/* General page setup */
body.te-overlay-blur #videoContainer {
    filter: blur(6px) brightness(0.45);
    transition: filter 0.6s ease;
}
body.te-overlay-blur #scene1Prompt,
body.te-overlay-blur .scene-popup {
    filter: blur(3px);
    opacity: 0.45;
    transition: filter 0.6s ease, opacity 0.6s ease;
}
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    /* Prevent scrollbars */
}

/* Video frame geometry — #videoContainer is centered and 16:9-capped, so its
   rect is pure viewport math. Overlays and corner buttons use these variables
   to anchor to the video frame rather than the browser window. */
:root {
    --video-width: min(100vw, calc(100vh * (16 / 9)));
    --video-height: min(100vh, calc(100vw * (9 / 16)));
    --video-left: calc((100vw - var(--video-width)) / 2);
    --video-top: calc((100vh - var(--video-height)) / 2);
}

body {
    background-color: #1a1a1a;
    /* Very dark grey */
    display: flex;
    /* Used for centering if needed, but videoContainer handles positioning */
    justify-content: center;
    align-items: center;
    font-family: Helvetica, sans-serif;
    /* Add a default font */
}

/* Container for video and controls */
#videoContainer {
    position: absolute;
    /* Center using absolute positioning */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    /* Take full width */
    height: 100%;
    /* Take full height */
    /* Apply aspect ratio constraints */
    max-width: calc(100vh * (16 / 9));
    /* Max width based on 16:9 aspect ratio relative to height */
    max-height: calc(100vw * (9 / 16));
    /* Max height based on 16:9 aspect ratio relative to width */
    background-color: #000;
    /* Black background for letter/pillarboxing */
    overflow: hidden;
}


/* Video player styling */
#videoPlayer {
    display: block;
    /* Remove extra space below video */
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Scale video while preserving aspect ratio */
}

/* Play button styling */
#playButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* --- Dynamic Circular Shape --- */
    width: 17vmin;
    height: 17vmin;
    border-radius: 50%;
    padding: 0;
    font-size: 4vmin;
    /* --- Appearance --- */
    background-color: rgba(0, 0, 0, 0.5);
    color: hsl(191, 100%, 50%);
    border: none;
    cursor: pointer;
    /* --- Content Centering --- */
    display: flex;
    justify-content: center;
    align-items: center;
    /* --- Stacking --- */
    z-index: 5;
    transition: background-color 0.2s ease;
    /* --- Add Text Glow --- */
    text-shadow: 0 0 7px hsla(191, 100%, 50%, 0.8),
        0 0 14px hsla(191, 100%, 50%, 0.7);

}

/* Apply flicker ONLY when button is enabled and NOT loading */
#playButton:not([disabled]) {
    /* Use the new animation name and a faster duration */
    animation: buzzFlicker 0.1s infinite linear;
    /* Adjust duration (e.g., 0.2s to 0.5s) */
}


#playButton:disabled {
    cursor: default;
    background-color: rgba(50, 50, 50, 0.37);
    color: #aaa;
    text-shadow: none;
    /* Remove glow when disabled */

    /* Ensure flicker stops when disabled */
    animation: none;
    /* Override the flicker animation */
}


#playButton:hover:not([disabled]) {
    background-color: rgba(0, 0, 0, 0.65);
    /* Darken on hover when enabled */
    /* Ensure flicker stops when disabled */
    animation: none;
    /* Override the flicker animation */
}

/* --- Style the LOADING text specifically --- */

#playButton.loading {
    /* --- Change the text color --- */
    color: hsl(0, 100%, 65%);
    /* --- Change the font size --- */
    font-size: 2.5vmin;
    /* Adjust as needed */
    /* --- Optional: Adjust the text glow for the loading state --- */
    text-shadow: 0 0 4px hsla(0, 100%, 65%, 0.8),
        0 0 8px hsla(0, 100%, 65%, 0.6);

    /* --- Explicitly apply animation for loading state --- */
    /* This ensures the flicker runs even with the .loading class */
    animation: buzzFlicker 0.1s infinite linear;

    /* --- Optional: Change background if desired during loading --- */
    /* background-color: rgba(20, 20, 20, 0.6); */
}

/* --- Language Selection Screen --- */
#languageSelectScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.85);
    background-image: url('img/landing_page.jpg?v=02d2a98a8b');
    background-size: cover;
    background-position: center;
}

#languageSelectContainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 10vh;
}

#languageSelectContainer .lang-button+.lang-button {
    margin-left: -2vmin;
}

.lang-button {
    width: 17vmin;
    height: 17vmin;
    border-radius: 50%;
    padding: 0;
    font-size: 3.2vmin;
    background-color: rgba(0, 0, 0, 0.5);
    color: hsl(52, 100%, 91%);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transition: background-color 0.2s ease;
    text-shadow: 0 0 7px hsla(52, 100%, 91%, 0.8),
        0 0 14px hsla(52, 100%, 91%, 0.7);
    animation: buzzFlicker 0.1s infinite linear;
    font-family: Helvetica, sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.lang-button:hover {
    background-color: rgba(0, 0, 0, 0.65);
    animation: none;
}

/* --- Mobile / Tablet Warning Screen --- */
#mobileWarningScreen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3800;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: #000;
    overflow: hidden;
}

#mobileWarningScreen::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('img/landing_page.jpg?v=02d2a98a8b');
    background-size: cover;
    background-position: center;
    filter: blur(14px) brightness(0.45);
    transform: scale(1.08);
    z-index: 0;
    pointer-events: none;
}

.mobile-warning-content {
    position: relative;
    background-color: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    box-shadow: none;
    width: 82vmin;
    max-width: 82vmin;
    height: 82vmin;
    color: hsl(52, 100%, 91%);
    font-family: Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10vmin 8vmin;
    box-sizing: border-box;
    letter-spacing: 0.5px;
    font-weight: 300;
    text-shadow: 0 0 3.5px hsla(52, 100%, 91%, 0.4),
        0 0 7px hsla(52, 100%, 91%, 0.36);
    animation: prereqBuzzFlicker 0.12s infinite linear;
}

