* {
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #ffffff;
    --surface: rgba(255, 255, 255, 0.95);
    --surface-dark: rgba(255, 255, 255, 0.1);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 24px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --link-color: #8ed8ff;
    --link-hover-color: #c9f0ff;
    --link-visited-color: #b8c4ff;
    --trophy-toast-mobile-bottom: max(36px, calc(env(safe-area-inset-bottom, 0px) + 22px));
}

/* Stage: banner ospite fuori dal device (vista classica) + contenitore tamagotchi */
.game-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: min(420px, calc(100vw - 32px));
    max-height: 100dvh;
    padding: 16px;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guest-data-banner--outside {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 16px 20px;
    box-sizing: border-box;
    text-align: center;
    flex-shrink: 0;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.guest-data-banner--outside a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-base);
}

.guest-data-banner--outside a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.tamagotchi-container {
    position: relative;
    z-index: 1;
    width: min(380px, calc(100vw - 32px));
    padding: 40px 30px 36px;
    text-align: center;
    isolation: isolate;
    /* Colonna pulsanti destra: ordine verticale Status → Pet → Store → Trofei → Mailbox → Opzioni */
    --device-side-toggle-y-start: 86px;
    --device-side-toggle-gap: 52px;
    border-radius: var(--border-radius-xl);
    background:
        radial-gradient(circle at 28% 13%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 19%),
        radial-gradient(circle at 76% 19%, rgba(255, 205, 214, 0.5), rgba(255, 205, 214, 0) 22%),
        linear-gradient(155deg, #ff9aa6 0%, #ff6275 42%, #d93e59 100%);
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        inset 0 12px 24px rgba(255, 255, 255, 0.42),
        inset 12px 0 24px rgba(255, 255, 255, 0.12),
        inset 0 -28px 36px rgba(104, 19, 38, 0.32),
        0 14px 0 #a92f48,
        0 32px 64px rgba(23, 31, 49, 0.32),
        var(--shadow-lg);
    transition: var(--transition-base);
}

.tamagotchi-container:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 12px 24px rgba(255, 255, 255, 0.42),
        inset 12px 0 24px rgba(255, 255, 255, 0.12),
        inset 0 -28px 36px rgba(104, 19, 38, 0.32),
        0 14px 0 #a92f48,
        0 36px 72px rgba(23, 31, 49, 0.4),
        var(--shadow-lg);
}

.tamagotchi-container::before,
.tamagotchi-container::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.tamagotchi-container::before {
    inset: 18px 32px auto 42px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0));
}

.tamagotchi-container::after {
    left: 50%;
    bottom: 15px;
    width: 118px;
    height: 16px;
    transform: translateX(-50%);
    border-radius: 999px;
    background:
        repeating-linear-gradient(90deg, rgba(70, 28, 42, 0.55) 0 5px, transparent 5px 10px);
    opacity: 0.38;
}

.tamagotchi-container>* {
    position: relative;
    z-index: 2;
}

.device-aura {
    position: absolute;
    inset: -18px;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 64%);
    filter: blur(8px);
}

.device-brand {
    width: fit-content;
    margin: 0 auto 12px;
    padding: 8px 20px;
    border-radius: 999px;
    color: var(--text-light);
    background: var(--surface-dark);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: var(--transition-base);
    text-transform: uppercase;
}

.device-brand:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.device-top-info {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 16px;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    background: var(--surface-dark);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        0 8px 16px rgba(70, 20, 36, 0.2);
    color: rgb(18 18 18 / 0.95);
    backdrop-filter: blur(10px);
    transition: var(--transition-base);
}

.device-top-info:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.device-top-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-base);
}

.device-top-pill:hover {
    background: rgba(255, 255, 255, 0.2);
}

.device-top-icon {
    font-size: 0.9rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.device-top-divider {
    width: 2px;
    height: 16px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

.device-controls {
    position: absolute;
    right: 0;
    top: 15%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 4;
    /* Spaziatura verticale tra i pulsanti, corrispondente a --device-side-toggle-gap */
}

.device-lights {
    position: absolute;
    top: 56px;
    right: 46px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.device-lights span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f9d66b;
    box-shadow: 0 0 12px rgba(249, 214, 107, 0.8);
    transition: var(--transition-base);
    cursor: pointer;
}

.device-lights span:hover {
    transform: scale(1.2);
    box-shadow: 0 0 16px rgba(249, 214, 107, 1);
}

.device-lights span:nth-child(2) {
    background: #78e6bf;
    box-shadow: 0 0 12px rgba(120, 230, 191, 0.7);
}

.device-lights span:nth-child(2):hover {
    box-shadow: 0 0 16px rgba(120, 230, 191, 0.9);
}

.device-lights span:nth-child(3) {
    background: #8fd2ff;
    box-shadow: 0 0 12px rgba(143, 210, 255, 0.68);
}

.device-lights span:nth-child(3):hover {
    box-shadow: 0 0 16px rgba(143, 210, 255, 0.85);
}

.device-options-toggle,
.device-store-toggle,
.device-status-toggle,
.device-trophies-toggle,
.device-pets-toggle,
.device-mail-toggle,
.device-chat-toggle,
.device-hall-toggle {
    z-index: 4;
    width: 48px;
    height: 48px;
    border: 3px solid rgba(48, 32, 42, 0.82);
    border-radius: 50%;
    color: #36242d;
    display: grid;
    place-items: center;
    text-decoration: none;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #fff2a8, #f4bd42);
    box-shadow:
        inset 0 3px 6px rgba(255, 255, 255, 0.46),
        inset 0 -6px 9px rgba(114, 73, 22, 0.22),
        0 6px 0 rgba(74, 32, 42, 0.35),
        var(--shadow-md);
    font-family: system-ui, "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    transition: var(--transition-base);
    backdrop-filter: blur(4px);
}

.device-options-toggle:hover,
.device-store-toggle:hover,
.device-status-toggle:hover,
.device-trophies-toggle:hover,
.device-pets-toggle:hover,
.device-mail-toggle:hover,
.device-chat-toggle:hover,
.device-hall-toggle:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow:
        inset 0 3px 6px rgba(255, 255, 255, 0.56),
        inset 0 -6px 9px rgba(114, 73, 22, 0.28),
        0 8px 0 rgba(74, 32, 42, 0.45),
        var(--shadow-lg);
}

.device-options-toggle:focus,
.device-store-toggle:focus,
.device-status-toggle:focus,
.device-trophies-toggle:focus,
.device-pets-toggle:focus,
.device-mail-toggle:focus,
.device-chat-toggle:focus,
.device-hall-toggle:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow:
        inset 0 3px 6px rgba(255, 255, 255, 0.46),
        inset 0 -6px 9px rgba(114, 73, 22, 0.22),
        0 6px 0 rgba(74, 32, 42, 0.35),
        0 0 0 4px rgba(240, 147, 251, 0.3),
        var(--shadow-md);
}

.device-options-toggle {
    margin-top: 40px;
}

.device-store-toggle {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #baf3cf, #35c77a);
}

.device-status-toggle {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #bfe8ff, #5fb3f5);
}

.device-trophies-toggle {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #ffd8ef, #ee77b8);
}

.device-hall-toggle {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #d7cdfd, #9d7af0);
}

.device-pets-toggle {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #ffe0b8, #eea85d);
}

.device-mail-toggle {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #e6d6ff, #9b74f3);
}

.device-chat-toggle {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, #c9e7ff, #6eb8f7);
}

.device-options-toggle:active,
.device-store-toggle:active,
.device-status-toggle:active,
.device-trophies-toggle:active,
.device-pets-toggle:active,
.device-mail-toggle:active,
.device-chat-toggle:active,
.device-hall-toggle:active {
    transform: translateY(2px) scale(0.95);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.36),
        inset 0 -3px 5px rgba(114, 73, 22, 0.2),
        var(--shadow-sm);
}

/* Global Animations and Transitions */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth scroll behavior */
html {
    height: 100%;
    overflow: hidden;
    scroll-behavior: smooth;
}

/* Focus visible improvements */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --secondary-color: #660099;
        --accent-color: #ff0066;
        --text-primary: #000000;
        --text-secondary: #333333;
        --text-light: #ffffff;
    }
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    body {
        padding: 8px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
        align-items: flex-start;
        overflow: hidden;
    }

    .game-stage {
        width: calc(100vw - 16px);
        padding: 12px;
        gap: 12px;
    }

    .guest-data-banner--outside {
        padding: 12px 16px;
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .tamagotchi-container {
        width: calc(100vw - 16px);
        padding: 32px 24px 28px;
        border-radius: var(--border-radius-lg);
    }

    .device-brand {
        font-size: 0.75rem;
        padding: 6px 16px;
        margin: 0 auto 10px;
    }

    .device-top-info {
        padding: 8px 12px;
        gap: 8px;
        margin: 0 auto 12px;
    }

    .device-top-pill {
        font-size: 0.7rem;
        padding: 3px 6px;
        gap: 6px;
    }

    .device-top-icon {
        font-size: 0.8rem;
    }

    .device-lights {
        gap: 6px;
    }

    .device-lights span {
        width: 8px;
        height: 8px;
    }

    .device-options-toggle,
    .device-store-toggle,
    .device-status-toggle,
    .device-trophies-toggle,
    .device-pets-toggle,
    .device-mail-toggle,
    .device-chat-toggle,
    .device-hall-toggle {
        width: 44px;
        height: 44px;
        right: -14px;
        border-width: 2px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-stage {
        width: 100vw;
        padding: 8px;
        gap: 8px;
    }

    .tamagotchi-container {
        width: 100vw;
        padding: 28px 20px 24px;
        border-radius: var(--border-radius-md);
    }

    .device-brand {
        font-size: 0.7rem;
        padding: 5px 14px;
    }

    .device-top-info {
        padding: 6px 10px;
        gap: 6px;
    }

    .device-options-toggle,
    .device-store-toggle,
    .device-status-toggle,
    .device-trophies-toggle,
    .device-pets-toggle,
    .device-mail-toggle,
    .device-chat-toggle,
    .device-hall-toggle {
        width: 40px;
        height: 40px;
        right: -12px;
        font-size: 0.9rem;
    }
}

.device-side-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.device-side-toggle svg path {
    vector-effect: non-scaling-stroke;
}

.gotchi-name {
    max-width: 88%;
    margin: 0 auto 8px;
    padding: 6px 16px;
    display: inline-block;
    border: 2px solid rgba(48, 32, 42, 0.88);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 234, 239, 0.9));
    color: #38242d;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 8px rgba(70, 20, 36, 0.16);
    font-size: clamp(1.05rem, 4.4vw, 1.45rem);
    font-weight: 900;
    cursor: pointer;
}

.screen {
    position: relative;
    height: 260px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border: 12px solid #25282b;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 32%),
        #a2b29f;
    box-shadow:
        inset 0 0 14px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 7px 0 rgba(0, 0, 0, 0.28),
        0 14px 22px rgba(80, 19, 38, 0.22);
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

.screen.pet-switch-swipe-zone {
    touch-action: pan-x;
}

.screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 30%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, rgba(0, 0, 0, 0.022) 2px 4px);
    mix-blend-mode: soft-light;
}

.stats-bar {
    display: none;
    justify-content: space-around;
    min-height: 18px;
    color: #25332b;
    font-weight: 900;
    font-size: 0.86rem;
    transition: opacity 0.25s ease;
}

.screen.egg-mode .stats-bar,
.screen.egg-mode .health-bar {
    opacity: 0;
    visibility: hidden;
}

.hunger-stat-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.hunger-overflow-alert {
    position: absolute;
    left: calc(100% + 3px);
    top: 50%;
    transform: translateY(-50%);
    background: #c0392b;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    padding: 1px 4px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.01em;
}

@keyframes dot-overflow-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

.status-dots.overflow span {
    background: #c0392b !important;
    animation: dot-overflow-blink 0.55s ease-in-out infinite;
}

.status-dots.overflow span:nth-child(2) {
    animation-delay: 0.1s;
}

.status-dots.overflow span:nth-child(3) {
    animation-delay: 0.2s;
}

.care-panel {
    min-height: 46px;
    margin: 0 6px 10px;
    padding: 8px 11px;
    border-radius: 8px;
    background: rgba(230, 242, 220, 0.42);
    border: 1px solid rgba(37, 51, 43, 0.12);
    color: #25332b;
    text-align: left;
    transition: opacity 0.25s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.care-need {
    min-height: 18px;
    font-size: 0.78rem;
    font-weight: 950;
    line-height: 1.25;
}

.care-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
    font-size: 0.66rem;
    font-weight: 950;
}

.care-meta span {
    min-width: 0;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
    white-space: nowrap;
}

.affection-bar {
    display: inline-block;
    vertical-align: middle;
    width: 40px;
    height: 6px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 3px;
    overflow: hidden;
    margin-left: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.affection-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    height: 3px;
    border-radius: 3px !important;
    transition: width 0.35s ease, background-color 0.35s ease;
    padding: 0 !important;
    left: -5px;
    position: relative;
}

.screen.sleep-mode {
    background-color: #4f665f;
    box-shadow:
        inset 0 0 34px rgba(0, 0, 0, 0.72),
        0 7px 0 rgba(0, 0, 0, 0.28),
        0 14px 22px rgba(80, 19, 38, 0.22);
}

.screen.sleep-mode::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.28) 72%);
}

