/* IBM Plex, SIL Open Font License 1.1. Self-hosted so no visitor data goes to a font service. */
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Cyrillic, for Ukrainian and Russian. A browser fetches these files only when a page shows such letters. */
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-500-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --ink: #16201C;
  --paper: #FFFFFF;
  --ground: #E9ECEA;
  --felt: #1F3B33;
  --felt-line: #6F8A80;
  --felt-text: #C9D6D0;
  --muted: #4A5650;
  --rule: #C3CAC6;
  --amber: #F2B233;
  --amber-deep: #A8770F;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0E1512; overflow: hidden; }
body { font-family: var(--sans); color: var(--ink); }
button { font-family: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
h1, h2, h3, p, dl, dd { margin: 0; }

/* A fixed 1280 x 720 stage, scaled to the window by main.js. */
#frame { position: fixed; inset: 0; }
#stage { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; overflow: hidden; background: var(--felt); transform-origin: center; transform: translate(-50%, -50%); }
/* Before the script picks a layout, small screens get the plain flow. */
@media (max-width: 921px), (max-height: 517px) { #stage:not([data-layout]) { position: static; width: 100%; height: auto; min-height: 100dvh; transform: none; } #stage:not([data-layout]) .boot { position: static; } }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mono.light { color: var(--felt-text); }
.mono.amber { color: var(--amber); }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fine { font-size: 13px; color: var(--felt-text); }
.fine.dark { color: var(--muted); }
.fine a { color: inherit; text-underline-offset: 2px; }

.btn { height: 48px; padding: 0 24px; border-radius: 8px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-size: 16px; font-weight: 600; }
.btn.primary { background: var(--amber); box-shadow: 0 5px 0 var(--amber-deep); border-color: var(--amber); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--amber-deep); }
.btn.big { height: 64px; padding: 0 40px; font-size: 20px; font-weight: 700; border-radius: 10px; }
#stage[data-screen='debrief'] .actions .btn { height: 44px; padding: 0 12px; font-size: 14.5px; }
.btn.ghost:hover { background: rgba(22, 32, 28, 0.06); }

/* Glossary term with its (i) button. */
.term { display: inline-flex; align-items: center; gap: 5px; padding: 0 2px; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.term.bare { padding: 0; vertical-align: middle; text-decoration: none; }
.i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 9px; border: 1.5px solid currentColor; font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1; text-decoration: none; flex: none; }
.term:hover .i, .chip:hover .i { background: var(--amber); color: var(--ink); border-color: var(--ink); }

#view, #over { display: contents; }
/* Nothing new to show: no entrance animation. */
.hand.still .card, .bubble.still { animation: none; }

/* ---- Intro ---- */
.intro { height: 100%; padding: 40px 56px; display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 56px; color: var(--paper); }
.file { background: var(--paper); color: var(--ink); border-radius: 12px; padding: 26px; display: flex; flex-direction: column; gap: 18px; transform: rotate(-1.5deg); box-shadow: 0 18px 0 rgba(0, 0, 0, 0.25); }
.file .who { display: flex; gap: 20px; align-items: center; }
.file h2 { font-size: 28px; letter-spacing: -0.01em; }
.file .who p { font-size: 16px; color: var(--muted); margin-top: 4px; }
.facts { display: flex; flex-direction: column; border-top: 1.5px solid var(--ink); flex-grow: 1; margin: 0; }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--rule); }
.facts dt { font-size: 13px; color: var(--muted); white-space: nowrap; }
.facts dd { font-size: 15px; font-weight: 600; text-align: right; }
.facts dd small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.resources { display: flex; flex-direction: column; gap: 8px; }
.resources ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.resources li { display: flex; flex-direction: column; gap: 3px; border-top: 1.5px solid var(--felt-line); padding-top: 9px; }
.resources b { font-size: 15px; }
.resources span { font-size: 13px; line-height: 1.35; color: var(--felt-text); }
.pitch { display: flex; flex-direction: column; gap: 22px; padding-top: 8px; }
.pitch h1 { font-size: 46px; line-height: 1.1; letter-spacing: -0.02em; }
.phasebox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.phasebox > div { border: 1.5px solid var(--felt-line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.phasebox .mono { color: var(--felt-text); }
.phasebox .active { border-color: var(--amber); }
.phasebox .active .mono { color: var(--amber); }
.phasebox h2 { font-size: 20px; }
.phasebox p, .lead { font-size: 15px; line-height: 1.45; color: var(--felt-text); }
.lead { font-size: 16px; }
.term.static { text-decoration-color: var(--amber); color: var(--paper); }
.cta { margin-top: auto; display: flex; align-items: center; gap: 20px; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pickers { display: flex; align-items: center; gap: 12px; }
.country { display: flex; align-items: center; gap: 8px; }
.bar > .mono { white-space: nowrap; }
.country select { max-width: 170px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--felt-line); background: var(--felt); color: var(--paper); font: 500 14px var(--sans); }
.lang-btn { height: 36px; padding: 0 10px 0 9px; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--felt-line); border-radius: 8px; background: transparent; color: var(--paper); font: 500 13px var(--mono); }
/* The language list: each language in its own name and script. */
.langlist { display: flex; flex-direction: column; gap: 8px; }
.langrow { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1.5px solid #3A4842; border-radius: 10px; background: transparent; color: var(--paper); font: 600 16px var(--sans); text-align: left; }
.langrow b { font-weight: 600; }
.langrow i { margin-left: auto; font-style: normal; font-size: 12px; color: var(--felt-text); }
.langrow .beta { padding: 2px 7px; border-radius: 999px; border: 1px solid var(--felt-line); font: 500 11px var(--mono); color: var(--felt-text); text-transform: uppercase; letter-spacing: 0.04em; }
.langrow[aria-pressed='true'] { background: var(--amber); border-color: var(--amber); color: #16201C; }
.langrow[aria-pressed='true'] i, .langrow[aria-pressed='true'] .beta { color: #16201C; border-color: #16201C; }
.langlist .fine { margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--felt-text); }
.debrief > .row { align-items: center; }

.scope-btn { align-self: flex-start; height: 40px; padding: 0 14px; border-radius: 8px; border: 1.5px solid var(--felt-line); background: transparent; color: var(--paper); font-size: 14px; font-weight: 600; }
.scope-btn:hover { border-color: var(--amber); }
.scope { gap: 6px; }
.scope p { font-size: 15px; line-height: 1.45; color: var(--felt-text); }
.scope h3 { font-size: 15px; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.scope h3::before { content: ''; width: 10px; height: 10px; border-radius: 5px; background: var(--amber); }
.scope h3.mid::before { background: var(--felt-text); }
.scope h3.out::before { background: transparent; border: 1.5px solid var(--felt-text); }
.scope ul { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.45; }
.scope li { margin-bottom: 3px; }
.fine .link { font-size: inherit; color: inherit; }
[data-layout='flow'] .scope-btn { order: 5; min-height: 44px; }

/* ---- Splash ---- */
.splash { position: absolute; inset: 0; color: var(--paper); }
/* The home screen opens on the table as the dealt case starts: HR's line, the offer, the first cards. */
.splash-art { position: absolute; right: 0; bottom: 0; width: 720px; height: 100%; }
.splash-copy { position: absolute; inset: 0; width: 600px; padding: 36px 24px 28px 56px; display: flex; flex-direction: column; gap: 18px; background: var(--felt); box-shadow: 24px 0 32px var(--felt); z-index: 1; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { border-radius: 7px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.18); }
.splash-pitch { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.splash h1 { font-size: 54px; line-height: 1.02; letter-spacing: -0.03em; max-width: 520px; text-wrap: balance; }
.splash h1 span { display: block; }
.splash h1 em { display: block; margin-top: 12px; font-style: normal; font-size: 27px; line-height: 1.15; letter-spacing: -0.015em; color: var(--amber); }
.splash .sub { font-size: 16px; line-height: 1.45; color: var(--felt-text); max-width: 510px; margin: 0; }
/* What the game shows: three plain lines, each led by its subject. */
.learn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 15px; line-height: 1.35; max-width: 520px; }
.learn li { display: flex; align-items: baseline; gap: 10px; }
.learn li::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 4px; background: var(--amber); transform: translateY(-1px); }
.learn b { font-weight: 700; }
.splash .cta { margin-top: 6px; align-items: center; gap: 22px; }
.splash .alt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.splash .alt .link { font-size: 15px; font-weight: 600; color: inherit; text-underline-offset: 3px; text-align: left; }
.splash .alt small { display: block; margin-top: 1px; font-size: 13px; color: var(--felt-text); }
.trust { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0; font-size: 13.5px; color: var(--felt-text); }
.trust span + span::before { content: '·'; margin: 0 9px; color: var(--felt-line); }
.footend { display: flex; align-items: center; gap: 12px; }
.splash .country select { height: 30px; font-size: 13px; }
.splash .bubble, .splash .doc, .splash-hand { color: var(--ink); }
/* The bubble hangs from a fixed bottom edge above HR's head, so a long opening line grows upward, not over the face. */
.splash .bubble { left: 660px; top: auto; bottom: 566px; width: 420px; animation: pop 0.28s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards; }
.splash .doc.wide { left: 672px; top: auto; bottom: max(174px, var(--doc-bottom, 0px)); animation: docin 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards; }
@keyframes docin { from { opacity: 0; transform: translate(60px, -46px) rotate(-9deg); } }
.splash-hand { position: absolute; left: 640px; right: 16px; bottom: -44px; display: flex; justify-content: center; cursor: pointer; }
.splash-hand .card { flex: 0 0 176px; margin: 0 3px; animation-delay: 0.75s; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.splash-hand .card:nth-child(1) { transform: rotate(-5deg) translateY(10px); }
.splash-hand .card:nth-child(2) { animation-delay: 0.82s; z-index: 1; }
.splash-hand .card:nth-child(3) { transform: rotate(5deg) translateY(10px); animation-delay: 0.89s; }
.splash-hand:hover .card:nth-child(1) { transform: rotate(-7deg) translate(-8px, -8px); }
.splash-hand:hover .card:nth-child(2) { transform: translateY(-20px); }
.splash-hand:hover .card:nth-child(3) { transform: rotate(7deg) translate(8px, -8px); }
.cta .btn { flex: none; white-space: nowrap; }

.sound { width: 40px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1.5px solid var(--felt-line); background: transparent; color: var(--paper); }
.sound[aria-pressed='false'] { color: var(--felt-text); border-style: dashed; }
.hud .sound { width: 36px; height: 30px; }
.debrief .sound { border-color: var(--ink); color: var(--ink); height: 30px; }
.debrief .pickers { gap: 8px; }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--felt-text); border-top: 1px solid var(--felt-line); padding-top: 12px; }
.foot a, .foot .link { color: inherit; font-size: inherit; text-underline-offset: 2px; }
.maker { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; border: 1.5px solid currentColor; font: 500 12px var(--mono); letter-spacing: 0.04em; text-decoration: none; color: inherit; white-space: nowrap; }
.maker:hover { background: var(--amber); color: #16201C; border-color: var(--amber); }
.fine .maker { height: 22px; padding: 0 8px; font-size: 11px; vertical-align: middle; }

.btn.light { border-color: var(--felt-line); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.light:hover { border-color: var(--amber); }
.splash .cta { gap: 12px; }
.splash .cta .btn.light { height: 64px; padding: 0 22px; font-size: 16px; border-radius: 10px; }
.pitch:has(.challenge) { gap: 15px; padding-top: 0; }
.challenge { background: var(--amber); color: #16201C; border-radius: 8px; padding: 10px 14px; font-size: 15px; font-weight: 600; }
.rtitle { display: inline-block; background: var(--amber); color: #16201C; border-radius: 6px; padding: 2px 10px; font-size: 15px; margin-right: 6px; }
.vs { font-weight: 600; }
.album h3 { font-size: 15px; margin-top: 8px; }
.album p { font-size: 15px; line-height: 1.45; color: var(--felt-text); }
.sheet.wide { width: 860px; }
/* A medal draws itself: badges.js returns one inline SVG that carries its own box and colors. --ms on a container resizes the medals in it. */
.medal { --s: 56px; display: inline-block; flex: none; width: var(--ms, var(--s)); height: var(--ms, var(--s)); line-height: 0; }
.medal svg { display: block; }
/* Locked: the medal's own shape as a flat, dark silhouette. The svg color draws its emblem and ring. */
.medal.locked svg { color: #26332E; }
/* Newly unlocked: the silhouette lights up, then the name appears. */
.award.fresh .medal { animation: reveal 0.9s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; }
.award.fresh span:last-child { animation: fade 0.4s ease-out 0.7s backwards; }
.award.fresh:nth-child(2) .medal { animation-delay: 0.15s; } .award.fresh:nth-child(3) .medal { animation-delay: 0.3s; }
.award.fresh:nth-child(4) .medal { animation-delay: 0.45s; } .award.fresh:nth-child(n+5) .medal { animation-delay: 0.6s; }
@keyframes reveal { 0% { filter: brightness(0.12) saturate(0); transform: scale(0.8) rotate(-12deg); } 55% { filter: brightness(1.25) saturate(1.2); transform: scale(1.18) rotate(4deg); } 100% { filter: none; transform: none; } }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px 8px; }
.award { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; border: 0; border-radius: 10px; background: none; color: #6F8A80; font: 500 12px/1.25 var(--mono); text-align: center; }
.award.open { color: var(--paper); font: 600 13px/1.25 var(--sans); }
.award span:last-child { overflow-wrap: anywhere; hyphens: auto; }
button.award.open:hover { background: rgba(255, 255, 255, 0.08); }
button.award.open:hover .medal { transform: scale(1.08); }
.award .medal { transition: transform 0.12s ease-out; }
.withmedal { display: flex; align-items: center; gap: 12px; }
.rtitle { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; vertical-align: middle; }
/* The ending's trophy stands left of the headline, outside its title pill. */
.top > div:first-child { position: relative; min-height: 88px; padding-left: 98px; display: flex; flex-direction: column; justify-content: center; }
.rtitle .medal { position: absolute; left: 0; top: calc(50% - var(--ms, var(--s)) / 2); }
.top.fresh .rtitle .medal { animation: reveal 0.9s cubic-bezier(0.2, 1.3, 0.4, 1) 0.3s backwards; }
.rtitle i { font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; background: #16201C; color: var(--amber); border-radius: 4px; padding: 1px 6px; }
.sharebox { gap: 14px; }
.cardslot canvas { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid #3A4842; }
.sharerow { display: flex; flex-wrap: wrap; gap: 8px; }
.sharerow .btn { height: 44px; padding: 0 16px; font-size: 15px; flex: none; }

.stats { font-size: 14px; font-weight: 600; color: var(--ink); background: var(--ground); border-radius: 6px; padding: 8px 12px; animation: pop 0.3s ease-out; }

/* ---- Play ---- */
.play { position: absolute; inset: 0; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud { position: absolute; top: 18px; left: 24px; right: 24px; display: flex; justify-content: space-between; align-items: center; z-index: 1; }
/* The picture, the speech bubble and the contract. On the stage each is placed by itself. */
.mid { display: contents; }
.phasecol { display: flex; flex-direction: column; gap: 6px; }
.phasecol .clock { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 28px; padding: 0 12px 0 9px; border: 1.5px solid transparent; border-radius: 14px; font-size: 12.5px; font-weight: 500; text-align: left; }
.clock svg { width: 15px; height: 15px; flex: none; }
/* The offer's clock: amber with two days left, red and pulsing on the last day. */
.phasecol .clock.soon { border-color: var(--amber); color: var(--amber); background: rgba(0, 0, 0, 0.25); }
.phasecol .clock.last { border-color: #FFB4A9; background: #B3261E; color: #FFFFFF; font-weight: 600; animation: urge 1.6s ease-in-out infinite; }
.phasecol .clock.tick { animation: flash 1s ease-out; }
.phasecol .clock.last.tick { animation: flash 1s ease-out, urge 1.6s ease-in-out 1s infinite; }
@keyframes urge { 50% { box-shadow: 0 0 0 7px rgba(255, 180, 169, 0.3); } }
.phases { display: flex; align-items: center; gap: 8px; }
.pill { height: 34px; padding: 0 14px; border-radius: 17px; border: 1.5px solid var(--felt-line); color: var(--felt-text); font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; background: rgba(0, 0, 0, 0.25); }
.pill.on { background: var(--amber); border-color: var(--amber); color: var(--ink); font-weight: 500; }
.dash { width: 20px; height: 2px; background: var(--felt-line); }
.meters { display: flex; align-items: center; gap: 22px; color: var(--paper); background: rgba(0, 0, 0, 0.25); padding: 8px 14px; border-radius: 10px; }
.meter { width: 124px; display: flex; flex-direction: column; gap: 5px; }
.mrow { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.mrow b { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mrow span { white-space: nowrap; }
.mrow { gap: 6px; }
.mrow .i, .drow .i, .trow .i { width: 15px; height: 15px; font-size: 10px; }
.meter { width: 142px !important; padding: 2px 4px; border-radius: 6px; }
.pip.green { background: #8FD0A8; }
.flash { animation: flash 1s ease-out; }
@keyframes flash { 0% { background: rgba(242, 178, 51, 0.75); transform: scale(1.06); } 100% { background: transparent; transform: scale(1); } }
.drow.flash { border-radius: 4px; }
.drow.read-weak b { color: #B3261E; } .drow.read-arguable b { color: #8A5A00; } .drow.read-strong b { color: #1F6B45; }
.card.blocked { opacity: 0.55; border-style: dashed; }
.card.blocked:hover { transform: none; }
.card.blocked .chint { color: #B3261E; font-weight: 600; }
.card.kind-leave.blocked .chint { color: #FFB4A9; }
.mrow span { color: var(--felt-text); }
.pips { display: flex; gap: 4px; }
.pip { flex: 1; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); }
.pip.amber { background: var(--amber); }
.pip.white { background: var(--paper); }
.clock { min-width: 150px; text-align: right; }

.bubble { position: absolute; top: 90px; left: 28px; width: 330px; background: var(--paper); border-radius: 12px 12px 12px 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); animation: pop 0.22s ease-out; }
.bubble p { font-size: 16px; line-height: 1.4; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.doc { position: absolute; top: 384px; left: 500px; width: 280px; background: var(--paper); border-radius: 3px; padding: 12px 14px; transform: rotate(-1.5deg); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; gap: 3px; }
.dtitle { font-size: 14px; margin-bottom: 2px; }
/* The offer sheet lies wide on the table, in two columns, so every row stays clear of the cards. */
/* The contract is pinned by its bottom edge and grows upward: a language with longer words makes it
   taller, and it must never reach the cards below it. */
.doc.wide { top: auto; bottom: max(176px, var(--doc-bottom, 0px)); left: 486px; width: 436px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; row-gap: 4px; align-items: baseline; transform: rotate(-1deg); }
.doc.wide .dtitle { grid-column: 1 / -1; }
.drow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; line-height: 1.35; }
.drow span { color: var(--muted); }
.nw { white-space: nowrap; }
.drow.big b { font-size: 19px; }
.drow.warn b { color: #B3261E; }
.drow b { text-align: right; }

.rights { position: absolute; top: 90px; right: 24px; width: 216px; display: flex; flex-direction: column; gap: 6px; }
.chip { min-height: 38px; border-radius: 6px; border: 0; background: var(--paper); color: var(--ink); padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; text-align: left; }
/* The medal is taller than the text row, so it reaches into the chip's padding. */
.chip .medal { margin: -3px 0 -3px -4px; }
.chip .cname { flex: 1; min-width: 0; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; hyphenate-limit-chars: 10 4 4; }
.chip.empty { background: none; border: 1.5px dashed var(--felt-line); color: var(--felt-text); font-weight: 400; }
.chip.more { background: none; border: 1.5px solid var(--felt-line); color: var(--paper); justify-content: center; }

.tabs { position: absolute; left: 24px; top: 474px; display: flex; align-items: center; gap: 8px; }
.tab { height: 40px; padding: 0 14px; border-radius: 8px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tab span { min-width: 20px; height: 20px; border-radius: 10px; background: var(--ground); font-family: var(--mono); font-size: 12px; display: grid; place-items: center; }
.tab.on { background: var(--ink); color: var(--paper); }
.tab.on span { background: var(--amber); color: var(--ink); }
.tab:disabled { opacity: 0.45; cursor: default; }
.tired { position: absolute; left: 0; bottom: calc(100% + 10px); width: max-content; max-width: 430px; font-size: 13px; line-height: 1.3; color: var(--paper); background: #B3261E; border-radius: 6px; padding: 6px 10px; }

.hand { position: absolute; left: 24px; right: 24px; bottom: -14px; display: flex; justify-content: center; align-items: flex-end; gap: 8px; }
.card { position: relative; flex: 0 1 184px; min-width: 0; min-height: 168px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); transition: transform 0.12s ease-out, opacity 0.2s; animation: deal 0.25s ease-out backwards; }
.card:nth-child(2) { animation-delay: 0.03s; } .card:nth-child(3) { animation-delay: 0.06s; } .card:nth-child(4) { animation-delay: 0.09s; }
.card:nth-child(5) { animation-delay: 0.12s; } .card:nth-child(6) { animation-delay: 0.15s; } .card:nth-child(n+7) { animation-delay: 0.18s; }
@keyframes deal { from { transform: translateY(60px); opacity: 0; } }
.card:hover, .card:focus-within { transform: translateY(-18px); }
.card-main { width: 100%; height: 100%; min-height: 164px; padding: 14px 14px 26px; border: 0; border-radius: 10px; background: none; color: inherit; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.card-main .mono { padding-right: 32px; font-size: 11px; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-i { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 16px; background: none; color: inherit; display: grid; place-items: center; }
.card-i:hover .i { background: var(--amber); color: var(--ink); border-color: var(--ink); }
.ctitle { font-size: 16px; line-height: 1.2; font-weight: 700; overflow-wrap: break-word; hyphens: auto; hyphenate-limit-chars: 10 4 4; }
.chint { font-size: 12px; line-height: 1.3; color: var(--muted); margin-top: auto; }
/* A card whose days use up the offer carries a red band along its bottom edge. */
/* The hand hangs 14px below the stage, so the band keeps its text above that edge. */
.card.last { border-color: #B3261E; }
.cwarn { display: flex; align-items: center; gap: 6px; margin: 0 -14px -26px; padding: 7px 12px 20px; border-radius: 0 0 9px 9px; background: #B3261E; color: #FFFFFF; font-size: 12px; font-weight: 600; line-height: 1.2; }
.cwarn svg { width: 14px; height: 14px; flex: none; }
/* Amber: this card costs the fast bonus. Ink: tap again to confirm a card that ends a phase. */
.cwarn.soft { background: var(--amber); color: var(--ink); }
.cwarn.confirm { background: var(--ink); color: var(--paper); justify-content: center; }
.card.kind-leave .cwarn.confirm, .card.kind-accept .cwarn.confirm { background: var(--paper); color: var(--ink); }
.card.kind-accept .cwarn.confirm { background: var(--ink); color: var(--paper); }
.card.armed { transform: translateY(-18px); outline: 3px solid var(--amber); outline-offset: 2px; }
.hand.busy .card { animation: none; opacity: 0.45; transform: none; }
.hand.busy .card.played { opacity: 1; transform: translateY(-46px) rotate(-2deg); }
.card-main:disabled { cursor: default; }
.card.kind-accept { background: var(--amber); }
.card.kind-accept .mono, .card.kind-accept .chint { color: var(--ink); }
.card.kind-accept .card-i:hover .i { background: var(--paper); }
.card.kind-leave { background: var(--ink); color: var(--paper); border-color: var(--paper); }
.card.kind-leave .mono, .card.kind-leave .chint { color: var(--felt-text); }

/* ---- Overlay: glossary and discovered rights ---- */
.overlay { position: absolute; inset: 0; background: rgba(10, 17, 14, 0.8); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 5; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 560px; max-height: 620px; background: var(--ink); color: var(--paper); border: 1.5px solid var(--amber); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 0 rgba(0, 0, 0, 0.35); animation: pop 0.2s ease-out; }
.entries { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; padding-right: 4px; }
.entry { display: flex; flex-direction: column; gap: 6px; }
.entry + .entry { border-top: 1px solid #3A4842; padding-top: 16px; }
.entry h3 { font-size: 24px; letter-spacing: -0.01em; }
.entry .en { font-size: 14px; color: var(--felt-text); }
.entry p { font-size: 16px; line-height: 1.45; }
.entry .watch { color: var(--amber); }
.sheet .term { color: inherit; }
.sheet .i { width: 16px; height: 16px; font-size: 10px; }
.entry .src { color: #9DAAA4; text-transform: none; letter-spacing: 0.02em; }
.sheet-actions { display: flex; gap: 12px; flex: none; }
.sheet .btn { flex: none; }
.filesheet .who { display: flex; align-items: center; gap: 16px; }
.filesheet .who h3 { font-size: 22px; }
.filesheet .who p { font-size: 15px; color: var(--felt-text); }
.filesheet .facts { margin: 0; border-top-color: var(--felt-line); }
.filesheet .facts > div { border-bottom-color: var(--felt-line); }
.filesheet .facts dt, .filesheet .facts dd small { color: var(--felt-text); }

/* ---- Debrief ---- */
#stage[data-screen='debrief'] { background: var(--ground); }
/* --verdict colors the stamp and the money left on the table: red for weak, ochre for fair, the felt green from strong up. */
.debrief { height: 100%; padding: 16px 48px 12px; display: flex; flex-direction: column; gap: 10px; --verdict: var(--felt); }
.debrief.v-weak { --verdict: #B3261E; } .debrief.v-fair { --verdict: #8A5A00; }
.top { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; align-items: center; }
.top h1 { font-size: 36px; line-height: 1.1; letter-spacing: -0.02em; }
.sub { font-size: 17px; color: var(--muted); margin-top: 6px; }
/* How the score is put together: the money share and the terms, with their weights. */
.parts { font-size: 14px; line-height: 1.35; color: var(--muted); margin-top: 3px; }
.stamp { height: 88px; border: 3px solid var(--verdict); border-radius: 10px; transform: rotate(-3deg); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--verdict); }
.stamp .mono { color: inherit; }
.stamp b { font-size: 30px; text-transform: uppercase; letter-spacing: 0.02em; }
.v-excellent .stamp { background: var(--verdict); color: var(--ground); }
.barbox { background: var(--paper); border-radius: 12px; padding: 12px 24px; display: flex; flex-direction: column; gap: 8px; }
.legend { display: flex; gap: 40px; font-size: 14px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend b { font-size: 20px; color: var(--ink); margin-left: 4px; }
.legend .left { margin-left: auto; gap: 6px; font-weight: 600; color: var(--ink); }
.legend .left b { color: var(--verdict); margin: 0; }
.dot { width: 12px; height: 12px; border-radius: 6px; border: 1.5px solid var(--ink); }
.dot.first, .mark.first { background: var(--paper); }
.dot.you, .mark.you { background: var(--amber); }
.dot.best, .mark.best { background: var(--felt); }
.track { position: relative; height: 16px; border-radius: 8px; background: var(--rule); margin: 6px 10px; }
.mark { position: absolute; top: -7px; width: 14px; height: 30px; margin-left: -7px; border-radius: 4px; border: 1.5px solid var(--ink); }
.mark.you { top: -10px; height: 36px; width: 18px; margin-left: -9px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 24px; flex-grow: 1; min-height: 0; }
/* The table takes the height the stage has left: its rows are 35px when there is room and close up when there is not. */
.tablebox { background: var(--paper); border-radius: 12px; padding: 4px 18px; align-self: start; max-height: 100%; display: flex; flex-direction: column; }

.trow { display: grid; grid-template-columns: 174px repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; flex: 0 1 35px; padding: 1px 0; font-size: 14px; border-bottom: 1px solid var(--rule); }
.trow .nw { white-space: nowrap; }
.trow:last-child { border-bottom: 0; }
.trow.head { flex: none; padding: 5px 0; border-bottom: 1.5px solid var(--ink); font-size: 13px; color: var(--muted); }
.trow > span:first-child { color: var(--muted); }
.trow .you { font-weight: 700; }
.trow small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.steps { margin: 0; padding: 0 4px 0 0; list-style: none; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .n { flex: none; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; background: var(--amber); color: var(--ink); font: 500 14px/28px var(--mono); text-align: center; }
.steps b { font-size: 16px; line-height: 1.3; }
.steps p { font-size: 14px; line-height: 1.4; color: var(--felt-text); margin-top: 2px; }
/* The best line marks each move: played, or missed. The missed ones are the lesson, so they carry the color. */
.tally { font-size: 15px; font-weight: 600; }
.steps .tag { display: inline-block; margin-left: 3px; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--felt-line); color: var(--felt-text); font: 500 11px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; vertical-align: 2px; }
.steps .hit .tag::before { content: '✓ '; }
.steps .miss .tag { background: var(--amber); border-color: var(--amber); color: #16201C; }
.steps .miss .n { background: transparent; color: var(--amber); box-shadow: inset 0 0 0 1.5px var(--amber); }
.side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.side h3 { font-size: 16px; }
.link { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 0; }
/* The gap cards scroll inside the column in the rare case that they are taller than the stage has room for. */
.gaps { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.gap { flex: none; background: var(--paper); border-radius: 10px; padding: 8px 14px; }
.gap b { font-size: 15px; color: var(--ink); margin-right: 2px; }
.gap p { font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.debrief .bestline { flex: none; align-self: flex-start; height: 44px; padding: 0 16px; font-size: 14.5px; background: var(--paper); }
.debrief .bestline:hover { background: var(--ground); }
.actions { flex: none; margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 6px; }
.legalline { flex: none; }
/* Phone only: the table waits behind a tap, below the lesson and the actions. */
.tabledrop { background: var(--paper); border-radius: 12px; }
.tabledrop summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px; font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; }
.tabledrop summary::-webkit-details-marker { display: none; }
.tabledrop summary::after { content: '+'; font: 500 20px var(--mono); }
.tabledrop[open] summary::after { content: '\2212'; }
.tabledrop .fine { padding: 6px 14px 14px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- Stage layout only: HUD extras that belong to the phone layout ---- */
.rights-btn { display: none; }
.clockrow { display: flex; align-items: center; gap: 10px; }
.file-btn { height: 28px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--felt-line); background: transparent; color: var(--paper); font-size: 13px; font-weight: 600; white-space: nowrap; }
.file-btn:hover { border-color: var(--amber); }

/* ---- Flow layout: phones and small windows. Stacked, scrollable. ---- */
#stage[data-layout='flow'] { position: static; transform: none; width: 100%; height: 100dvh; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
[data-layout='flow'] .btn { min-height: 48px; }

[data-layout='flow'] .intro { height: auto; min-height: 100%; padding: 16px 16px 0; display: flex; flex-direction: column; gap: 18px; max-width: 620px; margin: 0 auto; }
[data-layout='flow'] .pitch { display: contents; }
[data-layout='flow'] .bar { order: 1; flex-wrap: wrap; }
[data-layout='flow'] .pitch h1 { order: 2; font-size: 30px; }
[data-layout='flow'] .file { order: 3; transform: none; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25); padding: 18px; gap: 14px; }
[data-layout='flow'] .file h2 { font-size: 22px; }
[data-layout='flow'] .file .who svg { width: 72px; height: 82px; }
[data-layout='flow'] .facts dd { font-size: 15px; }
[data-layout='flow'] .resources { order: 4; }
[data-layout='flow'] .resources ul { grid-template-columns: 1fr; gap: 8px; }
[data-layout='flow'] .phasebox { order: 4; grid-template-columns: 1fr; gap: 10px; }
[data-layout='flow'] .phasebox > div { padding: 14px; }
[data-layout='flow'] .lead { order: 5; }
[data-layout='flow'] .cta { order: 6; position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--felt); flex-direction: column; align-items: stretch; gap: 8px; text-align: center; border-top: 1.5px solid var(--felt-line); }
[data-layout='flow'] .btn.big { height: 56px; font-size: 18px; padding: 0 16px; }

[data-layout='flow'] .splash { position: static; min-height: 100%; display: flex; flex-direction: column; max-width: 620px; margin: 0 auto; }
[data-layout='flow'] .splash-art { position: static; width: 100%; height: auto; aspect-ratio: 780 / 400; max-height: 24dvh; order: 3; flex: none; }
[data-layout='flow'] .splash-copy, [data-layout='flow'] .splash-pitch { display: contents; }
[data-layout='flow'] .splash .bar { order: 1; padding: 12px 16px; gap: 8px; }
[data-layout='flow'] .brand { font-size: 16px; gap: 8px; }
[data-layout='flow'] .splash .pickers { gap: 8px; }
[data-layout='flow'] .splash .bubble { order: 4; left: auto; top: auto; bottom: auto; width: auto; }
[data-layout='flow'] .splash .doc { order: 5; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; animation: none; }
[data-layout='flow'] .splash .doc .dtitle { margin: 0; }
[data-layout='flow'] .splash .doc .drow { gap: 10px; align-items: center; }
[data-layout='flow'] .splash .doc .drow span { display: none; }
[data-layout='flow'] .splash-hand { display: none; }
[data-layout='flow'] .splash h1 { order: 2; font-size: 36px; margin: 8px 16px 16px; max-width: none; }
[data-layout='flow'] .splash h1 em { font-size: 22px; margin-top: 10px; }
[data-layout='flow'] .splash .sub { order: 6; font-size: 16px; margin: 18px 16px 0; max-width: none; }
[data-layout='flow'] .learn { order: 6; margin: 14px 16px 0; max-width: none; }
[data-layout='flow'] .trust { order: 7; margin: 14px 16px 0; gap: 6px 22px; }
[data-layout='flow'] .trust span::before, [data-layout='flow'] .trust span + span::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 8px 2px 0; border-radius: 3px; background: var(--amber); }
[data-layout='flow'] .foot { order: 8; margin: 18px 16px 14px; }
[data-layout='flow'] .footend { flex-wrap: wrap; }
[data-layout='flow'] .splash .cta { order: 9; margin: auto 0 0; gap: 10px; }
[data-layout='flow'] .splash .alt { flex-direction: row; justify-content: center; gap: 18px; }
[data-layout='flow'] .splash .alt .link { min-height: 32px; font-size: 14px; }
[data-layout='flow'] .splash .alt small { display: none; }
[data-layout='flow'] .hud .sound { width: 40px; height: 36px; }
#stage[data-layout='flow'][data-screen='play'] { overflow: hidden; }
[data-layout='flow'] .play { position: static; height: 100%; display: flex; flex-direction: column; max-width: 620px; margin: 0 auto; }
[data-layout='flow'] .mid { order: 2; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 6px; }
[data-layout='flow'] .hud { position: static; order: 1; flex: none; flex-direction: column; align-items: stretch; gap: 5px; padding: 6px 12px 4px; }
[data-layout='flow'] .phases { gap: 6px; }
[data-layout='flow'] .pill { height: 28px; padding: 0 8px; font-size: 11px; letter-spacing: 0.03em; }
[data-layout='flow'] .pill:not(.on) { display: none; }
[data-layout='flow'] .dash { display: none; }
/* Phone HUD: three short meters in one row, then the two buttons. */
/* Each meter is as wide as its words need: "Poduszka 11 mies." is longer than "Nerves 4 / 5". */
[data-layout='flow'] .meters { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: space-between; gap: 5px 12px; padding: 5px 10px 6px; }
[data-layout='flow'] .meter { width: auto; min-width: 0; }
[data-layout='flow'] .mrow { gap: 4px; }
[data-layout='flow'] .phasecol { flex-direction: row; align-items: center; gap: 5px; }
[data-layout='flow'] .phases, [data-layout='flow'] .pill, [data-layout='flow'] .phasecol .clock { flex: none; white-space: nowrap; }
[data-layout='flow'] .clockrow { display: contents; }
[data-layout='flow'] .phasecol .clock { margin-right: auto; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
[data-layout='flow'] .phasecol .sound { width: 38px; height: 36px; flex: none; }
[data-layout='flow'] .file-btn { width: 38px; height: 36px; padding: 0; display: grid; place-items: center; flex: none; }
[data-layout='flow'] .rights-btn { height: 36px; padding: 0 7px; gap: 4px; flex: none; }
/* The three top bar buttons are drawn compact and keep a 44 px area to tap. */
[data-layout='flow'] .phasecol .sound, [data-layout='flow'] .file-btn, [data-layout='flow'] .rights-btn { position: relative; }
[data-layout='flow'] .phasecol .sound::after, [data-layout='flow'] .file-btn::after, [data-layout='flow'] .rights-btn::after { content: ''; position: absolute; inset: -4px -3px; }
[data-layout='flow'] .clock { font-size: clamp(10px, 2.9vw, 11.5px); letter-spacing: 0.02em; text-align: right; }
[data-layout='flow'] .phasecol .clock { align-self: center; height: 26px; padding: 0 8px 0 6px; gap: 5px; }
[data-layout='flow'] .meter { width: auto !important; }
[data-layout='flow'] .rights-btn { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--felt-line); background: transparent; color: var(--paper); font-size: 13px; font-weight: 600; }
[data-layout='flow'] .rights-btn span { min-width: 20px; height: 20px; border-radius: 10px; background: var(--amber); color: var(--ink); font: 500 12px var(--mono); display: grid; place-items: center; }
[data-layout='flow'] .rights-btn:disabled { opacity: 0.5; }
[data-layout='flow'] .rights-btn:disabled span { background: var(--felt-line); }
[data-layout='flow'] .scene { position: static; width: 100%; height: auto; flex: 1 1 96px; min-height: 70px; max-height: 190px; }
[data-layout='flow'] .bubble { position: static; flex: none; width: auto; margin: -2px 12px 0; padding: 10px 14px; border-radius: 12px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); z-index: 1; }
[data-layout='flow'] .bubble p { font-size: 15.5px; }
[data-layout='flow'] .doc { position: static; flex: none; width: auto; margin: 8px 12px 0; padding: 10px 12px; transform: none; border-radius: 8px; }
/* The offer keeps its two columns on the phone: three short rows in place of six. */
/* Phone contract: small cells with the label above its value. The eye reads down a cell and not
   across a gap, which a tester found tiring. Three cells to a row, each as wide as its words. */
[data-layout='flow'] .doc.wide { grid-template-columns: repeat(3, minmax(0, auto)); justify-content: space-between; column-gap: 12px; row-gap: 7px; align-items: stretch; }
[data-layout='flow'] .doc.wide .dtitle { grid-column: 1 / span 2; margin: 0; align-self: center; }
[data-layout='flow'] .doc.wide .drow.big { grid-column: 3; justify-self: end; flex-direction: row-reverse; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 6px; }
[data-layout='flow'] .doc.wide .drow.big > span { font-size: 0; }
[data-layout='flow'] .doc.wide .drow.big b { margin-left: 0; }
[data-layout='flow'] .doc.wide .drow:not(.big) { min-width: 0; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 0; font-size: 11px; line-height: 1.3; }
/* A long label wraps inside its cell. Its (i) stays glued to the last word. */
[data-layout='flow'] .doc.wide .drow:not(.big) span { min-width: 0; }
[data-layout='flow'] .doc.wide .drow:not(.big) b { font-size: 14px; line-height: 1.25; text-align: left; white-space: nowrap; }
[data-layout='flow'] .drow.big b { font-size: 17px; }
[data-layout='flow'] .rights { display: none; }
/* The tab row and the hand are one solid block: nothing shows through it, and a soft shadow says content scrolls under. */
[data-layout='flow'] .tabs { position: static; order: 3; flex: none; margin: 0; padding: 7px 12px 5px; gap: 6px; background: #0E1512; box-shadow: 0 -12px 16px -6px rgba(14, 21, 18, 0.7); z-index: 2; flex-wrap: wrap; }
[data-layout='flow'] .tab { flex: 1 1 0; min-width: 0; height: 42px; padding: 0 4px; gap: 5px; font-size: clamp(12px, 3.5vw, 14px); white-space: nowrap; justify-content: center; }
[data-layout='flow'] .tab span { min-width: 18px; height: 18px; font-size: 11px; }
[data-layout='flow'] .tired { position: static; flex: 1 0 100%; width: auto; max-width: none; text-align: center; }
[data-layout='flow'] .hand { position: static; order: 4; flex: none; height: 158px; overflow-y: hidden; padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); justify-content: flex-start; align-items: stretch; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; background: #0E1512; z-index: 2; scrollbar-width: none; }
[data-layout='flow'] .hand::-webkit-scrollbar { display: none; }
[data-layout='flow'] .card { flex: 0 0 166px; height: auto; scroll-snap-align: start; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
[data-layout='flow'] .card-main { padding: 9px 11px; gap: 5px; }
[data-layout='flow'] .card-i { width: 40px; height: 40px; top: 0; right: 0; }
[data-layout='flow'] .card:hover, [data-layout='flow'] .card:focus-within { transform: none; }
[data-layout='flow'] .hand.busy .card.played { transform: translateY(-8px); }
[data-layout='flow'] .card .mono { font-size: 11px; }
[data-layout='flow'] .ctitle { font-size: 14px; }
[data-layout='flow'] .chint { font-size: 12px; }
[data-layout='flow'] .card, [data-layout='flow'] .card-main { min-height: 0; }
[data-layout='flow'] .card.armed { transform: none; }
[data-layout='flow'] .cwarn { margin: 2px -11px -9px; padding: 6px 10px; font-size: 12px; }

[data-layout='flow'] .overlay { position: fixed; padding: 12px; }
[data-layout='flow'] .sheet.wide { max-width: 620px; }
[data-layout='flow'] .awards { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
[data-layout='flow'] .sheet { width: 100%; max-width: 560px; max-height: 86dvh; padding: 18px; }
[data-layout='flow'] .entry h3 { font-size: 21px; }
[data-layout='flow'] .entry p { font-size: 15.5px; }
[data-layout='flow'] .sheet-actions { flex-direction: column; }
[data-layout='flow'] .sheet .btn { align-self: stretch; }

[data-layout='flow'] .debrief { height: auto; min-height: 100%; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); gap: 14px; max-width: 620px; margin: 0 auto; }
[data-layout='flow'] .debrief > .row { align-items: flex-start; }
[data-layout='flow'] .top { grid-template-columns: 1fr; gap: 12px; }
[data-layout='flow'] .top h1 { font-size: 26px; }
[data-layout='flow'] .top > div:first-child { --ms: 76px; min-height: 80px; padding-left: 88px; }
[data-layout='flow'] .sub { font-size: 15px; }
[data-layout='flow'] .stamp { height: 64px; width: 200px; justify-self: start; }
[data-layout='flow'] .stamp b { font-size: 22px; }
[data-layout='flow'] .barbox { padding: 14px; gap: 12px; }
[data-layout='flow'] .legend { flex-direction: column; gap: 6px; }
[data-layout='flow'] .legend b { margin-left: auto; font-size: 18px; }
[data-layout='flow'] .legend .left { margin: 4px 0 0; padding-top: 8px; border-top: 1px solid var(--rule); }
[data-layout='flow'] .legend .left b { margin: 0; }
[data-layout='flow'] .cols { grid-template-columns: 1fr; grid-template-rows: none; align-content: start; gap: 14px; }
[data-layout='flow'] .tablebox { padding: 4px 12px; align-self: stretch; max-height: none; }
[data-layout='flow'] .trow { grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 6px; align-items: start; flex: none; padding: 5px 0; font-size: 12.5px; }
[data-layout='flow'] .gaps { overflow: visible; }
[data-layout='flow'] .debrief .bestline { align-self: stretch; height: 48px; font-size: 16px; }
[data-layout='flow'] .legalline { text-align: center; }
[data-layout='flow'] .trow.head { font-size: 11.5px; }
[data-layout='flow'] .actions { flex-direction: column; align-items: stretch; margin-top: 8px; }
#stage[data-layout='flow'][data-screen='debrief'] .actions .btn { height: 48px; font-size: 16px; }

/* Static text shown until the game starts, and to crawlers. */
.boot { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 48px; color: var(--paper); max-width: 760px; }
.boot h1 { font-size: 84px; line-height: 0.98; letter-spacing: -0.03em; }
@media (max-width: 921px) { .boot { padding: 24px 16px; } .boot h1 { font-size: 44px; } }
.boot a { color: var(--paper); }
.boot p { font-size: 18px; line-height: 1.5; color: var(--felt-text); }

/* ---- Scene motion: blinking, conferring, the beat between moves ---- */
.person { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.35s ease-out; }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
.person.lean-l .eye { animation-delay: 1.7s; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
.psst { opacity: 0; transition: opacity 0.2s; }
.scene.confer .lean-r { transform: rotate(7deg) translateX(18px); }
.scene.confer .lean-l { transform: rotate(-7deg) translateX(-18px); }
.scene.confer .psst { opacity: 1; animation: murmur 0.5s ease-in-out infinite alternate; }
@keyframes murmur { from { opacity: 0.25; } to { opacity: 1; } }
.steam path { animation: steam 2.8s ease-in-out infinite alternate; }
.steam path + path { animation-delay: 0.9s; }
@keyframes steam { from { opacity: 0.15; transform: translateY(4px); } to { opacity: 1; transform: translateY(-4px); } }
.bubble.thinking { width: auto; min-width: 190px; }
.dots { display: flex; gap: 7px; padding: 6px 0 4px; }
.dots i { width: 9px; height: 9px; border-radius: 5px; background: var(--ink); animation: dot 0.9s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; } .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { opacity: 0.2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ---- Themes. theme.js sets data-theme on <html>. The table scenes are art and keep their colors. ---- */
[data-theme='dark'] #stage[data-screen='debrief'] { background: #121916; }
[data-theme='dark'] .debrief { --ink: #E9ECEA; --paper: #1D2925; --ground: #121916; --muted: #A9B5AF; --rule: #33413B; --felt: #9AD0BD; color: var(--ink); }
[data-theme='dark'] .debrief.v-weak { --verdict: #FFB4A9; } [data-theme='dark'] .debrief.v-fair { --verdict: var(--amber); }
[data-theme='dark'] .debrief .btn.primary { color: #16201C; }
[data-theme='dark'] .debrief .btn.ghost:hover { background: rgba(233, 236, 234, 0.08); }
[data-theme='dark'] .debrief .mark, [data-theme='dark'] .debrief .dot { border-color: #E9ECEA; }
[data-theme='dark'] .debrief .mark.first, [data-theme='dark'] .debrief .dot.first { background: #1D2925; }
[data-theme='dark'] .debrief .mark.best, [data-theme='dark'] .debrief .dot.best { background: #9AD0BD; }

[data-theme='light'] #stage[data-screen='splash'], [data-theme='light'] #stage[data-screen='intro'] { background: var(--ground); }
[data-theme='light'] .splash, [data-theme='light'] .intro { color: var(--ink); --felt-text: #4A5650; --felt-line: #8D9993; }
[data-theme='light'] .splash-copy { background: var(--ground); box-shadow: none; }
[data-theme='light'] .splash h1 em, [data-theme='light'] .phasebox .active .mono { color: #8A5A00; }
[data-theme='light'] .phasebox .active { border-color: #B8860B; }
[data-theme='light'] .country select { background: var(--paper); color: var(--ink); }
[data-theme='light'] .splash .sound, [data-theme='light'] .intro .sound, [data-theme='light'] .splash .btn.light, [data-theme='light'] .term.static { color: var(--ink); }
[data-theme='light'] .file { box-shadow: 0 18px 0 rgba(22, 32, 28, 0.12); border: 1.5px solid var(--ink); }
[data-theme='light'] .cta { border-top-color: var(--felt-line); }
[data-theme='light'][data-layout] .cta, [data-theme='light'] [data-layout='flow'] .cta { background: var(--ground); }

/* ---- Debrief entrance ---- */
.top.fresh .stamp { animation: stamp 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 0.9s backwards; }
@keyframes stamp { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }
.debrief .mark { animation: mark 0.5s ease-out backwards; }
.debrief .mark.first { animation-delay: 0.2s; } .debrief .mark.you { animation-delay: 0.5s; } .debrief .mark.best { animation-delay: 0.8s; }
@keyframes mark { from { transform: scaleY(0); opacity: 0; } }
.debrief .gap { animation: pop 0.3s ease-out backwards; }
.debrief .gap:nth-of-type(2) { animation-delay: 0.1s; } .debrief .gap:nth-of-type(3) { animation-delay: 0.2s; }

/* ---- Settings sheet ---- */
.settings { gap: 0; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid #3A4842; font-size: 16px; font-weight: 600; }
.setrow .btn { height: 40px; padding: 0 18px; font-size: 14px; align-self: center !important; }
/* The build number, top right on every screen. Mid grey reads on felt and on the light ground. */
#ver { position: absolute; top: 3px; right: 8px; z-index: 6; font: 500 10px/1 var(--mono); letter-spacing: 0.06em; color: #8D9993; pointer-events: none; }
#stage[data-layout='flow'] #ver { position: fixed; top: 1px; right: 5px; font-size: 9px; }
.verline { margin: 0; padding-top: 2px; color: var(--felt-text); text-transform: none; letter-spacing: 0.04em; }
.setrow small { display: block; font-size: 13px; font-weight: 400; color: var(--felt-text); }
.seg { display: flex; border: 1.5px solid var(--felt-line); border-radius: 8px; overflow: hidden; flex: none; }
.seg button { min-width: 64px; height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--paper); font: 600 14px var(--sans); }
.seg button[aria-pressed='true'] { background: var(--amber); color: #16201C; }
.switch { width: 54px; height: 32px; border-radius: 16px; border: 1.5px solid var(--felt-line); background: transparent; padding: 0; position: relative; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 12px; background: var(--felt-text); transition: transform 0.15s ease-out; }
.switch[aria-checked='true'] { background: var(--amber); border-color: var(--amber); }
.switch[aria-checked='true'] i { transform: translateX(22px); background: #16201C; }

/* ---- Accessibility: target size, and the three display preferences ---- */
.term.bare { min-width: 24px; min-height: 24px; display: inline-grid; place-items: center; }
/* On a phone an (i) is still drawn at 24px, with a 44px area to tap. */
[data-layout='flow'] .term.bare { position: relative; }
[data-layout='flow'] .term.bare::after { content: ''; position: absolute; inset: -10px; }
[data-layout='flow'] .foot { line-height: 2.1; }
html[data-calm] *, html[data-calm] *::before, html[data-calm] *::after { animation: none !important; transition: none !important; }
html[data-contrast] { --muted: #16201C; --felt-text: #FFFFFF; --felt-line: #E9ECEA; --rule: #4A5650; }
html[data-contrast][data-theme='dark'] .debrief { --muted: #FFFFFF; --rule: #A9B5AF; }
html[data-contrast] .card, html[data-contrast] .chip, html[data-contrast] .doc, html[data-contrast] .bubble { outline: 2px solid #16201C; }
html[data-contrast] .card.blocked { opacity: 0.8; }
html[data-contrast] .medal.locked svg { color: #8FA39A; }
html[data-contrast] .chint, html[data-contrast] .mono { color: #16201C; }
html[data-contrast] .mono.light, html[data-contrast] .hud .mono, html[data-contrast] .card.kind-leave .mono, html[data-contrast] .card.kind-leave .chint, html[data-contrast] .sheet .mono { color: #FFFFFF; }
html[data-contrast] .mono.amber { color: var(--amber); }
/* Larger text: the single column, zoomed. main.js sets --zoom from the window size. */
html[data-large] #stage[data-layout='flow'] { zoom: var(--zoom, 1.2); height: calc(100dvh / var(--zoom, 1.2)); }
html[data-large] [data-layout='flow'] .scene { max-height: 110px; }
html[data-large] [data-layout='flow'] .sheet { max-height: calc(94dvh / var(--zoom, 1.2)); gap: 10px; }
#stage[data-short] .play .scene { display: none; }
#stage[data-short] .play .bubble { margin-top: 10px; }
/* High contrast: black and white surfaces with heavy borders. */
html[data-contrast] .sheet { background: #000000; border: 3px solid #FFFFFF; }
html[data-contrast] .overlay { background: rgba(0, 0, 0, 0.88); }
html[data-contrast] .setrow { border-bottom-color: #FFFFFF; }
html[data-contrast] .seg, html[data-contrast] .switch, html[data-contrast] .btn.light, html[data-contrast] .gear { border-width: 2.5px; border-color: #FFFFFF; }
html[data-contrast] .meters { background: #000000; outline: 2px solid #FFFFFF; }
html[data-contrast] .pill:not(.on) { border-width: 2px; background: #000000; }
html[data-contrast] .tab, html[data-contrast] .card { border-width: 3px; }
html[data-contrast] .bubble, html[data-contrast] .doc { outline-width: 3px; }
html[data-contrast] .phasecol .clock { background: #000000; border-color: #FFFFFF; }
html[data-contrast] .phasecol .clock.last { background: #B3261E; }
/* Light appearance reaches the sheets too, so the switch shows at once inside a game. The table scenes keep their colors. */
[data-theme='light'] .sheet { background: var(--paper); color: var(--ink); border-color: var(--ink); --felt-text: #4A5650; --felt-line: #8D9993; }
[data-theme='light'] .overlay { background: rgba(14, 21, 18, 0.72); }
[data-theme='light'] .sheet .mono.amber, [data-theme='light'] .entry .watch { color: #8A5A00; }
[data-theme='light'] .sheet .btn.light, [data-theme='light'] .seg button { color: var(--ink); }
[data-theme='light'] .seg button[aria-pressed='true'] { color: #16201C; }
[data-theme='light'] .setrow, [data-theme='light'] .entry + .entry { border-color: var(--rule); }
[data-theme='light'] .entry .src { color: var(--muted); }
[data-theme='light'] .steps .miss .n { color: #8A5A00; box-shadow: inset 0 0 0 1.5px #8A5A00; }
[data-theme='light'] .switch i { background: #4A5650; }
[data-theme='light'] .switch[aria-checked='true'] i { background: #16201C; }
[data-theme='light'] .sheet .award.open, [data-theme='light'] .sheet .album h3 { color: var(--ink); }
/* High contrast keeps every sheet black with white text, in either appearance. */
html[data-contrast] .sheet { color: #FFFFFF; --felt-text: #FFFFFF; --felt-line: #E9ECEA; }
html[data-contrast] .sheet .btn.light, html[data-contrast] .seg button, html[data-contrast] .sheet .award.open, html[data-contrast] .sheet .album h3 { color: #FFFFFF; }
html[data-contrast] .seg button[aria-pressed='true'] { color: #16201C; }
html[data-contrast] .sheet .mono.amber, html[data-contrast] .entry .watch { color: var(--amber); }
html[data-contrast] .switch i { background: #FFFFFF; }
html[data-contrast] .switch[aria-checked='true'] i { background: #16201C; }
/* Small caps labels follow the surface they sit on. */
html[data-contrast] .splash .mono, html[data-contrast] .intro .pitch .mono, html[data-contrast][data-theme='dark'] .debrief .mono { color: #FFFFFF; }
html[data-contrast] .phasebox .active .mono { color: var(--amber); }
html[data-contrast][data-theme='light'] .splash, html[data-contrast][data-theme='light'] .intro { --felt-text: #16201C; --felt-line: #16201C; }
html[data-contrast][data-theme='light'] .splash .mono, html[data-contrast][data-theme='light'] .intro .pitch .mono { color: #16201C; }
html[data-contrast][data-theme='light'] .phasebox .active .mono { color: #6B4500; }
html[data-contrast] .debrief .stamp .mono { color: inherit; }
/* Phone tap areas: 44 px on the controls a thumb has to hit. */
[data-layout='flow'] .seg button { height: 44px; }
[data-layout='flow'] .lang-btn { height: 44px; }
[data-layout='flow'] .switch { position: relative; }
[data-layout='flow'] .switch::after { content: ''; position: absolute; inset: -7px; }
[data-layout='flow'] .debrief .sound { width: 44px; height: 40px; }
[data-layout='flow'] .mrow b { font-size: 12.5px; }
[data-layout='flow'] .mrow span { font-size: 11.5px; }
[data-layout='flow'] .intro .bar .mono { white-space: normal; }
/* Keyboard focus never lands under the stuck tab and card block. */
/* Larger text on a narrow phone: two meters per row, compact tabs. */
html[data-large] [data-layout='flow'] .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-large] [data-layout='flow'] .tab { font-size: 12px; gap: 3px; padding: 0 2px; }
/* Larger text leaves the top bar about 330 px. The clock takes its own line, so the settings button stays on screen. */
html[data-large] [data-layout='flow'] .phasecol { flex-wrap: wrap; row-gap: 2px; }
html[data-large] [data-layout='flow'] .phases { margin-right: auto; }
html[data-large] [data-layout='flow'] .phasecol .clock { order: 5; flex: 1 0 100%; margin: 0; padding-left: 2px; height: 22px; justify-content: flex-start; text-align: left; }
html[data-large] [data-layout='flow'] .doc.wide { grid-template-columns: repeat(2, auto); }
html[data-large] [data-layout='flow'] .doc.wide .dtitle { grid-column: 1; }
html[data-large] [data-layout='flow'] .doc.wide .drow.big { grid-column: 2; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Narrow phones: the rights button is its count alone. Low screens: the words matter more than the picture. */
@media (max-width: 380px) {
  [data-layout='flow'] .rights-btn svg { display: none; }
  [data-layout='flow'] .doc.wide { column-gap: 8px; }
  [data-layout='flow'] .doc.wide .term.bare { min-width: 18px; }
}
@media (max-height: 660px) { [data-layout='flow'] .play .scene { display: none; } [data-layout='flow'] .play .bubble { margin-top: 6px; } }

/* ---- First-game tip: the screen dims around one thing and a banner points at it. It takes no row. ---- */
#coach { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
#coach:empty { display: none; }
[data-layout='flow'] #coach { position: fixed; }
.coach-hole { position: absolute; border-radius: 12px; box-shadow: 0 0 0 3px var(--amber), 0 0 0 3px rgba(242, 178, 51, 0), 0 0 0 4000px rgba(8, 16, 13, 0.74); animation: fade 0.25s ease-out, coachring 1.8s ease-in-out 0.3s infinite; }
/* The same three layers in both states, or the browser blends the ring into the dimming. */
@keyframes coachring { 50% { box-shadow: 0 0 0 3px var(--amber), 0 0 0 10px rgba(242, 178, 51, 0.4), 0 0 0 4000px rgba(8, 16, 13, 0.74); } }
.coach-tip { position: absolute; left: 0; top: 0; max-width: min(310px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 9px 9px 9px 14px; border-radius: 12px; background: var(--amber); color: #16201C; font-size: 14.5px; font-weight: 600; line-height: 1.3; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); pointer-events: auto; animation: pop 0.25s ease-out 0.1s backwards; }
.coach-tip::after { content: ''; position: absolute; left: var(--arrow, 50%); top: 100%; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: var(--amber); }
.coach-tip.below::after { top: auto; bottom: 100%; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--amber); }
.coach-tip .i { vertical-align: -3px; margin: 0 2px; }
.coach-tip button { position: relative; flex: none; height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: #16201C; color: #FFFFFF; font: inherit; font-size: 13px; cursor: pointer; }
.coach-tip button::after { content: ''; position: absolute; inset: -6px; }

/* ---- A "why this move" sheet: only the card and its explanation stay lit ---- */
.overlay.spot, [data-theme='light'] .overlay.spot, html[data-contrast] .overlay.spot { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.spot-hole { position: absolute; border-radius: 14px; box-shadow: 0 0 0 3px var(--amber), 0 0 0 4000px rgba(8, 16, 13, 0.84); pointer-events: none; }
html[data-contrast] .spot-hole { box-shadow: 0 0 0 3px var(--amber), 0 0 0 4000px rgba(0, 0, 0, 0.92); }
.overlay.spot .sheet { position: relative; }

/* ---- Phone: an arrow says that the card row scrolls sideways ---- */
.hand-more { display: none; }
[data-layout='flow'] .play { position: relative; }
[data-layout='flow'] .hand-more:not([hidden]) { display: grid; place-items: center; position: absolute; z-index: 3; right: 6px; bottom: calc(58px + env(safe-area-inset-bottom)); width: 40px; height: 40px; border-radius: 20px; border: 2px solid #16201C; background: var(--amber); color: #16201C; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), -14px 0 18px 6px rgba(12, 20, 17, 0.55); }

/* ---- Languages with longer words: Polish, Ukrainian, Russian ---- */
/* Their card titles run a line longer than English. A wider phone card and slightly smaller type keep them inside the card. */
html:lang(pl) [data-layout='flow'] .hand .card, html:lang(uk) [data-layout='flow'] .hand .card, html:lang(ru) [data-layout='flow'] .hand .card { flex-basis: 176px; }
html:lang(pl) [data-layout='flow'] .ctitle, html:lang(uk) [data-layout='flow'] .ctitle, html:lang(ru) [data-layout='flow'] .ctitle { font-size: 13px; line-height: 1.16; }
html:lang(pl) [data-layout='flow'] .card-main, html:lang(uk) [data-layout='flow'] .card-main, html:lang(ru) [data-layout='flow'] .card-main { gap: 3px; padding-top: 8px; }
/* The three meters share one row. Slightly smaller type keeps "Poduszka 11 mies." inside it. */
html:lang(pl) [data-layout='flow'] .meters, html:lang(uk) [data-layout='flow'] .meters, html:lang(ru) [data-layout='flow'] .meters { column-gap: 8px; padding-left: 8px; padding-right: 8px; }
html:lang(pl) [data-layout='flow'] .mrow b, html:lang(uk) [data-layout='flow'] .mrow b, html:lang(ru) [data-layout='flow'] .mrow b { font-size: 11.5px; gap: 3px; }
html:lang(pl) [data-layout='flow'] .mrow span, html:lang(uk) [data-layout='flow'] .mrow span, html:lang(ru) [data-layout='flow'] .mrow span { font-size: 11px; }
html:lang(pl) [data-layout='flow'] .card .mono, html:lang(uk) [data-layout='flow'] .card .mono, html:lang(ru) [data-layout='flow'] .card .mono { flex: none; letter-spacing: 0.02em; }

/* ---- Card groups: a card's tag and its tab's count share one colour ----
   A tester asked for green "accept" and red "refuse" cards. Those colours would judge the move, and
   signing is often the worse one. So the colours only say which group a card belongs to: blue for
   Find out, violet for Negotiate, ink for Decide. Amber stays the one signal colour. */
#stage { --g-find: #2F6F9F; --g-push: #7B4FA6; }
/* The tag never shrinks and keeps clear of the (i) button. Eight cards in a row leave it about 93 px. */
.card-main .mono { align-self: flex-start; flex: none; max-width: calc(100% - 24px); padding: 2px 6px; border-radius: 999px; background: var(--g-find); color: #FFFFFF; font-size: 10px; letter-spacing: 0; }
[data-layout='flow'] .card-main .mono { padding: 1px 6px; font-size: 10.5px; }
[data-layout='flow'] .card-main { gap: 4px; }
.card.kind-counter .card-main .mono { background: var(--g-push); }
.card.kind-accept .card-main .mono { background: #16201C; color: #FFFFFF; }
.card.kind-leave .card-main .mono { background: rgba(255, 255, 255, 0.2); color: #FFFFFF; }
.tab[data-group='find'] span { background: var(--g-find); color: #FFFFFF; }
.tab[data-group='push'] span { background: var(--g-push); color: #FFFFFF; }
.tab[data-group='decide'] span { background: #16201C; color: #FFFFFF; }
.tab.on[data-group='decide'] span { background: var(--paper); color: var(--ink); }
html[data-contrast] #stage { --g-find: #1D4E73; --g-push: #55307C; }
html[data-contrast] .card-main .mono { color: #FFFFFF; }
