/* Modern Minimalist Design */
html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

:root {
    /* Colors */
    --bg-app: #0f1115;
    --bg-card: #181b21;
    --bg-card-highlight: #232730;

    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;

    --accent: #4FD1C5;

    /* Subject Colors (Pastel/Vibrant Mix) */
    --color-subject-1: #FF8BA7;
    --color-subject-2: #8BE4FF;
    --color-subject-3: #FFC08B;
    --color-subject-4: #C58BFF;
    --color-subject-5: #8BFFAD;
    --color-subject-6: #FF8B8B;
    --color-subject-7: #FFFF8B;
    --color-subject-8: #8B94FF;
    --color-subject-9: #FF8BED;
    --color-subject-10: #8BFFEA;
    --color-subject-11: #D6FF8B;
    --color-subject-12: #FFAD8B;
    --color-break: #2a2e36;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* THEMES */

/* PREMIUM THEME ENGINE */

/* 1. Deep Space (Refined Default) */
body.theme-midnight {
    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --bg-card-highlight: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-rgb: 56, 189, 248;
    --color-break: #1e293b;
}

/* 2. Royal Gold (Luxury Black) */
body.theme-royal {
    --bg-app: #050505;
    /* True Black */
    --bg-card: #141414;
    /* Matte Black */
    --bg-card-highlight: #222222;
    --text-primary: #fbfbfb;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --accent: #fbbf24;
    /* Amber Gold */
    --accent-rgb: 251, 191, 36;
    --color-break: #141414;
}

/* 3. Neon Tokyo (Cyberpunk) */
body.theme-neon {
    --bg-app: #090014;
    /* Deep Violet Void */
    --bg-card: #18022e;
    /* Dark Plum */
    --bg-card-highlight: #2a044d;
    --text-primary: #fdf4ff;
    --text-secondary: #e879f9;
    /* Pinkish Text */
    --text-muted: #86198f;
    --accent: #22d3ee;
    /* Electric Cyan */
    --accent-rgb: 34, 211, 238;
    --color-break: #18022e;
}

/* 4. Emerald City (Nature/Wealth) */
body.theme-emerald {
    --bg-app: #022c22;
    /* Deepest Jungle */
    --bg-card: #064e3b;
    /* Emerald */
    --bg-card-highlight: #065f46;
    --text-primary: #ecfdf5;
    --text-secondary: #6ee7b7;
    --text-muted: #047857;
    --accent: #34d399;
    /* Bright Mint */
    --accent-rgb: 52, 211, 153;
    --color-break: #064e3b;
}

/* 5. Nordic Frost (Clean/Minimal) */
body.theme-frost {
    --bg-app: #1e293b;
    /* Slate Blue */
    --bg-card: #334155;
    /* Lighter Slate */
    --bg-card-highlight: #475569;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    /* Sky Blue */
    --accent-rgb: 56, 189, 248;
    --color-break: #334155;
}

/* 6. Crimson Command (Restored) */
body.theme-crimson {
    --bg-app: #450a0a;
    --bg-card: #7f1d1d;
    --bg-card-highlight: #991b1b;
    --text-primary: #fef2f2;
    --text-secondary: #fca5a5;
    --text-muted: #b91c1c;
    --accent: #f87171;
    --accent-rgb: 248, 113, 113;
    --color-break: #7f1d1d;
}

/* 7. The Matrix (Shop) */
body.theme-matrix {
    --bg-app: #000000;
    --bg-card: #001a00;
    --bg-card-highlight: #003300;
    --text-primary: #00ff00;
    --text-secondary: #00cc00;
    --text-muted: #006600;
    --accent: #00ff00;
    --accent-rgb: 0, 255, 0;
    --color-break: #001a00;
    font-family: 'Courier New', monospace;
    /* Hacker feel */
}

/* 8. Vapor Sunset (Shop) */
body.theme-sunset {
    --bg-app: #2d004d;
    /* Deep Purple */
    --bg-card: #560a5c;
    --bg-card-highlight: #851e6d;
    --text-primary: #ffd700;
    /* Gold */
    --text-secondary: #ff9e00;
    /* Orange */
    --text-muted: #c71585;
    /* Medium Violet */
    --accent: #ff00ff;
    /* Magenta */
    --accent-rgb: 255, 0, 255;
    --color-break: #560a5c;
}

/* 9. Deep Ocean (Shop) */
body.theme-ocean {
    --bg-app: #001f3f;
    --bg-card: #003366;
    --bg-card-highlight: #004080;
    --text-primary: #e0f7fa;
    --text-secondary: #4fc3f7;
    --text-muted: #0277bd;
    --accent: #00bcd4;
    --accent-rgb: 0, 188, 212;
    --color-break: #003366;
}

.menu-icon-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.bento-dot {
    width: 4px;
    height: 4px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Hover Effect: Center dot changes color, slight spread */
.theme-btn:hover .menu-icon-bento {
    gap: 4px;
    transform: rotate(90deg);
}

/* Active Theme Dot - SUPER VISIBLE */
.theme-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 4px;
    position: relative;
    opacity: 0.4;
    /* Dim unselected items */
}

.theme-dot:hover {
    transform: scale(1.1);
    opacity: 1;
    /* Bright on hover */
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 10px currentColor;
    }

    50% {
        box-shadow: 0 0 25px currentColor, 0 0 10px white;
    }

    100% {
        box-shadow: 0 0 10px currentColor;
    }
}

.theme-dot.active-theme {
    transform: scale(1.3);
    border: 3px solid #ffffff;
    box-shadow: 0 0 20px currentColor, 0 0 5px white;
    /* Constant strong glow */
    opacity: 1 !important;
    /* Ensure selected is bright */
    z-index: 10;
}

/* Checkmark Removed per user request */
.theme-dot.active-theme::after {
    content: '';
}

/* 3. Crimson Command (Red) */
body.theme-crimson {
    --bg-app: #180404;
    --bg-card: #280808;
    --bg-card-highlight: #450a0a;
    --text-primary: #fecaca;
    --text-secondary: #fca5a5;
    --accent: #ef4444;
    --accent-rgb: 239, 68, 68;
    --color-break: #450a0a;
}

/* 5. Nordic Frost (Refined: Lighter, Icy) */
body.theme-frost {
    --bg-app: #1e293b;
    --bg-card: #334155;
    --bg-card-highlight: #475569;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #bae6fd;
    /* Very Pale Ice Blue */
    --accent-rgb: 186, 230, 253;
    --color-break: #334155;
    /* Special override for frost: Make app bg slightly lighter to contrast with Deep Space */
    --bg-app: #22303f;
}