body:not(.meadow-mode) {
    background:
        radial-gradient(circle at 50% 14%, rgba(184, 205, 160, 0.14), rgba(184, 205, 160, 0) 26%),
        linear-gradient(180deg, #4b5550 0%, #232824 100%);
}

body:not(.meadow-mode) .guest-data-banner--outside {
    color: #182016;
    background: rgba(207, 220, 188, 0.94);
    border: 2px solid #111612;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.34);
    backdrop-filter: none;
}

body:not(.meadow-mode) .tamagotchi-container {
    margin-top: 100px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 14%),
        linear-gradient(180deg, #b8beb5 0%, #969d94 52%, #666d66 100%);
    border: 3px solid #141816;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.24),
        inset 0 -10px 18px rgba(0, 0, 0, 0.18),
        0 8px 0 #1d2220,
        0 24px 38px rgba(0, 0, 0, 0.28);
}

body.no-distractions-mode:not(.meadow-mode) .tamagotchi-container {
    margin-top: 50%;
}

body:not(.meadow-mode) .device-brand,
body:not(.meadow-mode) .device-lights,
body:not(.meadow-mode) .device-aura {
    filter: grayscale(1) contrast(1.15) brightness(0.88);
}

body:not(.meadow-mode) .screen {
    border-color: #111612;
    background:
        linear-gradient(180deg, rgba(224, 246, 200, 0.24), rgba(224, 246, 200, 0.02) 22%),
        linear-gradient(180deg, #b9d08e 0%, #98b36b 50%, #819958 100%);
    box-shadow:
        inset 0 0 0 2px rgba(15, 22, 13, 0.22),
        inset 0 0 24px rgba(31, 49, 24, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 7px 0 rgba(0, 0, 0, 0.36),
        0 14px 22px rgba(0, 0, 0, 0.14);
}

body:not(.meadow-mode) .screen::before {
    z-index: 4;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 16%),
        repeating-linear-gradient(0deg, rgba(12, 16, 11, 0.18) 0 1px, rgba(177, 206, 132, 0.04) 1px 4px),
        repeating-linear-gradient(90deg, rgba(17, 23, 14, 0.045) 0 2px, rgba(255, 255, 255, 0) 2px 8px);
    mix-blend-mode: multiply;
    opacity: 0.96;
}

body:not(.meadow-mode) .screen.sleep-mode {
    background:
        linear-gradient(180deg, rgba(208, 231, 178, 0.16), rgba(208, 231, 178, 0.02) 18%),
        linear-gradient(180deg, #91a56d 0%, #708254 100%);
    box-shadow:
        inset 0 0 0 2px rgba(15, 22, 13, 0.22),
        inset 0 0 34px rgba(0, 0, 0, 0.36),
        0 7px 0 rgba(0, 0, 0, 0.36),
        0 14px 22px rgba(0, 0, 0, 0.14);
}

body:not(.meadow-mode) .screen.sleep-mode::after {
    background: radial-gradient(circle at 50% 48%, rgba(222, 242, 190, 0.06), rgba(0, 0, 0, 0.18) 72%);
}

body:not(.meadow-mode) .stats-bar,
body:not(.meadow-mode) .care-panel,
body:not(.meadow-mode) .health-bar,
body:not(.meadow-mode) .gotchi-name,
body:not(.meadow-mode) .device-top-info {
    color: #101510;
    text-shadow: none;
}

body:not(.meadow-mode) .care-panel {
    background: rgba(202, 218, 170, 0.66);
    border: 2px solid rgba(16, 21, 16, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body:not(.meadow-mode) .care-meta span {
    color: #111612;
    background: rgba(176, 195, 140, 0.62);
    border: 1px solid rgba(17, 22, 17, 0.18);
}

body:not(.meadow-mode) .affection-bar {
    background: rgba(0, 0, 0, 0.24);
}

body:not(.meadow-mode) .affection-bar-fill,
body:not(.meadow-mode) #health-bar-fill {
    filter: grayscale(1) contrast(1.5) brightness(0.7);
}

body:not(.meadow-mode) #petCanvas {
    filter:
        grayscale(1) contrast(1.32) brightness(0.84) sepia(0.42) hue-rotate(28deg) saturate(0.58);
}

body:not(.meadow-mode) .btn,
body:not(.meadow-mode) .device-side-toggle {
    color: #eef4e8;
    background: linear-gradient(180deg, #717972, #4f5650) !important;
    border: 2px solid #121712;
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.22),
        inset 0 -4px 6px rgba(0, 0, 0, 0.2),
        0 4px 0 rgba(0, 0, 0, 0.34);
}

body:not(.meadow-mode) .btn-icon,
body:not(.meadow-mode) .device-side-toggle .toggle-glyph {
    color: #111612;
    background: rgba(210, 223, 195, 0.84);
}

body:not(.meadow-mode) .btn-label {
    color: #eef4e8;
}

.pet-sprite {
    font-size: 80px;
    margin: 20px 0;
    transition: transform 0.3s;
}

.pet-sprite.is-dead,
.pet-avatar.is-dead,
.pet-visual.is-dead {
    animation: none !important;
    transform: translateY(24px) rotate(85deg) scale(0.95);
    filter: grayscale(0.35) saturate(0.65) brightness(0.85);
    opacity: 0.9;
    transform-origin: center bottom;
}

.pet-area {
    position: relative;
    display: grid;
    place-items: center;
    flex: 1 1 auto;
    min-height: 0;
}

.pet-area.monitor-only {
    align-content: stretch;
}

#petCanvas {
    display: block;
    width: 100%;
    max-width: 252px;
    height: auto;
    margin: 0 auto;
    background: transparent;
    image-rendering: auto;
}

.pet-hit-zone {
    position: absolute;
    left: 50%;
    top: 54%;
    width: min(148px, 58%);
    height: min(128px, 68%);
    transform: translate(-50%, -50%);
    z-index: 4;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.pet-hit-zone:focus {
    outline: none;
}

.health-bar {
    display: none;
    width: 62px;
    height: 6px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background-color: rgba(40, 50, 42, 0.2);
}

.health-bar-fill {
    height: 100%;
    background-color: green;
    transition: width 0.3s ease;
}

.babysitting-monitor-card {
    width: min(100%, 270px);
    padding: 14px 14px 12px;
    border-radius: 14px;
    color: #203227;
    background: linear-gradient(180deg, rgba(250, 248, 239, 0.96), rgba(226, 238, 218, 0.94));
    border: 1px solid rgba(43, 72, 53, 0.16);
    box-shadow: 0 12px 24px rgba(35, 47, 40, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.babysitting-monitor-kicker {
    font-size: 0.63rem;
    font-weight: 1000;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4d6f57;
}

.babysitting-monitor-title {
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 1000;
}

.babysitting-monitor-lead {
    margin: 6px 0 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: rgba(32, 50, 39, 0.84);
}

.babysitting-monitor-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.babysitting-monitor-stat {
    padding: 8px 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(52, 78, 61, 0.1);
}

.babysitting-monitor-stat span {
    display: block;
    font-size: 0.67rem;
    font-weight: 900;
    color: rgba(51, 69, 57, 0.8);
}

.babysitting-monitor-stat strong {
    display: block;
    margin-top: 4px;
    font-size: 0.88rem;
    font-weight: 1000;
}

.babysitting-monitor-meta {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.babysitting-monitor-meta span {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(58, 84, 66, 0.08);
    font-size: 0.68rem;
    font-weight: 900;
    text-align: center;
}

.controls {
    margin-top: 14px;
}

.egg-wait-message {
    width: min(260px, 92%);
    min-height: 48px;
    margin: 0 auto;
    padding: 11px 14px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #f7f2df;
    background: rgba(46, 36, 49, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    font-size: 0.82rem;
    font-weight: 950;
    line-height: 1.25;
    text-align: center;
}

.egg-hatch-progress {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.egg-hatch-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.18s ease;
}

.egg-hatch-dot.done {
    background: #78e6bf;
    box-shadow: 0 0 6px rgba(120, 230, 191, 0.5);
}

@keyframes egg-tap-shake {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(-6deg) scale(1.06);
    }

    75% {
        transform: rotate(6deg) scale(1.06);
    }
}

.egg-tapping #petCanvas {
    animation: egg-tap-shake 0.18s ease-out;
}

#controls-alive,
#controls-dead {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

#controls-alive .action-overflowed {
    display: none;
}

.btn {
    position: relative;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1px;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    box-shadow:
        inset 0 3px 4px rgba(255, 255, 255, 0.36),
        inset 0 -5px 7px rgba(0, 0, 0, 0.18),
        0 4px 0 rgba(0, 0, 0, 0.32);
    transition: transform 0.1s, filter 0.16s ease, opacity 0.16s ease;
    touch-action: manipulation;
}

.btn-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: rgba(37, 24, 32, 0.78);
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 1000;
    line-height: 1;
}

.small-btn {
    font-size: 0.52rem;
}

.btn-icon svg,
.store-icon svg {
    width: 72%;
    height: 72%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-icon svg path,
.store-icon svg path {
    vector-effect: non-scaling-stroke;
}

.btn-label {
    max-width: 42px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.48rem;
    font-weight: 1000;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

#controls-alive>.pet-action .btn-label,
#controls-dead>.pet-action .btn-label,
#controls-alive>.btn-more-actions .btn-label {
    display: none;
}

.btn[data-tip]:not([data-tip=""])::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    z-index: 50;
    width: max-content;
    max-width: 190px;
    padding: 7px 9px;
    border-radius: 8px;
    color: #f7fbff;
    background: rgba(31, 36, 48, 0.96);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
    font-size: 0.68rem;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.btn[data-tip]:not([data-tip=""]):hover::after,
.btn[data-tip]:not([data-tip=""]):focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.btn:active {
    transform: translateY(4px);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.24),
        inset 0 -3px 5px rgba(0, 0, 0, 0.18);
}

.btn:hover {
    filter: brightness(1.05);
}

.btn:focus-visible {
    outline: 3px solid rgba(255, 223, 114, 0.95);
    outline-offset: 3px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    filter: none;
}

.btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.menu-action:disabled,
.menu-action[disabled],
.menu-action.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    filter: none;
}

.play-with-peer-row .btn:disabled,
.play-with-peer-row .btn[disabled],
.play-with-peer-row .btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    filter: none;
}

.btn-red {
    background: linear-gradient(180deg, #ff6472, #e5394e) !important;
}

.btn-blue {
    background: linear-gradient(180deg, #54b6ff, #1684e8) !important;
}

.btn-yellow {
    background: linear-gradient(180deg, #ffc859, #f39c12) !important;
}

.btn-green {
    background: linear-gradient(180deg, #57e58d, #20bf6b) !important;
}

.btn-purple {
    background: linear-gradient(180deg, #a66cff, #7d42ca) !important;
}

.btn-pink {
    background: linear-gradient(180deg, #ff85b8, #e84d88) !important;
}

.btn-cyan {
    background: linear-gradient(180deg, #55d8d0, #149eaa) !important;
}

.btn-drink {
    background: linear-gradient(180deg, #b57bff, #7c3aed) !important;
}

.btn-orange {
    background: linear-gradient(180deg, #ffad5b, #e87522) !important;
}

.btn-slate {
    background: linear-gradient(180deg, #7d8da1, #526173) !important;
}

/* Alias moderni (per uniformare gradualmente senza riscrivere markup) */
.btn-primary {
    background: linear-gradient(180deg, #54b6ff, #1684e8) !important;
}

.btn-secondary {
    background: linear-gradient(180deg, #7d8da1, #526173) !important;
}

.btn-danger {
    background: linear-gradient(180deg, #ff6472, #e5394e) !important;
}

.btn-success {
    background: linear-gradient(180deg, #57e58d, #20bf6b) !important;
}

.btn-warning {
    background: linear-gradient(180deg, #ffc859, #f39c12) !important;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.16);
}

.action-menu-grid {
    display: grid;
    gap: 10px;
}

.menu-action {
    min-height: 52px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-md);
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -4px 8px rgba(0, 0, 0, 0.2),
        0 6px 0 rgba(0, 0, 0, 0.3),
        var(--shadow-md);
    transition: var(--transition-base);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.3px;
}

.menu-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.menu-action:hover::before {
    left: 100%;
}

.menu-action.btn-treat {
    background: linear-gradient(135deg, #ff85b8, #e84d88);
    border-color: rgba(232, 77, 136, 0.4);
}

.menu-action.btn-work {
    background: linear-gradient(135deg, #55d8d0, #149eaa);
    border-color: rgba(20, 158, 170, 0.4);
}

.menu-action.btn-shop {
    background: linear-gradient(135deg, #ffad5b, #e87522);
    border-color: rgba(232, 117, 34, 0.4);
}

.menu-action.btn-drink {
    background: linear-gradient(135deg, #b57bff, #7c3aed);
    border-color: rgba(124, 58, 237, 0.4);
}

.menu-action:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        inset 0 3px 6px rgba(255, 255, 255, 0.4),
        inset 0 -6px 12px rgba(0, 0, 0, 0.25),
        0 8px 0 rgba(0, 0, 0, 0.35),
        var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.4);
}

.menu-action:active {
    transform: translateY(1px) scale(0.98);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -3px 6px rgba(0, 0, 0, 0.2),
        0 4px 0 rgba(0, 0, 0, 0.25),
        var(--shadow-sm);
}

.menu-action:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -4px 8px rgba(0, 0, 0, 0.2),
        0 6px 0 rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(240, 147, 251, 0.3),
        var(--shadow-md);
}

.menu-action:disabled,
.menu-action.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 2px 0 rgba(0, 0, 0, 0.2),
        var(--shadow-sm);
}

.menu-action:disabled:hover,
.menu-action.is-disabled:hover {
    transform: none;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 2px 0 rgba(0, 0, 0, 0.2),
        var(--shadow-sm);
}

.difficulty-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
    width: 100%;
}

.difficulty-strip button {
    min-height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: #ffeef2;
    background: rgba(108, 24, 48, 0.22);
    font-size: 0.64rem;
    font-weight: 950;
    cursor: pointer;
}

.difficulty-strip button.active {
    color: #3a2230;
    background: rgba(255, 255, 255, 0.82);
}

.options-modal-panel {
    position: relative;
    display: grid;
    gap: 14px;
    text-align: left;
}

.options-modal-panel h2,
.options-modal-panel p {
    text-align: center;
}

.has-modal-close {
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: #e8f2ff;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
}

.has-modal-close>.modal-close-btn,
.has-modal-close>.bug-report-close,
.has-modal-close>#cemetery-modal-close {
    position: sticky;
    top: 10px;
    right: auto;
    justify-self: end;
    align-self: start;
    margin: -6px -6px 6px 0;
    z-index: 6;
}

/* ── Options tabs ────────────────────────────────────────────────────────── */

.opts-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    padding: 4px;
}

.opts-tab {
    flex: 1;
    padding: 7px 4px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.opts-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
}

.opts-tab--active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.opts-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opts-pane--hidden {
    display: none;
}

/* ── Option blocks ───────────────────────────────────────────────────────── */

.option-block {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.option-title {
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 1000;
    text-transform: uppercase;
}

/* ── Night-config block ─────────────────────────────────────────────────── */

.night-config-block {
    background: rgba(30, 40, 70, 0.55);
    border-color: rgba(120, 160, 255, 0.22);
}

.night-config-lead {
    margin: 0 0 12px;
    color: #b8d0f8;
    font-size: 0.8rem;
    line-height: 1.4;
}

.night-config-selects {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.night-config-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.night-config-label {
    font-size: 0.78rem;
    color: #a0b8d8;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.night-config-arrow {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.35);
    padding-bottom: 6px;
    flex-shrink: 0;
    user-select: none;
}

.night-select {
    appearance: none;
    width: 100%;
    padding: 8px 32px 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(120, 160, 255, 0.30);
    background-color: #1a2240;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238ab0e0' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: #e8f0ff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.night-select option {
    background-color: #1a2240;
    color: #e8f0ff;
}

.night-select:focus {
    outline: none;
    border-color: rgba(120, 180, 255, 0.70);
    background-color: #1e2a50;
}

.night-select:hover {
    border-color: rgba(120, 180, 255, 0.50);
    background-color: #1e2a50;
}

.night-duration-note {
    display: block;
    margin: 0 0 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #cfe0f3;
    font-size: 0.78rem;
    font-weight: 700;
    min-height: 28px;
    line-height: 1.35;
}

.night-tz-note {
    display: block;
    margin: 0 0 10px;
    color: rgba(160, 185, 220, 0.70);
    font-size: 0.74rem;
    font-style: italic;
    line-height: 1.3;
}

.night-save-btn {
    width: 100%;
}

#safe-time-rest-note {
    margin-top: 10px;
    text-align: center;
}

/* ─────────────────────────────────────────────────────────────────────────── */

.option-title-with-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.option-help-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.86rem;
    font-weight: 1000;
    cursor: pointer;
}

.option-inline-note {
    display: inline-block;
    margin: 10px 0 0 !important;
    color: #cfe0f3;
    font-size: 0.76rem;
    font-weight: 860;
    line-height: 1.35;
}

.option-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.option-toggle-row+.option-toggle-row {
    margin-top: 10px;
}

.option-toggle-copy {
    display: grid;
    gap: 3px;
    text-align: left;
}

.option-toggle-copy strong {
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 900;
    text-align: left;
}

.option-toggle-copy small {
    color: #cfe0f3;
    font-size: 0.75rem;
    font-weight: 760;
    line-height: 1.3;
    text-align: left;
}

.option-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-toggle-pill {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: background 140ms ease, border-color 140ms ease;
}

.option-toggle-pill::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f7fbff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
    transition: transform 140ms ease;
}

.option-toggle-input:checked+.option-toggle-pill {
    background: linear-gradient(180deg, #d8f7d8, #84d98a);
    border-color: rgba(132, 217, 138, 0.72);
}

.option-toggle-input:checked+.option-toggle-pill::after {
    transform: translateX(20px);
}

.option-toggle-input:focus-visible+.option-toggle-pill {
    outline: 2px solid rgba(201, 240, 255, 0.9);
    outline-offset: 2px;
}

.option-toggle-input:disabled+.option-toggle-pill {
    opacity: 0.55;
}

.view-toggle-btn {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    color: #172133;
    background: linear-gradient(180deg, #d8f7d8, #84d98a);
    font-weight: 1000;
    cursor: pointer;
}

.restore-ui-btn {
    position: fixed;
    top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
    right: max(12px, calc(env(safe-area-inset-right, 0px) + 8px));
    z-index: 1200;
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(17, 28, 38, 0.84);
    color: #f7fbff;
    box-shadow: 0 10px 24px rgba(5, 10, 20, 0.22);
    backdrop-filter: blur(10px);
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}

.restore-ui-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.restore-ui-btn__icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.no-distractions-mode .restore-ui-btn {
    display: inline-flex;
}

body.no-distractions-mode .guest-data-banner--outside,
body.no-distractions-mode .device-aura,
body.no-distractions-mode .device-brand,
body.no-distractions-mode .device-top-info,
body.no-distractions-mode .device-controls,
body.no-distractions-mode .gotchi-name,
body.no-distractions-mode .care-panel,
body.no-distractions-mode .legal-footer,
body.no-distractions-mode #kofi-widget-overlay {
    display: none !important;
}

body.no-distractions-mode .tamagotchi-container::before,
body.no-distractions-mode .tamagotchi-container::after {
    display: none;
}

body.no-distractions-mode .game-stage {
    gap: 0;
    padding: 12px;
}

body.no-distractions-mode .tamagotchi-container {
    width: min(420px, calc(100vw - 24px));
    padding: 16px 14px 20px;
}

body.no-distractions-mode .tamagotchi-container:hover {
    transform: none;
}

body.no-distractions-mode .controls {
    margin-top: 10px;
}

body.no-distractions-mode .screen {
    margin-top: 0;
}

body.no-distractions-mode .modal-reconnection {
    z-index: 6;
}

@media (max-width: 480px) {
    .restore-ui-btn {
        min-height: 40px;
        padding: 0 12px;
        gap: 8px;
        font-size: 0.76rem;
    }
}

body.meadow-mode {
    align-items: center;
    justify-content: center;
    padding:
        max(6px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
}

body.meadow-mode .game-stage {
    width: min(820px, calc(100vw - 12px));
    height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px)));
    max-height: none;
    min-height: 0;
    overflow: visible;
    gap: 6px;
    padding: 0;
}

body.meadow-mode .guest-data-banner--outside {
    padding: 6px 10px;
    margin-right: 57px;
    font-size: 0.72rem;
    line-height: 1.3;
    top: 15.2%;
    position: absolute;
    left: 11px;
}

body.meadow-mode .tamagotchi-container {
    width: 100%;
    height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px)));
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin: 0 auto;
    --device-side-toggle-y-start: 76px;
    --device-side-toggle-gap: 44px;
    padding: max(10px, env(safe-area-inset-top + 140px, 0px)) max(12px, env(safe-area-inset-right + 140px, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    box-sizing: border-box;
}

body.meadow-mode .tamagotchi-container:hover {
    transform: none;
    box-shadow: none;
}

body.meadow-mode .device-aura,
body.meadow-mode .device-brand,
body.meadow-mode .device-lights,
body.meadow-mode .tamagotchi-container::before,
body.meadow-mode .tamagotchi-container::after {
    display: none;
}

body.meadow-mode .screen {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    isolation: isolate;
}

body.meadow-mode .screen::before {
    display: none;
}

body.meadow-mode .screen.sleep-mode {
    background: transparent;
    box-shadow: none;
}

body.meadow-mode .screen.sleep-mode::after {
    inset: -24px;
    border-radius: 0;
    background: radial-gradient(circle at 50% 52%, rgba(2, 8, 18, 0), rgba(2, 8, 18, 0.34) 78%);
}

body.meadow-mode .pet-area {
    position: absolute;
    inset: clamp(72px, 12vh, 118px) 0 clamp(82px, 15vh, 132px);
    display: grid;
    place-items: end center;
    overflow: visible;
    pointer-events: none;
}

body.meadow-mode .pet-hit-zone {
    pointer-events: auto;
    top: 58%;
    width: min(164px, 42vw);
    height: min(144px, 28vh);
}

body.meadow-mode .pet-area::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: clamp(10px, 3.2vh, 30px);
    width: min(620px, 92vw);
    height: clamp(98px, 20vh, 168px);
    transform: translateX(-50%);
    z-index: -1;
    border-radius: 52% 48% 38% 42% / 58% 58% 32% 32%;
    background:
        radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 28%),
        radial-gradient(ellipse at 22% 42%, rgba(154, 211, 105, 0.72), rgba(154, 211, 105, 0) 34%),
        radial-gradient(ellipse at 78% 52%, rgba(88, 170, 101, 0.72), rgba(88, 170, 101, 0) 36%),
        linear-gradient(180deg, #7fc85d 0%, #479850 48%, #2f703f 100%);
    box-shadow:
        inset 0 10px 18px rgba(255, 255, 255, 0.22),
        inset 0 -18px 24px rgba(21, 75, 35, 0.28),
        0 18px 36px rgba(10, 35, 22, 0.28);
}

body.meadow-mode .pet-area::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: clamp(16px, 4.2vh, 42px);
    width: min(560px, 84vw);
    height: clamp(38px, 7vh, 64px);
    transform: translateX(-50%);
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(35, 57, 32, 0.28), rgba(35, 57, 32, 0) 62%),
        repeating-linear-gradient(102deg, rgba(238, 248, 190, 0.2) 0 2px, rgba(238, 248, 190, 0) 2px 13px);
    mix-blend-mode: multiply;
}

body.meadow-mode #petCanvas {
    position: relative;
    z-index: 1;
    max-width: min(420px, 78vw);
    width: min(420px, 78vw);
    filter: drop-shadow(0 20px 18px rgba(12, 32, 20, 0.2));
}

body.meadow-mode .stats-bar,
body.meadow-mode .health-bar {
    display: none;
}

body.meadow-mode .device-top-info,
body.meadow-mode .gotchi-name,
body.meadow-mode .care-panel,
body.meadow-mode .controls {
    position: relative;
    z-index: 6;
}

body.meadow-mode .device-top-info {
    position: absolute;
    top: max(72px, env(safe-area-inset-top, 0px));
    right: max(5px, env(safe-area-inset-right, 0px));
    left: auto;
    width: auto;
    max-width: calc(100vw - 132px);
    min-height: 34px;
    padding: 6px 8px;
    gap: 6px;
    border-radius: 999px;
    color: #f7fbff;
    background: rgba(20, 33, 38, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: 0 10px 24px rgba(8, 20, 24, 0.18);
    backdrop-filter: blur(8px);
}

body.meadow-mode .device-top-pill {
    padding: 0;
    font-size: 0.72rem;
    color: inherit;
    background: transparent;
    box-shadow: none;
}

body.meadow-mode .device-top-divider {
    background: rgba(255, 255, 255, 0.34);
}

body.meadow-mode .gotchi-name {
    position: absolute;
    top: max(30px, env(safe-area-inset-top, 0px));
    left: max(5px, env(safe-area-inset-left, 0px));
    max-width: min(210px, 42vw);
    margin: 0;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: #f8fff5;
    background: rgba(22, 45, 31, 0.48);
    box-shadow: 0 10px 22px rgba(7, 22, 12, 0.18);
    backdrop-filter: blur(8px);
    font-size: clamp(0.9rem, 3.2vw, 1.16rem);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

body.meadow-mode .care-panel {
    position: absolute;
    left: 45%;
    bottom: clamp(26px, 12vh, 84px);
    width: min(390px, calc(100vw - 110px));
    min-height: 0;
    margin: 0;
    padding: 8px 11px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #f4fff3;
    background: rgba(20, 47, 30, 0.44);
    box-shadow: 0 12px 26px rgba(6, 20, 12, 0.18);
    backdrop-filter: blur(8px);
}

body.meadow-mode .care-meta span {
    color: #efffea;
    background: rgba(255, 255, 255, 0.16);
}

body.meadow-mode .affection-bar {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

body.meadow-mode .controls {
    position: absolute;
    left: 50%;
    bottom: max(155px, env(safe-area-inset-bottom, 142px));
    margin: 0;
    transform: translateX(-50%);
    padding: 6px 8px;
    border-radius: 18px;
    background: rgba(16, 31, 27, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 24px rgba(7, 18, 18, 0.16);
    backdrop-filter: blur(8px);
}

body.meadow-mode #controls-alive,
body.meadow-mode #controls-dead {
    gap: 7px;
}

body.meadow-mode #controls-alive .btn,
body.meadow-mode #controls-dead .btn {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    border-radius: 14px;
}

/* Pulsanti laterali dentro il contenitore (evita overflow orizzontale su telefono) */
body.meadow-mode .device-side-toggle {
    right: max(10px, env(safe-area-inset-right, 0px));
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.36);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%),
        rgba(18, 39, 39, 0.48);
    box-shadow: 0 9px 20px rgba(5, 18, 18, 0.18);
    backdrop-filter: blur(8px);
}

body.meadow-mode .device-status-toggle {
    top: max(110px, calc(env(safe-area-inset-top, 0px) + 108px));
}

body.meadow-mode .device-pets-toggle {
    top: max(156px, calc(env(safe-area-inset-top, 0px) + 154px));
}

body.meadow-mode .device-store-toggle {
    top: max(202px, calc(env(safe-area-inset-top, 0px) + 200px));
}

body.meadow-mode .device-trophies-toggle {
    top: max(248px, calc(env(safe-area-inset-top, 0px) + 246px));
}

body.meadow-mode .device-mail-toggle {
    top: max(294px, calc(env(safe-area-inset-top, 0px) + 292px));
}

body.meadow-mode .device-options-toggle {
    top: auto;
    bottom: max(103px, calc(env(safe-area-inset-bottom, 0px) + 101px));
}

body.meadow-mode .modal-reconnection {
    inset: clamp(78px, 12vh, 120px) 16px clamp(86px, 15vh, 132px);
    border-radius: 24px;
    background: rgba(12, 24, 22, 0.68);
    backdrop-filter: blur(10px);
}

body.meadow-mode.no-distractions-mode .game-stage {
    width: 100%;
    max-width: none;
    padding: 8px;
}

body.meadow-mode.no-distractions-mode .tamagotchi-container {
    padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
}

body.meadow-mode.no-distractions-mode .pet-area {
    inset: clamp(28px, 7vh, 72px) 0 clamp(92px, 16vh, 138px);
}

body.meadow-mode.no-distractions-mode .controls {
    margin-top: 0;
}

@media (max-width: 480px) {
    body.meadow-mode .game-stage {
        width: 100vw;
    }

    body.meadow-mode .tamagotchi-container {
        height: 100dvh;
        padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    }

    body.meadow-mode .device-top-info {
        top: max(72px, env(safe-area-inset-top, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        max-width: calc(100vw - 118px);
        padding: 5px 7px;
    }

    body.meadow-mode .device-top-pill {
        font-size: 0.64rem;
    }

    body.meadow-mode .gotchi-name {
        top: max(30px, env(safe-area-inset-top, 0px));
        left: max(8px, env(safe-area-inset-left, 0px));
        max-width: 105px;
        padding: 6px 9px;
    }

    body.meadow-mode .pet-area {
        inset: 70px 0 130px;
    }

    body.meadow-mode .pet-area::before {
        width: 104vw;
        height: clamp(100px, 19vh, 142px);
    }

    body.meadow-mode #petCanvas {
        width: min(360px, 82vw);
        max-width: min(360px, 82vw);
    }

    body.meadow-mode .care-panel {
        bottom: max(74px, calc(env(safe-area-inset-bottom, 0px) + 72px));
        width: calc(100vw - 92px);
        padding: 7px 9px;
    }

    body.meadow-mode .care-need {
        font-size: 0.72rem;
    }

    body.meadow-mode .care-meta {
        gap: 4px;
        font-size: 0.6rem;
    }

    body.meadow-mode .device-side-toggle {
        width: 34px;
        height: 34px;
        right: max(7px, env(safe-area-inset-right, 0px));
        border-radius: 12px;
    }

    body.meadow-mode .device-side-toggle svg {
        width: 19px;
        height: 19px;
    }
}

@media (max-height: 700px) {
    body.meadow-mode .pet-area {
        inset: 58px 0 114px;
    }

    body.meadow-mode .care-panel {
        bottom: max(64px, calc(env(safe-area-inset-bottom, 0px) + 62px));
    }

    body.meadow-mode #controls-alive .btn,
    body.meadow-mode #controls-dead .btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
    }
}

.command-guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.command-guide span {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #eaf4ff;
    background: rgba(255, 255, 255, 0.09);
    font-size: 0.78rem;
    font-weight: 850;
}

.command-guide b {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #172133;
    background: rgba(255, 255, 255, 0.86);
    font-size: 0.72rem;
}

.status-modal-panel,
.trophies-modal-panel,
.pets-modal-panel,
.chat-modal-panel {
    max-height: min(78vh, 560px);
    overflow: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chat-modal-intro {
    margin: 0 0 10px;
    font-size: 0.82rem;
}

.chat-messages {
    max-height: min(42vh, 360px);
    overflow-y: auto;
    margin: 0 0 12px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-hint {
    margin: 0;
    padding: 10px;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.82);
}

.chat-hint.error {
    color: #ffb4a8;
}

.chat-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-row:last-child {
    border-bottom: none;
}

.chat-row-avatar {
    flex: 0 0 auto;
}

.chat-avatar-img,
.chat-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: #1a1a1a;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.chat-row-body {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 850;
    color: rgba(255, 255, 255, 0.88);
}

.chat-row-who {
    font-weight: 950;
}

.chat-row-time {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.68rem;
}

.chat-row-text {
    font-size: 0.88rem;
    line-height: 1.35;
    color: #f4f8ff;
    word-break: break-word;
}

.chat-compose {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input {
    width: 100%;
    min-height: 56px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.chat-send-btn {
    align-self: flex-end;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 10px;
}

#chat-modal.app-modal {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

@media (max-width: 520px) {
    #chat-modal.app-modal {
        place-items: end center;
        padding: 0;
        align-content: end;
    }

    #chat-modal .chat-modal-panel {
        width: 100%;
        max-width: 100%;
        max-height: min(92dvh, 100vh);
        margin: 0;
        border-radius: 20px 20px 0 0;
        padding: 20px 16px max(16px, env(safe-area-inset-bottom, 0px));
    }

    .chat-messages {
        max-height: min(52dvh, 420px);
        min-height: 140px;
    }

    .chat-send-btn {
        align-self: stretch;
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
        font-weight: 800;
    }

    .chat-input {
        font-size: 1rem;
        min-height: 52px;
    }
}

.profilo-next-banner {
    margin: 0 0 12px;
    text-align: center;
    font-weight: 750;
}

.profilo-logout-banner {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(46, 125, 107, 0.14);
    border: 1px solid rgba(46, 125, 107, 0.28);
    text-align: center;
    font-weight: 700;
    line-height: 1.45;
}

.session-choice-panel {
    max-width: 400px;
}

.session-choice-lead {
    margin: 0 0 14px;
    color: #dce8f4;
    font-weight: 750;
    line-height: 1.45;
    text-align: center;
}

.session-choice-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.session-choice-actions .btn {
    text-align: center;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    box-sizing: border-box;
}

.session-choice-note {
    margin: 14px 0 0;
    font-size: 0.82rem;
    text-align: center;
}

.session-choice-oauth-off {
    margin: 0;
    font-size: 0.86rem;
    text-align: center;
}

.chat-send-error {
    margin: 4px 0 0;
    min-height: 1.2em;
    font-size: 0.82rem;
    color: #ffb4a8;
}

.status-grid {
    display: grid;
    gap: 8px;
}

.status-modal-panel {
    display: grid;
    gap: 10px;
}

.status-info-card {
    display: grid;
    gap: 7px;
    padding: 10px;
    border-radius: 12px;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.status-info-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(72px, auto) 1fr;
    gap: 10px;
    align-items: baseline;
    text-align: left;
}

.status-info-row span {
    color: #cfe0f3;
    font-size: 0.68rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.status-info-row strong {
    min-width: 0;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 950;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.status-row {
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #f4f8ff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 950;
}

.status-dots {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.status-world-card {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    color: #f7fbff;
    background:
        linear-gradient(180deg, rgba(158, 221, 255, 0.12), rgba(255, 255, 255, 0.05)),
        rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.status-world-open {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: 10px;
}

.status-world-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.status-world-head span {
    color: #cfe0f3;
    font-size: 0.68rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.status-world-head strong {
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 950;
    text-align: right;
}

.status-world-map {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(7, 18, 34, 0.42);
}

.status-world-open:focus-visible,
.world-map-stage:focus-visible {
    outline: 2px solid rgba(201, 240, 255, 0.9);
    outline-offset: 2px;
}

.status-world-caption {
    margin: 0;
    color: rgba(247, 251, 255, 0.82);
    font-size: 0.76rem;
    font-weight: 760;
    line-height: 1.35;
}

.status-name-history {
    display: grid;
    gap: 8px;
}

.status-history-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    text-align: left;
}

.status-history-title {
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.status-history-list {
    display: grid;
    gap: 7px;
}

.status-history-item,
.status-history-empty {
    padding: 8px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-history-item strong,
.status-history-item small,
.status-history-empty {
    display: block;
}

.status-history-item strong {
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 930;
    line-height: 1.25;
}

.status-history-item small,
.status-history-empty {
    margin-top: 4px;
    color: #cfe0f3;
    font-size: 0.72rem;
    font-weight: 820;
}

.world-map-screen {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background:
        radial-gradient(circle at 30% 18%, rgba(88, 170, 255, 0.18), rgba(88, 170, 255, 0) 28%),
        radial-gradient(circle at 72% 82%, rgba(112, 214, 255, 0.14), rgba(112, 214, 255, 0) 26%),
        linear-gradient(180deg, #081521 0%, #0b1d2c 100%);
    overflow: hidden;
}

.world-map-overlay {
    position: absolute;
    top: max(18px, env(safe-area-inset-top, 0px));
    left: max(18px, env(safe-area-inset-left, 0px));
    right: max(78px, calc(env(safe-area-inset-right, 0px) + 78px));
    z-index: 2;
    pointer-events: none;
    padding-right: 68px;
}

.world-map-overlay h2,
.world-map-overlay p {
    margin: 0;
    color: rgba(247, 251, 255, 0.96);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.world-map-overlay h2 {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 950;
}

.world-map-overlay p {
    margin-top: 6px;
    max-width: min(560px, 80vw);
}

.world-map-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: rgba(8, 21, 33, 0.48);
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
    pointer-events: auto;
}

.world-map-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    display: grid;
    place-items: center;
}

.world-map-viewport {
    transform-origin: center center;
    will-change: transform;
    display: grid;
    place-items: center;
}

.world-map-canvas-large {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 720px) {
    .world-map-overlay {
        top: max(14px, env(safe-area-inset-top, 0px));
        left: max(14px, env(safe-area-inset-left, 0px));
        right: max(70px, calc(env(safe-area-inset-right, 0px) + 70px));
        padding-right: 62px;
    }

    .world-map-close {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }

    .world-map-overlay p {
        max-width: 70vw;
    }
}

.status-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.status-dots span.filled {
    background: #f9d66b;
    box-shadow: 0 0 10px rgba(249, 214, 107, 0.32);
}

.status-1 .status-dots span.filled {
    background: #ff7f8f;
}

.status-3 .status-dots span.filled {
    background: #78e6bf;
}

.pet-trophies-grid {
    display: grid;
    gap: 9px;
}

.pet-trophy,
.pet-trophy-empty {
    min-height: 64px;
    padding: 9px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    text-align: left;
}

.pet-trophy-empty {
    display: block;
    min-height: 0;
    color: #cfe0f3;
    font-size: 0.82rem;
    font-weight: 900;
}

.pet-trophy .trophy-emblem {
    width: 44px;
    height: 44px;
    font-size: 0.62rem;
}

.pet-trophy strong {
    display: block;
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1.15;
}

.pet-trophy small {
    display: block;
    margin-top: 3px;
    color: #cfe0f3;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25;
}

.pet-list-actions {
    display: grid;
}

.pet-list-actions button {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    color: #172133;
    background: linear-gradient(180deg, #dfffea, #78e6bf);
    font-size: 0.78rem;
    font-weight: 1000;
    cursor: pointer;
}

.pet-list-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pet-list-section {
    display: grid;
    gap: 8px;
}

.pet-list {
    display: grid;
    gap: 8px;
}

.pet-list-item,
.pet-list-empty {
    min-height: 48px;
    padding: 9px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    text-align: left;
}

.pet-list-item {
    cursor: pointer;
}

.pet-list-item.active {
    border-color: rgba(120, 230, 191, 0.5);
    background: rgba(120, 230, 191, 0.16);
}

.pet-list-item span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 1000;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-list-item small,
.pet-list-empty {
    color: #cfe0f3;
    font-size: 0.68rem;
    font-weight: 900;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.store-modal-panel {
    position: relative;
}

.store-modal-loading {
    display: none;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: #f7fbff;
    text-align: center;
}

.store-modal-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.95);
    animation: storeSpinner 0.7s linear infinite;
}

@keyframes storeSpinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.store-modal-content {
    transition: opacity 0.18s ease;
}

.store-modal-panel.store-modal-panel--opening .store-modal-loading {
    display: flex;
}

.store-modal-panel.store-modal-panel--opening .store-modal-content {
    opacity: 0;
    pointer-events: none;
    user-select: none;
    visibility: hidden;
}

.store-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.store-tab {
    min-height: 38px;
    border: 0;
    border-radius: 999px;
    color: rgba(247, 251, 255, 0.82);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.76rem;
    font-weight: 980;
    cursor: pointer;
}

.store-tab.active {
    color: #102237;
    background: linear-gradient(180deg, #ffffff, #dce8f4);
}

.store-panel.hidden {
    display: none;
}

.store-feedback {
    min-height: 30px;
    margin: -4px 0 12px;
    padding: 7px 10px;
    border-radius: 8px;
    color: #dce8f4;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    font-weight: 900;
}

.store-feedback:empty {
    display: none;
}

.store-feedback.success {
    color: #dfffea;
    background: rgba(32, 191, 107, 0.2);
    border-color: rgba(120, 230, 191, 0.38);
}

.store-feedback.error {
    color: #ffe4e9;
    background: rgba(229, 57, 78, 0.18);
    border-color: rgba(255, 100, 114, 0.38);
}

.store-feedback.info {
    color: #dce8f4;
    background: rgba(93, 195, 255, 0.16);
    border-color: rgba(150, 213, 255, 0.34);
}

.emergency-medicine {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 8px;
    color: #eff8ff;
    background: rgba(120, 230, 191, 0.13);
    border: 1px solid rgba(120, 230, 191, 0.28);
    text-align: left;
}

.emergency-medicine b,
.inventory-title {
    display: block;
    margin-bottom: 3px;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.emergency-medicine span {
    display: block;
    color: #cfe0f3;
    font-size: 0.76rem;
    font-weight: 850;
    line-height: 1.25;
}

.emergency-medicine button {
    min-height: 36px;
    border: 0;
    border-radius: 999px;
    padding: 0 12px;
    color: #102237;
    background: linear-gradient(180deg, #dfffea, #78e6bf);
    font-size: 0.72rem;
    font-weight: 1000;
    cursor: pointer;
}

.emergency-medicine button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.store-guided-target {
    border-color: rgba(255, 232, 133, 0.92) !important;
    box-shadow:
        0 0 0 3px rgba(255, 232, 133, 0.22),
        0 0 22px rgba(255, 232, 133, 0.34);
    animation: storeGuidePulse 0.95s ease-in-out 4;
}

.inventory-panel {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 7px;
}

.inventory-grid span {
    min-width: 0;
    padding: 7px 4px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    gap: 2px;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.09);
}

.inventory-grid b {
    font-size: 1rem;
    line-height: 1;
}

.inventory-grid small {
    max-width: 100%;
    overflow: hidden;
    color: #cfe0f3;
    font-size: 0.58rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-item {
    position: relative;
    min-height: 96px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 10px;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.09);
    cursor: pointer;
    transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.store-count {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: #172133;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    font-weight: 1000;
    line-height: 1;
}

.store-count.store-badge {
    top: 8px;
    left: 8px;
    right: auto;
    min-width: 0;
    padding: 0 8px;
}

.store-item:disabled {
    cursor: wait;
}

.store-item.store-owned:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.store-item.store-locked {
    border-color: rgba(255, 214, 102, 0.4);
    background: rgba(255, 214, 102, 0.12);
}

.store-item.store-item--hidden {
    display: none;
}

.store-item.store-locked .store-meta {
    color: #ffe08a;
}

.store-item.store-buying {
    transform: translateY(2px) scale(0.98);
    opacity: 0.78;
}

.store-item.store-success {
    border-color: rgba(120, 230, 191, 0.62);
    background: rgba(32, 191, 107, 0.22);
    animation: storePop 0.36s ease;
}

.store-item.store-error {
    border-color: rgba(255, 100, 114, 0.58);
    background: rgba(229, 57, 78, 0.2);
    animation: storeShake 0.3s ease;
}

.store-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #172133;
    background: rgba(255, 255, 255, 0.88);
    font-weight: 1000;
}

.store-item b {
    font-size: 0.82rem;
}

.store-item small {
    color: #cfe0f3;
    font-weight: 850;
}

.store-item p {
    margin: 0;
    color: #dce8f4;
    font-size: 0.68rem;
    font-weight: 820;
    line-height: 1.3;
    text-align: center;
}

@keyframes storePop {
    50% {
        transform: scale(1.04);
    }
}

@keyframes storeShake {
    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-2px);
    }
}

@keyframes storeGuidePulse {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-2px) scale(1.035);
    }
}

.minigame-panel {
    position: relative;
    min-height: 330px;
    overflow: hidden;
}

.minigame-target {
    position: absolute;
    left: 50%;
    top: 58%;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    color: #172133;
    background: linear-gradient(180deg, #ffdf72, #f0a928);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.45),
        0 8px 0 rgba(0, 0, 0, 0.22);
    font-size: 1.2rem;
    font-weight: 1000;
    transform: translate(-50%, -50%);
    transition: left 0.16s ease, top 0.16s ease, transform 0.1s ease;
    cursor: pointer;
}

.minigame-work-zone {
    position: absolute;
    left: 18%;
    right: 18%;
    top: 41%;
    height: 126px;
    border-radius: 14px;
    background:
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0 38px, rgba(255, 255, 255, 0.02) 38px 42px),
        rgba(120, 230, 191, 0.12);
    border: 1px solid rgba(120, 230, 191, 0.35);
    box-shadow:
        0 0 20px rgba(120, 230, 191, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    pointer-events: none;
}

.minigame-work-mode .minigame-target {
    width: 48px;
    height: 48px;
    color: #f7fbff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #3edbd3, #098fa1);
}

.minigame-target:active {
    transform: translate(-50%, -45%) scale(0.96);
}

.minigame-progress {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 22px;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.minigame-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #78e6bf, #f9d66b);
    transition: width 0.14s ease;
}

.modal-reconnection {
    position: absolute;
    inset: 0;
    background: rgba(18, 28, 22, 0.82);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 100;
    border-radius: inherit;
    text-align: center;
    padding: 16px;
}

.modal-reconnection-text {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    color: #c8e8d5;
    line-height: 1.35;
}

.modal-reconnection-retry {
    font-size: 0.66rem;
    font-weight: 900;
    padding: 5px 12px;
    border-radius: 6px;
    background: #78e6bf;
    color: #122018;
    border: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.modal-reconnection-retry:active {
    transform: translateY(1px);
    box-shadow: none;
}

body.ws-controls-blocked #controls-alive .pet-action,
body.ws-controls-blocked #controls-alive .btn-more-actions,
body.ws-controls-blocked .device-side-toggle {
    display: none !important;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(13, 18, 30, 0.75);
    backdrop-filter: blur(12px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

#app-modal {
    z-index: 240000;
}

.app-modal-panel {
    width: min(380px, 100%);
    padding: 28px;
    border-radius: var(--border-radius-xl);
    border: 2px solid rgba(255, 255, 255, 0.25);
    background:
        radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 30%),
        linear-gradient(155deg, #2a3f5f 0%, #1a2942 58%, #0f1929 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -20px 30px rgba(0, 0, 0, 0.3),
        0 24px 52px rgba(5, 10, 20, 0.5),
        var(--shadow-lg);
    color: var(--text-light);
    text-align: center;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 95vh;
    overflow: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-modal-panel h2 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: #ffffff;
}

.app-modal-panel p {
    margin: 0 0 18px;
    color: #dce8f4;
    font-weight: 750;
    line-height: 1.4;
}

.onboarding-panel {
    width: min(420px, 100%);
}

.onboarding-body {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    text-align: left;
    color: #dce8f4;
    font-weight: 800;
    line-height: 1.35;
}

.onboarding-step-title {
    font-weight: 950;
    color: #ffffff;
    margin-bottom: 2px;
}

.onboarding-bullets {
    margin: 0;
    padding-left: 18px;
}

.onboarding-bullets li {
    margin: 4px 0;
}

#first-pet-cta {
    display: grid;
    justify-items: center;
    margin: 6px 0 10px;
}

.app-modal-input {
    width: 100%;
    height: 52px;
    margin-bottom: 20px;
    padding: 0 18px;
    border: 2px solid rgba(133, 190, 255, 0.4);
    border-radius: var(--border-radius-lg);
    outline: none;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition-base);
    backdrop-filter: blur(4px);
}

.app-modal-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.app-modal-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.app-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.app-modal-btn {
    min-height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    color: var(--text-light);
    display: grid;
    place-items: center;
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: stretch;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -4px 8px rgba(0, 0, 0, 0.2),
        0 6px 0 rgba(0, 0, 0, 0.3),
        var(--shadow-md);
    transition: var(--transition-base);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.3px;
}

.app-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.app-modal-btn:hover::before {
    left: 100%;
}

.app-modal-btn.primary {
    color: #fff;
    background: linear-gradient(180deg, #5dc3ff, #1979d8);
}

.app-modal-btn.secondary {
    color: #e8f2ff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.version {
    position: fixed;
    bottom: 10px;
    right: 10px;
    color: #333;
    font-size: 0.8em;
    text-align: right;
    z-index: -1;
}

.trophy-toast-stack {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 10000;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 28px));
    pointer-events: none;
}

.floatingchat-container-wrap {
    z-index: 1000 !important;
}

.trophy-toast {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 10px 14px 10px 10px;
    border-radius: 16px;
    color: #f7fbff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0)),
        linear-gradient(180deg, rgba(24, 30, 44, 0.96), rgba(10, 14, 24, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 18px 36px rgba(7, 12, 22, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transform: translateX(110%) scale(0.98);
    opacity: 0;
    transition: transform 0.34s cubic-bezier(.2, .9, .2, 1), opacity 0.24s ease;
}

.trophy-toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.app-toast {
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 14px 10px 10px;
    border-radius: 14px;
    color: #f7fbff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0)),
        linear-gradient(180deg, rgba(24, 30, 44, 0.97), rgba(10, 14, 24, 0.97));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 28px rgba(7, 12, 22, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.13);
    transform: translateX(110%) scale(0.98);
    opacity: 0;
    transition: transform 0.30s cubic-bezier(.2, .9, .2, 1), opacity 0.22s ease;
}

.app-toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.app-toast-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #1d2432;
}

.app-toast-body {
    font-size: 0.88rem;
    line-height: 1.35;
}

.app-toast-success .app-toast-icon {
    background: linear-gradient(180deg, #a8f0c6, #27ae60);
}

.app-toast-error .app-toast-icon {
    background: linear-gradient(180deg, #f8b4b4, #e74c3c);
}

.app-toast-info .app-toast-icon {
    background: linear-gradient(180deg, #a8d8f0, #2980b9);
}

.app-toast-warning .app-toast-icon {
    background: linear-gradient(180deg, #ffe9a8, #e4a72d);
}

.trophy-emblem {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    color: #1d2432;
    background: linear-gradient(180deg, #ffe9a8, #e4a72d);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.55),
        inset 0 -5px 0 rgba(83, 51, 10, 0.22),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    font-weight: 1000;
    letter-spacing: 0;
}

.trophy-copy {
    min-width: 0;
}

.trophy-copy span {
    display: block;
    color: #89c9ff;
    font-size: 0.72rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.trophy-copy strong {
    display: block;
    margin-top: 2px;
    color: #fff;
    font-size: 1rem;
    line-height: 1.08;
}

.trophy-copy small {
    display: block;
    margin-top: 4px;
    color: rgba(245, 249, 255, 0.78);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.trophy-mint .trophy-emblem,
.hall-trophy.trophy-mint {
    background: linear-gradient(180deg, #bdf7e7, #2ec7a1);
}

.trophy-blue .trophy-emblem,
.hall-trophy.trophy-blue {
    background: linear-gradient(180deg, #b9e5ff, #3b8ff0);
}

.trophy-green .trophy-emblem,
.hall-trophy.trophy-green {
    background: linear-gradient(180deg, #c8f7c5, #22b573);
}

.trophy-rose .trophy-emblem,
.hall-trophy.trophy-rose,
.trophy-pink .trophy-emblem,
.hall-trophy.trophy-pink {
    background: linear-gradient(180deg, #ffd1e1, #e4568a);
}

.trophy-red .trophy-emblem,
.hall-trophy.trophy-red {
    background: linear-gradient(180deg, #ffc2b8, #d84c3f);
}

.trophy-night .trophy-emblem,
.hall-trophy.trophy-night {
    color: #f7fbff;
    background: linear-gradient(180deg, #7785a8, #2c3552);
}

.trophy-warm .trophy-emblem,
.hall-trophy.trophy-warm {
    background: linear-gradient(180deg, #ffd9a6, #f08f3b);
}

.hall-mini-link {
    display: inline-block;
    margin-top: 14px;
    color: #ffeef2;
    background: rgba(108, 24, 48, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 900;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

.hall-page {
    align-items: flex-start;
    min-height: 100vh;
    overflow: auto;
    padding: 24px 14px;
}

.hall-shell {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 18px;
    border-radius: 18px;
    background: rgba(246, 249, 252, 0.86);
    border: 1px solid rgba(38, 50, 69, 0.12);
    box-shadow: 0 18px 44px rgba(24, 34, 52, 0.16);
    backdrop-filter: blur(12px);
}

.hall-header {
    margin-bottom: 16px;
    display: grid;
    gap: 8px;
}

.hall-back {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: #7d2942;
    font-size: 0.78rem;
    font-weight: 1000;
    text-decoration: none;
    border: 1px solid rgba(125, 41, 66, 0.12);
}

.hall-header h1 {
    margin: 0;
    color: #30242c;
    font-size: clamp(1.8rem, 7vw, 3rem);
    letter-spacing: 0;
    line-height: 0.98;
}

.hall-header p {
    max-width: 620px;
    margin: 0;
    color: #514650;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}

.hall-list {
    display: grid;
    gap: 12px;
}

.hall-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.hall-actions .btn {
    min-height: 44px;
    width: 100%;
}

.hall-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    align-items: stretch;
    gap: 14px;
    min-height: 124px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(38, 50, 69, 0.11);
    box-shadow: 0 8px 18px rgba(30, 42, 60, 0.08);
}

.hall-portrait {
    position: relative;
    min-height: 106px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(209, 227, 223, 0.9), rgba(164, 184, 169, 0.64));
    border: 1px solid rgba(38, 50, 69, 0.1);
    overflow: hidden;
}

.hall-card canvas {
    display: block;
}

.hall-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 34px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: rgba(35, 42, 55, 0.82);
    font-size: 0.76rem;
    font-weight: 1000;
}

.hall-copy {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 8px;
}

.hall-title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
}

.hall-copy h2 {
    margin: 0;
    color: #2f2630;
    font-size: clamp(1.05rem, 4vw, 1.35rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.hall-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hall-meta span {
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    color: #536071;
    background: rgba(236, 241, 245, 0.92);
    font-size: 0.72rem;
    font-weight: 950;
}

.hall-trophies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.hall-trophies-toggle {
    width: fit-content;
    min-height: 32px;
    border: 1px solid rgba(44, 57, 78, 0.12);
    border-radius: 999px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    color: #263245;
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 1000;
    cursor: pointer;
}

.hall-trophy,
.hall-trophy-more,
.hall-trophy-empty {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    color: #221b20;
    background: linear-gradient(180deg, #ffe9a8, #e4a72d);
    border: 1px solid rgba(70, 38, 17, 0.12);
    font-size: 0.62rem;
    font-weight: 1000;
}

.hall-trophy-more {
    color: #fff;
    background: #2d3446;
}

.hall-trophy-empty {
    width: auto;
    color: #6c6170;
    background: rgba(255, 255, 255, 0.7);
}

.hall-trophy-details {
    display: grid;
    gap: 8px;
    margin-top: 2px;
}

.hall-trophy-detail {
    padding: 8px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    align-items: center;
    background: rgba(246, 249, 252, 0.88);
    border: 1px solid rgba(37, 51, 43, 0.1);
}

.hall-trophy-detail .hall-trophy {
    margin: 0;
}

.hall-trophy-detail strong {
    display: block;
    color: #263245;
    font-size: 0.78rem;
    line-height: 1.15;
}

.hall-trophy-detail small {
    display: block;
    margin-top: 2px;
    color: #516170;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.25;
}

.hall-status {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fff;
    background: #20bf6b;
    font-size: 0.68rem;
    font-weight: 1000;
}

.hall-card.is-dead .hall-status {
    background: #59616f;
}

.hall-empty {
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    color: #514650;
    font-weight: 800;
}

/* Mailbox modal (tema dark) */
.mailbox-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0, 0, 0, 0.62);
    display: grid;
    place-items: center;
    padding: 14px;
}

.dm-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0, 0, 0, 0.42);
    display: grid;
    place-items: center;
    padding: 14px;
}

.mailbox-panel {
    width: min(1040px, calc(100vw - 28px));
    height: min(760px, calc(100vh - 28px));
    background:
        linear-gradient(165deg, rgba(30, 41, 59, 0.55) 0%, rgba(15, 23, 42, 0.08) 42%),
        linear-gradient(180deg, #0f172a 0%, #0c1220 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    color: #e2e8f0;
}

.mailbox-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.35));
}

.mailbox-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 22px;
    line-height: 1;
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.mailbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mailbox-head {
    min-width: 0;
    text-align: left;
}

.mailbox-title {
    font-weight: 900;
    color: #f8fafc;
}

.mailbox-sub {
    font-size: 0.86rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mailbox-refresh {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.52rem;
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(71, 85, 105, 0.85), rgba(51, 65, 85, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mailbox-refresh:hover {
    filter: brightness(1.08);
}

.mailbox-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
}

.mailbox-sidebar {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto 1fr;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(12, 18, 32, 0.98));
    border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.mailbox-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 10px;
    color: #e2e8f0;
}

.mailbox-count {
    min-width: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.65);
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 800;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.mailbox-empty,
.mailbox-thread-empty {
    margin: 12px 14px 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.55);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.12);
    line-height: 1.45;
}

.mailbox-friends {
    min-height: 0;
    overflow: auto;
    padding: 10px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.mailbox-friend {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.45);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    text-align: left;
    padding: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    color: #e2e8f0;
}

.mailbox-friend:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
}

.mailbox-friend.is-active {
    border-color: rgba(96, 165, 250, 0.55);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(30, 58, 138, 0.22));
    box-shadow:
        0 10px 28px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mailbox-friend-avatar,
.mailbox-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(97, 174, 255, 0.95), rgba(67, 105, 224, 0.94));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.mailbox-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mailbox-friend-main,
.mailbox-thread-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.mailbox-friend-name,
.mailbox-thread-meta strong {
    font-weight: 900;
    color: #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mailbox-friend-meta,
.mailbox-friend-preview,
.mailbox-thread-status {
    font-size: 0.82rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mailbox-friend-preview {
    margin-top: 4px;
}

.mailbox-friend-side {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.mailbox-friend-time {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}

.mailbox-unread-dot,
.mailbox-thread-unread {
    min-width: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, #5cb7ff, #2d70e8);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 6px 12px rgba(45, 112, 232, 0.18);
}

.mailbox-thread {
    min-height: 0;
    display: grid;
    background:
        radial-gradient(ellipse 120% 80% at 50% 0%, rgba(59, 130, 246, 0.08), transparent 55%),
        linear-gradient(180deg, #0f172a 0%, #0a0f18 100%);
}

.mailbox-thread-view {
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.mailbox-thread-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.75);
}

.mailbox-thread-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mailbox-messages {
    min-height: 0;
    overflow: auto;
    padding: 18px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.mailbox-msg {
    display: grid;
    gap: 4px;
}

.mailbox-msg.is-me {
    justify-items: end;
}

.mailbox-msg.is-them {
    justify-items: start;
}

.mailbox-msg-bubble {
    max-width: min(480px, 84%);
    padding: 12px 14px;
    border-radius: 16px;
    font-weight: 650;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.mailbox-msg.is-me .mailbox-msg-bubble {
    background: linear-gradient(180deg, rgba(84, 182, 255, 0.94), rgba(22, 132, 232, 0.94));
    color: #fff;
}

.mailbox-msg.is-them .mailbox-msg-bubble {
    background: rgba(51, 65, 85, 0.75);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.mailbox-msg-meta {
    font-size: 0.72rem;
    color: #64748b;
    padding: 0 6px;
}

.mailbox-compose {
    display: grid;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(12, 18, 32, 0.98));
}

.mailbox-input {
    width: 100%;
    resize: vertical;
    min-height: 88px;
    max-height: 200px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    font: inherit;
}

.mailbox-input::placeholder {
    color: rgba(148, 163, 184, 0.75);
}

.mailbox-input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.mailbox-compose-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mailbox-feedback {
    margin: 0;
    min-height: 1.2em;
    color: #94a3b8;
    font-size: 0.82rem;
}

.mailbox-send {
    min-height: 44px;
    border-radius: 12px;
    padding-inline: 18px;
    flex-shrink: 0;
}

.mailbox-empty-state {
    padding: 24px 18px;
    text-align: center;
    color: #94a3b8;
}

@media (max-width: 860px) {
    .mailbox-panel {
        width: min(100vw, calc(100vw - 12px));
        height: min(100vh, calc(100vh - 12px));
        border-radius: 16px;
    }

    .mailbox-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(180px, 34%) minmax(0, 1fr);
    }

    .mailbox-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    }

    .mailbox-sub {
        white-space: normal;
    }

    .mailbox-compose-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .mailbox-send {
        width: 100%;
    }
}

/* DM modal (pet↔pet chat) */
.dm-panel {
    width: min(520px, calc(100vw - 28px));
    height: min(740px, calc(100vh - 28px));
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(38, 50, 69, 0.12);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(18, 27, 42, 0.28);
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    overflow: hidden;
}

.dm-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(38, 50, 69, 0.08);
    background: linear-gradient(180deg, rgba(245, 251, 255, 0.96), rgba(255, 255, 255, 0.96));
}

.dm-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 22px;
    line-height: 1;
}

.dm-head {
    min-width: 0;
}

.dm-title {
    font-weight: 900;
    color: rgba(24, 30, 42, 0.92);
}

.dm-sub {
    font-size: 0.86rem;
    color: rgba(24, 30, 42, 0.66);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dm-badge {
    font-weight: 800;
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(18, 27, 42, 0.06);
    color: rgba(18, 27, 42, 0.78);
    border: 1px solid rgba(18, 27, 42, 0.08);
}

.dm-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(214, 236, 224, 0.65), rgba(214, 236, 224, 0.15));
    border-bottom: 1px solid rgba(38, 50, 69, 0.07);
}

.dm-stage canvas {
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(38, 50, 69, 0.08);
}

.dm-messages {
    padding: 12px;
    overflow: auto;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.9), rgba(245, 250, 255, 0.9));
}

.dm-msg {
    display: grid;
    gap: 4px;
    margin: 10px 0;
}

.dm-msg.is-me {
    justify-items: end;
}

.dm-msg.is-them {
    justify-items: start;
}

.dm-bubble {
    max-width: min(360px, 82%);
    padding: 10px 12px;
    border-radius: 14px;
    font-weight: 650;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.dm-msg.is-me .dm-bubble {
    background: linear-gradient(180deg, rgba(84, 182, 255, 0.92), rgba(22, 132, 232, 0.92));
    color: #fff;
}

.dm-msg.is-them .dm-bubble {
    background: rgba(18, 27, 42, 0.06);
    color: rgba(18, 27, 42, 0.92);
    border: 1px solid rgba(18, 27, 42, 0.07);
}

.dm-meta {
    font-size: 0.72rem;
    color: rgba(18, 27, 42, 0.55);
    padding: 0 6px;
}

.dm-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(38, 50, 69, 0.08);
    background: rgba(255, 255, 255, 0.96);
}

.dm-input {
    width: 100%;
    resize: none;
    min-height: 44px;
    max-height: 140px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(18, 27, 42, 0.14);
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
}

.dm-send {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
}

/* Play together session */
.pt-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0, 0, 0, 0.42);
    display: grid;
    place-items: center;
    padding: 14px;
}

.pt-panel {
    width: min(520px, calc(100vw - 28px));
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(38, 50, 69, 0.12);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(18, 27, 42, 0.28);
    overflow: hidden;
}

.pt-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(38, 50, 69, 0.08);
    background: linear-gradient(180deg, rgba(245, 251, 255, 0.96), rgba(255, 255, 255, 0.96));
}

.pt-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 22px;
    line-height: 1;
}

.pt-title {
    font-weight: 900;
    color: rgba(24, 30, 42, 0.92);
}

.pt-sub {
    font-size: 0.86rem;
    color: rgba(24, 30, 42, 0.66);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-badge {
    font-weight: 800;
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(18, 27, 42, 0.06);
    color: rgba(18, 27, 42, 0.78);
    border: 1px solid rgba(18, 27, 42, 0.08);
}

.pt-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(214, 236, 224, 0.65), rgba(214, 236, 224, 0.15));
}

.pt-stage canvas {
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(38, 50, 69, 0.08);
}

.pt-actions {
    padding: 12px;
    border-top: 1px solid rgba(38, 50, 69, 0.08);
    background: rgba(255, 255, 255, 0.96);
}

.pt-actions .btn {
    width: 100%;
    min-height: 44px;
}

.cemetery-shell {
    width: min(880px, 100%);
    background:
        linear-gradient(180deg, rgba(245, 249, 246, 0.9), rgba(226, 235, 226, 0.88)),
        rgba(246, 249, 252, 0.86);
}

.cemetery-header h1 {
    color: #26392f;
}

.cemetery-grid {
    min-height: 360px;
    padding: 18px;
    border-radius: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 16px 12px;
    align-items: end;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.62) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 32%, rgba(255, 255, 255, 0.52) 0 2px, transparent 3px),
        linear-gradient(180deg, rgba(178, 211, 188, 0.74), rgba(104, 151, 108, 0.76));
    border: 1px solid rgba(38, 50, 69, 0.12);
    box-shadow: inset 0 12px 28px rgba(255, 255, 255, 0.18);
}

.cemetery-marker {
    min-height: 142px;
    padding: 0;
    border: 0;
    display: grid;
    align-items: end;
    justify-items: center;
    color: #2f3440;
    background: transparent;
    cursor: pointer;
}

.cemetery-marker::after {
    content: "";
    width: 92%;
    height: 12px;
    margin-top: -4px;
    border-radius: 999px;
    background: rgba(43, 78, 45, 0.24);
    filter: blur(1px);
}

.cemetery-stone {
    width: min(122px, 100%);
    min-height: 118px;
    padding: 18px 10px 12px;
    border-radius: 54px 54px 10px 10px;
    display: grid;
    align-content: center;
    gap: 7px;
    text-align: center;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #d7ddd9, #9fa9a4);
    border: 1px solid rgba(52, 61, 68, 0.2);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.46),
        0 10px 18px rgba(34, 54, 40, 0.22);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.cemetery-marker:hover .cemetery-stone {
    transform: translateY(-3px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.52),
        0 14px 24px rgba(34, 54, 40, 0.26);
}

.cemetery-symbol {
    color: #59645f;
    font-size: 1.18rem;
    line-height: 1;
}

.cemetery-stone strong {
    color: #26302d;
    font-size: 0.86rem;
    font-weight: 1000;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.cemetery-stone small {
    color: #59645f;
    font-size: 0.66rem;
    font-weight: 900;
}

.cemetery-empty {
    grid-column: 1 / -1;
    align-self: center;
    justify-self: center;
    padding: 18px;
    border-radius: 12px;
    color: #33423a;
    background: rgba(255, 255, 255, 0.68);
    font-weight: 900;
    text-align: center;
}

.cemetery-pagination {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.cemetery-pagination a,
.cemetery-pagination span,
.cemetery-pagination strong {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    color: #26302d;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(38, 50, 69, 0.1);
    font-size: 0.74rem;
    font-weight: 950;
    text-decoration: none;
}

.cemetery-pagination span {
    opacity: 0.48;
}

.cemetery-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(15, 22, 27, 0.56);
    backdrop-filter: blur(8px);
}

.cemetery-modal-panel {
    position: relative;
    width: min(360px, 100%);
    padding: 18px;
    border-radius: 16px;
    display: grid;
    justify-items: center;
    gap: 12px;
    color: #25302d;
    background: rgba(248, 250, 248, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: 0 24px 60px rgba(5, 10, 20, 0.38);
}

#cemetery-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    color: #25302d;
    background: rgba(38, 48, 45, 0.08);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

#cemetery-modal-canvas {
    display: block;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(209, 227, 223, 0.9), rgba(164, 184, 169, 0.64));
    border: 1px solid rgba(38, 50, 69, 0.1);
}

.cemetery-modal-copy {
    display: grid;
    gap: 5px;
    text-align: center;
}

.cemetery-modal-copy h2 {
    margin: 0;
    color: #25302d;
    font-size: 1.6rem;
    line-height: 1.02;
    overflow-wrap: anywhere;
}

.cemetery-modal-copy p {
    margin: 0;
    color: #5a665f;
    font-size: 0.86rem;
    font-weight: 800;
}

@media (max-width: 560px) {
    .hall-shell {
        padding: 12px;
        border-radius: 16px;
    }

    .hall-card {
        grid-template-columns: 92px 1fr;
        gap: 10px;
        padding: 10px;
    }

    .hall-portrait {
        min-height: 100px;
    }

    .trophy-toast-stack {
        top: auto;
        right: 12px;
        bottom: calc(var(--trophy-toast-mobile-bottom) + 40px);
        width: calc(100vw - 24px);
    }
}

@media (max-width: 420px) {
    body {
        align-items: center;
    }

    .tamagotchi-container {
        width: min(340px, calc(100vw - 20px));
        padding: 34px 20px 28px;
    }

    .screen {
        height: 246px;
        border-width: 10px;
    }

    #controls-alive,
    #controls-dead {
        gap: 6px;
    }

    .btn {
        width: min(48px, 14vw);
        height: min(48px, 14vw);
        min-width: 42px;
        min-height: 42px;
        font-size: 0.5rem;
    }

    .btn-icon {
        width: 18px;
        height: 18px;
        font-size: 0.62rem;
    }

    .btn-label {
        max-width: 40px;
        font-size: 0.43rem;
    }
}

.sw-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding:
        max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    overflow-y: auto;
    color: var(--text-light);
    background:
        radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.25), transparent 28%),
        radial-gradient(circle at 80% 18%, rgba(255, 154, 166, 0.35), transparent 30%),
        linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    animation: swGateFadeIn 0.6s ease-out;
}

@keyframes swGateFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sw-gate.hidden {
    display: none;
}

.sw-gate--fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sw-gate-card {
    width: min(440px, 100%);
    padding: clamp(24px, 8vw, 36px);
    border-radius: clamp(24px, 8vw, var(--border-radius-xl));
    text-align: center;
    background:
        radial-gradient(circle at 28% 0%, rgba(255, 255, 255, 0.2), transparent 34%),
        linear-gradient(155deg, rgba(38, 50, 69, 0.98), rgba(16, 24, 39, 0.98));
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -24px 36px rgba(0, 0, 0, 0.2),
        0 28px 80px rgba(0, 0, 0, 0.45),
        var(--shadow-lg);
    backdrop-filter: blur(16px);
    animation: swGateCardSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: var(--transition-base);
}

@keyframes swGateCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sw-gate-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    padding: 7px 14px;
    border-radius: 999px;
    color: #ffeef2;
    background: rgba(255, 154, 166, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: clamp(0.68rem, 2.5vw, 0.78rem);
    font-weight: 1000;
    letter-spacing: 0.14em;
}

.sw-gate-card h1 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: clamp(1.45rem, 7vw, 2rem);
    line-height: 1.05;
}

.sw-gate-card p {
    margin: 0;
    color: rgba(245, 249, 255, 0.78);
    font-size: clamp(0.9rem, 3.8vw, 1rem);
    font-weight: 750;
    line-height: 1.45;
}

.sw-gate-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 42px;
    margin-bottom: 16px;
}

.sw-gate-loader span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffdf72;
    box-shadow: 0 0 18px rgba(255, 223, 114, 0.45);
    animation: swGateBounce 0.85s infinite ease-in-out;
}

.sw-gate-loader span:nth-child(2) {
    animation-delay: 0.12s;
    background: #78e6bf;
    box-shadow: 0 0 18px rgba(120, 230, 191, 0.42);
}

.sw-gate-loader span:nth-child(3) {
    animation-delay: 0.24s;
    background: #8fd2ff;
    box-shadow: 0 0 18px rgba(143, 210, 255, 0.42);
}

.sw-gate:not(.is-loading) .sw-gate-loader {
    display: none;
}

.sw-gate-actions {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.sw-gate-actions.hidden {
    display: none;
}

.sw-gate-card button {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    color: #172133;
    background: linear-gradient(180deg, #ffdf72, #f0a928);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.36),
        inset 0 -5px 7px rgba(0, 0, 0, 0.16),
        0 5px 0 rgba(0, 0, 0, 0.28);
    font-size: clamp(0.86rem, 3.5vw, 0.98rem);
    font-weight: 1000;
    cursor: pointer;
    touch-action: manipulation;
}

.sw-gate-card button+button {
    color: #e8f2ff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.sw-gate-card button:active {
    transform: translateY(4px);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.24),
        inset 0 -3px 5px rgba(0, 0, 0, 0.18);
}

@keyframes swGateBounce {

    0%,
    80%,
    100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.55;
    }

    40% {
        transform: translateY(-10px) scale(1);
        opacity: 1;
    }
}

@media (max-width: 420px) {
    .sw-gate {
        align-items: flex-start;
    }

    .sw-gate-card {
        margin-top: min(12vh, 70px);
    }
}

@media (max-width: 340px) {
    .sw-gate-card {
        padding: 20px 16px;
        border-radius: 22px;
    }

    .sw-gate-card button {
        min-height: 44px;
    }

    .sw-gate-loader {
        height: 36px;
        margin-bottom: 14px;
    }
}

@media (max-height: 560px) {
    .sw-gate {
        align-items: flex-start;
    }

    .sw-gate-card {
        margin-block: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sw-gate-loader span {
        animation: none;
    }
}

/* Unified mobile-game button system */
:where(button, .device-side-toggle, .hall-back, .hall-mini-link, .hall-trophies-toggle) {
    -webkit-tap-highlight-color: transparent;
}

:where(button, .device-side-toggle, .hall-back, .hall-mini-link, .hall-trophies-toggle):focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.88);
    outline-offset: 3px;
}

.device-options-toggle,
.device-store-toggle,
.device-status-toggle,
.device-trophies-toggle,
.device-pets-toggle,
.device-mail-toggle,
.device-chat-toggle,
.device-hall-toggle {
    right: -15px;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.84);
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #f9c74f, #f08a24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -7px 12px rgba(77, 41, 12, 0.22),
        0 7px 14px rgba(76, 27, 43, 0.28),
        0 0 0 2px rgba(54, 36, 45, 0.18);
    transition: transform 0.14s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.device-options-toggle:hover,
.device-store-toggle:hover,
.device-status-toggle:hover,
.device-trophies-toggle:hover,
.device-pets-toggle:hover,
.device-mail-toggle:hover,
.device-chat-toggle:hover,
.device-hall-toggle:hover {
    filter: brightness(1.04) saturate(1.05);
    transform: translateY(-1px);
}

.device-options-toggle:active,
.device-store-toggle:active,
.device-status-toggle:active,
.device-trophies-toggle:active,
.device-pets-toggle:active,
.device-mail-toggle:active,
.device-chat-toggle:active,
.device-hall-toggle:active {
    transform: translateY(3px) scale(0.96);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        inset 0 -4px 8px rgba(77, 41, 12, 0.2),
        0 3px 8px rgba(76, 27, 43, 0.22),
        0 0 0 2px rgba(54, 36, 45, 0.14);
}

.device-store-toggle {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #48d98d, #0f9f69);
}

.device-status-toggle {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #50b8ff, #2868e8);
}

.device-trophies-toggle {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #ff73b7, #d73587);
}

.device-pets-toggle {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #ffb84d, #dc712a);
}

.device-mail-toggle {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #bc9cff, #7b55e6);
}

.device-chat-toggle {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #7ec8ff, #3b8edf);
}

.device-hall-toggle {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #a58bff, #6847d8);
}

.device-side-toggle svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.6;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
}

