/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Special Elite", system-ui;
    background-color: #0a0a0a;
    color: #e0e0e0;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    width: 100vw;
    width: 100dvw; /* Dynamic viewport width */
}

/* All H1 elements uppercase */
h1 {
    text-transform: uppercase;
}

/* All H2 elements use Metal Mania font */
h2 {
    font-family: "Metal Mania", system-ui;
    font-weight: 400;
    font-style: normal;
}

/* Screen Management */
.screen {
    display: none;
    width: 100vw;
    width: 100dvw;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

/* Pre-Game Screens */
.pregame-container {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(26, 26, 26, 0.9);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
}

.game-title {
    font-family: "Metal Mania", system-ui;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #d4af37;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    margin-bottom: 2rem;
    letter-spacing: 3px;
    font-weight: 400;
    font-style: normal;
    text-transform: uppercase;
    word-wrap: break-word;
}

/* Coupon Entry */
.coupon-entry {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.coupon-entry label {
    font-size: 1.3rem;
    color: #c0c0c0;
}

#coupon-input {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    background-color: #1a1a1a;
    border: 2px solid #2d2d2d;
    color: #e0e0e0;
    border-radius: 5px;
    text-align: center;
    text-transform: uppercase;
    width: 100%;
    max-width: 300px;
}

#coupon-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

#coupon-submit,
#disclaimer-agree,
#qr-continue {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    background-color: #2d2d2d;
    border: 2px solid #d4af37;
    color: #d4af37;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Device Selection */
.device-selection-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.device-selection-content h2 {
    font-size: 1.8rem;
    color: #d4af37;
    margin-bottom: 0.5rem;
}

.device-recommendation {
    font-size: 1rem;
    color: #888;
    font-style: italic;
    margin-bottom: 1rem;
}

.device-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.device-btn {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    border: 2px solid;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.device-btn-primary {
    background-color: #00ff41;
    border-color: #00ff41;
    color: #0a0a0a;
}

.device-btn-primary:hover {
    background-color: #00cc33;
    border-color: #00cc33;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.device-btn-secondary {
    background-color: #2d2d2d;
    border-color: #d4af37;
    color: #d4af37;
}

.device-btn-secondary:hover {
    background-color: #d4af37;
    color: #0a0a0a;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

#coupon-submit:hover,
#disclaimer-agree:hover,
#qr-continue:hover {
    background-color: #d4af37;
    color: #0a0a0a;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.error-message {
    color: #ff4444;
    font-size: 1rem;
    margin-top: 0.5rem;
    min-height: 1.5rem;
}

/* Disclaimer */
.disclaimer-content {
    text-align: left;
    line-height: 1.8;
}

.disclaimer-content h2 {
    color: #d4af37;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 2rem;
}

.disclaimer-content p {
    margin-bottom: 1.5rem;
    color: #c0c0c0;
    font-size: 1.1rem;
}

.disclaimer-content .disclaimer-warning {
    font-weight: bold !important;
    color: #BB0000 !important;
    font-size: 1.2rem;
    text-align: center;
    margin: 1.5rem 0;
}

.disclaimer-content button {
    display: block;
    margin: 2rem auto 0;
}

/* Resume Screen */
.resume-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.resume-content h2 {
    color: #d4af37;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.resume-content > p {
    color: #c0c0c0;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.resume-info {
    background-color: rgba(212, 175, 55, 0.1);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: left;
    min-width: 300px;
}

.resume-info p {
    color: #e0e0e0;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.resume-info p:last-child {
    margin-bottom: 0;
}

.resume-info strong {
    color: #d4af37;
}

.resume-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.resume-btn {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid;
}

.resume-continue-btn {
    background-color: #2d2d2d;
    border-color: #d4af37;
    color: #d4af37;
}

.resume-continue-btn:hover {
    background-color: #d4af37;
    color: #0a0a0a;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.resume-restart-btn {
    background-color: #2d2d2d;
    border-color: #888;
    color: #c0c0c0;
}

.resume-restart-btn:hover {
    background-color: #444;
    color: #e0e0e0;
    border-color: #aaa;
    box-shadow: 0 0 10px rgba(136, 136, 136, 0.3);
}

/* QR Code Screen */
.qr-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.qr-content h2 {
    color: #d4af37;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.qr-content p {
    color: #c0c0c0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.qr-code-container {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #2d2d2d;
    display: inline-block;
}

.qr-codes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
    width: 100%;
    max-width: 900px;
}

.qr-code-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: rgba(26, 26, 26, 0.5);
    border-radius: 10px;
    border: 1px solid #2d2d2d;
}

