* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    /* Keep seasonal palette + new base gradient */
    --bg-gradient: linear-gradient(135deg, #ffdee9 0%, #b5fffc 100%);
    --card-bg: #ffffff;
    --card-text: #222222;
    --subtle-text: #555555;
    --border-color: #e5e7eb;
    --shadow: 0 18px 40px rgba(0,0,0,0.12);

    --accent: #ff6f61;
    --pill-bg: #fffaf0;
    --leaf-1: #f59e0b;
    --leaf-2: #f97316;
    --leaf-3: #facc15;
    --leaf-4: #fbbf24;
}

body.dark {
    --bg-gradient: radial-gradient(circle at top, #1f2933, #020617 60%);
    --card-bg: #111827;
    --card-text: #e5e7eb;
    --subtle-text: #9ca3af;
    --border-color: #374151;
    --shadow: 0 18px 40px rgba(0,0,0,0.6);

    --accent: #7dd3fc;
    --pill-bg: #0f172a;
}
body.dark.season-winter {
    /* Same background as dark-mode autumn/summer */
    --bg-gradient: radial-gradient(circle at top, #1f2933, #020617 60%);
}

body.season-winter {
    --bg-gradient: radial-gradient(circle at 30% 20%, #c7d2fe 0%, #e0e7ff 20%, #cbd5e1 45%, #94a3b8 100%);
    --leaf-1: #e5e7eb;
    --leaf-2: #cbd5e1;
    --leaf-3: #e2e8f0;
    --leaf-4: #f8fafc;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-text);
    transition: background 0.4s ease, color 0.3s ease;

    /* Allow vertical scrolling, prevent horizontal scroll */
    overflow-x: hidden;
    overflow-y: auto;
}

.card {
    max-width: 800px;
    width: 100%;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 28px 22px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
    gap: 20px;
    position: relative;
    z-index: 10;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 720px) {
    body {
        /* Switch to block display on mobile to avoid flex-centering clipping */
        display: block;
        /* Add padding to clear top controls (70px) and bottom buttons (100px) */
        padding: 80px 20px 100px;
        height: auto;
    }
    .card {
        grid-template-columns: 1fr;
        padding: 28px 22px 26px;
        /* Center the card horizontally */
        margin: 0 auto;
    }
}

.title { font-size: 26px; margin-bottom: 8px; }
.title span { color: var(--accent); }

.subtitle {
    font-size: 14px;
    color: var(--subtle-text);
    margin-bottom: 20px;
}

.hearts {
    font-size: 22px;
    margin-bottom: 14px;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #ff4b7d, #ff9a62);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(255,75,125,0.5);
    margin-bottom: 10px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-ghost {
    background: transparent;
    color: var(--subtle-text);
    box-shadow: none;
    border: 1px solid var(--border-color);
    margin-left: 8px;
}

.pill-btn {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--pill-bg);
    color: var(--card-text);
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.pill-btn.active {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #0f172a;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    transform: translateY(-1px);
}

@keyframes fireworksPulse {
    0% { box-shadow: 0 0 0 0 rgba(255,99,132,0.7), 0 0 10px rgba(255,99,132,0.8); transform: translateY(0); }
    50% { box-shadow: 0 0 0 4px rgba(255,99,132,0.0), 0 0 20px rgba(255,159,64,1); transform: translateY(-1px); }
    100% { box-shadow: 0 0 0 0 rgba(255,99,132,0.0), 0 0 10px rgba(255,99,132,0.8); transform: translateY(0); }
}
.btn-fireworks-active {
    border-color: rgba(255,99,132,0.9);
    animation: fireworksPulse 1.2s ease-in-out infinite;
}

.hint {
    font-size: 12px;
    color: var(--subtle-text);
}

.game-box {
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}
body.dark .game-box { background: #020617; }

.game-top {
    padding: 8px 12px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
}

iframe.small-game {
    width: 100%;
    height: 350px;
    border: none;
    display: block;
    background: #f1f5f9;
}

.fullscreen {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 9999;
}
body.dark .fullscreen { background: #020617; color: #e5e7eb; }

.fullscreen.active { opacity: 1; pointer-events: auto; }

.fullscreen-top {
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 500;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}
body.dark .fullscreen-top {
    color: #e5e7eb;
    border-color: #374151;
}

.fullscreen-btn {
    border: none;
    background: #f97373;
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
}

.fullscreen-frame-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

iframe.big-game {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: none;
    display: block;
    background: #ffffff;
}
body.dark iframe.big-game { background: #020617; }

.fullscreen-hint {
    text-align: center;
    font-size: 14px;
    color: #374151;
    padding-bottom: 10px;
}
body.dark .fullscreen-hint { color: #9ca3af; }

.balloons-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9998;
}

/* Balloon visuals + animations (merged from chat snippet) */
.balloon {
    position: absolute;
    top: 100vh;
    left: 0;
    width: 80px;
    height: 100px;
    --balloon-color: #ff4d6d;
    --balloon-scale: 1;
    background: radial-gradient(circle at 30% 30%, #ffccd2, #ff9aa2 40%, var(--balloon-color) 80%);
    border-radius: 50% 50% 50% 50%;
    cursor: grab;
    transform-origin: center bottom;
    transform: scale(var(--balloon-scale));
    opacity: 0;
    transition: transform 0.12s ease-out;
}
.balloon.grabbed { cursor: grabbing; }
.balloon::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 12px;
    background: var(--balloon-color);
    border-radius: 0 0 50% 50%;
}
.balloon .string {
    position: absolute;
    top: 100px;
    left: 50%;
    width: 2px;
    height: 120px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, #555, #999);
    border-radius: 999px;
    opacity: 0.9;
    transform-origin: top center;
    animation: stringWave 1.2s ease-in-out infinite;
}
@keyframes stringWave {
    0%   { transform: translateX(-50%) rotate(0deg); }
    25%  { transform: translateX(-50%) rotate(3deg); }
    50%  { transform: translateX(-50%) rotate(-3deg); }
    75%  { transform: translateX(-50%) rotate(2deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}
.balloon.bursting { animation: balloonBurst 0.25s forwards; }
@keyframes balloonBurst {
    0%   { transform: scale(1); opacity: 1; }
    60%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.5); opacity: 0; }
}

/* canvas snow background */
#snow {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: block;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

#fireworksCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}

.top-controls {
    position: fixed;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 11000;
    pointer-events: none;
}
.top-controls > * { pointer-events: auto; }

.daynight label { cursor: pointer; }
#checkbox { display: none; }

.toggle {
    height: 32px;
    width: 76px;
    border-radius: 9999px;
    background: linear-gradient(to bottom, #6ec8ff, #1f73a7);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px #0000003d;
}
/* (toggle internals remain unchanged) */
.mountains { height: 100%; width: 100%; position: absolute; z-index: 3; background-color: #1d7371; transition: all 0.5s ease-in-out; clip-path: polygon(0% 80%, 25% 50%, 40% 70%, 60% 35%, 65% 45%, 80% 20%, 100% 80%, 100% 100%, 0% 100%); }
.cloud { height: 4px; width: 12px; border-radius: 9999px; background-color: #ffffff; position: absolute; top: 26%; left: 10%; filter: opacity(0.5); }
.cloud::before { content: ""; height: 6px; width: 6px; border-radius: 50%; background-color: #ffffff; position: absolute; top: -50%; right: 50%; transform: translateX(50%); }
.sea { height: 120px; width: 300%; border-radius: 50%; position: absolute; right: 50%; bottom: -420%; transform: translateX(50%); transition: all 0.5s ease-in-out; background: linear-gradient(to bottom,#3f75cc,#06063b,#06063b,#06063b,#06063b); }
.sea::before { content: ""; height: 12px; width: 8px; background-color: rgba(254, 254, 254, 0.34); filter: blur(3px); position: absolute; top: 2%; left: 43%; }
.star { height: 1.5px; width: 1.5px; position: absolute; top: -50%; right: 18%; background-color: #fff; transition: all 0.5s ease-in-out; filter: blur(0.6px); border-radius: 50%; }
.star::before, .star::after { content: ""; height: 100%; width: 100%; position: absolute; background-color: #fff; transition: all 0.5s ease-in-out; border-radius: 50%; }
.star::before { top: -50%; right: 10px; }
.star::after  { top: 6px;  right: -10px; }
.toggle::before { content: ""; height: 18px; width: 18px; position: absolute; top: 10%; right: 36%; border-radius: 50%; background-color: #ffd34d; transition: all 0.5s ease-in-out; box-shadow: 0 0 8px #fef95fc3; }
.toggle::after { content: ""; height: 16px; width: 16px; position: absolute; top: 10%; left: -70%; border-radius: 50%; background-color: #ffffff; transition: all 0.5s ease-in-out; box-shadow: 0 0 6px #ffffff88; }
#checkbox:checked + .toggle { background: linear-gradient(to bottom, #036daf, #003d63); }
#checkbox:checked + .toggle::before { transform: translateX(160%); }
#checkbox:checked + .toggle::after  { transform: translateX(280%); }
#checkbox:checked + .toggle .mountains { background-color: #05021a; transform: translateY(100%); }
#checkbox:checked + .toggle .sea { bottom: -210%; }
#checkbox:checked + .toggle .star { transform: rotate(10deg); top: 20%; }

.sound-icon-btn {
    padding: 5px 7px;
    min-width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(15,23,42,0.85);
    color: #f9fafb;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
body.dark .sound-icon-btn {
    background: rgba(15,23,42,0.9);
    border-color: #374151;
}

/* Snow/Leaves control panel */
.snow-controls {
    position: fixed;
    left: 14px;
    bottom: 14px;
    max-width: 260px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15,23,42,0.88);
    color: #e5e7eb;
    font-size: 11px;
    line-height: 1.4;
    box-shadow: 0 12px 25px rgba(0,0,0,0.6);
    z-index: 11001;
    backdrop-filter: blur(10px);
    display: none;
}
.snow-controls.show { display: block; }
.snow-controls h2 { font-size: 12px; margin-bottom: 6px; }
.snow-controls small { display: block; margin-bottom: 6px; color: #9ca3af; }
.snow-controls label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 6px; }
.snow-controls input[type="number"], .snow-controls input[type="range"] { flex: 1; }
.snow-controls input[type="number"] { padding: 2px 4px; border-radius: 6px; border: 1px solid #4b5563; background: #020617; color: #e5e7eb; font-size: 10px; width: 70px; }
.snow-controls input[type="range"] { accent-color: #f97373; }
.snow-controls-row { margin-bottom: 6px; }
.snow-controls .checkbox-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

/* Tooltip helper */
.help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #f97373;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}

/* Monkey broom GIF sweeper */
.monkey-sweeper {
    position: fixed;
    bottom: 0px;
    left: -220px;
    z-index: 11002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.monkey-sweeper.show { opacity: 1; }
.monkey-sweeper video {
    display: block;
    height: 140px;
    width: auto;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}

/* Gallery styles */
.polaroid { width: 180px; background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); padding: 10px 10px 14px; transform: rotate(-2deg) translateY(0); opacity: 0; transition: opacity 0.4s ease, transform 0.6s ease; margin-top: 10px; position: absolute; pointer-events: auto; right: 20px; bottom: 80px; z-index: 12001; }
.polaroid img { width: 100%; border-radius: 4px; display: block; background: #0f172a; }
.polaroid .caption { margin-top: 8px; font-size: 12px; color: #111827; }
.polaroid.show { opacity: 1; transform: rotate(-2deg) translateY(-10px); }

.gallery-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 12002;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    border: 2px solid #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
.gallery-toggle-btn:hover { transform: scale(1.05); }
.gallery-toggle-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.gallery-toggle-btn .badge.show { opacity: 1; }

.gallery-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    max-height: 460px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    z-index: 12002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.gallery-header { padding: 14px; border-bottom: 1px solid var(--border-color); font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.03); }
.gallery-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.gallery-item { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--border-color); border-radius: 10px; background: rgba(0,0,0,0.02); }
.gallery-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; background: #e5e7eb; cursor: pointer; border: 1px solid #d1d5db; }
.gallery-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.gallery-time { font-size: 12px; font-weight: 500; color: var(--card-text); }
.gallery-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.gallery-action-btn { padding: 4px 8px; font-size: 10px; border: 1px solid var(--border-color); border-radius: 4px; background: #fff; cursor: pointer; text-decoration: none; color: #374151; text-align: center; flex: 1; white-space: nowrap; transition: background 0.1s; }
body.dark .gallery-action-btn { background: #1f2933; color: #e5e7eb; }
.gallery-action-btn:hover { background: #f3f4f6; }
body.dark .gallery-action-btn:hover { background: #374151; }