/* Custom Properties for Design System */
:root {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --color-primary: #0f172a;
    --color-primary-light: #1e293b;
    --color-gold: #c59b27;
    --color-gold-hover: #a8811e;
    --color-text-light: #ffffff;
    --color-text-dark: #0f172a;
    --color-text-muted: #64748b;
    --color-green: #10b981;
    --color-red: #ef4444;
    --color-border: rgba(15, 23, 42, 0.08);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
    --font-code: 'Space Grotesk', sans-serif;
    --shadow-premium: 0 10px 30px -10px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.04);
    --shadow-gold-glow: 0 0 20px rgba(197, 155, 39, 0.15);
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gold) var(--bg-dark);
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text-dark);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--color-gold);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-hover);
}

/* Top Persistent Navigation Bar */
.navbar {
    background-color: var(--color-primary);
    border-bottom: 2px solid var(--color-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-gold);
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.menu-btn:hover {
    background-color: rgba(197, 155, 39, 0.15);
    box-shadow: var(--shadow-gold-glow);
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--color-gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.brand-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

.nav-right {
    display: flex;
    align-items: center;
}

/* User Progression Display */
.user-progression {
    display: flex;
    align-items: center;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--color-border);
    border-radius: 30px;
    padding: 0.25rem 1rem;
    gap: 1rem;
}

.rank-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.gold-icon {
    color: var(--color-gold);
}

.xp-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.xp-label {
    color: var(--color-gold);
    font-family: var(--font-code);
}

.xp-value {
    background: linear-gradient(135deg, var(--color-gold), #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar Chapter Drawer */
.sidebar-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background-color: var(--bg-card);
    border-right: 1px solid var(--color-border);
    z-index: 105;
    transition: left var(--transition-speed) cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0,0,0,0.8);
}

.sidebar-drawer.open {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-family: var(--font-heading);
    color: var(--color-gold);
    font-size: 1.2rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--color-gold);
}

.chapter-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all var(--transition-speed);
    gap: 1rem;
}

.chapter-item:hover:not(.locked) {
    background-color: var(--bg-card-hover);
}

.chapter-item.active {
    background-color: rgba(25, 54, 93, 0.5);
    border-left: 4px solid var(--color-gold);
}

.chapter-num {
    font-family: var(--font-code);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gold);
    opacity: 0.7;
}

.chapter-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chapter-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-dark);
}

.chapter-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.chapter-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.lock-icon {
    color: var(--color-text-muted);
}

.arrow-icon {
    color: var(--color-gold);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.reset-btn {
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--color-red);
    color: var(--color-red);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    font-family: var(--font-body);
    font-weight: 600;
}

.reset-btn:hover {
    background-color: var(--color-red);
    color: white;
}

/* Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 104;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

/* Module Tabs Subnav */
.module-tabs {
    display: flex;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--color-border);
    justify-content: center;
    position: sticky;
    top: 67px;
    z-index: 99;
}

.tab-btn {
    flex: 1;
    max-width: 250px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    padding: 1rem 0;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--color-text-dark);
    background-color: rgba(255,255,255,0.02);
}

.tab-btn.active {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
    background-color: rgba(197, 155, 39, 0.05);
}

/* Main Content Area */
.main-container {
    flex-grow: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* SPA Sections visibility */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Headings */
.chapter-intro-banner {
    background: linear-gradient(135deg, var(--color-primary), var(--bg-card));
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.chapter-badge {
    background-color: var(--color-gold);
    color: var(--bg-dark);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 1px;
}

.chapter-intro-banner h1 {
    font-family: var(--font-heading);
    margin: 0.5rem 0;
    color: var(--color-text-dark);
    font-size: 2.2rem;
}

.chapter-intro-banner p {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-subtext {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   PHASE 1: LEARN INTERFACE
   ========================================================================== */

/* Swipe Concept Cards */
.deck-container {
    margin-bottom: 3rem;
}

.swipe-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 1rem 0;
}

.card-stack {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 300px;
    perspective: 1000px;
}

.concept-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-premium);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.6s ease;
    cursor: grab;
    user-select: none;
    backface-visibility: hidden;
}

.concept-card:active {
    cursor: grabbing;
}

.concept-card.hidden {
    opacity: 0;
    pointer-events: none;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.card-index {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--color-gold);
}

.card-term {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-text-dark);
}