.theme-btn:hover .bento-dot {
    background-color: var(--accent);
    border-radius: 1px;
    /* Sharpen up */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;

    /* GLOBAL LOCKDOWN */
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    overscroll-behavior: none;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Ensure top-alignment */
    align-items: center;
    /* Horizontally center the app container */

    transition: background-color 0.4s ease, color 0.4s ease, background-image 0.1s;

    /* Dynamic Theme Spotlight (Parallax) - Global */
    background-image: radial-gradient(circle at calc(50% + var(--mouse-x, 0) * 100px) calc(30% + var(--mouse-y, 0) * 80px),
            rgba(var(--accent-rgb), 0.15),
            transparent 70%);
    /* Disciplined Polish: Crisp Text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
    width: 100%;
    max-width: 100%;
    /* FIX: Full width to ensure scrolling works everywhere */
    height: 100%;
    /* Fill the fixed body */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Start from top */
    gap: var(--spacing-sm);
    padding: 10px;
    /* Small safety padding */
    box-sizing: border-box;
    overflow: hidden;
    /* Lock container */
}

/* Sidebar Navigation */
/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    gap: 10px;
    margin-bottom: var(--spacing-sm);
    padding: 0 5px;
    flex-shrink: 0;
    /* Keep nav fixed size */
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Dashboard Scroll Container */
#view-dashboard {
    flex: 1;
    /* Take remaining space */
    width: 100%;
    min-height: 0;
    /* CRITICAL: Allows flex child to scroll */
    overflow-y: auto;
    /* Allow internal scrolling */
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    /* Hide scrollbar for premium look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#view-dashboard::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 0;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--text-muted);
}

.nav-btn:hover {
    background-color: var(--bg-card-highlight);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--accent);
    color: black;
    border-color: var(--accent);
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(79, 209, 197, 0.3);
}

.sidebar-section {
    opacity: 0;
}

body.animations-active .sidebar-section {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
header {
    position: absolute;
    /* Fixed top */
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    z-index: 100;
    /* Above Hero */
    background: transparent;
    /* Totally transparent */
    pointer-events: none;
    /* Let clicks pass through empty space */
}

/* Enable clicks on buttons */
.header-right,
h1,
.theme-btn,
#menu-btn,
.class-selector {
    pointer-events: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    /* Push to right */
}

.class-selector {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-family);
    outline: none;
}

.class-selector:focus {
    border-color: var(--accent);
}

.theme-btn {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent);
    background-color: var(--bg-card-highlight);
}

/* SETTINGS BUTTON (Matches Theme Button) */
.settings-btn {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    color: white;
    /* Ensure visible icon */
}

.settings-btn:hover {
    transform: scale(1.1);
    /* border-color: var(--accent); */
    /* background-color: var(--bg-card-highlight); */
}





/* VERTICAL STORYBOARD STYLES */

.storyboard-container {
    width: 100%;
    max-width: 100%;
    /* FIX: Full width to prevent scroll dead zones */
    margin: 0;
    /* Center the content cards */
}

.story-section {
    min-height: 80vh;
    /* Almost full viewport */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg) 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.story-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-wrapper {
    width: 100%;
    max-width: 650px;
    /* Balanced width for elegance */
}

/* HERO SECTION SPECIFICS */
.hero-section {
    min-height: 85vh;
    /* Taller for hero */
    position: relative;
    overflow: hidden;
    justify-content: flex-start !important;
    /* Anchor to top */
    padding-top: 15vh;
    /* Consistent horizon */
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    font-size: 0.9rem;
    color: var(--text-muted);
    animation: bounce 2s infinite;
    opacity: 0.7;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Status Card (Hero Style) */
.status-card {
    background: transparent;
    /* Remove card bg for cleaner look */
    box-shadow: none;
    border: none;
    text-align: center;
    padding: 0;
}

/* Typography Overrides for Hero */
.status-label {
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    min-height: 1.2rem;
    /* Fixed height to prevent jumping with emojis */
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-content {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.current-subject {
    font-size: 4rem;
    /* Massive */
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.countdown-timer {
    font-size: 5rem;
    /* Massive */
    font-weight: 200;
    /* Apple thin style */
    color: var(--accent);
    margin-top: 1rem;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.next-info {
    font-size: 1.2rem;
    opacity: 0.7;
    font-weight: 400;
}

/* Day Selector & Buttons */
.day-selector {
    display: flex !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-bottom: 2rem !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.day-selector::-webkit-scrollbar {
    display: none;
}

.day-btn {
    all: unset;
    /* Reset everything to be sure */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    min-width: 60px;
    scroll-snap-align: start;
    text-align: center;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    /* Remove mobile tap gray box */
}

@media (hover: hover) {
    .day-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-2px);
        color: var(--text-primary);
    }
}

.day-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(var(--accent-rgb, 79, 209, 197), 0.3);
}

.schedule-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}





.current-subject {
    font-size: 3rem;
    /* Slightly larger for emphasis */
    font-weight: 800;
    margin-bottom: var(--spacing-xs);

    /* FIX FOR CLIPPED DESCENDERS */
    line-height: 1.4;
    padding-bottom: 0.2em;

    background: linear-gradient(to right, #ffffff, #c7d2fe);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    will-change: transform;
}

.next-info {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.countdown-timer {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    line-height: 1;
    margin-top: var(--spacing-xs);
}

/* Quick Links Grid */
.notes-container h3,
.links-container h3,
.tools-container h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--spacing-sm);
}

.link-item {
    background-color: var(--bg-card-highlight);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s;
    height: 80px;
    text-align: center;
}

.link-item:hover {
    background-color: var(--accent);
    color: #000;
}

.link-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.link-label {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Notes (Scratchpad) */
.notes-area {
    width: 100%;
    height: 120px;
    background-color: var(--bg-app);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: var(--spacing-sm);
    font-family: var(--font-family);
    font-size: 0.9rem;
    resize: none;
    outline: none;
}

button {
    font-family: var(--font-family);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease-out, background-color 0.2s ease;
}

button:active {
    transform: scale(0.98);
    /* Tactile Feedback */
}

.notes-area:focus {
    border-color: var(--accent);
}

/* Tools Tabs */
.tools-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.tab-btn.active {
    color: var(--accent);
    background-color: rgba(79, 209, 197, 0.1);
}

.tool-content {
    display: none;
}

.tool-content.active {
    display: block;
}

/* Calculator Tool */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-display {
    grid-column: span 4;
    background: var(--bg-app);
    color: white;
    padding: 10px;
    text-align: right;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-family: monospace;
    font-size: 1.25rem;
}

.calc-btn {
    background-color: var(--bg-card-highlight);
    border: none;
    color: white;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    position: relative;
    /* Ensure it's above potential overlays */
    z-index: 10;
}

.calc-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.calc-btn.accent {
    background-color: var(--accent);
    color: black;
}

/* Extras Overlay */
.extras-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    /* Above everything */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.extras-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Card Utility */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* UTILITY PANEL */
.utility-panel {
    /* Premium Glass Material (Dynamic Theme Tint) */
    background: linear-gradient(165deg,
            rgba(var(--accent-rgb), 0.15) 0%,
            rgba(0, 0, 0, 0.95) 100%);
    width: 320px;
    max-height: 85vh;
    border-radius: 28px;
    /* Dynamic Border Glow */
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    /* Dual Shadow: Deep Depth + Theme Glow */
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(var(--accent-rgb), 0.1),
        0 0 40px rgba(var(--accent-rgb), 0.1);
    padding: 24px;
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    backdrop-filter: blur(20px) saturate(180%);
    /* In case of small screens, limit width */
    max-width: 90vw;
    margin: 0 auto;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Close Button - Floating Bubble */
.close-btn-floating {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2005;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.close-btn-floating:hover {
    transform: scale(1.1);
    background: var(--accent);
    color: black;
}

/* Panel Sections Common */
.panel-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* ZONE 1: CONTEXT (Class + Theme) */
.context-bar {
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    align-items: center;
    gap: 15px;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.02);
}

.context-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.context-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.minimal-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    /* simple look */
}

.divider-vertical-small {
    display: none;
    /* Remove divider in vertical layout */
}

.theme-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.theme-dot {
    width: 24px;
    /* Larger hit targets */
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    /* Subtle border */
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-dot:hover {
    opacity: 0.8;
}

.theme-dot[data-theme='default'] {
    background: #0f172a;
}

.theme-dot[data-theme='forest'] {
    background: #052e16;
}

.theme-dot[data-theme='oled'] {
    background: #000;
}

/* ZONE 2: FOCUS */
.focus-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(79, 209, 197, 0.08), rgba(0, 0, 0, 0));
    border-color: rgba(79, 209, 197, 0.15);
}

.focus-display-large {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 12px;
    letter-spacing: -2px;
    color: var(--text-primary);
}

.focus-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 5px;
}

.focus-btn {
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--accent);
    color: black;
    transition: transform 0.1s, filter 0.2s;
}