.device-hall-toggle svg {
    width: 25px;
    height: 25px;
    stroke-width: 2.9;
}

.btn {
    width: 100%;
    min-width: 52px;
    height: 52px;
    margin-top: 10px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #7d8da1, #526173);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        inset 0 -7px 11px rgba(23, 33, 51, 0.18),
        0 7px 13px rgba(74, 32, 42, 0.24),
        0 0 0 2px rgba(54, 36, 45, 0.12);
    transition: transform 0.14s ease, filter 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

@media screen and (min-width: 480px) {
    .btn {
        width: min(320px, 100%);
    }
}

.btn:hover {
    filter: brightness(1.05) saturate(1.04);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(3px) scale(0.96);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -4px 8px rgba(23, 33, 51, 0.16),
        0 3px 8px rgba(74, 32, 42, 0.18),
        0 0 0 2px rgba(54, 36, 45, 0.1);
}

.btn-icon {
    width: 30px;
    height: 30px;
    color: currentColor;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-icon svg {
    width: 82%;
    height: 82%;
    stroke-width: 2.2;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

.btn-label {
    max-width: 46px;
    color: rgba(255, 255, 255, 0.98);
    font-size: 0.46rem;
    font-weight: 1000;
}

.btn-red {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #ff6b7e, #d92f49);
}

.btn-blue {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #50b8ff, #2868e8);
}

.btn-yellow {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #ffd166, #ef8f16);
}

.btn-green {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #48d98d, #0f9f69);
}

.btn-purple {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #a58bff, #6847d8);
}

.btn-pink,
.menu-action.btn-treat {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ff73b7, #d73587);
}

.btn-cyan,
.menu-action.btn-work {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #3edbd3, #098fa1);
}

.btn-orange,
.menu-action.btn-shop {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ffb84d, #dc712a);
}

.btn-slate {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #7f8ea3, #48566b);
}

.btn-drink,
.menu-action.btn-drink {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #b57bff, #7c3aed);
}

.menu-action,
.view-toggle-btn,
.pet-list-actions button,
.emergency-medicine button,
.app-modal-btn,
.sw-gate-card button,
.hall-back,
.hall-mini-link,
.hall-trophies-toggle {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 8px 16px rgba(5, 10, 20, 0.2);
    transition: transform 0.14s ease, filter 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.menu-action {
    min-height: 54px;
    padding: 10px 13px;
}

.menu-action .btn-icon {
    flex: 0 0 auto;
}

.view-toggle-btn,
.pet-list-actions button,
.emergency-medicine button,
.app-modal-btn.primary,
.sw-gate-card button,
.hall-back,
.hall-mini-link,
.hall-trophies-toggle {
    color: #102237;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ffdf72, #f0a928);
}

.app-modal-btn.secondary,
.sw-gate-card button+button {
    color: #f7fbff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 42%),
        rgba(255, 255, 255, 0.12);
}

.menu-action:hover,
.view-toggle-btn:hover,
.pet-list-actions button:hover,
.emergency-medicine button:hover,
.app-modal-btn:hover,
.sw-gate-card button:hover,
.hall-back:hover,
.hall-mini-link:hover,
.hall-trophies-toggle:hover,
.store-item:hover,
.pet-list-item:hover {
    filter: brightness(1.05) saturate(1.04);
    transform: translateY(-1px);
}

.menu-action:active,
.view-toggle-btn:active,
.pet-list-actions button:active,
.emergency-medicine button:active,
.app-modal-btn:active,
.sw-gate-card button:active,
.hall-back:active,
.hall-mini-link:active,
.hall-trophies-toggle:active,
.store-item:active,
.pet-list-item:active {
    transform: translateY(2px) scale(0.985);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 10px rgba(5, 10, 20, 0.16);
}

.modal-close-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 16px rgba(5, 10, 20, 0.18);
    transition: transform 0.14s ease, background 0.16s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.difficulty-strip {
    padding: 4px;
    border-radius: 14px;
    background: rgba(8, 14, 25, 0.22);
}

.difficulty-strip button {
    min-height: 34px;
    border: 0;
    border-radius: 10px;
    color: rgba(247, 251, 255, 0.78);
    background: transparent;
    transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.difficulty-strip button.active {
    color: #102237;
    background: linear-gradient(180deg, #ffffff, #dce8f4);
    box-shadow: 0 6px 12px rgba(5, 10, 20, 0.14);
}

.difficulty-strip button:active {
    transform: scale(0.97);
}

.store-item,
.pet-list-item {
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 48%),
        rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 8px 16px rgba(5, 10, 20, 0.16);
}

.store-icon {
    width: 40px;
    height: 40px;
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%),
        rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.store-icon svg {
    width: 72%;
    height: 72%;
    stroke-width: 2.5;
}

.store-count {
    color: #102237;
    background: #ffdf72;
    box-shadow: 0 4px 8px rgba(5, 10, 20, 0.18);
}

.minigame-target {
    border: 2px solid rgba(255, 255, 255, 0.82);
    color: #102237;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ffdf72, #f0a928);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        0 10px 18px rgba(5, 10, 20, 0.24);
}

.hall-back::before {
    content: "<";
    margin-right: 7px;
    font-weight: 1000;
}

.hall-trophies-toggle {
    min-height: 34px;
}

@media (max-width: 420px) {
    .btn {
        width: min(50px, 14.6vw);
        height: min(50px, 14.6vw);
    }

    .btn-icon {
        width: 26px;
        height: 26px;
    }
}

.legal-footer {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    z-index: 120;
    width: auto;
    max-width: min(680px, calc(100vw - 20px));
    pointer-events: none;
    display: grid;
    justify-items: end;
    gap: 4px;
}

.legal-footer nav {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 5px 6px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 16px;
    background: rgba(16, 24, 39, 0.74);
    box-shadow: 0 14px 30px rgba(5, 10, 20, 0.24);
    backdrop-filter: blur(12px);
    pointer-events: auto;
}

.legal-footer .footer-menu-toggle {
    min-height: 26px;
    padding: 0 10px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #f7fbff;
    font-size: 0.62rem;
    font-weight: 950;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease;
}

.legal-footer .footer-menu-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.legal-footer .footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 12px;
    color: rgba(247, 251, 255, 0.88);
    background: rgba(16, 24, 39, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 22px rgba(5, 10, 20, 0.2);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    font-size: 0.58rem;
    font-weight: 900;
    white-space: nowrap;
}

.legal-footer a,
.legal-footer .footer-link-button {
    min-height: 26px;
    padding: 0 8px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f7fbff;
    font-size: 0.62rem;
    font-weight: 950;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.16s ease, transform 0.14s ease;
}

.legal-footer .footer-link-button {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    background: transparent;
}

.legal-footer .footer-meta .footer-link-button {
    min-height: 20px;
    padding: 0;
    color: inherit;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-footer .footer-meta .footer-meta-link {
    min-height: 20px;
    padding: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-footer .footer-share-button {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.16s ease, transform 0.14s ease, border-color 0.16s ease;
}

.legal-footer .footer-share-button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.legal-footer a:visited {
    color: var(--link-visited-color);
}

.legal-footer a:hover,
.legal-footer .footer-link-button:hover {
    color: var(--link-hover-color);
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.legal-footer .footer-share-button:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.legal-footer .footer-lang {
    min-height: 26px;
    padding: 0 10px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #f7fbff;
    font-size: 0.62rem;
    font-weight: 950;
    cursor: pointer;
    white-space: nowrap;
}

.legal-footer .footer-lang:active {
    transform: translateY(1px);
}

.footer-menu-popover[hidden] {
    display: block;
    pointer-events: none;
}

.footer-menu-popover {
    position: fixed;
    z-index: 2600;
    width: min(280px, calc(100vw - 28px));
    transform-origin: calc(100% - 20px) calc(100% + 10px);
    transform: translateY(10px) scale(0.92);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s cubic-bezier(.22, 1, .36, 1), opacity 0.18s ease;
}

.footer-menu-popover[data-placement="down"] {
    transform-origin: calc(100% - 20px) -10px;
    transform: translateY(-10px) scale(0.92);
}

.footer-menu-popover.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.legal-footer[data-menu-open="1"] .footer-menu-toggle {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow: 0 10px 18px rgba(5, 10, 20, 0.24);
}

.footer-menu-popover__panel {
    max-width: min(280px, calc(100vw - 28px));
    max-height: min(70vh, calc(100vh - 24px));
    overflow: auto;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(16, 24, 39, 0.96);
    box-shadow:
        0 18px 38px rgba(5, 10, 20, 0.34),
        0 2px 0 rgba(255, 255, 255, 0.06) inset;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #f7fbff;
}

.footer-menu-popover__title {
    padding: 2px 4px 8px;
    color: rgba(247, 251, 255, 0.62);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.footer-menu-popover__list {
    display: grid;
    gap: 8px;
}

.footer-menu-popover__item {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f7fbff;
    font-size: 0.9rem;
    font-weight: 820;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.footer-menu-popover__item::after {
    content: "";
    flex: 0 0 18px;
    margin-left: 12px;
    width: 18px;
    height: 18px;
    background: no-repeat center/18px 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
}

.footer-menu-popover__item:visited {
    color: var(--link-visited-color);
}

.footer-menu-popover__item:hover,
.footer-menu-popover__item:focus-visible,
.legal-footer .footer-menu-toggle:hover,
.legal-footer .footer-menu-toggle:focus-visible {
    color: var(--link-hover-color);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    outline: none;
}

.footer-menu-popover__item:hover,
.footer-menu-popover__item:focus-visible {
    transform: translateY(-1px);
}

.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: max(64px, calc(env(safe-area-inset-bottom) + 64px));
    z-index: 2200;
    width: min(520px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    color: #f7fbff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 42%),
        rgba(16, 24, 39, 0.94);
    box-shadow: 0 20px 48px rgba(5, 10, 20, 0.42);
    backdrop-filter: blur(14px);
    transform: translateX(-50%);
}

body:not(.legal-page) .legal-footer {
    top: auto;
    bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    width: auto;
    max-width: min(680px, calc(100vw - 20px));
    z-index: 130;
}

body:not(.legal-page) .legal-footer nav {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 3px;
    padding: 3px 5px;
    border-radius: 12px;
    background: rgba(16, 24, 39, 0.48);
}

body:not(.legal-page) .legal-footer a,
body:not(.legal-page) .legal-footer .footer-link-button {
    min-height: 22px;
    padding: 0 6px;
    font-size: 0.52rem;
}

body:not(.legal-page) .legal-footer .footer-lang {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.52rem;
}

body:not(.legal-page) .legal-footer .footer-menu-toggle {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.52rem;
}

body:not(.legal-page) .cookie-banner {
    top: max(46px, calc(env(safe-area-inset-top) + 46px));
    bottom: auto;
    width: min(340px, calc(100vw - 24px));
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
}

body:not(.legal-page) .cookie-copy strong {
    font-size: 0.74rem;
}

body:not(.legal-page) .cookie-copy p {
    font-size: 0.66rem;
}

body:not(.legal-page) .cookie-accept {
    width: 100%;
    min-height: 34px;
}

.cookie-copy {
    min-width: 0;
    text-align: left;
}

.cookie-copy strong {
    display: block;
    margin-bottom: 4px;
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1.1;
}

.cookie-copy p {
    margin: 0;
    color: rgba(247, 251, 255, 0.82);
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1.3;
}

.cookie-copy a {
    display: inline-flex;
    margin-top: 7px;
    color: var(--link-color);
    font-size: 0.72rem;
    font-weight: 1000;
    text-decoration: none;
}

.cookie-copy a:visited {
    color: var(--link-visited-color);
}

.cookie-copy a:hover {
    color: var(--link-hover-color);
}

.cookie-accept {
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 12px;
    padding: 0 13px;
    color: #102237;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ffdf72, #f0a928);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 8px 16px rgba(5, 10, 20, 0.22);
    font-size: 0.76rem;
    font-weight: 1000;
    cursor: pointer;
}

.legal-page {
    align-items: flex-start;
    min-height: 100vh;
    overflow: auto;
    padding: 24px 14px 96px;
    color: #f7fbff;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.24), transparent 26%),
        radial-gradient(circle at 86% 12%, rgba(255, 154, 166, 0.25), transparent 28%),
        linear-gradient(155deg, #16213e 0%, #101827 58%, #070b14 100%);
}

.legal-shell {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: clamp(16px, 4vw, 24px);
    border-radius: 22px;
    background: rgba(246, 249, 252, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 22px 60px rgba(5, 10, 20, 0.28);
    backdrop-filter: blur(12px);
}

.legal-header {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.legal-header .hall-back {
    justify-self: start;
}

.legal-kicker {
    margin: 6px 0 0;
    color: #ffdf72;
    font-size: 0.76rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.legal-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 7vw, 3.4rem);
    line-height: 0.98;
}

.legal-header p:last-child {
    max-width: 720px;
    margin: 0;
    color: rgba(247, 251, 255, 0.78);
    font-size: 0.95rem;
    font-weight: 760;
    line-height: 1.4;
}

.legal-language-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.legal-card {
    padding: clamp(14px, 4vw, 20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 42%),
        rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.legal-card h2 {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 1.25rem;
}

.legal-card h3 {
    margin: 16px 0 6px;
    color: #ffdf72;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.legal-card p {
    margin: 0;
    color: rgba(247, 251, 255, 0.82);
    font-size: 0.86rem;
    font-weight: 720;
    line-height: 1.45;
}

.changelog-card {
    max-width: 760px;
    margin: 0 auto;
}

.changelog-list {
    display: grid;
    gap: 14px;
}

.changelog-release {
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.changelog-release:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.changelog-release-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.legal-card .changelog-release-header h2 {
    margin-bottom: 8px;
}

.changelog-date {
    color: rgba(247, 251, 255, 0.58);
    font-size: 0.76rem;
    font-weight: 850;
}

.changelog-release ul {
    margin: 0 0 2px;
    padding-left: 1.1rem;
    color: rgba(247, 251, 255, 0.84);
    font-size: 0.86rem;
    font-weight: 720;
    line-height: 1.45;
}

.changelog-release li+li {
    margin-top: 5px;
}

.changelog-release code {
    padding: 1px 5px;
    border-radius: 6px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.22);
    font-size: 0.82em;
}

.changelog-repeat-badge {
    display: inline-flex;
    margin-left: 7px;
    color: #ffdf72;
    font-size: 0.72rem;
    font-weight: 900;
}

.changelog-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.legal-muted {
    color: rgba(247, 251, 255, 0.62) !important;
    font-size: 0.82rem !important;
}

.legal-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.legal-nav::-webkit-scrollbar {
    display: none;
}

.legal-nav a {
    color: var(--link-color);
    font-weight: 700;
    font-size: 0.78rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.legal-nav a:visited {
    color: var(--link-visited-color);
}

.legal-nav a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.guest-data-banner {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 193, 7, 0.32);
    border: 1px solid rgba(255, 193, 7, 0.35);
    color: rgb(18 18 18 / 0.95);
    font-size: 0.78rem;
    line-height: 1.35;
    max-width: 78%;
}

.guest-data-banner a {
    color: rgb(18 18 18 / 0.95);
    font-weight: 800;
}

.guest-data-banner a:visited {
    color: var(--link-visited-color);
}

.guest-data-banner a:hover {
    color: var(--link-hover-color);
}

.legal-page .legal-card a {
    color: var(--link-color);
    font-weight: 800;
}

.legal-page .legal-card a:visited {
    color: var(--link-visited-color);
}

.legal-page .legal-card a:hover,
.legal-page .legal-card a:focus-visible,
.legal-footer a:focus-visible,
.legal-footer .footer-link-button:focus-visible,
.cookie-copy a:focus-visible,
.legal-nav a:focus-visible,
.guest-data-banner a:focus-visible {
    color: var(--link-hover-color);
    text-decoration: underline;
    outline: none;
}

.profilo-panel h2 {
    margin-top: 1.25rem;
}

.profilo-log {
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 0.75rem;
    overflow: auto;
    white-space: pre-wrap;
}

.profilo-import-auto {
    margin-top: 0.5rem;
}

.profilo-claim-feedback {
    margin-top: 0.75rem;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.profilo-claim-feedback:empty {
    display: none;
}

.profilo-claim-feedback.success {
    border-color: rgba(132, 217, 138, 0.45);
    background: rgba(40, 80, 50, 0.35);
    color: #d8f5dc;
}

.profilo-claim-feedback.warning {
    border-color: rgba(255, 200, 120, 0.5);
    background: rgba(80, 55, 20, 0.35);
    color: #ffe8c4;
}

.profilo-claim-feedback.error {
    border-color: rgba(255, 120, 100, 0.45);
    background: rgba(70, 30, 28, 0.4);
    color: #ffd6d0;
}

.profilo-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 1.5rem 0;
}

.profilo-actions-top {
    margin: 1rem 0 1.5rem;
}

/* Pulsante stile Google (orizzontale, non usa .btn del device che e' circolare 50px) */
.btn-google-signin {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-sizing: border-box;
    min-height: 52px;
    padding: 12px 28px 12px 22px;
    width: 100%;
    max-width: 340px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #3c4043;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.08s ease;
    touch-action: manipulation;
}

.btn-google-signin:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    filter: none;
}

.btn-google-signin:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.btn-google-signin:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 2px;
}

.btn-google-signin__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.btn-google-signin__text {
    flex: 0 1 auto;
    text-align: center;
}

/* Altri pulsanti nella scheda profilo: il .btn globale e' per il device tondo */
.profilo-panel .btn-profil-row {
    width: auto;
    max-width: 100%;
    min-width: min(280px, 100%);
    min-height: 48px;
    height: auto;
    border-radius: 12px;
    padding: 12px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
    text-decoration: none;
    grid-template-columns: none;
    place-items: unset;
    gap: 0;
}

.profilo-panel .btn-profil-row .btn-label {
    max-width: none;
    font-size: inherit;
}

.profilo-username-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 0.5rem;
}

.profilo-text-input {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
    font-size: 0.9rem;
}

.profilo-delete-input {
    display: block;
    max-width: min(420px, 100%);
    margin: 0.5rem 0;
}

.profilo-avatar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: 0.5rem;
}

.profilo-avatar-preview {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.2);
}

.profilo-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.profilo-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.profilo-inline-msg {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.profilo-inline-msg.error {
    color: #ff8a80;
}

.play-with-peer-block {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.play-with-peer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.play-with-peer-row select {
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
}

.play-with-peer-hint {
    margin-top: 8px;
    font-size: 0.82rem;
}

.profilo-donation {
    margin-top: 0.75rem;
}

@media (max-width: 720px) {
    .legal-language-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .cookie-banner {
        grid-template-columns: 1fr;
    }
}

/* Ko-fi Widget Adjustments */
#kofi-widget-overlay {
    z-index: 1000 !important;
}

/* Ensure Ko-fi widget doesn't interfere with pet controls on mobile */
@media (max-width: 480px) {
    #kofi-widget-overlay {
        bottom: 80px !important;
        right: 10px !important;
    }
}

@media (max-width: 380px) {
    #kofi-widget-overlay {
        bottom: 90px !important;
        right: 5px !important;
    }
}

/* Ensure Ko-fi widget doesn't interfere with modals */
.app-modal:not(.hidden)~#kofi-widget-overlay {
    z-index: 999 !important;
}

.bug-report-open {
    overflow: hidden;
}

.bug-report-modal {
    position: fixed;
    inset: 0;
    z-index: 230000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 14, 24, 0.74);
    backdrop-filter: blur(6px);
}

.bug-report-modal.hidden {
    display: none;
}

.bug-report-panel {
    position: relative;
    width: min(560px, calc(100vw - 24px));
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: 22px 18px 18px;
    border-radius: 22px;
    color: #f7fbff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 42%),
        rgba(16, 24, 39, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 60px rgba(5, 10, 20, 0.42);
}

.bug-report-panel h2 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
}

.bug-report-lead {
    margin: 0 0 14px;
    color: rgba(247, 251, 255, 0.84);
    line-height: 1.45;
}

.bug-report-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.bug-report-field {
    display: grid;
    gap: 7px;
    margin-top: 12px;
}

.bug-report-field span,
.bug-report-context summary {
    font-size: 0.84rem;
    font-weight: 900;
}

.bug-report-field input,
.bug-report-field textarea {
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #f7fbff;
    font: inherit;
    box-sizing: border-box;
}

.bug-report-field textarea {
    min-height: 132px;
    resize: vertical;
}

.bug-report-context {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.bug-report-context pre {
    margin: 10px 0 0;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.74rem;
    color: rgba(247, 251, 255, 0.88);
}

.bug-report-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.bug-report-feedback {
    min-height: 1.35em;
    margin: 12px 0 0;
    font-size: 0.86rem;
    font-weight: 760;
}

.bug-report-feedback.success {
    color: #b9f0c8;
}

.bug-report-feedback.error {
    color: #ffb4a8;
}

.bug-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {

    .legal-footer {
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) + 8px));
        max-width: calc(100vw - 16px);
    }

    body:not(.legal-page) .legal-footer {
        bottom: auto;
        top: max(8px, calc(env(safe-area-inset-bottom, 0px) + 8px));
        max-width: calc(100vw - 16px);
    }

    .legal-footer nav,
    body:not(.legal-page) .legal-footer nav {
        gap: 4px;
    }

    .footer-menu-popover {
        width: min(250px, calc(100vw - 24px));
    }

    .legal-footer .footer-meta {
        max-width: 100%;
        font-size: 0.56rem;
    }

    .hall-page .legal-footer {
        top: auto !important;
        bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) + 8px)) !important;
    }


    .bug-report-modal {
        padding: 0;
        align-items: end;
    }

    .bug-report-panel {
        width: 100%;
        max-height: min(92dvh, 100vh);
        border-radius: 22px 22px 0 0;
        padding-bottom: max(80px, env(safe-area-inset-bottom, 0px));
    }

    .bug-report-actions .btn {
        width: 100%;
        min-height: 46px;
    }
}

