/* ============================================
   ENTREL — VALUE LAB
   Drei durchnummerierte Kapitel:
     01  Der Verteilungs-Irrtum   — Balken, dessen Summe nie wächst
     02  Wertschöpfung            — der freiwillige Tausch
     03  Nash-Gleichgewicht       — Auszahlungsmatrix, einmalig vs. wiederholt

   Ein Markup, zwei Auftritte: normal liegt die Sektion im Dokumentfluss,
   im Gate-Zustand (.is-gate) liegt sie als Vollbild darüber.
   ============================================ */

/* ============================================
   RAHMEN
   ============================================ */
.lab {
    position: relative;
    padding-block: var(--section-gap);
    background: var(--bg-primary);
    overflow: hidden;
}

.lab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 62% 52% at 50% 42%, rgba(200, 180, 138, 0.07), transparent 72%);
    pointer-events: none;
}

.lab > * { position: relative; }

/* --- Gate-Zustand: dieselbe Sektion als Vollbild --- */
.lab.is-gate {
    position: fixed;
    inset: 0;
    z-index: 1500;
    padding-block: 0;
    display: flex;
    flex-direction: column;
    /* "safe" verhindert, dass zentrierter Inhalt oben abgeschnitten wird,
       wenn das höchste Kapitel höher ist als das Fenster. */
    justify-content: safe center;
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: labGateIn 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes labGateIn {
    from { opacity: 0; transform: scale(1.03); }
    to   { opacity: 1; transform: none; }
}

.lab.is-closing {
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

body.lab-gate { overflow: hidden; }
body.lab-gate .header,
body.lab-gate main > *:not(.lab),
body.lab-gate .footer { visibility: hidden; }

/* Der Schließen-Knopf existiert nur im Gate */
.lab-close {
    position: absolute;
    top: clamp(18px, 3vw, 36px);
    right: clamp(18px, 3vw, 40px);
    z-index: 5;
    display: none;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    transition: var(--transition);
}

.lab.is-gate .lab-close { display: inline-flex; }

.lab-close:hover {
    color: var(--gold-accent);
    border-color: var(--gold-accent-border);
}

/* Im Gate trägt das Lab seine eigene Kopfzeile, in der Seite die Sektionsköpfe */
.lab.is-gate .lab-head { display: none; }

.lab-head {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: clamp(36px, 5vw, 64px);
}

/* ============================================
   KAPITEL-NAVIGATION
   ============================================ */
.lab-nav {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 26px);
    margin-bottom: clamp(30px, 4vw, 56px);
}

/* Im Gate liegt der Schließen-Knopf oben rechts — die Leiste rutscht darunter,
   sonst überlagern sich Knopf und die Ziffer 03 */
.lab.is-gate .lab-nav {
    margin-top: clamp(40px, 6vh, 68px);
    margin-bottom: clamp(20px, 3vh, 36px);
    /* Platz für den Schließen-Knopf: sonst schiebt sich die Beschriftung von
       Kapitel 03 darunter. Die Fortschrittslinie gibt den Raum her. */
    padding-right: clamp(0px, 13vw, 180px);
}

.lab-step {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 2px;
    color: var(--text-faint);
    transition: color 0.45s ease;
    white-space: nowrap;
}

.lab-step-num {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(20px, 2.4vw, 32px);
    letter-spacing: -0.02em;
    line-height: 1;
    transition: color 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.lab-step-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.lab-step:hover { color: var(--text-muted); }

.lab-step[aria-current="true"] { color: var(--gold-accent); }
.lab-step[aria-current="true"] .lab-step-num { transform: scale(1.18); }

/* Nur das aktive Kapitel zeigt seinen Namen — hält die Leiste ruhig */
.lab-step[aria-current="true"] .lab-step-label {
    opacity: 1;
    max-width: 340px;
}

/* Fortschrittslinie zwischen den Nummern */
.lab-rail {
    flex: 1;
    height: 1px;
    min-width: 20px;
    background: var(--hairline);
    position: relative;
    overflow: hidden;
}

.lab-rail::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--lab-progress, 0%);
    background: var(--gold-accent);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 700px) {
    .lab-step-label { display: none; }
    .lab-nav { gap: 10px; }
}