.focus-btn:hover {
    filter: brightness(1.1);
}

.focus-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.focus-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

/* ZONE/* --- UTILITY PANEL REFINED --- */
.utility-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 420px;
    /* Slightly wider for the 3-col grid */
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 Columns */
    gap: 10px;
}

.resource-btn {
    display: flex;
    flex-direction: column;
    /* Stack Icon + Text for space */
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 5px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-align: center;
}

.resource-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
}

/* HERO BUTTON (Spillehal - Premium Widget Style) */
.resource-btn.hero-btn {
    grid-column: span 3;
    /* Full width (3 cols) */
    flex-direction: row;
    /* Keep icon/text side-by-side */
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    padding: 20px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.resource-btn.hero-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.res-icon {
    font-size: 1.2rem;
}

.hero-btn .res-icon {
    font-size: 1.4rem;
    margin: 0;
}

/* ZONE 4: SECONDARY TOOLS (Icons) */
.tools-row {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: transparent;
    border: none;
}

.tool-icon-btn {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tool-icon-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.05);
}

/* ZONE 5: SECONDARY VIEW */
.secondary-view {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    animation: fadeIn 0.3s ease;
}

.secondary-view.hidden {
    display: none;
}

.sec-content {
    animation: fadeIn 0.3s ease;
}

.sec-content.hidden {
    display: none;
}

/* Override for Compact Calculator in Menu */
.calc-grid.compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.calc-grid.compact button {
    height: 40px;
    font-size: 1rem;
}

.calc-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    text-align: right;
    font-family: monospace;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Student Search */
.student-list.compact {
    max-height: 200px;
    overflow-y: auto;
}

.search-input.compact {
    margin-bottom: 10px;
    width: 100%;
}

/* Debug */
.debug-hidden {
    display: none !important;
}