@media (min-width: 1024px) {
    body:not(.legal-page) .legal-footer {
        top: auto;
        bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 10px));
    }
}

/* Mandatory app update (above modals / Ko-fi) */
.app-update-required-backdrop {
    position: fixed;
    inset: 0;
    z-index: 250000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    box-sizing: border-box;
    background: rgba(15, 35, 40, 0.82);
    backdrop-filter: blur(6px);
    pointer-events: auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.app-update-required-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    text-align: center;
    color: #2c3e50;
}

.app-update-required-title {
    margin: 0 0 14px 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.25;
}

.app-update-required-message {
    margin: 0 0 22px 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: #4a5568;
}

.app-update-required-detail {
    margin: -8px 0 22px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(44, 62, 80, 0.07);
    color: #37475a;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: left;
}

.app-update-required-button {
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
}

.app-update-required-button:hover:not(:disabled) {
    filter: brightness(1.08);
}

.app-update-required-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* ─── Scrollbars ─────────────────────────────────────────────────────────── */

/* Global default: thin violet scrollbar for light/neutral surfaces */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.55) rgba(102, 126, 234, 0.08);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.06);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.45);
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.75);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Dark modal panels: lighter thumb on navy background */
.app-modal-panel,
.status-modal-panel,
.trophies-modal-panel,
.pets-modal-panel,
.chat-modal-panel,
.chat-messages {
    scrollbar-color: rgba(240, 147, 251, 0.45) rgba(255, 255, 255, 0.05);
}

