/* =============================================================
   COMICBOOK PROTOTYPE — style.css
   Prefix: cb-   (prevents conflicts when integrated elsewhere)
   Fonts: Bangers (titles/SFX), Comic Neue (speech/narration)
   ============================================================= */

/* --- CSS CUSTOM PROPERTIES --- */
:root {
    --cb-bg: #1a1a1a;
    --cb-panel-border: #111;
    --cb-speech-bg: #fff;
    --cb-speech-border: #111;
    --cb-thought-bg: rgba(255, 255, 255, 0.92);
    --cb-narration-bg: rgba(20, 20, 40, 0.92);
    --cb-narration-border: #4af;
    --cb-sfx-color: #ff2200;
    --cb-chapter-color: #fff;
    --cb-font-speech: 'Comic Neue', 'Comic Sans MS', cursive;
    --cb-font-sfx: 'Bangers', cursive;
}

/* --- BASE RESET --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--cb-bg);
    overflow: hidden;       /* Scroll handled by .cb-scroll-proxy + Lenis */
    width: 100vw;
    height: 100vh;
}

/* ============================================================
   3D SCENE
   ============================================================ */

/* Perspective container — fixed, covers full screen */
.cb-viewport {
    position: fixed;
    inset: 0;
    perspective: 900px;
    overflow: hidden;
    z-index: 1;
}

/* The 3D world — panels live inside here, JS translates Z */
.cb-world {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Each panel's 3D wrapper — JS sets translateZ via inline transform */
.cb-item {
    position: absolute;
    left: 0;
    top: 0;
    backface-visibility: hidden;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

/* Text overlay layer — matches .cb-panel size, sits 120px closer to
   the camera for parallax. Default 100vw × 100vh; override per-panel
   with an inline style or modifier class for custom sizes. */
.cb-panel__texts {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%) translateZ(120px);
    pointer-events: none;
}

/* ============================================================
   PANEL CONTAINER
   ============================================================ */

/* The panel itself — default 100vw × 100vh (full screen).
   Override with an inline style or modifier class for custom sizes.
   Use vw/vh or em units — avoid px for responsive layouts. */
.cb-panel {
    position: relative;
    width: 100vw;
    height: 100vh;
    border: 3px solid var(--cb-panel-border);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%);
    border-radius: 3px;
}

/* Real PNG image — fills the panel */
.cb-panel__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Animated MP4 panel — same layout as img */
.cb-panel__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder — colored rectangle used before real PNG is ready */
.cb-panel__placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* background color set via inline style */
}

/* ============================================================
   LAYERED PANELS
   Add class cb-panel--layered to enable bg / mid / fg depth layers.
   Each layer is a transparent PNG floating at a different Z depth.
   Full depth stack (back → front): bg → mid → fg → text bubbles (120px)
   ============================================================ */

.cb-panel--layered {
    transform-style: preserve-3d;
    overflow: visible;
}

.cb-panel__layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-panel__layer--00 { object-fit: contain; transform: translateZ(0px); }
.cb-panel__layer--01 { object-fit: contain; transform-origin: top center; transform: translateZ(80px) translateX(-40%) translateY(20%) scale(1.8); }
.cb-panel__layer--02 { object-fit: contain; transform-origin: top center; transform: translateZ(160px) translateX(25%)  translateY(20%) scale(1.8); }
.cb-panel__layer--03 { object-fit: contain; transform-origin: top center; transform: translateZ(240px) translateX(12%) translateY(20%) scale(1.8); }
.cb-panel__layer--04 { transform: translateZ(80px);                                             }
.cb-panel__layer--05 { transform: translateZ(100px);                                            }

/* ============================================================
   TEXT OVERLAYS — base style
   ============================================================ */

/* All text bubbles share this base */
.cb-text {
    position: absolute;
    font-family: var(--cb-font-speech);
    font-size: var(--cb-text-size, 1rem);
    line-height: 1.35;
    max-width: 14em;
    padding: 0.55em 0.9em;
    border-radius: 1em;
    z-index: 10;
    pointer-events: none;
    /* Smooth appear */
    transition: opacity 0.2s;
}

