:root {
    /* Colors */
    --primary-color: #DC2B81;
    --text-color: #333;
    --card-bg: #ffffff;
    --bg-color-main: #f16798;
    --bg-color-bubbles: #dd528b;
    --level-btn-bg: #990266;
    --game-ui-bg: #8c1b64;

    /* Z-Index Layer Management */
    --z-bg: 0;
    --z-content: 10;
    --z-hud: 50; 
    --z-title-dropdown: 2500; /* New layer for dropdown */
    --z-secret-pixel: 100;
    --z-flip-assembly: 100;
    --z-zoom-controls: 100;
    --z-hit-spot: 1400;
    --z-enemy: 1500;
    --z-confetti: 1600;
    --z-loading: 2000;
    --z-modal-overlay: 3000;
    --z-fireworks: 3100;
}

html { background-color: var(--bg-color-main); }

body {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color-main);
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden; 
    
    /* FIX: Allow vertical scrolling, prevent horizontal browser gestures */
    touch-action: pan-y; 
}

/* --- LOADING SCREEN --- */
#loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: var(--z-loading); display: flex; justify-content: center; align-items: center;
    background: transparent; pointer-events: auto; transition: opacity 1s ease; 
}

#loading-logo {
    max-width: 500px; width: calc(100vw - 200px);
    opacity: 0; transform: scale(1.5);
}

.splat-anim { animation: splat 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes splat {
    0% { opacity: 0; transform: scale(1.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* Wrapper to stack logo and bar */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Loading Bar Track */
#loading-bar-container {
    max-width: 500px; 
    width: calc(100vw - 200px); /* Matches logo width */
    height: 4px; /* Thin bar */
    background-color: #812662;
    margin-top: 20px;
    border-radius: 2px;
    overflow: hidden;
}

/* Loading Bar Progress Animation */
#loading-bar-fill {
    height: 100%;
    width: 0%;
    background-color: white;
    /* 3.8s allows it to fill just before the screen fades at 4s */
    animation: load-progress 3.8s linear forwards;
}

@keyframes load-progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* --- BACKGROUND --- */
#animated-bg-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: var(--z-bg); pointer-events: none; overflow: hidden;
}

.bg-layer {
    position: absolute; top: -5%; left: -5%; width: 110%; height: 110%;
    background-repeat: no-repeat; background-size: 100% 100%;
}

.bg-layer-1 { opacity: 1; animation: colony-pulse 14s ease-in-out infinite alternate; }
.bg-layer-2 { opacity: 1; animation: drift-pulse 20s ease-in-out infinite alternate; }
.bg-layer-3 { opacity: 1; animation: spore-swarm 25s ease-in-out infinite alternate; }

@keyframes colony-pulse {
    0% { transform: scale(0.96) translate(0, 0); }
    50% { transform: scale(1.0) translate(1px, 2px); }
    100% { transform: scale(1.08) translate(-1px, -1px); }
}
@keyframes drift-pulse {
    0% { transform: translateY(0) translateX(0) scale(0.98); }
    50% { transform: translateY(10px) translateX(5px) scale(1.03); }
    100% { transform: translateY(0) translateX(-5px) scale(0.98); }
}
@keyframes spore-swarm {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.02) rotate(1deg) translate(5px, 0); }
    50% { transform: scale(0.99) rotate(0deg) translate(0, 5px); }
    75% { transform: scale(1.02) rotate(-1deg) translate(-5px, 0); }
    100% { transform: scale(1) rotate(0deg); }
}

/* --- GAME ELEMENTS (ENEMIES) --- */
.enemy-container {
    position: fixed; z-index: var(--z-enemy); cursor: pointer; pointer-events: auto;
    width: 60px; height: 60px; touch-action: manipulation; 
}

.fly-container, .super-fly-container { transition: top linear, left linear; }
.bee-container { transition: top ease-in, left ease-in; }

.appley-fly, .appley-bee, .appley-super-fly {
    width: 100%; height: 100%; display: block;
}

