/* ==========================================================================
   Red Seal Ace - Modern PocketPrep & Apple/Tesla Inspired Design System
   ========================================================================== */

:root {
    /* Brand & Theme Colors */
    --primary: #0f172a;
    /* Deep PocketPrep Slate/Navy */
    --primary-light: #1e293b;
    --primary-accent: #2563eb;
    /* Vibrant Royal Blue */
    --accent-gold: #f59e0b;
    /* PocketPrep Gold */
    --accent-cyan: #06b6d4;

    /* Semantic States (PocketPrep Inspired) */
    --correct-color: #10b981;
    /* Emerald Green */
    --correct-bg: #f0fdf4;
    --correct-border: #86efac;
    --correct-glow: rgba(16, 185, 129, 0.2);

    --wrong-color: #ef4444;
    /* Rose Red */
    --wrong-bg: #fef2f2;
    --wrong-border: #fca5a5;
    --wrong-glow: rgba(239, 68, 68, 0.2);

    /* Neutral Colors & Surfaces */
    --bg-page: #f4f7fb;
    /* Ultra-clean Slate Tint */
    --card-bg: #ffffff;
    --card-bg-glass: rgba(255, 255, 255, 0.88);
    --border-color: #e2e8f0;
    --border-light: #edf2f7;

    /* Text Colors */
    --text-primary: #0f172a;
    /* Rich Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Elevation & Shadows */
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.06), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
    --shadow-card: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.8);
    --shadow-btn: 0 6px 18px -3px rgba(15, 23, 42, 0.25);

    /* Radii */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Base & Reset
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    background-image:
        radial-gradient(at 10% 10%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
        radial-gradient(at 90% 15%, rgba(245, 158, 11, 0.06) 0px, transparent 50%),
        radial-gradient(at 50% 95%, rgba(16, 185, 129, 0.04) 0px, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 28px 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   App Container & Challenge Header (3-Line Mobile Optimized Layout)
   -------------------------------------------------------------------------- */
.app-container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

/* Eye-Catching Dark Crimson Iridescent Header Banner */
.challenge-header {
    margin-bottom: 20px;
    padding: 22px 20px;
    background: linear-gradient(140deg, #09090b 0%, #1c0512 25%, #450a1b 60%, #7f1d1d 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px -6px rgba(127, 29, 29, 0.45), 0 4px 12px rgba(9, 9, 11, 0.25);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.challenge-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(225, 29, 72, 0.18) 0%, transparent 60%);
    pointer-events: none;
}

.challenge-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.challenge-pretitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 2px;
}

/* Highlighted "Are you ready" Framed Badge with Normal Case */
.ready-highlight {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.01em;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 1px 3px rgba(0, 0, 0, 0.4);
    background: rgba(244, 63, 94, 0.22);
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid rgba(254, 205, 211, 0.3);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
    text-transform: none;
}

.ready-sub {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fecdd3;
    letter-spacing: 0.02em;
    text-transform: none;
}

.challenge-title {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 3px 0 6px 0;
}

/* --------------------------------------------------------------------------
   Glitch, Subliminal Flash & VHS Interference CTA Container
   -------------------------------------------------------------------------- */
.challenge-cta-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
}

/* Primary Glowing Call-to-Action with Lightning Pulse */
.challenge-cta.cta-primary {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.16rem;
    font-weight: 900;
    color: #fde047;
    /* Radiant Gold */
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    width: 100%;
    text-align: center;
    text-shadow:
        0 0 8px rgba(253, 224, 71, 0.7),
        0 0 20px rgba(245, 158, 11, 0.5),
        0 0 32px rgba(239, 68, 68, 0.3);
    animation: ctaPrimaryGlitch 3.4s ease-in-out infinite;
    transform-origin: center;
    display: inline-block;
}

/* Subliminal Secret Glitch Text ("THINK YOU CAN PASS?") */
.challenge-cta.cta-glitch {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.22rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow:
        -3px 0 #00ffff,
        3px 0 #ff0055,
        0 0 16px rgba(255, 255, 255, 0.95);
    opacity: 0;
    pointer-events: none;
    animation: ctaSecretGlitch 3.4s steps(1, end) infinite;
    transform-origin: center;
}

/* VHS CRT Scanline Static Overlay */
.vhs-scanlines {
    position: absolute;
    inset: -6px -12px;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.45) 0px,
            rgba(0, 0, 0, 0.45) 1px,
            rgba(255, 255, 255, 0.08) 1px,
            rgba(255, 255, 255, 0.08) 2px,
            transparent 2px,
            transparent 4px);
    opacity: 0;
    pointer-events: none;
    border-radius: 8px;
    animation: vhsStaticInterference 3.4s steps(1, end) infinite;
}