.qr-code-wrapper p {
    color: #d4af37;
    font-weight: bold;
    margin-bottom: 10px;
}

.tool-management {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(26, 26, 26, 0.7);
    border: 2px solid #2d2d2d;
    border-radius: 10px;
    width: 100%;
    max-width: 600px;
}

.tool-management h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.connected-tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.connected-tool-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    color: #fff;
}

.kick-btn {
    padding: 5px 10px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.kick-btn:hover {
    background: #dc2626;
}

.choice-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.choice-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background-color: #2d2d2d;
    border: 2px solid #d4af37;
    color: #d4af37;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.choice-btn:hover {
    background-color: #d4af37;
    color: #0a0a0a;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

@keyframes staticFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.qr-code-container img {
    width: 300px;
    height: 300px;
    display: block;
}

.qr-code-container #qrcode {
    display: inline-block;
    padding: 0;
}

.qr-code-container #qrcode canvas,
.qr-code-container #qrcode img {
    display: block;
    margin: 0 auto;
}

.toolkit-url-link {
    display: none;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    word-break: break-all;
    text-align: center;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
    max-width: 90%;
}

.toolkit-url-link:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.toolkit-url-link:visited {
    color: rgba(255, 255, 255, 0.7);
}

/* Casting Setup Screen */
.pregame-container.compact {
    padding: 1.5rem;
    max-width: 600px;
}