.mobile-warning-title {
    font-size: 4.8vmin;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0 0 0.6vmin;
    color: hsl(0, 85%, 68%);
    text-shadow: 0 0 5px hsla(0, 85%, 68%, 0.7),
        0 0 12px hsla(0, 85%, 68%, 0.5);
}

#mobileWarningMessage {
    font-size: 2vmin;
    line-height: 1.45;
    font-weight: 300;
    letter-spacing: 0.5px;
    margin: 0.7vmin 0;
    white-space: pre-line;
}

.mobile-warning-reminder {
    font-size: 2vmin;
    color: hsl(52, 100%, 91%);
    line-height: 1.45;
}

#mobileWarningReminderText {
    font-size: 2.5vmin;
    font-weight: 700;
    margin-bottom: 2.5vmin;
}

.mobile-warning-content .prereq-reminder-copy {
    font-size: 2vmin;
}

.mobile-warning-content .prereq-calendar-link {
    margin-top: 1.5vmin;
    font-size: 1.8vmin;
    padding: 0.8vmin 1.5vmin;
}

.mobile-warning-icons {
    display: flex;
    gap: 1.8vmin;
    justify-content: center;
    align-items: center;
    margin-top: 1.6vmin;
    color: hsl(52, 100%, 91%);
}

.mobile-warning-icon {
    width: 4vmin;
    height: 4vmin;
    filter: drop-shadow(0 0 4.5px hsla(52, 100%, 91%, 0.45));
}

/* --- Loading Overlay and SVG Spinner Styles --- */

#loadingOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Center the spinner SVG */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Stacking and Interaction */
    z-index: 10;
    /* Ensure it's above video and play button */
    pointer-events: none;
    /* Allow clicks to pass through to the button underneath */
    /* Optional: Dim background while loading */
    /* background-color: rgba(0, 0, 0, 0.5); */
}

/* Hide the original progress bar if it's still in the HTML */
#loadingProgress {
    display: none;
}

/* The SVG container for the spinner */
#loadingSpinner {
    /* Match the size of the play button */
    width: 16vmin;
    height: 16vmin;
    /* Start drawing from the top (12 o'clock) instead of the side (3 o'clock) */
    transform: rotate(-90deg);
    overflow: visible;
    /* Prevent stroke from being clipped */
}

/* Common styles for both the track and the moving snake */
#loadingTrack,
#loadingSnake {
    cx: 50;
    /* Center X within the SVG's viewBox */
    cy: 50;
    /* Center Y within the SVG's viewBox */
    r: 48;
    /* Radius (must be less than 50 to account for stroke width, e.g., 50 - stroke-width/2) */
    fill: none;
    /* We only want the outline */
    stroke-width: 4;
    /* Thickness of the line - adjust for desired "pixel" size */
}

/* The background track of the circle */
#loadingTrack {
    stroke: hsla(0, 0%, 27%, 0.24);
    /* Dark grey color for the track */
}

/* The moving "snake" part that shows progress */
#loadingSnake {
    stroke: #00CFFF;
    /* Adjusted blue towards cyan */
    /* stroke-dasharray and stroke-dashoffset are controlled by JavaScript */
    transition: stroke-dashoffset 0.1s linear;
    /* Smooth animation between progress updates */

    /* --- Update the Glow Effect Color --- */
    /* drop-shadow(x-offset y-offset blur-radius color) */
    filter: drop-shadow(0 0 5px rgb(102, 227, 255)) drop-shadow(0 0 10px #9aecff);
    /* Cyan-tinted blue glow */
}

/* Optional: Adjust common styles if needed (no color change here) */
#loadingTrack,
#loadingSnake {
    cx: 50;
    cy: 50;
    r: 48;
    /* Radius (50 - stroke-width/2) */
    fill: none;
    stroke-width: 4;
    /* Keep a decent thickness */
}

/* Optional: Adjust track color if desired */
#loadingTrack {
    stroke: hsla(0, 0%, 27%, 0.201);
    /* Keep the track dark grey, or change if you like */
    /* ... other track styles ... */
}

@keyframes buzzFlicker {

    0%,
    100% {
        opacity: 1;
        /* text-shadow removed */
    }

    50% {
        opacity: 0.85;
        /* Adjust this value (0.8 to 0.95) for desired dip */
        /* text-shadow removed */
    }
}

/* Existing styles.css content might be here */

/* Visually hidden class for accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Credits Button */
#creditsButton {
    position: fixed;
    /* (10 Oct) the onboarding menu's Credits box, measure for measure, so it does not shift between the onboarding and the film */
    bottom: calc(var(--video-top) + var(--video-width) * .02);
    right: calc(var(--video-left) + var(--video-width) * .024);
    padding: calc(var(--video-width) * .006) calc(var(--video-width) * .0095);
    background-color: rgba(0, 0, 0, 0.3);
    /* Semi-transparent black */
    color: rgba(255, 250, 208, .62);                       /* (10 Oct) the onboarding's ink and type, so the film's buttons and the onboarding's match */
    border: 1px solid rgba(255, 250, 208, .45);
    border-radius: calc(var(--video-width) * .0032);
    cursor: pointer;
    z-index: 5000;
    /* Above all modals and overlays */
    font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    font-weight: 300;
    font-size: calc(var(--video-width) * .009);
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: background-color 0.3s;
}

#creditsButton:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Modal styles */
.modal {
    display: none;
    /* Hidden by default, will be changed to 'flex' by JS */
    position: fixed;
    z-index: 2000;
    /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.7);
    /* Dark overlay */
    justify-content: center;
    /* Center modal-content horizontally */
    align-items: center;
    /* Center modal-content vertically */
}