/* 1. Keyframes for Main Text: Steady -> Micro-pulse -> Disappear in Glitch -> Big Punch Return */
@keyframes ctaPrimaryGlitch {

    0%,
    87.5%,
    100% {
        opacity: 1;
        transform: scale(1);
        text-shadow:
            0 0 8px rgba(253, 224, 71, 0.7),
            0 0 20px rgba(245, 158, 11, 0.5),
            0 0 32px rgba(239, 68, 68, 0.3);
        filter: brightness(1);
    }

    88.5% {
        opacity: 1;
        transform: scale(1.025);
        text-shadow:
            0 0 12px rgba(253, 224, 71, 0.9),
            0 0 24px rgba(245, 158, 11, 0.7),
            0 0 38px rgba(239, 68, 68, 0.45);
        filter: brightness(1.15);
    }

    89.8% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }

    90.4% {
        opacity: 0;
        transform: skewX(-10deg) scale(0.95);
        filter: blur(1.5px);
    }

    91.7% {
        opacity: 0;
        transform: skewX(10deg) scale(0.95);
    }

    92.0% {
        opacity: 1;
        transform: scale(1.09);
        text-shadow:
            0 0 20px rgba(253, 224, 71, 1),
            0 0 40px rgba(245, 158, 11, 0.95),
            0 0 60px rgba(239, 68, 68, 0.75),
            0 0 85px rgba(245, 158, 11, 0.5);
        filter: brightness(1.4);
    }

    93.6% {
        opacity: 1;
        transform: scale(1);
        text-shadow:
            0 0 8px rgba(253, 224, 71, 0.7),
            0 0 20px rgba(245, 158, 11, 0.5),
            0 0 32px rgba(239, 68, 68, 0.3);
        filter: brightness(1);
    }
}

/* 2. Keyframes for Subliminal Secret Glitch Text: Flash for ~0.08s */
@keyframes ctaSecretGlitch {

    0%,
    90.3%,
    100% {
        opacity: 0;
        transform: scale(0.92);
    }

    90.5% {
        opacity: 1;
        transform: skewX(-8deg) scale(1.05);
        text-shadow: -4px 0 #00ffff, 4px 0 #ff0055, 0 0 20px rgba(255, 255, 255, 1);
    }

    91.1% {
        opacity: 1;
        transform: skewX(6deg) scale(1.03);
        text-shadow: 4px 0 #00ffff, -4px 0 #ff0055, 0 0 15px rgba(255, 0, 85, 0.9);
    }

    91.7% {
        opacity: 0;
        transform: scale(1);
    }
}

/* 3. Keyframes for VHS Static Interference */
@keyframes vhsStaticInterference {

    0%,
    90.3%,
    100% {
        opacity: 0;
    }

    90.5% {
        opacity: 0.85;
        background-color: rgba(255, 255, 255, 0.08);
        transform: translateY(-2px);
    }

    91.1% {
        opacity: 0.7;
        background-color: rgba(225, 29, 72, 0.12);
        transform: translateY(2px);
    }

    91.7% {
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   Main Quiz Card (PocketPrep & Tesla Minimalist Style)
   -------------------------------------------------------------------------- */
.card {
    background: var(--card-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 32px 28px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-smooth);
}

/* --------------------------------------------------------------------------
   Dual Progress Bars (Top of Card)
   -------------------------------------------------------------------------- */
.dual-progress-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 28px 0;
    background: transparent;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
}

/* Top Bar: 5-Question Block Progress (Blue -> Cyan) */
.progress-fill.questions-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
    border-radius: 0 4px 4px 0;
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Bottom Bar: XP / Score / Readiness (Dynamic Red -> Yellow -> Green) */
.progress-fill.xp-fill {
    height: 100%;
    width: 0%;
    background: #ef4444;
    border-radius: 0 4px 4px 0;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.5s ease;
}

.threshold-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.4);
    z-index: 10;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    font-weight: 600;
}