.appley-fly { animation: fly-wobble 0.2s linear infinite; }
.appley-super-fly { animation: super-loop 0.8s linear infinite, super-flash 0.15s steps(4) infinite; }

@keyframes fly-wobble {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2px, -2px) rotate(5deg); }
    50% { transform: translate(-1px, 1px) rotate(0deg); }
    75% { transform: translate(-2px, -1px) rotate(-5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes super-flash {
    0% { filter: hue-rotate(0deg) brightness(1.5) saturate(2); }
    100% { filter: hue-rotate(360deg) brightness(1.5) saturate(2); }
}

@keyframes super-loop {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(100px, -60px) rotate(90deg); }
    50%  { transform: translate(0, -120px) rotate(180deg); }
    75%  { transform: translate(-100px, -60px) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

.enemy-dead {
    pointer-events: none; animation: enemy-die 0.3s ease-out forwards !important;
    transition: none !important;
}

@keyframes enemy-die {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

.hit-spot {
    position: fixed; width: 60px; height: 60px;
    background: rgba(255, 235, 59, 0.7); border-radius: 50%;
    pointer-events: none; z-index: calc(var(--z-enemy) - 100); 
    transform-origin: center center; animation: hit-splash 0.4s ease-out forwards;
}

@keyframes hit-splash {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* --- EFFECTS --- */
.confetti-piece {
    position: fixed; top: -20px; width: 10px; height: 10px;
    z-index: var(--z-confetti); pointer-events: none;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.firework-particle {
    position: fixed; border-radius: 50%; pointer-events: none;
    z-index: var(--z-fireworks);
}

/* --- MODAL --- */
#generic-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(224, 111, 151, 0.8); z-index: var(--z-modal-overlay);
    display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.5s ease;
}

#generic-modal {
    background: white; border-radius: 25px; padding: 30px; text-align: center;
    max-width: calc(100vw - 50px); width: 300px; transform: scale(0.8);
    opacity: 0; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    display: flex; flex-direction: column; align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); box-sizing: border-box;
}

#generic-modal-overlay.open { opacity: 1; }
#generic-modal-overlay.open #generic-modal { transform: scale(1); opacity: 1; }

#modal-icon { font-size: 4rem; margin-bottom: 10px; display: inline-block; }
.anim-jitter { animation: trophy-jitter 2s infinite ease-in-out; }
.anim-sparkle { animation: sparkle-pulse 1.5s infinite ease-in-out; }

@keyframes trophy-jitter {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg) scale(1.1); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg) scale(1.1); }
    100% { transform: rotate(0deg); }
}

@keyframes sparkle-pulse {
    0% { transform: scale(1) rotate(0deg); filter: hue-rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); filter: hue-rotate(90deg); }
    100% { transform: scale(1) rotate(360deg); filter: hue-rotate(0deg); }
}

#modal-title { color: var(--primary-color); margin: 0 0 10px 0; font-weight: 800; font-size: 1.8rem; }
#modal-msg { font-size: 1.2rem; color: #555; margin: 0 0 20px 0; line-height: 1.4; }

/* New class for the small pause hint text */
.dialog-hint {
    font-size: 0.85rem;
    color: #666;
    display: block;
    margin-top: 10px;
}

#modal-btn {
    background-color: var(--level-btn-bg); color: white; border: none;
    padding: 12px 40px; border-radius: 50px; font-weight: 600;
    font-family: 'Jost', sans-serif; font-size: 1rem; cursor: pointer;
    box-shadow: none; transition: transform 0.1s, box-shadow 0.1s;
    white-space: nowrap; min-width: 140px; width: auto;
}
#modal-btn:active { transform: scale(0.95); }

#modal-link-action {
    margin-top: 15px; font-size: 0.9rem; color: var(--primary-color); 
    text-decoration: underline; cursor: pointer; font-weight: 600; display: none;
}
#modal-link-action:hover { color: var(--level-btn-bg); }