.modal-content {
    background-image: url('img/credit_shot.JPG?v=c8f6d8180a');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Set width and height to be ~85% of the viewport */
    width: 88vw;
    height: 85vh;

    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Aligns .credits-text-container to the bottom */
    align-items: center;
    /* Centers .credits-text-container horizontally */
    padding: 3vh 3vw;
    /* Overall responsive padding inside the modal */
    box-sizing: border-box;
}

.credits-text-container {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    /* Shadow for better readability on image */
    text-align: center;
    font-family: Helvetica, sans-serif;
    /* Reactive font size */
    font-size: 2vmin;
    /* Scales with the smaller of viewport width/height. Adjust as needed. */
    line-height: 1.2;
    /* Restored a sensible line-height */

    width: 100%;
    /* Take full width of the padded area in modal-content */
    /* Constrain to roughly the lower third of the modal's height */
    max-height: 40%;
    /* Percentage of the .modal-content's height */
    overflow-y: hidden;
    /* Scroll if content exceeds this 30% height */
    padding-bottom: 1vh;
    /* Small padding at the very bottom of the text */
}

.credits-text-container p {
    margin: 0.25vmin 0;
    /* Responsive margin for paragraphs */
    font-weight: 300;
    /* Make paragraph text (like names) light/thin */
}

.credits-text-container strong {
    display: block;
    /* Makes the role/title take its own line */
    margin-bottom: 0.25vmin;
    /* Responsive margin */
    font-weight: bold;
    /* Make titles (Dancers, Score, etc.) bold */
}

/* Close button for the modal */
.close-button {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 30px;
    /* Vertically center the '×' */
    text-align: center;
    /* Horizontally center the '×' */
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.close-button:hover,
.close-button:focus {
    background-color: rgba(255, 255, 255, 0.3);
    color: #000;
    /* Darker color on hover for contrast */
    text-decoration: none;
}

/* Instructions Button */
#instructionsButton {
    /* (10 Oct) the onboarding's own (i): a line icon alone in the bottom left corner, no box (the director: "both mean info, it's redundant to have two … keep it consistent") */
    position: fixed;
    left: calc(var(--video-left) + var(--video-width) * .024);
    bottom: calc(var(--video-top) + var(--video-width) * .02);    /* its bottom on the Credits box's bottom line */
    width: calc(var(--video-width) * .0156);               /* the onboarding's mark at its first size (25 px at 1600) */
    height: calc(var(--video-width) * .0156);
    padding: 0;
    background: none;
    border: 0;
    color: rgb(255, 250, 208);
    opacity: .55;
    cursor: pointer;
    z-index: 5000;
    transition: opacity 0.3s;
}

#instructionsButton svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#instructionsButton:hover {
    opacity: 1;
}

/* Fullscreen Button */
#fullscreenButton {
    position: fixed;
    top: calc(var(--video-top) + 20px);
    right: calc(var(--video-left) + 20px);
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    z-index: 5000;
    /* Above all modals and overlays, same as credits/info */
    font-family: Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1;
    transition: background-color 0.3s;
}

#fullscreenButton:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Fullscreen "ESC to exit" toast */
#fullscreenToast {
    position: fixed;
    top: calc(var(--video-top) + 24px);
    left: 50%;
    /* Window centre == video centre, so 50% stays correct */
    transform: translateX(-50%);
    padding: 12px 18px;
    background-color: rgba(0, 0, 0, 0.65);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    z-index: 6500;
    /* Above credits/instructions modals (6000) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#fullscreenToast.visible {
    opacity: 1;
}

/* Credits & Instructions modals must sit above every screen (language select 4000,
   prerequisites 3500, camera request 3000, scene popups 2000) so they can be
   opened and closed from any point in the experience. */
#creditsModal,
#instructionsModal {
    z-index: 6000;
}

/* Instructions Modal - inherits from .modal for basic display/overlay */
.instructions-modal-content {
    background-image: url('img/instructions_bg.jpg?v=05255c7dc3');
    /* Specific background */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Dimensions similar to credits modal */
    width: 85vw;
    height: 85vh;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    /* Center the text container within the modal */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2vh 2vw;
    box-sizing: border-box;
}

.instructions-text-container {
    color: black;
    /* Changed text color to black */
    text-align: left;
    /* Center align paragraphs */
    font-family: Helvetica, sans-serif;
    /* Same font as credits text */
    font-size: clamp(16px, 1.62vh, 20px);
    /* Sized to keep the info text readable while avoiding a desktop scrollbar */
    line-height: 1.26;
    /* Increased line height for readability */
    width: 98%;
    /* Increased width to take up more of the frame */
    max-width: 1550px;
    /* Adjusted max-width accordingly */
    max-height: 100%;
    /* Max height for the text area */
    overflow-y: auto;
    /* Keep fallback scrolling available for unusually small windows */
    padding: 1vh 1.5vw;
    box-sizing: border-box;
    border-radius: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.instructions-text-container::-webkit-scrollbar {
    display: none;
}

.instructions-text-container p,
.instructions-text-container li {
    margin: 0.55vh 0;
    /* Spacing between paragraphs/list items */
    font-weight: 300;
    /* Light/thin for regular text */
}

/* Style for main bolded headings */
.instructions-text-container .instructions-section-title {
    font-size: clamp(20px, 2vh, 24px);
    /* Larger font size for section titles */
    font-weight: bold;
    margin-top: 1.45vh;
    margin-bottom: 0.65vh;
}

/* Ensure other explicitly bolded text is also bold */
.instructions-text-container strong {
    font-weight: bold;
}

.instructions-text-container ul {
    list-style-position: inside;
    /* Keeps bullets aligned with text better for center align */
    padding-left: 0;
    /* Remove default padding as text-align center handles it */
    text-align: left;
    /* Align list items to the left for readability */
    margin-left: auto;
    /* Helps center the block of list items */
    margin-right: auto;
    /* Helps center the block of list items */
    max-width: 100%;
    /* Prevent list from becoming too wide */
}

.instructions-text-container code {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: "Courier New", Courier, monospace;
}

.instructions-text-container .instructions-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.25);
    margin: 1.15vh 0;
}