.progress-labels.top-labels {
    margin-bottom: 2px;
}

.progress-labels.bottom-labels {
    margin-top: 2px;
}

.progress-labels-hidden {
    display: none !important;
}

/* Skill Badges */
.skill-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 1px 0;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

.skill-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.skill-badge {
    font-weight: 700;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.badge-novice {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px !important;
    padding: 3px 8px !important;
    display: inline-block;
    background: rgba(148, 163, 184, 0.15) !important;
    color: #64748B !important;
    border: none !important;
}

.badge-apprentice {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px !important;
    padding: 3px 8px !important;
    display: inline-block;
    background: rgba(16, 185, 129, 0.12) !important;
    color: #059669 !important;
    border: none !important;
}

.badge-journeyman {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px !important;
    padding: 3px 8px !important;
    display: inline-block;
    background: rgba(2, 132, 199, 0.12) !important;
    color: #0284C7 !important;
    border: none !important;
}

.badge-master {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px !important;
    padding: 3px 8px !important;
    display: inline-block;
    background: rgba(139, 92, 246, 0.12) !important;
    color: #7C3AED !important;
    border: none !important;
}

.badge-ace {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px !important;
    padding: 3px 8px !important;
    display: inline-block;
    background: rgba(245, 158, 11, 0.15) !important;
    color: #D97706 !important;
    border: none !important;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.3) !important;
}

/* Centered Question Text */
#question-text {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary);
    letter-spacing: -0.015em;
    margin-bottom: 26px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Option Buttons Grid (Refined Top-Anchor Keycap & Structured Divider)
   -------------------------------------------------------------------------- */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 24px;
}

.option-btn {
    position: relative;
    display: flex;
    align-items: flex-start;
    /* Locks keycap to the top row consistently */
    gap: 16px;
    width: 100%;
    padding: 14px 18px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Distinct Keycap Letter Badge with Vertical Separator */
.opt-letter {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    font-size: 1.02rem;
    font-weight: 800;
    background: #f1f5f9;
    color: var(--text-secondary);
    border-radius: 9px;
    transition: all var(--transition-fast);
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    flex-shrink: 0;
    margin-top: 1px;
    position: relative;
}

/* Subtle Vertical Divider between Keycap column and Text column */
.opt-letter::after {
    content: '';
    position: absolute;
    right: -9px;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background: #e2e8f0;
    transition: background var(--transition-fast);
}

/* Option Content Typography with Typographic Balance & Baseline Alignment */
.opt-text {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.45;
    color: #1e293b;
    letter-spacing: -0.01em;
    flex: 1;
    text-wrap: pretty;
    /* Prevents dangling single words like 'it' */
    padding-top: 6px;
    /* Aligns first line baseline perfectly with 38px keycap */
    transition: color var(--transition-fast);
}

.option-btn:hover:not(:disabled) {
    border-color: #94a3b8;
    background-color: #f8fafc;
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-md);
}

.option-btn:hover:not(:disabled) .opt-text {
    color: #0f172a;
}

.option-btn:hover:not(:disabled) .opt-letter {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: var(--text-primary);
}

.option-btn:hover:not(:disabled) .opt-letter::after {
    background: #cbd5e1;
}

.option-btn:active:not(:disabled) {
    transform: scale(0.99);
}

/* Correct Answer State (PocketPrep Green) */
.option-btn.correct {
    border-color: var(--correct-color) !important;
    background: linear-gradient(135deg, #ffffff 0%, var(--correct-bg) 100%) !important;
    box-shadow: 0 0 0 3px var(--correct-glow), var(--shadow-sm) !important;
    animation: correctPulse 0.35s ease-out;
}

.option-btn.correct .opt-text {
    color: #065f46 !important;
    font-weight: 600;
}

.option-btn.correct .opt-letter {
    background: var(--correct-color) !important;
    color: #ffffff !important;
    border-color: var(--correct-color) !important;
}

.option-btn.correct .opt-letter::after {
    background: var(--correct-border) !important;
}

.option-btn.correct::after {
    content: '✓';
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--correct-color);
    padding-left: 8px;
    padding-top: 5px;
    align-self: flex-start;
    font-family: 'Outfit', sans-serif;
}

