* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    width: 100%;
    position: fixed;
    /* -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none; */
}

/* Забезпечуємо правильне масштабування для мобільних */
@media (max-width: 768px) {
    html {
        font-size: clamp(14px, 2vw, 16px);
    }
    
    body {
        position: fixed;
        width: 100vw;
        height: 100dvh;
        overflow: hidden;
    }
}

@keyframes backgroundShift {
    0%, 100% {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    50% {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    }
}

.journey-preview {
    width: min(920px, 94vw);
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
}

#run-progress {
    width: min(1040px, 97%);
    margin: 10px auto 0;
    display: none;
}

.journey-label {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    min-width: 64px;
}

.journey-label.finish {
    text-align: right;
    min-width: 84px;
}

.journey-track {
    position: relative;
    flex: 1;
    height: 84px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(180, 230, 255, 0.22) 0%, rgba(90, 140, 90, 0.38) 100%);
    border: 2px solid rgba(255, 255, 255, 0.32);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.track-line {
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: 16px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #7f5b37 0%, #976e44 50%, #7f5b37 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.track-items {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 8px;
    bottom: 0;
    pointer-events: none;
}

.track-item {
    position: absolute;
    top: 2px;
    transform: translateX(-50%);
    font-size: 19px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
    animation: previewFloat 1.9s ease-in-out infinite;
}

.track-item-image {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    image-rendering: auto;
}

.track-item.lane-1 {
    top: 1px;
}

.track-item.lane-2 {
    top: 21px;
}

.track-item.lane-3 {
    top: 40px;
}

.track-item.hazard {
    opacity: 0.86;
    transform: translateX(-50%) scale(0.86);
}

.track-item.passed {
    opacity: 0.32;
    transform: translateX(-50%) scale(0.82);
}

.track-item.star {
    animation-delay: 0.25s;
}

.track-item.key {
    animation-delay: 0.45s;
}

.track-item.spike {
    animation-delay: 0.65s;
}

.runner {
    position: absolute;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

.runner-pig {
    left: 8%;
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
    transition: left 80ms linear;
}

#runner-pig-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.runner-pig.running {
    animation: pigRunStep 0.26s ease-in-out infinite;
}

.runner-flag {
    left: 12%;
    font-size: 30px;
    opacity: 0.95;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
    transition: left 120ms linear;
}

@keyframes pigRunStep {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-3px);
    }
}

@keyframes previewFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

#game-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: block;
    background: #000;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100vw;
    height: 100dvh;
    touch-action: none;
}

/* ===== Катсцена-діалог (капібара) ===== */
.cutscene-dialog {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 16px max(20px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.12) 40%, transparent 70%);
    pointer-events: auto;
}

.cutscene-dialog.hidden { display: none; }

.cutscene-box {
    width: min(720px, 100%);
    display: flex;
    align-items: flex-end;
    gap: 14px;
    animation: cutsceneIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cutsceneIn {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cutscene-portrait {
    flex: 0 0 auto;
    width: clamp(72px, 18vw, 110px);
    height: clamp(72px, 18vw, 110px);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(40px, 10vw, 64px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.85);
    overflow: hidden;
    animation: cutsceneBob 2.6s ease-in-out infinite;
}

.cutscene-portrait img { width: 100%; height: 100%; object-fit: cover; }
.cutscene-portrait span { line-height: 1; }

.cutscene-portrait--capy { background: linear-gradient(160deg, #b98a5e 0%, #8a5f38 100%); }
.cutscene-portrait--pig  { background: linear-gradient(160deg, #ffd9a0 0%, #e2a96b 100%); }

@keyframes cutsceneBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.cutscene-content {
    flex: 1;
    min-width: 0;
    background: linear-gradient(160deg, #fffaf0 0%, #fdeccf 100%);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}

.cutscene-name {
    font-weight: 900;
    font-size: clamp(15px, 2.6vw, 19px);
    color: #8a5f38;
    margin-bottom: 6px;
}

.cutscene-text {
    margin: 0 0 12px;
    font-size: clamp(14px, 2.4vw, 17px);
    line-height: 1.5;
    color: #4a3a22;
}

.cutscene-next {
    display: block;
    margin-left: auto;
    padding: 10px 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd166 0%, #f0a020 100%);
    color: #3a2a00;
    font-size: clamp(14px, 2.4vw, 16px);
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(240, 160, 32, 0.45);
    transition: transform 0.12s ease;
}

.cutscene-next:hover { transform: translateY(-2px); }
.cutscene-next:active { transform: scale(0.96); }

#build-badge {
    position: fixed;
    left: max(4px, env(safe-area-inset-left));
    bottom: max(4px, env(safe-area-inset-bottom));
    z-index: 99999;
    font-size: 10px;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.28);
    padding: 2px 6px;
    border-radius: 6px;
    pointer-events: none;
    user-select: none;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    pointer-events: none;
    z-index: 10;
}

#hud {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(4px, 1.5vw, 16px);
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    padding: clamp(6px, 1.5vw, 14px) clamp(8px, 2vw, 20px);
    border-radius: clamp(8px, 2vw, 14px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 95%;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    font-weight: bold;
    font-size: clamp(11px, 2vw, 16px);
    color: #333;
    padding: clamp(4px, 1vw, 9px) clamp(8px, 1.5vw, 16px);
    background: rgba(230, 240, 255, 0.95);
    border-radius: clamp(8px, 1.5vw, 12px);
    min-width: max(50px, 12vw);
    justify-content: center;
    border: clamp(1px, 0.2vw, 3px) solid rgba(100, 150, 220, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.legacy-collect-counter {
    display: none;
}

.health-count-chip {
    display: none;
}

.level-items-hud {
    display: contents;
}

.level-item-chip {
    min-width: clamp(58px, 5.6vw, 82px);
    padding-inline: clamp(6px, 0.8vw, 10px);
    background: rgba(229, 255, 222, 0.96);
    border-color: rgba(72, 178, 77, 0.96);
}

.level-item-chip .level-item-count {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.level-item-chip.complete {
    border-color: #f0bd36;
    background: rgba(220, 255, 232, 0.96);
    box-shadow: 0 0 12px rgba(255, 212, 80, 0.34);
}

.hud-item.progress {
    background: rgba(135, 206, 235, 0.8);
    padding: 9px 18px;
    border-radius: 12px;
    border: 3px solid rgba(80, 160, 210, 1);
    min-width: 96px;
}

#hud-timer-wrap {
    min-width: 88px;
}

#hud-timer {
    display: inline-block;
    min-width: 4ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    animation: none;
    transition: none;
}

.icon {
    font-size: clamp(14px, 2.5vw, 18px);
}

#level-info {
    position: absolute;
    top: clamp(6px, 1.5vh, 10px);
    right: clamp(6px, 1.5vw, 12px);
    background: rgba(255, 255, 255, 0.95);
    padding: clamp(4px, 1vw, 8px) clamp(8px, 1.5vw, 14px);
    border-radius: clamp(6px, 1.5vw, 10px);
    font-weight: bold;
    font-size: clamp(10px, 1.8vw, 14px);
    color: #333;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

#game-pause-btn {
    position: absolute;
    top: clamp(44px, 7vh, 60px);
    right: clamp(6px, 1.5vw, 12px);
    width: clamp(38px, 8vw, 48px);
    height: clamp(38px, 8vw, 48px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: clamp(16px, 4vw, 22px);
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    transition: transform 0.12s ease, background 0.12s ease;
    z-index: 12;
}
#game-pause-btn:hover { background: #fff; transform: scale(1.08); }
#game-pause-btn:active { transform: scale(0.94); }

.health-hearts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, 0.45vw, 6px);
    min-width: clamp(108px, 12vw, 146px);
    min-height: 30px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(5px);
    pointer-events: none;
    flex-shrink: 0;
}

.health-heart {
    width: clamp(17px, 2vw, 24px);
    height: clamp(17px, 2vw, 24px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 1.9vw, 23px);
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.health-heart.empty {
    opacity: 0.42;
    filter: grayscale(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ===== SPLASH SCREEN ===== */
#game-container.splash-only > *:not(#splash-screen) {
    display: none !important;
}

#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(175deg, #8bd8f0 0%, #6ec87a 60%, #3d9e3d 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: opacity 0.7s ease;
}

.splash-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    z-index: 0;
}

#splash-screen.hidden {
    display: none;
}

#splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-btn-wrap {
    position: relative;
    z-index: 1;
    margin-bottom: 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(480px, 88vw);
}

#splash-loading-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.splash-loading-label {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    letter-spacing: 1px;
}

.splash-bar-outer {
    width: 100%;
    height: 18px;
    background: rgba(0,0,0,0.38);
    border-radius: 99px;
    border: 2px solid rgba(255,255,255,0.35);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.splash-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, #ff6b35 0%, #f7c948 60%, #ffe97a 100%);
    box-shadow: 0 0 14px rgba(255,150,30,0.8);
    transition: width 0.25s ease;
}

#splash-start-btn {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 900;
    padding: 18px 60px;
    border-radius: 60px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #ff6b35 0%, #f7c948 100%);
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    box-shadow: 0 8px 32px rgba(255,100,30,0.55), 0 2px 0 rgba(0,0,0,0.18);
    letter-spacing: 1.5px;
    transition: transform 0.12s, box-shadow 0.12s, opacity 0.3s;
    animation: splashBtnPulse 1.8s ease-in-out infinite;
    opacity: 0;
    pointer-events: none;
}

#splash-start-btn.ready {
    opacity: 1;
    pointer-events: auto;
}

#splash-start-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 40px rgba(255,100,30,0.7);
}

#splash-start-btn:active {
    transform: scale(0.96);
}

#splash-google-btn {
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #273044;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 24px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: clamp(15px, 2vw, 18px);
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.18s ease;
}

#splash-google-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

#splash-google-btn:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
}

.splash-google-mark {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background:
        linear-gradient(90deg, #4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75% 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

@keyframes splashBtnPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(255,100,30,0.55), 0 2px 0 rgba(0,0,0,0.18); }
    50%       { box-shadow: 0 8px 50px rgba(255,180,30,0.85), 0 2px 0 rgba(0,0,0,0.18); }
}

.game-tutorial {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(23, 39, 40, 0.34);
    backdrop-filter: blur(4px);
}

.game-tutorial.hidden {
    display: none;
}

.game-tutorial-card {
    position: relative;
    width: min(520px, 92vw);
    min-height: 520px;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 238, 182, 0.78);
    background:
        linear-gradient(180deg, rgba(255, 253, 244, 0.97), rgba(255, 239, 204, 0.96)),
        #fff8e8;
    box-shadow: 0 18px 50px rgba(46, 24, 8, 0.36);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #3d2410;
    text-align: center;
}

.tutorial-skip-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid rgba(125, 78, 31, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #7a4a1f;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.tutorial-step-label {
    width: fit-content;
    margin: 0 auto 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #f1e7d1;
    color: #7b4c24;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.6px;
}

.tutorial-art {
    position: relative;
    width: min(360px, 78vw);
    height: 150px;
    margin: 0 auto 16px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #86d8f3 0 60%, #72be65 61%);
    border: 2px solid rgba(255,255,255,0.7);
    box-shadow: inset 0 -18px 0 rgba(88, 112, 42, 0.14);
}

.tutorial-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    height: 10px;
    background: #83572e;
}

.tutorial-pig {
    position: absolute;
    left: 56px;
    bottom: 38px;
    width: 52px;
    height: 38px;
    border-radius: 50% 46% 46% 50%;
    background: #9b6a3c;
    box-shadow: inset 19px 0 0 #d7a067, 0 6px 12px rgba(50, 28, 10, 0.18);
    animation: tutorialBob 1s ease-in-out infinite;
}

.tutorial-pig::before {
    content: "";
    position: absolute;
    right: 6px;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #21140c;
}

.tutorial-carrot {
    position: absolute;
    right: 86px;
    top: 52px;
    width: 36px;
    height: 12px;
    border-radius: 999px 4px 4px 999px;
    background: #ff8a35;
    transform: rotate(-18deg);
}

.tutorial-carrot::after {
    content: "";
    position: absolute;
    right: -8px;
    top: -6px;
    width: 14px;
    height: 14px;
    border-radius: 3px 10px;
    background: #69bb5c;
}

.tutorial-star {
    position: absolute;
    right: 38px;
    top: 34px;
    width: 26px;
    height: 26px;
    background: #ffd95e;
    clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 34%);
    animation: tutorialBob 1.4s ease-in-out infinite;
}

.tutorial-art--controls::before,
.tutorial-art--controls::after {
    content: "";
    position: absolute;
    bottom: 34px;
    width: 62px;
    height: 62px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 -4px 0 rgba(87, 55, 29, 0.09);
}

.tutorial-art--controls::before {
    left: 62px;
}

.tutorial-art--controls::after {
    right: 62px;
}

.tutorial-art--controls .tutorial-pig {
    left: calc(50% - 26px);
    bottom: 88px;
}

.tutorial-art--controls .tutorial-carrot,
.tutorial-art--controls .tutorial-star {
    display: none;
}

.tutorial-art--items .tutorial-pig {
    left: 28px;
}

.tutorial-art--quiz .tutorial-pig {
    left: calc(50% - 26px);
}

.tutorial-art--quiz .tutorial-carrot {
    right: 34px;
}

@keyframes tutorialBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.tutorial-title {
    margin: 0 0 8px;
    color: #603204;
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.06;
    text-shadow: 0 2px 0 #ffd78e;
}

.tutorial-text {
    margin: 0 auto 16px;
    max-width: 430px;
    color: #724519;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.55;
}

.tutorial-options {
    display: grid;
    gap: 8px;
    margin: 12px auto;
    max-width: 430px;
}

.tutorial-option-btn {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #e4b56f;
    border-radius: 8px;
    background: #fffdf8;
    color: #4d2d11;
    font-family: inherit;
    font-size: 14px;
    font-weight: 850;
    cursor: pointer;
}

.tutorial-option-btn--correct {
    background: #dff8cf;
    border-color: #62bd6c;
    color: #245f11;
}

.tutorial-option-btn--wrong {
    background: #ffd5dc;
    border-color: #e35b75;
    color: #8a1730;
}

.tutorial-feedback {
    margin: 10px auto 0;
    max-width: 430px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

.tutorial-feedback--ok {
    background: #dff8cf;
    color: #245f11;
}

.tutorial-feedback--bad,
.tutorial-feedback--hint {
    background: #fff0bd;
    color: #765011;
}

.tutorial-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.tutorial-nav-btn {
    min-width: 130px;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid #ff8b3d;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff7b32, #f7c948);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(255, 139, 61, 0.22);
}

.tutorial-nav-btn--ghost {
    background: #fffdf8;
    color: #70461d;
    box-shadow: none;
}

.tutorial-nav-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

@media (max-width: 520px) {
    .game-tutorial {
        padding: 10px;
    }

    .game-tutorial-card {
        min-height: 0;
        padding: 16px 12px;
    }

    .tutorial-skip-btn {
        position: static;
        display: block;
        margin-left: auto;
        margin-bottom: 8px;
    }

    .tutorial-art {
        height: 128px;
    }

    .tutorial-actions {
        flex-direction: column;
    }

    .tutorial-nav-btn {
        width: 100%;
    }
}
/* ===== END SPLASH ===== */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 10, 35, 0.62);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 100;
    padding: max(clamp(8px, 2vh, 16px), env(safe-area-inset-top)) max(clamp(8px, 2vw, 16px), env(safe-area-inset-right)) max(clamp(8px, 2vh, 16px), env(safe-area-inset-bottom)) max(clamp(8px, 2vw, 16px), env(safe-area-inset-left));
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: clamp(38px, 5vw, 60px);
    margin-bottom: 14px;
    line-height: 1.12;
    letter-spacing: 0.3px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.screen h2 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: clamp(20px, 2.2vw, 34px);
    font-weight: 600;
    margin-bottom: 24px;
    opacity: 0.98;
}

.menu-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-title-pig {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.35));
}

.game-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.24);
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    margin: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.44);
    filter: brightness(1.08);
}

.game-button:active {
    transform: translateY(0) scale(0.98);
}

.game-button:focus-visible {
    outline: 3px solid rgba(170, 210, 255, 0.95);
    outline-offset: 2px;
}

.game-button:disabled {
    background: linear-gradient(135deg, #555 0%, #444 100%);
    color: rgba(255,255,255,0.45);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
    filter: none !important;
}

.controls-info {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.12);
    padding: 16px 22px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    max-width: min(620px, 92vw);
}

.controls-info p {
    margin: 5px 0;
    font-size: 16px;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.control-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#level-stats {
    font-size: 18px;
    margin-bottom: 20px;
    line-height: 1.6;
}

#touch-controls {
    position: absolute;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 25;
    pointer-events: none;
}

.touch-btn {
    pointer-events: auto;
    width: clamp(54px, 12vw, 72px);
    height: clamp(54px, 12vw, 72px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(30, 45, 70, 0.45);
    color: #fff;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
    transform: scale(0.95);
    background: rgba(30, 45, 70, 0.65);
}

.touch-btn.move {
    margin-right: 8px;
}

.touch-btn.jump {
    margin-left: auto;
    background: rgba(36, 88, 170, 0.55);
}

.touch-btn.shoot {
    margin-left: 10px;
    background: rgba(60, 160, 50, 0.58);
    border-color: rgba(80, 200, 60, 0.85);
    font-size: 24px;
}

.touch-btn.shield-block {
    margin-left: 6px;
    background: rgba(30, 90, 200, 0.62);
    border-color: rgba(100, 180, 255, 0.9);
    font-size: 22px;
}
.touch-btn.shield-block:active,
.touch-btn.shield-block.pressed {
    background: rgba(80, 160, 255, 0.82);
    box-shadow: 0 0 18px rgba(100, 200, 255, 0.8);
    transform: scale(0.93);
}

@media (max-width: 768px) {
    #hud {
        gap: 4px !important;
        padding: 4px 6px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        scrollbar-width: none;
        max-width: 100% !important;
        background: rgba(255,255,255,0.88);
        box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    }
    #hud::-webkit-scrollbar { display: none; }

    .hud-item {
        font-size: 11px !important;
        min-width: unset !important;
        padding: 3px 7px !important;
        border-width: 1px !important;
        gap: 3px !important;
        flex-shrink: 0 !important;
    }

    .icon {
        font-size: 13px !important;
    }

    #level-info {
        font-size: 11px;
        padding: 4px 8px;
        top: 7px;
        right: 8px;
    }

    .screen h1 {
        font-size: 32px;
    }

    .screen h2 {
        font-size: 24px;
    }

    #touch-controls {
        display: flex;
    }

    .journey-preview {
        gap: 6px;
        margin-bottom: 8px;
    }

    #run-progress {
        margin: 4px auto 0;
    }

    .journey-label {
        font-size: 10px;
        min-width: 32px;
    }

    .journey-label.finish {
        min-width: 42px;
    }

    .journey-track {
        height: 50px;
    }

    .track-line {
        bottom: 10px;
        height: 7px;
    }

    .track-item {
        font-size: 15px;
    }

    .track-item-image {
        width: 16px;
        height: 16px;
    }

    .track-item.lane-2 {
        top: 14px;
    }

    .track-item.lane-3 {
        top: 27px;
    }

    .runner-pig {
        width: 24px;
        height: 24px;
        bottom: 10px;
    }

    .runner-flag {
        font-size: 18px;
        bottom: 10px;
    }

    .touch-btn {
        width: 72px;
        height: 72px;
        font-size: 30px;
    }

    .touch-btn.jump {
        width: 80px;
        height: 80px;
        font-size: 34px;
    }

    #touch-controls {
        bottom: max(18px, env(safe-area-inset-bottom));
    }

    .menu-title {
        gap: 10px;
    }

    .menu-title-pig {
        width: 38px;
        height: 38px;
    }

    .controls-info {
        margin-top: 18px;
        padding: 12px 14px;
    }

    .controls-row {
        gap: 8px;
    }

    .control-chip {
        padding: 4px 9px;
        font-size: 14px;
    }
}

/* Екран вибору рівнів */
#level-select-screen {
    overflow-y: auto;
    width: 100%;
    height: 100%;
    max-height: none;
}

.level-progress {
    background: rgba(255, 255, 255, 0.24);
    padding: 12px 24px;
    border-radius: 999px;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: bold;
}

/* ============ СВІТИ (WORLD CARDS) ============ */
.ls-title {
    text-align: center;
    font-size: clamp(22px, 5vw, 34px);
    font-weight: 900;
    letter-spacing: 1px;
    margin: 4px 0 12px;
    color: #FFD86A;
    text-shadow: 0 3px 0 rgba(120, 60, 0, 0.65), 0 6px 14px rgba(0,0,0,0.4);
}

.worlds-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: min(720px, 96vw);
    margin: 12px auto 18px;
}

.world-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 4px solid rgba(255, 220, 130, 0.75);
    box-shadow: 0 10px 26px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
    color: #fff;
    aspect-ratio: 3 / 4.4;
    min-height: 260px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.world-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(0,0,0,0.55); }

.world-card-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.world-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 8px 8px 10px;
    pointer-events: none;
}

.world-card-banner {
    position: relative;
    padding: 8px 6px 8px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(40, 25, 8, 0.78) 0%, rgba(20, 10, 0, 0.85) 100%);
    border: 2px solid rgba(255, 210, 110, 0.65);
    border-radius: 10px;
    margin-bottom: 6px;
    color: #FFE9A8;
    text-shadow: 0 2px 0 rgba(60,20,0,0.7), 0 0 8px rgba(255,180,60,0.4);
    font-weight: 900;
    font-size: clamp(13px, 3.2vw, 16px);
    line-height: 1.05;
    letter-spacing: 0.4px;
    pointer-events: none;
}
.world-card-subtitle {
    display: block;
    margin-top: 3px;
    font-size: clamp(9px, 2.4vw, 11px);
    font-weight: 700;
    color: rgba(255, 220, 160, 0.85);
    letter-spacing: 0.3px;
}

.world-pin {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff5d8, #d59a3a 80%);
    border: 2.5px solid #5a2c00;
    color: #3a1900;
    font-weight: 900;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.5);
    padding: 0;
    line-height: 1;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: transform .12s;
    pointer-events: auto;
}
.world-pin:hover { transform: translate(-50%, -50%) scale(1.15); }
.world-pin--completed { background: radial-gradient(circle at 30% 30%, #fff9b3, #f5b620 80%); }
.world-pin--current {
    background: radial-gradient(circle at 30% 30%, #c8ffce, #4CD964 80%);
    box-shadow: 0 0 0 3px rgba(76,217,100,0.55), 0 3px 6px rgba(0,0,0,0.45);
    animation: pinPulse 1.4s ease-in-out infinite;
}
@keyframes pinPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(76,217,100,0.55), 0 3px 6px rgba(0,0,0,0.45); }
    50%      { box-shadow: 0 0 0 6px rgba(76,217,100,0.25), 0 3px 8px rgba(0,0,0,0.55); }
}
.world-pin--locked {
    background: radial-gradient(circle at 30% 30%, #777, #333 80%);
    color: rgba(255,255,255,0.65);
    cursor: not-allowed;
}
.world-pin--locked > span { font-size: 11px; }

.world-card-play {
    pointer-events: auto;
    background: linear-gradient(180deg, #58c44a 0%, #2e8a25 100%);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
    padding: 6px 14px;
    border-radius: 14px;
    font-size: clamp(11px, 3vw, 14px);
    font-weight: 900;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    align-self: center;
    text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.world-card-play--locked {
    background: linear-gradient(180deg, #888 0%, #555 100%);
    cursor: not-allowed;
}

.world-card--locked {
    filter: grayscale(0.55) brightness(0.65);
    cursor: not-allowed;
}

/* ============ КАРУСЕЛЬ РІВНІВ (legacy, не використовується) ============ */
.level-carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 24px;
}

.level-carousel {
    flex: 1;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.level-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-nav {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.carousel-nav:hover:not(:disabled) {
    background: linear-gradient(135deg, #7d8a93 0%, #5a6268 100%);
    transform: scale(1.08);
}

.carousel-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Стилі кнопок рівнів у карусельці */
.level-carousel .level-button {
    position: relative;
    width: 160px;
    height: 180px;
    padding: 12px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    background: linear-gradient(180deg, #7f6a61 0%, #58473f 78%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 8px 0 rgba(65, 43, 31, 0.35), 0 12px 18px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.level-carousel .level-button:hover:not(.locked) {
    transform: translateY(-8px);
    box-shadow: 0 12px 0 rgba(65, 43, 31, 0.35), 0 16px 26px rgba(0, 0, 0, 0.35);
}

.level-carousel .level-button.unlocked {
    background: linear-gradient(180deg, #8c7a72 0%, #4d3e38 82%);
}

.level-carousel .level-button.unlocked:hover {
    background: linear-gradient(180deg, #a08b7f 0%, #5a463f 82%);
}

.level-carousel .level-button.completed {
    background: linear-gradient(180deg, #d2b36a 0%, #8f6530 80%);
}

.level-carousel .level-button.completed:hover {
    background: linear-gradient(180deg, #d4b063 0%, #8e6631 80%);
}

.level-carousel .level-button.locked {
    background: linear-gradient(180deg, #616161 0%, #3e3e3e 82%);
    cursor: not-allowed;
    opacity: 0.7;
}

.level-carousel .level-button.level-button--next {
    box-shadow: 0 8px 0 rgba(65, 43, 31, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.4), 0 0 22px rgba(255, 241, 130, 0.7);
    animation: cardPulse 1.8s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { box-shadow: 0 8px 0 rgba(65,43,31,0.35), 0 0 0 3px rgba(255,255,255,0.4), 0 0 22px rgba(255,241,130,0.7); }
    50%      { box-shadow: 0 8px 0 rgba(65,43,31,0.35), 0 0 0 5px rgba(255,255,255,0.6), 0 0 36px rgba(255,241,130,0.9); }
}

.level-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.level-number {
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.level-icon {
    font-size: 16px;
}

.level-icon::before {
    content: '▶️';
}

.level-carousel .level-button.locked .level-icon::before {
    content: '🔒';
}

.level-carousel .level-button.completed .level-icon::before {
    content: '✓';
    color: #ffd700;
}

.level-name {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    opacity: 0.95;
}

.level-stars {
    display: flex;
    gap: 4px;
    margin-top: auto;
    font-size: 14px;
}

.lstar {
    color: rgba(255, 255, 255, 0.3);
}

.lstar.lstar--on {
    color: #ffd700;
}

.level-card-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.level-card-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Точки навігації карусельки */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.3);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Анімація появи кнопок */
.level-button-popin {
    animation: cardPopin 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardPopin {
    from { transform: scale(0.6) rotateY(90deg); opacity: 0; }
    to   { transform: scale(1) rotateY(0); opacity: 1; }
}

/* Статистика на екрані вибору рівня */
.level-select-stats {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 8px 26px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.96);
    margin-bottom: 12px;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.level-button .level-number {
    font-size: clamp(26px, calc(var(--node-size, 86px) * 0.48), 42px);
    line-height: 1;
    margin-bottom: 2px;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.level-button .level-icon {
    font-size: clamp(14px, calc(var(--node-size, 86px) * 0.24), 20px);
}

.level-button.locked .level-icon::before {
    content: '🔒';
}

.level-button.unlocked .level-icon::before {
    content: '▶️';
}

.level-button.completed .level-icon::before {
    content: '';
}

.game-button.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    margin-top: 10px;
}

.game-button.secondary:hover {
    background: linear-gradient(135deg, #7d8a93 0%, #5a6268 100%);
}

.game-button.small {
    padding: 10px 22px;
    font-size: 16px;
    margin: 6px;
}

/* ============ ЕКРАН ПАУЗИ (ігровий стиль) ============ */
#pause-screen {
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(120, 90, 220, 0.45) 0%, rgba(40, 25, 80, 0.55) 55%, rgba(15, 10, 35, 0.72) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#pause-screen .pause-card {
    position: relative;
    width: min(88vw, 380px);
    padding: clamp(22px, 4vw, 34px) clamp(20px, 4vw, 32px) clamp(24px, 4vw, 32px);
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 240, 255, 0.94) 100%);
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 18px 50px rgba(20, 12, 50, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.9);
    color: #2c2350;
    overflow: hidden;
    animation: pause-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#pause-screen .pause-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8px;
    background: linear-gradient(90deg, #ffd166, #ff8fab, #a78bfa, #6ee7b7);
}

@keyframes pause-pop {
    from { opacity: 0; transform: scale(0.82) translateY(18px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#pause-screen .pause-emoji {
    font-size: clamp(46px, 11vw, 62px);
    line-height: 1;
    margin: 4px 0 6px;
    filter: drop-shadow(0 6px 10px rgba(80, 50, 160, 0.35));
    animation: pause-bob 2.4s ease-in-out infinite;
}

@keyframes pause-bob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-7px) rotate(3deg); }
}

#pause-screen h2 {
    margin: 0;
    font-size: clamp(30px, 7vw, 40px);
    color: #5b3fb0;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

#pause-screen .pause-sub {
    margin: 4px 0 18px;
    font-size: clamp(14px, 3.5vw, 17px);
    font-weight: 600;
    color: #8a7fb0;
}

#pause-screen .pause-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

#pause-screen .pause-actions .game-button {
    width: 100%;
    margin: 0;
    padding: 14px 22px;
    font-size: clamp(16px, 4vw, 19px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(70, 45, 140, 0.28);
}

#pause-screen .pause-actions .btn-ic {
    font-size: 1.05em;
    line-height: 1;
}

/* Декоративні елементи, що плавають у картці */
#pause-screen .pause-card-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#pause-screen .pause-spark {
    position: absolute;
    font-size: clamp(16px, 4vw, 22px);
    opacity: 0.85;
    animation: pause-float 3.6s ease-in-out infinite;
}

#pause-screen .pause-spark-1 { top: 12px;  left: 16px;  animation-delay: 0s; }
#pause-screen .pause-spark-2 { top: 18px;  right: 18px; animation-delay: 0.7s; }
#pause-screen .pause-spark-3 { bottom: 14px; left: 22px; animation-delay: 1.4s; font-size: 16px; }

@keyframes pause-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
    50%      { transform: translateY(-8px) scale(1.12); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    #pause-screen .pause-card,
    #pause-screen .pause-emoji,
    #pause-screen .pause-spark { animation: none; }
}

/* Reference-style level map */
#level-select-screen {
    position: absolute;
    inset: 0;
    justify-content: flex-start;
    overflow: hidden;
    padding: clamp(8px, 1.4vh, 16px) clamp(58px, 6vw, 90px) clamp(18px, 2vh, 26px);
    background:
        radial-gradient(circle at 50% 118%, rgba(52, 215, 235, 0.34), transparent 28%),
        radial-gradient(circle at 12% 42%, rgba(17, 197, 145, 0.22), transparent 23%),
        radial-gradient(circle at 88% 50%, rgba(255, 116, 31, 0.18), transparent 24%),
        linear-gradient(180deg, rgba(8, 34, 62, 0.86), rgba(10, 52, 64, 0.8)),
        url("assets/bg-ladders.webp") center / cover no-repeat;
}

#level-select-screen::before,
#level-select-screen::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(42px, 5vw, 70px);
    z-index: 0;
    background:
        linear-gradient(180deg, rgba(24, 59, 70, 0.98), rgba(11, 35, 48, 0.98)),
        repeating-linear-gradient(180deg, transparent 0 58px, rgba(58, 246, 255, 0.26) 59px 62px);
    border-inline: 3px solid rgba(45, 239, 255, 0.35);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 242, 255, 0.2);
}

#level-select-screen::before { left: 0; }
#level-select-screen::after { right: 0; }

#level-select-screen .ls-title {
    position: relative;
    z-index: 2;
    margin: 0 0 clamp(8px, 1.6vh, 16px);
    font-size: clamp(34px, 5.1vw, 66px);
    line-height: 0.96;
    color: #ffd95b;
    -webkit-text-stroke: 2px #5a2300;
    text-shadow:
        0 4px 0 #9c3a05,
        0 8px 0 rgba(0, 0, 0, 0.36),
        0 0 20px rgba(255, 202, 62, 0.55);
    letter-spacing: 0;
}

#level-select-screen .level-progress,
#level-select-screen .level-select-stats {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

#level-select-screen .worlds-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: clamp(12px, 1.6vw, 22px);
    width: min(1120px, calc(100vw - 130px));
    margin: 0 auto;
    padding: clamp(12px, 1.8vh, 18px) clamp(10px, 1.2vw, 14px) clamp(16px, 2vh, 22px);
    border: 3px solid rgba(41, 230, 255, 0.72);
    border-radius: 8px;
    background: rgba(8, 72, 97, 0.36);
    box-shadow:
        0 0 18px rgba(27, 222, 255, 0.55),
        inset 0 0 28px rgba(28, 220, 255, 0.18);
}

#level-select-screen .world-card {
    min-height: 0;
    aspect-ratio: 0.62;
    border-width: 5px;
    border-radius: 15px;
    transform: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

#level-select-screen .world-card:hover {
    transform: translateY(-2px);
}

#level-select-screen .world-card-map,
#level-select-screen .world-scene,
#level-select-screen .scene-layer {
    position: absolute;
    inset: 0;
}

#level-select-screen .world-scene {
    overflow: hidden;
    background: #7cc96e;
}

#level-select-screen .scene-layer {
    pointer-events: none;
}

#level-select-screen .world-card-overlay {
    justify-content: flex-end;
    align-items: center;
    gap: clamp(2px, 0.6vh, 5px);
    padding: 0 clamp(7px, 0.8vw, 10px) clamp(10px, 1.6vh, 14px);
    background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 3;
}

#level-select-screen .world-card-banner {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff46e;
    -webkit-text-stroke: 1px #284d0a;
    font-size: clamp(21px, 2.2vw, 30px);
    line-height: 0.9;
    text-shadow: 0 3px 0 rgba(20, 71, 10, 0.95), 0 0 8px rgba(0, 0, 0, 0.55);
}

#level-select-screen .world-card-subtitle {
    margin: 0 0 3px;
    color: #fff7a5;
    font-size: clamp(13px, 1.35vw, 18px);
    text-shadow: 0 2px 0 #52310a, 0 0 7px rgba(0, 0, 0, 0.55);
}

#level-select-screen .world-card-play,
#level-select-screen #back-to-menu-button {
    min-width: clamp(96px, 9vw, 132px);
    margin: 0;
    padding: clamp(5px, 0.8vh, 8px) clamp(15px, 1.5vw, 22px);
    border: 3px solid #ffe479;
    border-radius: 8px;
    background: linear-gradient(180deg, #67df3f, #269617 58%, #176f12);
    color: #ffffff;
    font-size: clamp(14px, 1.4vw, 20px);
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.42), 0 4px 0 rgba(60, 42, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.32);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

#level-select-screen #back-to-menu-button {
    position: relative;
    z-index: 3;
    align-self: flex-end;
    margin-top: clamp(8px, 1.3vh, 14px);
    margin-right: calc((100vw - min(1120px, calc(100vw - 130px))) / 2 + 8px);
    background: linear-gradient(180deg, #f36d43, #bd3723 60%, #842012);
}

#level-select-screen .world-pin {
    width: clamp(19px, 2.15vw, 27px);
    height: clamp(19px, 2.15vw, 27px);
    border: 2px solid rgba(255, 250, 208, 0.92);
    background: radial-gradient(circle at 32% 28%, #fff1c4, #a75c2c 72%);
    color: #ffffff;
    font-size: clamp(9px, 1vw, 12px);
    text-shadow: 0 1px 0 #4a1f0d;
    box-shadow: 0 2px 0 #5d260e, 0 2px 7px rgba(0, 0, 0, 0.55);
}

#level-select-screen .world-pin--completed,
#level-select-screen .world-pin--current {
    background: radial-gradient(circle at 32% 28%, #eaffbd, #4aa52e 72%);
}

#level-select-screen .world-pin--locked {
    filter: none;
    opacity: 1;
    background: radial-gradient(circle at 32% 28%, #fff1c4, #a75c2c 72%);
    color: #ffffff;
    cursor: default;
}

#level-select-screen .world-card--forest {
    border-color: #43d647;
    box-shadow: 0 0 12px rgba(86, 255, 83, 0.8), 0 8px 18px rgba(0, 0, 0, 0.45);
}

#level-select-screen .world-card--forest .world-scene {
    background: linear-gradient(#8bd968 0 58%, #55b43e 58% 100%);
}

#level-select-screen .world-card--forest .scene-sky {
    background:
        radial-gradient(circle at 72% 24%, #f7f4d2 0 4%, transparent 4.5%),
        radial-gradient(circle at 24% 70%, #1c7a31 0 10%, transparent 10.5%),
        radial-gradient(circle at 39% 62%, #248c37 0 12%, transparent 12.5%),
        radial-gradient(circle at 70% 58%, #2e9a3f 0 13%, transparent 13.5%);
}

#level-select-screen .world-card--forest .scene-path {
    background:
        radial-gradient(80% 66% at 52% 78%, transparent 0 32%, #f3c66e 33% 38%, transparent 39%),
        linear-gradient(28deg, transparent 0 30%, #f0c06a 31% 39%, transparent 40%),
        linear-gradient(-24deg, transparent 0 39%, #f0c06a 40% 47%, transparent 48%);
}

#level-select-screen .world-card--forest .scene-mid {
    background:
        linear-gradient(135deg, transparent 0 65%, #5aa7ef 66% 74%, transparent 75%),
        radial-gradient(circle at 70% 18%, #c23d2a 0 4%, transparent 4.5%),
        linear-gradient(0deg, transparent 0 64%, #ddd 64% 74%, transparent 74%);
}

#level-select-screen .world-card--ice {
    border-color: #bff8ff;
    box-shadow: 0 0 12px rgba(146, 244, 255, 0.85), 0 8px 18px rgba(0, 0, 0, 0.45);
}

#level-select-screen .world-card--ice .world-scene {
    background: linear-gradient(#aeefff 0 48%, #e9fbff 48% 100%);
}

#level-select-screen .world-card--ice .scene-back {
    background:
        linear-gradient(135deg, transparent 0 35%, #4ba6d1 36% 50%, transparent 51%),
        linear-gradient(45deg, transparent 0 29%, #eaffff 30% 43%, transparent 44%),
        linear-gradient(-45deg, transparent 0 40%, #72c7e8 41% 55%, transparent 56%);
}

#level-select-screen .world-card--ice .scene-path {
    background:
        radial-gradient(70% 24% at 43% 80%, #78d7f4 0 22%, #eaffff 23% 34%, transparent 35%),
        linear-gradient(28deg, transparent 0 30%, #d8f8ff 31% 39%, transparent 40%);
}

#level-select-screen .world-card--sand {
    border-color: #f2c56d;
    box-shadow: 0 0 12px rgba(255, 202, 96, 0.82), 0 8px 18px rgba(0, 0, 0, 0.45);
}

#level-select-screen .world-card--sand .world-scene {
    background: linear-gradient(#ffe08e 0 36%, #e9ad45 36% 100%);
}

#level-select-screen .world-card--sand .scene-back {
    background:
        radial-gradient(50% 24% at 30% 36%, #e3a544 0 45%, transparent 46%),
        radial-gradient(72% 27% at 70% 58%, #ffd076 0 44%, transparent 45%),
        linear-gradient(24deg, transparent 0 57%, #c58935 58% 61%, transparent 62%);
}

#level-select-screen .world-card--sand .scene-mid {
    background:
        linear-gradient(28deg, transparent 0 54%, #f6cc74 55% 63%, transparent 64%),
        radial-gradient(circle at 28% 50%, #40b966 0 5%, transparent 5.5%);
}

#level-select-screen .world-card--volcano {
    border-color: #e25631;
    box-shadow: 0 0 14px rgba(255, 87, 35, 0.9), 0 8px 18px rgba(0, 0, 0, 0.45);
}

#level-select-screen .world-card--volcano .world-card-play {
    visibility: hidden;
}

#level-select-screen .world-card--volcano .world-scene {
    background: linear-gradient(#3b3332 0 48%, #1d1919 48% 100%);
}

#level-select-screen .world-card--volcano .scene-back {
    background:
        radial-gradient(circle at 70% 16%, #ffb23f 0 5%, transparent 5.5%),
        linear-gradient(135deg, transparent 0 49%, #74392c 50% 68%, transparent 69%),
        linear-gradient(45deg, transparent 0 30%, #2a2526 31% 54%, transparent 55%);
}

#level-select-screen .world-card--volcano .scene-path {
    background:
        linear-gradient(24deg, transparent 0 50%, #ff5d1f 51% 57%, transparent 58%),
        linear-gradient(-28deg, transparent 0 36%, #ff7b1b 37% 43%, transparent 44%),
        radial-gradient(70% 20% at 51% 76%, #ff4a16 0 34%, transparent 35%);
}

@media (max-width: 900px) {
    #level-select-screen {
        padding-inline: 46px;
        overflow-x: auto;
    }

    #level-select-screen .worlds-grid {
        width: 980px;
        max-width: none;
    }

    #level-select-screen #back-to-menu-button {
        margin-right: 0;
    }
}

/* Exact image-based level map */
#level-select-screen {
    padding: 0 !important;
    overflow: hidden !important;
    background: #06121f;
}

#level-select-screen .ls-title,
#level-select-screen .level-progress,
#level-select-screen .level-select-stats,
#level-select-screen > #back-to-menu-button {
    display: none !important;
}

#level-select-screen::before,
#level-select-screen::after {
    display: none;
}

#level-select-screen .worlds-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.level-map-art {
    position: relative;
    width: min(100vw, calc(100dvh * 1.8338));
    aspect-ratio: 1280 / 698;
    max-height: 100dvh;
    overflow: hidden;
}

.level-map-art-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    pointer-events: none;
}

.level-map-hit {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 3;
    border: 0;
    background: transparent;
    color: transparent;
    padding: 0;
    cursor: pointer;
    touch-action: manipulation;
}

.level-map-hit:disabled {
    cursor: default;
}

.level-map-hit--pin {
    width: 2.35%;
    aspect-ratio: 1;
    border-radius: 50%;
}

.level-map-hit--play {
    width: 7.4%;
    height: 5.3%;
    border-radius: 10px;
}

.level-map-hit--back {
    width: 9.0%;
    height: 5.3%;
    border-radius: 10px;
}

.level-map-hit--current {
    box-shadow: 0 0 0 2px rgba(126, 255, 82, 0.75), 0 0 8px rgba(126, 255, 82, 0.7);
}

.level-map-hit--completed {
    box-shadow: 0 0 0 2px rgba(255, 239, 105, 0.6), 0 0 6px rgba(255, 239, 105, 0.65);
}

.level-map-world-lock {
    position: absolute;
    z-index: 4;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(3px, 0.6vw, 8px);
    border-radius: 8px;
    background: rgba(4, 12, 22, 0.42);
    color: #fff6bf;
    font-family: inherit;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 3px 0 rgba(51, 18, 0, 0.72), 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.level-map-world-lock span {
    font-size: clamp(15px, 2.2vw, 32px);
    line-height: 1;
}

.level-map-world-lock small {
    display: block;
    padding: 0.22em 0.6em 0.28em;
    border-radius: 999px;
    background: rgba(255, 190, 42, 0.88);
    color: #5c2200;
    font-size: clamp(10px, 1.25vw, 18px);
    line-height: 1;
    text-shadow: none;
}

.level-map-visible-play {
    position: absolute;
    z-index: 5;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 7.4%;
    height: 5.3%;
    border: 2px solid rgba(255, 246, 180, 0.85);
    border-radius: 8px;
    color: #fff9d8;
    font-size: clamp(12px, 1.7vw, 22px);
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-shadow: 0 2px 0 rgba(76, 22, 0, 0.75);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32), inset 0 -4px 0 rgba(93, 30, 0, 0.35), 0 0 12px rgba(0, 0, 0, 0.45);
    opacity: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.level-map-visible-play:disabled {
    cursor: default;
}

.level-map-visible-play--forest {
    background: linear-gradient(180deg, #9af348 0%, #41c427 55%, #1d7d16 100%);
}

.level-map-visible-play--ice {
    background: linear-gradient(180deg, #62d9ff 0%, #1d8ee6 55%, #0d4f9a 100%);
}

.level-map-visible-play--sand {
    background: linear-gradient(180deg, #ffd35b 0%, #d58618 55%, #9c4a07 100%);
}

.level-map-visible-play--volcano {
    background: linear-gradient(180deg, #ff8b3d 0%, #d94118 55%, #7c170d 100%);
}

.level-map-back-cover {
    display: none;
}

.level-map-visible-back {
    position: absolute;
    z-index: 5;
    transform: translate(-50%, -50%);
    width: 7.6%;
    height: 4.5%;
    border: 2px solid rgba(255, 239, 178, 0.82);
    border-radius: 8px;
    background: linear-gradient(180deg, #ff8652 0%, #ce3a20 55%, #7d190f 100%);
    color: #fff9d8;
    font-size: clamp(10px, 1.2vw, 17px);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 0 rgba(80, 16, 0, 0.75);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), inset 0 -4px 0 rgba(73, 13, 0, 0.35), 0 0 12px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

#forest-level-screen {
    padding: clamp(18px, 4vw, 44px);
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 224, 88, 0.22), transparent 24%),
        linear-gradient(145deg, #09251b 0%, #174a28 46%, #092916 100%);
}

.forest-level-panel {
    width: min(920px, 94vw);
    max-height: min(680px, 92dvh);
    padding: clamp(16px, 3vw, 28px);
    border: 4px solid #62d852;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(25, 92, 42, 0.92), rgba(10, 45, 25, 0.96)),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 8px, transparent 8px 16px);
    box-shadow: 0 0 0 3px rgba(13, 75, 24, 0.9), 0 20px 48px rgba(0, 0, 0, 0.42);
}

.forest-level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: clamp(16px, 3vw, 24px);
}

.forest-level-kicker {
    color: #baff77;
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 900;
    text-shadow: 0 2px 0 #123c1b;
}

.forest-level-title {
    margin: 0;
    color: #ffe76d;
    font-size: clamp(30px, 5vw, 58px);
    line-height: 1;
    text-shadow: 0 4px 0 #5b2d0a, 0 0 14px rgba(255, 238, 117, 0.45);
}

.forest-level-back {
    min-width: 104px;
    min-height: 46px;
    border: 3px solid #ffcf69;
    border-radius: 8px;
    background: linear-gradient(#ff7e48, #b93519);
    color: #fff7cf;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 2px 0 rgba(82, 22, 0, 0.7);
    box-shadow: 0 5px 0 #6a220d;
    cursor: pointer;
}

.forest-level-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(96px, 1fr));
    gap: clamp(10px, 2vw, 16px);
}

.forest-level-button {
    min-height: 118px;
    border: 3px solid #c9ff84;
    border-radius: 8px;
    background: linear-gradient(180deg, #7de34a, #267b25);
    color: #fff8c8;
    box-shadow: inset 0 3px 0 rgba(255,255,255,0.36), 0 7px 0 #154c18, 0 10px 18px rgba(0,0,0,0.28);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 2px 0 rgba(20, 69, 17, 0.8);
}

.forest-level-button:disabled {
    cursor: default;
    filter: grayscale(0.85);
    opacity: 0.62;
}

.forest-level-button--completed {
    border-color: #ffe76d;
    background: linear-gradient(180deg, #addf4a, #458b20);
}

.forest-level-num {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #1f7f28;
    border: 3px solid #fff39a;
    font-size: 24px;
    font-weight: 900;
}

.forest-level-name {
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
}

.forest-level-stars {
    min-height: 18px;
    color: rgba(255, 255, 255, 0.32);
    font-size: 15px;
    letter-spacing: 0;
}

.forest-level-stars .on {
    color: #ffe14f;
}

@media (max-width: 760px) {
    .forest-level-panel {
        width: 96vw;
        max-height: 94dvh;
    }

    .forest-level-header {
        align-items: flex-start;
    }

    .forest-level-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        overflow-y: auto;
        max-height: 68dvh;
        padding-right: 4px;
    }

    .forest-level-button {
        min-height: 96px;
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    .forest-level-panel {
        max-height: 92dvh;
        padding: 14px;
    }

    .forest-level-grid {
        grid-template-columns: repeat(5, minmax(82px, 1fr));
        gap: 9px;
    }

    .forest-level-button {
        min-height: 82px;
    }

    .forest-level-num {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .forest-level-name,
    .forest-level-stars {
        font-size: 13px;
    }
}

#forest-level-screen {
    padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 238, 118, 0.2), transparent 18%),
        radial-gradient(circle at 82% 26%, rgba(117, 255, 146, 0.15), transparent 20%),
        linear-gradient(145deg, #03170e 0%, #0b2d1b 48%, #05150e 100%);
}

.forest-level-panel {
    position: relative;
    width: min(1120px, 94vw);
    height: min(610px, 88dvh);
    max-height: none;
    padding: 0;
    border: 4px solid #73e35a;
    border-radius: 8px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 22%, rgba(161, 231, 82, 0.48) 0 10%, transparent 22%),
        radial-gradient(circle at 82% 28%, rgba(63, 173, 69, 0.48) 0 12%, transparent 24%),
        linear-gradient(180deg, #328e39 0%, #1e7131 42%, #14542a 100%);
    box-shadow: 0 0 0 3px rgba(17, 84, 31, 0.95), 0 18px 50px rgba(0, 0, 0, 0.46);
}

.forest-level-panel::before,
.forest-level-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.forest-level-panel::before {
    inset: 0;
    background:
        radial-gradient(circle at 8% 18%, #1d7d35 0 7%, transparent 7.5%),
        radial-gradient(circle at 14% 27%, #2b9a3c 0 8%, transparent 8.5%),
        radial-gradient(circle at 90% 16%, #1f8239 0 9%, transparent 9.5%),
        radial-gradient(circle at 92% 80%, #176930 0 10%, transparent 10.5%),
        radial-gradient(circle at 8% 82%, #1b7835 0 11%, transparent 11.5%);
    opacity: 0.95;
}

.forest-level-panel::after {
    inset: auto 0 0 0;
    height: 16%;
    background: linear-gradient(180deg, transparent, rgba(5, 33, 18, 0.55));
}

.forest-level-header {
    position: absolute;
    top: clamp(16px, 3vh, 28px);
    left: clamp(18px, 3vw, 36px);
    right: clamp(18px, 3vw, 36px);
    z-index: 5;
    margin: 0;
}

.forest-level-kicker {
    color: #fff07a;
    font-size: clamp(20px, 3vw, 32px);
    line-height: 0.95;
    text-shadow: 0 3px 0 #194519, 0 0 12px rgba(255, 245, 113, 0.55);
}

.forest-level-title {
    color: #fff7a6;
    font-size: clamp(16px, 2.4vw, 24px);
    text-shadow: 0 3px 0 #194519;
}

.forest-level-back {
    transform: translateY(2px);
    border-color: #ffd983;
    background: linear-gradient(#ff9354, #c33b17);
}

.forest-map {
    position: absolute;
    inset: 74px 26px 20px;
    display: block;
    max-height: none;
    overflow: visible;
    border-radius: 8px;
}

.forest-map::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at 15% 76%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 24% 64%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 18% 49%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 30% 38%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 43% 46%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 53% 58%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 62% 44%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 72% 32%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 81% 43%, #d9b05e 0 5.2%, transparent 5.6%),
        radial-gradient(ellipse at 72% 65%, #d9b05e 0 5.2%, transparent 5.6%);
    filter: drop-shadow(0 3px 0 rgba(93, 62, 22, 0.35));
}

.forest-map-scenery,
.forest-map-scenery > * {
    position: absolute;
    pointer-events: none;
}

.forest-map-scenery {
    inset: 0;
    z-index: 0;
}

.forest-river {
    left: -5%;
    top: 56%;
    width: 62%;
    height: 18%;
    border-radius: 999px;
    transform: rotate(-14deg);
    background: linear-gradient(180deg, #8deaff, #28a9d6 58%, #1177af);
    box-shadow: inset 0 4px 0 rgba(255,255,255,0.36), 0 6px 16px rgba(0, 63, 96, 0.35);
}

.forest-path {
    left: 10%;
    top: 29%;
    width: 78%;
    height: 50%;
    border: 18px solid rgba(214, 159, 76, 0.78);
    border-left-width: 26px;
    border-right-width: 24px;
    border-top-color: transparent;
    border-radius: 50%;
    transform: rotate(-8deg);
    filter: drop-shadow(0 5px 0 rgba(96, 62, 26, 0.22));
}

.forest-house {
    width: 54px;
    height: 42px;
    background: linear-gradient(#f2c175, #b97035);
    border: 3px solid #70401d;
    border-radius: 6px;
    box-shadow: 0 6px 10px rgba(0,0,0,0.25);
}

.forest-house::before {
    content: "";
    position: absolute;
    left: -8px;
    top: -22px;
    width: 64px;
    height: 30px;
    background: linear-gradient(135deg, #d64d32 0 50%, #9c2d25 50%);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.forest-house span {
    position: absolute;
    left: 21px;
    bottom: 0;
    width: 14px;
    height: 24px;
    border-radius: 5px 5px 0 0;
    background: #693616;
}

.forest-house--one { left: 8%; top: 33%; }
.forest-house--two { left: 55%; top: 18%; transform: scale(0.86); }

.forest-castle {
    right: 8%;
    top: 14%;
    width: 70px;
    height: 58px;
    background:
        linear-gradient(90deg, transparent 0 12%, #d5d2c5 12% 28%, transparent 28% 36%, #e5e0d1 36% 64%, transparent 64% 72%, #c9c4b7 72% 88%, transparent 88%),
        linear-gradient(#ebe4d1, #b4aa91);
    border-bottom: 4px solid #7e735e;
    filter: drop-shadow(0 7px 8px rgba(0,0,0,0.28));
}

.forest-castle::before {
    content: "";
    position: absolute;
    inset: -18px 4px auto;
    height: 22px;
    background: linear-gradient(135deg, #b6402b 0 50%, #7f241f 50%);
    clip-path: polygon(0 100%, 16% 0, 32% 100%, 50% 0, 68% 100%, 84% 0, 100% 100%);
}

.forest-tree {
    width: 56px;
    height: 62px;
    border-radius: 50% 50% 46% 46%;
    background: radial-gradient(circle at 35% 28%, #78d85c 0 22%, #2b9a3f 52%, #17662d 100%);
    box-shadow: 0 8px 10px rgba(0,0,0,0.25);
}

.forest-tree::after {
    content: "";
    position: absolute;
    left: 23px;
    bottom: -16px;
    width: 10px;
    height: 24px;
    background: #724317;
    border-radius: 5px;
}

.forest-tree--one { left: 34%; top: 17%; }
.forest-tree--two { right: 22%; bottom: 9%; transform: scale(1.2); }
.forest-tree--three { left: 5%; bottom: 10%; transform: scale(0.95); }

.forest-firefly {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff36b;
    box-shadow: 0 0 12px 4px rgba(255, 243, 107, 0.75);
    animation: forestFirefly 2.6s ease-in-out infinite;
}

.forest-firefly--one { left: 39%; top: 25%; animation-delay: 0s; }
.forest-firefly--two { left: 68%; top: 19%; animation-delay: 0.5s; }
.forest-firefly--three { left: 88%; top: 59%; animation-delay: 1s; }
.forest-firefly--four { left: 27%; top: 81%; animation-delay: 1.4s; }

.forest-level-button {
    position: absolute;
    z-index: 3;
    width: clamp(54px, 7.4vw, 76px);
    min-height: 0;
    height: clamp(54px, 7.4vw, 76px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 4px solid #fff4a6;
    background: radial-gradient(circle at 35% 26%, #8df15d, #249128 72%);
    box-shadow: inset 0 4px 0 rgba(255,255,255,0.38), 0 6px 0 #14551c, 0 10px 16px rgba(0,0,0,0.28);
    gap: 0;
}

.forest-level-button--next {
    animation: forestLevelPulse 1.35s ease-in-out infinite;
}

.forest-level-button:disabled {
    opacity: 0.74;
    filter: grayscale(0.72);
    background: radial-gradient(circle at 35% 26%, #9aa995, #516455 72%);
    border-color: rgba(255,255,255,0.55);
}

.forest-level-button:disabled::after {
    content: "🔒";
    position: absolute;
    right: -8px;
    top: -9px;
    font-size: 18px;
    filter: grayscale(0);
}

.forest-level-button--completed {
    background: radial-gradient(circle at 35% 26%, #fff174, #7dac28 72%);
    border-color: #fff7a8;
}

.forest-level-num {
    width: auto;
    height: auto;
    border: 0;
    background: transparent;
    color: #fffce0;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1;
    text-shadow: 0 3px 0 rgba(43, 77, 20, 0.8);
}

.forest-level-name {
    display: none;
}

.forest-level-stars {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    white-space: nowrap;
    color: rgba(255, 248, 190, 0.42);
    font-size: 13px;
    text-shadow: 0 2px 2px rgba(0,0,0,0.45);
}

@keyframes forestFirefly {
    0%, 100% { opacity: 0.35; transform: translateY(0) scale(0.8); }
    50% { opacity: 1; transform: translateY(-7px) scale(1.15); }
}

@keyframes forestLevelPulse {
    0%, 100% { box-shadow: inset 0 4px 0 rgba(255,255,255,0.38), 0 6px 0 #14551c, 0 0 0 0 rgba(255, 244, 119, 0.72); }
    50% { box-shadow: inset 0 4px 0 rgba(255,255,255,0.38), 0 6px 0 #14551c, 0 0 0 12px rgba(255, 244, 119, 0); }
}

@media (max-width: 760px) {
    .forest-level-panel {
        width: 96vw;
        height: 86dvh;
    }

    .forest-map {
        inset: 82px 16px 18px;
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    .forest-level-panel {
        width: 92vw;
        height: 82dvh;
        padding: 0;
    }

    .forest-level-header {
        top: 12px;
    }

    .forest-map {
        inset: 58px 22px 14px;
    }

    .forest-level-button {
        width: clamp(44px, 8vh, 58px);
        height: clamp(44px, 8vh, 58px);
    }

    .forest-level-stars {
        font-size: 11px;
        top: calc(100% + 5px);
    }

    .forest-house,
    .forest-tree,
    .forest-castle {
        transform: scale(0.72);
    }
}

/* Green Grove image map */
#forest-level-screen {
    background: #06180f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.forest-level-panel {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: url("assets/green-grove-map.jpg") center / 100% 100% no-repeat;
    box-shadow: none;
}

.forest-level-panel::before,
.forest-level-panel::after,
.forest-map::before,
.forest-map-scenery {
    display: none;
}

.forest-level-header {
    inset: 0;
    pointer-events: none;
}

.forest-level-header > div {
    display: none;
}

.forest-level-back {
    position: absolute;
    right: 5.7%;
    top: 84.5%;
    pointer-events: auto;
    min-width: 0;
    width: 15.5%;
    min-height: 0;
    height: 6.2%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: transparent;
    box-shadow: none;
    text-shadow: none;
}

.forest-map {
    inset: 0;
}

.forest-level-button {
    width: 9.2%;
    height: auto;
    aspect-ratio: 1;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.forest-level-button,
.forest-level-button--completed,
.forest-level-button:disabled {
    background: transparent;
    border-color: transparent;
    filter: none;
    opacity: 1;
}

.forest-level-button:disabled::after,
.forest-level-num,
.forest-level-stars {
    display: none;
}

.forest-level-name {
    display: block;
    position: absolute;
    left: 50%;
    top: calc(100% + 22px);
    width: clamp(72px, 12vw, 150px);
    transform: translateX(-50%);
    padding: 2px 5px;
    border-radius: 8px;
    background: rgba(9, 55, 20, 0.78);
    color: #fff8ba;
    font-size: clamp(8px, 1vw, 13px);
    font-weight: 900;
    line-height: 1.08;
    text-align: center;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.8);
    white-space: normal;
    pointer-events: none;
}

.forest-level-button--next {
    animation: greenGroveHotspotPulse 1.4s ease-in-out infinite;
    border-radius: 50%;
}

@keyframes greenGroveHotspotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 247, 117, 0.72); }
    50% { box-shadow: 0 0 0 11px rgba(255, 247, 117, 0); }
}

@media (max-width: 1024px) and (orientation: landscape) {
    .forest-level-panel {
        width: 100vw;
        height: 100dvh;
        padding: 0;
    }

    .forest-level-header,
    .forest-map {
        inset: 0;
    }

    .forest-level-button {
        width: 9.2%;
        height: auto;
    }

    .forest-level-name {
        top: calc(100% + 14px);
        width: clamp(58px, 12vw, 110px);
        font-size: clamp(7px, 1.55vh, 10px);
        padding: 1px 4px;
    }
}

/* Restore the landscape Green Grove map style. */
#forest-level-screen {
    padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 238, 118, 0.2), transparent 18%),
        radial-gradient(circle at 82% 26%, rgba(117, 255, 146, 0.15), transparent 20%),
        linear-gradient(145deg, #03170e 0%, #0b2d1b 48%, #05150e 100%);
}

.forest-level-panel {
    width: min(1120px, 94vw);
    height: min(610px, 88dvh);
    max-height: none;
    aspect-ratio: auto;
    border: 4px solid #73e35a;
    border-radius: 8px;
    background:
        radial-gradient(circle at 18% 22%, rgba(161, 231, 82, 0.48) 0 10%, transparent 22%),
        radial-gradient(circle at 82% 28%, rgba(63, 173, 69, 0.48) 0 12%, transparent 24%),
        linear-gradient(180deg, #328e39 0%, #1e7131 42%, #14542a 100%);
    box-shadow: 0 0 0 3px rgba(17, 84, 31, 0.95), 0 18px 50px rgba(0, 0, 0, 0.46);
}

.forest-level-panel::before,
.forest-level-panel::after,
.forest-map::before,
.forest-map-scenery {
    display: block;
}

.forest-level-header {
    top: clamp(16px, 3vh, 28px);
    left: clamp(18px, 3vw, 36px);
    right: clamp(18px, 3vw, 36px);
    bottom: auto;
    pointer-events: auto;
}

.forest-level-header > div {
    display: block;
}

.forest-level-back {
    position: static;
    transform: translateY(2px);
    min-width: 104px;
    width: auto;
    min-height: 46px;
    height: auto;
    border: 3px solid #ffd983;
    border-radius: 8px;
    background: linear-gradient(#ff9354, #c33b17);
    color: #fff7cf;
    box-shadow: 0 5px 0 #6a220d;
    text-shadow: 0 2px 0 rgba(82, 22, 0, 0.7);
}

.forest-map {
    inset: 74px 26px 20px;
}

.forest-level-button {
    width: clamp(54px, 7.4vw, 76px);
    height: clamp(54px, 7.4vw, 76px);
    aspect-ratio: 1;
    border: 4px solid #fff4a6;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 26%, #8df15d, #249128 72%);
    box-shadow: inset 0 4px 0 rgba(255,255,255,0.38), 0 6px 0 #14551c, 0 10px 16px rgba(0,0,0,0.28);
    opacity: 1;
}

.forest-level-button--completed {
    background: radial-gradient(circle at 35% 26%, #fff174, #7dac28 72%);
    border-color: #fff7a8;
}

.forest-level-button:disabled {
    opacity: 0.74;
    filter: grayscale(0.72);
    background: radial-gradient(circle at 35% 26%, #9aa995, #516455 72%);
    border-color: rgba(255,255,255,0.55);
}

.forest-level-button:disabled::after {
    display: block;
}

.forest-level-num {
    display: grid;
}

.forest-level-stars {
    display: block;
}

@media (max-width: 1024px) and (orientation: landscape) {
    .forest-level-panel {
        width: 92vw;
        height: 82dvh;
        padding: 0;
    }

    .forest-level-header {
        top: 12px;
        left: clamp(18px, 3vw, 36px);
        right: clamp(18px, 3vw, 36px);
        bottom: auto;
    }

    .forest-map {
        inset: 58px 22px 14px;
    }

    .forest-level-button {
        width: clamp(44px, 8vh, 58px);
        height: clamp(44px, 8vh, 58px);
    }
}

/* Polished Green Grove map */
#build-badge {
    display: none !important;
}

#forest-level-screen {
    padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background:
        radial-gradient(circle at 18% 50%, rgba(31, 118, 63, 0.72), transparent 28%),
        radial-gradient(circle at 78% 40%, rgba(20, 92, 54, 0.78), transparent 34%),
        linear-gradient(135deg, #06130f 0%, #122d28 50%, #091512 100%);
}

.forest-level-panel {
    width: min(1180px, 98vw);
    height: min(660px, 94dvh);
    border: clamp(3px, 0.7vh, 6px) solid #69ff4f;
    border-radius: 8px;
    background:
        radial-gradient(circle at 20% 15%, rgba(116, 222, 68, 0.2) 0 10%, transparent 22%),
        radial-gradient(circle at 83% 25%, rgba(78, 198, 70, 0.22) 0 13%, transparent 25%),
        radial-gradient(circle at 12% 82%, rgba(48, 143, 66, 0.38) 0 17%, transparent 28%),
        radial-gradient(circle at 88% 84%, rgba(34, 110, 55, 0.44) 0 18%, transparent 32%),
        linear-gradient(180deg, #39a13f 0%, #208139 43%, #12622f 100%);
    box-shadow:
        0 0 0 2px rgba(28, 116, 35, 0.95),
        0 0 22px rgba(105, 255, 79, 0.58),
        0 18px 44px rgba(0, 0, 0, 0.48),
        inset 0 0 34px rgba(6, 51, 21, 0.42);
}

.forest-level-panel::before {
    background:
        radial-gradient(circle at 8% 18%, rgba(29, 125, 53, 0.92) 0 7%, transparent 7.6%),
        radial-gradient(circle at 14% 27%, rgba(43, 154, 60, 0.9) 0 8%, transparent 8.6%),
        radial-gradient(circle at 90% 16%, rgba(31, 130, 57, 0.9) 0 9%, transparent 9.6%),
        radial-gradient(circle at 92% 80%, rgba(23, 105, 48, 0.95) 0 10%, transparent 10.6%),
        radial-gradient(circle at 8% 82%, rgba(27, 120, 53, 0.92) 0 11%, transparent 11.6%),
        radial-gradient(circle at 45% 78%, rgba(255,255,255,0.14) 0 0.35%, transparent 0.7%),
        radial-gradient(circle at 37% 72%, rgba(255,255,255,0.16) 0 0.35%, transparent 0.7%),
        radial-gradient(circle at 58% 28%, rgba(255,255,255,0.12) 0 0.3%, transparent 0.65%);
}

.forest-level-header {
    top: clamp(12px, 2.1vh, 22px);
    left: clamp(18px, 3vw, 38px);
    right: clamp(18px, 3vw, 38px);
    align-items: flex-start;
}

.forest-level-kicker {
    color: #ffe878;
    font-size: clamp(24px, 4.2vh, 40px);
    line-height: 0.9;
    -webkit-text-stroke: 1px rgba(82, 46, 9, 0.45);
    text-shadow: 0 4px 0 #4d2a09, 0 0 18px rgba(255, 246, 128, 0.62);
}

.forest-level-title {
    color: #fff9bf;
    font-size: clamp(15px, 2.5vh, 24px);
    text-shadow: 0 3px 0 #31521a, 0 0 10px rgba(255,255,255,0.34);
}

.forest-level-back {
    min-width: clamp(96px, 14vw, 146px);
    min-height: clamp(42px, 7vh, 60px);
    border: 3px solid #ffdc84;
    background: linear-gradient(180deg, #ff9c58 0%, #ec5d2b 46%, #a82814 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.34),
        0 5px 0 #69200b,
        0 8px 14px rgba(0,0,0,0.32);
    font-size: clamp(17px, 3vh, 24px);
}

.forest-map {
    inset: clamp(54px, 13vh, 82px) clamp(18px, 3vw, 32px) clamp(12px, 2.2vh, 20px);
}

.forest-river {
    left: -4%;
    top: 54%;
    width: 64%;
    height: 20%;
    background:
        linear-gradient(115deg, transparent 0 18%, rgba(255,255,255,0.35) 19% 23%, transparent 24% 45%, rgba(255,255,255,0.22) 46% 49%, transparent 50%),
        linear-gradient(180deg, #a8f4ff, #2dbce4 55%, #0a75b2);
    box-shadow:
        inset 0 5px 0 rgba(255,255,255,0.48),
        inset 0 -8px 12px rgba(0, 77, 135, 0.32),
        0 8px 18px rgba(0, 51, 80, 0.34);
    animation: forestRiverGlow 3.8s ease-in-out infinite;
}

.forest-river::before,
.forest-river::after {
    content: "";
    position: absolute;
    left: 9%;
    right: 9%;
    height: 12%;
    border-radius: 999px;
    background: rgba(227, 255, 255, 0.45);
    filter: blur(1px);
}

.forest-river::before { top: 28%; }
.forest-river::after { top: 62%; opacity: 0.62; }

.forest-path {
    left: 9%;
    top: 28%;
    width: 80%;
    height: 52%;
    border-width: clamp(16px, 3vh, 24px);
    border-left-width: clamp(24px, 4.5vh, 36px);
    border-right-width: clamp(22px, 4vh, 34px);
    border-color: rgba(232, 183, 93, 0.9);
    border-top-color: transparent;
    filter:
        drop-shadow(0 6px 0 rgba(104, 70, 30, 0.32))
        drop-shadow(0 0 7px rgba(255, 234, 144, 0.28));
}

.forest-path::before {
    content: "";
    position: absolute;
    inset: -12% -8%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 18% 82%, rgba(255,241,160,0.9) 0 1.3%, transparent 1.7%),
        radial-gradient(circle at 42% 70%, rgba(104,72,38,0.38) 0 1.2%, transparent 1.6%),
        radial-gradient(circle at 72% 40%, rgba(255,241,160,0.72) 0 1.1%, transparent 1.5%),
        radial-gradient(circle at 84% 55%, rgba(104,72,38,0.38) 0 1.2%, transparent 1.6%);
}

.forest-house {
    transform-origin: center bottom;
    filter: drop-shadow(0 8px 7px rgba(0,0,0,0.32));
}

.forest-house--two { transform: scale(0.92); }

.forest-tree {
    box-shadow: 0 9px 12px rgba(0,0,0,0.24), inset 0 5px 8px rgba(255,255,255,0.18);
}

.forest-firefly {
    width: 8px;
    height: 8px;
    background: #fff56d;
    box-shadow: 0 0 14px 5px rgba(255, 243, 107, 0.86);
}

.forest-level-button {
    width: clamp(58px, 8.6vh, 84px);
    height: clamp(58px, 8.6vh, 84px);
    border: clamp(3px, 0.75vh, 6px) solid #ffef9c;
    background:
        radial-gradient(circle at 34% 20%, rgba(255,255,255,0.85) 0 9%, transparent 10%),
        radial-gradient(circle at 50% 55%, #62d640 0 44%, #1c8d2e 74%);
    box-shadow:
        inset 0 5px 0 rgba(255,255,255,0.36),
        inset 0 -8px 10px rgba(0, 73, 20, 0.36),
        0 5px 0 #0e5717,
        0 9px 15px rgba(0,0,0,0.34),
        0 0 0 4px rgba(93, 214, 55, 0.2);
}

.forest-level-button::before {
    content: "";
    position: absolute;
    inset: 9% 12% auto;
    height: 22%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0));
    pointer-events: none;
}

.forest-level-button--completed {
    background:
        radial-gradient(circle at 34% 20%, rgba(255,255,255,0.85) 0 9%, transparent 10%),
        radial-gradient(circle at 50% 55%, #91e34b 0 42%, #5c9a23 76%);
    border-color: #fff37b;
}

.forest-level-button--next {
    animation: forestLevelPulse 1.35s ease-in-out infinite;
}

.forest-level-button--next::after {
    content: "";
    position: absolute;
    inset: -18%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,239,92,0.5), transparent 58%);
    z-index: -1;
    animation: forestLevelHalo 1.35s ease-in-out infinite;
}

.forest-level-button:disabled {
    opacity: 0.9;
    filter: none;
    background:
        radial-gradient(circle at 34% 20%, rgba(255,255,255,0.62) 0 9%, transparent 10%),
        radial-gradient(circle at 50% 55%, #aeb9ad 0 40%, #65716a 76%);
    border-color: #d9ded8;
    box-shadow:
        inset 0 5px 0 rgba(255,255,255,0.26),
        inset 0 -8px 10px rgba(35, 45, 39, 0.3),
        0 5px 0 #56615a,
        0 9px 15px rgba(0,0,0,0.32);
}

.forest-level-button:disabled::after {
    content: "🔒";
    right: -10px;
    top: -10px;
    font-size: clamp(18px, 3vh, 24px);
    text-shadow: 0 2px 3px rgba(0,0,0,0.35);
}

.forest-level-num {
    color: #fffbd9;
    font-size: clamp(24px, 4.7vh, 38px);
    text-shadow: 0 3px 0 rgba(30, 84, 18, 0.88), 0 0 9px rgba(255,255,255,0.34);
}

.forest-level-stars {
    top: calc(100% + 7px);
    color: rgba(255, 255, 255, 0.42);
    font-size: clamp(10px, 1.85vh, 15px);
}

.forest-level-stars .on {
    color: #ffe652;
    filter: drop-shadow(0 0 5px rgba(255, 226, 78, 0.75));
}

@keyframes forestRiverGlow {
    0%, 100% { filter: saturate(1) brightness(1); }
    50% { filter: saturate(1.16) brightness(1.08); }
}

@keyframes forestLevelHalo {
    0%, 100% { opacity: 0.42; transform: scale(0.92); }
    50% { opacity: 0.95; transform: scale(1.08); }
}

@media (max-width: 1024px) and (orientation: landscape) {
    #forest-level-screen {
        padding: max(4px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    }

    .forest-level-panel {
        width: 97vw;
        height: 90dvh;
    }

    .forest-map {
        inset: clamp(46px, 12vh, 66px) clamp(14px, 2.4vw, 24px) clamp(10px, 2vh, 16px);
    }

    .forest-level-back {
        min-width: clamp(82px, 14vw, 116px);
        min-height: clamp(36px, 7vh, 50px);
        font-size: clamp(15px, 3.1vh, 20px);
    }

    .forest-level-button {
        width: clamp(46px, 9.2vh, 66px);
        height: clamp(46px, 9.2vh, 66px);
    }

    .forest-level-stars {
        top: calc(100% + 4px);
    }
}

.menu-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    margin-bottom: 4px;
}

.menu-progress-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 8px 22px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 18px;
    letter-spacing: 0.3px;
}

/* Плаваючі частинки на головному меню */
.menu-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.mp {
    position: absolute;
    font-size: 28px;
    opacity: 0;
    animation: menuFloat 8s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    user-select: none;
}

.mp:nth-child(1) { left: 8%;  animation-delay: 0s;    animation-duration: 7.5s; font-size: 26px; }
.mp:nth-child(2) { left: 22%; animation-delay: 1.2s;  animation-duration: 9s;   font-size: 22px; }
.mp:nth-child(3) { left: 38%; animation-delay: 2.4s;  animation-duration: 8s;   font-size: 30px; }
.mp:nth-child(4) { left: 55%; animation-delay: 0.7s;  animation-duration: 10s;  font-size: 24px; }
.mp:nth-child(5) { left: 70%; animation-delay: 3.1s;  animation-duration: 7s;   font-size: 28px; }
.mp:nth-child(6) { left: 83%; animation-delay: 1.8s;  animation-duration: 8.5s; font-size: 20px; }
.mp:nth-child(7) { left: 15%; animation-delay: 4.0s;  animation-duration: 9.5s; font-size: 24px; }
.mp:nth-child(8) { left: 63%; animation-delay: 2.0s;  animation-duration: 8.2s; font-size: 26px; }

@keyframes menuFloat {
    0%   { transform: translateY(110vh) rotate(-10deg); opacity: 0; }
    8%   { opacity: 0.7; }
    88%  { opacity: 0.5; }
    100% { transform: translateY(-12vh) rotate(15deg); opacity: 0; }
}

/* Зміщуємо вміст меню над частинками */
#menu-screen > *:not(.menu-particles) {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .level-grid {
        width: min(380px, 94vw);
        height: min(440px, 60vh);
    }

    .level-button {
        width: var(--node-size, 72px);
        height: var(--node-size, 72px);
        border-radius: 20px;
    }

    .game-button.small {
        padding: 8px 16px;
        font-size: 14px;
        margin: 4px;
    }

    .menu-progress-badge {
        font-size: 14px;
        padding: 6px 16px;
        margin-bottom: 14px;
    }

    .mp {
        font-size: 22px;
    }
}
/* ============================================
   СУПЕРСИЛИ — ПАНЕЛЬ ВИБОРУ
   ============================================ */

#superpower-panel {
    display: none;
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 10px;
    z-index: 30;
    pointer-events: auto;
    background: rgba(10, 18, 35, 0.65);
    padding: 7px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
    user-select: none;
}

.sp-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 64px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-slot:hover {
    border-color: rgba(255,255,255,0.45);
}

.sp-slot.sp-selected {
    border-color: #ffe04a;
    box-shadow: 0 0 12px 2px rgba(255,220,60,0.6);
    background: rgba(255,220,60,0.10);
}

.sp-slot.sp-active {
    border-color: #7dff88;
    box-shadow: 0 0 14px 3px rgba(80,255,100,0.55);
    background: rgba(80,255,100,0.10);
}

.sp-key {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    line-height: 1;
}

.sp-icon {
    font-size: 24px;
    line-height: 1;
    margin-top: 4px;
}

.sp-name {
    font-size: 9px;
    color: rgba(255,255,255,0.70);
    text-align: center;
    margin-top: 2px;
    line-height: 1;
    max-width: 54px;
    overflow: hidden;
    white-space: nowrap;
}

/* Кулдаун-оверлей — заповнює слот зверху вниз */
.sp-cd-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0,0,0,0.68);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding-top: 4px;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Мобільні кнопки суперсил */
.touch-btn.sp-cycle {
    margin-left: 10px;
    background: rgba(100, 30, 180, 0.58);
    border-color: rgba(180, 100, 255, 0.85);
    font-size: 22px;
}

.touch-btn.sp-use {
    margin-left: 6px;
    background: rgba(180, 140, 0, 0.58);
    border-color: rgba(255, 220, 60, 0.85);
    font-size: 22px;
}

@media (max-width: 768px) {
    #superpower-panel {
        bottom: 105px;
        gap: 7px;
        padding: 5px 8px;
    }
    .sp-slot {
        width: 48px;
        height: 54px;
        border-radius: 10px;
    }
    .sp-icon { font-size: 20px; }
    .sp-name { font-size: 8px; }
}

/* ============================================
   КАСТОМНИЙ ДІАЛОГ ПІДТВЕРДЖЕННЯ
   ============================================ */

.game-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gcOverlayIn 0.22s ease;
}

.game-confirm-overlay.hidden { display: none; }

.game-confirm--out {
    animation: gcOverlayOut 0.28s ease forwards;
}

@keyframes gcOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes gcOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.game-confirm-box {
    background: linear-gradient(160deg, #1e1a3a 0%, #2a2250 100%);
    border: 2px solid rgba(255, 210, 60, 0.55);
    border-radius: 24px;
    padding: 36px 32px 28px;
    max-width: min(420px, 92vw);
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.06);
    animation: gcBoxIn 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes gcBoxIn {
    from { transform: scale(0.82) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.game-confirm-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(255,200,50,0.5));
    animation: gcIconPulse 1.6s ease-in-out infinite;
}

@keyframes gcIconPulse {
    0%, 100% { transform: scale(1);    }
    50%       { transform: scale(1.08); }
}

.game-confirm-title {
    font-size: 22px;
    font-weight: 900;
    color: #FFE066;
    text-shadow: 0 2px 10px rgba(255,200,50,0.4);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.game-confirm-msg {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.80);
    line-height: 1.65;
    margin-bottom: 28px;
}

.game-confirm-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.game-confirm-btn {
    flex: 1;
    max-width: 170px;
    padding: 13px 20px;
    border-radius: 50px;
    border: none;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.13s, box-shadow 0.13s;
    letter-spacing: 0.3px;
}

.game-confirm-btn:hover  { transform: translateY(-3px); }
.game-confirm-btn:active { transform: scale(0.96); }

.game-confirm-btn--ok {
    background: linear-gradient(135deg, #FF4444 0%, #CC1111 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 50, 50, 0.45);
}

.game-confirm-btn--ok:hover {
    box-shadow: 0 10px 30px rgba(255, 50, 50, 0.65);
}

.game-confirm-btn--cancel {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.90);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.game-confirm-btn--cancel:hover {
    background: rgba(255, 255, 255, 0.20);
}

/* ===== Діалог вибору причини видалення акаунту ===== */
.delete-account-box {
    max-width: min(440px, 94vw);
    text-align: left;
}

.delete-account-box .game-confirm-icon,
.delete-account-box .game-confirm-title,
.delete-account-box .game-confirm-msg {
    text-align: center;
}

.delete-account-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

.del-reason {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s;
}

.del-reason:hover {
    background: rgba(255, 255, 255, 0.12);
}

.del-reason input {
    accent-color: #FF6B6B;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    cursor: pointer;
}

.del-reason:has(input:checked) {
    background: rgba(255, 107, 107, 0.16);
    border-color: rgba(255, 107, 107, 0.6);
}

.delete-account-other {
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.delete-account-other:focus {
    outline: none;
    border-color: rgba(255, 107, 107, 0.7);
}

.delete-account-other::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.delete-account-err {
    margin-top: 4px;
    color: #ff9d9d;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

/* Сповіщення «акаунт видалено» з кнопкою «Зрозуміло» */
.account-deleted-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 20, 14, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.account-deleted-overlay.show { opacity: 1; }

.account-deleted-card {
    width: min(92vw, 380px);
    padding: 28px 26px 24px;
    border-radius: 24px;
    background: #fff;
    text-align: center;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.account-deleted-overlay.show .account-deleted-card { transform: scale(1); }

.account-deleted-card .adc-icon {
    font-size: 50px;
    line-height: 1;
    margin-bottom: 8px;
}

.account-deleted-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #1f7a4d;
}

.account-deleted-card p {
    margin: 0 0 22px;
    font-size: 15px;
    color: #4a5560;
    line-height: 1.5;
}

.account-deleted-card .adc-ok {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2fa968 0%, #1f7a4d 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(31, 122, 77, 0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.account-deleted-card .adc-ok:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(31, 122, 77, 0.5); }
.account-deleted-card .adc-ok:active { transform: scale(0.97); }

/* ===== Діалог винагороди (бонус за реєстрацію) ===== */
.reward-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 12, 40, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reward-overlay.show { opacity: 1; }

.reward-card {
    width: min(92vw, 360px);
    padding: 30px 26px 24px;
    border-radius: 24px;
    background: linear-gradient(160deg, #fff7e6 0%, #ffeccf 100%);
    text-align: center;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
    border: 3px solid rgba(255, 209, 102, 0.9);
    transform: scale(0.85);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reward-overlay.show .reward-card { transform: scale(1); }

.reward-card .reward-icon {
    font-size: 54px;
    line-height: 1;
    margin-bottom: 6px;
    animation: rewardPop 1.6s ease-in-out infinite;
}

@keyframes rewardPop {
    0%, 100% { transform: scale(1) rotate(-4deg); }
    50% { transform: scale(1.12) rotate(4deg); }
}

.reward-card h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #b9770e;
}

.reward-card .reward-amount {
    font-size: 30px;
    font-weight: 900;
    color: #c8860d;
    margin: 4px 0 10px;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.reward-card p {
    margin: 0 0 22px;
    font-size: 15px;
    color: #6a5326;
    line-height: 1.5;
}

.reward-card .reward-ok {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffd166 0%, #f0a020 100%);
    color: #3a2a00;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(240, 160, 32, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.reward-card .reward-ok:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(240, 160, 32, 0.55); }
.reward-card .reward-ok:active { transform: scale(0.97); }

/* Адмін: рядок запиту на видалення */
.admin-row--deletion p {
    margin: 4px 0;
}

.admin-done-tag {
    font-size: 12px;
    color: #6ee7b7;
    font-weight: 700;
}

/* ============================================
   ХАБ: VÄRLD МОРСЬКИХ СВИНОК всередині меню гри
   ============================================ */

/* Робимо #menu-screen прокручуваним для довгого контенту */
#menu-screen {
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 16px;
    padding-bottom: 32px;
}

.hub-world-section {
    width: 100%;
    max-width: 900px;
    margin-top: 22px;
    padding: 16px;
    background: rgba(255, 249, 244, 0.10);
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.12);
}

.hub-world-divider {
    text-align: center;
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.55);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.hub-world-sub {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.70);
    margin: 0 0 12px;
}

.hub-world-grid {
    width: 100%;
}

.hub-ach-section {
    margin-top: 14px;
    background: rgba(109, 40, 217, 0.18) !important;
    border-color: rgba(221,214,254,0.3) !important;
}
.hub-ach-section .ach-section-title {
    color: #d4b8ff !important;
}
.hub-ach-section .ach-bar-empty {
    color: rgba(255,255,255,0.45) !important;
}

/* ============================================
   GAME LAUNCH PANEL (у #main-menu)
   ============================================ */
.game-launch-section {
    width: 100%;
    max-width: 900px;
    margin-top: 10px;
}

.game-section-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #6D28D9;
    margin-bottom: 8px;
    padding-left: 4px;
    text-shadow: 0 1px 3px rgba(109,40,217,0.18);
}

.game-launch-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 18px;
    background: linear-gradient(120deg, #3b0764 0%, #1e3a5f 60%, #0f172a 100%);
    border: 1.5px solid rgba(167,139,250,0.45);
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 6px 32px rgba(109,40,217,0.45), inset 0 1px 0 rgba(255,255,255,0.10);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.game-launch-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 44px rgba(139,92,246,0.55);
    border-color: rgba(196,181,253,0.7);
}
.game-launch-card:active {
    transform: scale(0.985);
}

/* плаваючі декоративні емодзі */
.game-launch-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.game-launch-decor span {
    position: absolute;
    font-size: 20px;
    opacity: 0.12;
    animation: glDecorFloat 6s ease-in-out infinite;
}
.game-launch-decor span:nth-child(1) { top: 10%;  left:  8%; animation-delay:  0s; }
.game-launch-decor span:nth-child(2) { top: 55%;  left: 22%; animation-delay: -2s; }
.game-launch-decor span:nth-child(3) { top: 20%;  left: 55%; animation-delay: -4s; }
.game-launch-decor span:nth-child(4) { top: 65%;  left: 68%; animation-delay: -1s; }
.game-launch-decor span:nth-child(5) { top: 36%;  left: 85%; animation-delay: -3s; }
@keyframes glDecorFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-8px) rotate(10deg); }
}

.game-launch-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.game-launch-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.game-launch-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(139,92,246,0.70);
    border: 1px solid rgba(196,181,253,0.5);
    border-radius: 6px;
    padding: 2px 8px;
}
.game-launch-badge--lvl {
    background: rgba(16,185,129,0.60);
    border-color: rgba(110,231,183,0.5);
}

.game-launch-title {
    font-size: clamp(15px, 2.2vw, 22px);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    line-height: 1.2;
    margin-bottom: 3px;
}

.game-launch-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    line-height: 1.4;
}

.game-launch-play {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 1;
}
.game-launch-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(167,139,250,0.30);
    border: 2px solid rgba(196,181,253,0.7);
    font-size: 18px;
    color: #fff;
    box-shadow: 0 0 18px rgba(139,92,246,0.55);
    transition: transform 0.18s ease;
}
.game-launch-card:hover .game-launch-play-icon {
    transform: scale(1.12);
}
.game-launch-play-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================================
   TIKTOK PROMO CARD
   ============================================ */
.tiktok-card {
    background: linear-gradient(145deg, #161823, #1f1f2e);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 16px 18px 14px;
    margin: 14px 0 16px;
    width: min(340px, 90vw);
    box-shadow: 0 4px 28px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07);
    position: relative;
    overflow: hidden;
}

.tiktok-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(254,44,85,0.18), transparent 70%);
    pointer-events: none;
}

.tiktok-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 12px;
}

.tiktok-card-profile {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 13px;
    text-decoration: none;
    cursor: pointer;
}

.tiktok-card-profile:hover .tiktok-card-name {
    text-decoration: underline;
}

.tiktok-card-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(254,44,85,0.5);
    animation: tiktok-ring-pulse 2.4s ease-in-out infinite;
    overflow: hidden;
}

.tiktok-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes tiktok-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(254,44,85,0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(254,44,85,0.25); }
}

.tiktok-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tiktok-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tiktok-card-handle {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.tiktok-card-bio {
    font-size: 12px;
    color: #ddd;
    line-height: 1.4;
    margin-top: 3px;
}

.tiktok-card-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 9px 8px;
    margin-bottom: 13px;
}

.tiktok-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.tiktok-stat-item b {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.tiktok-stat-item span {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tiktok-stat-sep {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.15);
}

.tiktok-follow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #fe2c55, #ff5f7e);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 4px 16px rgba(254,44,85,0.45);
}

.tiktok-follow-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.tiktok-follow-btn:active {
    transform: scale(0.97);
}

.tiktok-follow-btn.followed {
    background: linear-gradient(90deg, #2d9e5f, #3cc878);
    box-shadow: 0 4px 16px rgba(60,200,120,0.4);
}

@media (max-width: 480px) {
    .tiktok-card { padding: 13px 13px 12px; }
    .tiktok-card-avatar { width: 50px; height: 50px; }
    .tiktok-card-name { font-size: 13px; }
    .tiktok-follow-btn { font-size: 14px; }
}

/* ============================================
   TikTok відео попап між рівнями
   ============================================ */
.tiktok-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.tiktok-popup-overlay.hidden { display: none; }

.tiktok-popup-box {
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 24px 20px 20px;
    width: min(380px, 94vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.tiktok-popup-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    line-height: 1.4;
}

.tiktok-popup-embed {
    width: 100%;
    height: 560px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.tiktok-popup-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-height: 700px) {
    .tiktok-popup-embed { height: 380px; }
}

/* ============================================
   ІМ'Я СВИНКИ + СКІНИ
   ============================================ */
.pig-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pig-name-row label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.pig-name-input {
    padding: 8px 14px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    width: 130px;
    outline: none;
    transition: border-color 0.2s;
}

.pig-name-input:focus {
    border-color: rgba(255,220,60,0.9);
    background: rgba(255,255,255,0.18);
}

.pig-name-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.skins-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.skins-label {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}

.skin-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.skin-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}

.skin-btn:hover { transform: scale(1.12); }
.skin-btn.selected { border-color: #FFD700; box-shadow: 0 0 10px rgba(255,215,0,0.7); }
.skin-btn.locked-skin { opacity: 0.5; cursor: not-allowed; }
.skin-btn .skin-cost {
    position: absolute;
    bottom: -14px;
    font-size: 9px;
    color: #FFD700;
    font-weight: 700;
    white-space: nowrap;
}

/* ============================================
   ЩОДЕННИЙ ВИКЛИК
   ============================================ */
.daily-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 180, 0, 0.18);
    border: 2px solid rgba(255, 200, 0, 0.5);
    border-radius: 12px;
    padding: 8px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #FFE082;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    max-width: 380px;
}

.daily-badge-icon { font-size: 20px; }

.daily-done {
    color: #4CAF50;
    font-weight: 700;
}

/* ============================================
   МАГАЗИН
   ============================================ */
.shop-coins-display {
    font-size: 22px;
    font-weight: 700;
    color: #FFD700;
    background: rgba(0,0,0,0.35);
    padding: 8px 22px;
    border-radius: 10px;
    margin-bottom: 18px;
    border: 2px solid rgba(255,215,0,0.4);
}

.shop-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    max-width: 600px;
    margin-bottom: 20px;
}

.shop-item {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 18px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shop-item:hover:not(.shop-item-disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border-color: #FFD700;
}

.shop-item-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.shop-item-icon { font-size: 36px; }
.shop-item-name { font-size: 14px; font-weight: 700; color: #fff; text-align: center; }
.shop-item-desc { font-size: 12px; color: rgba(255,255,255,0.6); text-align: center; }
.shop-item-cost { font-size: 15px; font-weight: 700; color: #FFD700; margin-top: 4px; }

/* ============================================
   ТАБЛИЦЯ РЕКОРДІВ
   ============================================ */
.lb-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.lb-tab {
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.lb-tab.active {
    background: rgba(255, 220, 60, 0.25);
    border-color: #FFD700;
    color: #FFD700;
}

.lb-content {
    max-width: 420px;
    width: 100%;
    min-height: 160px;
    margin-bottom: 14px;
}

.lb-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.lb-rank { font-size: 22px; min-width: 30px; text-align: center; }
.lb-level-title {
    font-size: 14px;
    color: #FFD700;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 14px 0 6px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,215,0,0.3);
}
.lb-name { flex: 1; font-weight: 600; font-size: 15px; }
.lb-time { font-size: 15px; font-weight: 700; color: #FFD700; }
.lb-date { font-size: 11px; color: rgba(255,255,255,0.4); margin-left: 4px; }

.lb-empty {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 15px;
    padding: 30px 0;
}

/* ============================================
   АНІМАЦІЯ СМЕРТІ
   ============================================ */
.death-overlay {
    position: fixed;
    inset: 0;
    background: rgba(200, 0, 0, 0);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: none;
}

.death-overlay.hidden {
    display: none;
}

.death-overlay.death-flash {
    animation: deathFlash 0.7s ease-out forwards;
}

@keyframes deathFlash {
    0%   { background: rgba(200, 0, 0, 0.7); }
    100% { background: rgba(200, 0, 0, 0); }
}

.death-text {
    font-size: 72px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px rgba(255,0,0,0.9), 0 4px 8px rgba(0,0,0,0.8);
    animation: none;
    opacity: 0;
}

@keyframes deathTextPop {
    0%   { transform: scale(0.3); opacity: 0; }
    50%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

/* ============================================
   КООП СТАТУС
   ============================================ */
#coop-toggle-btn {
    font-size: 14px;
    padding: 8px 16px;
}

/* HUD ім'я свинки */
#hud-pig-name-wrap { 
    display: none;
}
#hud-pig-name {
    font-size: 14px;
    color: #555;
    font-weight: 700;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* ============================================
   ПОКРАЩЕННЯ ГОЛОВНОГО МЕНЮ
   ============================================ */

/* Кнопка "пружинить" при наведенні */
.game-button {
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, filter 0.18s ease;
}
.game-button:hover {
    transform: translateY(-3px) scale(1.035);
}
.game-button:active {
    transform: translateY(1px) scale(0.97);
}

/* Головна кнопка меню — виразна */
.menu-main-btn {
    background: linear-gradient(135deg, #a855f7 0%, #6d28d9 100%);
    font-size: 22px;
    padding: 18px 52px;
    box-shadow: 0 6px 28px rgba(109, 40, 217, 0.55);
    letter-spacing: 0.5px;
    margin-top: 6px;
    margin-bottom: 6px;
}
.menu-main-btn:hover {
    box-shadow: 0 10px 36px rgba(109, 40, 217, 0.72);
}

/* ---- Прогрес-бар ---- */
.menu-progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    width: min(340px, 86vw);
}
.menu-progress-label {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.3px;
}
.menu-progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.22);
}
.menu-progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f9c74f 0%, #f3722c 100%);
    box-shadow: 0 0 10px rgba(249,199,79,0.55);
    transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Профіль: аватар + ім'я ---- */
.pig-profile-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 20px;
    padding: 12px 20px;
    width: min(380px, 90vw);
}
.menu-skin-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    border: 3px solid rgba(255,255,255,0.55);
    box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
    animation: avatarPulse 3s ease-in-out infinite;
}
@keyframes avatarPulse {
    0%,100% { box-shadow: 0 4px 18px rgba(0,0,0,0.28); }
    50%      { box-shadow: 0 4px 24px rgba(168,85,247,0.5); }
}
.pig-name-col {
    flex: 1;
}

/* ---- Кутові кнопки меню ---- */
.menu-corner-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), background 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.22);
    user-select: none;
    flex-shrink: 0;
}
.menu-corner-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: scale(1.14);
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}
.menu-corner-btn:active {
    transform: scale(0.95);
}

/* Рядок кнопок під заголовком */
.menu-top-btns {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* ---- Модальні вікна ---- */
.menu-modal {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: modalFadeIn 0.18s ease;
}
.menu-modal.hidden {
    display: none;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.menu-modal-box {
    background: rgba(30, 18, 55, 0.95);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 22px;
    padding: 30px 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: min(460px, 90vw);
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
    animation: modalBoxIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalBoxIn {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}
.menu-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

/* Більше частинок у фоні — нові варіанти */
.mp:nth-child(9)  { left: 45%; animation-delay: 5.2s; animation-duration: 8.8s; font-size: 24px; }
.mp:nth-child(10) { left: 90%; animation-delay: 3.5s; animation-duration: 9.2s; font-size: 20px; }

@media (max-width: 768px) {
    .menu-skin-avatar { width: 56px; height: 56px; font-size: 30px; }
    .pig-profile-row  { padding: 10px 14px; gap: 12px; }
    .menu-corner-btn { width: 40px; height: 40px; font-size: 18px; }
    .menu-top-btns { gap: 10px; margin-bottom: 8px; }
    .menu-main-btn { font-size: 18px; padding: 14px 38px; }
    .menu-progress-wrap { width: min(280px, 90vw); }
}

/* ---- Кнопка "Змінити скін" у профілі ---- */
.skin-change-btn {
    font-size: 14px !important;
    padding: 7px 14px !important;
    margin: 6px 0 0 0 !important;
}

/* ============================================
   ПОВНОЕКРАННИЙ ЕКРАН ВИБОРУ СКІНУ
   ============================================ */
#skin-select-screen {
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: max(28px, env(safe-area-inset-top));
    gap: 0;
}

.skin-screen-title {
    font-size: clamp(28px, 5vw, 46px) !important;
    margin-bottom: 8px !important;
    text-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.skin-screen-coins {
    font-size: 18px;
    font-weight: 700;
    color: #FFD700;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,215,0,0.4);
    border-radius: 999px;
    padding: 6px 20px;
    margin-bottom: 24px;
}

/* Сітка карток скінів */
.skin-screen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    width: min(780px, 94vw);
    margin-bottom: 24px;
    padding: 4px 2px;
}

/* Картка скіна */
.skin-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 12px 16px;
    border-radius: 22px;
    border: 2px solid rgba(255,255,255,0.18);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
    min-height: 160px;
    backdrop-filter: blur(4px);
}

.skin-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
    border-color: rgba(255,255,255,0.45);
}

.skin-card:active {
    transform: scale(0.97);
}

/* Вибрана картка */
.skin-card--selected {
    border-color: #FFD700 !important;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.4), 0 8px 24px rgba(0,0,0,0.5) !important;
    background: rgba(255,215,0,0.1) !important;
}

/* Заблокована картка */
.skin-card--locked {
    opacity: 0.7;
}

/* Анімація "немає монет" */
.skin-card--no-coins {
    animation: skinNoCoins 0.5s ease;
    border-color: #ff4444 !important;
}

@keyframes skinNoCoins {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-7px); }
    40%     { transform: translateX(7px); }
    60%     { transform: translateX(-5px); }
    80%     { transform: translateX(5px); }
}

/* Великий емодзі скіна */
.skin-card-emoji {
    font-size: 54px;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.skin-card:hover .skin-card-emoji {
    transform: scale(1.1) translateY(-3px);
}

/* Назва */
.skin-card-label {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Ціна */
.skin-card-cost {
    font-size: 14px;
    font-weight: 700;
    color: #FFD700;
    background: rgba(0,0,0,0.35);
    border-radius: 999px;
    padding: 3px 10px;
    border: 1px solid rgba(255,215,0,0.4);
}

/* Бейдж "Обрано" / "Обрати" */
.skin-card-badge {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #22c55e, #15803d);
    border-radius: 999px;
    padding: 3px 12px;
    letter-spacing: 0.3px;
}

.skin-card-badge--pick {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Pop-in анімація карток при появі екрана */
.skin-card {
    animation: skinCardIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes skinCardIn {
    from { transform: scale(0.7) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);      opacity: 1; }
}

.skin-card:nth-child(1) { animation-delay: 0.00s; }
.skin-card:nth-child(2) { animation-delay: 0.06s; }
.skin-card:nth-child(3) { animation-delay: 0.12s; }
.skin-card:nth-child(4) { animation-delay: 0.18s; }
.skin-card:nth-child(5) { animation-delay: 0.24s; }
.skin-card:nth-child(6) { animation-delay: 0.30s; }
.skin-card:nth-child(7) { animation-delay: 0.36s; }

@media (max-width: 600px) {
    .skin-screen-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
    .skin-card { min-height: 130px; padding: 16px 8px 12px; }
    .skin-card-emoji { font-size: 40px; }
    .skin-card-label { font-size: 13px; }
}

/* ============================================
   НОВІ ПОКРАЩЕННЯ ГОЛОВНОГО МЕНЮ
   ============================================ */

/* ---- Анімація свинки у заголовку ---- */
.menu-title-pig {
    animation: pigTitleWave 3.5s ease-in-out infinite;
    transform-origin: bottom center;
}
@keyframes pigTitleWave {
    0%,100% { transform: rotate(0deg) scale(1); }
    15%      { transform: rotate(-8deg) scale(1.08); }
    30%      { transform: rotate(6deg) scale(1.05); }
    45%      { transform: rotate(-4deg) scale(1.03); }
    55%      { transform: rotate(0deg) scale(1); }
}

/* ---- Реальна картинка свинки в аватарі ---- */
.avatar-pig-wrap {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.avatar-pig-img {
    width: 110%;
    height: 110%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.menu-skin-avatar:hover .avatar-pig-img {
    transform: scale(1.08);
}

/* Маленька іконка свинки біля лейбла */
.pig-label-icon {
    width: 22px;
    height: 22px;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 2px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

/* ---- Зірочки на прогрес-барі ---- */
.menu-progress-bar-outer {
    position: relative;
    width: 100%;
    padding-top: 14px; /* місце для зірочок над баром */
}
.menu-progress-bar-bg {
    width: 100%;
}
.menu-progress-stars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    pointer-events: none;
}
.mps {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    opacity: 0.3;
    transition: opacity 0.4s, transform 0.4s, filter 0.4s;
    filter: grayscale(1);
    line-height: 1;
}
.mps--lit {
    opacity: 1;
    filter: none;
    transform: translate(-50%, -60%) scale(1.3);
    animation: starPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes starPop {
    from { transform: translate(-50%, -50%) scale(0.6); }
    to   { transform: translate(-50%, -55%) scale(1.25); }
}

/* ---- Обгортка аватара + монети ---- */
.pig-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ---- Монети під аватаром ---- */
.menu-pig-coins {
    font-size: 13px;
    font-weight: 800;
    color: #FFD700;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,215,0,0.4);
    border-radius: 999px;
    padding: 3px 10px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    animation: coinsGlow 2.5s ease-in-out infinite;
}
@keyframes coinsGlow {
    0%,100% { box-shadow: 0 0 6px rgba(255,215,0,0.2); }
    50%      { box-shadow: 0 0 12px rgba(255,215,0,0.5); }
}

/* ---- Останній рекорд ---- */
.menu-last-record {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin: -4px 0 8px;
    letter-spacing: 0.2px;
}
.menu-last-record span {
    color: #FFD700;
    font-weight: 800;
}

/* ============================================
   БАНЕР НЕБЕЗПЕКИ
   ============================================ */
.hazard-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99991;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.hazard-popup-overlay.hazard-popup-show {
    opacity: 1;
    pointer-events: all;
}
.hazard-popup-overlay.hidden { display: none; }
.hazard-popup-box {
    background: linear-gradient(135deg,#4a0000 0%,#7a0a0a 100%);
    border: 3px solid #FF3333;
    border-radius: 24px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0,0,0,0.7), 0 0 32px rgba(255,50,50,0.3);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.hazard-popup-show .hazard-popup-box {
    transform: scale(1);
}
.hazard-popup-icon {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(255,0,0,0.5));
    animation: hazardShake 0.5s ease-in-out;
}
@keyframes hazardShake {
    0%,100% { transform: rotate(0deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(8deg); }
    60% { transform: rotate(-5deg); }
    80% { transform: rotate(5deg); }
}
.hazard-popup-title {
    font-size: 24px;
    font-weight: 900;
    color: #FF6666;
    margin-bottom: 14px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.hazard-popup-text {
    font-size: 15px;
    color: rgba(255,255,255,0.92);
    line-height: 1.6;
    margin-bottom: 16px;
}
.hazard-popup-warning {
    background: rgba(255,0,0,0.18);
    border: 1px solid rgba(255,80,80,0.4);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #FF9999;
    margin-bottom: 20px;
}
.hazard-popup-btn {
    background: linear-gradient(135deg,#FF3333 0%,#CC0000 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 13px 38px;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255,50,50,0.45);
    transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.16s;
    letter-spacing: 0.5px;
}
.hazard-popup-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 6px 24px rgba(255,50,50,0.65);
}

/* ---- Яскраві кнопки Рекорди ---- */

/* ============================================
   ПОПАП ПРО ОВОЧ
   ============================================ */
.veg-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.veg-popup-overlay.veg-popup-show {
    opacity: 1;
    pointer-events: all;
}
.veg-popup-overlay.hidden { display: none; }
.veg-popup-box {
    background: linear-gradient(135deg, #1B4D20 0%, #2E7D32 100%);
    border: 3px solid #4CAF50;
    border-radius: 24px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 32px rgba(76,175,80,0.25);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.veg-popup-show .veg-popup-box {
    transform: scale(1);
}
.veg-popup-icon {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}
.veg-popup-title {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 14px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.veg-popup-text {
    font-size: 15px;
    color: rgba(255,255,255,0.92);
    line-height: 1.6;
    margin-bottom: 16px;
}
.veg-popup-bonus {
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #FFE082;
    margin-bottom: 20px;
}
.veg-popup-btn {
    background: linear-gradient(135deg, #FFD600 0%, #FF9800 100%);
    color: #1a0a00;
    border: none;
    border-radius: 50px;
    padding: 13px 40px;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255,200,0,0.45);
    transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.16s;
    letter-spacing: 0.5px;
}
.veg-popup-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 6px 24px rgba(255,200,0,0.65);
}
.menu-btn-accent {
    font-weight: 800 !important;
    border: none !important;
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s !important;
}
.menu-btn-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: 0 4px 16px rgba(245,158,11,0.45) !important;
}
.menu-btn-gold:hover {
    box-shadow: 0 6px 22px rgba(245,158,11,0.65) !important;
}

/* ---- Менша щоденна задача ---- */
.daily-badge--mini {
    font-size: 12px !important;
    padding: 5px 12px !important;
    margin-bottom: 6px !important;
    opacity: 0.82;
    background: rgba(255,180,0,0.12) !important;
    border-color: rgba(255,200,0,0.3) !important;
}
.daily-badge--mini .daily-badge-icon { font-size: 14px !important; }

@media (max-width: 768px) {
    .menu-pig-coins { font-size: 11px; padding: 2px 8px; }
    .menu-last-record { font-size: 12px; }
}

/* ========================================
   Info-screen: Controls & Settings
   ======================================== */
.info-screen-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    padding: 36px 20px 28px;
    box-sizing: border-box;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

.info-screen-header {
    width: 100%;
    text-align: center;
    margin-bottom: 28px;
}

.info-screen-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    margin: 0;
}

.info-screen-back {
    margin-top: 28px;
    min-width: 160px;
}

/* ---- Controls screen ---- */
.controls-section {
    width: 100%;
    margin-bottom: 22px;
}

.controls-section-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-bottom: 10px;
    padding-left: 4px;
}

.controls-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ctrl-card {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 90px;
    flex: 1 1 90px;
    backdrop-filter: blur(6px);
    transition: background .2s, transform .15s;
}

.ctrl-card:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

.ctrl-keys {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

kbd {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.32);
    border-bottom-width: 3px;
    border-radius: 7px;
    padding: 3px 9px;
    font-family: 'Segoe UI', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    min-width: 24px;
    text-align: center;
}

.ctrl-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    text-align: center;
    font-weight: 600;
}

/* ---- Settings screen ---- */
.settings-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-item {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    backdrop-filter: blur(6px);
}

.settings-item--danger {
    border-color: rgba(255,80,80,0.35);
    background: rgba(255,60,60,0.08);
}

.settings-item-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.settings-item-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.settings-item-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.settings-item-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
}

.settings-toggle {
    font-size: 1.4rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background .2s, transform .15s;
    color: #fff;
    line-height: 1;
}

.settings-toggle:hover { background: rgba(255,255,255,0.25); transform: scale(1.08); }
.settings-toggle--off  { background: rgba(60,60,60,0.35); }

.settings-danger-btn {
    background: rgba(255,60,60,0.65);
    border: 1px solid rgba(255,100,100,0.5);
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 18px;
    cursor: pointer;
    transition: background .2s, transform .15s;
    white-space: nowrap;
}

.settings-danger-btn:hover {
    background: rgba(255,60,60,0.88);
    transform: scale(1.04);
}

#settings-screen {
    overflow-y: auto;
    padding: 0;
    position: absolute;
    background:
        radial-gradient(circle at 15% 18%, rgba(255, 225, 144, 0.18), transparent 28%),
        radial-gradient(circle at 84% 14%, rgba(120, 200, 255, 0.15), transparent 26%),
        radial-gradient(circle at 78% 78%, rgba(255, 140, 200, 0.14), transparent 28%),
        linear-gradient(160deg, #0e1f3a 0%, #0b2540 45%, #071830 100%);
}

#settings-screen::before,
#settings-screen::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

#settings-screen::before {
    background:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.18;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.78), transparent 92%);
}

#settings-screen::after {
    background:
        radial-gradient(circle at 50% 0%, rgba(255,255,255,0.16), transparent 36%),
        radial-gradient(circle at 50% 100%, rgba(23, 56, 104, 0.24), transparent 45%);
}

#settings-screen .info-screen-wrap {
    max-width: min(1180px, 100%);
    align-items: stretch;
    padding: 28px 18px 32px;
    position: relative;
    z-index: 1;
}

.pig-room-shell {
    width: min(1100px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.pig-room-atmosphere {
    position: absolute;
    inset: -12px -18px auto;
    height: 180px;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.pig-room-spark {
    position: absolute;
    display: block;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.18));
    opacity: 0.72;
    animation: pigRoomFloat 10s ease-in-out infinite;
}

.pig-room-spark--a { left: 3%; top: 28px; font-size: 26px; animation-delay: 0s; }
.pig-room-spark--b { left: 22%; top: 92px; font-size: 24px; animation-delay: 1.2s; }
.pig-room-spark--c { right: 26%; top: 34px; font-size: 22px; animation-delay: 2.1s; }
.pig-room-spark--d { right: 10%; top: 96px; font-size: 28px; animation-delay: 3.4s; }
.pig-room-spark--e { left: 56%; top: 18px; font-size: 24px; animation-delay: 4s; }

@keyframes pigRoomFloat {
    0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
    50% { transform: translateY(-10px) rotate(7deg) scale(1.08); }
}

.pig-room-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at top left, rgba(255, 233, 164, 0.34), transparent 34%),
        radial-gradient(circle at 80% 24%, rgba(164, 228, 255, 0.2), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(145, 217, 255, 0.12) 52%, rgba(255, 210, 140, 0.12) 100%);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 24px 60px rgba(7, 23, 41, 0.24), inset 0 1px 0 rgba(255,255,255,0.22);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.pig-room-hero::before,
.pig-room-hero::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.pig-room-hero::before {
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.16) 22%, transparent 42%);
    transform: translateX(-48%);
}

.pig-room-hero::after {
    right: -80px;
    bottom: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 188, 116, 0.14), transparent 72%);
}

.pig-room-avatar {
    width: 108px;
    height: 108px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 30% 28%, rgba(255,255,255,0.4), transparent 34%),
        linear-gradient(160deg, rgba(255,255,255,0.28) 0%, rgba(255, 212, 138, 0.2) 100%);
    border: 1px solid rgba(255,255,255,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), 0 16px 38px rgba(0,0,0,0.24), 0 0 0 8px rgba(255,255,255,0.05);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.pig-room-avatar::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.16);
    pointer-events: none;
}

.pig-room-avatar .avatar-pig-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pig-room-avatar .avatar-pig-img {
    width: 88%;
    height: 88%;
    object-fit: contain;
}

.pig-room-avatar .pig-room-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pig-room-kicker,
.pig-room-card-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    font-weight: 800;
}

.pig-room-hero-copy {
    position: relative;
    z-index: 2;
}

.pig-room-title {
    text-align: left;
    margin-top: 4px;
    font-size: clamp(2rem, 3.7vw, 2.8rem);
    letter-spacing: 0.01em;
    text-shadow: 0 8px 24px rgba(21, 48, 76, 0.28);
}

.pig-room-sub {
    margin-top: 8px;
    color: rgba(255,255,255,0.82);
    font-size: 1rem;
    line-height: 1.45;
    max-width: 620px;
}

.pig-room-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.pig-room-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.94);
    font-weight: 700;
    font-size: 0.84rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.pig-room-hero-glow {
    position: absolute;
    right: 42px;
    top: 24px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 239, 188, 0.28), rgba(255, 201, 111, 0.08) 42%, transparent 70%);
    filter: blur(2px);
    pointer-events: none;
    z-index: 1;
}

.pig-room-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.pig-room-chip {
    padding: 16px 18px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%),
        radial-gradient(circle at top right, rgba(255, 219, 143, 0.12), transparent 46%);
    border: 1px solid rgba(255,255,255,0.18);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 28px rgba(14, 34, 64, 0.16), inset 0 1px 0 rgba(255,255,255,0.14);
    position: relative;
    overflow: hidden;
}

.pig-room-chip::after {
    content: '';
    position: absolute;
    inset: auto -28px -28px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 72%);
}

.pig-room-chip-icon {
    grid-row: 1 / span 2;
    font-size: 1.55rem;
}

.pig-room-chip-value {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.pig-room-chip-label {
    color: rgba(255,255,255,0.68);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pig-room-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pig-room-card {
    --pig-room-accent: rgba(255, 214, 102, 0.8);
    padding: 20px;
    border-radius: 28px;
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 18px 36px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.pig-room-card::before,
.pig-room-card::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.pig-room-card::before {
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--pig-room-accent), rgba(255,255,255,0));
    opacity: 0.95;
}

.pig-room-card::after {
    right: -54px;
    top: -54px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 68%);
    z-index: -1;
}

.pig-room-card--profile {
    --pig-room-accent: rgba(255, 197, 89, 0.95);
    background: linear-gradient(135deg, rgba(255, 204, 120, 0.18) 0%, rgba(255,255,255,0.12) 100%);
}

.pig-room-card--sound {
    --pig-room-accent: rgba(114, 205, 255, 0.95);
    background: linear-gradient(135deg, rgba(120, 198, 255, 0.18) 0%, rgba(255,255,255,0.1) 100%);
}

.pig-room-card--gameplay {
    --pig-room-accent: rgba(123, 231, 164, 0.95);
    background: linear-gradient(135deg, rgba(140, 225, 170, 0.18) 0%, rgba(255,255,255,0.1) 100%);
}

.pig-room-card--interface {
    --pig-room-accent: rgba(201, 173, 255, 0.95);
    background: linear-gradient(135deg, rgba(193, 165, 255, 0.18) 0%, rgba(255,255,255,0.1) 100%);
}

.pig-room-card--progress {
    --pig-room-accent: rgba(255, 214, 102, 0.95);
    background: linear-gradient(135deg, rgba(255, 214, 102, 0.18) 0%, rgba(255,255,255,0.1) 100%);
}

.pig-room-card--danger {
    --pig-room-accent: rgba(255, 110, 110, 0.95);
    background: linear-gradient(135deg, rgba(255, 116, 116, 0.16) 0%, rgba(255,255,255,0.08) 100%);
}

.pig-room-card--language {
    --pig-room-accent: rgba(100, 220, 180, 0.95);
    background: linear-gradient(135deg, rgba(80, 210, 170, 0.18) 0%, rgba(255,255,255,0.1) 100%);
}

/* Hide Google Translate toolbar */
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
}
body { top: 0 !important; }
.skiptranslate { display: none !important; }

.pig-room-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.pig-room-card-title {
    color: #fff;
    font-size: 1.34rem;
    font-weight: 800;
    margin: 4px 0 0;
    text-shadow: 0 4px 14px rgba(18, 40, 64, 0.14);
}

.pig-room-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.45rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.pig-room-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pig-room-field-label {
    color: rgba(255,255,255,0.82);
    font-size: 0.88rem;
    font-weight: 700;
}

.pig-room-input {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.24);
    background: linear-gradient(180deg, rgba(9, 24, 44, 0.3) 0%, rgba(17, 32, 58, 0.24) 100%);
    color: #fff;
    padding: 14px 16px;
    font-size: 1rem;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 20px rgba(5, 16, 32, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}

.pig-room-input:focus {
    border-color: rgba(255, 221, 132, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 205, 96, 0.18), 0 12px 22px rgba(5, 16, 32, 0.18);
    transform: translateY(-1px);
}

.pig-room-input::placeholder {
    color: rgba(255,255,255,0.45);
}

.pig-room-inline-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pig-room-inline-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: rgba(255,255,255,0.86);
    font-size: 0.95rem;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
}

.pig-room-inline-row strong {
    color: #fff;
    text-align: right;
}

.pig-room-actions,
.pig-room-danger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pig-room-toggle-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    position: relative;
    padding: 15px 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.07) 100%);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pig-room-toggle-row:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.2);
    background: linear-gradient(180deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.08) 100%);
}

.pig-room-toggle-row strong {
    display: block;
    color: #fff;
    font-size: 0.96rem;
    margin-bottom: 3px;
}

.pig-room-toggle-row small {
    display: block;
    color: rgba(255,255,255,0.64);
    line-height: 1.35;
}

.pig-room-switch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pig-room-switch {
    width: 58px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.08) 100%);
    border: 1px solid rgba(255,255,255,0.26);
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.pig-room-switch::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.22);
    transition: transform 0.2s ease;
}

.pig-room-switch-input:checked + .pig-room-switch {
    background: linear-gradient(135deg, #ffd166 0%, #ff8c42 100%);
    box-shadow: 0 0 18px rgba(255, 188, 67, 0.34);
}

.pig-room-switch-input:checked + .pig-room-switch::after {
    transform: translateX(26px);
}

.pig-room-range-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,0.9);
    font-weight: 700;
    font-size: 0.92rem;
}

.pig-room-range {
    width: 100%;
    accent-color: #ffb703;
}

.pig-room-range::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 214, 102, 0.9) 0%, rgba(255, 146, 77, 0.9) 100%);
}

.pig-room-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-top: -6px;
    border: 2px solid rgba(255,255,255,0.9);
    background: #fff7da;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.pig-room-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pig-room-mini-stat {
    padding: 14px 10px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.08) 100%);
    border: 1px solid rgba(255,255,255,0.14);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.pig-room-mini-icon {
    font-size: 1.25rem;
}

.pig-room-mini-stat strong {
    color: #fff;
    font-size: 1.08rem;
}

.pig-room-mini-stat small,
.pig-room-note {
    color: rgba(255,255,255,0.68);
}

.pig-room-note {
    line-height: 1.45;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
}

.pig-room-danger-actions .settings-danger-btn {
    box-shadow: 0 10px 22px rgba(98, 20, 20, 0.18);
}

/* Language selector */
.pig-room-lang-wrap {
    position: relative;
}

.pig-room-lang-select {
    width: 100%;
    padding: 13px 44px 13px 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.10);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.2s, background-color 0.2s;
}

.pig-room-lang-select:hover {
    border-color: rgba(100, 220, 180, 0.6);
    background-color: rgba(255,255,255,0.15);
}

.pig-room-lang-select:focus {
    outline: none;
    border-color: rgba(100, 220, 180, 0.9);
    box-shadow: 0 0 0 3px rgba(100, 220, 180, 0.2);
}

.pig-room-lang-select option {
    background: #0e1f3a;
    color: #fff;
}

.pig-room-lang-note {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
    margin: 4px 0 0;
}

.settings-danger-btn--soft {
    background: rgba(255, 125, 70, 0.7);
}

.settings-danger-btn--soft:hover {
    background: rgba(255, 125, 70, 0.92);
}

.settings-danger-btn--hard {
    background: rgba(215, 45, 45, 0.82);
}

.settings-danger-btn--hard:hover {
    background: rgba(215, 45, 45, 1);
}

body.settings-bright-hud #hud,
body.settings-bright-hud #level-info {
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

body.settings-bright-hud .hud-item {
    background: rgba(236, 245, 255, 1);
    border-color: rgba(82, 145, 230, 1);
}

body.settings-large-text #hud .hud-item,
body.settings-large-text #level-info,
body.settings-large-text .pig-room-card,
body.settings-large-text .pig-room-input,
body.settings-large-text .pig-room-sub {
    font-size: 1.05em;
}

body.settings-reduced-motion *,
body.settings-reduced-motion *::before,
body.settings-reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

@media (max-width: 900px) {
    .pig-room-summary,
    .pig-room-grid {
        grid-template-columns: 1fr;
    }

    .pig-room-mini-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    #settings-screen .info-screen-wrap {
        padding: 18px 14px 28px;
    }

    .pig-room-atmosphere {
        inset: -4px -6px auto;
    }

    .pig-room-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 18px;
    }

    .pig-room-avatar {
        width: 88px;
        height: 88px;
        border-radius: 24px;
    }

    .pig-room-hero-badges {
        gap: 8px;
    }

    .pig-room-hero-badge {
        font-size: 0.76rem;
        padding: 8px 12px;
    }

    .pig-room-card,
    .pig-room-chip {
        padding: 16px;
    }

    .pig-room-title {
        font-size: 1.6rem;
    }

    .pig-room-actions,
    .pig-room-danger-actions {
        flex-direction: column;
    }

    .pig-room-actions .game-button,
    .pig-room-danger-actions .settings-danger-btn {
        width: 100%;
    }
}

/* ========================================
   Екран вибору рівнів — покращення
   ======================================== */

/* Зірки під номером рівня */
.level-stars {
    display: flex;
    gap: 1px;
    justify-content: center;
    line-height: 1;
    margin-top: 2px;
}

.lstar {
    font-size: clamp(9px, calc(var(--node-size, 86px) * 0.145), 14px);
    color: rgba(255,255,255,0.25);
    transition: color .2s;
}

.lstar--on {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255,210,0,0.7);
}

/* Пульс наступного рівня */
.level-button--next {
    animation: nextLevelPulse 1.6s ease-in-out infinite !important;
}

@keyframes nextLevelPulse {
    0%,100% { box-shadow: 0 8px 0 rgba(65,43,31,0.35), 0 0 0 3px rgba(255,210,70,0.5),  0 0 20px rgba(255,210,70,0.4); }
    50%      { box-shadow: 0 8px 0 rgba(65,43,31,0.35), 0 0 0 6px rgba(255,210,70,0.85), 0 0 38px rgba(255,210,70,0.7); }
}

/* ========== ПАЗЛ ========== */
#puzzle-canvas {
    display: block;
    margin: 12px auto 0;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 24px rgba(0,0,0,0.6);
}
.puzzle-instruction {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin: 2px 0 0;
    text-align: center;
}
.puzzle-hint {
    font-size: 24px;
    min-height: 36px;
    text-align: center;
    margin-top: 10px;
}

/* ================================================================
   НОВІ СТИЛІ — СВІТ МОРСЬКИХ СВИНОК
   ================================================================ */

/* ---- ЗАГАЛЬНЕ ---- */
body {
    margin: 0;
    font-family: 'Segoe UI', 'Arial Rounded MT Bold', sans-serif;
    background: #FFF5E6;
    overflow-x: hidden;
}
body.in-game { overflow: hidden; background: #1a1a2e; touch-action: none; }
body.in-mode { overflow-x: hidden; overflow-y: auto; background: #FFF5E6; touch-action: pan-y; }
body.in-menu { overflow: hidden; touch-action: auto; }

/* ---- ГОЛОВНЕ МЕНЮ ---- */
.main-menu {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px 20px 24px;
    background: linear-gradient(135deg, #EAF6FF 0%, #C9E6FF 50%, #EEF7FF 100%);
    overflow-x: hidden;
    overflow-y: scroll;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}
.menu-bg-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.menu-bg-decor span {
    position: absolute;
    font-size: clamp(20px, 4vw, 40px);
    opacity: 0.12;
    animation: floatDecor 8s ease-in-out infinite;
}
.menu-bg-decor span:nth-child(1)  { left: 5%;  top: 10%; animation-delay: 0s; }
.menu-bg-decor span:nth-child(2)  { left: 15%; top: 70%; animation-delay: 1s; }
.menu-bg-decor span:nth-child(3)  { left: 80%; top: 15%; animation-delay: 2s; }
.menu-bg-decor span:nth-child(4)  { left: 90%; top: 60%; animation-delay: 0.5s; }
.menu-bg-decor span:nth-child(5)  { left: 50%; top: 5%;  animation-delay: 3s; }
.menu-bg-decor span:nth-child(6)  { left: 30%; top: 85%; animation-delay: 1.5s; }
.menu-bg-decor span:nth-child(7)  { left: 70%; top: 80%; animation-delay: 2.5s; }
.menu-bg-decor span:nth-child(8)  { left: 25%; top: 30%; animation-delay: 4s; }
.menu-bg-decor span:nth-child(9)  { left: 60%; top: 50%; animation-delay: 0.8s; }
.menu-bg-decor span:nth-child(10) { left: 42%; top: 92%; animation-delay: 3.5s; }
@keyframes floatDecor {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-18px) rotate(10deg); }
}

.menu-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 780px;
    width: 100%;
    padding: 10px 0;
}
.main-menu-title {
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 900;
    color: #5A2E00;
    text-shadow: 2px 3px 0 rgba(255,180,80,0.4);
    margin: 0;
    text-align: center;
    letter-spacing: -1px;
}
.main-menu-sub {
    font-size: clamp(14px, 2vw, 20px);
    color: #A06020;
    margin: 0;
    text-align: center;
}
.main-menu-pig-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
#menu-pig-canvas {
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(160,80,0,0.18);
    background: #FFF5E6;
    max-width: 90vw;
    max-height: 180px;
}
.menu-pig-name-label {
    font-size: 14px;
    color: #A06020;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Плитки меню */
.main-menu-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
}
.main-menu-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    font-family: inherit;
}
.main-menu-tile:hover   { transform: translateY(-4px) scale(1.03); box-shadow: 0 10px 28px rgba(0,0,0,0.15); }
.main-menu-tile:active  { transform: scale(0.97); }
.tile-gallery  { background: linear-gradient(135deg, #D4F4FF, #A8E4FF); }
.tile-dresser  { background: linear-gradient(135deg, #FFD6F0, #FFAAE0); }
.tile-feeding  { background: linear-gradient(135deg, #D4FFD4, #A0ECA0); }
.tile-puzzles  { background: linear-gradient(135deg, #FFE8A0, #FFD060); }
.tile-game     { background: linear-gradient(135deg, #D0C8FF, #B0A0FF); }
.tile-guide-male   { background: linear-gradient(135deg, #C8E6FF, #90CAF9); }
.tile-guide-female { background: linear-gradient(135deg, #FFD6EC, #F48FB1); }
.tile-guide-pair   { background: linear-gradient(135deg, #E0D4FF, #CE93D8); }
.tile-pig-room {
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.5), transparent 34%),
        linear-gradient(135deg, #FFE3A6, #FFC97D 52%, #FFAF84 100%);
    position: relative;
    overflow: hidden;
}
.tile-pig-room::after {
    content: '';
    position: absolute;
    right: -18px;
    bottom: -16px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3), transparent 70%);
    pointer-events: none;
}
.tile-icon  { font-size: 22px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.tile-pig-img { width: 28px; height: 28px; object-fit: cover; border-radius: 50%; vertical-align: middle; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.menu-title-pig-img { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; vertical-align: middle; box-shadow: 0 2px 8px rgba(0,0,0,0.18); margin-right: 4px; }
.gd-header-pig-img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; vertical-align: middle; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
/* Квадратна, збільшена іконка в заголовку розділу «Породи» */
.br-header .gd-header-pig-img { width: 88px; height: 88px; border-radius: 12px; }
.gd-img { width: 112px; height:112px; object-fit: cover; vertical-align: middle; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.tile-label { font-size: 12px; font-weight: 700; color: #2A2A2A; }
.tile-desc  { font-size: 9px; color: #555; text-align: center; }

/* ---- РЕЖИМ-КОНТЕЙНЕР ---- */
.mode-container {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #FFF9F4;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mode-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(90deg, #FF9240, #FFB060);
    box-shadow: 0 2px 12px rgba(200,80,0,0.18);
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 100;
}
.mode-topbar-icon {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 7px;
    vertical-align: middle;
    margin-right: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.mode-topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.back-to-menu-btn {
    background: rgba(255,255,255,0.25);
    border: 2px solid rgba(255,255,255,0.6);
    color: #FFFFFF;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.back-to-menu-btn:hover { background: rgba(255,255,255,0.4); }
.mode-mount {
    flex: 1 0 auto;
    overflow: visible;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
    min-height: 0;
}

/* Кнопка "← Меню" над платформером */
.game-back-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9999;
    background: rgba(255,120,40,0.9);
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: background 0.15s;
    font-family: inherit;
}
.game-back-btn:hover { background: rgba(255,80,0,0.95); }

/* У режимах (Енциклопедія тощо) є власна кнопка «Меню» в топбарі —
   ховаємо плаваючу кнопку платформера, щоб вони не накладались */
body.in-mode #game-back-btn { display: none !important; }

/* ================================================================
   ДОВІДНИК ЇЖІ ДЛЯ МОРСЬКИХ СВИНОК
   ================================================================ */
.fd-module {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ---- Заголовок ---- */
.fd-header { text-align: center; margin-bottom: 16px; }
.fd-header h1 { font-size: clamp(22px, 3vw, 36px); color: #5A2E00; margin: 0 0 6px; }
.fd-subtitle { color: #A06020; font-size: 15px; margin: 0; }

/* ---- Пошук ---- */
.fd-search-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.fd-search {
    width: 100%; max-width: 480px;
    padding: 11px 20px;
    border: 2px solid #E8C080;
    border-radius: 30px;
    font-size: 15px;
    font-family: inherit;
    background: #FFFDF9;
    color: #3A1A00;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.fd-search:focus { border-color: #FF9240; box-shadow: 0 0 0 3px rgba(255,146,64,.18); }

/* ---- Фільтри категорій ---- */
.fd-filter-bar {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin-bottom: 14px;
}
.fd-filter-btn {
    padding: 8px 17px; border: 2px solid #E8C080; background: #FFF9F0;
    border-radius: 22px; cursor: pointer; font-size: 13px; font-weight: 600; color: #7A4A00;
    transition: all .15s; font-family: inherit;
}
.fd-filter-btn:hover    { background: #FFE8CC; border-color: #FFA040; }
.fd-filter-btn--active  { background: #FF9240; color: #FFF; border-color: #FF7020; }

/* ---- Статистика ---- */
.fd-stats-bar {
    display: flex; gap: 12px; flex-wrap: wrap;
    justify-content: center; margin-bottom: 18px;
}
.fd-stat { font-size: 13px; font-weight: 700; padding: 4px 14px; border-radius: 14px; }
.fd-stat--good { background: #DDFFC4; color: #1E6600; }
.fd-stat--warn { background: #FFF3CD; color: #7A5000; }
.fd-stat--bad  { background: #FFD4D4; color: #880000; }

/* ---- Сітка карток ---- */
.fd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.fd-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #A06020;
}

/* ---- Картка ---- */
.fd-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 16px 12px;
    box-shadow: 0 3px 14px rgba(160,80,0,.09);
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    cursor: pointer;
    transition: transform .14s, box-shadow .14s;
    border: 2px solid transparent;
    text-align: center;
}
.fd-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(160,80,0,.18); }
.fd-card--good { border-color: rgba(80,200,80,.3); }
.fd-card--warn { border-color: rgba(255,180,0,.3); }
.fd-card--bad  { border-color: rgba(220,60,60,.3); background: #FFF8F8; }
.fd-card:hover.fd-card--good { border-color: #44BB00; }
.fd-card:hover.fd-card--warn { border-color: #FFA020; }
.fd-card:hover.fd-card--bad  { border-color: #DD2222; }

.fd-card-emoji { font-size: 40px; line-height: 1; }
.fd-card-name { font-size: 14px; font-weight: 700; color: #3A1A00; line-height: 1.2; }
.fd-card-dose { font-size: 11px; color: #888; line-height: 1.3; }

/* ---- Статус-бейдж ---- */
.fd-card-status {
    font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 12px;
}
.fd-status--good { background: #DDFFC4; color: #1E6600; }
.fd-status--warn { background: #FFF3CD; color: #7A5000; }
.fd-status--bad  { background: #FFD4D4; color: #880000; }

/* ================================================================
   МОДАЛЬНЕ ВІКНО ДОВІДНИКА
   ================================================================ */
.fd-modal {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.fd-modal.hidden { display: none; }
.fd-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(4px);
}
.fd-modal-box {
    position: relative; z-index: 1;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 28px 26px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    animation: fdModalIn .22s ease;
}
@keyframes fdModalIn {
    from { opacity: 0; transform: scale(.93) translateY(12px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.fd-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: #F0E0D0; border: none; border-radius: 50%;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #5A2E00; transition: background .15s;
}
.fd-modal-close:hover { background: #FFCFA0; }

.fd-modal-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.fd-modal-emoji { font-size: 56px; line-height: 1; flex-shrink: 0; }
.fd-modal-title { font-size: 22px; font-weight: 800; color: #3A1A00; margin: 0 0 6px; }
.fd-modal-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-badge {
    font-size: 12px; font-weight: 700;
    padding: 3px 11px; border-radius: 12px;
}
.fd-badge--cat { background: #E8F4FF; color: #1A4A8A; }

.fd-modal-desc {
    font-size: 14px; color: #444; line-height: 1.7;
    margin: 0 0 18px;
    padding: 12px 16px;
    background: #FFFDF5;
    border-left: 4px solid #FFD700;
    border-radius: 0 12px 12px 0;
}

.fd-modal-rows { display: flex; flex-direction: column; gap: 10px; }
.fd-modal-row {
    display: flex; gap: 12px; align-items: flex-start;
    background: #FAFAFA; border-radius: 12px; padding: 11px 14px;
    border: 1px solid #F0E8D8;
}
.fd-modal-row-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.fd-modal-row-label { font-size: 11px; color: #999; font-weight: 600; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .5px; }
.fd-modal-row-val { font-size: 14px; color: #333; font-weight: 500; line-height: 1.5; }
.fd-modal-row-val--good { color: #1E6600; font-weight: 600; }
.fd-modal-row-val--warn { color: #883300; }
.fd-modal-row-val--vitc { color: #0066AA; font-weight: 700; }

/* --- Зірки улюбленості --- */
.fd-stars { color: #FFB800; font-size: 13px; letter-spacing: 1px; }
.fd-stars-dim { color: #DDD; }
.fd-stars--none { font-size: 16px; }
.fd-card-stars { margin-top: 4px; }
.fd-modal-stars { font-size: 13px; color: #888; margin: 4px 0 2px; }
.fd-modal-stars .fd-stars { font-size: 14px; }
.fd-modal-season { font-size: 12px; color: #AAA; margin-top: 2px; }

/* --- Картка: верхній рядок з сезоном і небезпекою --- */
.fd-card-top-row { display: flex; justify-content: space-between; align-items: center; min-height: 18px; margin-bottom: 2px; }
.fd-card-num {
    min-width: 22px; height: 22px; border-radius: 50%;
    background: #FF8C00; color: #fff;
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(255,140,0,.35);
    flex-shrink: 0;
}
.fd-card-season { font-size: 11px; line-height: 1; }
.fd-card-danger { font-size: 14px; line-height: 1; }

/* --- Бейдж небезпеки --- */
.fd-badge--danger { background: #FFF0E0; color: #AA4400; }
.fd-badge--lethal { background: #FFE0E0; color: #AA0000; animation: fd-pulse 1.2s ease-in-out infinite; }
@keyframes fd-pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ================================================================
   ПЕРЕМИКАЧ РЕЖИМІВ
   ================================================================ */
.fd-mode-switcher {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.fd-mode-btn {
    padding: 9px 18px; border-radius: 22px; border: 2px solid #FFB347;
    background: #FFF8F0; color: #AA5500; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all .2s;
}
.fd-mode-btn:hover { background: #FFE8C0; }
.fd-mode-btn--active { background: #FF9240; color: #fff; border-color: #FF9240; }

/* ================================================================
   КАЛЬКУЛЯТОР ВІТАМІНУ C
   ================================================================ */
.fd-vitc-title { margin-bottom: 16px; }
.fd-vitc-title h2 { font-size: 22px; color: #3A1A00; margin: 0 0 6px; }
.fd-vitc-title p { font-size: 14px; color: #666; margin: 0; }
.fd-vitc-progress-wrap { margin-bottom: 14px; }
.fd-vitc-progress-bar-bg {
    height: 20px; background: #F0E8D8; border-radius: 12px; overflow: hidden;
    margin-bottom: 6px;
}
.fd-vitc-progress-bar {
    height: 100%; background: #D32F2F; border-radius: 12px;
    transition: width .4s ease, background .4s;
}
.fd-vitc-bar--mid  { background: #F57C00; }
.fd-vitc-bar--full { background: #2E7D32; }
.fd-vitc-progress-label { font-size: 15px; font-weight: 700; color: #444; }
.fd-vitc-basket {
    min-height: 44px; background: #FFFDF5; border: 1px dashed #FFB347;
    border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.fd-vitc-basket-empty { color: #BBB; font-size: 13px; }
.fd-vitc-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #FFE8C0; border-radius: 20px; padding: 4px 10px;
    font-size: 13px; font-weight: 600; color: #7A3800;
}
.fd-vitc-tag-del {
    background: none; border: none; cursor: pointer; color: #AA5500;
    font-size: 11px; padding: 0 2px; line-height: 1;
}
.fd-vitc-reset {
    background: #FFF0E0; border: 1px solid #FFB347; border-radius: 10px;
    padding: 6px 14px; font-size: 12px; cursor: pointer; color: #AA4400;
    margin-bottom: 14px;
}
.fd-vitc-picker-title { font-size: 13px; color: #888; margin: 0 0 8px; font-weight: 600; }
.fd-vitc-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-vitc-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #F5F5F5; border: 1px solid #E0D8CC; border-radius: 20px;
    padding: 6px 12px; font-size: 13px; cursor: pointer; color: #333;
    transition: background .15s;
}
.fd-vitc-chip:hover { background: #FFE8C0; border-color: #FFB347; }
.fd-vitc-chip strong { color: #0066AA; }

/* ================================================================
   КВІЗ
   ================================================================ */
.fd-quiz-wrap { max-width: 500px; margin: 0 auto; }
.fd-quiz-progress {
    display: flex; justify-content: space-between;
    font-size: 13px; color: #888; margin-bottom: 16px; font-weight: 600;
}
.fd-quiz-card {
    background: #FFFDF5; border-radius: 20px; padding: 32px 20px 24px;
    text-align: center; box-shadow: 0 4px 20px rgba(160,80,0,.1);
    margin-bottom: 20px;
}
.fd-quiz-emoji { font-size: 72px; line-height: 1; margin-bottom: 12px; }
.fd-quiz-name { font-size: 22px; font-weight: 800; color: #3A1A00; margin-bottom: 8px; }
.fd-quiz-question { font-size: 15px; color: #666; margin: 0; }
.fd-quiz-btns { display: flex; gap: 12px; justify-content: center; }
.fd-quiz-btn {
    flex: 1; max-width: 200px; padding: 14px 20px; border-radius: 16px;
    font-size: 16px; font-weight: 800; border: none; cursor: pointer; transition: transform .15s;
}
.fd-quiz-btn:first-child { background: #C8F0C0; color: #1A5A00; }
.fd-quiz-btn:last-child  { background: #F0C0C0; color: #AA0000; }
.fd-quiz-btn:hover:not(:disabled) { transform: scale(1.04); }
.fd-quiz-btn:disabled { opacity: .6; cursor: default; }
.fd-quiz-feedback {
    border-radius: 12px; padding: 12px 16px; margin-top: 14px;
    font-size: 14px; line-height: 1.6; text-align: center;
}
.fd-quiz-feedback--ok  { background: #E8F5E0; color: #1A5A00; }
.fd-quiz-feedback--err { background: #FDECEA; color: #AA0000; }
.fd-quiz-result {
    text-align: center; padding: 40px 20px;
    background: #FFFDF5; border-radius: 20px;
    box-shadow: 0 4px 20px rgba(160,80,0,.1);
}
.fd-quiz-result-icon { font-size: 72px; margin-bottom: 12px; }
.fd-quiz-result-title { font-size: 28px; font-weight: 800; color: #3A1A00; margin: 0 0 8px; }
.fd-quiz-result-score { font-size: 18px; color: #666; margin: 0 0 24px; }
.fd-quiz-restart {
    background: #FF9240; color: #fff; border: none; border-radius: 16px;
    padding: 13px 30px; font-size: 16px; font-weight: 800; cursor: pointer;
    transition: background .2s;
}
.fd-quiz-restart:hover { background: #E07820; }

/* ================================================================
   МЕНЮ ТИЖНЯ
   ================================================================ */
.fd-menu-title { margin-bottom: 16px; }
.fd-menu-title h2 { font-size: 22px; color: #3A1A00; margin: 0 0 6px; }
.fd-menu-title p { font-size: 14px; color: #666; margin: 0; }
.fd-menu-regen {
    background: #FFF0E0; border: 2px solid #FFB347; border-radius: 12px;
    padding: 8px 20px; font-size: 14px; font-weight: 700; color: #AA5500;
    cursor: pointer; margin-bottom: 18px; transition: background .2s;
}
.fd-menu-regen:hover { background: #FFE8C0; }
.fd-menu-table { display: flex; flex-direction: column; gap: 10px; }
.fd-menu-row {
    display: flex; gap: 14px; align-items: flex-start;
    background: #FFFDF5; border-radius: 14px; padding: 12px 16px;
    border: 1px solid #F0E8D8;
    flex-wrap: wrap;
}
.fd-menu-day { font-size: 13px; font-weight: 800; color: #AA5500; min-width: 80px; padding-top: 2px; }
.fd-menu-items { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.fd-menu-group { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.fd-menu-group-label { font-size: 11px; color: #AAA; font-weight: 700; margin-right: 2px; white-space: nowrap; }
.fd-menu-item {
    background: #F5EFE0; border-radius: 12px; padding: 3px 10px;
    font-size: 13px; color: #5A3800;
}
.fd-menu-note { font-size: 12px; color: #AAA; margin-top: 14px; line-height: 1.6; }

.fd-modal-tip {
    display: flex; gap: 12px; align-items: flex-start;
    background: linear-gradient(135deg, #FFFBEA, #FFF3C0);
    border: 1px solid #FFD700;
    border-radius: 14px;
    padding: 13px 16px;
    margin-top: 12px;
}
.fd-modal-tip-icon { font-size: 22px; flex-shrink: 0; line-height: 1.3; }
.fd-modal-tip-text { font-size: 13px; color: #5A3A00; line-height: 1.6; margin: 0; font-style: italic; }

@media (max-width: 480px) {
    .fd-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .fd-card-emoji { font-size: 32px; }
    .fd-modal-box { padding: 20px 16px; }
    .fd-modal-emoji { font-size: 40px; }
    .fd-modal-title { font-size: 18px; }
}

/* ================================================================
   ОДЯГАЛКА
   ================================================================ */
.dresser-module { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.dresser-header { text-align: center; margin-bottom: 16px; }
.dresser-header h1 { font-size: clamp(20px, 3vw, 34px); color: #5A2E00; margin: 0 0 4px; }
.dresser-header p { color: #A06020; font-size: 14px; margin: 0; }

.dresser-layout { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.dresser-stage {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    background: #FFFFFF; border-radius: 20px;
    padding: 16px; box-shadow: 0 4px 20px rgba(160,80,0,0.1);
}
#dresser-canvas { border-radius: 14px; box-shadow: 0 2px 12px rgba(160,80,0,0.12); }
.dresser-pig-info { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dresser-pig-info span { font-size: 13px; color: #7A4A00; }
#dresser-breed-name { font-weight: 700; }
.dresser-actions { display: flex; gap: 8px; }
.dresser-btn {
    padding: 9px 18px; border-radius: 20px;
    border: none; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit;
    transition: transform 0.12s, box-shadow 0.12s;
}
.dresser-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.dresser-btn.primary { background: #FF9240; color: #FFFFFF; }
.dresser-btn.secondary { background: #F0E0D0; color: #5A2E00; }

.dresser-panels { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 12px; }
.dresser-panel {
    background: #FFFFFF; border-radius: 16px;
    padding: 14px; box-shadow: 0 2px 10px rgba(160,80,0,0.08);
}
.dresser-panel h3 { margin: 0 0 10px; font-size: 14px; color: #5A2E00; }

.dresser-breed-scroll { display: flex; flex-wrap: wrap; gap: 6px; }
.breed-chip {
    padding: 4px 12px; border-radius: 14px;
    border: 2px solid #E8C080; background: #FFF9F0;
    cursor: pointer; font-size: 12px; font-weight: 600; color: #7A4A00;
    transition: all 0.12s; font-family: inherit;
}
.breed-chip.active, .breed-chip:hover { background: #FF9240; color: #FFF; border-color: #FF7020; }

.dresser-color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
    width: 34px; height: 34px; border-radius: 8px;
    border: 2px solid transparent; cursor: pointer; transition: all 0.12s;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 1px; position: relative; overflow: hidden;
}
.color-swatch span { font-size: 8px; color: rgba(255,255,255,0.9); text-shadow: 0 1px 2px rgba(0,0,0,0.6); line-height: 1; display: none; }
.color-swatch:hover span { display: block; }
.color-swatch.active { border-color: #FF7020; box-shadow: 0 0 0 3px rgba(255,112,32,0.3); transform: scale(1.1); }

.dresser-bg-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.bg-swatch {
    width: 48px; height: 36px; border-radius: 10px;
    border: 2px solid transparent; cursor: pointer; transition: all 0.12s;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: rgba(0,0,0,0.7); text-align: center;
}
.bg-swatch span { font-size: 10px; display: none; }
.bg-swatch:hover span { display: block; }
.bg-swatch.active { border-color: #FF7020; box-shadow: 0 0 0 3px rgba(255,112,32,0.3); }

.dresser-item-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.item-chip {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 10px; border-radius: 12px;
    border: 2px solid #E8C080; background: #FFF9F0;
    cursor: pointer; transition: all 0.12s; font-family: inherit;
    min-width: 58px;
}
.item-chip:hover, .item-chip.active { background: #FFD090; border-color: #FF9040; }
.item-icon { font-size: 22px; line-height: 1; }
.item-name { font-size: 10px; color: #5A2E00; font-weight: 600; text-align: center; line-height: 1.2; }

.dresser-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: #2A6A00; color: #FFFFFF; padding: 12px 24px;
    border-radius: 24px; font-size: 15px; font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    z-index: 9999; animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ================================================================
   ГОДУВАННЯ
   ================================================================ */
.feeding-module { max-width: 1000px; margin: 0 auto; padding: 20px 16px 40px; }
.feeding-header { text-align: center; margin-bottom: 16px; }
.feeding-header h1 { font-size: clamp(20px, 3vw, 34px); color: #2A5A00; margin: 0 0 4px; }
.feeding-header p { color: #4A8A20; font-size: 14px; margin: 0; }

.feeding-layout { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.feeding-stage-wrap { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.feeding-score-bar {
    display: flex; gap: 12px; flex-wrap: wrap;
    background: #FFFFFF; padding: 10px 16px; border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); font-size: 14px; color: #333;
}
.feeding-score-bar strong { color: #2A6A00; }
#feeding-canvas { width: 100%; border-radius: 16px; box-shadow: 0 4px 18px rgba(0,0,0,0.1); cursor: crosshair; }
.feeding-result { padding: 14px; background: #FFFBD0; border-radius: 12px; font-size: 14px; text-align: center; }
.feeding-result.hidden { display: none; }

.feeding-info-panel {
    width: 240px; flex: 0 0 240px;
    display: flex; flex-direction: column; gap: 12px; align-items: center;
}
#feeding-pig-canvas { border-radius: 14px; box-shadow: 0 2px 12px rgba(160,80,0,0.1); }
.feeding-fact-box {
    background: #FFFFFF; border-radius: 14px; padding: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    font-size: 13px; color: #444; line-height: 1.6; width: 100%;
}
.fact-good strong { color: #2A7A00; }
.fact-bad strong { color: #CC0000; }
.feeding-legend { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #555; align-self: flex-start; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.legend-dot.good { background: #88FF44; }
.legend-dot.bad  { background: #FF4444; }
.feeding-btn {
    width: 100%; padding: 11px; border-radius: 20px;
    border: none; cursor: pointer; font-size: 14px; font-weight: 700; font-family: inherit;
    transition: transform 0.12s;
}
.feeding-btn:hover { transform: translateY(-2px); }
.feeding-btn.primary  { background: #4CAF50; color: #FFF; }
.feeding-btn.secondary { background: #F0E0D0; color: #5A2E00; }
.feeding-btn.hidden { display: none; }

/* ================================================================
   ГОЛОВОЛОМКИ
   ================================================================ */
.puzzles-module { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }
.puzzles-header { text-align: center; margin-bottom: 14px; }
.puzzles-header h1 { font-size: clamp(20px, 3vw, 34px); color: #3A1A80; margin: 0 0 4px; }
.puzzles-header p { color: #6A40C0; font-size: 14px; margin: 0; }

.puzzles-type-bar {
    display: flex; gap: 10px; justify-content: center;
    flex-wrap: wrap; margin-bottom: 20px;
}
.puzzle-type-btn {
    padding: 9px 22px; border-radius: 20px;
    border: 2px solid #C0A0F0; background: #F8F0FF;
    cursor: pointer; font-size: 14px; font-weight: 600; color: #5A20C0;
    transition: all 0.15s; font-family: inherit;
}
.puzzle-type-btn:hover, .puzzle-type-btn.active {
    background: #8B5CF6; color: #FFFFFF; border-color: #7040E0;
}
.puzzle-area { min-height: 300px; }

/* Вікторина */
.quiz-wrap { max-width: 580px; margin: 0 auto; }
.quiz-progress { font-size: 13px; color: #7A5A00; margin-bottom: 6px; text-align: center; }
.quiz-progress-bar { height: 6px; background: #E8E0FF; border-radius: 4px; margin-bottom: 18px; }
.quiz-progress-fill { height: 100%; background: #8B5CF6; border-radius: 4px; transition: width 0.4s; }
.quiz-question {
    font-size: clamp(16px, 2.5vw, 20px); font-weight: 700; color: #2A1A50;
    margin-bottom: 18px; text-align: center; line-height: 1.5;
}
.quiz-answers { display: flex; flex-direction: column; gap: 10px; }
.quiz-answer-btn {
    padding: 13px 18px; border-radius: 14px;
    border: 2px solid #D0C0F0; background: #F8F4FF;
    cursor: pointer; font-size: 15px; font-weight: 500; text-align: left;
    transition: all 0.15s; font-family: inherit; color: #2A1A50;
}
.quiz-answer-btn:hover:not(:disabled) { background: #EAE0FF; border-color: #8B5CF6; }
.quiz-answer-btn.correct { background: #DDFFC4; border-color: #44BB00; color: #1A5A00; }
.quiz-answer-btn.wrong   { background: #FFD4D4; border-color: #CC2200; color: #660000; }
.quiz-fact {
    margin-top: 14px; padding: 12px 16px;
    background: #FFFBD0; border-left: 4px solid #FFD700;
    border-radius: 0 12px 12px 0;
    font-size: 13px; color: #5A4800; line-height: 1.6;
}
.quiz-fact.hidden { display: none; }
.quiz-next-btn {
    display: block; margin: 14px auto 0; padding: 11px 30px;
    background: #8B5CF6; color: #FFF; border: none;
    border-radius: 20px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
    transition: transform 0.12s;
}
.quiz-next-btn:hover { transform: translateY(-2px); }
.quiz-next-btn.hidden { display: none; }

/* Memory */
.memory-wrap { max-width: 660px; margin: 0 auto; }
.memory-topbar { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; font-size: 14px; color: #3A1A50; flex-wrap: wrap; }
.memory-topbar strong { color: #5A30A0; }
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.memory-card {
    aspect-ratio: 1;
    cursor: pointer;
    perspective: 600px;
    border-radius: 12px;
}
.memory-card-inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
    border-radius: 12px;
}
.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner { transform: rotateY(180deg); }
.memory-card-front, .memory-card-back {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.memory-card-front {
    background: linear-gradient(135deg, #9B70F6, #6040D0);
    font-size: 32px;
}
.memory-card-back {
    background: #FFF9F4;
    transform: rotateY(180deg);
    gap: 4px;
}
.memory-card-label { font-size: 10px; font-weight: 700; color: #5A2E00; text-align: center; padding: 0 4px; }
.memory-card.matched .memory-card-back { background: #D4FAD4; }

/* Пазл */
.jigsaw-wrap { max-width: 720px; margin: 0 auto; }
.jigsaw-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; color: #3A1A50; }
.jig-hint-btn {
    padding: 6px 16px; border-radius: 14px;
    background: #FFD700; border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; color: #5A3A00; font-family: inherit;
}
.jigsaw-layout {
    display: flex; gap: 16px; flex-wrap: wrap;
    align-items: flex-start;
}
.jigsaw-board {
    position: relative;
    background: #F0EAF8;
    border-radius: 12px;
    border: 2px dashed #C0A0F0;
    flex: 0 0 auto;
}
.jig-slot {
    position: absolute;
    background: rgba(180,150,240,0.15);
    border: 2px dashed #C0A0F0;
    border-radius: 4px;
    transition: background 0.2s;
    box-sizing: border-box;
}
.jig-slot.filled { border: 2px solid #88CC44; background: transparent; }
.jig-slot.wrong-drop { animation: shake 0.4s; background: rgba(255,100,100,0.2); }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.jigsaw-pieces {
    flex: 1; min-width: 200px;
    display: flex; flex-wrap: wrap; gap: 6px;
    align-content: flex-start;
    background: #FFF9F4; border-radius: 12px; padding: 10px;
    border: 2px solid #E8C080;
}
.jig-piece {
    border-radius: 4px; cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.1s, box-shadow 0.1s;
}
.jig-piece:hover { transform: scale(1.05); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.jig-piece:active { cursor: grabbing; }

/* Результат (спільний для всіх) */
.quiz-result {
    max-width: 460px; margin: 30px auto; text-align: center;
    background: #FFFFFF; border-radius: 24px; padding: 36px;
    box-shadow: 0 8px 32px rgba(100,60,200,0.15);
}
.quiz-result-stars { font-size: 40px; margin-bottom: 10px; }
.quiz-result h2 { font-size: 24px; color: #2A1A50; margin: 0 0 12px; }
.quiz-result-score { font-size: 16px; color: #555; margin-bottom: 20px; }
.quiz-result-score strong { color: #5A30A0; }
.quiz-restart-btn {
    padding: 12px 32px; background: #8B5CF6; color: #FFFFFF;
    border: none; border-radius: 24px; font-size: 16px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: transform 0.12s;
}
.quiz-restart-btn:hover { transform: translateY(-2px); }

/* Records bar у Головоломках */
.puzzles-records-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; margin: 0 0 8px;
  background: linear-gradient(90deg, #f0ebff, #ede9fe);
  border-radius: 12px; flex-wrap: wrap; min-height: 0;
}
.pzr-label { font-size: 13px; font-weight: 700; color: #6D28D9; }
.pzr-card {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1.5px solid #c4b5fd;
  border-radius: 20px; padding: 3px 12px;
  font-size: 13px; color: #4C1D95;
}
.pzr-card strong { color: #7C3AED; }
.pzr-new-record {
  text-align: center; font-size: 16px; font-weight: 800;
  color: #059669; background: #D1FAE5;
  border-radius: 10px; padding: 6px 16px; margin: 4px 0 12px;
}

.puzzles-module--mega {
  max-width: 1120px;
}

.puzzles-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, .75) 0 70px, transparent 72px),
    linear-gradient(135deg, #fff0b8, #d7f8e4 52%, #e9ddff);
  border: 2px solid rgba(77, 188, 119, .22);
  box-shadow: 0 16px 42px rgba(43, 82, 51, .11);
}

.puzzles-kicker {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #0c6b3e;
  font-size: 13px;
  font-weight: 800;
}

.puzzles-hero h1 {
  margin: 8px 0 5px;
  color: #114d31;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
}

.puzzles-hero p {
  margin: 0;
  max-width: 620px;
  color: #52645a;
  font-size: 15px;
}

.puzzles-hero-badge {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 26px;
  background: rgba(255, 255, 255, .76);
  font-size: 52px;
  box-shadow: 0 12px 30px rgba(46, 104, 72, .14);
  overflow: hidden;
}
.puzzles-hero-badge-img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; display: block; }

.puzzles-game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.puzzle-game-card {
  min-height: 118px;
  padding: 13px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px solid #cdeed8;
  border-radius: 18px;
  background: #fffef8;
  color: #123b28;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(44, 87, 55, .08);
  transition: transform .14s, border-color .14s, box-shadow .14s, background .14s;
}

.puzzle-game-card span {
  font-size: 32px;
  line-height: 1;
}

.puzzle-game-card strong {
  font-size: 15px;
  line-height: 1.15;
}

.puzzle-game-card small {
  max-width: 140px;
  color: #6b7b71;
  font-size: 12px;
  line-height: 1.25;
}

.puzzle-game-card:hover,
.puzzle-game-card.active {
  transform: translateY(-2px);
  border-color: #33c46b;
  background: #effff4;
  box-shadow: 0 16px 34px rgba(35, 150, 78, .15);
}

.puzzle-play-area {
  padding: 10px 0 24px;
}

.mini-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px;
  border: 2px solid #c9ecd6;
  border-radius: 24px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 46px rgba(26, 83, 47, .11);
}

.puzzle-intro-card {
  text-align: center;
}

.puzzle-intro-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f2ffe8, #e8efff);
  box-shadow: inset 0 -3px 0 rgba(20, 61, 41, .08);
  font-size: 44px;
}

.puzzle-intro-card h2 {
  margin: 0 0 10px;
  color: #0d3d2d;
  font-size: clamp(26px, 4vw, 42px);
}

.puzzle-intro-card p {
  max-width: 620px;
  margin: 0 auto 20px;
  color: #586b61;
  font-size: 17px;
  line-height: 1.5;
}

.puzzle-intro-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 24px;
}

.puzzle-intro-steps div {
  min-height: 108px;
  padding: 14px;
  border: 2px solid #d5eddc;
  border-radius: 16px;
  background: #fffdf6;
  text-align: left;
}

.puzzle-intro-steps strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #28c86b;
  color: #fff;
}

.puzzle-intro-steps span {
  display: block;
  color: #234235;
  font-weight: 750;
  line-height: 1.35;
}

.puzzle-start-btn {
  min-width: 190px;
}

.mini-progress,
.memory-status {
  color: #66756c;
  font-weight: 700;
  text-align: center;
}

.food-game {
  text-align: center;
}

.food-emoji {
  margin: 8px auto 4px;
  font-size: 76px;
  line-height: 1;
}

.food-game h2 {
  margin: 0;
  color: #123b28;
  font-size: 30px;
}

.food-game p {
  margin: 8px 0 18px;
  color: #66756c;
}

.food-level-intro {
  margin: 0 0 16px;
  color: #66756c;
  line-height: 1.45;
}

.food-level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.food-level-card {
  min-height: 84px;
  padding: 12px;
  border: 2px solid #d5eddc;
  border-radius: 16px;
  background: #fffdf6;
  color: #143d29;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 10px 24px rgba(27, 92, 49, .08);
}

.food-level-card:hover {
  border-color: #31c46c;
  background: #effff4;
  transform: translateY(-2px);
}

.food-level-card--today {
  border-color: #28c86b;
  box-shadow: 0 0 0 2px rgba(40, 200, 107, .12), 0 10px 24px rgba(27, 92, 49, .1);
}

.food-level-card--locked,
.food-level-card:disabled {
  cursor: default;
  opacity: .54;
  filter: grayscale(.45);
}

.food-level-card--locked:hover,
.food-level-card:disabled:hover {
  border-color: #d5eddc;
  background: #fffdf6;
  transform: none;
}

.food-level-card span {
  color: #68786d;
  font-size: 12px;
  font-weight: 800;
}

.puzzle-daily-done {
  border-color: rgba(40, 200, 107, .3);
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 228, 95, .28), transparent 24%),
    linear-gradient(135deg, #fffdf7, #effff5);
}

.puzzle-daily-done .quiz-result-score {
  line-height: 1.65;
}

.food-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.food-actions button {
  min-height: 132px;
  border-radius: 20px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px 16px;
  font-size: 20px;
  box-shadow: 0 12px 28px rgba(25, 80, 55, .12);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

.food-actions button::before {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.food-actions button[data-answer="yes"]::before {
  content: "✅";
}

.food-actions button[data-answer="no"]::before {
  content: "🚫";
}

.food-actions button::after {
  content: "Натисни картку";
  display: block;
  font-size: 12px;
  font-weight: 800;
  opacity: .72;
}

.food-actions button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(25, 80, 55, .18);
}

.food-actions button.is-correct {
  border-color: #22c86b;
  background: linear-gradient(135deg, #37d87b, #a6f4c5);
  color: #073b20;
}

.food-actions button.is-wrong {
  border-color: #ff6b74;
  background: linear-gradient(135deg, #ff8089, #ffd3d7);
  color: #5d0610;
}

.food-actions button.is-picked {
  box-shadow: 0 0 0 4px rgba(255, 213, 94, .58), 0 16px 34px rgba(25, 80, 55, .16);
}

.food-actions button,
.maze-controls button,
.sequence-btn {
  min-height: 48px;
  border: none;
  border-radius: 16px;
  background: #2ec76d;
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(46, 199, 109, .24);
}

.food-actions button:last-child {
  background: #ff6b6b;
  box-shadow: 0 10px 22px rgba(255, 107, 107, .22);
}

.food-actions button:disabled {
  opacity: .72;
  cursor: default;
}

.mini-feedback {
  margin: 16px auto 0;
  max-width: 560px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.mini-feedback.ok {
  background: #dcfce7;
  color: #166534;
}

.mini-feedback.bad {
  background: #fee2e2;
  color: #991b1b;
}

.food-next-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.food-next-btn,
.food-level-back {
  min-height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.food-next-btn {
  background: #2ec76d;
  color: #fff;
  box-shadow: 0 10px 22px rgba(46, 199, 109, .22);
}

.food-level-back {
  background: #edf6ef;
  color: #17442c;
}

.food-next-btn[hidden] {
  display: none;
}

.maze-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: #153052;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.maze-top strong,
.maze-top span {
  color: #153052;
}

.maze-board {
  width: min(100%, 594px);
  max-width: 720px;
  aspect-ratio: 9 / 7;
  display: grid;
  gap: 0;
  margin: 0 auto 16px;
  padding: 8px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(92, 157, 255, .22), rgba(0, 0, 0, .08)),
    var(--maze-wall, #82c99a);
  border: 5px solid #11d4ff;
  box-shadow:
    inset 0 0 0 4px rgba(0, 8, 62, .72),
    inset 0 0 24px rgba(5, 20, 120, .82),
    0 0 0 2px rgba(123, 195, 255, .2),
    0 18px 34px rgba(7, 15, 58, .24);
  outline: none;
  overflow: hidden;
}

.maze-cell {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--maze-path, #fffef8);
  font-size: clamp(18px, 4vw, 30px);
  box-shadow: inset 0 0 0 1px rgba(30, 68, 170, .16);
  z-index: 1;
}

.maze-cell.wall {
  background:
    linear-gradient(180deg, rgba(101, 155, 255, .38), rgba(0, 13, 94, .2)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.09) 0 1px, transparent 1px 4px),
    var(--maze-wall, #82c99a);
  box-shadow:
    inset 0 1px 0 rgba(118, 192, 255, .62),
    inset 0 -3px 0 rgba(0, 4, 70, .48),
    inset 3px 0 0 rgba(0, 220, 255, .12),
    inset -3px 0 0 rgba(0, 2, 64, .22);
  z-index: 2;
}

.maze-cell.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .4;
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(145, 201, 255, .24) 44% 47%, transparent 50%),
    linear-gradient(0deg, transparent 0 42%, rgba(0, 1, 45, .24) 44% 47%, transparent 50%);
}

.maze-cell.goal {
  margin: 7%;
  border-radius: 8px;
  background: var(--maze-goal, #fff0aa);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, .34),
    0 0 18px rgba(255, 235, 91, .56);
  z-index: 3;
}

.maze-cell.pig {
  margin: 7%;
  border-radius: 8px;
  background: #ffe8f0;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, .46),
    0 0 18px rgba(255, 114, 174, .5);
  z-index: 4;
}

.maze-controls {
  display: grid;
  grid-template-columns: repeat(4, 58px);
  gap: 10px;
  justify-content: center;
}

.maze-controls button {
  font-size: 22px;
}

.maze-level-meter {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 5px;
  margin: -4px 0 14px;
}

.maze-level-meter span {
  height: 8px;
  border-radius: 999px;
  background: #d9e7df;
  box-shadow: inset 0 0 0 1px rgba(30, 74, 54, 0.06);
}

.maze-level-meter span.done {
  background: linear-gradient(90deg, #31c46c, #9be76d);
}

.sort-level-meter {
  grid-template-columns: repeat(20, 1fr);
}

.memory-level-meter {
  grid-template-columns: repeat(15, 1fr);
}

.diff-level-meter {
  grid-template-columns: repeat(15, 1fr);
}

.maze-status {
  width: min(100%, 594px);
  margin: -4px auto 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #071342;
  color: #ffe96b;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow:
    inset 0 0 0 1px rgba(17, 212, 255, .28),
    0 8px 18px rgba(4, 8, 42, .14);
}

.maze-cell.cat {
  margin: 7%;
  border-radius: 8px;
  background: #ffe0c9;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, .44),
    0 0 18px rgba(255, 117, 44, .54);
  z-index: 4;
}

.maze-caught-result .quiz-result-stars {
  color: #c45a28;
}

.maze-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.sort-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 82px;
  padding: 12px;
  border-radius: 18px;
  background: #f7fbf0;
}

.sort-chip {
  min-width: 86px;
  min-height: 68px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 2px solid #d6efd8;
  border-radius: 16px;
  background: #fff;
  font-size: 25px;
  cursor: grab;
  font-family: inherit;
  transition: transform .14s, border-color .14s;
}

.sort-chip small {
  font-size: 11px;
  font-weight: 800;
  color: #3c5646;
}

.sort-chip.selected {
  border-color: #24b85f;
  transform: translateY(-2px);
}

.sort-chip.correct {
  background: #dcfce7;
}

.sort-chip.wrong {
  background: #fee2e2;
}

.sort-bins {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 14px;
    margin-top: 18px;
  }
  
  .sort-bin {
    position: relative;
    min-height: 188px;
    padding: 26px 12px 14px;
    border: 3px solid #97cba8;
    border-radius: 18px 18px 28px 28px;
    background:
      linear-gradient(90deg, rgba(255,255,255,0.18) 0 12%, transparent 12% 22%, rgba(255,255,255,0.16) 22% 34%, transparent 34% 44%, rgba(255,255,255,0.15) 44% 56%, transparent 56% 66%, rgba(255,255,255,0.15) 66% 78%, transparent 78% 100%),
      linear-gradient(180deg, #fffdf0 0%, #f3ffe9 100%);
    box-shadow: inset 0 -12px 0 rgba(52, 121, 77, 0.08), 0 12px 24px rgba(36, 93, 56, 0.12);
    text-align: center;
    overflow: visible;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .sort-bin::before,
  .sort-bin::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    height: 3px;
    background: rgba(63, 128, 82, 0.22);
    border-radius: 999px;
    pointer-events: none;
  }

  .sort-bin::before {
    top: 68px;
  }

  .sort-bin::after {
    bottom: 28px;
  }

  .sort-bin:hover,
  .sort-bin:focus-within {
    transform: translateY(-2px);
    border-color: #4fbd75;
    box-shadow: inset 0 -12px 0 rgba(52, 121, 77, 0.08), 0 16px 30px rgba(36, 93, 56, 0.18);
  }

  .sort-basket-handle {
    position: absolute;
    left: 24%;
    right: 24%;
    top: -18px;
    height: 34px;
    border: 4px solid #97cba8;
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: transparent;
    pointer-events: none;
  }
  
  .sort-bin strong {
    display: block;
    margin-bottom: 2px;
    color: #16462c;
    font-size: 18px;
    position: relative;
    z-index: 1;
  }

  .sort-bin > small {
    display: block;
    margin-bottom: 12px;
    color: rgba(22, 70, 44, 0.62);
    font-size: 11px;
    font-weight: 800;
    position: relative;
    z-index: 1;
  }

  .sort-bin .sort-chip {
    min-width: 66px;
    min-height: 56px;
    margin: 4px;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 14px rgba(28, 80, 48, 0.12);
  }

  .sort-bin--hay {
    border-color: #d6b75c;
    background:
      linear-gradient(90deg, rgba(255,255,255,0.18) 0 12%, transparent 12% 22%, rgba(255,255,255,0.16) 22% 34%, transparent 34% 44%, rgba(255,255,255,0.15) 44% 56%, transparent 56% 66%, rgba(255,255,255,0.15) 66% 78%, transparent 78% 100%),
      linear-gradient(180deg, #fff9d8 0%, #fff0aa 100%);
  }

  .sort-bin--hay .sort-basket-handle { border-color: #d6b75c; }

  .sort-bin--veg {
    border-color: #7fcf8e;
    background:
      linear-gradient(90deg, rgba(255,255,255,0.18) 0 12%, transparent 12% 22%, rgba(255,255,255,0.16) 22% 34%, transparent 34% 44%, rgba(255,255,255,0.15) 44% 56%, transparent 56% 66%, rgba(255,255,255,0.15) 66% 78%, transparent 78% 100%),
      linear-gradient(180deg, #efffea 0%, #d8f8de 100%);
  }

  .sort-bin--veg .sort-basket-handle { border-color: #7fcf8e; }

  .sort-bin--treat {
    border-color: #f3a3bb;
    background:
      linear-gradient(90deg, rgba(255,255,255,0.18) 0 12%, transparent 12% 22%, rgba(255,255,255,0.16) 22% 34%, transparent 34% 44%, rgba(255,255,255,0.15) 44% 56%, transparent 56% 66%, rgba(255,255,255,0.15) 66% 78%, transparent 78% 100%),
      linear-gradient(180deg, #fff2f6 0%, #ffe0ea 100%);
  }

  .sort-bin--treat .sort-basket-handle { border-color: #f3a3bb; }

  .sort-bin--bad {
    border-color: #e69696;
    background:
      linear-gradient(90deg, rgba(255,255,255,0.18) 0 12%, transparent 12% 22%, rgba(255,255,255,0.16) 22% 34%, transparent 34% 44%, rgba(255,255,255,0.15) 44% 56%, transparent 56% 66%, rgba(255,255,255,0.15) 66% 78%, transparent 78% 100%),
      linear-gradient(180deg, #fff5f2 0%, #ffe2dc 100%);
  }

.sequence-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 18px auto 0;
}

.memory-target {
  display: grid;
  grid-template-columns: repeat(8, minmax(48px, 1fr));
  gap: 10px;
  max-width: 760px;
  margin: 18px auto 0;
}

.memory-slot {
  min-height: 78px;
  border: 2px dashed #b9dec8;
  border-radius: 14px;
  background: #f8fff8;
  color: #6b7b70;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
}

.memory-slot.filled {
  border-style: solid;
  border-color: #f2c94c;
  background: #fff8d7;
  color: #1d3328;
}

.memory-slot.correct {
  border-color: #2fc56b;
  background: #dcfce7;
}

.memory-tray {
  margin-top: 18px;
}

.sequence-btn {
  min-height: 86px;
  font-size: 40px;
  background: #fff8d7;
  color: #173d2b;
  border: 2px solid #f2d469;
  box-shadow: 0 12px 24px rgba(148, 114, 31, .12);
}

.sequence-btn.flash {
  background: #33c46b;
  color: #fff;
  transform: scale(1.06);
}

.sequence-btn.selected {
  opacity: 0.42;
  transform: scale(0.96);
}

.diff-scenes {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.diff-scene {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 2px solid #d9efd9;
  background: #fff9df;
}

.diff-scene svg {
  display: block;
  width: 100%;
  height: auto;
}

.diff-hit {
  position: absolute;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.diff-hit.found {
  border-color: #22c55e;
  background: rgba(34, 197, 94, .2);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .15);
}

.puzzle-result .quiz-result-stars {
  font-size: 54px;
}

@media (max-width: 900px) {
  .puzzles-game-grid,
  .sort-bins {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .food-level-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .puzzles-hero {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .puzzles-hero {
    padding: 18px;
  }

  .puzzles-hero-badge {
    display: none;
  }

  .puzzles-game-grid,
  .sort-bins,
  .diff-scenes,
  .food-actions,
  .food-level-grid {
    grid-template-columns: 1fr;
  }

  .sequence-board {
    grid-template-columns: repeat(3, 1fr);
  }

  .maze-top {
    align-items: flex-start;
    flex-direction: column;
  }
}
.pzr-prev-best {
  text-align: center; font-size: 13px; color: #6B7280;
  margin: 2px 0 12px;
}

/* ESC підказка в topbar */
.topbar-esc-hint {
  font-size: 11px; color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px; white-space: nowrap; text-align: right;
}

/* ----------------------------------------------------------------
   Щоденний факт на головному екрані
   ---------------------------------------------------------------- */
.daily-fact {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #fcd34d;
  border-radius: 14px;
  padding: 7px 16px;
  margin: 2px 0 6px;
  font-size: 12px; color: #78350f;
  font-style: italic; font-weight: 500;
  text-align: center;
  max-width: 600px; margin-left: auto; margin-right: auto;
}

/* ----------------------------------------------------------------
   Система досягнень (Ачівки)
   ---------------------------------------------------------------- */
.ach-section {
  width: 100%; max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 10px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: 16px;
  border: 1.5px solid #ddd6fe;
}
.ach-section-title {
  font-size: 13px; font-weight: 700; color: #6D28D9;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.ach-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ach-bar-empty {
  font-size: 12px; color: #9CA3AF; font-style: italic;
}
.ach-count {
  font-size: 11px; color: #7C3AED; font-weight: 700;
  background: #EDE9FE; border-radius: 10px; padding: 2px 8px;
}
.ach-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1.5px solid #C4B5FD;
  border-radius: 20px; padding: 3px 10px;
  font-size: 12px; color: #4C1D95; font-weight: 600;
  cursor: default;
  transition: transform 0.12s, box-shadow 0.12s;
}
.ach-badge:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(109,40,217,0.15); }
.ach-badge-e { font-size: 16px; }
.ach-badge-t { font-size: 11px; }

/* Тост-сповіщення про нову ачівку */
.ach-toast {
  position: fixed; right: 16px; bottom: 20px; z-index: 9000;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #4C1D95, #6D28D9);
  color: #fff; border-radius: 16px;
  padding: 12px 20px; min-width: 220px; max-width: 320px;
  box-shadow: 0 8px 24px rgba(109,40,217,0.4);
  transform: translateX(120%); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  pointer-events: none;
}
.ach-toast--in {
  transform: translateX(0); opacity: 1;
}
.ach-toast-emoji { font-size: 32px; flex-shrink: 0; }
.ach-toast strong { font-size: 13px; display: block; }
.ach-toast-desc { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }



/* ----------------------------------------------------------------
   Адаптивність
   ---------------------------------------------------------------- */
@media (max-width: 600px) {
    .main-menu-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .main-menu-tile { padding: 12px 8px; }
    .tile-icon { font-size: 24px; }
    .tile-label { font-size: 12px; }
    .tile-desc { font-size: 9px; }
    .dresser-layout { flex-direction: column; }
    .dresser-stage { width: 100%; }
    .feeding-layout { flex-direction: column; }
    .feeding-info-panel { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .memory-grid { grid-template-columns: repeat(3, 1fr); }
    .modal-layout { flex-direction: column; }
    .breed-modal-content { padding: 18px; }
    .jigsaw-layout { flex-direction: column; }
    .jigsaw-pieces { max-height: none; }
}

/* ================================================================
   ЕНЦИКЛОПЕДІЯ ПОРІД (BreedsInfoModule)
   ================================================================ */
.br-module {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ---- Заголовок ---- */
.br-header { text-align: center; margin-bottom: 18px; }
.br-header h1 { font-size: clamp(22px, 3vw, 36px); color: #5A2E00; margin: 0 0 6px; }
.br-subtitle { color: #A06020; font-size: 15px; margin: 0; }

/* ---- Вкладки ---- */
.br-tabs {
    display: flex; gap: 8px; flex-wrap: wrap;
    justify-content: center; margin-bottom: 20px;
}
.br-tab {
    padding: 10px 24px; border-radius: 24px;
    border: 2px solid #E8C080; background: #FFF9F0;
    cursor: pointer; font-size: 14px; font-weight: 700; color: #7A4A00;
    transition: all .15s; font-family: inherit;
}
.br-tab:hover { background: #FFE8CC; border-color: #FFA040; }
.br-tab--active { background: #FF9240; color: #FFF; border-color: #FF7020; }

/* ---- Контроли: пошук + фільтри ---- */
.br-controls { margin-bottom: 18px; }
.br-search-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.br-search {
    width: 100%; max-width: 480px;
    padding: 11px 18px; border-radius: 28px;
    border: 2px solid #E8C080; background: #FFFDF5;
    font-size: 15px; font-family: inherit; color: #3A1A00;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.br-search:focus { border-color: #FF9240; box-shadow: 0 0 0 3px rgba(255,146,64,.18); }
.br-filter-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.br-filter-label { font-size: 12px; color: #AAA; font-weight: 700; white-space: nowrap; }
.br-filter-btn {
    padding: 5px 13px; border-radius: 16px;
    border: 1px solid #E8C080; background: #FFF9F0;
    cursor: pointer; font-size: 12px; font-weight: 600; color: #7A4A00;
    transition: all .12s; font-family: inherit;
}
.br-filter-btn:hover { background: #FFE8CC; border-color: #FFA040; }
.br-filter-btn--active { background: #FF9240; color: #FFF; border-color: #FF7020; }

/* ---- Лічильник ---- */
.br-count {
    font-size: 13px; color: #AAA; text-align: center;
    margin-bottom: 14px; font-weight: 600;
}

/* ---- Сітка порід ---- */
.br-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.br-empty {
    grid-column: 1/-1; text-align: center;
    padding: 40px; font-size: 18px; color: #A06020;
}

/* ---- Картка породи ---- */
.br-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 18px;
    padding: 16px 14px;
    box-shadow: 0 3px 14px rgba(160,80,0,.08);
    cursor: pointer;
    transition: transform .14s, box-shadow .14s;
    border: 2px solid transparent;
    display: flex; flex-direction: column; gap: 6px;
    overflow: hidden;
}
.br-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(160,80,0,.18);
    border-color: #FFD090;
}
.br-card--locked {
    cursor: default;
}
.br-card--locked:hover {
    transform: none;
    border-color: transparent;
    box-shadow: 0 3px 14px rgba(160,80,0,.08);
}
.br-card--locked > :not(.br-card-lock) {
    filter: grayscale(.15);
    opacity: .38;
}
.br-card-head { display: flex; align-items: center; justify-content: space-between; }
.br-card-emoji { font-size: 36px; line-height: 1; }
.br-card-num {
    font-size: 12px; font-weight: 800; color: #C07020;
    background: #FFF0D0; border-radius: 10px;
    padding: 2px 8px; margin-bottom: 4px;
    display: block; text-align: center;
}
.br-card-name { font-size: 16px; font-weight: 800; color: #3A1A00; }
.br-card-fur { font-size: 12px; color: #888; }
.br-card-stats {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: 12px; color: #666;
}
.br-card-origin { font-size: 12px; color: #A06020; }
.br-card-temperament { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.br-card-lock {
    position: absolute;
    z-index: 3;
    inset: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 14px;
    background: rgba(255, 250, 241, .9);
    border: 1px solid rgba(160, 96, 32, .16);
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.br-card-lock-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #8a5728, #c07020);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 8px 18px rgba(80, 45, 16, .2);
}
.br-card-lock-title {
    max-width: 170px;
    color: #5a371c;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.2;
}
.br-card-lock-sub {
    color: rgba(58, 26, 0, .58);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.br-card-lock-time {
    min-width: 14ch;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    color: #8a5728;
    font-size: 0;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    box-shadow: inset 0 -2px 0 rgba(123, 79, 39, .08);
    animation: none;
    transition: none;
}

.br-card-lock-time::before {
    content: attr(data-lock-time);
    font-size: 13px;
}

/* ---- Бейджі ---- */
.br-badge {
    font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 12px;
    display: inline-block;
}
.br-badge--origin { background: #E8F4FF; color: #1A4A8A; }
.br-badge--fur { background: #F0E8FF; color: #5A20A0; }
.br-badge--care.br-badge--easy { background: #DDFFC4; color: #1E6600; }
.br-badge--care.br-badge--medium { background: #FFF3CD; color: #7A5000; }
.br-badge--care.br-badge--hard { background: #FFD4D4; color: #880000; }

/* ---- Тег темпераменту ---- */
.br-tag {
    font-size: 11px; font-weight: 600;
    padding: 2px 9px; border-radius: 12px;
    background: #F0E8FF; color: #5820A0;
    display: inline-block;
}
.br-tag--big { font-size: 13px; padding: 4px 12px; }

/* ================================================================
   МОДАЛЬНЕ ВІКНО ПОРОДИ
   ================================================================ */
.br-modal {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.br-modal.hidden { display: none; }
.br-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(4px);
}
.br-modal-box {
    position: relative; z-index: 1;
    background: #FFFFFF; border-radius: 24px;
    padding: 28px 26px;
    max-width: 620px; width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    animation: brModalIn .22s ease;
}
@keyframes brModalIn {
    from { opacity: 0; transform: scale(.93) translateY(12px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.br-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: #F0E0D0; border: none; border-radius: 50%;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #5A2E00; transition: background .15s;
}
.br-modal-close:hover { background: #FFCFA0; }
.br-modal-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.br-modal-emoji { font-size: 56px; line-height: 1; flex-shrink: 0; }
.br-modal-photo {
    width: 72px; height: 72px; flex-shrink: 0;
    object-fit: cover; border-radius: 16px;
    border: 3px solid #FFF; box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}
.br-modal-title { font-size: 24px; font-weight: 800; color: #3A1A00; margin: 0 0 8px; }
.br-modal-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.br-modal-desc {
    font-size: 14px; color: #444; line-height: 1.7;
    margin: 0 0 18px; padding: 12px 16px;
    background: #FFFDF5; border-left: 4px solid #FFD700;
    border-radius: 0 12px 12px 0;
}

/* ---- Статистичні картки ---- */
.br-modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px; margin-bottom: 18px;
}
.br-stat-card {
    background: #FAFAFA; border-radius: 12px;
    padding: 12px 10px; text-align: center;
    border: 1px solid #F0E8D8;
}
.br-stat-icon { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.br-stat-label { font-size: 11px; color: #AAA; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.br-stat-val { font-size: 13px; font-weight: 700; color: #3A1A00; line-height: 1.4; }

/* ---- Секція ---- */
.br-modal-section { margin-bottom: 18px; }
.br-modal-section h3 { font-size: 16px; color: #5A2E00; margin: 0 0 10px; }
.br-modal-text { font-size: 14px; color: #555; line-height: 1.7; margin: 0; }
.br-tags-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Догляд ---- */
.br-care-box {
    border: 1px solid; border-radius: 14px;
    padding: 14px 16px;
}
.br-care-level-badge {
    display: inline-block; font-size: 12px; font-weight: 700;
    padding: 3px 12px; border-radius: 12px; margin-bottom: 8px;
}
.br-care-box p { font-size: 14px; color: #444; line-height: 1.7; margin: 0; }

/* ---- Хвороби у модалці ---- */
.br-disease-list { display: flex; flex-direction: column; gap: 10px; }
.br-disease-item {
    background: #FAFAFA; border-radius: 12px;
    padding: 12px 14px; border: 1px solid #F0E8D8;
}
.br-disease-item--high { border-color: rgba(220,40,40,.25); background: #FFF8F8; }
.br-disease-item--medium { border-color: rgba(255,160,0,.25); background: #FFFCF0; }
.br-disease-item--low { border-color: rgba(80,200,80,.2); }
.br-disease-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.br-disease-name { font-size: 14px; font-weight: 700; color: #3A1A00; }
.br-disease-risk { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.br-disease-risk--high { background: #FFD4D4; color: #880000; }
.br-disease-risk--medium { background: #FFF3CD; color: #7A5000; }
.br-disease-risk--low { background: #DDFFC4; color: #1E6600; }
.br-disease-desc { font-size: 13px; color: #555; line-height: 1.6; margin: 0; }

/* ---- Факт ---- */
.br-fact-box {
    display: flex; gap: 12px; align-items: flex-start;
    background: linear-gradient(135deg, #FFFBEA, #FFF3C0);
    border: 1px solid #FFD700; border-radius: 14px;
    padding: 14px 16px;
}
.br-fact-emoji { font-size: 24px; flex-shrink: 0; line-height: 1.3; }
.br-fact-box p { font-size: 14px; color: #5A3A00; line-height: 1.7; margin: 0; font-style: italic; }

/* ================================================================
   СТОРІНКА ХВОРОБ
   ================================================================ */
.br-section-intro { text-align: center; margin-bottom: 20px; }
.br-section-intro h2 { font-size: clamp(20px, 3vw, 30px); color: #5A2E00; margin: 0 0 6px; }
.br-section-intro p { font-size: 14px; color: #888; margin: 0; }

.br-disease-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 14px;
}
.br-disease-card {
    position: relative;
    background: #FFFFFF; border-radius: 16px;
    padding: 18px 16px; border: 2px solid #F0E8D8;
    box-shadow: 0 3px 12px rgba(0,0,0,.06);
    overflow: hidden;
}
.br-disease-card--locked > :not(.br-card-lock) {
    filter: grayscale(.15);
    opacity: .38;
}
.br-disease-card--critical { border-color: rgba(200,0,0,.3); background: #FFF8F8; }
.br-disease-card--high    { border-color: rgba(220,80,0,.25); background: #FFF9F0; }
.br-disease-card--medium  { border-color: rgba(200,160,0,.25); background: #FFFCF0; }
.br-disease-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.br-disease-card-num {
    min-width: 26px; height: 26px;
    background: #FF8C00; color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(255,140,0,.35);
}
.br-disease-card-emoji { font-size: 32px; line-height: 1; flex-shrink: 0; }
.br-disease-card-name { font-size: 15px; font-weight: 800; color: #3A1A00; }
.br-severity-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    padding: 2px 10px; border-radius: 10px; margin-top: 3px;
}
.br-severity-badge--critical { background: #FFD4D4; color: #880000; }
.br-severity-badge--high     { background: #FFE0C0; color: #883300; }
.br-severity-badge--medium   { background: #FFF3CD; color: #7A5000; }
.br-severity-badge--low      { background: #DDFFC4; color: #1E6600; }
.br-disease-card-desc {
    font-size: 13px; color: #555; line-height: 1.6; margin: 0 0 10px;
}
.br-disease-breeds {
    font-size: 12px; color: #5A3700;
    background: #FFF8E1; border-radius: 8px;
    padding: 6px 10px; margin-bottom: 8px;
    border-left: 3px solid #FFC107;
    line-height: 1.5;
}
.br-disease-breeds-label { font-weight: 700; }
.br-disease-symptoms {
    font-size: 13px; color: #6B0000; line-height: 1.6;
    background: #FFF5F5; border-radius: 8px;
    padding: 7px 12px; margin-bottom: 8px;
    border-left: 3px solid #FF6B6B;
}
.br-disease-treatment {
    font-size: 13px; color: #003A5A; line-height: 1.6;
    background: #EFF7FF; border-radius: 8px;
    padding: 7px 12px; margin-bottom: 8px;
    border-left: 3px solid #4DA6FF;
}
.br-prevention {
    font-size: 13px; color: #3A5000; line-height: 1.6;
    background: #F4FFF0; border-radius: 8px;
    padding: 8px 12px; border-left: 3px solid #66BB00;
}
.br-disease-category { margin-bottom: 30px; }
.br-disease-category-title {
    font-size: 18px; font-weight: 800; color: #4A1A00;
    margin: 0 0 14px;
    padding: 8px 14px;
    background: linear-gradient(90deg, #FFF3E0 0%, transparent 100%);
    border-radius: 10px;
    border-left: 4px solid #FF8C00;
}
.br-disease-severity-legend {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 10px;
}

/* ================================================================
   СТОРІНКА ПОРАД
   ================================================================ */
.br-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.br-tip-card {
    position: relative;
    background: #FFFFFF; border-radius: 18px;
    padding: 20px 16px;
    box-shadow: 0 3px 14px rgba(160,80,0,.08);
    border: 2px solid #F0E8D8;
    display: flex; flex-direction: column; gap: 8px;
    transition: transform .14s, box-shadow .14s;
    overflow: hidden;
}
.br-tip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(160,80,0,.15);
}
.br-tip-card--locked:hover {
    transform: none;
    box-shadow: 0 3px 14px rgba(160,80,0,.08);
}
.br-tip-card--locked > :not(.br-card-lock) {
    filter: grayscale(.15);
    opacity: .38;
}
.br-tip-card-top {
    display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
}
.br-tip-num {
    min-width: 26px; height: 26px; border-radius: 50%;
    background: #FF8C00; color: #fff;
    font-size: 12px; font-weight: 800; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(255,140,0,.35);
}
.br-tip-emoji { font-size: 36px; line-height: 1; }
.br-tip-title { font-size: 15px; font-weight: 800; color: #3A1A00; }
.br-tip-text { font-size: 13px; color: #555; line-height: 1.7; margin: 0; }

/* ================================================================
   НОВІ ФІЛЬТРИ ПОРІД
   ================================================================ */
.br-filter-row-extra {
    display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap;
}
.br-beginner-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 20px; cursor: pointer;
    background: #F5EFD8; color: #7A5000; font-weight: 700; font-size: 13px;
    border: 2px solid #E0C97B; transition: all .18s; user-select: none;
}
.br-beginner-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.br-beginner-toggle:hover { background: #FFD700; color: #5A2E00; }
.br-beginner-toggle--active { background: #FFD700; color: #5A2E00; border-color: #C9A800; }
.br-compare-btn {
    padding: 7px 18px; border-radius: 20px; background: #FF6600;
    color: #fff; border: none; font-weight: 800; font-size: 13px;
    cursor: pointer; transition: transform .14s, background .14s;
    box-shadow: 0 3px 10px rgba(255,102,0,.35);
}
.br-compare-btn:hover { background: #CC4400; transform: translateY(-1px); }

/* ================================================================
   ЗНАЧКИ НА КАРТКАХ ПОРІД
   ================================================================ */
.br-beginner-badge {
    display: inline-block; padding: 3px 9px; border-radius: 12px;
    background: #FFF9C4; color: #7A5200; font-size: 11px; font-weight: 700;
    border: 1px solid #F9D800; margin-top: 4px;
}
.br-card-rarity {
    display: inline-block; padding: 3px 9px; border-radius: 12px;
    font-size: 11px; font-weight: 700; margin-top: 4px;
}
.br-compare-toggle {
    width: 100%; margin-top: 8px; padding: 6px 10px;
    border-radius: 10px; border: 2px solid #DDD; background: #F8F8F8;
    font-size: 12px; font-weight: 700; color: #555;
    cursor: pointer; transition: all .16s;
}
.br-compare-toggle:hover { border-color: #FF8C00; color: #FF8C00; background: #FFF7F0; }
.br-compare-toggle--on { background: #FF8C00; border-color: #CC5500; color: #fff; }
.br-card--compare { box-shadow: 0 0 0 3px #FF8C00, 0 4px 20px rgba(255,140,0,.25) !important; }

/* ================================================================
   МОДАЛЬНЕ ПОРІВНЯННЯ
   ================================================================ */
.br-compare-title {
    font-size: 22px; font-weight: 900; margin-bottom: 18px; color: #3A1A00;
}
.br-compare-table-wrap { overflow-x: auto; margin-bottom: 16px; }
.br-compare-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.br-compare-table th {
    background: #FFF3E0; color: #5A2E00; padding: 10px 14px;
    border-bottom: 2px solid #F0E0C8; text-align: center; font-weight: 800;
}
.br-compare-head-emoji { font-size: 28px; display: block; margin-bottom: 4px; }
.br-compare-table td { padding: 9px 14px; border-bottom: 1px solid #F0E8D8; vertical-align: top; }
.br-compare-table tr:hover td { background: #FFFAF4; }
.br-compare-field { font-weight: 700; color: #3A1A00; white-space: nowrap; min-width: 120px; }
.br-compare-clear {
    background: #f5f5f5; border: 2px solid #ddd; border-radius: 10px;
    padding: 8px 18px; font-size: 13px; font-weight: 700; color: #888;
    cursor: pointer; transition: all .16s;
}
.br-compare-clear:hover { background: #FFEBEE; border-color: #FF5555; color: #B00; }

/* ================================================================
   ВКЛАДКА: РІДКІСНІ
   ================================================================ */
.br-rarity-section { margin-bottom: 28px; }
.br-rarity-title {
    font-size: 17px; font-weight: 800; padding: 10px 18px;
    border-radius: 12px; border: 2px solid; margin-bottom: 14px;
    display: inline-flex; align-items: center; gap: 8px;
}
.br-rarity-grid {
    display: flex; flex-wrap: wrap; gap: 12px;
}
.br-rarity-card {
    position: relative;
    overflow: hidden;
    border: 2px solid; border-radius: 16px; padding: 14px 16px;
    background: #FFFAF5; cursor: pointer; transition: transform .14s, box-shadow .14s;
    min-width: 130px; text-align: center;
}
.br-rarity-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.br-rarity-card--locked { min-height: 176px; cursor: default; }
.br-rarity-card--locked:hover { transform: none; box-shadow: none; }
.br-rarity-card--locked > :not(.br-card-lock) {
    opacity: .38;
}
.br-card-lock--rarity {
    inset: 4px;
    border-radius: 12px;
}
.br-card-lock--rarity .br-card-lock-title {
    max-width: 145px;
    font-size: 12px;
}
.br-card-lock--rarity .br-card-lock-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
}
.br-rarity-card-emoji { font-size: 32px; display: block; margin-bottom: 6px; }
.br-rarity-card-img { width: 66px; height: 66px; object-fit: cover; border-radius: 12px; display: block; margin: 0 auto 8px; box-shadow: 0 2px 7px rgba(0,0,0,0.16); }
.br-rarity-card-name { font-weight: 800; font-size: 13px; color: #3A1A00; }
.br-rarity-card-origin { font-size: 11px; color: #888; margin-top: 2px; }
.br-beginner-mini {
    display: inline-block; margin-top: 5px; padding: 2px 7px;
    border-radius: 10px; background: #FFF9C4; color: #7A5200;
    font-size: 10px; font-weight: 700; border: 1px solid #F9D800;
}
.br-continent-groups { display: flex; flex-direction: column; gap: 18px; }
.br-continent-title {
    font-size: 15px; font-weight: 800; color: #3A1A00; margin-bottom: 8px;
}
.br-continent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.br-continent-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px; border-radius: 18px; background: #FFF3E0;
    border: 1.5px solid #F0C070; font-size: 13px; font-weight: 600; color: #5A2E00;
    cursor: pointer; transition: background .15s;
}
.br-continent-chip:hover { background: #FFE0A0; }
.br-continent-chip-img { width: 24px; height: 24px; object-fit: cover; border-radius: 7px; flex-shrink: 0; }
.br-continent-chip--locked {
    cursor: default;
    opacity: .78;
}
.br-continent-chip--locked:hover { background: #FFF3E0; }
.br-chip-lock-time {
    display: inline-flex;
    align-items: center;
    min-width: 8ch;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff;
    color: #8a5728;
    font-size: 0;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 rgba(123, 79, 39, .08);
    animation: none;
    transition: none;
}
.br-chip-lock-time::before {
    content: attr(data-lock-time);
    font-size: 11px;
}

/* ================================================================
   ПОРАДИ — ФІЛЬТРИ
   ================================================================ */
.br-tips-filter-bar {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.br-tips-cat-btn {
    padding: 7px 16px; border-radius: 20px; border: 2px solid #E0D0B0;
    background: #FFF8F0; color: #6A3A00; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all .16s;
}
.br-tips-cat-btn:hover { background: #FFE5B0; }
.br-tips-cat-btn--active { background: #FF8C00; border-color: #CC5500; color: #fff; }
.br-tips-search-row {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.br-tips-count { font-size: 13px; color: #888; font-weight: 600; white-space: nowrap; }
.br-no-results { color: #888; font-size: 14px; font-style: italic; padding: 20px 0; }

/* ================================================================
   ЗНАЧКИ ВАЖЛИВОСТІ НА ПОРАДАХ
   ================================================================ */
.br-imp-badge {
    display: inline-block; padding: 3px 9px; border-radius: 12px;
    font-size: 11px; font-weight: 800; margin-left: auto; flex-shrink: 0;
}
.br-tip-card-top { flex-wrap: nowrap; }

/* ================================================================
   РОЗКЛАД ВЛАСНИКА
   ================================================================ */
.br-schedule-block {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFF3E0 100%);
    border: 2px solid #F0D090; border-radius: 20px;
    padding: 24px; margin-top: 30px;
}
.br-schedule-block h3 { font-size: 20px; font-weight: 900; color: #3A1A00; margin-bottom: 6px; }
.br-schedule-desc { color: #7A5000; font-size: 13px; margin-bottom: 18px; }
.br-schedule-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.br-schedule-col h4 { font-size: 15px; font-weight: 800; color: #5A2E00; margin-bottom: 10px; }
.br-schedule-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.br-schedule-col li { font-size: 13px; color: #4A2800; line-height: 1.5; }

/* ================================================================
   КАЛЬКУЛЯТОР КЛІТКИ
   ================================================================ */
.br-cage-calc {
    background: #F0F7FF; border: 2px solid #C0D8F0; border-radius: 20px;
    padding: 24px; margin-top: 24px;
}
.br-cage-calc h3 { font-size: 20px; font-weight: 900; color: #0A2A4A; margin-bottom: 8px; }
.br-cage-calc p { font-size: 14px; color: #3A5A7A; margin-bottom: 14px; }
.br-cage-calc-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.br-cage-btn {
    padding: 9px 20px; border-radius: 20px; border: 2px solid #90BBDD;
    background: #E5F0FA; color: #1A3A5A; font-weight: 800; font-size: 14px;
    cursor: pointer; transition: all .16s;
}
.br-cage-btn:hover { background: #C5DDF0; }
.br-cage-btn--active { background: #1976D2; border-color: #1565C0; color: #fff; }
.br-cage-result { padding: 14px 18px; background: #fff; border-radius: 14px; border: 2px solid #90BBDD; }
.br-cage-result-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.br-cage-label { font-size: 12px; color: #888; display: block; margin-bottom: 2px; }
.br-cage-result-inner strong { font-size: 16px; color: #1A3A5A; }
.br-cage-note { font-size: 12px; color: #5A7A9A; font-style: italic; }

/* ================================================================
   СЕЗОННІ ПОРАДИ
   ================================================================ */
.br-seasonal { margin-top: 24px; }
.br-seasonal h3 { font-size: 20px; font-weight: 900; color: #3A1A00; margin-bottom: 16px; }
.br-seasonal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.br-seasonal-card {
    border-radius: 18px; padding: 20px;
    border: 2px solid;
}
.br-seasonal-summer {
    background: linear-gradient(135deg, #FFF9C4, #FFE082);
    border-color: #FFC107;
}
.br-seasonal-winter {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-color: #64B5F6;
}
.br-seasonal-spring {
    background: linear-gradient(135deg, #F9FBE7, #DCEDC8);
    border-color: #AED581;
}
.br-seasonal-autumn {
    background: linear-gradient(135deg, #FBE9E7, #FFCCBC);
    border-color: #FF8A65;
}
.br-seasonal-card h4 { font-size: 16px; font-weight: 800; margin-bottom: 12px; color: #1A1A2E; }
.br-seasonal-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.br-seasonal-card li { font-size: 13px; color: #333; line-height: 1.5; padding-left: 10px; position: relative; }
.br-seasonal-card li::before { content: '•'; position: absolute; left: 0; color: #888; }

/* ================================================================
   ПОШУК ВЕТЕРИНАРА
   ================================================================ */
.br-vet-finder {
    background: linear-gradient(135deg, #F0FFF4 0%, #E8F5E9 100%);
    border: 2px solid #81C784; border-radius: 20px;
    padding: 24px; margin-top: 24px;
}
.br-vet-finder h3 { font-size: 20px; font-weight: 900; color: #1B5E20; margin-bottom: 8px; }
.br-vet-desc { font-size: 14px; color: #2E7D32; margin-bottom: 10px; }
.br-vet-warning {
    background: #FFF8E1; border: 1.5px solid #FFD54F; border-radius: 12px;
    padding: 10px 14px; font-size: 13px; color: #5A3E00; margin-bottom: 16px;
}
.br-vet-btns { margin-bottom: 14px; }
.br-vet-locate-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 26px; border-radius: 24px; border: none;
    background: linear-gradient(135deg, #388E3C, #2E7D32);
    color: #fff; font-size: 15px; font-weight: 800; cursor: pointer;
    box-shadow: 0 4px 14px rgba(56,142,60,.4);
    transition: transform .16s, box-shadow .16s;
}
.br-vet-locate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(56,142,60,.5); }
.br-vet-locate-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.br-vet-result { margin-top: 12px; }
.br-vet-coords { font-size: 13px; color: #2E7D32; margin-bottom: 12px; font-weight: 600; }
.br-vet-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.br-vet-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: 700;
    text-decoration: none; transition: transform .14s, box-shadow .14s;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.br-vet-link:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,0,0,.18); }
.br-vet-link--maps   { background: #4285F4; color: #fff; }
.br-vet-link--exotic { background: #00897B; color: #fff; }
.br-vet-link--google { background: #F4F4F4; color: #333; border: 1.5px solid #DDD; }
.br-vet-hint {
    font-size: 12px; color: #555; font-style: italic;
    background: #fff; padding: 10px 14px; border-radius: 10px;
    border: 1px solid #C8E6C9;
}
.br-vet-error {
    color: #B71C1C; font-size: 13px; font-weight: 600; margin-bottom: 10px;
}

@media (max-width: 600px) {
    .br-vet-links { flex-direction: column; }
    .br-vet-link { justify-content: center; }
    .br-vet-locate-btn { width: 100%; justify-content: center; }
}

/* ---- Адаптивність для нових блоків ---- */
@media (max-width: 600px) {
    .br-tips-filter-bar { gap: 5px; }
    .br-tips-cat-btn { padding: 5px 12px; font-size: 12px; }
    .br-schedule-cols { grid-template-columns: 1fr; }
    .br-seasonal-grid { grid-template-columns: 1fr; }
    .br-cage-calc-buttons { gap: 7px; }
    .br-rarity-grid { gap: 8px; }
    .br-rarity-card { min-width: 110px; }
}

/* ---- Адаптивність ---- */
@media (max-width: 600px) {
    .br-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .br-card-emoji { font-size: 28px; }
    .br-modal-box { padding: 20px 14px; }
    .br-modal-emoji { font-size: 40px; }
    .br-modal-photo { width: 56px; height: 56px; border-radius: 13px; }
    .br-modal-title { font-size: 18px; }
    .br-modal-stats { grid-template-columns: repeat(2, 1fr); }
    .br-disease-grid { grid-template-columns: 1fr; }
    .br-tips-grid { grid-template-columns: 1fr; }
    .br-filter-bar { gap: 4px; }
    .br-filter-btn { padding: 4px 9px; font-size: 11px; }
}

/* ================================================================
   ДОВІДНИКИ: ДЛЯ НЬОГО / ДЛЯ НЕЇ / ДЛЯ ПАРИ
   ================================================================ */

/* ---- Загальний модуль ---- */
.gd-module {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

/* ---- Заголовок ---- */
.gd-header {
    text-align: center;
    margin-bottom: 20px;
}
.gd-header-emoji {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 8px;
}
.gd-header-icon {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    display: inline-block;
    vertical-align: middle;
}
.gd-title {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 900;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}
.gd-module--male   .gd-title { color: #1565C0; }
.gd-module--female .gd-title { color: #880E4F; }
.gd-module--pair   .gd-title { color: #6A1B9A; }

.gd-subtitle {
    font-size: 14px;
    color: #777;
    margin: 0;
}

/* ---- Зміст (TOC) ---- */
.gd-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: #FAFAFA;
    border-radius: 16px;
    border: 1px solid #EEE;
}
.gd-toc-btn {
    padding: 6px 13px;
    border-radius: 18px;
    border: 1.5px solid #DDD;
    background: #FFF;
    color: #444;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.gd-toc-btn:hover {
    border-color: #9B70F6;
    background: #F5EFFF;
    color: #6A1B9A;
}
.gd-module--male   .gd-toc-btn:hover { border-color: #90CAF9; background: #EBF4FF; color: #1565C0; }
.gd-module--female .gd-toc-btn:hover { border-color: #F48FB1; background: #FFF0F5; color: #880E4F; }

/* ---- Контент ---- */
.gd-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---- Секція ---- */
.gd-section {
    border-radius: 20px;
    border: 2px solid;
    padding: 20px;
    scroll-margin-top: 80px;
}
.gd-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.gd-section-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
}
.gd-section-title {
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 800;
    margin: 0;
}

/* ---- Елементи ---- */
.gd-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gd-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.65;
    border: 1.5px solid transparent;
}
.gd-item p {
    margin: 0;
    color: #333;
}
.gd-item-emoji {
    font-size: 20px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* Типи елементів */
.gd-item--info      { background: #F0F4FF; border-color: #C5CAE9; }
.gd-item--tip       { background: #F1FBF2; border-color: #A5D6A7; }
.gd-item--warn      { background: #FFFDE7; border-color: #FFE082; }
.gd-item--danger    { background: #FFEBEE; border-color: #EF9A9A; }
.gd-item--good      { background: #F1FBF2; border-color: #66BB6A; }
.gd-item--important { background: #FFF3E0; border-color: #FFB74D; }

/* Кроки */
.gd-item--step {
    background: #FAFBFF;
    border-color: #C5CAE9;
    align-items: flex-start;
}
.gd-step-num {
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #FFF;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.gd-item-body {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}

/* Розклад */
.gd-item--schedule {
    background: #FFFDF5;
    border-color: #FFE082;
    flex-wrap: wrap;
    gap: 8px;
}
.gd-schedule-time {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    min-width: 60px;
    padding-top: 3px;
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .gd-toc { gap: 5px; }
    .gd-toc-btn { font-size: 11px; padding: 5px 10px; }
    .gd-section { padding: 14px; }
    .gd-item { padding: 9px 11px; font-size: 13px; }
    .gd-header-emoji { font-size: 40px; }
}

/* ================================================================
   ВІЗУАЛЬНІ БЛОКИ ДОВІДНИКІВ — схеми, таймлайни, графіки
   ================================================================ */

/* Загальна картка-обгортка */
.gd-visual-block {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 16px;
    margin-top: 14px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.07);
    border: 1px solid #F0EEF8;
}
.gd-visual-title {
    font-size: 11px;
    font-weight: 700;
    color: #9990BC;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 12px;
}
.gd-visual-caption {
    text-align: center;
    font-size: 12px;
    color: #AAA;
    margin-top: 8px;
}
.gd-cage-svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* ---- Флоучарт кроків знайомства ---- */
.gd-steps-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px 0;
}
.gd-step-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 8px;
    background: #7B52C0;
    border-radius: 12px;
    min-width: 74px;
    flex-shrink: 0;
}
.gd-steps-flow--pink   .gd-step-card { background: #C04888; }
.gd-steps-flow--purple .gd-step-card { background: #7040C0; }
.gd-step-card--ok { background: #2E7D32 !important; }
.gd-step-n   { font-size: 16px; font-weight: 800; color: #FFF; line-height: 1; }
.gd-step-ico { font-size: 18px; line-height: 1; }
.gd-step-lbl { font-size: 9px; color: rgba(255,255,255,.9); text-align: center; line-height: 1.3; }
.gd-step-arrow {
    font-size: 20px;
    color: #9B70D0;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
.gd-steps-flow--pink   .gd-step-arrow { color: #C04888; }
.gd-steps-flow--purple .gd-step-arrow { color: #7040C0; }

/* ---- Графік поведінки (3 колонки) ---- */
.gd-behavior-chart {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.gd-bcol { border-radius: 12px; padding: 12px 11px; }
.gd-bcol--good   { background: #E8FAE0; border: 2px solid #66BB6A; }
.gd-bcol--warn   { background: #FFF8E0; border: 2px solid #FFC107; }
.gd-bcol--danger { background: #FFE8E8; border: 2px solid #EF5350; }
.gd-bcol-head    { font-size: 12px; font-weight: 800; margin-bottom: 8px; }
.gd-bcol--good   .gd-bcol-head { color: #1B5E20; }
.gd-bcol--warn   .gd-bcol-head { color: #7A4800; }
.gd-bcol--danger .gd-bcol-head { color: #8B0000; }
.gd-bcol-list    { margin: 0; padding-left: 14px; font-size: 11px; line-height: 1.9; }
.gd-bcol--good   .gd-bcol-list { color: #2A6A20; }
.gd-bcol--warn   .gd-bcol-list { color: #7A5000; }
.gd-bcol--danger .gd-bcol-list { color: #7A0000; }

/* ---- Цикл охоти (самиця) ---- */
.gd-estrus-wrap {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.gd-estrus-ring {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 12px solid #F8BBD9;
    border-top-color: #E91E8C;
    border-right-color: #E91E8C;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gd-estrus-center { text-align: center; }
.gd-estrus-days   { font-size: 20px; font-weight: 800; color: #880E4F; line-height: 1; }
.gd-estrus-unit   { font-size: 11px; color: #AD1457; }
.gd-estrus-sub    { font-size: 10px; color: #C06090; }
.gd-estrus-facts  { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 10px; }
.gd-estrus-fact   { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: #444; line-height: 1.5; }
.gd-ef-dot        { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.gd-ef--calm   .gd-ef-dot { background: #90CAF9; }
.gd-ef--active .gd-ef-dot { background: #E91E8C; }
.gd-ef--repeat .gd-ef-dot { background: #BDBDBD; }

/* ---- Таймлайн кастрації (горизонтальний) ---- */
.gd-tl-wrap {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch;
    gap: 0;
}
.gd-tl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    flex-shrink: 0;
}
.gd-tl-dot {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 3px solid;
}
.gd-tl-item--red    .gd-tl-dot { background: #FFCDD2; border-color: #E53935; }
.gd-tl-item--orange .gd-tl-dot { background: #FFE0B2; border-color: #FB8C00; }
.gd-tl-item--yellow .gd-tl-dot { background: #FFF9C4; border-color: #FDD835; }
.gd-tl-item--green  .gd-tl-dot { background: #C8E6C9; border-color: #43A047; }
.gd-tl-content { text-align: center; }
.gd-tl-time { font-size: 10px; font-weight: 800; color: #666; margin-bottom: 2px; }
.gd-tl-lbl  { font-size: 10px; color: #444; line-height: 1.4; max-width: 92px; }
.gd-tl-conn {
    flex: 1;
    height: 5px;
    min-width: 14px;
    background: #E0E0E0;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 24px;
}
.gd-tl-conn--orange { background: linear-gradient(to right, #FFCDD2, #FFE0B2); }
.gd-tl-conn--yellow { background: linear-gradient(to right, #FFE0B2, #FFF9C4); }
.gd-tl-conn--green  { background: linear-gradient(to right, #FFF9C4, #C8E6C9); }

/* ---- Статистика розмноження ---- */
.gd-breed-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.gd-bstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 14px;
    background: #EEF4FF;
    border-radius: 14px;
    border: 2px solid #C5D8FF;
    min-width: 78px;
    text-align: center;
}
.gd-bstat--warn  { background: #FFF5E0; border-color: #FFCC80; }
.gd-bstat--alert { background: #FFF0E0; border-color: #FFAB76; }
.gd-bstat-icon   { font-size: 22px; line-height: 1; }
.gd-bstat-val    { font-size: 18px; font-weight: 800; color: #1A3A80; line-height: 1.1; }
.gd-bstat--warn  .gd-bstat-val { color: #7A3800; }
.gd-bstat--alert .gd-bstat-val { color: #7A3000; }
.gd-bstat-unit   { font-size: 10px; color: #888; min-height: 14px; }
.gd-bstat-lbl    { font-size: 11px; color: #555; }

@media (max-width: 520px) {
    .gd-behavior-chart { grid-template-columns: 1fr; }
    .gd-steps-flow     { gap: 4px; }
    .gd-step-card      { min-width: 60px; padding: 8px 6px; }
    .gd-step-n         { font-size: 14px; }
    .gd-step-ico       { font-size: 15px; }
    .gd-step-lbl       { font-size: 8px; }
    .gd-estrus-wrap    { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
   ЛІКУВАННЯ ХВОРОБ (DiseasesModule)
   ================================================================ */
.tile-diseases { background: linear-gradient(135deg, #FFE0E0, #FFAAAA); }

.dis-module { max-width: 1000px; margin: 0 auto; padding: 20px 16px 40px; }

/* ---- Заголовок ---- */
.dis-header { text-align: center; margin-bottom: 16px; }
.dis-header h1 { font-size: clamp(22px, 3vw, 36px); color: #7A0000; margin: 0 0 6px; }
.dis-header-icon { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; vertical-align: middle; margin-right: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.dis-subtitle { color: #AA3030; font-size: 15px; margin: 0; }

/* ---- Перемикач Все / Вдома / Вет ---- */
.dis-switcher { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; justify-content: center; }
.dis-switch-btn {
    padding: 9px 18px; border-radius: 22px; border: 2px solid #E0C0C0;
    background: #FFF8F8; color: #883030; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all .18s; font-family: inherit;
}
.dis-switch-btn:hover { background: #FFE8E8; }
.dis-switch-btn--active { background: #CC3333; color: #fff; border-color: #AA2020; }
.dis-switch-btn--home-off { border-color: #A0D080; color: #2A6000; background: #F4FFF0; }
.dis-switch-btn--home-off:hover { background: #E0FFD0; }
.dis-switch-btn--vet-off  { border-color: #90B0E0; color: #0A3080; background: #F0F6FF; }
.dis-switch-btn--vet-off:hover  { background: #E0EEFF; }
.dis-switch-btn--active.dis-switch-btn--home { background: #2E7D00; border-color: #1A5A00; color: #fff; }
.dis-switch-btn--active.dis-switch-btn--vet  { background: #1A4A9A; border-color: #0A3080; color: #fff; }
.dis-switch-count {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.3); border-radius: 10px;
    padding: 0 7px; font-size: 11px; margin-left: 4px; min-width: 20px;
}

/* ---- Пошук ---- */
.dis-search-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.dis-search {
    width: 100%; max-width: 500px; padding: 10px 16px; border-radius: 24px;
    border: 2px solid #E8C0C0; font-size: 14px; outline: none; font-family: inherit;
    background: #FFFAFA; color: #333;
    transition: border-color .15s;
}
.dis-search:focus { border-color: #CC3333; box-shadow: 0 0 0 3px rgba(204,51,51,.12); }

/* ---- Теги ---- */
.dis-tags-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dis-tag-btn {
    padding: 4px 12px; border-radius: 14px;
    border: 1.5px solid #E0C0C0; background: #FFF8F8;
    cursor: pointer; font-size: 12px; font-weight: 600; color: #883030;
    transition: all .15s; font-family: inherit;
}
.dis-tag-btn:hover { background: #FFE8E8; border-color: #CC5555; }
.dis-tag-btn--active { background: #CC3333; color: #fff; border-color: #AA2020; }

/* ---- Статистика ---- */
.dis-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.dis-stat { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 12px; }
.dis-stat--home  { background: #E0FFD0; color: #1A5A00; }
.dis-stat--vet   { background: #D0E8FF; color: #0A3080; }
.dis-stat--total { background: #F0E8FF; color: #5A20A0; }

/* ---- Попередження ---- */
.dis-warning-bar {
    background: #FFF8E0; border: 1px solid #FFD700;
    border-radius: 12px; padding: 10px 16px;
    font-size: 13px; color: #7A5000; margin-bottom: 18px; line-height: 1.5;
}

/* ---- Пусто ---- */
.dis-empty {
    grid-column: 1 / -1; text-align: center;
    padding: 40px 20px; color: #AA7070; font-size: 15px;
}

/* ---- Сітка карток ---- */
.dis-grid { display: flex; flex-direction: column; gap: 10px; }

/* ---- Картка ---- */
.dis-card {
    border-radius: 16px; border: 2px solid #F0D0D0;
    background: #FFFAFA;
    cursor: pointer; transition: box-shadow .18s, border-color .18s;
    padding: 14px 16px;
    user-select: none;
}
.dis-card:hover { box-shadow: 0 4px 18px rgba(180,40,40,.12); border-color: #E08080; }
.dis-card--open { border-color: #CC3333; box-shadow: 0 6px 24px rgba(180,40,40,.15); }
.dis-card--home { border-left: 5px solid #4CAF50; }
.dis-card--home.dis-card--open { border-left-color: #2E7D00; }
.dis-card--vet  { border-left: 5px solid #2196F3; }
.dis-card--vet.dis-card--open  { border-left-color: #0A3080; }

/* Серйозність */
.dis-card--sev2 { background: #FFFBF0; }
.dis-card--sev3 { background: #FFF5F5; }

/* ---- Голова картки ---- */
.dis-card-head { display: flex; align-items: flex-start; gap: 12px; }
.dis-card-emoji { font-size: 36px; line-height: 1; flex-shrink: 0; }
.dis-card-info { flex: 1; }
.dis-card-name { font-size: 16px; font-weight: 800; color: #3A0000; margin-bottom: 6px; }
.dis-card-bottom { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dis-card-arrow { font-size: 12px; color: #AAA; flex-shrink: 0; align-self: center; }

/* ---- Бейджі ---- */
.dis-badge {
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
}
.dis-badge--home { background: #DDFFC4; color: #1A5A00; }
.dis-badge--vet  { background: #D0E8FF; color: #0A3080; }
.dis-badge--urgent { background: #FFD4D4; color: #880000; animation: dis-pulse 1.2s ease-in-out infinite; }
@keyframes dis-pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.dis-card-tag {
    font-size: 11px; color: #AA6040; background: #FFF0E8;
    padding: 3px 9px; border-radius: 10px; font-weight: 600;
}
.dis-card-sev {
    font-size: 11px; font-weight: 700;
}
.dis-card-sev--1 { color: #4CAF50; }
.dis-card-sev--2 { color: #FF9800; }
.dis-card-sev--3 { color: #F44336; }

/* ---- Попередній перегляд симптомів ---- */
.dis-card-symptoms-preview { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.dis-symptom-chip {
    font-size: 11px; color: #AA5050; background: #FFF0F0;
    border-radius: 10px; padding: 2px 9px; border: 1px solid #F0D0D0;
}
.dis-symptom-more {
    background: #F0E8FF; color: #6020A0; border-color: #E0C8FF;
    font-weight: 700;
}

/* ---- Розгорнутий блок ---- */
.dis-expand { margin-top: 14px; border-top: 1.5px solid #F0D0D0; padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.dis-expand-row { background: #FAFAFA; border-radius: 12px; padding: 12px 14px; border: 1px solid #F0E8E8; }
.dis-expand-symptoms { background: #FFF8F8; border-color: #F0D0D0; }
.dis-expand-vet-when  { background: #FFFBF0; border-color: #FFE080; }
.dis-expand-danger    { background: #FFF0F0; border-color: #FFB0B0; }
.dis-expand-label {
    font-size: 11px; font-weight: 800; color: #888; text-transform: uppercase;
    letter-spacing: .6px; margin-bottom: 8px;
}
.dis-label-home { color: #2A6A00; }
.dis-label-vet  { color: #0A4080; }

/* Симптоми списком */
.dis-symptom-list {
    margin: 0; padding: 0 0 0 16px;
    display: flex; flex-direction: column; gap: 4px;
}
.dis-symptom-list li { font-size: 13px; color: #444; line-height: 1.5; }

/* Кроки лікування */
.dis-steps-list {
    margin: 0; padding: 0 0 0 20px;
    display: flex; flex-direction: column; gap: 6px;
}
.dis-steps-list li { font-size: 13px; color: #333; line-height: 1.6; }

/* Тексти */
.dis-vet-when-text, .dis-vethelp-text, .dis-prevention-text, .dis-danger-text {
    font-size: 13px; line-height: 1.6; margin: 0; color: #444;
}
.dis-danger-text { color: #880000; font-weight: 600; }
.dis-vet-when-text { color: #7A5000; }
.dis-vthelp-text { color: #0A3080; }

/* ---- Блок "Ветеринар поблизу" ---- */
.dis-vet-finder {
    margin-top: 0;
    margin-bottom: 20px;
    background: #F0FFF4; border: 2px solid #A8E6B8;
    border-radius: 20px; padding: 20px 22px;
}
.dis-vet-finder h3 {
    font-size: 18px; font-weight: 800; color: #1A5A00;
    margin: 0 0 8px;
}
.dis-vet-desc { font-size: 14px; color: #3A6030; margin: 0 0 12px; line-height: 1.5; }
.dis-vet-warning {
    background: #FFFBEA; border: 1px solid #FFD700;
    border-radius: 10px; padding: 9px 14px;
    font-size: 13px; color: #7A5000; margin-bottom: 16px; line-height: 1.5;
}
.dis-vet-btns { margin-bottom: 12px; }
.dis-vet-locate-btn {
    background: #2E7D32; color: #fff;
    border: none; border-radius: 16px;
    padding: 12px 24px; font-size: 15px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: background .18s, transform .12s;
    box-shadow: 0 4px 14px rgba(46,125,50,.3);
}
.dis-vet-locate-btn:hover:not(:disabled) { background: #1B5E20; transform: translateY(-2px); }
.dis-vet-locate-btn:disabled { opacity: .65; cursor: default; transform: none; }

.dis-vet-result { margin-top: 10px; }
.dis-vet-result.hidden { display: none; }

.dis-vet-found { display: flex; flex-direction: column; gap: 10px; }
.dis-vet-coords { font-size: 13px; color: #2A6A00; margin: 0; font-weight: 600; }
.dis-vet-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dis-vet-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 14px;
    font-size: 13px; font-weight: 700; text-decoration: none;
    transition: transform .12s, box-shadow .12s;
}
.dis-vet-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.dis-vet-link--maps   { background: #E8F5E9; color: #1B5E20; border: 1px solid #A5D6A7; }
.dis-vet-link--exotic { background: #E3F2FD; color: #0D47A1; border: 1px solid #90CAF9; }
.dis-vet-link--google { background: #FFF8E1; color: #E65100; border: 1px solid #FFCC80; }
.dis-vet-hint { font-size: 12px; color: #666; margin: 4px 0 0; line-height: 1.5; font-style: italic; }
.dis-vet-error { font-size: 13px; color: #B71C1C; margin: 0 0 8px; }

@media (max-width: 480px) {
    .dis-card-name { font-size: 14px; }
    .dis-card-emoji { font-size: 28px; }
    .dis-switcher { gap: 6px; }
    .dis-switch-btn { padding: 7px 12px; font-size: 12px; }
}
/* ================================================================
   ЦІНИ (PricesModule)
   ================================================================ */
.tile-prices { background: linear-gradient(135deg, #D4FFEA, #90EEC0); }

.pr-module { max-width: 1000px; margin: 0 auto; padding: 20px 16px 40px; }

/* ---- Заголовок ---- */
.pr-header { text-align: center; margin-bottom: 16px; }
.pr-header h1 { font-size: clamp(22px, 3vw, 36px); color: #1A4A00; margin: 0 0 6px; }
.pr-header-icon { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; vertical-align: middle; margin-right: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.pr-subtitle { color: #3A8030; font-size: 15px; margin: 0; }

/* ---- Перемикач валют (21 країна) ---- */
.pr-currency-bar {
    display: flex; gap: 6px; flex-wrap: wrap;
    justify-content: center; margin-bottom: 18px;
}
.pr-cur-btn {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 5px 10px; border-radius: 12px;
    border: 2px solid #A0E0C0; background: #F0FFF8;
    cursor: pointer; font-size: 11px; font-weight: 700; color: #1A5A30;
    transition: all .2s; font-family: inherit; line-height: 1.3; min-width: 54px;
}
.pr-cur-btn:hover { background: #C8F5DF; border-color: #30B870; }
.pr-cur-btn--active { background: #1A8A50; color: #fff; border-color: #0A6830; }
.pr-cur-code { font-size: 12px; font-weight: 900; letter-spacing: .5px; }
.pr-cur-sym  { font-size: 13px; line-height: 1; }
.pr-cur-country { font-size: 9px; font-weight: 500; opacity: .75; white-space: nowrap; }
.pr-cur-btn--active .pr-cur-country { opacity: .9; }

/* ---- Таби ---- */
.pr-tab-bar {
    display: flex; gap: 8px; flex-wrap: wrap;
    justify-content: center; margin-bottom: 20px;
}
.pr-tab-btn {
    padding: 9px 18px; border-radius: 20px;
    border: 2px solid #A0D890; background: #F4FFF0;
    cursor: pointer; font-size: 13px; font-weight: 700; color: #2A6A10;
    transition: all .2s; font-family: inherit;
}
.pr-tab-btn:hover { background: #D0F5C0; border-color: #50C030; }
.pr-tab-btn--active { background: #38A818; color: #fff; border-color: #28880A; }

/* ---- Назва секції ---- */
.pr-section-title {
    font-size: 18px; font-weight: 800; color: #1A4A00;
    margin-bottom: 8px;
}
.pr-note {
    font-size: 13px; color: #666; margin: 0 0 16px; line-height: 1.5;
}

/* ---- Картки ---- */
.pr-cards { display: flex; flex-direction: column; gap: 8px; }
.pr-card {
    display: flex; align-items: center; gap: 12px;
    background: #FFFFFF; border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid #E0F0E8;
    transition: transform .12s;
}
.pr-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,100,0,.1); }
.pr-card-num {
    min-width: 24px; height: 24px; border-radius: 50%;
    background: #38A818; color: #fff;
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pr-card-emoji { font-size: 30px; line-height: 1; flex-shrink: 0; }
.pr-card-img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; display: block; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.pr-card-body { flex: 1; min-width: 0; }
.pr-card-name { font-size: 14px; font-weight: 700; color: #1A3A00; line-height: 1.3; }
.pr-card-note { font-size: 12px; color: #888; margin-top: 2px; }
.pr-card-price {
    font-size: 15px; font-weight: 800; color: #1A6A30;
    white-space: nowrap; flex-shrink: 0;
    background: #E8FFF0; padding: 4px 12px; border-radius: 12px;
    border: 1px solid #90D8A0;
}

/* ---- Щомісячна таблиця ---- */
.pr-monthly-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pr-monthly-row {
    display: flex; align-items: center; gap: 10px;
    background: #FFFFFF; border-radius: 12px;
    padding: 10px 14px;
    border: 1px solid #E0F0E8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.pr-monthly-total {
    background: #E8FFF0; border-color: #60C080;
    font-weight: 700;
}
.pr-monthly-emoji { font-size: 22px; flex-shrink: 0; }
.pr-monthly-name { font-size: 14px; font-weight: 700; color: #1A3A00; min-width: 160px; }
.pr-monthly-note { flex: 1; font-size: 12px; color: #888; }
.pr-monthly-price {
    font-size: 14px; font-weight: 800; color: #1A6A30;
    white-space: nowrap; flex-shrink: 0;
}
.pr-monthly-total .pr-monthly-price { font-size: 16px; color: #0A5020; }

.pr-monthly-tip {
    display: flex; gap: 10px; align-items: flex-start;
    background: linear-gradient(135deg, #FFFBEA, #FFF3C0);
    border: 1px solid #FFD700;
    border-radius: 14px; padding: 12px 16px;
    font-size: 13px; color: #5A3A00; line-height: 1.6;
}

/* ---- Дисклеймер ---- */
.pr-disclaimer {
    margin-top: 24px; padding: 12px 16px;
    background: #F8F8F8; border-radius: 12px;
    font-size: 12px; color: #888; line-height: 1.6;
    border: 1px solid #E8E8E8;
}

@media (max-width: 600px) {
    .pr-monthly-note { display: none; }
    .pr-monthly-name { min-width: 0; flex: 1; }
    .pr-cur-country { display: none; }
    .pr-card-price { font-size: 13px; }
}

/* ================================================================
   ПРО ДОДАТОК (AboutModule)
   ================================================================ */
.tile-about { background: linear-gradient(135deg, #E8F4FF, #BFD9FF); }

.ab-module { max-width: 700px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---- Шапка ---- */
.ab-header { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #F0F8FF, #D6EEFF); border-radius: 20px; padding: 20px; margin-bottom: 18px; box-shadow: 0 4px 16px rgba(0,80,180,.1); }
.ab-pig-img { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; border: 3px solid #90C0FF; box-shadow: 0 2px 8px rgba(0,0,0,.15); flex-shrink: 0; }
.ab-title { font-size: clamp(22px, 3vw, 30px); font-weight: 900; color: #003A80; margin: 0 0 4px; }
.ab-subtitle { font-size: 13px; color: #2255AA; margin: 0; }

/* ---- Лічильник ---- */
.ab-count-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.ab-count-chip { background: #fff; border: 2px solid #C0D8FF; border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 700; color: #1A4A9A; white-space: nowrap; }

/* ---- Секції ---- */
.ab-sections { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.ab-section { background: var(--ab-color, #F0F8FF); border-radius: 16px; overflow: hidden; border: 2px solid transparent; transition: border-color .2s, box-shadow .2s; }
.ab-section:hover { border-color: rgba(0,0,0,.08); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.ab-section--open { border-color: var(--ab-accent, #0055CC) !important; box-shadow: 0 4px 20px rgba(0,0,0,.12); }

.ab-section-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; user-select: none; }
.ab-section-emoji { font-size: 30px; flex-shrink: 0; width: 36px; text-align: center; }
.ab-section-info { flex: 1; min-width: 0; }
.ab-section-title { font-size: 15px; font-weight: 800; color: var(--ab-accent, #003A80); }
.ab-section-desc { font-size: 12px; color: #555; margin-top: 3px; line-height: 1.5; }
.ab-section-arrow { font-size: 18px; color: var(--ab-accent, #0055CC); flex-shrink: 0; transition: transform .25s; }
.ab-section--open .ab-section-arrow { transform: rotate(180deg); }

.ab-section-body { display: none; padding: 0 16px 14px 16px; }
.ab-section--open .ab-section-body { display: block; }

/* ---- Список можливостей ---- */
.ab-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ab-feature { display: flex; align-items: flex-start; gap: 10px; background: rgba(255,255,255,.6); border-radius: 10px; padding: 8px 12px; }
.ab-feature-icon { font-size: 18px; flex-shrink: 0; line-height: 1.3; }
.ab-feature-text { font-size: 13px; color: #333; line-height: 1.5; }

/* ---- Підказка ---- */
.ab-tip { display: flex; align-items: flex-start; gap: 12px; background: linear-gradient(135deg, #FFFBEA, #FFF3C0); border: 2px solid #FFD700; border-radius: 14px; padding: 14px 16px; }
.ab-tip-icon { font-size: 22px; flex-shrink: 0; line-height: 1.3; }
.ab-tip-text { font-size: 13px; color: #5A4000; line-height: 1.6; margin: 0; }

@media (max-width: 480px) {
  .ab-header { flex-direction: row; padding: 14px; }
  .ab-pig-img { width: 48px; height: 48px; }
  .ab-section-desc { display: none; }
  .ab-section--open .ab-section-desc { display: block; }
}

/* ================================================================
   ЧАТ ПРО СВИНОК (ChatModule)
   ================================================================ */
.tile-chat { background: linear-gradient(135deg, #E8FFEF, #B6F0CC); }

/* Загальний контейнер */
.chat-wrap {
  display: flex;
  flex-direction: column;
    min-height: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 8px;
}

/* Шапка головного екрану */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #E0FFF0, #C6F4DA);
  border-bottom: 2px solid rgba(0,180,80,.15);
  padding: 14px 16px;
  flex-shrink: 0;
}
.chat-header-icon { font-size: 34px; line-height: 1; }
.chat-global-header .chat-header-icon { overflow: hidden; padding: 0; }
.chat-global-header .chat-header-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-header-info { flex: 1; }
.chat-header-title { font-size: 20px; font-weight: 900; color: #1A6A35; }
.chat-header-sub   { font-size: 13px; color: #3A9A5A; margin-top: 2px; }

.chat-nick-btn {
  background: #fff;
  border: 2px solid #5AC87A;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #1A6A35;
  white-space: nowrap;
  transition: background .15s, transform .12s;
}
.chat-nick-btn:hover { background: #DFF7E8; transform: scale(1.04); }
.chat-nick-label { pointer-events: none; }

/* Сітка тем */
.chat-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px;
}

.chat-topic-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: #fff;
  border: 2px solid rgba(0,160,70,.22);
  border-radius: 16px;
  padding: 16px 14px 12px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 2px 10px rgba(0,120,60,.08);
}
.chat-topic-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 22px rgba(0,140,70,.18);
  border-color: #3DAA60;
}
.chat-topic-card:active { transform: scale(0.97); }

.chat-topic-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}
.chat-topic-name {
  font-size: 16px;
  font-weight: 800;
  color: #1A4A2A;
  line-height: 1.2;
}
.chat-topic-count {
  font-size: 11px;
  font-weight: 700;
  color: #3A9A5A;
  background: #E0FFF0;
  border-radius: 999px;
  padding: 2px 8px;
  margin-top: 2px;
}
.chat-topic-empty {
  font-size: 11px;
  color: #9AB;
  font-style: italic;
  margin-top: 2px;
}
.chat-topic-last {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 2px;
  opacity: .75;
}

/* Шапка теми */
.chat-topic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #E0FFF0, #C6F4DA);
  border-bottom: 2px solid rgba(0,180,80,.15);
  padding: 12px 14px;
  flex-shrink: 0;
}
.chat-back-btn {
  background: #fff;
  border: 2px solid #5AC87A;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #1A6A35;
  transition: background .15s, transform .12s;
  white-space: nowrap;
}
.chat-back-btn:hover { background: #DFF7E8; transform: scale(1.04); }
.chat-topic-header-icon { font-size: 24px; line-height: 1; }
.chat-topic-header-name { font-size: 18px; font-weight: 800; color: #1A4A2A; flex: 1; }

/* Область повідомлень */
.chat-messages-area {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-no-msgs {
  text-align: center;
  color: #9AB;
  font-size: 15px;
  font-style: italic;
  margin: auto;
}

.chat-msg {
  background: #fff;
  border: 1.5px solid rgba(0,160,70,.18);
  border-radius: 14px;
  padding: 10px 14px;
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(0,120,60,.06);
}
.chat-msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.chat-msg-nick {
  font-size: 13px;
  font-weight: 800;
  color: #1A6A35;
}
.chat-msg-time {
  font-size: 11px;
  color: #9AB;
}
.chat-msg-text {
  font-size: 14px;
  color: #222;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Панель введення */
.chat-input-bar {
  flex-shrink: 0;
  border-top: 2px solid rgba(0,160,70,.15);
  background: #F4FFF8;
  padding: 10px 14px 12px;
}
.chat-input-row { display: flex; flex-direction: column; gap: 8px; }

.chat-nick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-nick-show {
  font-size: 13px;
  font-weight: 700;
  color: #1A6A35;
}
.chat-nick-missing { color: #E06030; font-style: italic; }
.chat-change-nick-btn {
  background: none;
  border: 1px solid #5AC87A;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  color: #3A9A5A;
  cursor: pointer;
  transition: background .12s;
}
.chat-change-nick-btn:hover { background: #DFF7E8; }

.chat-msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-textarea {
  flex: 1;
  border: 2px solid rgba(0,160,70,.35);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color .2s;
  background: #fff;
  color: #222;
  max-height: 100px;
  line-height: 1.4;
}
.chat-textarea:focus { border-color: #3DAA60; }
.chat-textarea.chat-input-error { border-color: #DD3300; animation: chatShake .3s; }

.chat-send-btn {
  background: linear-gradient(135deg, #4ACF70, #28A74E);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, box-shadow .15s;
  box-shadow: 0 3px 10px rgba(0,140,60,.3);
  align-self: stretch;
}
.chat-send-btn:hover { transform: scale(1.05); box-shadow: 0 5px 16px rgba(0,140,60,.4); }
.chat-send-btn:active { transform: scale(0.97); }

/* Діалог нікнейму */
.chat-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-dialog {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  width: min(360px, 92vw);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-dialog-title {
  font-size: 18px;
  font-weight: 800;
  color: #1A4A2A;
  text-align: center;
}
.chat-dialog-input {
  border: 2px solid #5AC87A;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color .2s;
}
.chat-dialog-input:focus { border-color: #28A74E; }
.chat-dialog-input.chat-input-error { border-color: #DD3300; animation: chatShake .3s; }
.chat-dialog-btns {
  display: flex;
  gap: 10px;
}
.chat-dialog-cancel, .chat-dialog-ok {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform .12s;
}
.chat-dialog-cancel { background: #F0F0F0; color: #444; }
.chat-dialog-ok     { background: linear-gradient(135deg, #4ACF70, #28A74E); color: #fff; }
.chat-dialog-cancel:hover { background: #E0E0E0; }
.chat-dialog-ok:hover     { filter: brightness(1.07); transform: scale(1.03); }

@keyframes chatShake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

/* ── Плитка "Фото" з тамбнейлом ── */
.chat-topic-card--photo {
  border-color: rgba(255,130,0,.3);
  background: linear-gradient(135deg, #FFF8F0, #FFF0DC);
}
.chat-topic-card--photo:hover {
  border-color: #FF8C00;
  box-shadow: 0 8px 22px rgba(255,130,0,.22);
}
.chat-topic-thumb-wrap {
  width: 100%;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
  background: #eee;
  flex-shrink: 0;
}
.chat-topic-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Галерейний вигляд повідомлень ── */
.chat-messages-area--gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-content: start;
  padding: 14px;
}
.chat-messages-area--gallery .chat-no-msgs {
  grid-column: 1 / -1;
}

/* ── Повідомлення з фото ── */
.chat-msg--photo {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}
.chat-msg--photo .chat-msg-head {
  padding: 8px 12px 4px;
}
.chat-msg--photo .chat-msg-text {
  padding: 0 12px 10px;
  font-size: 13px;
  color: #444;
}

.chat-msg-photo-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  background: #f0f0f0;
  max-height: 260px;
}
.chat-msg-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform .2s;
}
.chat-msg-photo--zoom {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain;
  z-index: 99999;
  background: rgba(0,0,0,.92);
  cursor: zoom-out;
  border-radius: 0;
  transform: none !important;
}

/* ── Кнопка завантаження фото ── */
.chat-photo-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid rgba(255,140,0,.5);
  background: #FFF8F0;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, transform .12s;
  user-select: none;
  align-self: stretch;
}
.chat-photo-label:hover { background: #FFE8C0; border-color: #FF8C00; transform: scale(1.06); }
.chat-photo-label.chat-input-error { border-color: #DD3300; animation: chatShake .3s; }
.chat-photo-label.chat-photo-loading { opacity: .5; pointer-events: none; }

/* ── Превʼю вибраного фото ── */
.chat-photo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  background: #FFF8F0;
  border: 2px dashed rgba(255,140,0,.5);
  border-radius: 10px;
  padding: 6px 10px;
}
.chat-photo-preview {
  height: 60px;
  max-width: 120px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.chat-photo-remove {
  background: rgba(220,50,50,.12);
  border: 1.5px solid rgba(220,50,50,.4);
  border-radius: 8px;
  color: #C03030;
  font-size: 18px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  transition: background .12s;
}
.chat-photo-remove:hover { background: rgba(220,50,50,.25); }

@media (max-width: 480px) {
  .chat-topics-grid { grid-template-columns: 1fr 1fr; padding: 10px; gap: 8px; }
  .chat-topic-card  { padding: 12px 10px 10px; }
  .chat-topic-icon  { font-size: 22px; }
  .chat-topic-name  { font-size: 14px; }
  .chat-send-btn    { padding: 10px 12px; font-size: 13px; }
  .chat-messages-area--gallery { grid-template-columns: 1fr 1fr; }
  .chat-msg-photo   { height: 140px; }
  .chat-topic-thumb-wrap { height: 60px; }
}

/* Global chat feed */
.chat-global-wrap {
  position: relative;
  width: min(1220px, 100%);
  max-width: 1220px;
  height: 100%;
  min-height: 0;
  padding-inline: clamp(10px, 2.2vw, 28px);
  background:
    linear-gradient(180deg, rgba(246, 255, 248, .96), rgba(255, 250, 242, .92)),
    repeating-linear-gradient(135deg, rgba(44, 151, 86, .035) 0 1px, transparent 1px 18px);
  isolation: isolate;
  overflow: hidden;
}

.chat-global-wrap::before {
  content: "";
  position: absolute;
  inset: 96px 0 auto;
  height: 180px;
  background:
    linear-gradient(90deg, rgba(255, 180, 84, .12), transparent 28%, rgba(68, 195, 116, .16) 64%, transparent),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(31, 122, 68, .035) 34px 35px);
  mask-image: linear-gradient(180deg, #000, transparent);
  pointer-events: none;
  z-index: -1;
}

.chat-global-header {
  position: relative;
  margin: 0 calc(clamp(10px, 2.2vw, 28px) * -1) 0;
  padding: 20px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid rgba(43, 163, 90, .22);
  background:
    linear-gradient(115deg, rgba(215, 255, 231, .98), rgba(197, 245, 222, .94) 48%, rgba(255, 237, 197, .88)),
    #D7FFE8;
  box-shadow: 0 18px 44px rgba(22, 104, 58, .11);
  overflow: hidden;
}

.chat-global-header::after {
  content: "";
  position: absolute;
  right: clamp(132px, 14vw, 220px);
  top: 0;
  bottom: 0;
  width: 190px;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.28) 0 9px, transparent 9px 18px);
  transform: skewX(-12deg);
  pointer-events: none;
}

.chat-global-header .chat-header-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(64, 175, 98, .2);
  box-shadow: inset 0 -3px 0 rgba(23, 122, 61, .08), 0 8px 18px rgba(24, 104, 58, .12);
}

.chat-global-header .chat-header-title {
  color: #074C2A;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255,255,255,.9);
}

.chat-global-header .chat-header-sub {
  color: #2D8E57;
  font-size: 14px;
  font-weight: 650;
  margin-top: 5px;
}

.chat-header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.chat-header-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(31, 143, 78, .16);
  color: #20683D;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 5px 14px rgba(22, 104, 58, .07);
}

.chat-composer {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 14px;
  padding: clamp(14px, 2vw, 20px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(249, 255, 251, .92)),
    #fff;
  border: 1px solid rgba(54, 184, 103, .25);
  border-radius: 16px;
  box-shadow:
    0 18px 46px rgba(21, 103, 58, .12),
    0 1px 0 rgba(255,255,255,.9) inset;
  overflow: hidden;
}

.chat-composer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, #35C66F, #F9C64A, #FF8F5A);
}

.chat-composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-composer-title {
  flex: 1;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-composer-title strong {
  color: #0B4D2A;
  font-size: 17px;
  line-height: 1.15;
}

.chat-composer-title span {
  color: #789085;
  font-size: 12px;
  font-weight: 650;
}

.chat-mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: #E9F8EF;
  border: 1px solid rgba(60, 170, 90, .18);
  border-radius: 12px;
}

.chat-mode-tab {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #276B42;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 14px;
  transition: background .16s, color .16s, transform .12s, box-shadow .16s;
}

.chat-mode-tab.is-active {
  background: #fff;
  color: #0C512C;
  box-shadow: 0 8px 18px rgba(20, 113, 58, .13);
}

.chat-mode-tab:hover {
  transform: translateY(-1px);
}

.chat-saved-count {
  appearance: none;
  cursor: pointer;
  color: #835912;
  background: linear-gradient(180deg, #FFF7D8, #FFEDB7);
  border: 1px solid rgba(218, 164, 36, .34);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(168, 117, 17, .12);
  transition: transform .12s, box-shadow .16s;
}

.chat-saved-count:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(168, 117, 17, .16);
}

.chat-global-textarea {
  min-height: 96px;
  max-height: 148px;
  border-radius: 14px;
  border-width: 1.5px;
  background:
    linear-gradient(180deg, #fff, #FBFFFC);
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 20px rgba(22, 104, 58, .04);
}

.chat-emoji-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 0 4px;
}

.chat-emoji-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(40, 150, 80, .2);
  border-radius: 12px;
  background: linear-gradient(180deg, #FFFFFF, #F2FFF6);
  cursor: pointer;
  font-size: 19px;
  box-shadow: 0 6px 14px rgba(17, 103, 55, .07);
  transition: transform .12s, border-color .16s, box-shadow .16s;
}

.chat-emoji-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(43, 179, 91, .48);
  box-shadow: 0 10px 20px rgba(17, 103, 55, .12);
}

.chat-emoji-btn:active,
.chat-upload-btn:active,
.chat-action-btn:active {
  transform: scale(.96);
}

.chat-composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1.5px solid rgba(255, 140, 0, .38);
  border-radius: 13px;
  background: linear-gradient(180deg, #FFF8EF, #FFEED7);
  color: #855212;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 16px;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(175, 104, 24, .1);
  transition: transform .12s, box-shadow .16s;
}

.chat-media-rule {
  flex: 1;
  min-width: 0;
  color: #7C8B82;
  font-size: 12px;
}

.chat-global-send {
  border-radius: 14px;
  align-self: auto;
  min-height: 50px;
  padding-inline: 24px;
  background: linear-gradient(135deg, #20B95D, #39D071);
  box-shadow: 0 12px 24px rgba(23, 163, 78, .26);
}

.chat-media-preview {
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1.5px dashed rgba(255, 140, 0, .42);
  border-radius: 8px;
  background: #FFF9EF;
}

.chat-media-preview-thumb {
  width: 68px;
  height: 52px;
  overflow: hidden;
  border-radius: 6px;
  background: #eee;
  flex-shrink: 0;
}

.chat-media-preview-thumb img,
.chat-media-preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-media-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #58645D;
}

.chat-media-preview-info strong {
  color: #314B39;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 0 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(44, 160, 86, .38) transparent;
}

.chat-lazy-loader {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: 2px 0 4px;
  pointer-events: none;
}

.chat-lazy-loader span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 247, 216, .94);
  border: 1px solid rgba(219, 165, 40, .3);
  color: #856018;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(112, 80, 18, .12);
}

.chat-feed-item {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(252,255,253,.96)),
    #fff;
  border: 1px solid rgba(38, 157, 82, .17);
  border-radius: 18px;
  padding: clamp(14px, 2vw, 18px);
  box-shadow: 0 14px 36px rgba(23, 100, 58, .1);
  overflow: hidden;
}

.chat-feed-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #35C66F, #9CE8B4);
}

.chat-feed-item--post {
  border-color: rgba(255, 154, 57, .32);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255, 251, 243, .96)),
    #fff;
}

.chat-feed-item--post::before {
  background: linear-gradient(180deg, #FFAD45, #FFD36D);
}

.chat-feed-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(180deg, #EFFFF4, #DFF9E8);
  border: 1px solid rgba(60, 170, 90, .2);
  box-shadow: inset 0 -2px 0 rgba(25, 125, 60, .08), 0 8px 18px rgba(24, 104, 58, .1);
  flex-shrink: 0;
}

.chat-feed-meta {
  min-width: 0;
}

.chat-feed-nick {
  color: #0B4D2A;
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-feed-time {
  color: #74877D;
  font-size: 12px;
  font-weight: 600;
  margin-top: 1px;
}

.chat-feed-text {
  color: #1C2B22;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 4px 0 10px;
}

.chat-media-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: #EDF2EF;
  margin: 10px 0 12px;
  border: 1px solid rgba(30, 90, 60, .1);
}

.chat-media-image,
.chat-media-video {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #111;
}

.chat-media-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(40, 160, 80, .11);
  padding-top: 12px;
  margin-top: 4px;
}

.chat-action-btn {
  min-height: 40px;
  border: 1px solid rgba(40, 160, 80, .16);
  border-radius: 12px;
  background: linear-gradient(180deg, #FFFFFF, #F3FFF7);
  color: #26583B;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 13px;
  box-shadow: 0 6px 14px rgba(18, 105, 56, .06);
  transition: transform .12s, border-color .16s, box-shadow .16s, background .16s;
}

.chat-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(42, 180, 92, .42);
  box-shadow: 0 10px 20px rgba(18, 105, 56, .1);
}

.chat-action-btn.is-active {
  background: linear-gradient(180deg, #E9FFF1, #D8FBE4);
  border-color: #4ACF70;
  color: #16713A;
}

.chat-comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.chat-comments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-comment {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: #F3FBF6;
  border: 1px solid rgba(39, 153, 81, .08);
  border-radius: 12px;
}

.chat-comment-nick {
  color: #176437;
  font-size: 12px;
  font-weight: 900;
}

.chat-comment-text {
  color: #26342A;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.chat-comment-time {
  color: #9AA8A0;
  font-size: 10px;
  margin-left: auto;
}

.chat-comment-row {
  display: flex;
  gap: 7px;
}

.chat-comment-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid rgba(40, 160, 80, .28);
  border-radius: 12px;
  color: #1F2C24;
  font-family: inherit;
  font-size: 13px;
  padding: 11px 12px;
  outline: none;
}

.chat-comment-input:focus {
  border-color: #3DAA60;
}

.chat-comment-input.chat-input-error {
  border-color: #DD3300;
  animation: chatShake .3s;
}

.chat-comment-send {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #22A754, #36C86B);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 0 14px;
  box-shadow: 0 8px 16px rgba(31, 154, 76, .2);
}

.chat-folder-overlay {
  padding: 18px;
  align-items: stretch;
}

.chat-folder-dialog {
  width: min(980px, 96vw);
  max-height: min(760px, 92dvh);
  display: flex;
  flex-direction: column;
  margin: auto;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,255,251,.98)),
    #fff;
  border: 1px solid rgba(54, 184, 103, .24);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  overflow: hidden;
}

.chat-folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(42, 160, 86, .14);
  background: linear-gradient(115deg, #E8FFF0, #FFF4D8);
}

.chat-folder-title {
  color: #0B4D2A;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.15;
}

.chat-folder-sub {
  margin-top: 3px;
  color: #678074;
  font-size: 12px;
  font-weight: 700;
}

.chat-folder-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: #1D5C37;
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(22, 104, 58, .1);
}

.chat-folder-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  padding: 14px;
}

.chat-folder-item {
  overflow: hidden;
  border: 1px solid rgba(42, 160, 86, .16);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 104, 58, .09);
}

.chat-folder-media {
  height: 190px;
  background: #111;
}

.chat-folder-media img,
.chat-folder-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.chat-folder-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}

.chat-folder-info strong {
  color: #0B4D2A;
  font-size: 14px;
  font-weight: 900;
}

.chat-folder-info span {
  color: #7E9088;
  font-size: 11px;
  font-weight: 700;
}

.chat-folder-info p {
  margin: 2px 0 0;
  color: #24352A;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.chat-folder-empty {
  grid-column: 1 / -1;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  color: #61786D;
  border: 1.5px dashed rgba(42, 160, 86, .24);
  border-radius: 16px;
  background: #F8FFF9;
}

.chat-folder-empty div {
  font-size: 44px;
}

.chat-folder-empty strong {
  color: #0B4D2A;
  font-size: 17px;
}

.chat-folder-empty span {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-folder-screen {
  width: min(1220px, 100%);
  max-width: 1220px;
  padding-inline: clamp(10px, 2.2vw, 28px);
}

.chat-folder-full-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 calc(clamp(10px, 2.2vw, 28px) * -1) 16px;
  padding: 16px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid rgba(43, 163, 90, .2);
  background: linear-gradient(115deg, #E8FFF0, #FFF4D8);
  box-shadow: 0 16px 36px rgba(22, 104, 58, .1);
}

.chat-folder-back {
  min-height: 42px;
  padding: 9px 15px;
  border: 1.5px solid rgba(42, 160, 86, .34);
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  color: #0B4D2A;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(22, 104, 58, .1);
}

.chat-folder-full-title {
  min-width: 0;
}

.chat-folder-grid--full {
  flex: 1;
  min-height: 0;
  padding: 0 0 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (max-width: 620px) {
  .chat-global-wrap {
    padding-inline: 8px;
  }

  .chat-global-header {
    align-items: flex-start;
    margin-inline: -8px;
    padding: 13px 12px 15px;
  }

  .chat-global-header .chat-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 26px;
  }

  .chat-global-header .chat-header-title {
    font-size: 17px;
  }

  .chat-global-header .chat-header-sub {
    font-size: 12px;
  }

  .chat-header-chips {
    gap: 5px;
    margin-top: 8px;
  }

  .chat-header-chips span {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 10px;
  }

  .chat-nick-btn {
    padding: 6px 9px;
    font-size: 12px;
    max-width: 124px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-composer {
    margin: 10px 0 8px;
    padding: 11px;
    border-radius: 14px;
  }

  .chat-composer-title {
    flex-basis: 100%;
    min-width: 0;
  }

  .chat-composer-title strong {
    font-size: 15px;
  }

  .chat-mode-tabs {
    flex: 1 1 auto;
  }

  .chat-mode-tab {
    flex: 1;
    padding: 9px 10px;
    font-size: 13px;
  }

  .chat-global-textarea {
    min-height: 86px;
  }

  .chat-composer-actions {
    flex-wrap: wrap;
  }

  .chat-upload-btn,
  .chat-global-send {
    flex: 1 1 132px;
  }

  .chat-media-rule {
    flex-basis: 100%;
    order: 3;
  }

  .chat-feed {
    padding: 0 0 12px;
    gap: 10px;
  }

  .chat-feed-item {
    border-radius: 14px;
    padding: 12px;
  }

  .chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .chat-feed-text {
    font-size: 15px;
  }

  .chat-actions {
    gap: 6px;
  }

  .chat-action-btn {
    flex: 1;
    padding: 7px 6px;
    font-size: 12px;
  }

  .chat-media-image,
  .chat-media-video {
    max-height: 260px;
  }

  .chat-folder-overlay {
    padding: 8px;
  }

  .chat-folder-dialog {
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .chat-folder-head {
    padding: 12px;
  }

  .chat-folder-title {
    font-size: 17px;
  }

  .chat-folder-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .chat-folder-media {
    height: 220px;
  }

  .chat-folder-screen {
    padding-inline: 8px;
  }

  .chat-folder-full-head {
    margin-inline: -8px;
    padding: 12px;
    gap: 9px;
  }

  .chat-folder-back {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 13px;
  }

  .chat-folder-grid--full {
    grid-template-columns: 1fr;
    padding-bottom: 12px;
  }
}

/* Premium */
.tile-premium {
  background: linear-gradient(135deg, #FFE48A 0%, #FFB36C 52%, #F58FC4 100%);
  box-shadow: 0 12px 28px rgba(175, 92, 28, .24);
}

.premium-wrap {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto 32px;
  color: #3d2916;
}

.premium-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .75fr);
  gap: 18px;
  align-items: stretch;
  margin: 10px 0 18px;
}

.premium-hero-copy,
.premium-price-card,
.premium-panel {
  border: 1px solid rgba(133, 75, 25, .14);
  background: rgba(255, 250, 240, .88);
  box-shadow: 0 12px 30px rgba(117, 69, 20, .12);
  border-radius: 8px;
}

.premium-block-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: block;
  margin-bottom: 12px;
}

/* ===== Екран-замок Premium (для довідників) ===== */
.premium-lock-screen { display: flex; justify-content: center; padding: 30px 16px; }
.premium-lock-card {
  max-width: 460px;
  text-align: center;
  background: linear-gradient(160deg, #fff7e0, #ffe6c4);
  border: 2px solid #f0c070;
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(150, 90, 20, 0.18);
}
.premium-lock-crown { font-size: 56px; line-height: 1; margin-bottom: 10px; }
.premium-lock-title { margin: 0 0 8px; font-size: 1.5rem; font-weight: 900; color: #7a4a00; }
.premium-lock-text { margin: 0 0 18px; color: #6b5740; line-height: 1.5; font-size: 1rem; }
.premium-lock-btn {
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #f0a020, #c87010);
  box-shadow: 0 6px 16px rgba(200, 112, 16, 0.35);
  transition: transform .14s ease, filter .14s ease;
}
.premium-lock-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* Замок Premium на картці їжі */
.fd-card-lock--premium {
  background: linear-gradient(160deg, rgba(255,240,200,0.97), rgba(255,224,178,0.97));
}
.fd-card-lock-btn {
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #f0a020, #c87010);
  box-shadow: 0 3px 10px rgba(200, 112, 16, 0.3);
}
.fd-card-lock-btn:hover { filter: brightness(1.06); }

/* Прострочене оголошення у «Мої оголошення» */
.mk-my-row--expired { opacity: 0.72; background: #fff4e6; }

/* Замок Premium на картках порід */
.br-card-lock--premium {
    background: linear-gradient(160deg, rgba(255,240,200,0.97), rgba(255,224,178,0.97));
}
.br-card-lock-btn {
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #f0a020, #c87010);
    box-shadow: 0 3px 10px rgba(200, 112, 16, 0.3);
}
.br-card-lock-btn:hover { filter: brightness(1.06); }
.br-chip-lock-premium { margin-left: 4px; }

/* Замок Premium на картках хвороб */
.dis-card--locked { position: relative; overflow: hidden; }
.dis-card-lock {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(160deg, rgba(255,244,225,0.93), rgba(255,228,192,0.95));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 10px;
}
.dis-card-lock-icon { font-size: 30px; line-height: 1; }
.dis-card-lock-title { font-weight: 800; color: #7a4a00; }
.dis-card-lock-btn {
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #f0a020, #c87010);
    box-shadow: 0 3px 10px rgba(200, 112, 16, 0.3);
}
.dis-card-lock-btn:hover { filter: brightness(1.06); }

/* Блок «помилки рівня» у головоломках */
.pz-mistakes {
    margin: 14px auto 4px;
    max-width: 460px;
    text-align: left;
    background: #fff4f3;
    border: 1.5px solid #f3c0bb;
    border-radius: 14px;
    padding: 12px 14px;
}
.pz-mistakes-head { font-weight: 800; color: #b03a2e; margin-bottom: 8px; }
.pz-mistakes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pz-mistakes-list li { display: flex; flex-direction: column; gap: 2px; background: #fff; border-radius: 10px; padding: 8px 10px; }
.pz-mistakes-list li strong { color: #7a2b22; font-size: 0.95rem; }
.pz-mistakes-list li span { color: #5a5a5a; font-size: 0.85rem; line-height: 1.4; }
.pz-mistakes--none {
    margin: 14px auto 4px;
    max-width: 460px;
    background: #e9f9ef;
    border: 1.5px solid #8fd6a8;
    border-radius: 14px;
    padding: 12px 14px;
    color: #2e7d46;
    font-weight: 700;
    text-align: center;
}

/* Адмінка: користувачі (преміум / звичайні) */
.admin-users-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.admin-stat-chip { background: #eef0f8; border: 1px solid #cdd2e0; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; color: #334; }
.admin-stat-chip--prem { background: #fff3da; border-color: #f0c878; color: #8a5a00; }
.admin-users-group { margin-bottom: 14px; }
.admin-users-group-title { font-weight: 800; margin: 6px 0 8px; color: #3a3a4a; }
.admin-premium-tag { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #f0a020, #c87010); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.admin-loaded-note { font-size: 12px; color: #8a90a6; margin: 0 0 10px; }
.admin-load-more { display: block; width: 100%; margin-top: 10px; padding: 10px 16px; border: 1px solid #cdd2e0; border-radius: 12px; background: #f4f6fc; color: #334; font-weight: 700; font-size: 14px; cursor: pointer; transition: background 0.14s; }
.admin-load-more:hover { background: #e8ecf8; }
.admin-load-more:disabled { opacity: 0.6; cursor: default; }

/* Статус акаунта в «Кімнаті свинки» */
.pig-room-plan {
    display: inline-block;
    margin: 4px 0 8px;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    color: #2a3a4a;
    background: rgba(255, 255, 255, 0.82);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}
.pig-room-plan--premium {
    color: #fff;
    background: linear-gradient(135deg, #f0a020, #c87010);
    border-color: #f6cf88;
    box-shadow: 0 2px 8px rgba(200, 112, 16, 0.35);
}

/* Екран Premium: ціна + список переваг */
.premium-price-big { font-size: 2.6rem; font-weight: 900; color: #c87010; line-height: 1; margin: 6px 0 2px; }
.premium-price-big span { font-size: 1rem; font-weight: 700; color: #8a6a40; }
.premium-price-base { font-size: 13px; color: #8a7a60; margin-bottom: 12px; }
.premium-cur-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: #6b5740; }
.premium-cur-row select { flex: 1; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #e0c79a; background: #fff; font-weight: 700; }
.premium-benefits-head { text-align: center; font-size: 1.4rem; font-weight: 900; color: #7a4a00; margin: 22px 0 14px; }
.premium-benefits { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.premium-benefit { display: flex; align-items: flex-start; gap: 12px; background: linear-gradient(135deg, #fffaf0, #fff2dc); border: 1.5px solid #f0d9a8; border-radius: 16px; padding: 14px 16px; box-shadow: 0 3px 10px rgba(160, 110, 30, 0.08); }
.premium-benefit-emoji { font-size: 26px; flex-shrink: 0; line-height: 1; }
.premium-benefit-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.premium-benefit-text strong { color: #5a3a10; font-size: 1rem; }
.premium-benefit-text span { color: #7a6852; font-size: 0.85rem; line-height: 1.4; }
.premium-benefit-check { color: #fff; background: #4caf6e; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; flex-shrink: 0; }
.premium-hero-copy {
  padding: 24px;
  min-height: 230px;
  background:
    linear-gradient(135deg, rgba(255,248,220,.94), rgba(255,231,187,.9)),
    radial-gradient(circle at 85% 20%, rgba(255,111,145,.22), transparent 34%);
}

.premium-kicker {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(142, 84, 20, .12);
  color: #8a4e14;
  font-weight: 800;
  font-size: 13px;
}

.premium-hero h2 {
  margin: 14px 0 10px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
  color: #613407;
}

.premium-hero p {
  margin: 0;
  max-width: 660px;
  font-size: 16px;
  line-height: 1.55;
  color: #684b2c;
}

.premium-status {
  margin-top: 18px;
  font-size: 15px;
}

.premium-price-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.premium-price-label {
  color: #815017;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

.premium-price {
  font-size: 30px;
  font-weight: 900;
  color: #6c3908;
}

.premium-price-sub {
  color: #765637;
  font-size: 14px;
  margin-bottom: 4px;
}

.premium-primary,
.premium-secondary,
.premium-link {
  min-height: 42px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
}

.premium-primary {
  background: #8B4A16;
  color: #fff;
  box-shadow: 0 8px 18px rgba(139, 74, 22, .22);
}

.premium-secondary {
  background: #FFF2CF;
  color: #6E430F;
  border: 1px solid rgba(139, 74, 22, .22);
}

.premium-link {
  background: transparent;
  color: #79502A;
  text-decoration: underline;
}

.premium-msg {
  min-height: 18px;
  color: #6e5131;
  font-size: 13px;
}

.premium-msg.warn {
  color: #9a3d18;
}

.premium-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.premium-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.premium-access-card {
  padding: 16px;
  border-radius: 8px;
  background: #F7FFF3;
  border: 1px solid rgba(75, 132, 59, .18);
  color: #345129;
}

.premium-access-card--premium {
  background: #FFF5D7;
  border-color: rgba(155, 99, 13, .22);
  color: #5f3b09;
}

.premium-access-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.premium-access-card ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.55;
}

.premium-feature {
  min-height: 86px;
  padding: 14px;
  border-radius: 8px;
  background: #FFF9ED;
  border: 1px solid rgba(135, 82, 25, .12);
}

.premium-feature strong,
.premium-feature span {
  display: block;
}

.premium-feature strong {
  color: #5d3509;
  margin-bottom: 6px;
}

.premium-feature span {
  color: #6d5438;
  font-size: 14px;
  line-height: 1.35;
}

.premium-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.premium-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(133, 75, 25, .16);
  background: #FFF8E8;
  color: #694013;
  font-weight: 800;
  cursor: pointer;
}

.premium-tabs button.active {
  background: #7D4313;
  color: #fff;
}

.premium-panel {
  padding: 18px;
}

.premium-panel h3 {
  margin: 0 0 14px;
  font-size: 22px;
  color: #5e350b;
}

.premium-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.premium-lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #FFF0B8;
  border: 1px solid rgba(170, 106, 0, .22);
  color: #62400a;
}

.premium-lock-banner span {
  font-size: 14px;
}

.premium-locked-panel {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.premium-locked-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #FFF0B8;
  color: #6a4309;
  font-size: 27px;
}

.premium-locked-panel p {
  margin: 0;
  max-width: 620px;
  color: #664d31;
  line-height: 1.5;
}

.premium-locked-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 4px;
}

.premium-locked-list span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #FFF8E6;
  border: 1px solid rgba(139, 74, 22, .14);
  color: #684315;
  font-weight: 700;
  font-size: 13px;
}

.premium-checklist {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.premium-check {
  min-height: 76px;
  padding: 12px;
  border-radius: 8px;
  background: #F6FFF4;
  border: 1px solid rgba(63, 133, 59, .18);
  display: flex;
  gap: 10px;
  align-items: center;
  color: #34542b;
  font-weight: 800;
}

.premium-check input {
  width: 18px;
  height: 18px;
}

.premium-progress-note,
.premium-shopping {
  margin-top: 14px;
  color: #6f5535;
  line-height: 1.45;
}

.premium-profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.premium-profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #F7FBFF;
  border: 1px solid rgba(61, 118, 164, .14);
}

.premium-profile textarea,
.premium-profile .premium-remove-profile {
  grid-column: 1 / -1;
}

.premium-profile input,
.premium-profile select,
.premium-profile textarea,
.premium-diary-form input,
.premium-diary-form select {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(121, 86, 43, .22);
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  color: #3d2916;
}

.premium-profile textarea {
  min-height: 74px;
  resize: vertical;
}

.premium-remove-profile {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(178, 45, 35, .28);
  background: #FFF0ED;
  color: #982a1f;
  font-weight: 800;
  cursor: pointer;
}

.premium-week-menu,
.premium-game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.premium-day,
.premium-game-grid > div,
.premium-diary-entry,
.premium-empty {
  padding: 12px;
  border-radius: 8px;
  background: #FFF9F0;
  border: 1px solid rgba(133, 75, 25, .12);
}

.premium-day strong,
.premium-day span,
.premium-day small,
.premium-game-grid strong,
.premium-game-grid span,
.premium-diary-entry strong,
.premium-diary-entry span,
.premium-diary-entry small {
  display: block;
}

.premium-day span,
.premium-game-grid span,
.premium-diary-entry span {
  margin-top: 5px;
  color: #5f472d;
}

.premium-day small,
.premium-diary-entry small {
  margin-top: 6px;
  color: #8a6b47;
}

.premium-diary-form {
  display: grid;
  grid-template-columns: 110px minmax(150px, 1fr) minmax(150px, 1fr) minmax(160px, 1.2fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.premium-diary-list {
  display: grid;
  gap: 8px;
}

@media (max-width: 820px) {
  .premium-hero,
  .premium-profile-list {
    grid-template-columns: 1fr;
  }

  .premium-features,
  .premium-access-grid,
  .premium-checklist,
  .premium-week-menu,
  .premium-game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .premium-diary-form {
    grid-template-columns: 1fr;
  }

  .premium-hero h2 {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .premium-wrap {
    width: min(100%, calc(100vw - 18px));
  }

  .premium-hero-copy,
  .premium-price-card,
  .premium-panel {
    padding: 14px;
  }

  .premium-features,
  .premium-access-grid,
  .premium-checklist,
  .premium-week-menu,
  .premium-game-grid,
  .premium-profile {
    grid-template-columns: 1fr;
  }

  .premium-lock-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ================================================================
   Головний екран: затишний pet-care хаб + міні-пригода
   ================================================================ */
body.in-menu {
  background: #fff4e4;
}

.main-menu {
  padding: clamp(10px, 2vh, 20px) clamp(14px, 3vw, 32px) 30px;
  background:
    radial-gradient(circle at 12% 14%, rgba(120, 190, 255, 0.28), transparent 24%),
    radial-gradient(circle at 86% 22%, rgba(150, 215, 255, 0.28), transparent 20%),
    linear-gradient(135deg, #eaf6ff 0%, #c9e6ff 48%, #eef7ff 100%);
}

.main-menu::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    radial-gradient(circle at 12px 12px, #b68562 0 2px, transparent 2.4px),
    radial-gradient(circle at 24px 18px, #b68562 0 1.7px, transparent 2.1px),
    radial-gradient(circle at 30px 10px, #b68562 0 1.5px, transparent 2px);
  background-size: 170px 140px;
  mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
}

.menu-content {
  max-width: 780px;
  gap: 7px;
}

.menu-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  width: 100%;
  min-height: 116px;
  padding: 14px 20px 14px 26px;
  border: 1px solid rgba(187, 128, 59, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 253, 244, 0.94), rgba(255, 237, 203, 0.84)),
    linear-gradient(135deg, #fffaf0, #ffe3bd);
  box-shadow: 0 18px 44px rgba(130, 73, 26, 0.12);
  overflow: hidden;
}

.menu-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 56px;
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(206, 159, 83, 0.22) 6% 8%, transparent 8% 16%) 0 0 / 130px 100%,
    linear-gradient(180deg, rgba(238, 205, 143, 0), rgba(216, 168, 96, 0.36));
}

.menu-hero-copy {
  position: relative;
  z-index: 1;
}

.menu-kicker {
  width: fit-content;
  margin-bottom: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f3ead3;
  color: #7b4c24;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.main-menu-title {
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 0.98;
  letter-spacing: 0;
  text-align: left;
  color: #603204;
  text-shadow: 0 2px 0 #ffd78e;
}

.main-menu-sub {
  margin-top: 8px;
  color: #9a5a24;
  text-align: left;
  font-weight: 650;
}

.menu-hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
}

.hero-window {
  position: relative;
  width: 164px;
  height: 96px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(183, 229, 248, 0.86), rgba(249, 246, 214, 0.86) 58%, #ddb980 59%);
  border: 2px solid rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 -16px 0 rgba(169, 115, 57, 0.18), 0 14px 30px rgba(126, 70, 28, 0.18);
  overflow: hidden;
}

.hero-window .menu-title-pig-img {
  position: absolute;
  right: 42px;
  bottom: 22px;
  width: 62px;
  height: 62px;
  margin: 0;
  border: 3px solid #fff7df;
  box-shadow: 0 8px 18px rgba(73, 38, 14, 0.2);
}

.hero-hay {
  position: absolute;
  left: 18px;
  right: 14px;
  bottom: 12px;
  height: 22px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(15deg, #d69d44 0 3px, #edc66c 3px 6px);
  opacity: 0.95;
}

.hero-food,
.hero-food::before,
.hero-food::after {
  position: absolute;
  content: "";
  display: block;
}

.hero-food--carrot {
  right: 18px;
  bottom: 25px;
  width: 34px;
  height: 13px;
  border-radius: 10px 3px 3px 10px;
  background: #f77f2f;
  transform: rotate(-18deg);
}

.hero-food--carrot::before {
  right: -8px;
  top: -5px;
  width: 13px;
  height: 13px;
  border-radius: 2px 10px 2px 10px;
  background: #69aa48;
}

.hero-food--leaf {
  left: 28px;
  bottom: 34px;
  width: 34px;
  height: 18px;
  border-radius: 50% 8px 50% 8px;
  background: #6fbd72;
  transform: rotate(22deg);
}

.daily-fact {
  max-width: 750px;
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.92);
  box-shadow: 0 8px 22px rgba(130, 73, 26, 0.08);
}

.main-menu-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  max-width: 680px;
  margin-inline: auto;
}

.main-menu-tile {
  position: relative;
  min-height: 78px;
  justify-content: center;
  gap: 4px;
  padding: 8px 8px 7px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(99, 58, 24, 0.1);
}

.main-menu-tile::after {
  content: "";
  position: absolute;
  inset: auto -24px -34px auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.main-menu-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(99, 58, 24, 0.16);
}

.tile-gallery,
.tile-about {
  background: linear-gradient(135deg, #dff4ff, #aedaef);
}

.tile-dresser,
.tile-chat {
  background: linear-gradient(135deg, #dff9e8, #a8e7c3);
}

.tile-puzzles,
.tile-pig-room {
  background: linear-gradient(135deg, #ffe9a8, #ffc96f);
}

.tile-guide-male {
  background: linear-gradient(135deg, #dceeff, #99ccef);
}

.tile-guide-female {
  background: linear-gradient(135deg, #ffe0ef, #f4a5c9);
}

.tile-guide-pair {
  background: linear-gradient(135deg, #eadfff, #cfa5e8);
}

.tile-diseases {
  background: linear-gradient(135deg, #ffe0df, #ffa7a5);
}

.tile-prices,
.tile-premium {
  background: linear-gradient(135deg, #ffe3a1, #ffa477);
}

.tile-market {
  background: linear-gradient(135deg, #d9f8ff, #7bded2);
}

.tile-account {
  background: linear-gradient(135deg, #f2e4ff, #b9d7ff);
}

.tile-survey {
  background: linear-gradient(135deg, #fff2c8, #ffb7d5);
}

.tile-admin {
  background: linear-gradient(135deg, #ffe7e7, #ffb36f);
}

.tile-icon {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 -2px 0 rgba(87, 55, 29, 0.09), 0 4px 10px rgba(71, 42, 18, 0.12);
}

.tile-icon::before,
.tile-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.tile-label,
.tile-desc {
  position: relative;
  z-index: 1;
}

.tile-label {
  font-size: 11px;
  line-height: 1.16;
  color: #2c251f;
}

.tile-desc {
  max-width: 132px;
  font-size: 8px;
  line-height: 1.18;
  color: rgba(44, 37, 31, 0.68);
}

.tile-pig-img {
  width: 22px;
  height: 22px;
}

.tile-image {
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #fff;
  border: none;
  box-shadow: 0 8px 22px rgba(99, 58, 24, 0.1);
}

.tile-image::after {
  display: none;
}

.tile-full-img {
  display: block;
  width: 100%;
  /* Показуємо лише ілюстрацію — нижню текстову смугу картинки обрізаємо */
  aspect-ratio: 1 / 0.78;
  height: auto;
  object-fit: cover;
  object-position: top center;
  border-radius: 0;
  image-rendering: auto;
  z-index: 0;
}

/* Чіткий HTML-підпис під плиткою */
.tile-cap {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  padding: 5px 4px 7px;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: 0.005em;
  color: #2c1d0f;
  text-align: center;
  background: #fff;
  z-index: 1;
}

.tile-admin .tile-cap,
.tile-premium .tile-cap,
.tile-prices .tile-cap {
  color: #d9781a;
}

@media (max-width: 520px) {
  .tile-cap { font-size: 11.5px; padding: 4px 3px 6px; }
}

.tile-icon-food::before {
  left: 11px;
  top: 18px;
  width: 24px;
  height: 9px;
  border-radius: 999px 999px 5px 5px;
  background: #72b968;
  box-shadow: inset 0 -3px 0 #4c964d;
}

.tile-icon-food::after {
  left: 14px;
  top: 11px;
  width: 18px;
  height: 10px;
  border-radius: 12px 2px 12px 2px;
  background: #ff8c3b;
  transform: rotate(-18deg);
}

.tile-icon-book::before {
  left: 8px;
  top: 10px;
  width: 12px;
  height: 23px;
  border-radius: 3px 1px 1px 3px;
  background: #7fb4ef;
  box-shadow: 14px 0 0 #f4a6c8;
}

.tile-icon-book::after {
  left: 21px;
  top: 10px;
  width: 1px;
  height: 23px;
  background: rgba(80, 55, 50, 0.28);
}

.tile-icon-puzzle::before {
  left: 10px;
  top: 10px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: conic-gradient(from 90deg, #67c587 0 25%, #ffd55f 0 50%, #ef7e9a 0 75%, #75b7e9 0);
}

.tile-icon-puzzle::after {
  left: 17px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 26px 0 rgba(255, 255, 255, 0.82);
}

.tile-icon-male::before,
.tile-icon-female::before,
.tile-icon-pair::before,
.tile-icon-chat::before,
.tile-icon-room::before {
  left: 8px;
  top: 13px;
  width: 23px;
  height: 17px;
  border-radius: 50% 46% 46% 50%;
  background: #9b6a3c;
  box-shadow: inset 9px 0 0 #d7a067;
}

.tile-icon-male::after,
.tile-icon-female::after,
.tile-icon-pair::after {
  right: 5px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4387df;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.tile-icon-female::after {
  background: #df5aa2;
}

.tile-icon-pair::after {
  width: 18px;
  height: 14px;
  border-radius: 50% 50% 45% 45%;
  background: #e95e75;
  transform: rotate(-12deg);
}

.tile-icon-med::before {
  left: 10px;
  top: 16px;
  width: 24px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ee4162 0 50%, #fff1e4 50%);
  transform: rotate(-35deg);
  box-shadow: 0 2px 5px rgba(98, 39, 32, 0.16);
}

.tile-icon-med::after {
  left: 20px;
  top: 14px;
  width: 2px;
  height: 16px;
  background: rgba(91, 54, 48, 0.22);
  transform: rotate(-35deg);
}

.tile-icon-price::before {
  left: 12px;
  top: 10px;
  width: 18px;
  height: 22px;
  border-radius: 50% 50% 43% 43%;
  background: #d89a32;
}

.tile-icon-price::after {
  left: 19px;
  top: 13px;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: #fff3bd;
  box-shadow: -4px 4px 0 -1px #fff3bd, 4px -4px 0 -1px #fff3bd;
}

.tile-icon-market::before {
  left: 9px;
  top: 12px;
  width: 22px;
  height: 15px;
  border-radius: 4px 4px 7px 7px;
  background: #24a87d;
  box-shadow: inset 0 -4px 0 rgba(255,255,255,.22);
}

.tile-icon-market::after {
  left: 13px;
  top: 8px;
  width: 14px;
  height: 10px;
  border: 3px solid #f5b544;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.tile-icon-account::before {
  left: 14px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5c8de8;
}

.tile-icon-account::after {
  left: 9px;
  top: 22px;
  width: 24px;
  height: 13px;
  border-radius: 14px 14px 5px 5px;
  background: #5c8de8;
}

.tile-icon-admin::before {
  left: 10px;
  top: 8px;
  width: 22px;
  height: 25px;
  border-radius: 12px 12px 8px 8px;
  background: #d46936;
  clip-path: polygon(50% 0, 100% 18%, 88% 78%, 50% 100%, 12% 78%, 0 18%);
}

.tile-icon-admin::after {
  left: 18px;
  top: 15px;
  width: 7px;
  height: 12px;
  border-radius: 4px;
  background: #fff3d5;
}

.tile-icon-info::before {
  left: 18px;
  top: 16px;
  width: 6px;
  height: 17px;
  border-radius: 4px;
  background: #5e94d8;
}

.tile-icon-info::after {
  left: 18px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5e94d8;
}

.tile-icon-room::after {
  left: 8px;
  top: 10px;
  width: 26px;
  height: 22px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 0 38%, #b67345 38% 62%, transparent 62%),
    linear-gradient(#f0c076, #d89152);
  clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%);
}

.tile-icon-chat::after {
  right: 6px;
  top: 7px;
  width: 18px;
  height: 13px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(90, 55, 35, 0.12);
}

.tile-icon-premium::before {
  left: 10px;
  top: 14px;
  width: 22px;
  height: 15px;
  border-radius: 3px 3px 6px 6px;
  background: #e5a82e;
  clip-path: polygon(0 100%, 0 35%, 22% 65%, 50% 0, 78% 65%, 100% 35%, 100% 100%);
}

.tile-icon-premium::after {
  left: 14px;
  top: 30px;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: #fff2b0;
}

.game-launch-section {
  max-width: 980px;
  margin-top: 8px;
}

.game-section-label,
.ach-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6f3bc5;
  letter-spacing: 0.8px;
}

.section-mark {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #ede3ff;
  box-shadow: inset 0 -2px 0 rgba(82, 40, 145, 0.12);
}

.section-mark-game::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  width: 12px;
  height: 7px;
  border-radius: 4px;
  background: #6f3bc5;
}

.section-mark-game::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffcf55;
  box-shadow: 7px 4px 0 #ffcf55;
}

.section-mark-ach::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 5px;
  width: 10px;
  height: 13px;
  border-radius: 50% 50% 45% 45%;
  background: #f4b83d;
  box-shadow: inset 0 0 0 3px #ffe8a4;
}

.game-launch-card {
  min-height: 112px;
  padding: 12px 18px 12px 152px;
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(60, 35, 110, 0.94), rgba(22, 67, 96, 0.96)),
    linear-gradient(135deg, #3b0764, #12324b);
  border-color: rgba(255, 223, 147, 0.25);
  box-shadow: 0 15px 38px rgba(111, 59, 197, 0.25), 0 5px 20px rgba(99, 58, 24, 0.12);
}

.game-launch-scene {
  position: absolute;
  left: 16px;
  top: 14px;
  width: 116px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(180deg, #8ed0f1 0 58%, #67b96d 59%);
  border: 2px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  z-index: 1;
}

.game-launch-scene img {
  position: absolute;
  left: 18px;
  bottom: 21px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff8df;
  object-fit: cover;
  animation: gamePigBob 1.2s ease-in-out infinite;
}

.scene-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 8px;
  background: #78502f;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14);
}

.scene-carrot {
  position: absolute;
  right: 26px;
  top: 29px;
  width: 22px;
  height: 8px;
  border-radius: 999px 3px 3px 999px;
  background: #ff8a35;
  transform: rotate(-20deg);
}

.scene-carrot::after {
  content: "";
  position: absolute;
  right: -6px;
  top: -5px;
  width: 11px;
  height: 11px;
  border-radius: 2px 8px;
  background: #69bb5c;
}

.scene-block {
  position: absolute;
  right: 16px;
  bottom: 26px;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #e0a062;
  box-shadow: inset 0 -3px 0 rgba(92, 52, 25, 0.18);
}

@keyframes gamePigBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.game-launch-decor span {
  width: 24px;
  height: 24px;
}

.game-launch-title {
  font-size: clamp(19px, 2.4vw, 26px);
}

.game-launch-sub {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.74);
}

.game-launch-play-icon {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.ach-section {
  max-width: 800px;
  margin-top: 2px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.86), rgba(239, 232, 255, 0.88)),
    #f4efff;
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.1);
}

.ach-bar {
  min-height: 36px;
}

.ach-badge {
  border-radius: 8px;
}

.ach-bar-empty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ach-bar-empty::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, #ffe89c 0 5px, transparent 5.5px),
    linear-gradient(135deg, #f4b83d, #c88225);
  box-shadow: inset 0 -3px 0 rgba(80, 48, 16, 0.15);
}

.decor-carrot,
.decor-leaf,
.decor-star,
.decor-paw,
.decor-flower,
.decor-broccoli,
.decor-heart,
.decor-cucumber,
.decor-sprout,
.decor-ribbon,
.decor-key {
  width: 34px;
  height: 34px;
}

.decor-carrot {
  border-radius: 999px 6px 6px 999px;
  background: #f58a35;
  transform: rotate(-25deg);
}

.decor-carrot::after,
.decor-leaf::after,
.decor-star::after,
.decor-paw::after,
.decor-flower::after,
.decor-broccoli::after,
.decor-heart::after,
.decor-cucumber::after,
.decor-sprout::after,
.decor-ribbon::after,
.decor-key::after {
  content: "";
  position: absolute;
  display: block;
}

.decor-carrot::after {
  right: -9px;
  top: -7px;
  width: 16px;
  height: 16px;
  border-radius: 3px 12px;
  background: #64aa4c;
}

.decor-leaf,
.decor-cucumber {
  border-radius: 50% 8px 50% 8px;
  background: #75b66f;
  transform: rotate(28deg);
}

.decor-star {
  background: #ffd66b;
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 34%);
}

.decor-paw {
  background:
    radial-gradient(circle at 50% 72%, #9b7460 0 8px, transparent 9px),
    radial-gradient(circle at 24% 40%, #9b7460 0 4px, transparent 5px),
    radial-gradient(circle at 50% 28%, #9b7460 0 4px, transparent 5px),
    radial-gradient(circle at 76% 40%, #9b7460 0 4px, transparent 5px);
}

.decor-flower,
.decor-broccoli {
  background:
    radial-gradient(circle at 50% 50%, #f6b6ca 0 7px, transparent 8px),
    radial-gradient(circle at 35% 34%, #ffd8e5 0 7px, transparent 8px),
    radial-gradient(circle at 66% 34%, #ffd8e5 0 7px, transparent 8px),
    radial-gradient(circle at 35% 66%, #ffd8e5 0 7px, transparent 8px),
    radial-gradient(circle at 66% 66%, #ffd8e5 0 7px, transparent 8px);
}

.decor-broccoli {
  background:
    radial-gradient(circle at 50% 40%, #6bbf65 0 9px, transparent 10px),
    radial-gradient(circle at 35% 52%, #80cf78 0 9px, transparent 10px),
    radial-gradient(circle at 65% 52%, #80cf78 0 9px, transparent 10px);
}

.decor-heart {
  background: #ef7185;
  clip-path: polygon(50% 90%, 12% 52%, 8% 28%, 26% 12%, 50% 30%, 74% 12%, 92% 28%, 88% 52%);
}

.decor-sprout {
  background:
    linear-gradient(#6cad62, #6cad62) 50% 55% / 3px 22px no-repeat,
    radial-gradient(ellipse at 38% 40%, #86cf77 0 9px, transparent 10px),
    radial-gradient(ellipse at 62% 35%, #86cf77 0 9px, transparent 10px);
}

.decor-ribbon {
  background:
    linear-gradient(#e984b9, #e984b9) 45% 0 / 9px 34px no-repeat,
    linear-gradient(#e984b9, #e984b9) 0 45% / 34px 9px no-repeat;
  border-radius: 50%;
}

.decor-key {
  background:
    radial-gradient(circle at 28% 42%, transparent 0 5px, #e8c24a 5.5px 10px, transparent 10.5px),
    linear-gradient(#e8c24a, #e8c24a) 42% 43% / 22px 6px no-repeat;
}

@media (max-width: 820px) {
  .menu-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 18px;
  }

  .menu-hero-art {
    display: none;
  }

  .main-menu-title,
  .main-menu-sub {
    text-align: center;
  }

  .menu-kicker {
    margin-left: auto;
    margin-right: auto;
  }

  .main-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-launch-card {
    padding-left: 18px;
  }

  .game-launch-scene {
    display: none;
  }
}

@media (min-width: 821px) and (max-height: 900px) {
  .main-menu {
    padding-top: clamp(6px, 1.2vh, 12px);
    padding-bottom: clamp(8px, 1.4vh, 14px);
    overflow-y: hidden;
  }

  .menu-content {
    gap: clamp(4px, 0.7vh, 7px);
    padding: 0;
  }

  .menu-hero {
    min-height: 0;
    padding: clamp(9px, 1.2vh, 12px) 20px clamp(9px, 1.2vh, 12px) 26px;
  }

  .menu-kicker {
    margin-bottom: 4px;
    padding: 3px 9px;
    font-size: 10px;
  }

  .main-menu-title {
    font-size: clamp(30px, 3.4vw, 42px);
    line-height: 0.94;
  }

  .main-menu-sub {
    margin-top: 5px;
    font-size: clamp(16px, 1.5vw, 19px);
  }

  .hero-window {
    width: 150px;
    height: 82px;
  }

  .hero-window .menu-title-pig-img {
    right: 40px;
    bottom: 18px;
    width: 54px;
    height: 54px;
  }

  .hero-hay {
    bottom: 9px;
    height: 18px;
  }

  .daily-fact {
    padding-block: 7px;
    font-size: 12px;
  }

  .main-menu-grid {
    gap: 6px;
  }

  .main-menu-tile {
    min-height: 66px;
    gap: 2px;
    padding: 6px 8px;
  }

  .tile-icon {
    width: 26px;
    height: 26px;
    transform: scale(0.9);
    transform-origin: center;
  }

  .tile-label {
    font-size: 10px;
    line-height: 1.08;
  }

  .tile-desc {
    font-size: 7px;
    line-height: 1.12;
  }

  .game-launch-section {
    margin-top: 4px;
  }

  .game-section-label,
  .ach-section-title {
    gap: 6px;
    font-size: 13px;
    line-height: 1.15;
  }

  .section-mark {
    width: 18px;
    height: 18px;
    border-radius: 6px;
  }

  .game-launch-card {
    min-height: 84px;
    padding: 10px 16px 10px 124px;
  }

  .game-launch-scene {
    left: 14px;
    top: 10px;
    width: 94px;
    height: 62px;
  }

  .game-launch-scene img {
    width: 30px;
    height: 30px;
  }

  .game-launch-title {
    font-size: clamp(17px, 2vw, 22px);
  }

  .game-launch-sub {
    font-size: 11px;
    line-height: 1.25;
  }

  .game-launch-play-icon {
    width: 34px;
    height: 34px;
  }

  .game-launch-play-label {
    font-size: 11px;
  }

  .ach-section {
    margin-top: 0;
    padding: 8px 10px;
  }

  .ach-bar {
    min-height: 28px;
  }
}

@media (min-width: 821px) and (max-height: 760px) {
  .menu-hero-art,
  .tile-desc,
  .game-launch-sub,
  .ach-section {
    display: none;
  }

  .menu-hero {
    grid-template-columns: 1fr;
    padding-block: 8px;
  }

  .main-menu-title,
  .main-menu-sub {
    text-align: center;
  }

  .menu-kicker {
    margin-left: auto;
    margin-right: auto;
  }

  .main-menu-tile {
    min-height: 54px;
  }

  .game-launch-card {
    min-height: 62px;
  }
}

@media (max-width: 520px) {
  .main-menu {
    padding-inline: 10px;
  }

  .menu-content {
    gap: 8px;
  }

  .main-menu-grid {
    gap: 7px;
  }

  .main-menu-tile {
    min-height: 84px;
    padding: 8px 7px;
  }

  .tile-icon {
    width: 30px;
    height: 30px;
  }

  .tile-label {
    font-size: 10px;
  }

  .tile-desc {
    font-size: 8px;
  }

  .game-launch-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-launch-play {
    align-self: flex-end;
    flex-direction: row;
  }
}

/* ================================================================
   Внутрішній екран: довідник їжі
   ================================================================ */
.fd-module {
  position: relative;
  max-width: 1080px;
  padding: 18px 16px 56px;
}

.fd-module::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    radial-gradient(circle at 18px 18px, #c59a68 0 2px, transparent 2.5px),
    radial-gradient(circle at 32px 26px, #c59a68 0 1.5px, transparent 2px);
  background-size: 160px 130px;
}

.fd-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 18px;
  min-height: 150px;
  margin-bottom: 14px;
  padding: 22px 24px;
  border: 1px solid rgba(190, 137, 71, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 253, 246, 0.96), rgba(255, 235, 201, 0.88)),
    #fff7e9;
  box-shadow: 0 18px 42px rgba(132, 78, 27, 0.12);
  overflow: hidden;
  text-align: left;
}

.fd-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 48px;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(206, 159, 83, 0.2) 7% 8%, transparent 8% 17%) 0 0 / 130px 100%,
    linear-gradient(180deg, rgba(238, 205, 143, 0), rgba(216, 168, 96, 0.26));
}

.fd-hero-copy {
  position: relative;
  z-index: 1;
}

.fd-kicker {
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1e7d1;
  color: #764820;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.fd-header h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: 0;
  text-align: left;
  color: #603204;
  text-shadow: 0 2px 0 #ffd78e;
}

.fd-title-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 -2px 0 rgba(87, 55, 29, 0.09), 0 4px 10px rgba(71, 42, 18, 0.12);
}

.fd-title-mark::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 18px;
  width: 25px;
  height: 11px;
  border-radius: 999px 3px 3px 999px;
  background: #ff8937;
  transform: rotate(-22deg);
}

.fd-title-mark::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 10px;
  width: 14px;
  height: 14px;
  border-radius: 3px 10px;
  background: #6fbd61;
}

.fd-subtitle {
  margin-top: 8px;
  color: #9a5a24;
  font-size: 16px;
  font-weight: 650;
  text-align: left;
}

.fd-quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.fd-quick {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: inset 0 -2px 0 rgba(75, 42, 18, 0.08);
}

.fd-quick--good { background: #dff8cf; color: #245f11; }
.fd-quick--warn { background: #fff0bd; color: #765011; }
.fd-quick--bad { background: #ffd5dc; color: #8a1730; }

.fd-hero-art {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 112px;
  justify-self: end;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(183, 229, 248, 0.86), rgba(249, 246, 214, 0.86) 58%, #ddb980 59%);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 -18px 0 rgba(169, 115, 57, 0.18), 0 14px 30px rgba(126, 70, 28, 0.18);
  overflow: hidden;
}

.fd-hero-art--photo {
  /* квадрат під квадратну іконку — заповнюється повністю, підпис читабельний */
  width: 132px;
  height: 132px;
  background: #fff;
  border: none;
  box-shadow: 0 14px 30px rgba(126, 70, 28, 0.18);
}

.fd-hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

.fd-art-bowl,
.fd-art-carrot,
.fd-art-hay {
  position: absolute;
  display: block;
}

.fd-art-bowl {
  left: 64px;
  bottom: 32px;
  width: 72px;
  height: 38px;
  border-radius: 12px 12px 28px 28px;
  background: linear-gradient(180deg, #fff8e7, #d89f62);
  box-shadow: inset 0 -8px 0 rgba(112, 66, 27, 0.16);
}

.fd-art-bowl::before {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  top: -9px;
  height: 22px;
  border-radius: 50%;
  background: #7cc46b;
  box-shadow: 17px 0 0 #64ad57, -12px 4px 0 #92d27a;
}

.fd-art-carrot {
  right: 26px;
  bottom: 39px;
  width: 42px;
  height: 14px;
  border-radius: 999px 4px 4px 999px;
  background: #ff8736;
  transform: rotate(-18deg);
}

.fd-art-carrot::after {
  content: "";
  position: absolute;
  right: -8px;
  top: -6px;
  width: 14px;
  height: 14px;
  border-radius: 3px 10px;
  background: #66b759;
}

.fd-art-hay {
  left: 20px;
  right: 18px;
  bottom: 14px;
  height: 24px;
  border-radius: 999px;
  background: repeating-linear-gradient(15deg, #d69d44 0 3px, #edc66c 3px 6px);
}

.fd-mode-switcher {
  justify-content: center;
  margin-bottom: 12px;
}

.fd-mode-btn {
  border-radius: 8px;
  border-color: #efc07e;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 14px rgba(116, 69, 22, 0.08);
}

.fd-mode-btn--active {
  background: #ff8b3d;
  border-color: #ff8b3d;
  box-shadow: 0 9px 18px rgba(255, 139, 61, 0.24);
}

.fd-guide-tools {
  position: sticky;
  top: 56px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(199, 151, 88, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  box-shadow: 0 12px 30px rgba(132, 78, 27, 0.1);
}

.fd-search-wrap {
  position: relative;
  display: block;
  margin-bottom: 0;
}

.fd-search-label {
  position: absolute;
  left: 14px;
  top: 7px;
  z-index: 1;
  color: #936027;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.fd-search {
  max-width: none;
  min-height: 54px;
  padding: 23px 16px 8px;
  border-radius: 8px;
  border-color: #e8c28a;
  background: #fffdf8;
}

.fd-filter-bar {
  justify-content: flex-start;
  gap: 7px;
  margin-bottom: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.fd-filter-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 8px;
  border-width: 1px;
  background: #fffdf8;
  box-shadow: inset 0 -2px 0 rgba(83, 47, 17, 0.05);
}

.fd-filter-btn--active {
  background: #ff8b3d;
  color: #fff;
  border-color: #ff8b3d;
}

.fd-stats-bar {
  margin-bottom: 14px;
}

.fd-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: inset 0 -2px 0 rgba(75, 42, 18, 0.08);
}

.fd-stat b {
  font-size: 15px;
}

.fd-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.fd-card {
  position: relative;
  align-items: stretch;
  min-height: 254px;
  padding: 12px;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid rgba(225, 179, 111, 0.5);
  text-align: left;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(99, 58, 24, 0.1);
}

.fd-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: #e0b468;
}

.fd-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -36px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 223, 177, 0.42);
  pointer-events: none;
}

.fd-card--good {
  border-color: rgba(90, 190, 105, 0.38);
}

.fd-card--good::before {
  background: #63bd6d;
}

.fd-card--warn {
  border-color: rgba(232, 178, 68, 0.48);
}

.fd-card--warn::before {
  background: #efbd4f;
}

.fd-card--bad {
  border-color: rgba(224, 85, 110, 0.42);
  background: #fffafa;
}

.fd-card--bad::before {
  background: #e35b75;
}

.fd-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(99, 58, 24, 0.16);
}

.fd-card--locked {
  cursor: default;
}

.fd-card--locked:hover {
  transform: none;
}

.fd-card--locked .fd-card-top-row,
.fd-card--locked .fd-card-main,
.fd-card--locked .fd-card-status,
.fd-card--locked .fd-card-facts,
.fd-card--locked .fd-card-score,
.fd-card--locked .fd-card-more {
  filter: grayscale(.15);
  opacity: .38;
}

.fd-card-top-row,
.fd-card-main,
.fd-card-status,
.fd-card-facts,
.fd-card-score,
.fd-card-more {
  position: relative;
  z-index: 1;
}

.fd-card-top-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  min-height: 26px;
  margin-bottom: 0;
}

.fd-card-num {
  width: auto;
  min-width: 28px;
  height: 24px;
  border-radius: 7px;
  background: #7b4f27;
  font-size: 11px;
  box-shadow: none;
}

.fd-card-cat {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7b4f27;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.fd-card-danger {
  margin-left: auto;
}

.fd-card-main {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.fd-card-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 -2px 0 rgba(87, 55, 29, 0.09), 0 4px 10px rgba(71, 42, 18, 0.12);
  font-size: 31px;
}

.fd-card-name {
  color: #2c251f;
  font-size: 16px;
  line-height: 1.18;
}

.fd-card-season {
  margin-top: 4px;
  color: rgba(44, 37, 31, 0.52);
  font-size: 11px;
}

.fd-card-status {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
}

.fd-card-facts {
  display: grid;
  gap: 7px;
}

.fd-card-facts div {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(123, 79, 39, 0.08);
}

.fd-card-facts span,
.fd-card-score > span {
  display: block;
  margin-bottom: 3px;
  color: rgba(44, 37, 31, 0.52);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.fd-card-facts strong {
  display: -webkit-box;
  overflow: hidden;
  color: #3f2b19;
  font-size: 12px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.fd-card-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fd-card-score > span {
  margin: 0;
}

.fd-card-score > div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.fd-score-meter {
  display: block;
  width: 62px;
  height: 8px;
  border-radius: 999px;
  background: rgba(123, 79, 39, 0.12);
  overflow: hidden;
}

.fd-score-meter span {
  display: block;
  width: calc(var(--score) * 20%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2b23e, #69bd67);
}

.fd-score-text {
  color: #6f4b24;
  font-size: 11px;
  font-weight: 850;
}

.fd-card-more {
  margin-top: auto;
  color: #8a5728;
  font-size: 12px;
  font-weight: 850;
}

.fd-card-more::after {
  content: ">";
  margin-left: 6px;
}

.fd-card-lock {
  position: absolute;
  z-index: 3;
  inset: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  background: rgba(255, 250, 241, .88);
  border: 1px solid rgba(123, 79, 39, .12);
  text-align: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.fd-card-lock-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #7b4f27, #a46a2a);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(80, 45, 16, .2);
}

.fd-card-lock-title {
  max-width: 170px;
  color: #5a371c;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.fd-card-lock-sub {
  color: rgba(44, 37, 31, .58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.fd-card-lock-time {
  min-width: 14ch;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  color: #8a5728;
  font-size: 0;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(123, 79, 39, .08);
  animation: none;
  transition: none;
}

.fd-card-lock-time::before {
  content: attr(data-lock-time);
  font-size: 13px;
}

.fd-empty {
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: 0 8px 22px rgba(99, 58, 24, 0.08);
}

.fd-modal-box {
  border-radius: 8px;
}

.fd-modal-close,
.fd-modal-row,
.fd-modal-tip,
.fd-badge {
  border-radius: 8px;
}

.fd-modal-desc {
  border-radius: 8px;
}

@media (max-width: 900px) {
  .fd-header {
    grid-template-columns: 1fr;
  }

  .fd-hero-art {
    display: none;
  }

  .fd-guide-tools {
    position: static;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .mode-topbar {
    min-height: 56px;
    padding: 8px 10px;
    gap: 8px;
  }

  .mode-topbar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }

  .mode-topbar .back-to-menu-btn {
    flex: 0 0 auto;
    min-width: 78px;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
  }

  .topbar-esc-hint {
    display: none;
  }

  .fd-module {
    padding: 12px 10px 44px;
  }

  .fd-header {
    padding: 18px 16px;
  }

  .fd-kicker {
    margin-left: auto;
    margin-right: auto;
  }

  .fd-header h1,
  .fd-subtitle {
    text-align: center;
  }

  .fd-header h1 {
    flex-direction: column;
    gap: 8px;
  }

  .fd-quick-stats {
    justify-content: center;
  }

  .fd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .fd-card {
    min-height: 268px;
    padding: 10px;
  }

  .fd-card-main {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .fd-card-status {
    margin-inline: auto;
  }

  .fd-card-facts div {
    min-height: 58px;
  }

  .fd-card-score {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .fd-card-more {
    text-align: center;
  }
}

/* ================================================================
   Модалка продукту: швидке рішення + деталі
   ================================================================ */
.fd-modal {
  padding: 16px;
}

.fd-modal-backdrop {
  background: rgba(38, 24, 13, 0.58);
}

.fd-modal-box {
  width: min(820px, calc(100vw - 24px));
  max-width: 820px;
  padding: 0;
  border-radius: 8px;
  background: #fffaf1;
  overflow: auto;
}

.fd-modal-close {
  position: sticky;
  top: 12px;
  margin-left: auto;
  margin-right: 12px;
  margin-bottom: -46px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(245, 226, 205, 0.96);
  box-shadow: 0 6px 14px rgba(73, 40, 16, 0.12);
}

.fd-modal-shell {
  --modal-accent: #e9b74a;
  --modal-soft: #fff0bd;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(255, 255, 255, 0.98)),
    #fffaf1;
}

.fd-modal-shell--good {
  --modal-accent: #62bd6c;
  --modal-soft: #ddf8cf;
}

.fd-modal-shell--warn {
  --modal-accent: #efbd4f;
  --modal-soft: #fff0bd;
}

.fd-modal-shell--bad {
  --modal-accent: #e35b75;
  --modal-soft: #ffd5dc;
}

.fd-modal-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(123, 79, 39, 0.12);
  border-top: 5px solid var(--modal-accent);
  border-radius: 8px;
  background:
    radial-gradient(circle at 90% 18%, rgba(255, 255, 255, 0.8), transparent 20%),
    linear-gradient(135deg, #fffdf8, var(--modal-soft));
}

.fd-modal-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 -4px 0 rgba(87, 55, 29, 0.08), 0 12px 24px rgba(71, 42, 18, 0.12);
}

.fd-modal-emoji {
  font-size: 64px;
}

.fd-modal-kicker {
  width: fit-content;
  margin-bottom: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #7b4f27;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.fd-modal-title {
  margin: 0 42px 8px 0;
  color: #2c251f;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.fd-modal-badges {
  gap: 7px;
}

.fd-modal-verdict {
  margin: 12px 0 8px;
  color: #563817;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.fd-modal-season {
  color: rgba(44, 37, 31, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.fd-modal-decision {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.fd-decision-card {
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(123, 79, 39, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 16px rgba(93, 56, 22, 0.06);
}

.fd-decision-card span,
.fd-modal-panel h3,
.fd-modal-meter-top span {
  display: block;
  margin-bottom: 6px;
  color: rgba(44, 37, 31, 0.52);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.fd-decision-card strong {
  display: block;
  color: #2f241b;
  font-size: 14px;
  line-height: 1.25;
}

.fd-modal-body-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fd-modal-panel {
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(123, 79, 39, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.fd-modal-panel--wide,
.fd-modal-panel--tip {
  grid-column: 1 / -1;
}

.fd-modal-panel--alert {
  border-color: rgba(227, 91, 117, 0.22);
  background: #fff5f2;
}

.fd-modal-panel--tip {
  background: linear-gradient(135deg, #fffbea, #fff3c0);
  border-color: rgba(239, 189, 79, 0.42);
}

.fd-modal-panel p,
.fd-modal-desc {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3f3024;
  font-size: 14px;
  line-height: 1.65;
}

.fd-modal-meters {
  display: grid;
  gap: 10px;
}

.fd-modal-meter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fd-modal-meter-top span {
  margin: 0;
}

.fd-modal-meter-top strong {
  color: #47311e;
  font-size: 12px;
}

.fd-modal-meter-track {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: rgba(123, 79, 39, 0.12);
  overflow: hidden;
}

.fd-modal-meter-track span {
  display: block;
  width: calc(var(--meter) * 20%);
  height: 100%;
  border-radius: inherit;
}

.fd-modal-meter--benefit .fd-modal-meter-track span,
.fd-modal-meter--vitc .fd-modal-meter-track span {
  background: linear-gradient(90deg, #efbd4f, #62bd6c);
}

.fd-modal-meter--risk .fd-modal-meter-track span,
.fd-modal-meter--sugar .fd-modal-meter-track span {
  background: linear-gradient(90deg, #efbd4f, #e35b75);
}

.fd-modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 14px -18px -18px;
  padding: 12px 18px;
  border-top: 1px solid rgba(123, 79, 39, 0.12);
  background: rgba(255, 250, 241, 0.96);
}

.fd-modal-action {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--modal-accent);
  border-radius: 8px;
  background: var(--modal-accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.fd-modal-action--ghost {
  background: #fffdf8;
  color: #6e451e;
}

/* Marketplace */
.mk-wrap {
  width: min(1160px, calc(100vw - 24px));
  margin: 0 auto 28px;
  padding: 14px 0 28px;
  color: #213228;
}

.mk-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(115deg, #E5FFF2, #FFF3D4);
  border: 1px solid rgba(40, 160, 90, .18);
  box-shadow: 0 16px 38px rgba(35, 104, 72, .12);
}

.mk-kicker {
  width: fit-content;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  color: #23724A;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mk-header-icon {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  vertical-align: middle;
  margin-right: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.mk-hero h1 {
  margin: 0;
  color: #0B4D2A;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.mk-hero p {
  margin: 8px 0 0;
  color: #587466;
  font-weight: 650;
}

.mk-hero-stats,
.mk-toolbar,
.mk-cats,
.mk-card-actions,
.mk-dialog-actions,
.mk-form-row,
.mk-chat-head,
.mk-chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mk-form-row > * {
  flex: 1;
}

.mk-form-row #mk-currency {
  flex: 0 0 128px;
}

.mk-hero-stats {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mk-hero-stats button,
.mk-sell-btn,
.mk-card-actions button,
.mk-buy-main,
.mk-report-btn,
.mk-back,
.mk-address-helper button,
.mk-chat-input button,
.mk-dialog-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #22A754, #38CF70);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  padding: 10px 14px;
  box-shadow: 0 10px 22px rgba(31, 154, 76, .18);
}

.mk-hero-stats button,
.mk-back,
.mk-address-helper button,
.mk-report-btn {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(40, 160, 90, .2);
  color: #0B4D2A;
}

.mk-toolbar {
  margin: 14px 0 10px;
}

.mk-filters {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .7fr) repeat(2, minmax(95px, .55fr)) auto;
  gap: 8px;
  margin: 0 0 10px;
}

.mk-search {
  flex: 1;
}

.mk-search input,
.mk-filters select,
.mk-filters input,
.mk-dialog input,
.mk-dialog select,
.mk-dialog textarea,
.mk-chat-input textarea {
  width: 100%;
  border: 1.5px solid rgba(40, 160, 90, .25);
  border-radius: 12px;
  background: #fff;
  color: #213228;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  padding: 12px 13px;
}

.mk-filters button {
  min-height: 42px;
  border: 1px solid rgba(40, 160, 90, .2);
  border-radius: 12px;
  background: #fff;
  color: #0B4D2A;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  padding: 9px 12px;
}

.mk-cats {
  overflow-x: auto;
  padding-bottom: 4px;
}

.mk-cats button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid rgba(40, 160, 90, .17);
  border-radius: 999px;
  background: #fff;
  color: #315B43;
  cursor: pointer;
  font-family: inherit;
  font-weight: 850;
  padding: 8px 13px;
}

.mk-cats button.is-active {
  background: #E5FFF0;
  border-color: #35C66F;
  color: #0B4D2A;
}

.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mk-card {
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(40, 160, 90, .14);
  box-shadow: 0 10px 28px rgba(35, 104, 72, .1);
}

.mk-card-main {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  padding: 0;
}

.mk-photo {
  height: 164px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #E9FFF1, #FFF3D4);
}

.mk-photo img,
.mk-detail-photo img,
.mk-order-thumb img,
.mk-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mk-photo span,
.mk-detail-photo span,
.mk-order-thumb span {
  font-size: 54px;
}

.mk-card-body {
  padding: 11px;
}

.mk-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #70847B;
  font-size: 11px;
  font-weight: 800;
}

.mk-card h3 {
  min-height: 38px;
  margin: 7px 0 6px;
  color: #162B20;
  font-size: 15px;
  line-height: 1.25;
}

.mk-card strong,
.mk-price {
  color: #0B4D2A;
  font-size: 20px;
  font-weight: 950;
}

.mk-card p {
  display: -webkit-box;
  min-height: 36px;
  margin: 6px 0 0;
  overflow: hidden;
  color: #65786F;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.mk-card-actions {
  padding: 0 11px 11px;
}

.mk-card-actions button {
  width: 100%;
}

.mk-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: 14px;
  background: #fff;
  color: #60766B;
  text-align: center;
}

.mk-detail-card {
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(35, 104, 72, .11);
}

.mk-detail-photo {
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: #111;
}

.mk-detail-info h1 {
  margin: 10px 0;
  color: #13291D;
}

.mk-detail-info p {
  color: #465C51;
  line-height: 1.6;
}

.mk-chip {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #E5FFF0;
  color: #0B4D2A;
  font-size: 12px;
  font-weight: 900;
}

.mk-seller-box,
.mk-order-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border-radius: 12px;
  background: #F4FFF7;
  color: #426254;
}

.mk-seller-box {
  flex-direction: column;
  align-items: flex-start;
}

.mk-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.46);
  backdrop-filter: blur(4px);
}

.mk-dialog {
  width: min(420px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.mk-dialog--wide {
  width: min(620px, 94vw);
}

.mk-dialog h2 {
  margin: 0 0 4px;
  color: #0B4D2A;
}

.mk-dialog-actions {
  justify-content: flex-end;
}

.mk-dialog-actions button:first-child {
  background: #EEF4F0;
  color: #315B43;
  box-shadow: none;
}

.mk-photo-picker {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed rgba(40, 160, 90, .34);
  border-radius: 12px;
  color: #0B4D2A;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 14px;
}

.mk-photo-preview {
  height: 160px;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
}

.mk-chat-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.mk-chat-head {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(115deg, #E5FFF0, #FFF3D4);
}

.mk-chat-head div {
  display: flex;
  flex-direction: column;
}

.mk-chat-head span,
.mk-order-summary span {
  color: #65786F;
  font-size: 12px;
  font-weight: 700;
}

.mk-order-thumb {
  width: 60px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: #E5FFF0;
  flex-shrink: 0;
}

.mk-messages {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #F7FFF9;
}

.mk-msg {
  max-width: 78%;
  align-self: flex-start;
  padding: 9px 11px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(35, 104, 72, .07);
}

.mk-msg.is-me {
  align-self: flex-end;
  background: #DFF9E8;
}

.mk-msg.is-system {
  align-self: center;
  background: #FFF3D4;
}

.mk-msg p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.mk-msg span {
  display: block;
  margin-top: 4px;
  color: #7E9088;
  font-size: 10px;
}

.mk-address-helper {
  margin: 10px 0;
}

.mk-chat-input textarea {
  flex: 1;
  resize: none;
}

.mk-orders-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mk-order-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(40, 160, 90, .16);
  border-radius: 12px;
  background: #fff;
  color: #213228;
  cursor: pointer;
  font-family: inherit;
  padding: 13px;
  text-align: left;
}

.mk-order-row span {
  color: #65786F;
  font-size: 12px;
}

/* Account */
.account-wrap {
  width: min(1060px, calc(100vw - 24px));
  margin: 0 auto 32px;
  padding: 16px 0 28px;
  color: #213228;
}

.account-intro {
  margin: 14px 0 4px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #EAF2FF;
  border: 1.5px solid #BFD8FF;
}
.account-intro-main {
  margin: 0;
  color: #1E3A5F;
  font-size: 15px;
  line-height: 1.5;
}
.account-intro-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed #BFD8FF;
  color: #4A5E75;
  font-size: 13.5px;
  line-height: 1.5;
}
.account-hero {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(82, 126, 210, .18);
  border-radius: 16px;
  background: linear-gradient(115deg, #EEF5FF, #F7EEFF 52%, #FFF5D8);
  box-shadow: 0 16px 38px rgba(66, 82, 130, .14);
}

.account-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  color: #315fcb;
  font-size: 34px;
  font-weight: 950;
  box-shadow: inset 0 -3px 0 rgba(70, 80, 120, .08), 0 10px 22px rgba(66, 82, 130, .12);
}

.account-kicker {
  width: fit-content;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: #315fcb;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-hero h1 {
  margin: 0;
  color: #142846;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.account-hero p {
  margin: 7px 0 0;
  color: #647286;
  font-weight: 700;
}

.account-score {
  min-width: 96px;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  color: #142846;
}

.account-score strong {
  font-size: 30px;
}

.account-score span {
  color: #647286;
  font-size: 12px;
  font-weight: 800;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 14px;
  margin-top: 14px;
}

.account-panel {
  padding: 18px;
  border: 1px solid rgba(82, 126, 210, .14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(66, 82, 130, .09);
}

.account-panel h2 {
  margin: 0 0 12px;
  color: #142846;
}

.account-form,
.account-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-form label {
  color: #56657A;
  font-size: 12px;
  font-weight: 900;
}

.account-form input,
.account-form select {
  width: 100%;
  border: 1.5px solid rgba(82, 126, 210, .22);
  border-radius: 12px;
  color: #213228;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 13px;
  outline: none;
}

.account-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-form button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4D7DF0, #35C66F);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 950;
  margin-top: 4px;
  padding: 11px 16px;
  box-shadow: 0 10px 22px rgba(56, 103, 200, .2);
}

.account-status {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px;
  border-radius: 14px;
  background: #FFF6D8;
  color: #7A5A17;
}

.account-status.is-cloud {
  background: #E8FFF0;
  color: #0B4D2A;
}

.account-status span {
  font-size: 13px;
  line-height: 1.45;
}

.account-stat-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.account-stat-list div {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 10px;
  border-radius: 12px;
  background: #F6F9FF;
}

.account-stat-list strong {
  color: #142846;
}

.account-stat-list span {
  color: #647286;
  font-size: 11px;
  font-weight: 800;
}

.account-firebase {
  grid-column: 1 / -1;
}

.account-firebase p {
  margin: 0 0 10px;
  color: #647286;
  line-height: 1.45;
}

.account-firebase textarea {
  width: 100%;
  border: 1.5px solid rgba(82, 126, 210, .22);
  border-radius: 12px;
  color: #213228;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  outline: none;
  padding: 12px;
  resize: vertical;
}

.account-firebase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.account-firebase-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4D7DF0, #35C66F);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  padding: 10px 14px;
}

.account-firebase-actions button:last-child {
  background: #EEF4F0;
  color: #315B43;
}

.account-firebase-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #F6F9FF;
  color: #475970;
  font-size: 13px;
  font-weight: 700;
}

/* Admin */
.admin-wrap {
  width: min(1180px, calc(100vw - 24px));
  margin: 0 auto 30px;
  padding: 16px 0 28px;
  color: #243126;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(115deg, #FFF0E3, #FFE5E5);
  border: 1px solid rgba(190, 88, 40, .18);
  box-shadow: 0 16px 38px rgba(120, 60, 30, .13);
}

.admin-hero h1 {
  margin: 0;
  color: #6A2F16;
  font-size: clamp(28px, 4vw, 44px);
}

.admin-hero p {
  margin: 6px 0 0;
  color: #7A5F50;
}

.admin-status,
.admin-denied {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: #6A2F16;
  font-weight: 800;
}

.admin-denied {
  margin-top: 14px;
}

.admin-denied p {
  margin: 6px 0 0;
  word-break: break-all;
}

.admin-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-panel {
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(190, 88, 40, .14);
  box-shadow: 0 10px 26px rgba(120, 60, 30, .08);
}

.admin-panel h2 {
  margin: 0 0 10px;
  color: #6A2F16;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 10px;
  background: #FFF8F4;
}

.admin-row strong,
.admin-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-row span {
  color: #735D50;
  font-size: 12px;
}

.admin-row div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-row button {
  border: 1px solid rgba(190, 88, 40, .2);
  border-radius: 8px;
  background: #fff;
  color: #6A2F16;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 850;
  padding: 7px 9px;
}

.admin-empty {
  color: #735D50;
  font-size: 13px;
}

.mk-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mk-detail-actions .mk-buy-main {
  flex: 1;
}

.mk-my-list,
.mk-rules {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mk-my-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(40, 160, 90, .16);
  border-radius: 12px;
  background: #fff;
  padding: 11px;
  box-shadow: 0 8px 20px rgba(35, 104, 72, .07);
}

.mk-my-row > div:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mk-my-row strong {
  color: #13291D;
}

.mk-my-row span {
  color: #65786F;
  font-size: 12px;
}

.mk-my-row button {
  min-height: 38px;
  border: 1px solid rgba(40, 160, 90, .18);
  border-radius: 10px;
  background: #F4FFF7;
  color: #0B4D2A;
  cursor: pointer;
  font-family: inherit;
  font-weight: 850;
  padding: 8px 10px;
}

.mk-rules article {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(40, 160, 90, .14);
  box-shadow: 0 8px 20px rgba(35, 104, 72, .07);
}

.mk-rules strong {
  color: #0B4D2A;
}

.mk-rules span {
  color: #587466;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .fd-modal {
    padding: 8px;
  }

  .fd-modal-box {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .fd-modal-shell {
    padding: 10px;
  }

  .fd-modal-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 16px 12px;
    text-align: center;
  }

  .fd-modal-title {
    margin-right: 0;
  }

  .fd-modal-kicker {
    margin-left: auto;
    margin-right: auto;
  }

  .fd-modal-badges {
    justify-content: center;
  }

  .fd-modal-decision {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .fd-decision-card {
    min-height: 66px;
    padding: 10px;
  }

  .fd-decision-card strong {
    font-size: 13px;
  }

  .fd-modal-body-grid {
    grid-template-columns: 1fr;
  }

  .fd-modal-actions {
    margin: 12px -10px -10px;
    padding: 10px;
  }

  .fd-modal-action {
    flex: 1;
  }

  .mk-wrap {
    width: calc(100vw - 16px);
    padding-top: 8px;
  }

  .mk-hero,
  .mk-toolbar,
  .mk-chat-input {
    align-items: stretch;
    flex-direction: column;
  }

  .mk-filters {
    grid-template-columns: 1fr 1fr;
  }

  .mk-hero-stats {
    justify-content: stretch;
  }

  .mk-hero-stats button,
  .mk-sell-btn {
    width: 100%;
  }

  .mk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .mk-photo {
    height: 118px;
  }

  .mk-card-body {
    padding: 9px;
  }

  .mk-card h3 {
    font-size: 13px;
  }

  .mk-card strong,
  .mk-price {
    font-size: 17px;
  }

  .mk-detail-card {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .mk-detail-photo {
    min-height: 250px;
  }

  .mk-dialog {
    max-height: 92dvh;
    overflow-y: auto;
  }

  .mk-form-row {
    flex-direction: column;
  }

  .mk-msg {
    max-width: 92%;
  }

  .mk-my-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .mk-my-row button {
    grid-column: span 1;
  }

  .account-wrap {
    width: calc(100vw - 16px);
    padding-top: 8px;
  }

  .account-hero {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 14px;
  }

  .account-avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 25px;
  }

  .account-score {
    grid-column: 1 / -1;
    align-items: flex-start;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-row {
    grid-template-columns: 1fr;
  }

  .admin-wrap {
    width: calc(100vw - 16px);
    padding-top: 8px;
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-columns {
    grid-template-columns: 1fr;
  }
}

/* Survey */
.survey-wrap {
  width: min(860px, calc(100vw - 24px));
  margin: 0 auto 34px;
  padding: 16px 0 34px;
  color: #2d2a21;
}

.survey-hero,
.survey-form {
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(190, 100, 40, .16);
  box-shadow: 0 14px 34px rgba(125, 74, 28, .09);
}

.survey-hero {
  padding: 22px;
  background: linear-gradient(135deg, #fff7d8, #ffe1ec);
}
.sv-header-icon {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  vertical-align: middle;
  margin-left: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.survey-badge {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #9a4b12;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.survey-hero h1 {
  margin: 0 0 8px;
  color: #6a2f16;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
}

.survey-hero p {
  max-width: 720px;
  margin: 0;
  color: #745548;
  line-height: 1.55;
}

.survey-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
}

.survey-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.survey-form label,
.survey-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.survey-form label span {
  color: #5f3c25;
  font-size: 13px;
  font-weight: 900;
}

.survey-form input,
.survey-form select,
.survey-form textarea {
  width: 100%;
  border: 2px solid #f0d4bf;
  border-radius: 10px;
  background: #fffdf8;
  color: #2e2a23;
  font: inherit;
  font-size: 14px;
  padding: 11px 12px;
  outline: none;
}

.survey-form textarea {
  min-height: 92px;
  resize: vertical;
}

.survey-form input:focus,
.survey-form select:focus,
.survey-form textarea:focus {
  border-color: #ff9640;
  box-shadow: 0 0 0 4px rgba(255, 150, 64, .14);
}

.survey-submit {
  justify-self: start;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff7b32, #ff4f9a);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 950;
  padding: 12px 18px;
  box-shadow: 0 10px 22px rgba(255, 100, 70, .2);
}

.survey-submit:disabled {
  opacity: .55;
  cursor: default;
}

.survey-message {
  border-radius: 10px;
  padding: 11px 12px;
  font-weight: 850;
}

.survey-message--ok {
  background: #e6f9df;
  color: #1e6b22;
}

.survey-message--warn {
  background: #fff1ca;
  color: #78510c;
}

.tile-icon-survey::before {
  left: 8px;
  top: 6px;
  width: 14px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff, #e8f1ff);
  box-shadow: inset 0 -2px 0 rgba(60, 90, 160, .14);
}

.tile-icon-survey::after {
  left: 12px;
  top: 11px;
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: #ff7aa8;
  box-shadow: 0 6px 0 #6dcf82, 0 12px 0 #6aa8ff;
}

.admin-row--survey p {
  margin: 0;
  color: #3d3029;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 760px) {
  .survey-grid {
    grid-template-columns: 1fr;
  }

  .survey-submit {
    width: 100%;
  }
}

.br-tab {
  gap: 4px;
}

.br-tab-unlock {
  display: block;
  margin-top: 2px;
  color: #8a4d0b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.br-tab-unlock strong {
  font-variant-numeric: tabular-nums;
}

.br-tab--active .br-tab-unlock {
  color: rgba(255, 255, 255, 0.92);
}

.br-tab-unlock--done {
  color: #2f7d32;
}

.pig-room-card--account {
  border-top-color: rgba(96, 165, 250, 0.7);
}

.pig-room-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.pig-room-account-actions .game-button,
.pig-room-account-actions .settings-danger-btn {
  min-width: 170px;
}

.game-exited-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, #fff4cf 0%, #f4d9a5 36%, #1c1b2e 100%);
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.game-exited-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.game-exited-card {
  width: min(420px, 92vw);
  text-align: center;
  padding: 34px 24px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  background: rgba(12, 16, 32, 0.78);
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}

.game-exited-icon {
  font-size: 54px;
  margin-bottom: 12px;
}

.game-exited-card h1 {
  margin: 0 0 10px;
  font-size: 34px;
}

.game-exited-card p {
  margin: 0 0 22px;
  color: rgba(255,255,255,0.78);
  font-size: 16px;
  line-height: 1.45;
}

.game-exited-card button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  color: #3d2500;
  background: #ffd166;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

/* Skin shop redesign */
#skin-select-screen {
    align-items: stretch;
    justify-content: flex-start;
    padding: max(18px, env(safe-area-inset-top)) 18px 28px;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 214, 92, 0.14), transparent 28%),
        radial-gradient(circle at 88% 8%, rgba(88, 166, 255, 0.16), transparent 30%),
        linear-gradient(180deg, #080514 0%, #11091f 100%);
}

.skin-shop-shell {
    width: min(1060px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

/* ===== Вкладки магазину ===== */
.shop-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.shop-tab {
    padding: 10px 20px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(14px, 2.2vw, 17px);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.shop-tab:hover { background: rgba(255, 255, 255, 0.12); }
.shop-tab:active { transform: scale(0.96); }

.shop-tab--active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.shop-panel { display: none; }
.shop-panel--active { display: block; }

.shop-panel-intro {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(14px, 2vw, 16px);
    margin: 0 0 16px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

/* ===== Картка бустера ===== */
.shop-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.shop-item--owned { border-color: rgba(110, 231, 183, 0.5); background: rgba(47, 169, 104, 0.12); }

.shop-item-emoji { font-size: 38px; line-height: 1; flex: 0 0 auto; }

.shop-item-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.shop-item-body strong { color: #fff; font-size: 17px; }
.shop-item-desc { color: rgba(255, 255, 255, 0.65); font-size: 13px; }
.shop-item-level { color: #ffd166; font-size: 12px; font-weight: 700; }

.shop-item-buy {
    flex: 0 0 auto;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffd166 0%, #f0a020 100%);
    color: #3a2a00;
    font-weight: 800;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.12s;
}
.shop-item-buy:hover { transform: translateY(-2px); }
.shop-item-buy:active { transform: scale(0.95); }
.shop-item-buy--no-coins { animation: shopShake 0.5s; }

@keyframes shopShake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shop-item-soon, .shop-item-owned-tag {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 10px;
}
.shop-item-soon { color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.08); }
.shop-item-owned-tag { color: #6ee7b7; }

/* ===== Пакети монет ===== */
.shop-coin-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 16px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.shop-coin-pack--featured {
    border-color: rgba(255, 209, 102, 0.7);
    background: rgba(255, 209, 102, 0.1);
}

.shop-coin-tag {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd166, #f0a020);
    color: #3a2a00;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 14px;
    border-radius: 999px;
    white-space: nowrap;
}

.shop-coin-amount { font-size: 26px; font-weight: 900; color: #fff; }
.shop-coin-bonus { font-size: 13px; color: #6ee7b7; font-weight: 700; min-height: 18px; }

.shop-coin-buy {
    margin-top: 6px;
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2fa968 0%, #1f7a4d 100%);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
}
.shop-coin-buy:disabled { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.5); cursor: default; }

.shop-coins-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin: 14px 0 0;
}

.shop-coins-blocked {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    padding: 30px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.skin-shop-topbar {
    display: grid;
    grid-template-columns: minmax(96px, 160px) 1fr minmax(96px, 160px);
    align-items: center;
    gap: 12px;
}

.skin-shop-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
}

.skin-shop-title span {
    font-size: clamp(28px, 4vw, 46px);
}

.skin-shop-title h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 5vw, 56px);
    line-height: 1;
    text-shadow: 0 8px 22px rgba(0,0,0,0.42);
}

.skin-shop-back {
    width: fit-content;
    min-height: 44px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 0 18px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0,0,0,0.2);
}

.skin-shop-back:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}

.skin-screen-coins {
    justify-self: end;
    min-width: 112px;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    color: #ffe45c;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,226,88,0.46);
    border-radius: 999px;
    padding: 9px 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 10px 22px rgba(0,0,0,0.18);
}

.skin-shop-preview {
    display: grid;
    grid-template-columns: 138px 1fr;
    align-items: center;
    gap: 18px;
    min-height: 158px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
    box-shadow: 0 20px 50px rgba(0,0,0,0.22);
}

.skin-preview-avatar {
    width: 122px;
    height: 122px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.22);
    font-size: 62px;
    overflow: hidden;
}

.skin-preview-pig-img {
    width: 104px;
    height: 104px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}

.skin-preview-copy {
    display: grid;
    gap: 5px;
    color: #fff;
}

.skin-preview-kicker {
    color: rgba(255,255,255,0.66);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.skin-preview-copy strong {
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.05;
}

.skin-preview-copy small {
    width: fit-content;
    color: #0e4d24;
    background: #9af2aa;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 900;
}

.skin-screen-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
}

.skin-card {
    min-height: 178px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.18);
    padding: 18px 12px 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 16px 34px rgba(0,0,0,0.26);
}

.skin-card--selected {
    border-color: #ffe45c !important;
    box-shadow: 0 0 0 3px rgba(255,228,92,0.36), 0 20px 38px rgba(0,0,0,0.32) !important;
}

.skin-card-emoji {
    font-size: 54px;
}

.skin-card-label {
    font-size: 17px;
}

.skin-card-cost,
.skin-card-badge {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
}

@media (max-width: 700px) {
    #skin-select-screen {
        padding-inline: 12px;
    }

    .skin-shop-topbar {
        grid-template-columns: 1fr auto;
    }

    .skin-shop-title {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-content: flex-start;
    }

    .skin-shop-back {
        grid-row: 2;
    }

    .skin-screen-coins {
        grid-row: 2;
    }

    .skin-shop-preview {
        grid-template-columns: 86px 1fr;
        min-height: 112px;
        padding: 12px;
        border-radius: 14px;
    }

    .skin-preview-avatar {
        width: 78px;
        height: 78px;
        border-radius: 18px;
        font-size: 42px;
    }

    .skin-preview-pig-img {
        width: 70px;
        height: 70px;
    }

    .skin-screen-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .skin-card {
        min-height: 142px;
        border-radius: 14px;
    }
}

/* ============================================================
   КОМІКСИ (ComicsModule) — cm-*
   ============================================================ */
.cm-module {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 14px 28px;
    box-sizing: border-box;
}

.cm-header {
    text-align: center;
    margin-bottom: 16px;
}
.cm-title {
    margin: 0 0 6px;
    font-size: 1.6rem;
    color: #6b3fb0;
}
.cm-title-icon {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    vertical-align: middle;
    margin-right: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.cm-subtitle {
    margin: 0;
    color: #6b5d52;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ---- Меню епізодів ---- */
.cm-ep-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.cm-ep-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    padding: 14px 16px;
    border: 2px solid #f0d9b8;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff8ec, #ffeccd);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cm-ep-card:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #e8b770;
}
.cm-ep-card:active:not(:disabled) {
    transform: translateY(0);
}
.cm-ep-emoji {
    font-size: 2.4rem;
    flex: 0 0 auto;
    line-height: 1;
}
.cm-ep-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}
.cm-ep-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: #5a3a12;
}
.cm-ep-blurb {
    font-size: 0.88rem;
    color: #7a6552;
    line-height: 1.35;
}
.cm-ep-status {
    flex: 0 0 auto;
    align-self: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    background: #c8702a;
    border-radius: 999px;
    padding: 6px 12px;
    white-space: nowrap;
}
.cm-ep-card--done .cm-ep-status {
    background: #4caf6e;
}
.cm-ep-card--locked {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.4);
}
.cm-ep-card--locked .cm-ep-status {
    background: #9a8c7c;
}

/* ---- Сцена ---- */
.cm-play { display: flex; flex-direction: column; }
.cm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.cm-back {
    border: none;
    background: #efe3d2;
    color: #5a3a12;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
}
.cm-back:hover { background: #e6d5bd; }
.cm-ep-chip {
    font-weight: 700;
    color: #6b5d52;
    font-size: 0.9rem;
}

.cm-stage {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
    border: 3px solid #fff;
}
.cm-stage-art {
    position: relative;
    flex: 1 1 auto;
    min-height: 240px;
    height: 42vh;
    max-height: 420px;
    display: flex;
}
.cm-pig {
    flex: 1 1 0;
    width: 100%;
    height: 100%;
    display: block;
    animation: cmFloat 3.4s ease-in-out infinite;
}
.cm-pig.cm-face-right {
    transform: scaleX(-1);
    animation-name: cmFloatFlip;
}
@keyframes cmFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes cmFloatFlip {
    0%, 100% { transform: scaleX(-1) translateY(0); }
    50% { transform: scaleX(-1) translateY(-5px); }
}
.cm-stage-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Бульбашка діалогу ---- */
.cm-bubble {
    background: #fffdf7;
    padding: 14px 16px 16px;
    border-top: 2px solid #f0e2c8;
}
.cm-bubble-speaker {
    font-weight: 800;
    color: #c8702a;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.cm-bubble-text {
    color: #3a3027;
    font-size: 1.02rem;
    line-height: 1.45;
}

/* ---- Кнопки вибору ---- */
.cm-choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}
.cm-choice {
    border: none;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #8a5cd0, #6b3fb0);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(107, 63, 176, 0.3);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    text-align: left;
    line-height: 1.35;
}
.cm-choice:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 8px 18px rgba(107, 63, 176, 0.36);
}
.cm-choice:active { transform: translateY(0); }

/* ---- Кінцівка ---- */
.cm-ending {
    margin-top: 14px;
    padding: 20px 18px;
    border-radius: 18px;
    text-align: center;
    border: 2px solid;
}
.cm-ending--win  { background: #e9f9ef; border-color: #4caf6e; }
.cm-ending--lose { background: #fff1e3; border-color: #e8954a; }
.cm-ending--fail { background: #f6ecff; border-color: #a06bd0; }
.cm-ending-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #3a3027;
}
.cm-ending-text {
    color: #4a4036;
    line-height: 1.5;
    margin-bottom: 16px;
}
.cm-ending-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.cm-ending-actions .cm-choice { text-align: center; }
.cm-restart { background: linear-gradient(135deg, #4caf6e, #2f9e5a); box-shadow: 0 4px 12px rgba(47, 158, 90, 0.3); }
.cm-to-episodes { background: linear-gradient(135deg, #c8702a, #a85618); box-shadow: 0 4px 12px rgba(168, 86, 24, 0.3); }

@media (max-width: 520px) {
    .cm-title { font-size: 1.35rem; }
    .cm-ep-emoji { font-size: 2rem; }
    .cm-ep-name { font-size: 1rem; }
    .cm-ep-blurb { font-size: 0.82rem; }
    .cm-ending-actions { grid-template-columns: 1fr; }
}

/* Іконка застосунку в кінці головного заголовка */
.main-menu-title .title-icon {
    height: 2.2em;
    width: auto;
    vertical-align: middle;
    border-radius: 10px;
    margin-left: 0.25em;
    box-shadow: 0 2px 6px rgba(90, 46, 0, 0.25);
    animation: tileFloat 3.4s ease-in-out infinite;
}

/* ===== Живі плитки головного меню ===== */
@keyframes tileFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-5px) rotate(-0.7deg); }
}
.main-menu-tile .tile-full-img {
    animation: tileFloat 3.6s ease-in-out infinite;
    will-change: transform;
}
/* Розкид фаз, щоб плитки не рухались синхронно */
.main-menu-grid .main-menu-tile:nth-child(2n) .tile-full-img   { animation-delay: -0.8s; animation-duration: 4.1s; }
.main-menu-grid .main-menu-tile:nth-child(3n) .tile-full-img   { animation-delay: -1.6s; animation-duration: 3.2s; }
.main-menu-grid .main-menu-tile:nth-child(3n+1) .tile-full-img { animation-delay: -2.4s; animation-duration: 4.4s; }

.main-menu-tile {
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}
.main-menu-tile:hover {
    transform: translateY(-5px) scale(1.05);
    z-index: 3;
}
.main-menu-tile:active {
    transform: translateY(-1px) scale(1.0);
}
/* Прихована плитка (напр. «Адмін» для не-адмінів) має реально ховатись.
   Без цього display:flex з .tile-image перебиває атрибут hidden. */
.main-menu-tile[hidden] {
    display: none !important;
}

/* Позначка «Premium» на плитці меню */
.tile-premium { position: relative; }
.tile-premium-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 4;
    background: linear-gradient(135deg, #f0a020, #c87010);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.2px;
    padding: 2px 7px;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
    white-space: nowrap;
    pointer-events: none;
}
.main-menu-tile:hover .tile-full-img {
    animation-duration: 1.3s; /* швидше підстрибує під час наведення */
}

/* Пульс кнопки «Грати» у картці платформера */
@keyframes ctaPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.09); }
}
.game-launch-play-icon {
    animation: ctaPulse 1.9s ease-in-out infinite;
}

/* ===== Живі картинки в усіх розділах (їжа, породи, ціни, маркет...) ===== */
#mode-mount img {
    animation: tileFloat 3.6s ease-in-out infinite;
    will-change: transform;
}
#mode-mount img:nth-of-type(2n) { animation-delay: -1s;   animation-duration: 4.2s; }
#mode-mount img:nth-of-type(3n) { animation-delay: -2s;   animation-duration: 3.2s; }
#mode-mount img:nth-of-type(4n) { animation-delay: -0.5s; animation-duration: 4.6s; }
/* Картинки в картках-сітках — розкид фаз, щоб не рухались синхронно */
#mode-mount .br-rarity-grid > *:nth-child(2n) img,
#mode-mount .br-grid > *:nth-child(2n) img,
#mode-mount .pr-card:nth-child(2n) img,
#mode-mount .fd-card:nth-child(2n) img { animation-delay: -1.4s; animation-duration: 3.9s; }
#mode-mount .br-rarity-grid > *:nth-child(3n) img,
#mode-mount .br-grid > *:nth-child(3n) img,
#mode-mount .pr-card:nth-child(3n) img,
#mode-mount .fd-card:nth-child(3n) img { animation-delay: -2.6s; animation-duration: 3.3s; }
/* Великі зображення-панелі коміксу не коливаємо під час читання */
#mode-mount .cm-panel-img,
#mode-mount .cm-stage-img { animation: none; }
/* Наведення на картинку в картці — легкий «стрибок» */
#mode-mount .br-rarity-card:hover img,
#mode-mount .pr-card:hover img,
#mode-mount .fd-card:hover img,
#mode-mount .mk-card:hover img { animation-duration: 1.3s; }

/* Картка гри: мініатюра-іконка платформера на всю площу */
.game-launch-scene {
    background: none;
}
.game-launch-scene img {
    position: absolute;
    inset: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    object-fit: cover;
}
.game-launch-scene .scene-track,
.game-launch-scene .scene-carrot,
.game-launch-scene .scene-block {
    display: none;
}

/* Кнопка «Грати»: іконка-картинка замість ▶ */
.game-launch-play-icon {
    width: 52px;
    height: 52px;
    padding: 0;
    overflow: hidden;
    background: none;
}
.game-launch-play-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

/* ---- Комікс: панелі історії (зображення + текст) ---- */
.cm-stage--img {
    border: none;
    box-shadow: none;
    background: none;
    border-radius: 0;
}
.cm-stage--img .cm-stage-art {
    height: auto;
    min-height: 0;
    max-height: none;
    display: block;
}
.cm-panel-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    border: 3px solid #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.cm-narration {
    margin-top: 12px;
    font-size: 0.98rem;
    line-height: 1.5;
    color: #4a4036;
    background: #fffdf7;
    border-left: 4px solid #c8a86b;
    border-radius: 8px;
    padding: 10px 14px;
}
.cm-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.cm-line {
    background: #f1ecff;
    border-radius: 12px;
    padding: 10px 14px;
}
.cm-line-speaker {
    font-weight: 800;
    color: #6b3fb0;
    margin-right: 6px;
}
.cm-line-speaker::after { content: ':'; }
.cm-line-text { color: #3a3027; }
.cm-end-note {
    margin-top: 12px;
    text-align: center;
    font-weight: 800;
    color: #4caf6e;
    font-size: 1.1rem;
}
.cm-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}
.cm-nav-btn {
    border: none;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #8a5cd0, #6b3fb0);
    box-shadow: 0 4px 12px rgba(107, 63, 176, 0.3);
    transition: transform 0.12s ease, filter 0.12s ease;
}
.cm-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.05);
}
.cm-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.cm-nav-prev {
    background: linear-gradient(135deg, #b0a290, #8a7c68);
    box-shadow: 0 4px 12px rgba(138, 124, 104, 0.3);
}
.cm-nav-restart {
    background: linear-gradient(135deg, #4caf6e, #2f9e5a);
    box-shadow: 0 4px 12px rgba(47, 158, 90, 0.3);
}

.legal-footer {
  margin-top: 8px !important;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom)) !important;
  font-size: 0.78rem !important;
  line-height: 1.25;
  flex-shrink: 0;
}

@media (min-width: 821px) {
  .ach-section {
    position: fixed;
    top: auto;
    right: clamp(14px, 3vw, 32px);
    bottom: 46px;
    z-index: 5;
    width: min(260px, 34vw);
    max-width: 260px;
    display: block !important;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 218, 0.88)),
      #fff8e8;
    box-shadow: 0 12px 28px rgba(71, 42, 18, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
  }

  .ach-section-title {
    gap: 6px;
    margin-bottom: 5px;
    color: #714019;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0.45px;
    text-transform: uppercase;
  }

  .ach-section .section-mark {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    flex: 0 0 18px;
    background: #fff0c5;
  }

  .ach-section .section-mark-ach::before {
    left: 5px;
    top: 4px;
    width: 8px;
    height: 11px;
    box-shadow: inset 0 0 0 2px #ffe8a4;
  }

  .ach-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-height: 0;
    max-height: 70px;
    overflow: hidden;
  }

  .ach-count {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: #6f3bc5;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
  }

  .ach-badge {
    min-width: 0;
    max-width: 104px;
    min-height: 28px;
    padding: 4px 7px;
    border: 1px solid rgba(186, 122, 38, 0.18);
    border-radius: 8px;
    background: rgba(255, 252, 245, 0.92);
    box-shadow: 0 5px 12px rgba(71, 42, 18, 0.08);
  }

  .ach-badge-e {
    font-size: 14px;
    line-height: 1;
  }

  .ach-badge-t {
    max-width: 70px;
    overflow: hidden;
    color: #4a2b12;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ach-bar-empty {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #5c3b18;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.22;
  }

  .ach-bar-empty::before {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    flex: 0 0 22px;
  }
}

@media (min-width: 821px) and (max-height: 760px) {
  .ach-section {
    top: auto;
    right: 6px;
    bottom: 28px;
    width: 224px;
    display: block !important;
    padding: 6px;
  }

  .ach-section-title {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .ach-bar {
    max-height: 52px;
  }
}