/* ============================================
   BÜHNE UND KAPITEL
   ============================================ */
/* Die drei Kapitel liegen nebeneinander in einer echten horizontalen
   Scrollfläche: mit Trackpad, Wischen oder Ziehen durchblätterbar, mit
   scroll-snap rastet immer genau ein Kapitel ein. Die Nummern springen
   über scrollTo dorthin. */
.lab-stage {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.lab-stage::-webkit-scrollbar { display: none; }
.lab-stage.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.lab-track {
    display: flex;
    align-items: flex-start;
}

.chapter {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 2.4vh, 34px) 16px clamp(20px, 3vh, 40px);
    gap: clamp(18px, 2.6vh, 38px);

    /* Nachbarkapitel bleiben sichtbar — man soll ja sehen, dass es
       weitergeht — aber zurückgenommen. */
    opacity: 0.28;
    transition: opacity 0.45s ease;
}

.chapter.is-active { opacity: 1; }

.lab.is-gate .chapter { gap: clamp(14px, 2.2vh, 30px); padding-block: 0 clamp(12px, 2vh, 28px); }

.chapter-title {
    text-align: center;
    max-width: 16ch;
}

/* Der Kapitelwechsel setzt den Fokus auf die Überschrift, damit Screenreader
   mitkommen. Ein sichtbarer Rahmen gehört an Bedienelemente, nicht an eine
   Überschrift — deshalb hier ohne Ring. */
.chapter-title:focus,
.chapter-title:focus-visible { outline: none; }

.chapter-lead {
    max-width: 44ch;
    font-size: clamp(15px, 1.7vw, 19px);
    color: var(--text-muted);
    text-align: center;
    text-wrap: balance;
}

