* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: #0E0C14; color: #FBF7EE; font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
body { display: grid; place-items: center; overflow: hidden; }
.stage { position: relative; width: min(100vw, 177.78vh); aspect-ratio: 16 / 9; overflow: hidden; background: #16141F; user-select: none; -webkit-user-select: none; touch-action: none; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.film { position: absolute; inset: 0; background: #0E0C14; opacity: 1; pointer-events: none; transition: opacity .28s; }
.film.clear { opacity: 0; }
kbd { display: inline-block; min-width: 1.5em; padding: .08em .35em; border-radius: 6px; background: #2C2840; border: 1px solid #554F73; color: #FBF7EE; font: inherit; font-weight: 800; text-align: center; }

.hud { position: absolute; left: 2%; right: 2%; top: 2.5%; display: flex; align-items: center; gap: 12px; font-size: clamp(11px, 1.45vw, 16px); text-shadow: 0 1px 3px #000; }
.dots { display: flex; gap: 6px; }
.dots i { width: .75em; height: .75em; border-radius: 50%; background: rgba(255, 255, 255, .28); box-shadow: 0 1px 2px #0008; }
.dots i.on { background: #FFC93C; }
.tries { margin-left: auto; opacity: .85; }
.ask { font: inherit; font-weight: 700; padding: .2em .8em; color: #FBF7EE; cursor: pointer; border-radius: 999px; background: rgba(22, 20, 31, .75); border: 1px solid rgba(255, 255, 255, .28); }

/* the current thing to learn, big enough to read while you play */
.lesson { position: absolute; left: 50%; top: 9%; transform: translateX(-50%); width: min(86%, 820px); padding: .55em 1em; border-radius: 14px; background: #FFC93C; color: #1E1B2E; border: 3px solid #1E1B2E; box-shadow: 3px 3px 0 #1E1B2E; text-align: center; font-weight: 750; font-size: clamp(12px, 1.8vw, 21px); pointer-events: none; }
.lesson kbd { background: #1E1B2E; border-color: #1E1B2E; }
.prompt, .say { position: absolute; pointer-events: none; }
.prompt { transform: translate(-50%, -100%); padding: .25em .65em; border-radius: 999px; background: #1E1B2E; color: #FFC93C; font-weight: 800; font-size: clamp(11px, 1.4vw, 16px); border: 2px solid #FFC93C; white-space: nowrap; }
/* a speech bubble over whoever is talking */
.say { transform: translate(-50%, -100%); max-width: min(46%, 430px); width: max-content; padding: .45em .8em; border-radius: 14px; background: #FBF7EE; color: #1E1B2E; border: 2px solid #1E1B2E; box-shadow: 2px 2px 0 #1E1B2E; text-align: center; font-weight: 650; line-height: 1.25; font-size: clamp(11px, 1.45vw, 17px); z-index: 2; }
.say::after { content: ""; position: absolute; left: var(--tail, 50%); bottom: -9px; width: 12px; height: 12px; margin-left: -6px; background: inherit; border-right: 2px solid #1E1B2E; border-bottom: 2px solid #1E1B2E; transform: rotate(45deg); }
.say.tangled { background: #FFD9D2; border-color: #A81F12; color: #5C0C07; font-style: italic; }
.say.tangled::after { border-color: #A81F12; }
.say.shout { font-weight: 850; font-style: normal; }
.say b { display: block; font-size: .72em; letter-spacing: .04em; text-transform: uppercase; opacity: .65; }
.psay { min-height: 1.3em; font-style: italic; color: #FFC93C; opacity: 1 !important; }

/* what you can do: bright means now, pulsing means this is what the lesson is about */
.bar { position: absolute; left: 50%; bottom: 2.5%; transform: translateX(-50%); display: flex; gap: clamp(4px, .8vw, 10px); align-items: stretch; font-size: clamp(10px, 1.3vw, 15px); }
.bar .group { display: flex; align-items: center; gap: .3em; padding: .3em .55em; border-radius: 12px; font: inherit; color: #FBF7EE; background: rgba(22, 20, 31, .82); border: 2px solid rgba(255, 255, 255, .16); transition: opacity .15s, border-color .15s; touch-action: none; }
.bar .group button { all: unset; cursor: pointer; }
.bar button.group { cursor: pointer; }
.bar small { font-size: 1em; font-weight: 750; white-space: nowrap; }
.bar .off { opacity: .4; }
.bar .lit { border-color: #FFC93C; }
.bar .teach { border-color: #FFC93C; background: #5A4514; animation: teach 1s ease-in-out infinite; }
@keyframes teach { 50% { transform: translateY(-3px); box-shadow: 0 4px 0 #FFC93C; } }
@media (prefers-reduced-motion: reduce) { .bar .teach { animation: none; } }
@media (pointer: coarse) { .bar { font-size: clamp(12px, 2vw, 18px); } .bar .group { padding: .8em .9em; } }

.card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6vh; padding: 4%; text-align: center; background: rgba(14, 12, 20, .78); }
.card[hidden] { display: none; }
.card h1 { font-size: clamp(34px, 7vw, 86px); font-weight: 900; letter-spacing: -.02em; color: #FFC93C; }
.card p { max-width: 620px; font-size: clamp(12px, 1.6vw, 18px); line-height: 1.4; }
.card .lead { font-size: clamp(14px, 2vw, 24px); font-weight: 700; }
.card .small { opacity: .7; font-size: clamp(10px, 1.2vw, 14px); }
.go, .back { font: inherit; font-weight: 800; cursor: pointer; border-radius: 999px; border: 3px solid #1E1B2E; }
.go { padding: .5em 1.6em; font-size: clamp(13px, 1.8vw, 20px); background: #FFC93C; color: #1E1B2E; box-shadow: 3px 3px 0 #1E1B2E; }
.go:disabled { opacity: .45; cursor: default; }

.puzzle, .help { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(14, 12, 20, .72); z-index: 3; }
.puzzle[hidden], .help[hidden] { display: none; }
.box { padding: clamp(10px, 2vw, 24px); border-radius: 20px; background: #221D33; border: 3px solid #D9503F; text-align: center; max-height: 96%; overflow: auto; }
.box h2 { color: #FF8A6E; font-size: clamp(15px, 2.2vw, 26px); }
.box p { margin: .3em auto .7em; max-width: 380px; font-size: clamp(11px, 1.4vw, 15px); opacity: .9; }
.help .box { width: min(90%, 720px); border-color: #FFC93C; }
.help h2 { color: #FFC93C; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: .5em 1em; margin: .8em 0; text-align: left; font-size: clamp(11px, 1.45vw, 16px); }
.help dt { font-weight: 800; white-space: nowrap; }
.help .tip { max-width: none; font-weight: 700; }
.grid { display: grid; gap: 2px; width: min(50vh, 42vw); margin: 0 auto; aspect-ratio: 1; }
.grid button { all: unset; min-width: 0; min-height: 0; overflow: hidden; display: grid; place-items: center; font-size: clamp(16px, 4vh, 34px); line-height: 1; color: #1E1B2E; cursor: pointer; border-radius: 4px; background: #EADCC0; }
.grid button.given { background: #BFAE8C; cursor: default; }
.grid button.bad { outline: 3px solid #D9503F; outline-offset: -3px; }
.back { margin-top: .8em; padding: .3em 1.1em; background: transparent; color: #FBF7EE; border-color: #554F73; font-size: clamp(11px, 1.3vw, 14px); }

/* the team, the level list */
.team { padding: .15em .7em; border-radius: 999px; background: #FFC93C; color: #1E1B2E; font-weight: 800; text-shadow: none; }
.team span { padding: 0 .4em; font-weight: 650; opacity: .62; white-space: nowrap; }
.team span.me { font-weight: 900; opacity: 1; }
.team span.away { opacity: .38; font-style: italic; }
.lesson.dim { opacity: .55; }
.go[data-get] { text-decoration: none; }
.pitch { display: flex; align-items: center; gap: 14px; max-width: 760px; text-align: left; padding: 8px 12px; border-radius: 12px; background: rgba(251, 247, 238, .08); font-size: clamp(11px, 1.3vw, 15px); }
.pitch[hidden] { display: none; }
.pitch img { width: clamp(90px, 14vw, 170px); border-radius: 8px; }
.pitch video { width: clamp(150px, 28vw, 340px); border-radius: 8px; }
.pitch div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pitch a:not(.go) { color: #FFC93C; font-weight: 800; }
.pitch .go { text-decoration: none; }
.levels { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.go.level { background: #2C2840; color: #FBF7EE; border-color: #554F73; box-shadow: none; font-size: clamp(12px, 1.6vw, 18px); }
.go.level:hover, .go.level.next { background: #FFC93C; color: #1E1B2E; border-color: #1E1B2E; box-shadow: 3px 3px 0 #1E1B2E; }
.bar [hidden] { display: none; }

.talk .box { max-width: 560px; }
.tsay { font-weight: 850; color: #A81F12; font-size: 1.05em; margin: .3em 0 .7em; }
.answers { display: grid; gap: 8px; margin-bottom: .6em; }
.answer { all: unset; cursor: pointer; padding: .6em .9em; border-radius: 12px; background: #FBF7EE; color: #1E1B2E; border: 2px solid #1E1B2E; font-weight: 700; line-height: 1.25; }
.answer:hover, .answer:focus-visible { background: #FFC93C; }
.answer:disabled { opacity: .5; cursor: default; }
.treply { font-weight: 700; color: #1B6B3A; margin: .2em 0 .5em; }
.treply.no { color: #A81F12; }

/* The films */
.cinema { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; place-items: center; }
.cinema[hidden] { display: none; }
.cinema video { width: 100%; height: 100%; object-fit: contain; }
.cline { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); width: min(78%, 760px); margin: 0; padding: .55em 1em; border-radius: 14px; background: rgba(251, 247, 238, .96); color: #1E1B2E; font-weight: 650; font-size: clamp(14px, 1.9vw, 21px); line-height: 1.3; text-align: center; box-shadow: 0 6px 22px rgba(0, 0, 0, .4); }
.cline[hidden] { display: none; }
.cline b { display: block; font-size: .72em; letter-spacing: .08em; text-transform: uppercase; color: #8A6A2A; }
.cskip { position: absolute; right: 16px; top: 12px; }