.cast-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.cast-content h2 {
    color: #d4af37;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.cast-subtitle {
    color: #c0c0c0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cast-buttons-row {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.cast-menu-btn,
.test-sound-btn {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    background-color: #2d2d2d;
    border: 2px solid #d4af37;
    color: #d4af37;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cast-menu-btn:hover,
.test-sound-btn:hover {
    background-color: #d4af37;
    color: #0a0a0a;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.cast-menu-btn:active,
.test-sound-btn:active {
    transform: scale(0.95);
}

.audio-note {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    margin: 0.5rem 0;
}

.cast-ready-btn {
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    background-color: #2d2d2d;
    border: 2px solid #d4af37;
    color: #d4af37;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.cast-ready-btn:hover {
    background-color: #d4af37;
    color: #0a0a0a;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

/* Game Screen */
#game-screen {
    background-color: #000;
    overflow: hidden;
}

.scene-player {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    object-fit: contain;
    background-color: #000;
}

/* Task Overlay */
/* Z-index hierarchy: Video (1) < Task/Interaction (10) < Disclaimer (12) < QR Codes (15) */
.task-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10; /* Standard overlay layer */
}

.task-overlay.hidden {
    display: none;
}

/* Interaction prompt overlay - black background, no visible box around text */
.task-overlay.interaction-prompt {
    background-color: #000000;
    pointer-events: none; /* Allow clicks through to video */
}

.task-overlay.interaction-prompt .task-container {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 2rem;
    pointer-events: auto; /* Re-enable pointer events for the content area */
}

/* Hide the continue button footer for interaction prompts */
.task-overlay.interaction-prompt .task-footer {
    display: none;
}

.task-container {
    max-width: 900px;
    width: 90%;
    max-width: min(900px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(26, 26, 26, 0.98);
    border: 2px solid #2d2d2d;
    border-radius: 10px;
    padding: clamp(1.5rem, 3vw, 3rem);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    box-sizing: border-box;
}

.task-content {
    color: #e0e0e0;
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.8;
    margin-bottom: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.task-content h1 {
    font-family: "Metal Mania", system-ui;
    color: #d4af37;
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 400;
    font-style: normal;
    text-transform: uppercase;
    word-wrap: break-word;
}

.task-content h2 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: clamp(1.2rem, 3vw, 2rem);
    word-wrap: break-word;
}

.task-content h3 {
    color: #d4af37;
    margin-bottom: 0.8rem;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    word-wrap: break-word;
}

.task-content p {
    margin-bottom: 1rem;
    color: #c0c0c0;
}

/* Interaction prompt content - green walkie-style text */
.task-overlay.interaction-prompt .task-content {
    color: #00ff41;
    text-shadow: 
        0 0 10px #00ff41,
        0 0 20px #00ff41,
        0 0 30px rgba(0, 255, 65, 0.5);
    position: relative;
}

.task-overlay.interaction-prompt .task-content h1 {
    color: #00ff41;
    text-shadow: 
        0 0 0px #00ff41,
        0 0 5px #00ff41,
        0 0 7.5px rgba(0, 255, 65, 0.125);
    font-family: "Metal Mania", system-ui;
}

.task-overlay.interaction-prompt .task-content p {
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.6;
}

.task-overlay.interaction-prompt .task-content div {
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.6;
}

.task-overlay.interaction-prompt .task-content ul,
.task-overlay.interaction-prompt .task-content div ul {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
    display: block;
}

.task-overlay.interaction-prompt .task-content li,
.task-overlay.interaction-prompt .task-content div li {
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    line-height: 1.5;
    display: list-item;
}

.task-overlay.interaction-prompt .task-content li::before,
.task-overlay.interaction-prompt .task-content div li::before {
    content: "•";
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    position: absolute;
    left: 0;
    font-size: 1.5em;
    line-height: 1;
}

/* Base station task overlays (v2 prompts) - green walkie styling, no legacy continue button */
.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-footer {
    display: none;
}

#task-continue {
    display: none;
}

.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-container {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 2rem;
}

.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-content {
    font-family: "Special Elite", system-ui;
    color: #00ff41;
    text-shadow:
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.6;
}

.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-content h1 {
    color: #00ff41;
    text-shadow:
        0 0 2.5px #00ff41,
        0 0 5px #00ff41,
        0 0 7.5px rgba(0, 255, 65, 0.125);
    font-family: "Metal Mania", system-ui;
    margin-bottom: 1.5rem;
}

.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-content ul,
.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-content li {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-content li {
    position: relative;
    padding-left: 1.5rem;
}

.task-overlay:not(.disclaimer-overlay-base):not(.sound-test-overlay-base) .task-content li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: #00ff41;
    text-shadow:
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
}

/* Disclaimer overlay inside base station - green walkie-style text */
/* Z-index hierarchy: Video (1) < Task/Interaction (10) < Disclaimer (12) < QR Codes (15) */
.task-overlay.disclaimer-overlay-base {
    background-color: #000000;
    z-index: 12; /* Above standard overlays, below QR codes */
    position: absolute; /* Absolute positioning by default */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: flex-start; /* Start from top instead of center */
    padding: 1rem; /* Add padding to prevent content touching edges */
    overflow: visible; /* No scrolling - base station will expand */
    box-sizing: border-box;
    min-height: 100%; /* Ensure it fills base station view */
}

/* When base station is in content-expand mode, make overlay position relative to affect parent height */
.base-station-view.content-expand .task-overlay.disclaimer-overlay-base {
    position: relative; /* Change to relative so it affects parent height */
    height: auto; /* Allow height to adjust to content */
    min-height: 100%; /* Still fill at minimum */
}

.task-overlay.disclaimer-overlay-base .task-container {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 2rem;
    max-height: none; /* Allow container to expand - base station will grow */
    height: auto;
    min-height: 100%; /* Fill overlay at minimum */
    overflow: visible;
    width: 100%;
    margin: 0; /* Remove any default margins */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Start from top */
    box-sizing: border-box;
}

.task-overlay.disclaimer-overlay-base .disclaimer-content-base {
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    text-align: center;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.task-overlay.disclaimer-overlay-base .disclaimer-content-base h1 {
    color: #00ff41;
    text-shadow: 
        0 0 2.5px #00ff41,
        0 0 5px #00ff41,
        0 0 7.5px rgba(0, 255, 65, 0.125);
    font-family: "Metal Mania", system-ui;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 2rem;
}

.task-overlay.disclaimer-overlay-base .disclaimer-content-base p {
    font-family: "Special Elite", system-ui; /* Standardize text font */
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.task-overlay.disclaimer-overlay-base .disclaimer-warning-base {
    font-family: "Special Elite", system-ui; /* Standardize text font */
    color: #00ff41;
    text-shadow: 
        0 0 8px #00ff41,
        0 0 15px rgba(0, 255, 65, 0.7);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.task-overlay.disclaimer-overlay-base .task-footer {
    margin-top: 3rem;
    margin-bottom: 1rem; /* Add bottom margin to prevent overlap with controls */
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.task-overlay.disclaimer-overlay-base .task-continue-btn {
    font-family: "Special Elite", system-ui; /* Standardize button font */
    background-color: #2d2d2d;
    border: 2px solid #00ff41;
    color: #00ff41;
    box-shadow: 
        0 0 10px rgba(0, 255, 65, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    padding: 1rem 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.task-overlay.disclaimer-overlay-base .task-continue-btn:hover {
    background-color: rgba(0, 255, 65, 0.2);
    box-shadow: 
        0 0 15px rgba(0, 255, 65, 0.8),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Sound test overlay inside base station - green walkie-style text */
/* Z-index hierarchy: Video (1) < Task/Interaction (10) < Disclaimer (12) < Sound Test (13) < QR Codes (15) */
.task-overlay.sound-test-overlay-base {
    background-color: #000000;
    z-index: 13; /* Above disclaimer, below QR codes */
    position: absolute; /* Absolute positioning by default */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: flex-start; /* Start from top instead of center */
    padding: 1rem; /* Add padding to prevent content touching edges */
    overflow: visible; /* No scrolling - base station will expand */
    box-sizing: border-box;
    min-height: 100%; /* Ensure it fills base station view */
}

/* When base station is in content-expand mode, make overlay position relative to affect parent height */
.base-station-view.content-expand .task-overlay.sound-test-overlay-base {
    position: relative; /* Change to relative so it affects parent height */
    height: auto; /* Allow height to adjust to content */
    min-height: 100%; /* Still fill at minimum */
}

.task-overlay.sound-test-overlay-base .task-container {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 2rem;
    max-height: none; /* Allow container to expand - base station will grow */
    height: auto;
    min-height: 100%; /* Fill overlay at minimum */
    overflow: visible;
    width: 100%;
    margin: 0; /* Remove any default margins */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Start from top */
    box-sizing: border-box;
}

.task-overlay.sound-test-overlay-base .sound-test-content-base {
    font-family: "Special Elite", system-ui; /* Standardize text font */
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    text-align: center;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.task-overlay.sound-test-overlay-base .sound-test-content-base h1 {
    color: #00ff41;
    text-shadow: 
        0 0 2.5px #00ff41,
        0 0 5px #00ff41,
        0 0 7.5px rgba(0, 255, 65, 0.125);
    font-family: "Metal Mania", system-ui;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 2rem;
}

.task-overlay.sound-test-overlay-base .sound-test-content-base p {
    font-family: "Special Elite", system-ui; /* Standardize text font */
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.task-overlay.sound-test-overlay-base .sound-test-note {
    font-family: "Special Elite", system-ui; /* Standardize text font */
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px rgba(0, 255, 65, 0.5);
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-style: italic;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.task-overlay.sound-test-overlay-base .sound-test-buttons {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.task-overlay.sound-test-overlay-base .task-footer {
    margin-top: 2rem;
    margin-bottom: 1rem; /* Add bottom margin to prevent overlap with controls */
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.task-overlay.sound-test-overlay-base .task-continue-btn {
    font-family: "Special Elite", system-ui; /* Standardize button font */
    background-color: #2d2d2d;
    border: 2px solid #00ff41;
    color: #00ff41;
    box-shadow: 
        0 0 10px rgba(0, 255, 65, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    padding: 1rem 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.task-overlay.sound-test-overlay-base .task-continue-btn:hover {
    background-color: rgba(0, 255, 65, 0.2);
    box-shadow: 
        0 0 15px rgba(0, 255, 65, 0.8),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Animated glow effect for green button during interaction prompts */
#base-station-green.interaction-glow {
    animation: buttonGlowPulse 1s ease-in-out infinite;
    border-color: #00ff41 !important;
    transform-origin: center center;
    box-shadow: 
        0 0 12px rgba(0, 255, 65, 0.9),
        0 0 24px rgba(0, 255, 65, 0.7),
        0 0 36px rgba(0, 255, 65, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2) !important;
}

@keyframes buttonGlowPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 12px rgba(0, 255, 65, 0.9),
            0 0 24px rgba(0, 255, 65, 0.7),
            0 0 36px rgba(0, 255, 65, 0.5),
            0 2px 8px rgba(0, 0, 0, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.2);
        border-color: #00ff41;
    }
    50% {
        transform: scale(1.04);
        box-shadow: 
            0 0 16px rgba(0, 255, 65, 1),
            0 0 32px rgba(0, 255, 65, 0.8),
            0 0 48px rgba(0, 255, 65, 0.6),
            0 2px 8px rgba(0, 0, 0, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.2);
        border-color: #00ff66;
    }
}

.task-assignment {
    background-color: rgba(212, 175, 55, 0.1);
    border-left: 3px solid #d4af37;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
}

.task-assignment .assigned-to {
    margin: 0;
    color: #d4af37;
}

/* Ritual Assignment Styles */
.ritual-image-container {
    margin: 2rem 0;
    text-align: center;
}

.ritual-image {
    max-width: 100%;
    max-height: 60vh;
    max-height: 60dvh;
    border-radius: 8px;
    border: 2px solid #2d2d2d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.ritual-instructions {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #c0c0c0;
}

.task-assignment .assigned-to strong {
    color: #f0d080;
    font-size: 1.2rem;
}

.task-footer {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.task-continue-btn {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    background-color: #2d2d2d;
    border: 2px solid #d4af37;
    color: #d4af37;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.task-continue-btn:hover:not(:disabled) {
    background-color: #d4af37;
    color: #0a0a0a;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.task-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #555;
    color: #888;
}

/* Music Controls */
.volume-controls {
    position: fixed;
    bottom: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: rgba(26, 26, 26, 0.7);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(45, 45, 45, 0.5);
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    min-width: 40px;
    min-height: 60px;
    width: auto;
    height: auto;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure volume controls stay visible in fullscreen */
:fullscreen .volume-controls,
:-webkit-full-screen .volume-controls,
:-moz-full-screen .volume-controls,
:-ms-fullscreen .volume-controls {
    position: fixed !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
    display: flex !important;
}

/* Ensure icons stay visible in fullscreen */
:fullscreen .volume-icon,
:-webkit-full-screen .volume-icon,
:-moz-full-screen .volume-icon,
:-ms-fullscreen .volume-icon {
    visibility: visible !important;
    opacity: 0.8 !important;
    display: block !important;
}

/* Ensure volume control items stay visible in fullscreen */
:fullscreen .volume-control-item,
:-webkit-full-screen .volume-control-item,
:-moz-full-screen .volume-control-item,
:-ms-fullscreen .volume-control-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.volume-control-item {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    min-height: 20px;
    min-width: 20px;
    width: auto;
    visibility: visible !important;
    opacity: 1 !important;
}

.volume-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.8 !important;
    flex-shrink: 0;
    display: block !important;
    visibility: visible !important;
}

/* Collapsed state - hide sliders by default */
.volume-slider {
    width: 0;
    min-width: 0;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

/* Expanded state on hover */
.volume-controls:hover .volume-slider {
    width: 80px;
    opacity: 1;
}

/* Ensure icons are always visible, even when not hovered */
.volume-controls .volume-icon {
    visibility: visible !important;
    opacity: 0.8 !important;
    display: block !important;
}

/* Ensure control items are always visible */
.volume-controls .volume-control-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure container never collapses - always show icons when not hovered */
.volume-controls:not(:hover) .volume-icon {
    visibility: visible !important;
    opacity: 0.8 !important;
    display: block !important;
}

.volume-controls:not(:hover) .volume-control-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 20px !important;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #d4af37;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #f4cf47;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #d4af37;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    background: #f4cf47;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .screen.active {
        padding: 0.5rem;
        align-items: flex-start;
    }
    
    .pregame-container {
        padding: 1.5rem;
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    
    .resume-content h2 {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }
    
    .resume-content > p {
        font-size: clamp(0.9rem, 2.5vw, 1rem);
    }
    
    .resume-info {
        min-width: auto;
        width: 100%;
        padding: 1rem;
    }
    
    .resume-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .resume-btn {
        width: 100%;
    }
    
    .task-container {
        padding: 1.5rem;
        width: 95%;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    
    .task-content {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    }
    
    .task-content h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
        font-family: "Metal Mania", system-ui;
        font-weight: 400;
        font-style: normal;
    }
    
    .qr-code-container img {
        width: min(250px, 80vw);
        height: auto;
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .screen.active {
        padding: 0.25rem;
    }
    
    .pregame-container {
        padding: 1rem;
        margin: 0.25rem;
    }
    
    .task-container {
        padding: 1rem;
        width: 98%;
    }
    
    .coupon-entry {
        gap: 1rem;
    }
    
    #coupon-input {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    #coupon-submit,
    #disclaimer-agree,
    #qr-continue {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}