/* MODAL SYSTEM (Generic) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    /* Darker overlay */
    backdrop-filter: blur(10px);
    /* Stronger blur */
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* MODAL ANIMATION */
@keyframes popIn {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    color: white;
    /* Pop In Animation (Default) */
    animation: popIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* OVERRIDE ANIMATION (To match Leaderboard exact feel) */
@keyframes popInOverride {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pop-in-animation {
    /* Exact same timing as default popIn (0.25s) */
    animation: popInOverride 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
}

/* EXIT ANIMATION (Smoother, Standard Ease-In) */
@keyframes popOutOverride {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

.pop-out-animation {
    /* Fast, snappy exit using standard ease-in */
    animation: popOutOverride 0.15s ease-in forwards !important;
}

/* Forced Centering for Overlays */
.modal-overlay:not(.hidden) {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.glass-panel.centered-panel {
    background: rgba(20, 20, 20, 0.95);
    /* Nearly solid dark */
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 90%;
    max-width: 360px;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.8);
    border-radius: 24px;
}

.glass-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    /* Darker input */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    text-align: center;
    box-sizing: border-box;
}

/* Live Link Widget Styles */
.live-link-widget {
    /* Kept clean to match other cards */
}

.drop-zone {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 10px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.drop-zone.active {
    border-color: var(--accent);
    background: rgba(79, 209, 197, 0.05);
}

.gradient-text {
    background: linear-gradient(90deg, #4FD1C5, #63B3ED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-size: 1.1rem;
    word-break: break-all;
}

/* PROFILE HUB */
.hub-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hub-avatar {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hub-name-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

.hub-name-input:focus {
    outline: none;
    border-bottom: 1px solid var(--accent);
}

.hub-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.stat-pill {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    gap: 6px;
    align-items: center;
}

.stat-pill {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    gap: 6px;
    align-items: center;
}

.hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.hub-btn {
    background: rgba(255, 255, 255, 0.08);
    /* Slightly more visible */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.hub-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    /* Brighter hover */
    transform: translateY(-2px);
    border-color: var(--accent);
}

.hub-icon {
    font-size: 2rem;
}

.send-area {
    display: flex;
    gap: 5px;
}

.send-area input {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.send-area button,
.btn {
    padding: 0 15px;
    background: var(--accent);
    color: var(--bg-card);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    font-family: var(--font-family);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    transition: filter 0.2s, transform 0.1s;
}

.btn:hover {
    filter: brightness(1.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn.secondary {
    background-color: var(--bg-card-highlight);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}



.column-title {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

/* SMART SUBJECT WIDGET */
.subject-widget {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 15px;
    margin-top: 20px;
    width: 100%;
    max-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    margin-left: auto;
    /* Centering fix */
    margin-right: auto;
    margin-right: auto;
    /* Centering fix */
}

body.animations-active .subject-widget {
    animation: slideUp 0.5s ease forwards;
}

.topic-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.topic-arrow {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.2s;
}

.topic-arrow:hover {
    color: var(--accent);
}

.topic-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.topic-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.widget-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: black;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.1s, filter 0.2s;
}

.widget-action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.widget-action-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Quote Styles (moved here) */
.quotes-container {
    text-align: center;
}

.quote-display {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 10px 0;
    font-style: italic;
}

.quote-author {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Schedule List */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.section-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: var(--spacing-xs);
}

.schedule-item {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    /* More spacing */
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.2s ease;
    /* Smoother transition */
    border-left: 4px solid transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border definition */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Depth */
}

.schedule-item.active {
    background-color: var(--bg-card-highlight);
    border-left: 4px solid var(--accent);
    transform: scale(1.02);
    /* Pop effect */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    /* Stronger shadow */
    border-color: var(--accent);
    /* Highlight border */
}

.schedule-item.past {
    opacity: 0.5;
}

.time-slot {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 80px;
    font-variant-numeric: tabular-nums;
}

.subject-info {
    flex-grow: 1;
}

.subject-name {
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
}

.teacher-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.hidden-input {
    display: none;
}

/* Responsive adjustments if needed */
@media (min-width: 768px) {
    .current-subject {
        font-size: 5rem;
    }

    .countdown-timer {
        font-size: 7rem;
    }
}

@media (max-width: 400px) {
    .current-subject {
        font-size: 2rem;
    }

    .countdown-timer {
        font-size: 2.5rem;
    }
}

/* Lock Screen - Landing Page Style */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-app);
    background-image: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Transition: Opacity/Transform 0.6s. Visibility waits 0s (immediate show) */
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    pointer-events: auto;
}

.lock-screen.hidden {
    /* Fade out, Zoom out. Visibility waits 0.6s until fade is done */
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0.6s;
}

.lock-content.landing-style {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 0 20px;
    animation: fadeIn 1s ease;
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.lock-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.lock-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
    line-height: 1.5;
}

/* Modern Input Group */
.input-group {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

#lock-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    text-align: left;
    /* Normal input */
}

#lock-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(79, 209, 197, 0.1);
}

.arrow-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    width: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: black;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.arrow-btn:hover {
    transform: scale(1.1);
}

#lock-error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 15px;
    font-weight: 500;
}

.lock-content button:hover {
    transform: scale(1.02);
}

#lock-error {
    color: #ff6b6b;
    margin-top: var(--spacing-sm);
    font-weight: 600;
}

/* Weather Widget */
.weather-widget {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: default;
    opacity: 0;
    /* Hidden until loaded */
    transform: translateY(-10px);
}

.weather-widget.visible {
    opacity: 1;
    transform: translateY(0);
}

.weather-widget:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(1px);
}

.weather-icon {
    font-size: 1.2rem;
}

/* Menu Button Container */
.header-right {
    display: flex;
    justify-content: flex-end;
}

.header-left {
    pointer-events: auto;
}

/* Weather Widget SVGs */
.weather-icon svg {
    width: 28px;
    height: 28px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Animations */
@keyframes w-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes w-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes w-rain-fall {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(5px);
    }
}

.w-anim-sun,
.w-sun-bg {
    animation: w-spin 12s linear infinite;
    transform-origin: center;
}

.w-anim-cloud,
.w-anim-partly,
.w-anim-moon {
    animation: w-float 4s ease-in-out infinite;
}

.w-drops {
    animation: w-rain-fall 1.5s linear infinite;
}

.w-flake {
    animation: w-rain-fall 2.5s linear infinite;
}

.w-flake-2 {
    animation: w-rain-fall 2.5s linear infinite;
    animation-delay: 1.25s;
}

/* --- AETHER MUSIC PLAYER --- */
.aether-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.aether-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#aether-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

.aether-content {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: white;
}

.aether-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.aether-logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #c084fc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.aether-btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s;
}

.aether-btn-icon:hover {
    transform: scale(1.1);
    color: white;
}

/* Vinyl Art */
.aether-album-art {
    margin: 20px auto;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #111;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: vinyl-spin 10s linear infinite;
    animation-play-state: paused;
}

.aether-album-art.playing {
    animation-play-state: running;
}

.vinyl-record {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: repeating-radial-gradient(#111,
            #111 2px,
            #222 3px,
            #222 4px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.vinyl-label {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f43f5e, #a855f7);
    border: 3px solid #111;
}

@keyframes vinyl-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#aether-track-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#aether-status {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Controls */
.aether-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.aether-input-group {
    display: flex;
    gap: 10px;
}

.aether-input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
}

.aether-input-group button,
.aether-presets button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.aether-input-group button:hover,
.aether-presets button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.aether-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.control-btn.big {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.control-btn.big:active {
    transform: scale(0.9);
}

#aether-volume {
    width: 100px;
    accent-color: #a855f7;
}

.aether-presets {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Secret Game Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 17, 21, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    /* Higher than lock screen just in case */
    backdrop-filter: blur(5px);
}

.game-overlay.hidden {
    display: none;
}

.game-container {
    text-align: center;
}

canvas#snake-game {
    background-color: #000;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 20px rgba(79, 209, 197, 0.3);
}

.game-info {
    margin-top: var(--spacing-sm);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 1.2rem;
    width: 400px;
    /* Match canvas width */
}

.close-game-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.close-game-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.close-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Classmate Widget */
.search-input {
    width: 100%;
    padding: 10px;
    background-color: var(--bg-app);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-family);
}

.search-input:focus {
    border-color: var(--accent);
    outline: none;
}

.student-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Scrollbar for student list */
.student-list::-webkit-scrollbar {
    width: 6px;
}

