:root {
  color-scheme: light;
  --ink: #20201e;
  --muted: #5c5c56;
  --line: #deded8;
  --light: #f6f6f3;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: white;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
p, figure, ol, dl, dd { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid #3c504a; outline-offset: 3px; }
button, select, input { font: inherit; }
button, select, summary, .file-label { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
main { width: min(740px, calc(100% - 40px)); margin: 54px auto 55px; }
.intro { margin: 0 auto 27px; }
.intro p:not(.links) { font: 1.125rem/1.48 Georgia, serif; }
.intro p + p { margin-top: 9px; }
.links { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .89rem; }
.section-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; font-size: .92rem; }
.section-line a { font-size: .83rem; }
.error { margin-bottom: 8px; color: #8f3025; }
.replay { display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(254px, 1fr); border: 1px solid var(--line); }
.play-area { min-width: 0; display: flex; flex-direction: column; }
.table-bar { display: flex; justify-content: space-between; gap: 7px; font: .78rem/1.4 var(--mono); padding: 8px 10px; border-bottom: 1px solid var(--line); }
#round, .scoreboard span { white-space: nowrap; }
#round span { color: var(--muted); }
.scoreboard { display: flex; gap: 10px; }
.board { min-height: 268px; flex: 1; display: grid; grid-template: repeat(3, 1fr) / repeat(3, minmax(0, 1fr)); align-items: center; justify-items: center; padding: 6px 3px; background: var(--light); }
.seat, .market { min-width: 0; display: grid; justify-items: center; gap: 4px; }
.north { grid-area: 1 / 2; }.east { grid-area: 2 / 3; }.south { grid-area: 3 / 2; }.west { grid-area: 2 / 1; }.market { grid-area: 2 / 2; }
.seat-name, .market > span { font: .72rem/1.3 var(--mono); white-space: nowrap; padding: 2px 4px; }
.seat-team { color: var(--muted); margin-left: 4px; }
.seat[data-active] .seat-name { background: #242420; color: white; }
.seat[data-active] .seat-team { color: #e5e5de; }
.seat[data-target] .seat-name { outline: 1px solid #6a6a61; }
.cards { display: flex; justify-content: center; gap: 2px; }
.card { width: 27px; min-height: 24px; display: flex; align-items: center; justify-content: center; gap: 1px; border: 1px solid #d2d2ca; background: white; font: 600 .65rem/1 var(--mono); }
.card-suit { font-size: .8rem; }
.card.red { color: #8a3026; }
.card.back { background: repeating-linear-gradient(135deg, #eee 0 3px, #dfdfd8 3px 4px); }
.card.empty { border-style: dashed; background: transparent; }
.card.changed, .seat[data-square] .card { border-color: #466055; background: #edf2ee; }
.phases { display: flex; gap: 3px; list-style: none; padding: 6px 9px; border-top: 1px solid var(--line); color: var(--muted); font: .72rem var(--mono); }
.phases li { padding: 2px 5px; }
.phases li[aria-current] { color: var(--ink); background: #e7e7e1; font-weight: 700; }
.transport { display: flex; gap: 5px; align-items: center; padding: 2px 9px 9px; }
.transport button, .close-dialog { min-height: 28px; padding: 2px 7px; color: var(--ink); background: white; border: 1px solid #c5c5bd; border-radius: 2px; font-size: .79rem; }
.transport button:hover:not(:disabled), .close-dialog:hover { background: var(--light); }
#play { min-width: 52px; }
#scrub { flex: 1; min-width: 24px; accent-color: #333; }
#position { text-align: right; white-space: nowrap; font: .69rem var(--mono); color: var(--muted); }
.spectator { display: flex; flex-direction: column; min-width: 0; padding: 0 10px; border-left: 1px solid var(--line); font-size: .84rem; }
.mode-switch { display: flex; gap: 12px; border-bottom: 1px solid var(--line); }
.mode-switch button { background: none; border: 0; border-bottom: 1px solid transparent; padding: 7px 0 5px; color: var(--muted); }
.mode-switch button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 650; }
.replay-story { padding-block: 7px; overflow-wrap: anywhere; }
.replay-story strong, .secondary { display: block; }
.secondary { color: var(--muted); font: .71rem/1.4 var(--mono); }
.replay-story p { margin-top: 2px; }
.scene-secret { color: #3c5147; }
.chapters, .full-log { min-height: 0; }
.chapter, .full-log button { display: grid; grid-template-columns: 56px 1fr; align-items: baseline; gap: 5px; width: 100%; background: white; border: 0; border-bottom: 1px solid #ededeb; color: var(--ink); padding: 4px 3px; text-align: left; overflow-wrap: anywhere; font-size: .79rem; }
.chapter:hover, .full-log button:hover, .chapter[aria-current], .full-log button[aria-current] { background: var(--light); }
.chapter[aria-current], .full-log button[aria-current] { font-weight: 630; }
.chapter-time { color: var(--muted); font: .67rem var(--mono); white-space: nowrap; }
.chapter-next { display: none; }
.log-heading { border-block: 1px solid var(--line); padding: 4px 0; display: flex; gap: 5px; justify-content: space-between; align-items: center; font-size: .77rem; }
.log-heading select { max-width: 112px; border: 1px solid var(--line); color: var(--ink); background: white; font-size: .75rem; }
.full-log ol { padding: 0; list-style: none; max-height: 114px; overflow-y: auto; }
.full-log button { grid-template-columns: 30px 1fr; }
.full-log button > span:first-child { font: .69rem var(--mono); color: var(--muted); }
.spectator-tools { margin-top: auto; padding-top: 7px; }
.reveal { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 5px; }
.reveal input { margin: 0; accent-color: var(--ink); }
.tells { color: var(--muted); font-size: .77rem; padding: 3px 0; }
.replay-file { display: flex; justify-content: space-between; gap: 5px; padding-block: 5px 7px; font-size: .74rem; color: var(--muted); }
.file-label { text-decoration: underline; text-underline-offset: 3px; }
.file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-label:focus-within { outline: 2px solid #3c504a; outline-offset: 2px; }
.metrics { display: flex; flex-wrap: wrap; gap: 5px 20px; padding: 7px 9px; border: 1px solid var(--line); border-top: 0; font-size: .79rem; }
.metrics dt { color: var(--muted); }.metrics dd { font-family: var(--mono); }
details { border-top: 1px solid var(--line); margin-top: 22px; padding: 7px 0; font-size: .86rem; }
details summary { width: fit-content; }
details p { margin-top: 7px; }
pre { margin: 9px 0; padding: 8px; overflow: auto; background: var(--light); }
code { font-family: var(--mono); }
dialog { width: min(510px, calc(100% - 30px)); max-height: 85vh; border: 1px solid #9b9b92; padding: 14px; color: var(--ink); background: white; }
dialog::backdrop { background: #16161370; }
dialog form { float: right; }
dialog p { margin-top: 7px; font-size: .87rem; }
.scoring { margin-top: 10px; font-size: .83rem; }
.scoring > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; border-top: 1px solid var(--line); padding-block: 4px; }
.scoring dt { font-weight: 650; }.scoring dd:last-of-type { grid-column: 1 / -1; color: var(--muted); }
@media (max-width: 620px) {
  main { width: calc(100% - 24px); margin-top: 20px; }
  .intro { margin-bottom: 25px; }
  .replay { grid-template-columns: 1fr; }
  .spectator { border-left: 0; border-top: 1px solid var(--line); }
  .board { min-height: 215px; }
  .card { width: 22px; }
}
@media (max-width: 350px) {
  .card { width: 20px; }
  .card-suit { font-size: .7rem; }
}

.recording-select { margin-bottom: 6px; color: var(--muted); font-size: .79rem; }
.recording-select select { border: 1px solid var(--line); background: white; color: var(--ink); }
.study { margin-top: 26px; padding-top: 13px; border-top: 1px solid var(--line); }
.study h2, .study h3 { margin: 0 0 6px; font-size: .98rem; }
.study h3 { margin-top: 18px; }
.study p { font-size: .92rem; }
.study p + p, .study-table + p { margin-top: 7px; }
.study details { margin-top: 13px; }
.policy-chart { display: grid; gap: 6px; margin: 6px 0 11px; }
.chart-row { display: grid; grid-template-columns: minmax(130px, .9fr) 3fr; align-items: center; gap: 8px; font-size: .8rem; }
.chart-bar { display: flex; min-height: 19px; font: .72rem/1 var(--mono); }
.chart-bar span { display: grid; flex-basis: 0; align-items: center; text-align: center; }
.series-squares { --series: #363632; --series-ink: white; }
.series-caught { --series: #9d8978; --series-ink: #151411; }
.series-unanswered { --series: #eae9e3; --series-ink: #242420; }
.chart-bar span { background: var(--series); color: var(--series-ink); }
.chart-legend { display: flex; flex-wrap: wrap; padding: 0; column-gap: 10px; list-style: none; margin: 9px 0 2px; color: var(--muted); font-size: .75rem; }
.chart-legend li { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend li::before { content: ""; width: 8px; height: 8px; border: 1px solid var(--line); background: var(--series); }
.study-table { width: 100%; overflow: auto; margin: 8px 0; }
.study-table table { width: 100%; border-collapse: collapse; text-align: left; font-size: .78rem; }
.study-table tr { border-bottom: 1px solid var(--line); }
.study-table th, .study-table td { padding: 4px 6px; vertical-align: top; }
.study-table th:first-child { padding-left: 0; }
.study-table tbody th { font-weight: 500; }
@media (max-width: 425px) {
  .chart-row { grid-template-columns: 114px 1fr; gap: 4px; font-size: .75rem; }
}
.contact { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 9px; font-size: .86rem; }