.card-body {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.card-body strong {
    color: var(--color-gold);
}

.card-footer-tip {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--color-gold);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
}

/* Control buttons below cards */
.swipe-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.swipe-btn {
    background-color: var(--color-primary);
    border: 1px solid var(--color-border);
    color: var(--color-gold);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.swipe-btn:hover {
    background-color: var(--color-gold);
    color: var(--bg-dark);
    box-shadow: var(--shadow-gold-glow);
}

.card-indicator {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 900px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

.calc-card, .chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-premium);
}

.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.slider-val {
    font-family: var(--font-code);
    color: var(--color-gold);
    font-weight: 700;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-gold);
    cursor: pointer;
    box-shadow: var(--shadow-gold-glow);
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Metrics Displays */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.metric-box {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-box.highlighted {
    border-color: var(--color-gold);
    background-color: rgba(197, 155, 39, 0.05);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-family: var(--font-code);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
}

.metric-box.highlighted .metric-value {
    color: var(--color-gold);
}

/* Data Vis Canvas */
.canvas-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--color-border);
}

canvas {
    max-width: 100%;
    height: auto;
}

/* Historical Timeline Anchors */
.timeline-section {
    margin-top: 2rem;
}

.timeline-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem 2rem 0.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--color-gold) rgba(0,0,0,0.1);
}

.timeline-card {
    flex: 0 0 320px;
    scroll-snap-align: start;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-dark));
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    transition: transform var(--transition-speed);
}

.timeline-card:hover {
    transform: translateY(-5px);
}

.timeline-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1.5rem;
    width: 25px;
    height: 4px;
    background-color: var(--color-gold);
    border-radius: 0 0 2px 2px;
}

.timeline-year {
    font-family: var(--font-code);
    color: var(--color-gold);
    font-weight: 700;
    font-size: 1.25rem;
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-text-dark);
}

.timeline-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.timeline-lesson {
    background-color: rgba(26, 54, 93, 0.4);
    border-left: 2px solid var(--color-gold);
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* ==========================================================================
   PHASE 2: PLAY INTERFACE (SIMULATOR)
   ========================================================================== */

.simulator-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.scenario-card {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-premium);
}

.scenario-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scenario-icon {
    font-size: 1.5rem;
    color: var(--color-gold);
}

.scenario-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-gold);
    letter-spacing: 1px;
    font-weight: 700;
}

.scenario-card h3 {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
}

#scenario-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.scenario-details {
    margin-top: 0.5rem;
    font-family: var(--font-code);
    font-weight: 600;
    color: var(--color-gold);
}

/* Drag and Drop Grid */
.drag-drop-arena {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .drag-drop-arena {
        grid-template-columns: 1fr;
    }
}

.drop-zone-wrapper, .supply-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.zone-header {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ayes-theme {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--color-green);
    color: var(--color-green);
}

.nays-theme {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--color-red);
    color: var(--color-red);
}

.neutral-theme {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-light);
}

.drop-zone {
    background-color: rgba(0,0,0,0.25);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    min-height: 250px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
    transition: all var(--transition-speed);
}

.drop-zone.dragover {
    background-color: rgba(197, 155, 39, 0.05);
    border-color: var(--color-gold);
}

.zone-placeholder {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin: auto;
    pointer-events: none;
}

.zone-sum {
    text-align: right;
    font-family: var(--font-code);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-muted);
}

/* Supply Area */
.supply-area {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 250px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.75rem;
}