/* Close button for the instructions modal (can reuse .close-button if identical) */
/* Creating a specific one for clarity, but can be merged if styles are the same */
.close-instructions-button {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 30px;
    /* Vertically center the '×' */
    text-align: center;
    /* Horizontally center the '×' */
    position: absolute;
    top: 15px;
    /* Adjusted slightly for better placement */
    right: 15px;
    /* Adjusted slightly for better placement */
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    z-index: 10;
    /* Ensure it's above the text container */
}

.close-instructions-button:hover,
.close-instructions-button:focus {
    background-color: rgba(255, 255, 255, 0.3);
    color: #000;
    text-decoration: none;
}

/* --- Prerequisites Modal Styles --- */
#prerequisitesModal {
    display: none;
    z-index: 3500;
    background-color: #000;
    flex-direction: column;
    overflow: hidden;
}

#prerequisitesModal::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('img/landing_page.jpg?v=02d2a98a8b');
    background-size: cover;
    background-position: center;
    filter: blur(14px) brightness(0.45);
    transform: scale(1.08);
    z-index: 0;
    pointer-events: none;
}

.prerequisites-content {
    /* position: relative with NO z-index — must not become its own
       stacking context, or mix-blend-mode on the slow_down title can't
       reach the blurred ::before backdrop of #prerequisitesModal. */
    position: relative;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: none;
    color: hsl(52, 100%, 91%);
    font-family: Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vmin;
}

.prereq-slowdown-title {
    display: block;
    width: auto;
    height: auto;
    max-width: 90vmin;
    max-height: 29vmin;
    object-fit: contain;
    mix-blend-mode: screen;
    background: transparent;
    filter: none;
    margin-bottom: 1vmin;
}

.prereq-venn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    transform: translateY(-5vh);
    transform-origin: center center;
}

@media (max-aspect-ratio: 4 / 3) {
    .prereq-venn {
        transform: translateY(-3.5vh) scale(0.82);
    }
}

@media (max-aspect-ratio: 1 / 1) {
    .prereq-venn {
        transform: translateY(-3vh) scale(0.68);
    }
}

.prereq-circle {
    position: relative;
    width: 48vmin;
    height: 48vmin;
    background-color: transparent;
    color: hsl(52, 100%, 91%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5vmin;
    box-sizing: border-box;
    text-align: center;
    text-shadow: 0 0 5px hsla(52, 100%, 91%, 0.6),
        0 0 10px hsla(52, 100%, 91%, 0.53);
    animation: prereqBuzzFlicker 0.12s infinite linear;
    font-family: Helvetica, sans-serif;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.prereq-center {
    width: 57vmin;
    height: 57vmin;
    padding-top: 10vmin;
    padding-bottom: 2vmin;
}

@keyframes prereqBuzzFlicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.925;
    }
}

.prereq-circle::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.prereq-circle>* {
    position: relative;
    z-index: 2;
}

.prereq-circle+.prereq-circle {
    margin-left: -5vmin;
}

.prereq-left {
    z-index: 4;
}

.prereq-right {
    z-index: 3;
}

.prereq-center {
    z-index: 2;
}

.prereq-left .prereq-reminder-icons,
.prereq-right .prereq-reminder-icons {
    margin-bottom: 4vmin;
}

.prereq-left .prereq-text p {
    line-height: 1.8;
}

.prereq-no-mobile {
    display: inline-block;
    margin-top: 4vmin;
    font-size: 2vmin;
    font-weight: 600;
    color: #ff4444;
    text-shadow: 0 0 4px rgba(255, 68, 68, 0.7),
        0 0 9.3px rgba(255, 68, 68, 0.5);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transform: translateY(1vmin);
}

.prereq-text-left,
.prereq-text-right {
    /* Locks the height so different language strings don't shift surrounding icons/buttons */
    height: 14vmin;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prereq-text p {
    margin: 0.7vmin 0;
    font-size: 2vmin;
    line-height: 1.45;
}

.prereq-text .prereq-title {
    font-size: 4.8vmin;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.6vmin;
    margin-top: -7vmin;
    display: block;
}

.prereq-text .prereq-subtitle {
    font-size: 1.75vmin;
    /* Preserve the original line spacing while quieting supporting copy. */
    line-height: 3.045vmin;
    opacity: 0.82;
    text-shadow: none;
    margin-bottom: 0.5vmin;
}

.prereq-text .prereq-subtitle-2 {
    margin-top: 1.2vmin;
}

.prereq-text .quota-line {
    font-style: normal;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    margin: 2.6vmin 0 1.2vmin;
    font-size: 1.55vmin;
    letter-spacing: 0.18em;
    color: hsl(52, 100%, 91%);
    text-shadow: 0 0 5px hsla(52, 100%, 91%, 0.6),
        0 0 10px hsla(52, 100%, 91%, 0.53);
}

.quota-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    white-space: nowrap;
}

.quota-globe {
    width: 30px;
    height: 30px;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 0 3px hsla(195, 100%, 50%, 0.4));
}

#quotaCountdown {
    font-size: 1em;
    letter-spacing: 0.2em;
    opacity: 0.75;
}

.quota-digit {
    color: rgb(253, 81, 81);
    font-weight: 600;
    text-shadow: 0 0 5px hsla(0, 97%, 65%, 0.68),
        0 0 10px hsla(0, 97%, 65%, 0.53);
}

.quota-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgb(253, 81, 81);
    border-radius: 50%;
    animation: quota-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes quota-spin {
    to {
        transform: rotate(360deg);
    }
}

