@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100..900&display=swap');


:root {
  color-scheme: dark;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 18px;
  --bg: #171525; --panel: #201d31; --surface: #1b1829;
  --line: #373247; --control: #2d273e; --control-line: #51475f;
  --text: #f5f1e6; --muted: #c0b8cd; --button-text: #271c2c;
  --pink: #ed93ad; --green: #76ddba; --gold: #e8be70;
  --stay: #ed93ad; --switch: #76ddba; --random: #e8be70;
  --insight: #2b2430; --insight-line: #564331; --glow: #35234245;
  --stage-back: #2c233c; --stage-stripe: #352940; --stage-shadow: #241c33;
  --stage-floor: #4c3347; --stage-seam: #3b2b3b; --stage-edge: #946579; --stage-text: #e4d5ef;
  --door-frame: #866181; --door-trim: #b07b95; --door: #9d5677;
  --door-light: #c07c96; --door-shadow: #743d62; --door-inset: #ab6483;
}
:root[data-theme="black-gold"] {
  --bg: #10100f; --panel: #1a1916; --surface: #131310;
  --line: #3a3425; --control: #28251d; --control-line: #655736;
  --text: #f6efdc; --muted: #c9bea6; --button-text: #18140a;
  --pink: #e6bd61; --green: #8acabb; --gold: #e6bd61;
  --stay: #e6bd61; --switch: #8acabb; --random: #c2afe1;
  --insight: #231f15; --insight-line: #594827; --glow: #be923718;
  --stage-back: #24221b; --stage-stripe: #2d291f; --stage-shadow: #15140f;
  --stage-floor: #3f3521; --stage-seam: #2b2418; --stage-edge: #9b7a3f; --stage-text: #f4e4bc;
  --door-frame: #8c7349; --door-trim: #c5a563; --door: #937235;
  --door-light: #d4b66c; --door-shadow: #5a4524; --door-inset: #ac8b46;
}
:root[data-theme="ocean"] {
  --bg: #0f1d29; --panel: #172b39; --surface: #12232f;
  --line: #2a4656; --control: #203b4a; --control-line: #456779;
  --text: #eaf5f5; --muted: #b7cfda; --button-text: #102633;
  --pink: #79d4e3; --green: #a5ddad; --gold: #efc786;
  --stay: #79d4e3; --switch: #a5ddad; --random: #efc786;
  --insight: #20323a; --insight-line: #4b5a50; --glow: #247a941f;
  --stage-back: #173648; --stage-stripe: #1f4051; --stage-shadow: #102431;
  --stage-floor: #29495a; --stage-seam: #1c3442; --stage-edge: #6696a6; --stage-text: #deeff5;
  --door-frame: #5f91a4; --door-trim: #8bb8c3; --door: #3e829b;
  --door-light: #8ccbd3; --door-shadow: #295669; --door-inset: #579bad;
}
:root[data-theme="daylight"] {
  color-scheme: light;
  --bg: #f2efe7; --panel: #fffdf7; --surface: #ebe7dc;
  --line: #d8d2c3; --control: #ede8dc; --control-line: #b7ae9b;
  --text: #2c352e; --muted: #565e52; --button-text: #ffffff;
  --pink: #32694e; --green: #317259; --gold: #916519;
  --stay: #b14c68; --switch: #247c60; --random: #8a6517;
  --insight: #f4eddc; --insight-line: #d9c8a2; --glow: #bac7a825;
  --stage-back: #d4dacc; --stage-stripe: #c7d1c0; --stage-shadow: #334737;
  --stage-floor: #adbaa0; --stage-seam: #83997b; --stage-edge: #597350; --stage-text: #263b2a;
  --door-frame: #4f7358; --door-trim: #8fb28e; --door: #5a8260;
  --door-light: #a9c3a0; --door-shadow: #36583e; --door-inset: #789b73;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.35; background-image: radial-gradient(ellipse at 75% 5%, var(--glow), transparent 45%); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
button:hover:not(:disabled) { filter: brightness(1.12); }
a { color: inherit; text-decoration: none; }
canvas { image-rendering: pixelated; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Put the controls directly above the experiment, with labels beside inputs. */
.site-header { min-height: 56px; max-width: 1480px; margin: auto; padding: 7px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px 'Roboto', system-ui, sans-serif; }
.brand canvas { width: 30px; height: 30px; }
.brand b { color: var(--pink); }
.header-actions { display: flex; align-items: center; gap: 22px; }
.theme-control { display: flex; align-items: center; gap: 9px; }
.theme-control label { font-size: 12px; letter-spacing: .5px; font-weight: 700; color: var(--muted); }
.theme-swatch { width: 12px; height: 12px; flex-shrink: 0; background: var(--pink); border-radius: 2px; }
.theme-control select { min-height: 34px; max-width: 180px; padding: 4px 24px 4px 10px; border: 1px solid var(--control-line); border-radius: 4px; background: var(--control); color: var(--text); font-size: 14px; cursor: pointer; }
main { max-width: 1480px; margin: auto; padding: 0 24px; }
.site-footer { max-width: 1480px; margin: 24px auto 0; padding: 16px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.site-footer a { color: var(--pink); text-decoration: underline; text-underline-offset: 3px; }
.workspace-top { min-height: 47px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 26px; }
.tab { display: flex; align-items: center; gap: 8px; padding: 12px 0 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font-size: 16px; font-weight: 600; color: var(--muted); }
.tab.active { color: var(--pink); border-bottom-color: var(--pink); }
.workspace-actions { display: flex; align-items: center; gap: 18px; }
.session-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.focus-button { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.focus-button > span { font-size: 17px; line-height: 1; }
.focus-button[aria-pressed="true"] { color: var(--pink); border-color: var(--pink); background: color-mix(in srgb, var(--pink) 7%, transparent); }
.controls { display: flex; flex-direction: column; align-items: stretch; margin-top: 8px; padding: 9px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.controls-row { display: flex; align-items: center; gap: 16px; }
.simulation-controls { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.control-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.control-group label { font-size: 14px; font-weight: 600; color: var(--muted); }
.stepper { display: flex; align-items: center; height: 34px; border: 1px solid var(--control-line); border-radius: 4px; overflow: hidden; }
.stepper button { width: 30px; height: 100%; background: var(--control); color: var(--text); font-size: 21px; }
.stepper output { width: 32px; text-align: center; font: 600 18px 'Roboto', sans-serif; }
.speed-control { flex: 1; min-width: 200px; gap: 10px; }
.speed-control label { display: flex; flex-direction: column; flex-shrink: 0; line-height: 1.2; }
.speed-control output { color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; margin-top: 2px; }
.range-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 34px; }
.range-wrap span { font-size: 14px; }
.range-wrap input { width: 100%; min-width: 50px; height: 5px; accent-color: var(--pink); cursor: pointer; }
.rounds-control select { height: 34px; padding: 0 20px 0 8px; border: 1px solid var(--control-line); border-radius: 4px; background: var(--control); color: var(--text); font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 9px 17px; border-radius: 4px; font-size: 16px; font-weight: 700; box-shadow: 0 3px 0 #0003; transition: filter .15s, transform .15s; }
.button:active { transform: translateY(2px); box-shadow: none; }
.primary { color: var(--button-text); background: var(--pink); border: 1px solid var(--pink); }
.secondary { color: var(--text); background: var(--control); border: 1px solid var(--control-line); }
.simulation-controls > .primary { min-height: 36px; padding: 7px 12px; font-size: 14px; white-space: nowrap; }
.reset-button { flex-shrink: 0; width: 34px; height: 34px; background: none; color: var(--muted); font-size: 28px; }
.setting-note { margin: 7px 2px 8px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.intro-card { max-width: 840px; margin: 24px auto; padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.intro-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.intro-heading h2 { margin-top: 6px; font: 700 28px 'Roboto', system-ui, sans-serif; }
.intro-heading > span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.intro-strategy { margin: 16px 0 20px; color: var(--muted); line-height: 1.6; }
#intro-scene { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.intro-explanation { min-height: 114px; padding: 20px 0; }
.intro-explanation h3 { margin-bottom: 8px; font-size: 19px; }
.intro-explanation p { color: var(--muted); line-height: 1.6; }
.intro-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }

/* Contestants get the majority of the width; the graph is a compact sidebar. */
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); align-items: start; gap: 20px; transition: grid-template-columns .45s cubic-bezier(.2,.75,.25,1), gap .45s ease; }
.players-column, .results-column { min-width: 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; min-height: 26px; }
.section-title h2 { font-size: 20px; font-weight: 600; }
.section-title > span { margin-left: auto; font-size: 12px; color: var(--muted); }
#players { display: flex; flex-direction: column; gap: 9px; }
.player-card { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 7px; overflow: hidden; background: var(--panel); }
.player-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 16px 6px; }
.player-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-info h3 { font-size: 20px; font-weight: 650; line-height: 1.2; margin-bottom: 3px; }
.player-rate { flex-shrink: 0; text-align: right; color: var(--accent); font: 600 34px/1 'Roboto', sans-serif; letter-spacing: -.7px; }
.player-rate small { display: inline-block; margin-left: 8px; color: var(--muted); font: 500 12px/1 'Roboto', sans-serif; letter-spacing: 0; }
.player-scene { position: relative; height: 110px; margin: 0 12px; overflow: hidden; border: 1px solid var(--line); border-bottom: 0; border-radius: 3px 3px 0 0; background: var(--stage-back); }
.player-scene canvas { width: 100%; height: 100%; display: block; }
.player-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 16px; font-size: 14px; line-height: 1.25; color: var(--muted); background: var(--surface); }
.player-bottom b { color: var(--text); font-weight: 600; }
.player-bottom .expected { color: var(--accent); }
.results-column { display: flex; flex-direction: column; gap: 12px; margin-top: 34px; transition: margin-top .45s ease; }
.chart-card { position: relative; padding: 16px 16px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .8px; color: var(--muted); }
.chart-heading h2 { font: 600 25px/1.2 'Roboto', sans-serif; letter-spacing: -.5px; margin: 7px 0; }
.chart-description { font-size: 16px; color: var(--muted); }
.chart-description strong { color: var(--text); font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 16px 0 10px; color: var(--text); font-size: 16px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-legend i { display: block; width: 9px; height: 9px; border-radius: 2px; }
.stay-color { background: var(--stay); }
.switch-color { background: var(--switch); }
.random-color { background: var(--random); }
.chart-wrap { position: relative; height: 210px; transition: height .45s cubic-bezier(.2,.75,.25,1); }
.chart-wrap canvas { display: block; width: 100%; height: 100%; image-rendering: auto; }
.chart-open { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: zoom-in; }
.chart-open:hover:not(:disabled) { filter: none; }
.chart-open:focus-visible { outline-offset: -4px; }
.chart-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; padding: 10px 0; margin-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.chart-footer > span:first-child { display: flex; align-items: center; gap: 6px; }
.dash-icon { display: inline-block; width: 16px; border-top: 1px dashed var(--muted); }
#auto-view.graph-focused .lab-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); align-items: stretch; }
#auto-view.graph-focused .players-column { display: flex; flex-direction: column; justify-content: center; min-height: calc(100dvh - 125px); }
#auto-view.graph-focused #players { flex: 0 1 auto; }
#auto-view.graph-focused .player-card { flex: 0 0 auto; }
#auto-view.graph-focused .player-top { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 10px; }
#auto-view.graph-focused .player-info h3 { font-size: clamp(14px, 1.35vw, 18px); }
#auto-view.graph-focused .player-rate { text-align: left; font-size: clamp(20px, 2.5vw, 28px); }
#auto-view.graph-focused .player-rate small { margin-left: 4px; font-size: 10px; }
#auto-view.graph-focused .player-bottom { padding: 5px 10px; font-size: clamp(10px, 1vw, 12px); gap: 4px 8px; }
#auto-view.graph-focused .player-scene { flex: 0 0 auto; height: clamp(84px, 12vh, 140px); min-height: 0; }
#auto-view.graph-focused .results-column { margin-top: 0; }
#auto-view.graph-focused .chart-wrap { height: min(62dvh, 620px); }
#auto-view.graph-focused .chart-open { cursor: zoom-out; }
#auto-view.graph-focused .player-scene { cursor: zoom-out; }
.text-button { display: inline-flex; gap: 12px; margin-top: 9px; padding: 0; background: none; color: var(--gold); font-size: 14px; font-weight: 600; }

/* Manual play uses the same legible type scale as the lab. */
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; margin-bottom: 20px; }
.play-card, .personal-stats { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.play-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 20px; }
.play-heading h2 { margin-top: 6px; font: 600 28px/1.2 'Roboto', sans-serif; }
.round-badge { flex-shrink: 0; padding: 6px 9px; border: 1px solid var(--insight-line); border-radius: 3px; font-size: 13px; color: var(--gold); }
.play-scene { position: relative; min-height: 270px; margin: 0 20px; padding: 22px 20px 17px; border: 1px solid var(--door-frame); border-radius: 4px; overflow: hidden; background: repeating-linear-gradient(90deg, var(--stage-back) 0, var(--stage-back) 34px, var(--stage-stripe) 35px, var(--stage-stripe) 44px); }
.play-scene:after { content: ''; pointer-events: none; position: absolute; top: 0; left: 0; right: 0; height: 10px; border-bottom: 3px solid var(--door-shadow); background: repeating-linear-gradient(90deg, var(--door) 0, var(--door) 18px, var(--door-shadow) 18px, var(--door-shadow) 36px); }
.play-scene > #play-host { position: relative; z-index: 1; width: 64px; height: 80px; }
.speech { display: inline-block; vertical-align: top; max-width: calc(100% - 94px); margin: 5px 0 0 20px; padding: 12px 15px; border: 1px solid var(--control-line); border-radius: 5px; background: var(--surface); color: var(--text); font-size: 16px; line-height: 1.6; }
.play-doors { position: relative; z-index: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; padding-bottom: 14px; }
.door-button { position: relative; display: flex; align-items: center; flex-direction: column; width: 84px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; }
.door-button:not(:disabled):hover { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 8%, transparent); }
.door-button.selected { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, transparent); }
.door-button.final-choice { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.door-button canvas { width: 72px; height: 103.5px; }
.door-button span { padding: 6px 0 5px; color: var(--stage-text); font: 600 14px 'Roboto', sans-serif; }
.door-button:disabled { opacity: 1; }
.door-button.open-goat { opacity: .65; }
.stage-floor { position: absolute; bottom: 0; left: 0; right: 0; height: 33px; border-top: 4px solid var(--stage-edge); background: repeating-linear-gradient(90deg, var(--stage-floor) 0, var(--stage-floor) 39px, var(--stage-seam) 39px, var(--stage-seam) 41px); }
.play-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; min-height: 100px; padding: 20px; }
.play-actions p { color: var(--muted); font-size: 16px; line-height: 1.5; }
.play-actions > div { display: flex; flex-wrap: wrap; gap: 12px; }
.personal-stats { padding: 22px; }
.personal-rate { padding: 22px 0; border-bottom: 1px solid var(--line); }
.personal-rate > span { color: var(--pink); font: 600 48px/1 'Roboto', sans-serif; letter-spacing: -1px; }
.personal-rate small { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; }
.personal-counts { display: flex; justify-content: space-between; gap: 20px; margin-top: 20px; }
.personal-counts strong { display: block; font: 600 28px 'Roboto', sans-serif; }
.personal-counts span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.personal-stats .text-button { margin-top: 23px; color: var(--muted); }
.focus-view .setting-note { display: none; }
.focus-view .lab-grid, .focus-view .play-layout { margin-top: 12px; }
.focus-view .players-column { display: flex; flex-direction: column; min-height: calc(100dvh - 125px); }
.focus-view #players { flex: 1; }
.focus-view .player-card { flex: 1; display: flex; flex-direction: column; }
.focus-view .player-scene { flex: 1; min-height: 96px; }
:root.focus-view[data-mode="auto"] .site-header,
:root.focus-view[data-mode="auto"] .tabs,
:root.focus-view[data-mode="auto"] .door-controls,
:root.focus-view[data-mode="auto"] .session-status,
:root.focus-view[data-mode="auto"] .site-footer { display: none; }
:root.focus-view[data-mode="auto"] .workspace-top { min-height: 0; justify-content: flex-end; margin-top: 8px; border: 0; }
:root.focus-view[data-mode="auto"] .simulation-controls { margin-top: 0; padding-top: 0; border-top: 0; }

@media (min-width: 981px) and (max-height: 800px) {
  .player-scene { height: 96px; }
  .player-top { padding-top: 5px; padding-bottom: 4px; }
  .player-bottom { padding-top: 5px; padding-bottom: 5px; }
  .chart-wrap { height: 190px; }
}
@media (max-width: 1180px) {
  .simulation-controls { flex-wrap: wrap; gap: 10px 16px; }
  .speed-control { min-width: 220px; }
  .simulation-controls > .primary { margin-left: auto; }
  .lab-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
  .chart-legend { gap: 8px 12px; }
  .section-title > span { font-size: 11px; }
}
@media (max-width: 980px) {
  .session-status { display: none; }
  .lab-grid { grid-template-columns: 1fr; }
  .results-column { margin-top: 0; }
  :root.focus-view[data-mode="auto"] .players-column { min-height: 0; }
  .player-scene { height: 110px; }
  .chart-wrap { height: 240px; }
  .play-layout { grid-template-columns: minmax(0, 1fr) 240px; }
  .focus-view .players-column { min-height: 0; }
  .focus-view .player-scene { min-height: 110px; }
}
@media (max-width: 680px) {
  .intro-card { padding: 16px; margin-top: 16px; }
  .intro-heading h2 { font-size: 23px; }
  .workspace-top { flex-wrap: wrap; }
  .site-header { padding: 8px 16px; gap: 12px; flex-wrap: wrap; }
  main { padding: 0 16px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand canvas { width: 26px; height: 26px; }
  .header-actions { gap: 12px; }
  .theme-control { gap: 6px; }
  .theme-control label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme-control select { max-width: 160px; }
  .workspace-top { gap: 10px; }
  .tabs { gap: 16px; }
  .tab { font-size: 14px; gap: 6px; }
  .focus-button { padding: 6px 8px; font-size: 13px; }
  .controls { gap: 0; padding: 10px; }
  .door-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .simulation-controls { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 10px; margin-top: 10px; padding-top: 10px; }
  .controls-row > .control-group { min-width: 0; }
  .control-group { justify-content: space-between; }
  .control-group label { font-size: 14px; }
  .speed-control { grid-column: 1 / 3; }
  .speed-control label { flex-direction: row; align-items: center; gap: 8px; }
  .speed-control output { margin: 0; font-size: 13px; }
  .range-wrap span { display: none; }
  .rounds-control { grid-column: 1 / 3; justify-content: flex-start; }
  .rounds-control select { flex: 1; }
  .simulation-controls > .primary { grid-column: 1; width: 100%; margin: 0; font-size: 15px; }
  .reset-button { grid-column: 2; }
  .setting-note { font-size: 13px; margin-bottom: 14px; }
  .section-title > span { display: none; }
  .player-top { padding: 10px 12px 8px; gap: 10px; }
  .player-info { gap: 8px; }
  .player-info h3 { font-size: 20px; }
  .player-rate { font-size: 30px; }
  .player-rate small { display: block; margin: 3px 0 0; }
  .player-bottom { padding: 8px 12px; font-size: 13px; flex-wrap: wrap; gap: 4px 10px; }
  .player-scene { margin: 0 10px; height: 100px; }
  .chart-heading h2 { font-size: 23px; }
  .chart-legend { gap: 8px 12px; }
  .chart-wrap { height: 220px; }
  .play-layout { grid-template-columns: 1fr; gap: 16px; }
  .play-heading { padding: 18px 14px; gap: 8px; }
  .play-heading h2 { font-size: 24px; }
  .round-badge { font-size: 12px; padding: 6px; }
  .play-scene { margin: 0 12px; padding: 22px 10px 17px; }
  .speech { margin-left: 8px; padding: 10px; max-width: calc(100% - 80px); font-size: 15px; }
  .play-doors { gap: 8px; }
  .play-actions { padding: 18px 14px; }
  .play-actions > div { width: 100%; gap: 8px; }
  .play-actions .button { flex: 1; padding: 10px; font-size: 15px; }
  .play-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .personal-stats { padding: 16px; }
  .personal-rate > span { font-size: 38px; }
}
@media (max-width: 420px) {
  .site-header { gap: 6px; }
  .brand { font-size: 15px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .theme-control label { position: static; width: auto; height: auto; clip-path: none; font-size: 12px; }
  .tabs { gap: 12px; }
  .focus-button { font-size: 12px; padding: 6px; gap: 4px; }
  .focus-button > span { font-size: 14px; }
  .stepper button { width: 25px; }
  .stepper output { width: 27px; }
  .speed-control label { flex-direction: column; align-items: flex-start; gap: 1px; }
}
@media (max-width: 680px) {
  #auto-view.graph-focused .lab-grid { grid-template-columns: minmax(0, 1fr); }
  #auto-view.graph-focused .lab-grid { align-items: start; }
  #auto-view.graph-focused .players-column { min-height: 0; }
  #auto-view.graph-focused #players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  #auto-view.graph-focused .player-top { display: block; padding: 6px; }
  #auto-view.graph-focused .player-info h3 { overflow-wrap: anywhere; font-size: 12px; }
  #auto-view.graph-focused .player-rate { margin-top: 4px; text-align: left; font-size: 18px; }
  #auto-view.graph-focused .player-rate small,
  #auto-view.graph-focused .player-bottom { display: none; }
  #auto-view.graph-focused .player-scene { height: 56px; min-height: 0; margin: 0 4px; }
  #auto-view.graph-focused .chart-wrap { height: min(62dvh, 500px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
}