.supply-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Draggable MP Tokens */
.mp-token {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: grab;
    width: 100%;
    max-width: 220px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.mp-token:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.mp-token:hover {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(197, 155, 39, 0.2);
}

.token-info {
    display: flex;
    flex-direction: column;
}

.token-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.token-coalition {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.token-count {
    background-color: rgba(197, 155, 39, 0.15);
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Simulator Control Buttons */
.simulator-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.action-btn {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background-color: var(--color-gold);
    color: var(--bg-dark);
    border: 1px solid var(--color-gold);
}

.primary-btn:hover {
    background-color: var(--color-gold-hover);
    box-shadow: var(--shadow-gold-glow);
}

.secondary-btn {
    background-color: transparent;
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
}

.secondary-btn:hover {
    background-color: rgba(197, 155, 39, 0.1);
}

/* Simulator Feedback Display */
.sim-feedback {
    background-color: var(--bg-card);
    border: 2px solid var(--color-green);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    animation: slideIn 0.3s ease-out;
}

.sim-feedback.error-feedback {
    border-color: var(--color-red);
}

.feedback-icon-container {
    font-size: 2.5rem;
}

.sim-feedback .feedback-icon {
    font-size: 2.5rem;
    color: var(--color-green);
}

.sim-feedback.error-feedback .feedback-icon {
    color: var(--color-red);
}

.feedback-text {
    flex-grow: 1;
}

.feedback-text h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

.feedback-text p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.xp-earned-banner {
    display: inline-block;
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--color-green);
    font-family: var(--font-code);
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.sim-feedback.error-feedback .xp-earned-banner {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--color-red);
}

/* ==========================================================================
   PHASE 3: PRACTICE/EXAMINE INTERFACE
   ========================================================================== */

/* Lobby Screen */
.lobby-card {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.lobby-icon {
    font-size: 3.5rem;
    color: var(--color-gold);
}

.lobby-card h2 {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
}

.lobby-rules {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.text-gold {
    color: var(--color-gold);
    margin-top: 0.2rem;
}

.start-quiz-btn {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    background-color: var(--color-gold);
    color: #0f172a;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-gold-glow);
}

.start-quiz-btn:hover {
    background-color: var(--color-gold-hover);
    transform: translateY(-2px);
}

/* Active Quiz Screen */
.quiz-active-screen {
    max-width: 700px;
    margin: 0 auto;
}

.quiz-header {
    margin-bottom: 2rem;
}

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(15, 23, 42, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold), #ffd700);
    transition: width var(--transition-speed) ease;
}

.quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-tracker {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.timer-display {
    font-family: var(--font-code);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-dark);
    background-color: var(--bg-card);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timer-low {
    color: var(--color-red);
    border-color: var(--color-red);
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.6; }
}

.question-card {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    margin-bottom: 2rem;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: var(--color-text-dark);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-dark);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-btn:hover {
    background-color: var(--bg-card-hover);
    color: var(--color-text-dark);
}

.option-btn.selected {
    background-color: rgba(197, 155, 39, 0.1);
    border-color: var(--color-gold);
    box-shadow: var(--shadow-gold-glow);
}

.option-btn.correct {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: var(--color-green);
    color: var(--color-green);
}

.option-btn.incorrect {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: var(--color-red);
    color: var(--color-red);
}

.option-letter {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--color-gold);
}

/* Quiz Feedback Remedy Screen */
.quiz-feedback-overlay {
    max-width: 600px;
    margin: 0 auto;
}

.remedy-card {
    background-color: var(--bg-card);
    border: 2px solid var(--color-red);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
}

.remedy-card.correct-remedy {
    border-color: var(--color-green);
}

.remedy-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-icon {
    font-size: 3rem;
}

.text-red {
    color: var(--color-red);
}

.text-green {
    color: var(--color-green);
}

#remedy-status-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
}

#remedy-xp-diff {
    font-family: var(--font-code);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-red);
}

.correct-remedy #remedy-xp-diff {
    color: var(--color-green);
}