.prerequisites-ok-button {
    width: 14.8vmin;
    height: 14.8vmin;
    border-radius: 50%;
    padding: 0;
    font-size: 1.7vmin;
    transform: translateY(10%);
    background-color: rgba(0, 0, 0, 0.6);
    border: 0.8px solid hsl(195, 100%, 50%);
    color: hsl(195, 100%, 50%);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-weight: 500;
    letter-spacing: 0.12em;
    margin: 1.5vmin 0 0;
    text-shadow: 0 0 6px hsla(195, 100%, 50%, 0.9),
        0 0 14px hsla(195, 100%, 50%, 0.7);
    box-shadow: 0 0 8px hsla(195, 100%, 50%, 0.5),
        inset 0 0 6px hsla(195, 100%, 50%, 0.15);
    animation: prereqBuzzFlicker 0.12s infinite linear;
}

.prerequisites-ok-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: hsl(195, 100%, 65%);
    color: hsl(195, 100%, 65%);
    box-shadow: 0 0 14px hsla(195, 100%, 50%, 0.75),
        inset 0 0 8px hsla(195, 100%, 50%, 0.2);
    transform: translateY(-2px);
}

.prerequisites-ok-button:active {
    transform: translateY(0);
}

.prereq-reminder-icons {
    display: flex;
    gap: 1.2vmin;
    justify-content: center;
    align-items: center;
    margin-bottom: 1vmin;
    color: hsl(52, 100%, 91%);
}

.prereq-icon {
    width: 4vmin;
    height: 4vmin;
    filter: drop-shadow(0 0 4.5px hsla(52, 100%, 91%, 0.45));
}

.side-lead, .prereq-reminder-lead {
    font-size: 2.1vmin;
    font-weight: 400;
    margin-bottom: 1.2vmin;
}

.prereq-left .prereq-text .side-body {
    font-size: 1.7vmin;
    line-height: 3.6vmin;
    opacity: 0.82;
    text-shadow: none;
    font-weight: 300;
}

.prereq-reminder-copy {
    margin: 1vmin 0;
    font-size: 1.75vmin;
    line-height: 1.45;
    user-select: all;
    cursor: text;
    color: hsl(52, 100%, 91%);
    opacity: 0.95;
}

/* Dimmed body text only in the prereq right circle — must not leak to the
   mobile warning screen, which shares .prereq-reminder-copy */
.prereq-right .prereq-reminder-copy {
    font-size: 1.65vmin;
    line-height: 2.9vmin;
    width: 82.5%;
    align-self: center;
    opacity: 0.82;
    text-shadow: none;
}

.prereq-copy-btn {
    background: none;
    border: 1px solid rgba(255, 230, 170, 0.4);
    color: hsl(52, 100%, 91%);
    cursor: pointer;
    font-size: 1.7vmin;
    padding: 0.3vmin 0.7vmin;
    margin-left: 0.5vmin;
    border-radius: 3px;
    vertical-align: middle;
}

.prereq-calendar-link {
    display: inline-block;
    margin-top: 4vmin;
    padding: 1vmin 1.8vmin;
    font-size: 1.75vmin;
    color: #ff4444;
    text-decoration: none;
    border: 1px solid rgba(255, 68, 68, 0.45);
    border-radius: 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 4px rgba(255, 68, 68, 0.7),
        0 0 9.3px rgba(255, 68, 68, 0.5);
    transition: all 0.3s ease;
}

.prereq-right .prereq-calendar-link {
    /* Identical to .prereq-no-mobile transform for perfect lock */
    transform: translateY(1vmin);
}

.prereq-calendar-link:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 68, 68, 0.75);
}

/* --- Camera Request Modal Styles --- */
#cameraRequestModal {
    display: flex;
    z-index: 3000;
    background-color: #000;
    flex-direction: column;
    overflow: hidden;
}

#cameraRequestModal::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('img/landing_page.jpg?v=02d2a98a8b');
    background-size: cover;
    background-position: center;
    filter: blur(14px) brightness(0.45);
    transform: scale(1.08);
    z-index: 0;
    pointer-events: none;
}

.camera-request-content {
    position: relative;
    background-color: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    box-shadow: none;
    width: 82vmin;
    max-width: 82vmin;
    height: 82vmin;
    color: hsl(52, 100%, 91%);
    font-family: Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10vmin 8vmin;
    box-sizing: border-box;
    letter-spacing: 0.5px;
    font-weight: 300;
    text-shadow: 0 0 3.5px hsla(52, 100%, 91%, 0.4),
        0 0 7px hsla(52, 100%, 91%, 0.36);
    animation: prereqBuzzFlicker 0.12s infinite linear;
}

.entry-divider {
    border: none;
    border-top: 1px solid hsla(52, 100%, 91%, 0.18);
    margin: 2vmin 0 1.5vmin;
    width: 40%;
}

.camera-request-text p {
    margin: 0.7vmin 0;
    font-size: 2vmin;
    line-height: 1.45;
}

.camera-request-button {
    width: 14.8vmin;
    height: 14.8vmin;
    border-radius: 50%;
    padding: 0;
    font-size: 1.5vmin;
    background-color: rgba(0, 0, 0, 0.6);
    border: 0.8px solid hsl(195, 100%, 50%);
    color: hsl(195, 100%, 50%);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.1vmin;
    transition: all 0.3s ease;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-weight: 500;
    letter-spacing: 0.12em;
    margin-top: 6vmin;
    text-transform: uppercase;
    text-shadow: 0 0 4px hsla(195, 100%, 50%, 0.6),
        0 0 9.3px hsla(195, 100%, 50%, 0.47);
    box-shadow: 0 0 5.4px hsla(195, 100%, 50%, 0.335),
        inset 0 0 4px hsla(195, 100%, 50%, 0.1);
    animation: prereqBuzzFlicker 0.12s infinite linear;
}

