:root {
    --bg: #121212;
    --primary: #3b82f6;
    --text: #ffffff;
    --muted: #a0aec0;
}

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

body.sim-page {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    transform-origin: top left;
}

/* ── NAV ── */
.cs-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 60px;
    background: rgba(18, 18, 18, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    z-index: 200;
    flex-shrink: 0;
}

.logo a {
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.nav-breadcrumb .sep {
    opacity: 0.3;
}

.nav-breadcrumb .nav-current {
    color: var(--text);
    font-weight: 600;
}

.control-strip {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1rem;
    color: var(--muted);
}

.control-strip label span {
    color: var(--primary);
    font-weight: 700;
}

.cs-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
}

.cs-btn-outline:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* ── FOCUS CONTAINER ── */
.focus-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.intro-text {
    font-size: 1.8rem;
    margin-bottom: 4rem;
    color: #e2e8f0;
    text-align: center;
}

.math-hl {
    border-bottom: 2px dotted #4a5568;
    padding-bottom: 4px;
}

.math-bold {
    font-weight: 700;
}

#equation-focus {
    width: 100%;
    max-width: 1100px;
}

#expansion-result {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: 'Times New Roman', serif;
    font-size: 2.5rem;
    text-align: center;
    line-height: 1.8;
}

/* Term Box */
.term-box {
    display: inline-flex;
    align-items: center;
    margin: 1rem 0;
}

/* Combination Notation nCk Style */
.comb-style-nck {
    display: inline-flex;
    align-items: baseline;
    font-family: 'Times New Roman', serif;
    line-height: normal;
}

.comb-c {
    font-size: .9em;
    font-weight: 600;
    font-family: 'Outfit';
    margin: 0 4px;
}

.comb-style-nck sup,
.comb-style-nck sub {
    vertical-align: baseline;
    font-size: 1em;
}

.comb-n {
    font-size: 0.55em;
    font-weight: 800;
    color: var(--primary);
    position: relative;
    top: -0.8em;
}

.comb-k {
    font-size: 0.55em;
    font-weight: 800;
    color: var(--primary);
    position: relative;
    bottom: -0.6em;
}

.term-vars {
    display: inline-flex;
    align-items: baseline;
    margin-left: 0.4rem;
}

.var-base {
    font-style: italic;
    font-weight: 400;
}

.var-pow {
    font-size: 0.65em;
    position: relative;
    top: -0.6em;
    font-weight: 700;
    color: var(--primary);
    padding-left: 1px;
}

.plus-sep {
    font-size: 2.2rem;
    color: var(--muted);
    padding: 0 0.8rem;
}

/* Global Slider */
.phet-slider {
    width: 200px;
    height: 6px;
    appearance: none;
    background: #333;
    border-radius: 10px;
    outline: none;
}

.phet-slider::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 10px var(--primary);
}