.remedy-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.remedy-body h4 {
    font-family: var(--font-heading);
    color: var(--color-gold);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.formula-block {
    background-color: var(--bg-dark);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1rem;
    font-family: var(--font-code);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    text-align: center;
}

#remedy-explanation {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* Quiz Results Screen */
.results-card {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.results-icon {
    font-size: 4rem;
    color: var(--color-gold);
}

.results-card h2 {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.score-num {
    font-family: var(--font-code);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-text-dark);
}

.score-percentage {
    color: var(--color-gold);
    font-weight: 700;
    font-size: 1.2rem;
}

.result-message {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.xp-results-row {
    width: 100%;
    max-width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 1rem 0;
}

.xp-result-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.xp-result-value {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--color-green);
    font-size: 1.1rem;
}

.results-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* ==========================================================================
   LEVEL UP & PROGRESSION UX
   ========================================================================== */

/* Level Up Banner (Notification Toast) */
.notification-banner {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trophy-icon {
    font-size: 1.5rem;
    color: var(--color-gold);
}

.banner-title {
    font-family: var(--font-heading);
    color: var(--color-gold);
    font-size: 0.95rem;
}

.banner-desc {
    font-size: 0.85rem;
    color: var(--color-text-dark);
}

/* Level Up Fullscreen Modal */
.level-up-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(9, 14, 26, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.level-modal {
    background-color: var(--bg-card);
    border: 2px solid var(--color-gold);
    border-radius: var(--border-radius);
    padding: 3.5rem 2.5rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(197, 155, 39, 0.25);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: zoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-glow {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(197, 155, 39, 0.15) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
}

.modal-icon {
    font-size: 4rem;
    color: var(--color-gold);
    filter: drop-shadow(0 0 10px rgba(197, 155, 39, 0.4));
}

.level-modal h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: white;
}

.rank-up-sub {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.rank-transition {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.old-rank {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    text-decoration: line-through;
}

.new-rank {
    color: var(--color-gold);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(197, 155, 39, 0.3);
}

.rank-benefit-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.modal-close-btn {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    background-color: var(--color-gold);
    color: var(--bg-dark);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.modal-close-btn:hover {
    background-color: var(--color-gold-hover);
    box-shadow: var(--shadow-gold-glow);
}

/* Play Mode Subnavigation (Play 1 vs Play 2) */
.play-mode-subnav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.play-mode-btn {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.play-mode-btn:hover {
    color: white;
    background-color: var(--bg-card-hover);
    border-color: var(--color-gold);
}

.play-mode-btn.active {
    color: var(--bg-dark);
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    box-shadow: var(--shadow-gold-glow);
}

/* MP Grid Legend */
.grid-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.legend-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.voting-box {
    background-color: rgba(59, 130, 246, 0.3);
    border: 1.5px solid #3b82f6;
}

.absent-box {
    background-color: rgba(245, 158, 11, 0.3);
    border: 1.5px solid #f59e0b;
}

.vacant-box {
    background-color: rgba(239, 68, 68, 0.3);
    border: 1.5px solid #ef4444;
}

/* Dynamic Stats Bubbles */
.mp-grid-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-bubble {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.bubble-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.bubble-value {
    font-family: var(--font-code);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-dark);
}

/* MP Grid Structure */
.mp-grid-container {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
}

.house-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 6px;
    max-height: 380px;
    overflow-y: auto;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.05);
}

/* Individual MP cell */
.mp-cell {
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-family: var(--font-code);
    font-weight: 700;
    transition: all 0.2s ease;
    user-select: none;
}

.mp-cell.voting {
    background-color: rgba(59, 130, 246, 0.15);
    border: 1.5px solid #3b82f6;
    color: #3b82f6;
    cursor: pointer;
}

.mp-cell.voting:hover {
    background-color: rgba(59, 130, 246, 0.35);
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.mp-cell.voting.ticked {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--bg-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-gold-glow);
}

.mp-cell.absent {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1.5px solid #f59e0b;
    color: #f59e0b;
    opacity: 0.5;
    cursor: not-allowed;
}

.mp-cell.vacant {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1.5px solid #ef4444;
    color: #ef4444;
    opacity: 0.4;
    cursor: not-allowed;
}

/* Helper Class */
.hidden {
    display: none !important;
}

/* Animation utilities */
.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}