.begin-btn-icon {
    font-size: 3.6vmin;
    line-height: 1;
    filter: drop-shadow(0 0 4px hsla(195, 100%, 50%, 0.1));
}

.begin-btn-label {
    font-size: 1.5vmin;
    line-height: 1;
    letter-spacing: 0.12em;
}

.begin-btn-count {
    font-size: 3.2vmin;
    line-height: 1;
}

.camera-request-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: hsl(195, 100%, 65%);
    color: hsl(195, 100%, 65%);
    box-shadow: 0 0 9.3px hsla(195, 100%, 50%, 0.53),
        inset 0 0 5.4px hsla(195, 100%, 50%, 0.13);
    transform: translateY(-2px);
}

.camera-request-button:active {
    transform: translateY(0);
}

#calibrationCard {
    margin: 4vmin 0 1vmin;
    padding: 2vmin 2.5vmin;
    border: 1px solid hsla(52, 100%, 91%, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
}

.calibration-label {
    display: block;
    font-size: 1.2vmin;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: hsla(52, 100%, 91%, 0.5);
    margin-bottom: 1vmin;
}

#calibrationText {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3vmin;
}

.cal-line {
    display: block;
    font-style: italic;
    font-size: 2.2vmin;
    line-height: 1.4;
    font-weight: 600;
    color: hsl(52, 100%, 91%);
}

.cal-word {
    opacity: 0.25;
    transition: opacity 0.4s ease;
}

.cal-word.active {
    opacity: 1;
    text-shadow: 0 0 4px hsla(52, 100%, 91%, 0.6),
        0 0 9.3px hsla(52, 100%, 91%, 0.47);
}

.camera-request-status {
    font-size: 1.6vmin;
    margin-top: 0.8vmin;
    font-weight: 300;
    color: hsl(52, 100%, 91%);
}

.camera-request-status.error {
    color: hsl(0, 85%, 68%);
    text-shadow: 0 0 3.35px hsla(0, 85%, 68%, 0.7),
        0 0 6.7px hsla(0, 85%, 68%, 0.5);
}

.camera-request-status.success {
    color: hsl(52, 100%, 91%);
    text-shadow: 0 0 4px hsla(52, 100%, 91%, 0.6),
        0 0 9.3px hsla(52, 100%, 91%, 0.47);
}

#micCheckStatus {
    color: hsl(52, 100%, 91%) !important;
    font-size: 1.6vmin !important;
}

/* --- Scene Popup Shared Styles (Bubble Chain Backdrop) --- */
#scene1Popup,
#scene2Popup,
#scene4Popup,
#scene5Popup {
    display: none;
    z-index: 2000;
    background-color: transparent;
    align-items: flex-start;
    padding-top: calc(var(--video-height) * 0.05);
    opacity: 0;
    transition: opacity 1s ease;
    /* Bound to the video frame, not the browser window */
    left: var(--video-left);
    top: var(--video-top);
    width: var(--video-width);
    height: var(--video-height);
    box-sizing: border-box;
}

#scene1Popup.visible,
#scene2Popup.visible,
#scene4Popup.visible,
#scene5Popup.visible {
    opacity: 1;
}

/* Content container — text flows normally, circles are behind */
.scene1-content,
.scene2-content,
.scene3-content,
.scene4-content,
.scene5-content {
    position: relative;
    text-align: center;
    max-width: 700px;
    width: 90%;
    color: hsl(52, 100%, 91%);
    text-shadow: 0 0 5px hsla(52, 100%, 91%, 0.53),
        0 0 10px hsla(52, 100%, 91%, 0.47);
    font-family: Helvetica, sans-serif;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 400;
    margin-top: 1.2vh;
    padding: 3vmin 4vmin;
    background: none;
    border: none;
    animation: buzzFlicker 0.1s infinite linear;
}

.scene1-content p,
.scene2-content p,
.scene3-content p,
.scene4-content p,
.scene5-content p {
    position: relative;
    z-index: 1;
    margin: 0.4em 0;
}

/* Circle chain backdrop — ::before creates the circles via box-shadow */
.scene1-content::before,
.scene2-content::before,
.scene3-content::before,
.scene4-content::before,
.scene5-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18vmin;
    height: 18vmin;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 0;
    pointer-events: none;
}

/* 5-circle scenes: scene 1, 2, 4 — extra circles via box-shadow */
.scene1-content::before,
.scene2-content::before,
.scene4-content::before {
    box-shadow:
        -30vmin 0 0 0 rgba(0, 0, 0, 0.3),
        -15vmin 0 0 0 rgba(0, 0, 0, 0.4),
        15vmin 0 0 0 rgba(0, 0, 0, 0.4),
        30vmin 0 0 0 rgba(0, 0, 0, 0.3);
}

/* All scenes now use 5 circles — scene 3, 5 match the rest */
.scene3-content::before,
.scene5-content::before {
    box-shadow:
        -30vmin 0 0 0 rgba(0, 0, 0, 0.3),
        -15vmin 0 0 0 rgba(0, 0, 0, 0.4),
        15vmin 0 0 0 rgba(0, 0, 0, 0.4),
        30vmin 0 0 0 rgba(0, 0, 0, 0.3);
}

/* (9 Oct, his words: "the cursor popped up with the little hand icon as if there was a button to click … There should not be any hand
   popping up in the scene five loop") scene five's prompt no longer shows a pointer: it was "keep clickable", for the old click-to-continue
   (script.js still listens for a click there as the very last fallback when no voice at all can be played; nothing invites it) */

/* Typewriter word fade-in transition */
.scene1-content p span,
.scene2-content p span,
.scene3-content p span,
.scene4-content p span,
.scene5-content p span {
    transition: opacity 0.7s ease;
}