/* ============================================================
   TEXT TYPES
   ============================================================ */

/* SPEECH — white rounded bubble with thick border and tail */
.cb-text--speech {
    background: var(--cb-speech-bg);
    border: 2.5px solid var(--cb-speech-border);
    color: #111;
    font-weight: 700;
    border-radius: 1.2em;
    box-shadow: 2px 3px 0 rgba(0,0,0,0.18);
}

/* THOUGHT — dashed bubble, italic */
.cb-text--thought {
    background: var(--cb-thought-bg);
    border: 2px dashed #555;
    color: #222;
    font-style: italic;
    font-weight: 400;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    box-shadow: 1px 2px 0 rgba(0,0,0,0.15);
}

/* NARRATION — dark caption box, left accent stripe */
.cb-text--narration {
    background: var(--cb-narration-bg);
    border-left: 4px solid var(--cb-narration-border);
    color: #ddeeff;
    font-weight: 400;
    border-radius: 0 0.4em 0.4em 0;
    font-style: italic;
    box-shadow: 2px 3px 8px rgba(0,0,0,0.4);
}

/* SFX — Bangers font, no background, large outlined text */
.cb-text--sfx {
    font-family: var(--cb-font-sfx);
    font-size: 3rem;
    font-weight: 400;
    color: var(--cb-sfx-color);
    -webkit-text-stroke: 2px #111;
    text-stroke: 2px #111;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    line-height: 1;
    letter-spacing: 0.03em;
    text-shadow:
        3px 3px 0 #111,
        -1px -1px 0 #111;
    max-width: 400px;
}

/* CHAPTER TITLE — large Bangers, centered, used for chapter dividers */
.cb-text--chapter {
    font-family: var(--cb-font-sfx);
    font-size: 4rem;
    font-weight: 400;
    color: var(--cb-chapter-color);
    -webkit-text-stroke: 2px #000;
    text-stroke: 2px #000;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    line-height: 1;
    letter-spacing: 0.05em;
    text-align: center;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.6);
    max-width: 600px;
}

/* ============================================================
   SPEECH BUBBLE TAILS (CSS triangles)
   Add one of these classes alongside cb-text--speech or --thought
   bl = bottom-left   br = bottom-right
   tl = top-left      tr = top-right
   ============================================================ */

/* Shared tail pseudo-element setup */
.cb-tail--bl::after,
.cb-tail--br::after,
.cb-tail--tl::before,
.cb-tail--tr::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

/* Bottom-left tail — points down-left */
.cb-tail--bl::after {
    bottom: -20px;
    left: 18px;
    border-top-color: var(--cb-speech-border);
}
.cb-tail--bl::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    bottom: -17px;
    left: 18px;
    border-top-color: var(--cb-speech-bg);
    z-index: 1;
}

/* Bottom-right tail — points down-right */
.cb-tail--br::after {
    bottom: -20px;
    right: 18px;
    border-top-color: var(--cb-speech-border);
}
.cb-tail--br::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    bottom: -17px;
    right: 18px;
    border-top-color: var(--cb-speech-bg);
    z-index: 1;
}

/* Top-left tail — points up-left */
.cb-tail--tl::before {
    top: -20px;
    left: 18px;
    border-bottom-color: var(--cb-speech-border);
}
.cb-tail--tl::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    top: -17px;
    left: 18px;
    border-bottom-color: var(--cb-speech-bg);
    z-index: 1;
}

/* Top-right tail — points up-right */
.cb-tail--tr::before {
    top: -20px;
    right: 18px;
    border-bottom-color: var(--cb-speech-border);
}
.cb-tail--tr::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    top: -17px;
    right: 18px;
    border-bottom-color: var(--cb-speech-bg);
    z-index: 1;
}

/* ============================================================
   TEXT EFFECTS
   Applied via data-effect attribute on .cb-text elements.
   JS reads the attribute and adds CSS animation classes,
   OR you can use [data-effect="X"] attribute selectors here.
   ============================================================ */