.student-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.student-item {
    padding: 6px 10px;
    background-color: var(--bg-card-highlight);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-item.birthday-today {
    border: 1px solid var(--accent);
    background-color: rgba(79, 209, 197, 0.1);
}

/* Fun Zone */
.fun-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.fun-btn {
    flex: 1;
    background-color: var(--bg-card-highlight);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.fun-btn:hover {
    background-color: var(--accent);
    color: black;
}

.fun-display {
    background-color: var(--bg-app);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--accent);
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* FLOATING ACTION BUTTON (Right Bottom) - Glassified */
.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 5000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-btn:hover {
    transform: scale(1.1) translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
}

.fab-btn:active {
    transform: scale(0.9);
}

/* --- SECRET DEBUG STYLES (Appended) --- */
.debug-hidden {
    display: none;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    width: 100%;
}

.debug-hidden.show {
    display: block !important;
    animation: fadeIn 0.5s;
}

.debug-hidden button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    margin: 2px;
}

.debug-hidden button:hover {
    background: var(--accent);
    color: black;
}

/* TOAST NOTIFICATION (Top of screen) */
/* TOAST NOTIFICATION (Bulletproof) */
#toast {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    background: var(--accent);
    color: #000;
    padding: 10px 20px;
    border-radius: 99px;

    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2147483647 !important;
    /* Max Z-Index */

    display: none;
    /* JS toggles this */
    pointer-events: none;
    white-space: nowrap;
}

/* Remove animation to prevent transform bugs */
/* @keyframes slideDown ... removed */

/* FORCE HIDDEN */
.hidden {
    display: none !important;
}

/* Navigation & View Containers */
#view-dashboard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: center center;
    will-change: transform, opacity;
}

/* Constrain ONLY the content */
.storyboard-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    /* Restore padding here for content safety */
    padding: var(--spacing-sm);
    padding-top: 80px;
    /* Space for the absolute Layout */
}

/* EXTRAS OVERLAY (MUST BE TOPMOST) */
.extras-overlay {
    z-index: 100001 !important;
    /* Above LiveLink (99999) */
}

/* Header Correction: FIXED to Viewport */
header {
    position: fixed;
    /* Locked to screen */
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    z-index: 4000;
    /* Above Dashboard, Below LiveLink (99999) */
}

/* FLOATING ACTION BUTTON (Right Bottom) */
.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    /* ... existing styles ... */
    z-index: 5000;
    /* Above Header */
}

/* Live Link View (Top Overlay) */
.livelink-view {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999 !important;
    /* Absolute top */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    overflow: hidden;
}

/* Ensure header buttons in Live Link are clickable */
.livelink-view header {
    z-index: 100000;
    /* Above the view background */
    pointer-events: auto;
}


/* ANIMATIONS FOR VIEWS */
/* Unlock Animation */
@keyframes slideUpUnlock {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.anim-unlock {
    animation: slideUpUnlock 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* PREMIUM SCHEDULE CARDS */
/* PREMIUM SCHEDULE CARDS */
.schedule-card {
    /* FORCE SOLID COLOR - NO TRANSPARENCY */
    background: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: none;
    padding: 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);

    /* GRID LAYOUT TO PREVENT OVERLAP */
    display: grid;
    grid-template-columns: 80px 1fr auto;
    /* Fixed Time | Fluid Subject | Auto Teacher */
    align-items: center;
    gap: 15px;

    position: relative;
    overflow: visible;
    /* changed from hidden to allow popout if needed, but grid contains it well */
    /* Ensure hardware acceleration */
    transform: translateZ(0);
}

.schedule-card:hover {
    /* Hover is just a lighter solid color */
    background: var(--bg-card-highlight) !important;
    transform: translateY(-2px);
}

/* Explicit style for breaks to be lower contrast */
/* Explicit style for breaks to be lower contrast but SAME brightness */
.break-item {
    background: var(--bg-card) !important;
    opacity: 1;
    border: 2px dashed rgba(255, 255, 255, 0.4) !important;
    /* MUCH MORE VISIBLE */
    color: var(--text-muted);
}

.schedule-card.current {
    /* Glowing Border for Active Class */
    background: var(--bg-card) !important;
    border: 1px solid var(--accent);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
}



.schedule-card.past {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.card-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 50px;
}

.card-subject {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
    padding-left: 15px;
}

.card-room {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

@keyframes slideDownOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

@keyframes slideUpIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUpOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideDownIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.anim-slide-up-in {
    animation: slideUpIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-slide-up-out {
    animation: slideUpOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-slide-down-in {
    animation: slideDownIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-slide-down-out {
    animation: slideDownOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.anim-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* --- ARCADE VIEW (Gaming Hub) --- */
/* --- ARCADE VIEW (Gaming Hub) --- */
.arcade-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
    /* MATCH BODY GLOW: Use the same dynamic gradient as the main page */
    background-image: radial-gradient(circle at calc(50% + var(--mouse-x, 0) * 100px) calc(30% + var(--mouse-y, 0) * 80px),
            rgba(var(--accent-rgb), 0.15),
            transparent 70%);
    z-index: 10005;
    display: flex;
    flex-direction: column;
    /* Animation removed - now handled via Nuclear JS */
}

.arcade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: transparent;
    position: relative;
    /* Anchor for absolute title */
    height: 80px;
    box-sizing: border-box;
}

/* IDENTITY PILL (Start) */
.identity-pill {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Increased internal gap */
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    height: auto;
    flex-shrink: 0;
    /* Prevent crushing */
    white-space: nowrap;
    /* Prevent wrapping */
}

.identity-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.coin-section,
.name-section {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.pill-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
}

.name-section {
    color: var(--accent);
    /* Highlight name */
}

/* IDENTITY PILL (End) */

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    /* Increased spacing between Pill and Shop */
    z-index: 2;
    flex: 1;
    /* Balance both sides so title remains true center */
}

.header-right {
    justify-content: flex-end;
    /* Push right items to edge */
}

/* New Clean Glass Button for Header */
.glass-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    padding: 0;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* Text-based Glass Button (e.g. Back Button) */
.glass-btn-text {
    width: auto;
    height: 40px;
    padding: 0 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.glass-btn-text:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-3px);
    /* Subtle back motion */
}

.arcade-title-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    /* Behind items if overlap (unlikely) */
    text-align: center;
    width: 100%;
    /* Ensures centering works relative to header */
    pointer-events: none;
    /* Let clicks pass through to background */
}

/* Ensure title doesn't stretch */
.arcade-title-wrapper .arcade-title {
    display: inline-block;
}

.arcade-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property */
    -webkit-text-fill-color: transparent;
    opacity: 0.95;
    margin: 0;
    white-space: nowrap;
}