/* Scene 4 draws its own 85% Normal film composite and 77% crash foam. */
#scene4WaveCanvas {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1999;
    pointer-events: none;
    background: transparent;
}

#scene4WaveCanvas.visible {
    display: block;
}

/* Scene 1 Afterimage Canvas, and the new wash's (6 Oct) */
#scene1WashCanvas {
    position: fixed;
    top: var(--video-top);
    left: var(--video-left);
    width: var(--video-width);
    height: var(--video-height);
    z-index: 2600;
    pointer-events: none;
}

/* Pose Overlay Canvas */
#poseOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    /* Ensure it is above the video (z-index 0 or auto) but below controls if needed */
    pointer-events: none;
    /* Allow clicks to pass through to the video/controls */
}

/* Scene 2 Bubble Canvas — compositor matches the film bounds exactly. */
#scene2Canvas {
    position: fixed;
    top: var(--video-top);
    left: var(--video-left);
    width: var(--video-width);
    height: var(--video-height);
    z-index: 4;
    /* Below controls (z-index 5+), above video */
    pointer-events: none;
    display: none;
    /* Hidden by default */
    opacity: 0;
    transition: none;
}

#scene2Canvas.visible {
    opacity: 1;
}

/* Scene 3 shares the film's luminous dialogue palette. The cue has its own row. */
#scene3Container {
    display: none; position: fixed; z-index: 2001;
    left: var(--video-left); width: var(--video-width);
    top: calc(var(--video-top) + var(--video-height) * .28);
    transform: translateY(-100%); justify-content: center; pointer-events: none;
    color: hsl(52, 100%, 91%); --s3-energy: 0;
}
.scene3-stage { width: min(92%, 700px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scene3-dialogue.scene3-content {
    isolation: isolate; box-sizing: border-box; width: 100%; margin: 0;
    padding: 15px 24px; animation: none;
    font: 400 clamp(16px, 2.1vmin, 21px)/1.45 Helvetica, sans-serif;
}
.scene3-dialogue.scene3-content::before {
    inset: 0; transform: none; width: 100%; height: 100%; border-radius: 0;
    box-shadow: none;
    background: radial-gradient(ellipse at 50% 50%, #000b 0 42%, #0006 64%, transparent 75%);
}
.scene3-dialogue #scene3Prompt { margin: 0; }
.scene3-response {
    position: relative; width: min(100%, 280px); height: clamp(92px, 13vmin, 120px);
    overflow: hidden; isolation: isolate;
}
#scene3Number, #scene3Graphic, #scene3Word {
    position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); margin: 0;
}
#scene3Number {
    font: 400 clamp(38px, 6.6vmin, 64px)/1 'Press Start 2P', monospace;
}
#scene3Graphic { width: clamp(124px, 19vmin, 174px); }
.scene3-hands { display: block; width: 100%; overflow: visible; shape-rendering: crispEdges; filter: drop-shadow(2px 3px 0 #100f18) drop-shadow(0 0 4px #ff728233); }
.scene3-hand-fill { fill: url(#scene3HandFace); stroke: #fff9d1; stroke-width: 2.5; stroke-linejoin: miter; }
.scene3-hand-shadow { fill: #692f48; stroke: #1b1522; stroke-width: 4; }
.scene3-impact { fill: #fff9d1; stroke: none; opacity: 0; }
.scene3-hand-a { transform: translateX(-17px) rotate(-8deg); transform-origin: 50% 90%; }
.scene3-hand-b { transform: translateX(17px) rotate(8deg); transform-origin: 50% 90%; }
#scene3Word {
    font: 400 clamp(27px, 4.6vmin, 42px)/1.2 'Press Start 2P', monospace;
    letter-spacing: .05em; white-space: nowrap;
}
/* A dark stepped extrusion sits behind a separately painted, bevelled face. */
#scene3Number, #scene3Word {
    color: #813447;
    -webkit-text-stroke: 1px #201624;
    text-shadow: 1px 1px #b85362, 2px 2px #a5485b, 3px 3px #84344d,
        4px 4px #66283f, 5px 5px #482338, 6px 6px #171321,
        7px 7px #171321, 0 0 12px #ed59622e;
}
#scene3Number::after, #scene3Word::after {
    content: attr(data-text); position: absolute; inset: 0;
    color: #fff5d2; -webkit-text-fill-color: transparent;
    background-image:
        linear-gradient(112deg, transparent 36%, #fffce788 43%, #ffffff 47%, transparent 54%),
        linear-gradient(to bottom, #ff9a9e 0%, #ed4e65 17%, #ab2f4b 29%,
            #fff7d6 32%, #fff9dc 54%, #d5c4c4 56%, #fff1cf 74%, #bc8eaa 100%);
    background-size: 280% 100%, 100% 100%;
    background-position: 110% 0, 0 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-stroke: .65px #261a2b;
    text-shadow: none;
    filter: drop-shadow(0 -1px 0 #fff8d388);
}
#scene3Container[data-number="3"] #scene3Number::after,
#scene3Container[data-number="1"] #scene3Number::after { animation: s3-shine-a .68s ease-out both; }
#scene3Container[data-number="2"] #scene3Number::after { animation: s3-shine-b .68s ease-out both; }
#scene3Word::after { animation: s3-shine-a .72s ease-out both; }
#scene3Container[data-hit="a"][data-response="voice"] #scene3Word::after { animation: s3-shine-b .48s ease-out both; }
#scene3Container[data-hit="b"][data-response="voice"] #scene3Word::after { animation: s3-shine-a .48s ease-out both; }
@keyframes s3-shine-a { from { background-position: 110% 0, 0 0; } to { background-position: -20% 0, 0 0; } }
@keyframes s3-shine-b { from { background-position: 110% 0, 0 0; } to { background-position: -20% 0, 0 0; } }
#scene3Claps { position: absolute; bottom: 5px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
#scene3Claps span { width: 5px; height: 5px; border: 1px solid #fff9d17a; }
#scene3Claps span.is-filled { background: #fff9d1; box-shadow: 0 0 6px #fff9d18c; }
#scene3Sparks { position: absolute; z-index: 2; width: 256px; height: 160px; left: 50%; top: 44%; transform: translate(-50%, -50%); image-rendering: pixelated; pointer-events: none; filter: drop-shadow(0 0 2px #fff9d14d); }
#scene3Retry { position: relative; z-index: 1; pointer-events: auto; cursor: pointer; margin-top: 12px; border: 1px solid #fff9d16b; background: #14131dcc; color: inherit; padding: 8px 14px; font: inherit; font-size: 14px; }
#scene3Retry:focus-visible { outline: 2px solid #a8ded8; outline-offset: 3px; }
#scene3Container [hidden] { display: none !important; }
#scene3Container[data-phase="error"] .scene3-response,
#scene3Container[data-phase="preparing"] .scene3-response,
#scene3Container[data-phase="paused"] .scene3-response { display: none; }
#scene3Container[data-phase="instruction"] #scene3Prompt { animation: s3-dialogue-in .24s ease-out; }
#scene3Container[data-number="3"] #scene3Number, #scene3Container[data-number="1"] #scene3Number { animation: s3-count-a .2s steps(3,end); }
#scene3Container[data-number="2"] #scene3Number { animation: s3-count-b .2s steps(3,end); }
#scene3Container[data-hit="a"] .scene3-hand-a { animation: s3-left-a .32s steps(4,end); }
#scene3Container[data-hit="a"] .scene3-hand-b { animation: s3-right-a .32s steps(4,end); }
#scene3Container[data-hit="b"] .scene3-hand-a { animation: s3-left-b .32s steps(4,end); }
#scene3Container[data-hit="b"] .scene3-hand-b { animation: s3-right-b .32s steps(4,end); }
#scene3Container[data-hit="a"] .scene3-hand-fill { animation: s3-lit-a .4s steps(4,end); }
#scene3Container[data-hit="b"] .scene3-hand-fill { animation: s3-lit-b .4s steps(4,end); }
#scene3Container[data-hit="a"][data-response="voice"] #scene3Word { animation: s3-voice-a .4s steps(4,end); }
#scene3Container[data-hit="b"][data-response="voice"] #scene3Word { animation: s3-voice-b .4s steps(4,end); }
@keyframes s3-dialogue-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes s3-count-a { from { opacity: .5; translate: 0 5px; scale: 1.12; } }
@keyframes s3-count-b { from { opacity: .5; translate: 0 5px; scale: 1.12; } }
@keyframes s3-left-a { 30% { transform: translateX(-2px) rotate(1deg); } }
@keyframes s3-left-b { 30% { transform: translateX(-2px) rotate(1deg); } }
@keyframes s3-right-a { 30% { transform: translateX(2px) rotate(-1deg); } }
@keyframes s3-right-b { 30% { transform: translateX(2px) rotate(-1deg); } }
@keyframes s3-lit-a { 0%, 25% { fill: #fff9d1; } }
@keyframes s3-lit-b { 0%, 25% { fill: #fff9d1; } }
@keyframes s3-voice-a { 25% { filter: brightness(1.3) drop-shadow(0 0 5px #ed647d77); scale: 1.1; } }
@keyframes s3-voice-b { 25% { filter: brightness(1.3) drop-shadow(0 0 5px #ed647d77); scale: 1.1; } }
@media (prefers-reduced-motion: reduce) {
    #scene3Container *, #scene3Container *::before, #scene3Container *::after { animation: none !important; transition: none !important; }
}

/* --- Mobile / Tablet Overrides --- */
@media (max-width: 768px),
(pointer: coarse) and (hover: none) {

    /* Shrink corner buttons so they don't overlap the warning card */
    #creditsButton,
    #instructionsButton {
        padding: 6px 10px;
        font-size: 11px;
        bottom: 10px;
    }

    #creditsButton {
        right: 10px;
    }

    #instructionsButton {
        left: 10px;
    }

    /* Fullscreen API is unavailable on iOS and mobile is blocked anyway */
    #fullscreenButton {
        display: none;
    }

    /* Bigger language selection buttons on mobile */
    .lang-button {
        width: 26vmin;
        height: 26vmin;
        font-size: 4.5vmin;
    }

    #languageSelectContainer .lang-button+.lang-button {
        margin-left: -3vmin;
    }

    /* Show full landing image without cropping on mobile */
    #languageSelectScreen {
        background-size: contain;
        background-repeat: no-repeat;
        background-color: #000;
    }

    /* Oversized circle clips viewport edges so text can span nearly full width.
       Horizontal padding = 28vmin = (circle_width - content_width)/2 where
       content_width ≈ viewport_width (100vmin), so text sits just inside the
       viewport edges while the dark circle extends beyond them. */
    .mobile-warning-content {
        width: 152vmin;
        max-width: 152vmin;
        height: 152vmin;
        padding: 19vmin 28vmin;
    }

    .mobile-warning-title {
        font-size: 7vmin;
    }

    #mobileWarningMessage {
        font-size: 4.5vmin;
    }

    #mobileWarningReminderText {
        font-size: 4.2vmin;
        padding: 0 6vmin;
    }

    .mobile-warning-reminder {
        font-size: 4.5vmin;
    }

    .mobile-warning-content .prereq-reminder-copy {
        font-size: 3.8vmin;
        padding: 0 6vmin;
    }

    .mobile-warning-content .prereq-calendar-link {
        margin-top: 2.5vmin;
        font-size: 3.5vmin;
        padding: 1.5vmin 3vmin;
    }

    .mobile-warning-icons {
        gap: 3vmin;
        margin-top: 3vmin;
    }

    .mobile-warning-icon {
        width: 7vmin;
        height: 7vmin;
    }
}