/* Wrong Answer State (PocketPrep Red) */
.option-btn.wrong {
    border-color: var(--wrong-color) !important;
    background: linear-gradient(135deg, #ffffff 0%, var(--wrong-bg) 100%) !important;
    box-shadow: 0 0 0 3px var(--wrong-glow), var(--shadow-sm) !important;
    animation: shakeSoft 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    cursor: not-allowed;
}

.option-btn.wrong .opt-text {
    color: #991b1b !important;
    font-weight: 600;
}

.option-btn.wrong .opt-letter {
    background: var(--wrong-color) !important;
    color: #ffffff !important;
    border-color: var(--wrong-color) !important;
}

.option-btn.wrong .opt-letter::after {
    background: var(--wrong-border) !important;
}

.option-btn.wrong::after {
    content: '✕';
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--wrong-color);
    padding-left: 8px;
    padding-top: 5px;
    align-self: flex-start;
    font-family: 'Outfit', sans-serif;
}

.option-btn:disabled {
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Explanation Box (PocketPrep Callout)
   -------------------------------------------------------------------------- */
.explanation {
    margin-top: 20px;
    margin-bottom: 24px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.explanation h3 {
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.explanation h3::before {
    content: '💡';
    font-size: 0.95rem;
}

.explanation p {
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--text-primary);
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-weight: 400;
}

/* --------------------------------------------------------------------------
   Controls & Action Button (Tesla/PocketPrep Style Button)
   -------------------------------------------------------------------------- */
.controls {
    display: flex;
    justify-content: flex-end;
}

.primary-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.35);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn::after {
    content: '➔';
    font-size: 1.05rem;
    transition: transform var(--transition-fast);
}

.primary-btn:hover::after {
    transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Utility Classes & Keyframes
   -------------------------------------------------------------------------- */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.015);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shakeSoft {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-3px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(3px, 0, 0);
    }
}

/* --------------------------------------------------------------------------
   Post-Question 5 Overlay (Glassmorphic Trigger)
   -------------------------------------------------------------------------- */
.quiz-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 50;
    border-radius: var(--radius-xl);
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay-glass-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.overlay-badge {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 18px;
    border-radius: var(--radius-full);
}

.overlay-glass-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.overlay-glass-card p {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.pulse-action {
    animation: ctaPrimaryPulse 2.5s infinite;
}

@keyframes ctaPrimaryPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: var(--shadow-btn);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    }
}

/* --------------------------------------------------------------------------
   Assessment & Results Modal
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(226, 232, 240, 0.8);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 32px 28px;
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* Radial / Circular Score Gauge */
.modal-header-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.score-circle-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
}

.circular-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 3;
}

.circle-progress {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.5s ease;
}

.score-number-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.score-percent {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.score-sub-badge {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 6px;
}

/* Performance Tier Badge Variants */
.tier-solid {
    background: #dcfce7;
    color: #15803d;
}

.tier-boundary {
    background: #fef3c7;
    color: #b45309;
}

.tier-needs-improvement {
    background: #fee2e2;
    color: #b91c1c;
}

.modal-body-content {
    text-align: center;
}

.modal-body-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.assessment-feedback-text {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Pacing Breakdown Component */
.pacing-breakdown-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-align: left;
}

.pacing-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pacing-item-row .q-num {
    font-weight: 700;
    color: var(--text-primary);
}

.pacing-item-row .q-time {
    font-family: 'Outfit', monospace;
    font-weight: 600;
}

.pacing-item-row .q-score {
    font-weight: 700;
}

.q-score.positive {
    color: #16a34a;
}

.q-score.zero {
    color: #dc2626;
}

/* Soft-Gate Card */
.soft-gate-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
    border: 1.5px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    text-align: center;
}

.soft-gate-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.soft-gate-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 6px;
}