/* Input Styling (Player Name) */
#player-name-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    outline: none;
    width: 100px;
    text-align: center;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

#player-name-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.15);
}

/* Icon Button (Menu) */
.btn-icon-only {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Unified Arcade Button Style */
.arcade-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    padding: 8px 16px;
    backdrop-filter: blur(5px);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 20000;
    position: relative;
    pointer-events: auto !important;
    user-select: none;
}

.arcade-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.arcade-nav-btn:active {
    transform: translateY(0) scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

/* Deprecated back-btn, keeping helper just in case */
.back-btn {
    display: none;
}

.arcade-content {
    flex: 1;
    display: flex;
    justify-content: center;
    /* Move from center to top */
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

/* Game Selector */
.game-selector {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.game-card {
    width: 200px;
    height: 260px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.game-card:nth-child(1) {
    animation-delay: 0.05s;
}

.game-card:nth-child(2) {
    animation-delay: 0.1s;
}

.game-card:nth-child(3) {
    animation-delay: 0.15s;
}

.game-card:nth-child(4) {
    animation-delay: 0.2s;
}

.game-card:nth-child(5) {
    animation-delay: 0.25s;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.game-thumb {
    flex: 2;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
}

.snake-thumb {
    background: linear-gradient(135deg, #064e3b, #10b981);
}

.breakout-thumb {
    background: linear-gradient(135deg, #7f1d1d, #f87171);
}

.pong-thumb {
    background: linear-gradient(135deg, #1e3a8a, #60a5fa);
}

.space-thumb {
    background: linear-gradient(135deg, #4c1d95, #c026d3);
}

.game-meta {
    flex: 1;
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.game-meta h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}

.game-meta p {
    margin: 5px 0 0;
    font-size: 0.8rem;
    color: #888;
}

.game-card.locked {
    opacity: 0.5;
    cursor: default;
}

.game-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Game Stage (Active Game) */
/* Game Stage (Active Game) */
.game-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    height: 100%;
    justify-content: center;
    /* Center vertically */
    /* Remove fixed margins that cause offset */
    margin: 0 auto;
}

/* Mobile Controls for Space Defence */
.mobile-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.fire-btn {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    width: 70px;
    height: 70px;
}

.fire-btn:active {
    background: rgba(239, 68, 68, 0.6);
}

.game-viewport {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: block;
    /* RESPONSIVE SCALING FIX */
    max-width: 100%;
    max-height: 70vh;
    /* Force it to fit! */
    object-fit: contain;
}

.game-hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-family: var(--font-main);
    font-weight: 500;
    opacity: 0.9;
}

.score-board {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    opacity: 0.7;
}

.settings-btn:hover {
    opacity: 1;
    transform: rotate(45deg);
    transition: 0.3s;
}

/* Settings Panel */
/* Settings Panel */
.settings-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    z-index: 100;
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.settings-panel h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--accent);
}

.setting-group {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.setting-group:last-of-type {
    border-bottom: none;
}

.setting-group label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.setting-group select,
.setting-group input[type="text"] {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: 0.2s;
}

.setting-group select:focus,
.setting-group input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

/* Custom Checkbox as Toggle */
.setting-group input[type="checkbox"] {
    appearance: none;
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

.setting-group input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.setting-group input[type="checkbox"]:checked {
    background: var(--accent);
}

.setting-group input[type="checkbox"]:checked::after {
    left: 21px;
}

/* Game Over Overlay */
/* Game Over Overlay */
/* Game Over Overlay */
.game-overlay-msg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: var(--text-primary);
    z-index: 2200;
    padding: 20px;
    text-align: center;
    border-radius: var(--radius-md);
    /* Match Canvas (12px) */
    overflow: hidden;

    /* Animation State (Default: Invisible) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Active State (Visible) */
.game-overlay-msg.active {
    opacity: 1;
    pointer-events: auto;
}

/* Fallback: Force invisible if NOT active (Fixes "Missing Animation" bug) */
#breakout-game-over:not(.active) {
    opacity: 0 !important;
    pointer-events: none;
}

.game-stage {
    position: relative;
    /* Ensure overlay covers THIS container */
}

/* DUEL UI STYLES */
.duel-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.duel-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

.duel-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.duel-section:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.duel-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 1.5rem;
    font-family: monospace;
    text-align: center;
    letter-spacing: 5px;
    transition: all 0.2s;
}

.duel-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2);
}

.duel-header-status {
    position: fixed;
    /* Fixed to screen, ignores flow */
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;

    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 2px solid var(--accent);
    /* Extra visibility */
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    box-sizing: border-box;
    z-index: 20002;
    /* Higher than Force Visible */
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-overlay-msg h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: none;
    margin: 0;
    letter-spacing: -0.5px;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* WORDLE STYLES */
#wordle-board {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    box-sizing: border-box;
    width: 300px;
    height: 380px;
    margin: 0 auto 20px auto;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#wordle-board::-webkit-scrollbar {
    display: none;
}

.wordle-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 5px;
    height: 55px;
    flex-shrink: 0;
}

.tile {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    background: transparent;
    transition: transform 0.6s;
    backface-visibility: hidden;
    user-select: none;
}

/* Tile States */
.tile[data-state='active'] {
    border-color: rgba(255, 255, 255, 0.5);
    animation: pop 0.1s;
}

.tile[data-state='correct'] {
    background: #538d4e;
    border-color: #538d4e;
}

.tile[data-state='present'] {
    background: #b59f3b;
    border-color: #b59f3b;
}

.tile[data-state='absent'] {
    background: #3a3a3c;
    border-color: #3a3a3c;
}

.tile.flip {
    animation: flip 0.6s ease-in;
}

/* Keyboard */
#wordle-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    padding: 0 10px 20px;
}


/* WORDLE STYLES */

/* Keyboard Container */
#wordle-keyboard {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 600px;
    user-select: none;
}

.keyboard-row {
    display: flex;
    width: 100%;
    gap: 6px;
    justify-content: center;
}

/* Base Key Style */
.key {
    background: #818384;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    height: 50px;
    /* Taller keys for touch */
    min-width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    flex: 1;
    user-select: none;
    transition: background 0.2s;
}

.key.big {
    flex: 1.5;
    font-size: 0.8rem;
}

.key:hover {
    opacity: 0.9;
}

/* Key States */
.key[data-state='correct'] {
    background: #538d4e;
}

.key[data-state='present'] {
    background: #b59f3b;
}