.chapter-punch {
    max-width: 22ch;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(19px, 2.4vw, 32px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-align: center;
    text-wrap: balance;
    color: var(--gold-accent);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-punch.is-shown { opacity: 1; transform: none; }

.chapter-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

/* ============================================
   KAPITEL 01 — Der Verteilungs-Irrtum
   ============================================ */
.pie {
    width: min(760px, 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.pie-bar {
    position: relative;
    display: flex;
    height: clamp(58px, 8vw, 86px);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.pie-side {
    display: flex;
    align-items: center;
    padding-inline: clamp(12px, 2vw, 22px);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(20px, 3vw, 34px);
    letter-spacing: -0.02em;
    /* Breite kommt aus --split, gesetzt vom Range-Input */
    transition: width 0.12s linear;
}

.pie-side--a {
    width: calc(var(--split, 60) * 1%);
    justify-content: flex-start;
    background: linear-gradient(90deg, rgba(200, 180, 138, 0.32), rgba(200, 180, 138, 0.16));
    color: var(--person-a);
}

.pie-side--b {
    width: calc((100 - var(--split, 60)) * 1%);
    justify-content: flex-end;
    background: linear-gradient(90deg, rgba(127, 168, 160, 0.16), rgba(127, 168, 160, 0.32));
    color: var(--person-b);
}

/* Der Griff sitzt exakt auf der Trennkante */
.pie-range {
    width: 100%;
    margin: 0;
    appearance: none;
    background: transparent;
    cursor: ew-resize;
}

.pie-range:focus { outline: none; }
.pie-range:focus-visible { outline: 2px solid var(--gold-accent); outline-offset: 6px; border-radius: 999px; }

.pie-range::-webkit-slider-runnable-track {
    height: 2px;
    background: var(--hairline);
    border-radius: 999px;
}

.pie-range::-webkit-slider-thumb {
    appearance: none;
    width: 30px; height: 30px;
    margin-top: -14px;
    border-radius: 999px;
    background: var(--gold-accent);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 6px 20px rgba(200, 180, 138, 0.4);
    cursor: ew-resize;
    transition: transform 0.2s ease;
}

.pie-range:active::-webkit-slider-thumb { transform: scale(1.16); }

.pie-range::-moz-range-track {
    height: 2px;
    background: var(--hairline);
    border-radius: 999px;
}

.pie-range::-moz-range-thumb {
    width: 24px; height: 24px;
    border-radius: 999px;
    background: var(--gold-accent);
    border: 3px solid var(--bg-primary);
    cursor: ew-resize;
}

.pie-sum {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(26px, 3.6vw, 46px);
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.pie-sum small {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* Kurzes Pulsieren bei jeder Bewegung: die Summe rührt sich nicht */
.pie-sum.is-pulsing .pie-sum-value { animation: sumPulse 340ms ease-out; }

@keyframes sumPulse {
    0%   { transform: scale(1); color: var(--text-primary); }
    40%  { transform: scale(1.09); color: var(--gold-accent); }
    100% { transform: scale(1); color: var(--text-primary); }
}

.pie-sum-value { display: inline-block; }

.pie-legend {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.pie-legend span:first-child { color: var(--person-a); }
.pie-legend span:last-child { color: var(--person-b); }

/* TIEFE — `--panel-face` und `--panel-lift` stehen seit der
   Sektionsüberarbeitung in base.css unter `:root`, weil sie auch die
   Prinzipien, die Phasenspur und die Schulformate tragen. */

/* ============================================
   KAPITEL 02 — Wertschöpfung (der Tausch)
   ============================================ */
.trade {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    justify-items: center;
    gap: clamp(12px, 2.4vw, 32px);
    width: 100%;
    max-width: 900px;
}

/* --- Die beiden Parteien als Karten, einander zugewandt --- */
.person {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    padding: clamp(20px, 2.6vh, 30px) clamp(16px, 2vw, 26px) clamp(18px, 2.4vh, 26px);
    border-radius: 24px;
    border: 1px solid rgba(245, 242, 232, 0.08);
    background: var(--panel-face);
    box-shadow: var(--panel-lift);
    transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Farbiger Schein hinter der Karte — trägt die Rollenfarbe in die Tiefe */
.person::before {
    content: '';
    position: absolute;
    inset: 12% -6% -10%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 60%, currentColor, transparent 68%);
    opacity: 0.16;
    filter: blur(26px);
    pointer-events: none;
}

.person--a { color: var(--person-a); }
.person--b { color: var(--person-b); }

.person--a { border-color: rgba(200, 180, 138, 0.2); }
.person--b { border-color: rgba(127, 168, 160, 0.2); }

/* Die eigene Seite steht vorn */
.person.is-you {
    border-color: var(--gold-accent-border);
    box-shadow: var(--panel-lift), 0 0 0 1px rgba(200, 180, 138, 0.16);
}

.person-avatar {
    position: relative;
    width: clamp(56px, 7vw, 76px);
    aspect-ratio: 1;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid currentColor;
    background: radial-gradient(circle at 50% 30%,
        color-mix(in srgb, currentColor 26%, transparent),
        color-mix(in srgb, currentColor 8%, transparent) 70%);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.person-avatar svg { width: 54%; height: 54%; }

.person-name {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Steht auf beiden Karten — bei B unsichtbar, damit die Zeilen fluchten. */
.person-you {
    display: inline-block;
    visibility: hidden;
    min-height: 1em;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--gold-accent);
    color: #0E0E0E;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    box-shadow: 0 6px 16px -6px rgba(200, 180, 138, 0.9);
}

.person.is-you .person-you { visibility: visible; }

/* --- Besitz: das gehandelte Objekt --- */
.person-holdings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 84px;
    width: 100%;
}

.holding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(245, 242, 232, 0.1);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.2));
    box-shadow: 0 14px 26px -14px rgba(0, 0, 0, 0.9),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.holding svg { width: 30px; height: 30px; }
.holding--item { color: var(--text-primary); }
.holding--money { color: var(--person-b); }

.holding-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Der Wert je Seite: sitzt am Kartenfuß, damit beide Seiten fluchten --- */
.person-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(245, 242, 232, 0.08);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    text-align: center;
}

.person-value strong {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(26px, 3.4vw, 40px);
    letter-spacing: -0.03em;
    line-height: 1;
    color: currentColor;
    text-transform: none;
}

/* --- Gewinn nach dem Tausch --- */
.person-gain {
    display: inline-flex;
    align-items: baseline;
    padding: 7px 18px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(16px, 2.2vw, 24px);
    letter-spacing: -0.02em;
    box-shadow: 0 10px 24px -12px currentColor;
    opacity: 0;
    transform: scale(0.86) translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.person-gain.is-shown { opacity: 1; transform: none; }

/* --- Der Knoten in der Mitte: hier findet der Tausch statt --- */
.trade-middle {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.trade-arrows {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(54px, 7vw, 76px);
    aspect-ratio: 1;
    border-radius: 999px;
    border: 1px solid rgba(245, 242, 232, 0.12);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.28));
    box-shadow: 0 16px 30px -16px rgba(0, 0, 0, 0.9),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: var(--text-faint);
    transition: color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

.trade-arrows svg { width: 58%; height: auto; }

/* Nach dem Tausch leuchtet der Knoten auf */
.trade.is-settled .trade-arrows {
    color: var(--gold-accent);
    border-color: var(--gold-accent-border);
    box-shadow: 0 16px 34px -14px rgba(200, 180, 138, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.18),
                0 0 0 6px rgba(200, 180, 138, 0.07);
}

/* Fliegendes Objekt während des Tauschs */
.trade-flyer {
    position: fixed;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid var(--gold-accent-border);
    background: linear-gradient(165deg, #232120, #131211);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.75),
                0 0 0 6px rgba(200, 180, 138, 0.08);
    pointer-events: none;
}

.trade-flyer svg { width: 30px; height: 30px; }

/* --- Entscheidung --- */
.decision {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.decision-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.decision-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 210px;
    padding: 16px 26px;
    border: 1px solid rgba(245, 242, 232, 0.12);
    border-radius: 18px;
    background: var(--panel-face);
    box-shadow: var(--panel-lift);
    text-align: left;
    transition: var(--transition);
}

.decision-btn strong {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.decision-btn span { font-size: 12.5px; color: var(--text-faint); }

.decision-btn:hover {
    border-color: var(--gold-accent-border);
    transform: translateY(-4px);
    box-shadow: 0 30px 56px -20px rgba(0, 0, 0, 0.9),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.decision-btn--trade {
    border-color: transparent;
    background: linear-gradient(165deg, #E0CFA6, var(--gold-accent) 60%, #B8A379);
    color: #0E0E0E;
    box-shadow: 0 22px 44px -18px rgba(200, 180, 138, 0.75),
                inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.decision-btn--trade span { color: rgba(14, 14, 14, 0.66); }

.decision-btn--trade:hover {
    box-shadow: 0 30px 56px -18px rgba(200, 180, 138, 0.85),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.decision-btn:disabled { opacity: 0.4; pointer-events: none; }

/* --- Ergebnis --- */
.result-block { display: none; }

.chapter[data-state="result"] .decision { display: none; }

/* Der Einleitungstext beschreibt die Ausgangslage — nach dem Tausch ist er
   erledigt und würde nur den Platz für das Ergebnis wegnehmen. */
.chapter[data-state="result"] > .chapter-lead { display: none; }
.chapter[data-state="result"] { gap: clamp(14px, 2vh, 26px); }

.chapter[data-state="result"] .result-block,
.chapter[data-state="brand"] .result-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.value-created {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: clamp(14px, 2vh, 22px) clamp(30px, 5vw, 56px);
    border-radius: 22px;
    border: 1px solid var(--gold-accent-medium);
    background: radial-gradient(ellipse at 50% 0%, rgba(200, 180, 138, 0.16), transparent 70%),
                var(--panel-face);
    box-shadow: 0 30px 60px -26px rgba(200, 180, 138, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.value-created-num {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(40px, 6.4vw, 84px);
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--gold-accent);
    text-shadow: 0 0 70px rgba(200, 180, 138, 0.45);
}

.value-created-label {
    font-size: clamp(10px, 1.3vw, 13px);
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.result-note {
    max-width: 46ch;
    font-size: clamp(14px, 1.6vw, 17px);
    color: var(--text-muted);
    text-align: center;
    text-wrap: balance;
}

.result-block.is-neutral .value-created {
    border-color: var(--hairline);
    background: var(--panel-face);
    box-shadow: var(--panel-lift);
}

.result-block.is-neutral .value-created-num {
    color: var(--text-faint);
    text-shadow: none;
}

/* ============================================
   KAPITEL 03 — Nash-Gleichgewicht

   Auszahlungen (A | B). „Drücken" dominiert im Einmalspiel: egal was der
   andere tut, drücken bringt mehr — deshalb landen beide bei 1|1, obwohl
   3|3 für beide besser wäre. Im Wiederholungsspiel dreht sich das.
   ============================================ */
.nash {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 2vw, 22px);
    width: 100%;
}

/* --- Umschalter Einmalig / Immer wieder --- */
.nash-mode {
    display: inline-flex;
    padding: 5px;
    border: 1px solid rgba(245, 242, 232, 0.1);
    border-radius: 999px;
    gap: 4px;
    background: linear-gradient(165deg, rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.03));
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.nash-mode button {
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    transition: var(--transition);
}

.nash-mode button:hover { color: var(--text-primary); }

.nash-mode button[aria-pressed="true"] {
    background: linear-gradient(165deg, rgba(200, 180, 138, 0.24), rgba(200, 180, 138, 0.1));
    color: var(--gold-accent);
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.9),
                inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* --- Die Matrix --- */
.nash-table-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.nash-table-wrap::-webkit-scrollbar { display: none; }

/* Feste Spaltenbreiten: bei automatischem Layout sprengt die Beschriftung
   links ihre Spalte, die Ausgleichsspalte rechts bleibt schmal — und das
   Raster steht nicht mehr auf der Mittelachse. */
.nash-table {
    --nash-side: clamp(74px, 9vw, 124px);
    --nash-cell: clamp(124px, 16vw, 186px);

    table-layout: fixed;
    width: calc(var(--nash-side) * 2 + var(--nash-cell) * 2 + 50px);
    border-collapse: separate;
    border-spacing: 10px;
    text-align: center;
}

/* Kopf- und Zeilenbeschriftung als Chips in der jeweiligen Rollenfarbe */
.nash-table th {
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0;
    white-space: nowrap;
}

.nash-table thead th span,
.nash-table tbody th span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.nash-table thead th { color: var(--person-b); }
.nash-table tbody th { color: var(--person-a); text-align: right; }

/* --- Die Zellen als erhabene Kacheln --- */
.nash-cell { width: var(--nash-cell); padding: 0; }

.nash-cell button {
    position: relative;
    width: 100%;
    padding: clamp(18px, 2.4vw, 28px) 12px;
    border: 1px solid rgba(245, 242, 232, 0.09);
    border-radius: 20px;
    background: var(--panel-face);
    box-shadow: var(--panel-lift);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
}

.nash-cell button:hover {
    border-color: var(--gold-accent-border);
    transform: translateY(-4px);
    box-shadow: 0 32px 58px -22px rgba(0, 0, 0, 0.9),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nash-payoff {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(24px, 3.2vw, 38px);
    letter-spacing: -0.03em;
    line-height: 1;
}

.nash-payoff .a { color: var(--person-a); }
.nash-payoff .b { color: var(--person-b); }

/* Feiner Trennstrich zwischen den beiden Auszahlungen */
.nash-payoff .sep {
    display: inline-block;
    width: 1px;
    height: 0.74em;
    align-self: center;
    background: rgba(245, 242, 232, 0.24);
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}

/* Beschriftungsspalte links und Ausgleichsspalte rechts, exakt gleich breit */
.nash-gutter,
.nash-table tbody th { width: var(--nash-side); padding: 0; }

.nash-table thead th { width: var(--nash-cell); }

.nash-cell-tag {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: transparent;
    transition: color 0.4s ease;
}

/* Vom Nutzer gewählte Zelle */
.nash-cell.is-chosen button {
    border-color: rgba(200, 180, 138, 0.55);
    transform: translateY(-4px);
}

/* Das Gleichgewicht des jeweiligen Modus — hebt sich deutlich ab */
.nash-cell.is-equilibrium button {
    border-color: var(--gold-accent);
    background: radial-gradient(ellipse at 50% 0%, rgba(200, 180, 138, 0.2), transparent 72%),
                var(--panel-face);
    box-shadow: 0 30px 60px -24px rgba(200, 180, 138, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.16),
                0 0 0 5px rgba(200, 180, 138, 0.08);
}

.nash-cell.is-equilibrium .nash-cell-tag { color: var(--gold-accent); }

/* --- Rundenverlauf --- */
.nash-rounds {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 12px;
}

.nash-round {
    width: 11px; height: 11px;
    border-radius: 4px;
    background: rgba(245, 242, 232, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: background 0.3s ease, transform 0.3s ease;
}

.nash-round.is-coop {
    background: var(--gold-accent);
    box-shadow: 0 4px 12px -4px rgba(200, 180, 138, 0.9);
}

.nash-round.is-defect {
    background: rgba(224, 138, 122, 0.8);
    box-shadow: 0 4px 12px -4px rgba(224, 138, 122, 0.7);
}

.nash-verdict {
    max-width: 46ch;
    min-height: 3em;
    font-size: clamp(14px, 1.6vw, 17px);
    color: var(--text-muted);
    text-align: center;
    text-wrap: balance;
    transition: opacity 0.4s ease;
}

@media (max-width: 640px) {
    /* Muss samt Beschriftungsspalten schon ab 360px hineinpassen:
       2 × 52 + 2 × 90 + 30 = 314 px bei 360px Fensterbreite. */
    .nash-table {
        --nash-side: 52px;
        --nash-cell: clamp(78px, 25vw, 130px);
        border-spacing: 6px;
        width: calc(var(--nash-side) * 2 + var(--nash-cell) * 2 + 30px);
    }
    .nash-table thead th span,
    .nash-table tbody th span {
        padding: 5px 7px;
        font-size: 8.5px;
        letter-spacing: 0.04em;
        border-radius: 10px;
    }
    .nash-table th { font-size: 9px; letter-spacing: 0.08em; }
    .nash-table thead th span,
    .nash-table tbody th span { padding: 6px 9px; }
    .nash-table tbody th { white-space: normal; }
}

/* ============================================
   ABSCHLUSS IM GATE
   ============================================ */
.lab-outro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

/* Im Seitenzustand führt das Kapitel weiter, statt das Gate zu schließen */
.lab:not(.is-gate) .lab-outro-gateonly { display: none; }
.lab.is-gate .lab-outro-pageonly { display: none; }

/* ============================================
   MOBIL
   ============================================ */
@media (max-width: 760px) {

    .trade {
        grid-template-columns: 1fr;
        gap: 8px;
        justify-items: center;
    }

    .trade-middle { flex-direction: row; gap: 12px; }
    .trade-arrows { transform: rotate(90deg); }
    .trade-arrows svg { width: 30px; }

    .person { gap: 7px; }
    .person-avatar { width: 54px; }
    .person-holdings { min-height: 0; gap: 8px; }
    .holding { padding: 7px 12px; }
    .holding svg { width: 19px; height: 19px; }
    .person-value strong { font-size: 19px; }

    .decision-buttons { width: 100%; flex-direction: column; gap: 10px; }
    .decision-btn { width: 100%; min-width: 0; padding: 13px 20px; }

    .pie-side { font-size: 19px; }
    .pie-bar { height: 54px; }
}

@media (max-height: 680px) {
    .chapter { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .chapter,
    .chapter.is-active { transform: none !important; }
    .trade-flyer { display: none !important; }
    .lab.is-gate { animation: none; }
    .pie-sum.is-pulsing .pie-sum-value { animation: none; }
}