.soft-gate-card p {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.soft-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.soft-gate-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.soft-gate-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.text-link-btn {
    background: none;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 12px;
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.text-link-btn:hover {
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Responsive Mobile Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .rpg-skills {
        display: flex;
        flex-direction: column;
        gap: 2px;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0 auto;
        width: 100%;
        max-width: 210px;
        position: static;
        transform: none;
        z-index: auto;
    }

    .rpg-skill-name {
        flex: 1;
        text-align: right;
        padding-right: 4px;
        font-size: 11px;
        font-weight: 600;
        color: #475569;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .rpg-skill-badge-wrapper {
        flex: 1;
        text-align: left;
        padding-left: 4px;
        display: flex;
        justify-content: flex-start;
    }

    .rpg-skill-badge {
        font-size: 7px !important;
        padding: 1px 4px !important;
    }

    .rpg-header {
        padding: 8px 10px;
    }

    .rpg-prv-slot {
        width: 80px;
        height: 80px;
    }

    .challenge-header {
        padding: 18px 14px;
        margin-bottom: 16px;
    }

    .ready-highlight {
        font-size: 0.95rem;
        padding: 2px 8px;
    }

    .ready-sub {
        font-size: 0.88rem;
    }

    .challenge-title {
        font-size: 1.32rem;
        margin: 2px 0 5px 0;
    }

    .challenge-cta.cta-primary {
        font-size: 1.02rem;
        letter-spacing: 0.04em;
    }

    .challenge-cta.cta-glitch {
        font-size: 1.05rem;
        letter-spacing: 0.08em;
    }

    .card {
        padding: 22px 16px;
        border-radius: var(--radius-lg);
    }

    .dual-progress-container {
        margin: -22px -16px 18px -16px;
    }

    #question-text {
        font-size: 1.1rem;
        margin-bottom: 18px;
        text-align: center;
    }

    .options-grid {
        gap: 12px;
    }

    .option-btn {
        padding: 12px 14px;
        gap: 14px;
    }

    .opt-letter {
        min-width: 36px;
        height: 36px;
        font-size: 0.94rem;
        border-radius: 8px;
        margin-top: 1px;
    }

    .opt-letter::after {
        right: -8px;
        height: 22px;
    }

    .opt-text {
        font-size: 0.96rem;
        line-height: 1.4;
        padding-top: 6px;
    }
}

/* --------------------------------------------------------------------------
   Auth Modal & Toast Notification
   -------------------------------------------------------------------------- */
.auth-modal-card {
    max-width: 400px;
    padding: 32px 24px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.auth-social-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

.google-btn {
    background: #ffffff;
    color: #3c4043;
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #dadce0;
}

.apple-btn {
    background: #000000;
    color: #ffffff;
    border: none;
}

.apple-btn:hover {
    background: #1a1a1a;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-light);
}

.auth-divider span {
    padding: 0 12px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-form .input-group input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.auth-submit-btn {
    margin-top: 8px;
    width: 100%;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.hidden {
    display: none;
}

.hidden {
    display: none !important;
}



/* =================================================================
   PRV Companion Layer Styles
   ================================================================= */
#prv-companion-layer {
    position: fixed;
    z-index: 9999;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    /* Let clicks pass through container */
}

#prv-companion-layer * {
    pointer-events: auto;
    /* Re-enable for children */
}

/* Fullscreen Mode (Interaction) */
#prv-companion-layer.prv-fullscreen-mode {
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    /* Dark overlay */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#prv-companion-layer.prv-fullscreen-mode #prv-svg-container {
    width: 360px;
    height: auto;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
    transform: translateY(0) scale(1);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Widget Mode (Bottom Right) */
#prv-companion-layer.prv-widget-mode {
    bottom: 70px;
    right: calc(max(20px, 50vw - 320px + 16px));
    width: 120px;
    height: 120px;
    background: transparent;
    backdrop-filter: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    touch-action: none;
    cursor: grab;
    z-index: 1000;
}

#prv-companion-layer.prv-widget-mode:active {
    cursor: grabbing;
}

#prv-companion-layer.prv-widget-mode #prv-svg-container {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    transform-origin: bottom right;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    animation: float-sway 6s ease-in-out infinite;
}

@keyframes float-sway {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-4px) rotate(-2deg);
    }

    50% {
        transform: translateY(0) rotate(0deg);
    }

    75% {
        transform: translateY(-4px) rotate(2deg);
    }
}

/* --- System Note HUD --- */
#prv-system-note {
    position: absolute;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-left: 4px solid #38bdf8;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 14px 20px;
    color: #e0f2fe;
    font-family: 'Outfit', monospace;
    font-size: 14px;
    line-height: 1.5;
    max-width: 400px;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.system-note-icon {
    font-size: 18px;
    margin-top: 2px;
    animation: rotate-gear 4s linear infinite;
}