/* --- QUIZ --- */
#quiz-wrapper {
    position: relative; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    transform-style: preserve-3d; backface-visibility: hidden;
}
#quiz-bg-image { max-width: 100%; height: auto; border-radius: 4px; object-fit: contain; display: block; user-select: none; }
#quiz-content {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 25px; box-sizing: border-box;
}
#quiz-question {
    font-weight: 400; color: black; font-size: 2.7rem; text-align: center;
    margin-bottom: 20px; max-width: 50%; background: rgba(255,255,255,0.95); 
    padding: 20px; border-radius: 15px; box-shadow: none; 
}
#quiz-form {
    display: flex; flex-direction: column; gap: 15px; align-items: center;
    background: rgba(255,255,255,0.9); padding: 20px; border-radius: 15px;
}
#quiz-date-input {
    padding: 10px; font-size: 1.1rem; border-radius: 10px; border: 2px solid var(--primary-color);
    font-family: 'Jost', sans-serif; text-align: center; width: 100%; box-sizing: border-box;
}
#quiz-submit-btn {
    background-color: var(--level-btn-bg); color: white; border: none; padding: 12px 30px;
    border-radius: 50px; font-weight: 600; font-family: 'Jost', sans-serif; font-size: 1rem;
    cursor: pointer; transition: transform 0.1s; width: 100%;
}
#quiz-submit-btn:active { transform: scale(0.95); }
.shake-anim { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

#quiz-controls { display: none; justify-content: center; width: 100%; margin-bottom: 20px; }
#secret-year { cursor: pointer; text-decoration: none; color: inherit; }
#achievement-tracker {
    width: 100%; text-align: center; color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem; margin-bottom: 20px; margin-top: 10px; font-weight: 600;
}

/* --- HUD & CONTROLS --- */
#game-hud {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 15px; align-items: center; z-index: var(--z-hud); height: 40px;
    pointer-events: none; /* Allow clicks to pass through empty space */
}

#game-score {
    font-size: 1.2rem; font-weight: 800; background-color: var(--game-ui-bg);
    color: #FFF; box-shadow: 0 4px 6px rgba(0,0,0,0.2); padding: 0 20px; 
    border-radius: 20px; display: none; text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    height: 100%; align-items: center; justify-content: center; white-space: nowrap;
    cursor: pointer; pointer-events: auto; /* Enable clicks on the button itself */
    transition: transform 0.2s, background 0.2s;
}

#game-score:hover { transform: scale(1.1); }
#game-score.game-active { display: flex; }
#game-score.score-complete { animation: pulse-btn 2s infinite; }

#level-buttons-container { display: flex; gap: 10px; height: 100%; align-items: center; pointer-events: auto; }
.level-btn {
    background-color: var(--level-btn-bg); color: #FFF; font-size: 1.2rem; font-weight: 600; 
    padding: 0; border-radius: 50%; border: none; cursor: pointer; box-shadow: none; 
    animation: pulse-btn 2s infinite; height: 100%; width: 40px; 
    display: flex; align-items: center; justify-content: center; margin: 0; 
}
.level-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.3); }
@keyframes pulse-btn {
    0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); }
}

/* --- LAYOUT --- */
#content-wrapper {
    width: 100%; display: flex; flex-direction: column; align-items: center;
    min-height: 100vh; position: relative; z-index: var(--z-content);
    padding: 0 25px; box-sizing: border-box; opacity: 0; transition: opacity 1s ease;
}
header { width: 100%; text-align: center; padding-top: calc(env(safe-area-inset-top) + 30px); padding-bottom: 30px; position: relative; }

/* H1 now just handles layout/text style, no interaction */
h1 {
    margin: 0; font-size: 2.5rem; font-weight: 800; color: white; 
    text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.2; padding: 0 28px;
    pointer-events: none; /* Disable click on padding */
}

/* #main-title moves to the span for precise clicking */
#main-title { 
    cursor: pointer; 
    display: inline-block; 
    transition: opacity 0.2s ease, transform 0.1s ease; 
    user-select: none;
    pointer-events: auto; /* Re-enable click only on text */
}
#main-title:active { transform: scale(0.95); }
#main-title.scrambling { opacity: 0; transform: scale(1.05); }