.app-modal-panel::-webkit-scrollbar-track,
.status-modal-panel::-webkit-scrollbar-track,
.trophies-modal-panel::-webkit-scrollbar-track,
.pets-modal-panel::-webkit-scrollbar-track,
.chat-modal-panel::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 99px;
}

.app-modal-panel::-webkit-scrollbar-thumb,
.status-modal-panel::-webkit-scrollbar-thumb,
.trophies-modal-panel::-webkit-scrollbar-thumb,
.pets-modal-panel::-webkit-scrollbar-thumb,
.chat-modal-panel::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(240, 147, 251, 0.38);
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-modal-panel::-webkit-scrollbar-thumb:hover,
.status-modal-panel::-webkit-scrollbar-thumb:hover,
.trophies-modal-panel::-webkit-scrollbar-thumb:hover,
.pets-modal-panel::-webkit-scrollbar-thumb:hover,
.chat-modal-panel::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(240, 147, 251, 0.65);
}

/* Body scroll: keep it subtle on the purple gradient background */
body {
    scrollbar-color: rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.05);
}

body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.40);
}

/* Elements that intentionally hide their scrollbar keep the existing rule */
.legal-nav {
    scrollbar-width: none;
}

/* ─── Status modal tabs ──────────────────────────────────────────────────── */