@keyframes rotate-gear {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.prv-fullscreen-mode #prv-system-note {
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
}

.prv-widget-mode #prv-system-note {
    display: none !important;
    /* Hide system notes in widget mode */
}

/* --- PRV Speech Bubble --- */
#prv-speech-bubble {
    position: absolute;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 14px 18px;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    max-width: 250px;
    z-index: 10;
    transition: opacity 0.2s ease;
}

#prv-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
    display: block;
    width: 0;
}

.prv-fullscreen-mode #prv-speech-bubble {
    top: 30%;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
}

.prv-widget-mode #prv-speech-bubble {
    bottom: 140px;
    right: 20px;
}

.anim-speech-jiggle {
    animation: speech-jiggle 0.2s ease-in-out infinite alternate !important;
}

@keyframes speech-jiggle {
    0% {
        transform: translateX(-50%) translateY(-100%) scale(1) rotate(-1deg);
    }

    100% {
        transform: translateX(-50%) translateY(-100%) scale(1.03) rotate(1deg);
    }
}

/* ================= PRV GLOBAL SPEECH BUBBLE (FLOATING HINT) ================= */
#prv-dialog-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.1) !important;
    /* Ultra-subtle overlay: Questions & choices remain 100% visible and readable! */
    backdrop-filter: none !important;
    /* NO BLUR so quiz text is crystal clear! */
    -webkit-backdrop-filter: none !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 135px !important;
    /* Positioned directly under RPG header near PRV! */
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    opacity: 1;
    pointer-events: auto !important;
    cursor: pointer;
}

#prv-dialog-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}

.prv-modal-bubble {
    background: #0f172a !important;
    /* Premium crisp slate dark box */
    border: 2px solid #38bdf8 !important;
    border-radius: 14px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45), 0 0 20px rgba(56, 189, 248, 0.25) !important;
    width: 100% !important;
    max-width: 420px !important;
    padding: 16px 20px !important;
    color: #f8fafc !important;
    position: relative !important;
    animation: prvBubbleSlideIn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    cursor: default !important;
    user-select: text !important;
    z-index: 100000 !important;
}

/* Comic tail pointing up to PRV slot in the header */
.prv-modal-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 36px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #38bdf8;
}

.prv-modal-bubble::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 37px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #0f172a;
}

@keyframes prvBubbleSlideIn {
    0% {
        transform: translateY(-10px) scale(0.95);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.prv-modal-bubble-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prv-mini-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.prv-avatar-svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.prv-modal-sender {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.prv-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #38bdf8;
}

.prv-status {
    font-size: 10px;
    color: #94a3b8;
}

.prv-bubble-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}

.prv-bubble-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.prv-modal-bubble-body {
    margin-bottom: 10px;
}

#prv-modal-speech-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #f1f5f9;
    font-weight: 500;
}

.prv-modal-bubble-footer {
    display: flex;
    justify-content: flex-end;
}

.prv-hint-text {
    font-size: 10px;
    color: #64748b;
    font-style: italic;
}

/* Staging Area for Drag and Drop */
#prv-parts-staging {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

.draggable-part {
    background: none !important;
    border: none !important;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    transition: transform 0.25s ease;
    font-weight: 600;
    box-shadow: none !important;
}

.draggable-part:hover {
    background: none !important;
    transform: translateY(-2px);
}

.draggable-part:active {
    cursor: grabbing;
}

/* ================= CSS ANIMATIONS ================= */
#prv-eye-left,
#prv-eye-right,
#prv-nose,
#prv-mouth {
    transform-box: fill-box;
    transform-origin: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Повільний дзен-рух зрачків */
.pupil {
    transform-box: fill-box;
    transform-origin: center;
    animation: pupil-zen-look 9s ease-in-out infinite;
}

@keyframes pupil-zen-look {

    0%,
    100% {
        transform: translateX(0);
    }

    25%,
    45% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(0);
    }

    70%,
    90% {
        transform: translateX(3px);
    }
}

/* Моргання / Підмигування */
.anim-blink {
    animation: eye-blink 0.22s ease-in-out;
}

@keyframes eye-blink {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.1);
    }
}

/* Плавне та повільне Дзен-мовлення */
.anim-talking {
    animation: mouth-zen-speak 0.55s ease-in-out infinite;
}