.secret-pixel {
    position: absolute; width: 24px; height: 24px; background: transparent; 
    z-index: var(--z-secret-pixel); cursor: pointer; display: none; 
}
.sp-top-left { top: 50%; left: 0; transform: translateY(-50%); }
.sp-top-right { top: 50%; right: 0; transform: translateY(-50%); }
.sp-bottom-left { left: 0; top: 50%; transform: translateY(-50%); }
.sp-bottom-right { right: 0; top: 50%; transform: translateY(-50%); }

#footer-logo-container { position: relative; width: 100%; display: flex; justify-content: center; align-items: center; margin-bottom: 5px; }
#footer-logo-link { display: inline-block; text-decoration: none; border: none; margin-bottom: 0; }
#footer-logo-link:hover, #footer-logo-link:active, #footer-logo-link:focus { background: none; opacity: 1; transform: none; box-shadow: none; outline: none; }
main {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; width: 100%; max-width: 1000px;
    padding: 50px 0 20px 0; box-sizing: border-box; position: relative; 
}
footer { width: 100%; padding: 20px 0; text-align: center; font-size: 0.85rem; color: #fff; margin-top: 0; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
footer a { color: inherit; text-decoration: underline; }

/* New RSS Icon Style */
.rss-icon {
    width: 16px;
    height: 16px;
    min-width: 16px; /* Ensure Safari doesn't crunch it */
    vertical-align: middle;
    border: none;
    display: inline-block;
    margin-bottom: 2px;
}

/* --- TITLE & DROPDOWN --- */
#comic-title-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: var(--z-title-dropdown); /* Ensure it stays above comic content */
}

#comic-title {
    margin-bottom: 20px; 
    font-size: 1.4rem; 
    font-weight: 600; 
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2); 
    text-align: center; 
    min-height: 2rem;
    cursor: pointer;
    /* Changed from inline-flex to simple block with text-align to ensure natural text flow with nested icon */
    display: block; 
    user-select: none;
    transition: transform 0.1s;
    pointer-events: auto;
}

#comic-title:active {
    transform: scale(0.98);
    opacity: 0.8;
}

.title-text {
    /* No special styling needed, just a container */
}

.dropdown-icon {
    width: 0.64em; /* Scaled down 20% from 0.8em */
    height: 0.64em;
    filter: brightness(0) invert(1); /* Forces icon to pure white #fff */
    opacity: 0.8;
    transition: transform 0.2s;
    display: inline-block;
    margin-left: 0.4em; /* Spacing next to last letter */
    vertical-align: middle;
    position: relative;
    top: -1px; /* Optical centering */
}

#comic-title.menu-open .dropdown-icon {
    transform: rotate(180deg);
}

#comic-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; 
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    max-width: 90vw;
    max-height: 60vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    overflow-y: auto;
    flex-direction: column;
    padding: 8px 0;
    text-align: left;
}

/* Widen on desktop */
@media (min-width: 801px) {
    #comic-dropdown-menu {
        width: 500px;
        max-width: 90vw;
    }
}

#comic-dropdown-menu.show {
    display: flex;
    animation: dropdown-pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dropdown-pop {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.95); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.dropdown-item {
    padding: 12px 12px;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.1s;
    font-weight: 500;
    display: flex; /* Flex layout for hanging indent */
    align-items: flex-start;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dd-num {
    flex: 0 0 35px; /* Fixed width for numbers creates the alignment column */
    margin-right: 5px;
    text-align: right;
    font-weight: 600;
}

.dd-text {
    flex: 1; /* Takes remaining space, wraps nicely */
}

.dropdown-item:hover {
    background-color: #fce4ec; /* Light pink hover */
    color: var(--primary-color);
}

.dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-item-bonus {
    background-color: #fff8e1; /* Light yellow for bonus items */
    color: #856404;
    /* REMOVED BORDER-LEFT */
}

.dropdown-item-bonus:hover {
    background-color: #ffe8a1;
    color: #856404;
}

.dropdown-item-bonus.active {
    background-color: #ffc107;
    color: #333;
}

.dropdown-divider {
    height: 4px;
    background-color: #eee;
    margin: 0;
    border: none;
}

/* --- COMIC CONTAINER --- */
#comic-container {
    background: var(--card-bg); padding: 20px; margin: 0 0 30px 0;
    width: 100%; display: flex; justify-content: center; align-items: center;
    min-height: auto; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
    position: relative; overflow: hidden; transition: height 0.6s ease-in-out; perspective: 2000px; 
}
#comic-image {
    max-width: 100%; height: auto; border-radius: 4px; object-fit: contain;
    display: block; min-height: auto; user-select: none; -webkit-user-drag: none; transition: opacity 0.1s;
}

