/* Fibonacci Explorer - Mathematics Hub */
* { box-sizing: border-box; }
:root {
    --primary: #10b981;
    --accent: #22d3ee;
    --bg: #0f172a;
    --grid: rgba(255, 255, 255, 0.05);
    --glass: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --text-muted: #94a3b8;
}

body.math-lab-theme {
    background-color: var(--bg);
    color: white;
    font-family: 'Outfit', sans-serif;
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; touch-action: none;
    display: flex; flex-direction: column;
}

#phet-stage {
    position: absolute;
    top: 0; left: 0;
    width: 1280px; height: 720px;
    background: var(--bg);
    display: flex; flex-direction: column;
    overflow: hidden;
    transform-origin: 0 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
    touch-action: none;
}

/* Nav Styles - Override global fixed nav */
nav {
    position: relative !important;
    top: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    width: 100%;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.logo span {
    color: var(--primary);
    font-weight: 300;
}

.divider {
    margin: 0 12px;
    color: var(--border);
}

.chapter-name {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
}

.nav-links li a:hover {
    color: var(--accent);
}

/* Main Simulation Area */
#sim-app {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sim-container {
    flex: 1;
    display: flex;
    position: relative;
    background:
        linear-gradient(90deg, var(--grid) 1px, transparent 1px),
        linear-gradient(var(--grid) 1px, transparent 1px);
    background-size: 50px 50px;
}

#simCanvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

/* Math Dashboard */
.math-dashboard {
    position: absolute;
    top: 50px;
    right: 40px;
    width: 320px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    z-index: 100;
}

.current-ratio-box {
    background: #1e293b;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    border: 2px solid var(--primary);
}

.current-ratio-box label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.giant-ratio {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
    margin: 5px 0;
    font-family: 'JetBrains Mono', monospace;
}

.ratio-formula {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
}

.sequence-history {
    margin-bottom: 20px;
}

.sequence-history label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
}

.history-list li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Logic HUD - Fixed to bottom of window */
.logic-hud {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 30px;
    border-radius: 50px;
    color: #0f172a;
    font-weight: 800;
    font-size: 1.2rem;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.num-box {
    display: inline-block;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.num-box.highlight {
    background: var(--primary);
    color: white;
}

.stat-row span {
    color: white;
    font-weight: 700;
}

/* Theory Overlay - Fixed to bottom left */
.theory-overlay {
    position: fixed;
    bottom: 55px;
    left: 25px;
    max-width: 400px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    border-left: 2px solid var(--accent);
    padding-left: 15px;
}