.status-tabs {
    display: flex;
    gap: 4px;
    margin: 10px 0 14px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-tab {
    flex: 1;
    padding: 7px 4px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.status-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.status-tab.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.72), rgba(118, 75, 162, 0.72));
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.status-pane {
    animation: statusPaneFadeIn 0.18s ease-out;
}

@keyframes statusPaneFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* status-dots tooltip on hover */
.status-dots[data-tooltip] {
    position: relative;
    cursor: default;
}

.status-dots[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.92);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* satiety percent-dots */
.status-dots.percent-dots span.dot-red {
    background: #ff7f8f;
}

.status-dots.percent-dots span.dot-yellow {
    background: #f9d66b;
}

.status-dots.percent-dots span.dot-green {
    background: #78e6bf;
}

.status-dots.percent-dots span.overflow-blink {
    background: #ff7f8f;
    animation: satietyBlink 0.7s ease-in-out infinite alternate;
}

@keyframes satietyBlink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.25;
    }
}

.stroke-fx {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    pointer-events: none;
    animation: strokeFxFloat 0.9s ease-out forwards;
    z-index: 100;
}

@keyframes strokeFxFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.7);
    }

    40% {
        opacity: 1;
        transform: translate(-50%, -90%) scale(1.15);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -140%) scale(0.85);
    }
}