.flip-assembly {
    position: absolute; top: 0; left: 0; z-index: var(--z-flip-assembly); pointer-events: none;
    display: flex; flex-direction: row; transition: width 0.6s ease-in-out, height 0.6s ease-in-out, left 0.6s ease-in-out, top 0.6s ease-in-out;
}
.half-panel { position: relative; width: 50%; height: 100%; overflow: hidden; }
.half-panel img { position: absolute; top: 0; width: 200%; height: 100%; object-fit: fill; max-width: none; }
.left-panel img { left: 0; }
.right-panel img { left: -100%; }
.flipper { position: absolute; top: 0; width: 50%; height: 100%; transform-style: preserve-3d; transition: transform 0.6s ease-in-out; z-index: 10; }
.flipper-face { position: absolute; top: 0; left: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-color: var(--card-bg); overflow: hidden; }
.flipper-face::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.flipper-front::after { background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%); }
.flipper-back::after { background: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%); }
.flipper-face img { position: absolute; top: 0; width: 200%; height: 100%; object-fit: fill; max-width: none; }
.flipper-face * { width: 100%; height: 100%; }
.flipper-front { z-index: 2; transform: rotateY(0deg); }
.flipper-back { transform: rotateY(180deg); }

.video-container { width: 100%; height: 0; padding-bottom: 56.25%; position: relative; transform-style: preserve-3d; backface-visibility: hidden; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; border-radius: 4px; }

#zoom-wrapper { 
    width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; 
    cursor: pointer; 
    
    /* FIX: Allow vertical scrolling by default (when not zoomed) */
    touch-action: pan-y; 
}
#zoom-wrapper.active-drag { 
    cursor: grab; 
    transition: none; 
    /* FIX: Disable scrolling only when zoomed in/dragging */
    touch-action: none;
}
#zoom-wrapper.active-drag:active { cursor: grabbing; }

#btn-zoom-trigger {
    position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; padding: 0;
    min-width: auto; border-radius: 50%; background: rgba(255, 255, 255, 0.6); box-shadow: none;
    display: flex; align-items: center; justify-content: center; z-index: 20;
    transition: opacity 0.2s, background 0.2s; cursor: pointer;
}
#btn-zoom-trigger:hover { background: rgba(255, 255, 255, 0.9); }
#btn-zoom-trigger svg { width: 24px; height: 24px; fill: #333; }

#zoom-toolbar {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); padding: 8px 16px;
    border-radius: 30px; display: flex; align-items: center; gap: 10px;
    z-index: var(--z-zoom-controls); opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#zoom-toolbar.visible { opacity: 1; pointer-events: auto; }
#zoom-toolbar button {
    background: transparent; color: white; border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px; min-width: auto; font-size: 0.9rem; border-radius: 15px;
    box-shadow: none; white-space: nowrap; width: auto; 
}
#zoom-toolbar button.circle-btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; line-height: 1; }
#zoom-toolbar button.zoom-out { font-size: 1.6rem; padding-bottom: 4px; }
#zoom-toolbar button:hover { background: rgba(255,255,255,0.2); transform: none; }

.controls { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; width: 100%; margin-bottom: 20px; }
#video-controls { display: none; justify-content: center; width: 100%; margin-bottom: 20px; }