@keyframes mouth-zen-speak {

    0%,
    100% {
        transform: scaleY(1) translateY(0);
    }

    50% {
        transform: scaleY(0.85) translateY(2px);
    }
}

/* Рух носа під час роздумів */
.anim-nose-think {
    animation: nose-bounce 0.4s ease-in-out infinite;
}

@keyframes nose-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}


/* Header Mode for PRV Layer */
#prv-companion-layer.prv-header-mode {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    width: 100%;
    height: 100%;
    transform: none !important;
    z-index: 10;
    pointer-events: auto;
    /* allow clicks */
    cursor: pointer;
}

#prv-companion-layer.prv-header-mode #prv-svg-container {
    width: 70px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    animation: float-sway 6s ease-in-out infinite;
}

#prv-companion-layer.prv-header-mode #prv-system-note {
    bottom: -80px;
    left: 80px;
    width: 250px;
}


/* Header Mode for PRV Layer */
#prv-companion-layer.prv-header-mode {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    width: 100%;
    height: 100%;
    transform: none !important;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

#prv-companion-layer.prv-header-mode #prv-svg-container {
    width: 70px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    animation: float-sway 6s ease-in-out infinite;
}

#prv-companion-layer.prv-header-mode #prv-system-note {
    bottom: -80px;
    left: 80px;
    width: 250px;
}


.prv-skip-btn {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.9);
    color: white;
    border: 1px solid #059669;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
    z-index: 100;
}

.prv-skip-btn:hover {
    background: #059669;
}

/* --- RPG Header Styles --- */
.rpg-header {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 100px;
    max-height: 120px;
}

.rpg-prv-slot {
    width: 90px;
    height: 90px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto 0;
}

#prv-companion-layer.prv-header-mode {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

#prv-companion-layer.prv-header-mode #prv-svg-container {
    width: 75px !important;
    height: 75px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: auto !important;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
    animation: float-sway 6s ease-in-out infinite;
}

#prv-companion-layer.prv-header-mode svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    margin: auto !important;
}

#prv-companion-layer.prv-header-mode #prv-speech-bubble,
#prv-companion-layer.prv-header-mode #prv-system-note,
#prv-companion-layer.prv-header-mode #prv-skip-btn {
    display: none !important;
}

.rpg-skills {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 210px;
    position: static;
    transform: none;
    z-index: auto;
}

.skill-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 1px 0;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

.skill-row:last-child {
    border-bottom: none;
}

.rpg-skill-name {
    flex: 1;
    text-align: right;
    padding-right: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rpg-skill-badge-wrapper {
    flex: 1;
    text-align: left;
    padding-left: 4px;
    display: flex;
    justify-content: flex-start;
}

.rpg-user-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.rpg-avatar {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #eff6ff;
}


@media (max-width: 480px) {
    .rpg-skills {
        display: flex;
        flex-direction: column;
        gap: 2px;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0 auto;
        width: 100%;
        max-width: 210px;
        position: static;
        transform: none;
        z-index: auto;
    }

    .rpg-skill-name {
        flex: 1;
        text-align: right;
        padding-right: 4px;
        font-size: 11px;
        font-weight: 600;
        color: #475569;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .rpg-skill-badge-wrapper {
        flex: 1;
        text-align: left;
        padding-left: 4px;
        display: flex;
        justify-content: flex-start;
    }

    .rpg-skill-badge {
        font-size: 7px !important;
        padding: 1px 4px !important;
    }

    .rpg-header {
        padding: 8px 10px;
    }

    .rpg-prv-slot {
        width: 80px;
        height: 80px;
    }
}

.draggable-part {
    transition: transform 0.25s ease;
}

.draggable-part.is-dragging {
    transition: none;
    /* No transition while actively dragging to prevent lag */
}

.draggable-part .part-label {
    opacity: 1;
    transition: opacity 0.15s ease;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
}

.draggable-part.is-dragging .part-label {
    opacity: 0;
}

#prv-parts-staging {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Level Up & Free Practice Limit Modals */
.level-up-badge-glow {
    animation: levelUpPulse 2s infinite ease-in-out;
}

@keyframes levelUpPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 35px rgba(245, 158, 11, 0.7);
    }
}

.level-card-glass {
    background: rgba(17, 24, 39, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1.5px solid rgba(251, 191, 36, 0.35) !important;
    border-radius: 20px !important;
}