.key[data-state='absent'] {
    background: #3a3a3c;
    opacity: 0.5;
}

/* Animations */
@keyframes pop {
    50% {
        transform: scale(1.1);
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.wordle-row.shake {
    animation: shake 0.5s;
}

/* Thumb */
.wordle-thumb {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* --- REFACTORED START SCREEN (Premium Glass) --- */
.start-screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* FIX: Transparent background to show themed canvas behind */
    background: rgba(0, 0, 0, 0.2);
    /* Very subtle tint instead of full opaque */
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;

    /* LAYOUT (Restored) */
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-screen-overlay.active {
    opacity: 1;
    pointer-events: auto;
    /* Enable clicks */
}

.breakout-menu-floater {
    /* Restore container background for the menu panel */
    background: rgba(30, 30, 35, 0.85);
    /* Darker base */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 20px;
    /* Reduced from 30px */

    /* Subtle Gradient for "Lækkerhed" */
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);

    /* Layout */
    text-align: center;
    max-width: 380px;
    /* Narrower for vertical stack */
    width: 90%;
    /* Ensure it fits vertically in 320px height */
    max-height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;

    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.start-screen-overlay.active .breakout-menu-floater,
.game-overlay-msg.active .breakout-menu-floater {
    transform: translateY(0) scale(1);
}

/* SPECIAL GAME OVER VARIANT (Smaller & Colorful) */
.breakout-menu-floater.game-over-special {
    max-width: 240px;
    /* Reduced from 280px */
    padding: 15px;
    /* Reduced from 20px */
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.95), rgba(20, 20, 20, 0.98));
    border: 2px solid transparent;
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    /* Gradient Border Trick - NOW DYNAMIC THEME */
    background-image: linear-gradient(rgba(30, 30, 35, 0.9), rgba(30, 30, 35, 0.9)),
        linear-gradient(45deg, var(--accent), var(--text-secondary));
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    /* Neutral shadow to let border shine */
    transition: all 0.5s ease;
}

/* Typography for Game Over Special */
.game-over-title {
    font-size: 1.5rem;
    /* Reduced from 2rem */
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-over-score-container {
    margin: 15px 0;
}

.game-over-label {
    font-size: 0.75rem;
    /* Reduced from 0.9rem */
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.game-over-score {
    font-size: 2.5rem;
    /* Reduced from 3.5rem */
    font-weight: 800;
    line-height: 1;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Specialized Buttons */
.game-over-btn-primary {
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    padding: 10px 15px !important;
    /* Force smaller padding */
    font-size: 0.9rem !important;
    /* Force smaller text */
    border-radius: 12px !important;
}

.game-over-btn-secondary {
    justify-content: center;
    background: rgba(255, 50, 50, 0.1);
    border-color: rgba(255, 50, 50, 0.2);
    padding: 10px 15px !important;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
}

/* Vertical Button Stack */
.menu-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reduced gap */
    margin-top: 15px;
    /* Reduced margin */
    margin-bottom: 0;
}

.glass-menu-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 18px 25px;

    /* Base Glass */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;

    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.glass-menu-btn span.lives {
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Color Tints (ALWAYS VISIBLE) */
.glass-menu-btn.easy {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
}

.glass-menu-btn.normal {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
    border-color: rgba(251, 191, 36, 0.3);
}

.glass-menu-btn.hard {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
}

.glass-menu-btn:hover {
    transform: translateX(5px);
}

.glass-menu-btn.easy:hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.1));
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.glass-menu-btn.normal:hover {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.1));
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
    border-color: #fbbf24;
}

.glass-menu-btn.hard:hover {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.1));
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.cancel-link {
    display: inline-block;
    margin-top: 15px;
    color: #888;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 500;
}

.cancel-link:hover {
    color: white;
}

/* --- ANIMATIONS --- */
.fade-target {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.fade-out-state {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

/* Wordle Result Styling */
#wordle-msg {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
    margin-top: 0;
    text-shadow: none;
    /* Remove any potential glow */
    font-family: 'Inter', sans-serif;
}

/* Wordle Result Styling */
#wordle-result-word {
    font-weight: 900 !important;
    /* Extra Bold */
    background: linear-gradient(135deg, #fff, var(--accent), #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradientText 3s linear infinite;
    text-transform: uppercase;
    letter-spacing: 2px;
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.5));
}

@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ECONOMY & SHOP CSS */
.coin-display {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #fbbf24;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* SHOP REVAMP - GRID & GLASS */
.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    padding-bottom: 20px;
    max-height: 450px;
    overflow-y: auto;
}

.shop-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.shop-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 40px -5px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(var(--accent-rgb), 0.3);
    border-color: rgba(var(--accent-rgb), 0.5);
    /* Parallax Highlight on Hover */
    background-image: radial-gradient(circle at calc(50% - var(--mouse-x, 0) * 150px) calc(50% - var(--mouse-y, 0) * 150px),
            rgba(255, 255, 255, 0.05),
            transparent 80%);
}

.shop-card.owned {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.shop-card.active-theme {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    box-shadow: 0 0 0 1px var(--accent);
}

.shop-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.shop-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.shop-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    flex-grow: 1;
}

.shop-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* Mod Active Badge */
.btn.mod-active {
    background: transparent;
    border: 1px solid var(--success);
    color: var(--success);
    padding: 4px 10px;
    cursor: default;
}

/* THEMES */
body.theme-matrix {
    --bg-app: #0d0d0d;
    --bg-card: #111111;
    --text-primary: #00ff41;
    --accent: #00ff41;
    --accent-rgb: 0, 255, 65;
    font-family: 'Courier New', monospace;
}

body.theme-matrix .app-container {
    background-image: linear-gradient(rgba(0, 20, 0, 0.9), rgba(0, 20, 0, 0.9)), url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='10' y='30' fill='%23003300' font-family='monospace' font-size='20'%3E10%3C/text%3E%3C/svg%3E");
}

body.theme-sunset {
    --bg-app: #2a1b3d;
    --bg-card: rgba(68, 49, 141, 0.3);
    --text-primary: #fce7f3;
    --accent: #f472b6;
    /* Pink */
    --accent-rgb: 244, 114, 182;
    background: linear-gradient(135deg, #4338ca, #be185d);
}

body.theme-ocean {
    --bg-app: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --text-primary: #e2e8f0;
    --accent: #38bdf8;
    /* Sky Blue */
    --accent-rgb: 56, 189, 248;
    background: linear-gradient(to bottom, #0f172a, #0c4a6e);
}

/* Leaderboard Styles */
.leader-section {
    margin-bottom: 20px;
}

.leader-section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.leader-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 4px;
    font-family: monospace;
    font-size: 0.95rem;
}

.leader-row.highlight-me {
    background: rgba(var(--accent-rgb), 0.2) !important;
    border: 1px solid rgba(var(--accent-rgb), 0.4);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.1);
    font-weight: bold;
    color: white;
}