button {
    background-color: white; border: none; color: var(--primary-color);
    padding: 12px 0; width: 135px; border-radius: 50px; font-family: 'Jost', sans-serif;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s, border-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); text-transform: uppercase;
    display: flex; justify-content: center; align-items: center; text-align: center;
}
button:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.secondary-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; width: 100%; }
.secondary-controls button {
    font-size: 0.9rem; width: 135px; padding: 10px 0; background-color: transparent;
    color: #333; border: 1px solid transparent; box-shadow: none; white-space: nowrap;
    display: flex; justify-content: center; align-items: center;
}
@media (hover: hover) {
    .secondary-controls button:hover { background-color: #ffffff; border-color: #ffffff; color: #333; box-shadow: 0 4px 8px rgba(0,0,0,0.1); transform: translateY(-2px); }
}
.secondary-controls button:active { background-color: rgba(255,255,255,0.5); border-color: transparent; }

#footer-logo { width: 100px; height: auto; display: block; transition: width 0.3s ease; }
@media (min-width: 801px) { #footer-logo { width: 150px; } #generic-modal { width: 360px; } }
footer { width: 100%; padding: 20px 0; text-align: center; font-size: 0.85rem; color: #fff; margin-top: 0; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
footer a { color: inherit; text-decoration: underline; }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (min-width: 801px) and (max-width: 1800px) {
    #comic-container { height: auto; width: fit-content; min-height: auto; min-width: auto; }
    #comic-container.video-mode { width: 100%; max-width: 1000px; }
    #comic-image { max-height: 560px; max-width: 100%; height: auto; width: auto; object-fit: contain; }
    .video-container { height: auto; width: 100%; max-width: 996px; aspect-ratio: 16 / 9; padding-bottom: 0; }
    #quiz-wrapper { width: auto; height: auto; position: relative; }
    #quiz-bg-image { max-height: 560px; max-width: 100%; height: auto; width: auto; display: block; }
}

@media (max-width: 600px) {
    h1 { font-size: 1.8rem; margin: 0; }
    
    /* Layout Fixes: COMPLETELY RESET STICKY FOOTER BEHAVIOR ON MOBILE */
    body { min-height: auto; height: auto; }
    #content-wrapper { min-height: auto; height: auto; display: block; } /* display: block disables flex stretching */
    
    main { 
        padding: 20px 0 10px 0; 
        flex: none; /* Redundant if wrapper is block, but good safety */
        margin-bottom: 0;
    }
    
    /* Footer Fixes */
    footer { 
        white-space: normal; 
        overflow: visible; 
        text-overflow: clip; 
        line-height: 1.6;
        padding-bottom: 40px; 
    }

    .controls, .secondary-controls { gap: 10px; }
    .controls, #video-controls, #quiz-controls { margin-bottom: 10px; }
    button, .secondary-controls button { width: auto; min-width: 0; flex: 1; padding: 10px 5px; font-size: 0.9rem; }
    #zoom-toolbar button { flex: none; width: auto; }
    #birthday-btn { padding: 12px 48px; }
    #quiz-content { padding: 5px; }
    #quiz-question { font-size: 1.2rem; padding: 15px 0; max-width: none; width: 100%; margin-bottom: 10px; line-height: 1.1; }
    #quiz-form { padding: 5px; gap: 10px; width: 100%; box-sizing: border-box; }
    #quiz-date-input, #quiz-submit-btn { width: 170px; }
    #quiz-submit-btn { padding: 12px 0; }
}

@media (max-width: 520px) {
    #comic-container { min-height: auto; padding: 10px; }
}

@media (max-width: 480px) {
    header { padding-bottom: 5px; } 
    main { padding-top: 60px; } 
    #comic-title { font-size: 1.2rem; }
    #game-hud { top: 10px; transform: translateX(-50%) scale(0.9); }
    #game-score { font-size: 0.9rem; padding: 0 16px; }
    .level-btn { font-size: 0.9rem; }
    .enemy-container { width: 48px; height: 48px; }
}