/* --- GLITCH — red/cyan text-shadow flicker (intense emotion) --- */
@keyframes cb-glitch {
    0%   { text-shadow: 2px 0 #ff0040, -2px 0 #00f3ff; transform: translate(0); }
    10%  { text-shadow: -3px 0 #ff0040,  3px 0 #00f3ff; transform: translate(-2px, 1px); }
    20%  { text-shadow:  3px 0 #ff0040, -3px 0 #00f3ff; transform: translate(2px, -1px); }
    30%  { text-shadow: -2px 0 #ff0040,  2px 0 #00f3ff; transform: translate(1px, 2px); }
    40%  { text-shadow:  2px 0 #ff0040, -2px 0 #00f3ff; transform: translate(-1px, 0); }
    50%  { text-shadow: -3px 0 #ff0040,  3px 0 #00f3ff; transform: translate(0, -2px); }
    60%  { text-shadow:  3px 0 #ff0040, -3px 0 #00f3ff; transform: translate(2px, 1px); }
    70%  { text-shadow: -1px 0 #ff0040,  1px 0 #00f3ff; transform: translate(0); }
    80%  { text-shadow:  2px 0 #ff0040, -2px 0 #00f3ff; transform: translate(-2px, 0); }
    90%  { text-shadow: -3px 0 #ff0040,  3px 0 #00f3ff; transform: translate(1px, 1px); }
    100% { text-shadow:  2px 0 #ff0040, -2px 0 #00f3ff; transform: translate(0); }
}

[data-effect="glitch"] {
    animation: cb-glitch 0.35s infinite steps(1);
    color: #fff;
}

/* --- WAVE — vertical character oscillation (flowing/magical speech) --- */
@keyframes cb-wave {
    0%   { transform: translateY(0); }
    25%  { transform: translateY(-4px); }
    50%  { transform: translateY(0); }
    75%  { transform: translateY(4px); }
    100% { transform: translateY(0); }
}

[data-effect="wave"] {
    animation: cb-wave 0.8s ease-in-out infinite;
    display: inline-block;
}

/* --- SHAKE — rapid jitter (explosive/panicked speech) --- */
@keyframes cb-shake {
    0%   { transform: translate(0, 0) rotate(0deg); }
    15%  { transform: translate(-2px, 1px) rotate(-0.5deg); }
    30%  { transform: translate(2px, -1px) rotate(0.5deg); }
    45%  { transform: translate(-1px, 2px) rotate(-0.3deg); }
    60%  { transform: translate(1px, -2px) rotate(0.3deg); }
    75%  { transform: translate(2px, 1px) rotate(-0.5deg); }
    90%  { transform: translate(-2px, -1px) rotate(0.5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

[data-effect="shake"] {
    animation: cb-shake 0.15s linear infinite;
}

/* --- FLICKER — opacity pulse (whisper/uncertain/eerie) --- */
@keyframes cb-flicker {
    0%   { opacity: 1; }
    8%   { opacity: 0.3; }
    10%  { opacity: 1; }
    30%  { opacity: 0.7; }
    32%  { opacity: 1; }
    60%  { opacity: 0.5; }
    62%  { opacity: 1; }
    80%  { opacity: 0.8; }
    82%  { opacity: 1; }
    100% { opacity: 1; }
}

[data-effect="flicker"] {
    animation: cb-flicker 1.2s ease-in-out infinite;
}

/* --- PULSE — gentle scale breath (heartbeat/important emphasis) --- */
@keyframes cb-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

[data-effect="pulse"] {
    animation: cb-pulse 1.5s ease-in-out infinite;
    display: inline-block;
}

/* ============================================================
   HUD — scroll velocity, FPS, coordinates
   Sits above post-processing (z-index 10-12) but below menu UI.
   ============================================================ */
.cb-hud {
    position: fixed;
    inset: 1.25rem;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    font-size: 10px;
    color: rgba(64, 224, 208, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cb-hud-top,
.cb-hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Push top-row to the right so it doesn't overlap the hamburger */
.cb-hud-top {
    padding-left: 3.5rem;
}

.cb-hud strong {
    color: #40e0d0;   /* brighter turquoise for values */
}

/* Thin rule with a small accent square at its right end */
.cb-hud-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.75rem;
    position: relative;
}

.cb-hud-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 5px;
    height: 5px;
    background: #ff2200;   /* matches --cb-sfx-color */
}

/* Progress line — real element replaces ::after so it can receive pointer events */
#cb-hud-progress-line {
    pointer-events: auto;
    cursor: pointer;
}

#cb-hud-progress-line::after {
    display: none; /* replaced by #cb-hud-dot */
}

#cb-hud-dot {
    position: absolute;
    top: -4px;          /* vertically centred on the 1px line */
    left: calc(var(--cb-prog, 0) * (100% - 9px));
    width: 9px;
    height: 9px;
    background: #ff2200;
    cursor: grab;
    /* Expand hit area without changing visual size */
    outline: 6px solid transparent;
}

#cb-hud-status {
    color: #ff2200;
}

#cb-hud-dot:active {
    cursor: grabbing;
}

/* Vertical velocity readout — rotated on the left side */
.cb-hud-center {
    align-self: flex-start;
    margin-top: auto;
    margin-bottom: auto;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Hide on very small screens where it would clutter the UI */
@media (max-width: 480px) {
    .cb-hud { display: none; }
}

/* ============================================================
   POST-PROCESSING OVERLAYS
   Scanlines, vignette, film grain — sit above the 3D scene
   (z-index 1) but below the hamburger / menu UI (z-index 150+).
   ============================================================ */

/* Horizontal scanlines — repeating 4px stripe */
.cb-scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.18) 50%,
        rgba(0, 0, 0, 0.18)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* Vignette — darkens screen edges like a camera lens */
.cb-vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, transparent 40%, #000 120%);
    z-index: 11;
    pointer-events: none;
}

/* Film grain noise — SVG fractal noise at low opacity */
.cb-noise {
    position: fixed;
    inset: 0;
    z-index: 12;
    opacity: 0.06;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ============================================================
   SCROLL PROXY
   Invisible tall element — gives the browser a scrollable
   height. Lenis intercepts and drives the 3D camera.
   JS sets the height based on panel count + spacing.
   ============================================================ */
.cb-scroll-proxy {
    position: absolute;
    width: 100%;
    z-index: -1;
    /* Height set dynamically by script.js */
}

/* ============================================================
   HAMBURGER BUTTON — fixed top-left trigger
   ============================================================ */
.cb-hamburger {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 200;
    width: 2.4rem;
    height: 2.4rem;
    background: rgba(10, 10, 10, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.6rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

.cb-hamburger span {
    display: block;
    width: 1rem;
    height: 2px;
    background: #bbb;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease;
}

/* Animate to × when open */
.cb-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cb-hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.cb-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   SLIDE-OUT MENU PANEL
   ============================================================ */
.cb-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    z-index: 150;
    background: rgba(8, 8, 8, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.6);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 5rem 1.25rem 1.5rem;
    gap: 1.25rem;
    font-family: var(--cb-font-speech);
    font-size: 0.82rem;
    color: #ccc;
    -webkit-user-select: none;
    user-select: none;
}

.cb-menu-panel.open {
    transform: translateX(0);
}

/* Nav links inside panel */
.cb-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cb-nav-home {
    color: #bbb;
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    border-radius: 0.35rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.cb-nav-home:hover { background: rgba(255,255,255,0.08); color: #fff; }

.cb-nav-select {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.35rem;
    color: #bbb;
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    outline: none;
    width: 100%;
}
.cb-nav-select:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.cb-nav-select option { background: #111; color: #ddd; }

/* Divider between nav and audio controls */
.cb-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   AUDIO CONTROLS HUD — dot-control style
   Fixed bottom-right. Two draggable dot controls (Music, SFX)
   with a master mute button and per-channel toggles.
   ============================================================ */

/* Dot color tokens (dark theme) */
:root {
    --dot-bg-color: #0d2e2b;
    --dot-fg-color: #40e0d0;
}

.cb-audio-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Row of two dot controls */
.cb-dotctrl-row {
    display: flex;
    gap: 1rem;
}

.cb-dotctrl-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Draggable dot canvas area */
.cb-dotctrl-control {
    position: relative;
    width: 3rem;
    height: 6.5rem;
    cursor: ns-resize;
    touch-action: none;   /* prevent page scroll while dragging on mobile */
}

/* Scope canvas to the HUD so it doesn't bleed globally */
.cb-audio-hud canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.cb-dotctrl-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #aaa;
    margin-top: 0.4rem;
}

.cb-dotctrl-value {
    font-size: 0.68rem;
    color: #7dcfff;
    margin-top: 0.1rem;
}

/* Per-channel toggle button (below value) */
.cb-audio-toggle {
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.35rem;
    color: #666;
    font-family: inherit;
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    width: 100%;
    text-align: center;
}
.cb-audio-toggle.active {
    background: rgba(80, 180, 255, 0.15);
    border-color: rgba(80, 180, 255, 0.45);
    color: #7dcfff;
}
.cb-audio-toggle:hover { background: rgba(255, 255, 255, 0.12); color: #ddd; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Panel can overflow on short screens */
.cb-menu-panel {
    overflow-y: auto;
}

/* Tablet — slightly smaller controls */
@media (max-width: 768px) {
    .cb-dotctrl-control {
        width: 2.6rem;
        height: 5.5rem;
    }
    .cb-dotctrl-row {
        gap: 0.7rem;
    }
}

/* Mobile — full-width panel, compact controls */
@media (max-width: 480px) {
    .cb-menu-panel {
        width: 100vw;
        border-right: none;
        padding: 5rem 1rem 1.5rem;
    }
    .cb-dotctrl-control {
        width: 2.2rem;
        height: 4.5rem;
    }
    .cb-dotctrl-row {
        gap: 0.5rem;
        justify-content: center;
    }
    .cb-dotctrl-label,
    .cb-dotctrl-value,
    .cb-audio-toggle {
        font-size: 0.6rem;
    }
    .cb-hamburger {
        width: 2rem;
        height: 2rem;
    }
    .cb-hamburger span {
        width: 0.85rem;
    }
}


/* ============================================================
   PORTRAIT ORIENTATION LOCK (mobile only)
   Shows a full-screen prompt when a touch device is in portrait.
   Hidden automatically when the device rotates to landscape.
   ============================================================ */
.cb-rotate-prompt {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #0a0a14;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: center;
    padding: 2rem;
}

@media (pointer: coarse) and (orientation: portrait) {
    .cb-rotate-prompt { display: flex; }
}

.cb-rotate-prompt__icon {
    font-size: 4rem;
    color: #40e0d0;
    animation: cb-rotate-spin 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes cb-rotate-spin {
    0%   { transform: rotate(0deg);   }
    40%  { transform: rotate(-90deg); }
    60%  { transform: rotate(-90deg); }
    100% { transform: rotate(-90deg); }
}

.cb-rotate-prompt__title {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    letter-spacing: 0.05em;
    color: #40e0d0;
}

.cb-rotate-prompt__body {
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 280px;
    line-height: 1.5;
}

/* ── PANEL 02 — per-panel layer overrides ─────────────────── */
.cb-panel--p02 .cb-panel__layer--01 {
    transform: translateZ(80px) translateX(30%) translateY(20%) scale(1.26);
}

/* ── PANEL 03 — per-panel layer overrides ─────────────────── */
.cb-panel--p03 .cb-panel__layer--00 {
    transform: translateZ(0px) scale(1.36);
}

.cb-panel--p03 .cb-panel__layer--01 {
    transform: translateZ(80px) translateX(0%) translateY(35%) scale(0.82);
}

.cb-panel--p03 .cb-panel__layer--02 {
    transform: translateZ(160px) translateX(25%) translateY(40%) scale(0.81);
}

/* ── PANEL 04 — per-panel layer overrides ─────────────────── */
.cb-panel--p04 .cb-panel__layer--00 {
    transform: translateZ(0px) scale(1.3);
}

/* ── PANEL 05 — per-panel layer overrides ─────────────────── */
.cb-panel--p05 .cb-panel__layer--00 {
    transform: translateZ(0px) scale(1.3);
}

/* ── PANEL 06 — per-panel layer overrides ─────────────────── */
.cb-panel--p06 .cb-panel__layer--00 {
    transform: translateZ(0px) scale(1.3);
}