/* ── Adoption page ─────────────────────────────────────────────────────── */

.adoption-account-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(79, 140, 255, 0.12);
    border: 1px solid rgba(79, 140, 255, 0.25);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.adoption-account-link {
    font-size: 0.85rem;
    color: #4f8cff;
}

.adoption-guest-notice {
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255, 180, 60, 0.12);
    border: 1px solid rgba(255, 180, 60, 0.30);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.adoption-rules {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.adoption-rules ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
    font-size: 0.88rem;
    opacity: 0.85;
}

.adoption-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.adoption-hint {
    font-size: 0.82rem;
    opacity: 0.7;
    margin: -8px 0 12px;
}

.adoption-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.adoption-empty {
    text-align: center;
    opacity: 0.6;
    padding: 20px 0;
    font-size: 0.9rem;
}

.adoption-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.adoption-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.adoption-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.adoption-card-preview {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, rgba(160, 214, 255, 0.24) 0%, rgba(220, 244, 255, 0.16) 54%, rgba(102, 164, 88, 0.16) 55%, rgba(56, 103, 57, 0.22) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.adoption-card-preview canvas {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
}

.adoption-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.adoption-card-meta {
    font-size: 0.8rem;
    opacity: 0.7;
}

.adoption-card-status {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.adoption-stat-chip {
    min-width: 0;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(6, 12, 24, 0.22);
    display: grid;
    gap: 2px;
}

.adoption-stat-chip strong {
    font-size: 0.9rem;
    color: #fff;
}

.adoption-stat-chip span {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

.adoption-care-note {
    margin-top: 8px;
    font-size: 0.76rem;
    color: #a7f3d0;
}

.adoption-card-cost {
    font-size: 0.82rem;
    color: #ffd93d;
    font-weight: 600;
}

.adoption-login-hint {
    font-size: 0.78rem;
    opacity: 0.55;
    flex-shrink: 0;
}

.adoption-adopt-btn,
.adoption-list-btn {
    flex-shrink: 0;
    min-width: 90px;
    font-size: 0.85rem;
}

.adoption-status-btn {
    min-width: 84px;
    font-size: 0.82rem;
}

.adoption-modal-panel {
    width: min(560px, 100%);
    text-align: left;
}

.adoption-modal-panel h2,
.adoption-modal-panel p {
    text-align: left;
}

.adoption-modal-body {
    display: grid;
    gap: 14px;
}

.adoption-modal-summary {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.adoption-modal-summary-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
}

.adoption-modal-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.adoption-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adoption-modal-tag {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.76rem;
    font-weight: 700;
}

.adoption-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.adoption-modal-stat {
    padding: 12px 13px;
    border-radius: 12px;
    background: rgba(8, 14, 28, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 4px;
}

.adoption-modal-stat-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.68;
}

.adoption-modal-stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.adoption-modal-note {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(95, 195, 255, 0.10);
    border: 1px solid rgba(95, 195, 255, 0.22);
    color: #dff4ff;
    font-size: 0.86rem;
    line-height: 1.5;
}

@media (max-width: 680px) {
    .adoption-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .adoption-card-body {
        min-width: min(100%, 240px);
    }

    .adoption-card-actions {
        width: 100%;
        justify-content: stretch;
    }

    .adoption-card-actions .btn,
    .adoption-card-actions .app-modal-btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .adoption-card-status,
    .adoption-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.babysitting-panel {
    display: grid;
    gap: 18px;
    max-width: 1120px;
    margin: 0 auto;
}

.babysitting-rules {
    padding: 14px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.babysitting-rules ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
    font-size: 0.9rem;
    opacity: 0.9;
}

.babysitting-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 16px;
    align-items: start;
}

.babysitting-column,
.babysitting-section {
    display: grid;
    gap: 12px;
}

.babysitting-section {
    padding: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.babysitting-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.babysitting-form-grid,
.babysitting-revoke-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.babysitting-revoke-grid {
    grid-template-columns: 1fr;
}

.babysitting-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.babysitting-field span {
    font-size: 0.8rem;
    opacity: 0.76;
}

.babysitting-textarea {
    min-height: 96px;
    resize: vertical;
}

.babysitting-inline-note {
    margin: 0;
    font-size: 0.82rem;
    opacity: 0.72;
}

.babysitting-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.babysitting-card {
    align-items: flex-start;
}

.babysitting-applications {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.babysitting-application-list {
    display: grid;
    gap: 10px;
}

.babysitting-application-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(6, 12, 24, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.babysitting-modal-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    line-height: 1.55;
}

@media (max-width: 940px) {
    .babysitting-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .babysitting-form-grid {
        grid-template-columns: 1fr;
    }

    .babysitting-application-row {
        flex-direction: column;
    }
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* vscode hook test Sun May 10 02:37:53 CEST 2026 */