.game-score {
    color: var(--accent);
    font-weight: bold;
}

/* LEADERBOARD CSS */
/* Leaderboard - Apple Style Clean */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Tighter gap */
    margin-top: 15px;
}

.leader-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    /* Rank, Name, Score */
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    /* Very subtle */
    border-radius: 12px;
    /* Smooth corners */
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.leader-row:hover {
    background: rgba(255, 255, 255, 0.08);
    /* Highlight */
    transform: scale(1.01);
}

.leader-row .rank-num {
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

.leader-row .game-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.leader-row .game-score {
    font-family: 'SF Mono', 'Menlo', monospace;
    /* Tech feel */
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.5px;
}

/* User Highlight */
.leader-row.highlight-me {
    background: rgba(14, 165, 233, 0.15);
    /* Accent tint */
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.1);
}

/* Top 3 Highlighting */
.leaderboard-list .leader-row:nth-child(1) .rank-num {
    color: #fbbf24;
}

/* Gold */
.leaderboard-list .leader-row:nth-child(2) .rank-num {
    color: #94a3b8;
}

/* Silver */
.leaderboard-list .leader-row:nth-child(3) .rank-num {
    color: #b45309;
}

/* Bronze */

/* --- MODALS (Shop/Leaderboard) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 20005;
    /* Above Arcade View */
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: #1a1b20;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--spacing-sm);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

.close-btn:hover {
    color: white;
}

/* Duel Room Code Pill (HUD) */
.duel-code-pill {
    background: rgba(79, 209, 197, 0.2);
    /* Low opacity accent */
    border: 1px solid var(--accent);
    color: var(--accent);
    margin-left: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(79, 209, 197, 0.3);
}

.duel-code-pill span {
    color: white;
    margin-left: 5px;
}

.duel-status-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

/* --- DASHBOARD NATIVE DUEL UI --- */

/* 1. LOBBY OVERLAY & CARD */
#wordle-duel-lobby {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
}

.duel-lobby-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    position: relative;
    color: var(--text-primary);
}

.duel-lobby-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.duel-lobby-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.duel-lobby-divider::before,
.duel-lobby-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.duel-lobby-divider span {
    margin: 0 15px;
}

/* 2. INPUT FIELDS */
.duel-input-large {
    background: var(--bg-app);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.8rem;
    letter-spacing: 6px;
    text-align: center;
    padding: 12px;
    width: 100%;
    outline: none;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    margin-bottom: 12px;
}

.duel-input-large:focus {
    border-color: var(--accent);
}

/* 3. BUTTONS */
.btn-duel-action {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.btn-duel-action:active {
    transform: scale(0.98);
}

.btn-create {
    background: var(--bg-card-highlight);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-create:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-join {
    background: var(--accent);
    color: #1a1a1a;
    /* Dark text for contrast on accent */
}

.btn-join:hover {
    opacity: 0.9;
}

/* 4. DASHBOARD HUD */
.hud-glass-panel {
    background: var(--bg-card-highlight);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-room-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 20000;
    position: relative;
    pointer-events: auto !important;
}

.hud-room-code {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.hud-vs-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

/* SEGMENTED CONTROL (Premium Settings Switcher) */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.segment-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.segment-btn.active {
    background: var(--accent);
    color: black;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* SETTINGS ACTIONS (CENTERED) */
.settings-actions {
    margin-top: 20px;
    width: 100%;
    display: flex;
    gap: 15px;
    justify-content: center;
    /* CENTER BUTTONS */
}

.settings-actions button {
    min-width: 120px;
    /* Don't stretch */
    flex: 0 1 auto;
}

/* GAME CANVAS WRAPPER (For strict overlay clipping) */
.game-canvas-wrapper {
    position: relative;
    display: inline-flex;
    /* Shrink to canvas size */
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-md);
    overflow: hidden;
    /* Clips the square overlay to rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.game-canvas-wrapper canvas {
    border-radius: 0 !important;
    /* Wrapper handles radius */
    box-shadow: none !important;
    /* Wrapper handles shadow */
    display: block;
}

/* Ensure overlay stays inside wrapper */
.game-canvas-wrapper .game-overlay-msg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0 !important;
    /* Wrapper handles radius */
}

/* FADE OUT ANIMATION for Settings */
.fade-out-anim {
    animation: fadeOutFast 0.2s ease forwards !important;
    pointer-events: none;
}

@keyframes fadeOutFast {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* SPA TRANSITIONS (Premium Feel) */
@keyframes arcadeFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes slideDownOut {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(30px) scale(0.98);
        opacity: 0;
    }
}

.arcade-fade-in {
    animation: arcadeFadeIn 0.5s ease forwards !important;
}

.anim-slide-down-out {
    animation: slideDownOut 0.5s cubic-bezier(0.32, 0.72, 0, 1) forwards !important;
    pointer-events: none;
}

/* LIVE LINK PREMIUM GLASS UI */
.livelink-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Shine Effect */
.livelink-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    transform: rotate(25deg);
    pointer-events: none;
    animation: shine-sweep 6s infinite ease-in-out;
}

@keyframes shine-sweep {
    0% {
        left: -150%;
    }

    20% {
        left: 150%;
    }

    /* Fast sweep */
    100% {
        left: 150%;
    }

    /* Wait */
}

/* Premium Buttons within Card - Toned down */
.livelink-card .btn.primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%), rgba(var(--accent-rgb), 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Apple-Style depth: More ambient shadow */
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
    text-shadow: none;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.livelink-card .btn.primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%), rgba(var(--accent-rgb), 0.95);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.livelink-card .btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.livelink-card .btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.livelink-dropzone {
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.livelink-dropzone:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
}

.livelink-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(135deg, white 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    letter-spacing: -0.5px;
}

.livelink-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 400;
}

/* TOAST NOTIFICATION */
.toast-notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(25, 25, 25, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification span {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

#toast-icon {
    font-size: 1.2rem;
}

/* BACKGROUND EFFECTS CANVAS */
#bg-effects-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind everything */
    pointer-events: none;
    opacity: 0.8;
    /* Subtle overall transparency */
}