:root {
  color-scheme: only dark;
  font: 16px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #09110d;
  color: #e8f0e4;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { min-width: 320px; }
button, input, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 2px solid #f0ca82; outline-offset: 4px; }
a { color: #b5e59c; text-underline-offset: 3px; }
[hidden] { display: none !important; }

#hackerllion-chain {
  --hc-bg: #111b15;
  --hc-bar: #17241b;
  --hc-text: #e8f0e4;
  --hc-muted: #96a994;
  --hc-line: #304235;
  --hc-accent: #b5e59c;
  --hc-gold: #f0ca82;
  --hc-error: #efa891;
  --hc-cool: #a3d5ce;
  --hc-fill: #223725;
  position: fixed; inset: var(--viewport-top, 0px) 0 auto;
  height: var(--viewport-height, 100dvh); width: 100%; max-width: 840px; margin: 0 auto;
  display: flex; flex-direction: column; padding: 16px 20px 10px;
}
.hc-terminal { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--hc-bg); border: 1px solid var(--hc-line); border-radius: 10px; overflow: hidden; }
#hackerllion-chain button { color: inherit; background: transparent; border: 0; border-radius: 3px; }
#hackerllion-chain button:hover { background: var(--hc-fill); color: var(--hc-accent); }
.hc-chrome { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; min-height: 44px; background: var(--hc-bar); border-bottom: 1px solid var(--hc-line); color: var(--hc-muted); }
.hc-modes, .hc-tools { display: flex; gap: 16px; align-items: center; }
#hackerllion-chain .hc-chrome button { min-height: 44px; padding: 8px 0; font-size: .875rem; }
.hc-modes button[aria-pressed=true] { color: var(--hc-accent) !important; text-decoration: underline; text-underline-offset: 7px; }
.hc-sound[aria-pressed=true] { color: var(--hc-accent) !important; }
#hackerllion-chain .hc-entry-sound { min-width: 28px; font-size: 1.125rem; color: var(--hc-muted); }
.hc-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 22px 12px; }
.hc-screen > :not(.hc-game):not(.hc-summary) { flex-shrink: 0; }
.hc-masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 1.9rem; line-height: 1.2; font-weight: 600; letter-spacing: -1.6px; margin: 0; }
h1 span { color: var(--hc-accent); }
.hc-score { display: flex; flex-direction: column; align-items: flex-end; color: var(--hc-muted); font-size: .75rem; line-height: 1.2; }
.hc-score > span:first-child { text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; }
.hc-score b { color: var(--hc-accent); font-size: 1.375rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.hc-score small { font-size: .75rem; }

/* One persistent strip for the run, separate from the exploit's own phases. */
.hc-rounds { --round-gap: 6px; position: relative; display: grid; grid-template-columns: repeat(var(--round-count, 7), minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; gap: var(--round-gap); }
.hc-rounds li { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 7px 10px; border: 1px solid #2d3d30; border-radius: 3px; color: #7d927e; line-height: 1.15; }
.hc-round-number { font-size: .75rem; }
.hc-round-outcome { font-size: .875rem; }
.hc-rounds .is-current { background: var(--hc-fill); border-color: #74976a; color: var(--hc-accent); }
.hc-rounds .is-done { background: #1a2b1c; color: var(--hc-accent); border-color: #3c563d; }
.hc-rounds .is-current.is-done { border-color: var(--hc-accent); }
.hc-rounds .is-root { background: #30291b; color: var(--hc-gold); border-color: #7f6841; }
.hc-rounds .is-root.is-current { border-color: var(--hc-gold); }

/* The prompt is the brightest reading surface; its clock never changes role. */
.hc-question { position: relative; padding: 12px 16px 15px; background: #192b25; border: 1px solid #3a5d50; border-left: 3px solid var(--hc-cool); border-radius: 5px; margin: 0; overflow: hidden; }
.hc-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 27px; }
.hc-command { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; font-size: .8125rem; }
.hc-command-file { color: var(--hc-cool); font-weight: 500; letter-spacing: .075em; }
.hc-round-meta { color: #a1b7aa; font-variant-numeric: tabular-nums; font-size: .75rem; }
.hc-timer { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; color: var(--hc-cool); }
.hc-timer-caption { color: #a1b7aa; font-size: .75rem; }
.hc-countdown { min-width: 3ch; text-align: right; font-size: 1.375rem; line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.hc-timer.is-urgent, .hc-timer.is-urgent .hc-timer-caption { color: var(--hc-error); }
.hc-question h2 { margin: 7px 0 6px; color: #f0f7eb; font-size: 1.5rem; line-height: 1.3; letter-spacing: -.6px; font-weight: 500; overflow-wrap: break-word; }
.hc-question-sub { margin: 0; color: #a6bcae; font-size: .8125rem; }
.hc-time-track { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: #2c4137; }
.hc-time-track span { display: block; height: 100%; background: var(--hc-cool); transform-origin: left; transition: transform .1s linear; }
.hc-time-track.is-urgent span { background: var(--hc-error); }
#hackerllion-chain:not([data-state=answering]):not([data-state=ready]) .hc-time-track { visibility: hidden; }

/* A dedicated output window holds the code, payoff, and its explanation. */
.hc-game { flex: 1; min-height: 0; display: flex; flex-direction: column; container: output / size; background: #080f0b; border: 1px solid #344739; border-radius: 5px; overflow: hidden; }
.hc-session { flex-shrink: 0; display: flex; align-items: center; gap: 12px; min-height: 35px; padding: 8px 15px; background: #142018; border-bottom: 1px solid #2b3b2f; font-size: .75rem; }
.hc-game-label { color: var(--hc-accent); font-weight: 500; letter-spacing: .075em; }
.hc-session-text { color: var(--hc-muted); }
.hc-clock { margin-left: auto; color: var(--hc-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hc-rail { flex-shrink: 0; display: flex; gap: 8px; list-style: none; padding: 0; margin: 12px 15px 0; font-size: .75rem; line-height: 1.2; }
.hc-rail li { flex: 1; position: relative; padding-top: 9px; color: #8da28f; }
.hc-rail li::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: #29392e; }
.hc-rail li.done::before { background: var(--hc-accent); }
.hc-rail li.active::before { background: linear-gradient(90deg, var(--hc-accent) var(--phase-fill, 0%), #29392e var(--phase-fill, 0%)); }
.hc-rail li.active, .hc-rail li.done { color: var(--hc-accent); }
.hc-rail li.active { font-weight: 600; }
.hc-playfield { flex: 1; min-height: 0; position: relative; padding: 14px 15px 0; overflow: hidden; }
.hc-code { font-size: 1rem; line-height: 1.55; letter-spacing: -.2px; }
.hc-line { min-height: 25px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hc-line[data-kind=dim] { color: var(--hc-muted); }
.hc-line[data-kind=source] { color: var(--hc-cool); }
.hc-line[data-kind=ok] { color: var(--hc-accent); }
.hc-line[data-kind=root] { color: var(--hc-gold); }
.hc-line.is-typing::after { content: '▌'; color: var(--hc-accent); }
.hc-memory { display: flex; gap: 4px; margin: 12px 0 0; max-width: 370px; }
.hc-memory span { flex: 1; text-align: center; padding: 6px 0; background: #17241a; color: var(--hc-muted); font-size: .75rem; }
.hc-memory span.is-live { background: var(--hc-fill); color: var(--hc-accent); }
.hc-memory span.is-free { background: transparent; }
.hc-memory span.is-reused { background: var(--hc-accent); color: #0e1713; transform: translateY(-3px); }
.hc-character { position: absolute; inset: auto 15px 14px; display: flex; align-items: center; gap: 14px; min-height: 32px; }
.hc-bug { display: inline-block; min-width: 68px; color: var(--hc-accent); font-size: 25px; letter-spacing: -2px; white-space: pre; }
.hc-quip { font-size: .8125rem; color: var(--hc-muted); }
.hc-payoff { position: absolute; inset: 65px 15px 10px; display: flex; flex-direction: column; justify-content: center; }
.hc-payoff-top { display: flex; align-items: center; gap: 16px; }
.hc-rank { color: var(--hc-accent); font-size: 46px; line-height: 1; letter-spacing: -2px; font-weight: 500; }
.hc-points { background: #243b24; color: var(--hc-accent); padding: 5px 8px; border-radius: 3px; font-size: .875rem; white-space: nowrap; }
.hc-final-bug { margin-left: auto; align-self: center; color: var(--hc-accent); font-size: 23px; line-height: 1.05; letter-spacing: -1px; white-space: pre; }
.hc-payoff-name { font-size: .75rem; color: var(--hc-muted); margin-top: 8px; overflow-wrap: anywhere; }
.hc-punchline { margin: 4px 0 0; font-size: .9375rem; line-height: 1.4; }
.hc-game[data-state=result] { border-color: #536c44; background: #0e1a10; }
.hc-game[data-state=result] .hc-session { background: #1b2b1b; }
.is-root .hc-game[data-state=result] { border-color: #9e814e; background: #19170e; }
.is-root .hc-game[data-state=result] .hc-session { background: #2b2517; border-bottom-color: #4c412b; }
.is-root .hc-game-label, .is-root .hc-rank, .is-root .hc-final-bug { color: var(--hc-gold); }
.is-root .hc-points { color: var(--hc-gold); background: #3c301c; }
.is-root .hc-rail li.done { color: var(--hc-gold); }
.is-root .hc-rail li.done::before { background: var(--hc-gold); }
.hc-result { flex-shrink: 0; display: flex; align-items: center; min-height: 52px; padding: 10px 15px; border-top: 1px solid #2b3b2f; background: #121e16; color: var(--hc-muted); font-size: .875rem; line-height: 1.45; }
.hc-result.is-error { color: var(--hc-error); }
.is-root .hc-game .hc-result { background: #211e13; border-color: #4c412b; color: #c2b48e; }

/* The only place to type: a green, focusable command dock. */
.hc-entry { margin: 0; padding: 10px 13px; background: #19281c; border: 1px solid #526c44; border-radius: 5px; transition: border-color .12s, box-shadow .12s; }
.hc-entry:focus-within { border-color: var(--hc-accent); box-shadow: 0 0 0 1px #b5e59c26; }
.hc-entry.is-invalid { border-color: var(--hc-error); }
.hc-entry-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 3px 12px; min-height: 32px; margin-bottom: 4px; }
.hc-entry-label { font-size: .8125rem; letter-spacing: .065em; color: var(--hc-accent); font-weight: 500; }
.hc-login { margin-left: auto; font-size: .75rem; color: #9bb390; }
.is-root .hc-login { color: var(--hc-gold); }
.hc-input-row { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 44px; }
.hc-chevron { color: var(--hc-accent); font-size: 1.125rem; }
#hc-answer { flex: 1; width: 100%; min-width: 0; padding: 7px 0; border: 0; background: transparent; color: var(--hc-text); font-size: 1.125rem; caret-color: var(--hc-accent); }
#hc-answer:focus-visible { outline: none; }
#hc-answer:disabled { opacity: 1; }
#hc-answer::placeholder { color: #a2b499; opacity: 1; }
#hackerllion-chain .hc-run { flex-shrink: 0; min-width: 82px; min-height: 44px; padding: 10px 14px; background: var(--hc-accent); color: #10200e; font-size: .875rem; font-weight: 600; }
#hackerllion-chain .hc-run:hover { background: #caedb7; color: #10200e; }
#hackerllion-chain .hc-run.is-skip { background: #324a2d; color: var(--hc-accent); }
#hackerllion-chain[data-state=animating] .hc-entry, #hackerllion-chain[data-state=review] .hc-entry { background: #152119; border-color: #3e5340; }
.hc-entry.is-summary { padding: 0; background: none; border: 0; box-shadow: none; }
.hc-entry.is-summary .hc-entry-label, .hc-entry.is-summary .hc-login, .hc-entry.is-summary input, .hc-entry.is-summary .hc-chevron { display: none; }
.hc-entry.is-summary .hc-entry-sound { display: none; }
.hc-entry.is-summary .hc-entry-head { justify-content: flex-end; }
.hc-entry.is-summary .hc-run { width: 100%; }
footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; min-height: 24px; margin: 0; font-size: .75rem; color: var(--hc-muted); }
.hc-footer-actions { display: flex; gap: 16px; align-items: center; margin-left: auto; }
#hackerllion-chain .hc-footer-actions button { padding: 4px 0; min-height: 32px; font-size: .875rem; color: var(--hc-accent); }
.hc-footer-actions a { color: var(--hc-muted); font-size: .75rem; }
.hc-page-note { text-align: center; color: var(--hc-muted); font-size: .75rem; margin: 12px 0 0; }
.hc-summary { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: #0a130e; border: 1px solid var(--hc-line); border-radius: 5px; }
.hc-recap { list-style: none; padding: 0 15px; margin: 0; }
.hc-recap li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hc-line); }
.hc-recap li:last-child { border-bottom: 0; }
.hc-recap li > div { min-width: 0; }
.hc-recap-question { display: block; color: var(--hc-muted); font-size: .75rem; margin-bottom: 4px; }
.hc-recap strong { font-size: 1rem; font-weight: 500; overflow-wrap: anywhere; }
.hc-recap-rank { color: var(--hc-accent); font-size: .875rem; white-space: nowrap; }
.hc-recap-rank.is-root { color: var(--hc-gold); }

/* The last reveal ends in a dedicated score screen. */
#hackerllion-chain[data-state=complete] .hc-question,
#hackerllion-chain[data-state=complete] .hc-score,
#hackerllion-chain[data-state=complete] footer { display: none; }
.hc-summary { animation: hc-report-in .45s ease-out both; }
.hc-finale { padding: 22px 20px 20px; text-align: center; }
.hc-finale-stamp { margin: 0 0 18px; font-size: .8125rem; letter-spacing: .08em; color: var(--hc-muted); }
.hc-finale-bug { color: var(--hc-accent); font-size: 40px; line-height: 1.1; letter-spacing: -2px; white-space: pre; margin-bottom: 12px; }
.hc-finale h2 { font-size: clamp(1.375rem, 4vw, 1.8rem); font-weight: 500; line-height: 1.25; margin: 0 0 12px; }
.hc-final-score { display: flex; justify-content: center; align-items: baseline; gap: 10px; color: var(--hc-muted); }
.hc-final-score strong { color: var(--hc-accent); font-size: clamp(3.25rem, 12vw, 4.5rem); font-weight: 500; line-height: 1; letter-spacing: -.06em; }
.hc-final-score span { font-size: 1.125rem; }
.hc-final-rank { margin: 12px 0 0; color: var(--hc-muted); font-size: .875rem; }
.is-root .hc-finale-bug, .is-root .hc-final-score strong { color: var(--hc-gold); }
.hc-summary > .hc-result { justify-content: center; text-align: center; min-height: 44px; }
.hc-final-review { border-top: 1px solid var(--hc-line); }
.hc-final-review > summary { padding: 12px 15px; cursor: pointer; color: var(--hc-accent); font-size: .875rem; }
.hc-entry.is-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hc-entry.is-summary .hc-entry-head, .hc-entry.is-summary .hc-footer-actions { display: contents; }
.hc-entry.is-summary .hc-input-row { grid-column: 1; grid-row: 1; }
#hackerllion-chain .hc-entry.is-summary .hc-secondary { grid-column: 2; grid-row: 1; min-height: 44px; padding: 10px; border: 1px solid #526c44; background: #1b2b1b; font-size: .875rem; }
#hackerllion-chain .hc-entry.is-summary .hc-answers { grid-column: 1 / -1; grid-row: 2; justify-self: center; min-height: 32px; }
@keyframes hc-report-in { from { opacity: .2; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* One readable network hop: no moving controls or scrambled question text. */
.hc-connection { position: absolute; width: min(80%, 330px); top: calc(50% - 16px); height: 2px; pointer-events: none; }
.hc-connection-command { position: absolute; bottom: 52px; left: 0; right: 0; text-align: center; font-size: .8125rem; color: var(--hc-cool); white-space: nowrap; }
.hc-connection-wire { position: absolute; inset: 0; background: #2a4130; }
.hc-connection-wire::after { content: ''; position: absolute; inset: -1px 0; background: var(--hc-accent); transform-origin: left; animation: hc-connect-wire var(--entry-duration) ease-out both; }
.is-entering { --arrival-color: var(--hc-accent); }
.is-entering.is-final-entry { --arrival-color: var(--hc-gold); }
.is-entering .hc-game-label, .is-entering .hc-connection-command { color: var(--arrival-color); }
.is-entering .hc-bug { position: relative; z-index: 1; color: var(--arrival-color); text-shadow: 0 0 14px #080f0b; animation: hc-bug-hop var(--entry-duration) cubic-bezier(.2,.65,.3,1) both; }
.is-entering .hc-quip { text-align: center; animation: hc-quip-in var(--entry-duration) ease-out both; }
.is-entering .hc-connection { animation: hc-wire-out var(--entry-duration) linear both; }
.is-entering .hc-question::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 35%, #b5e59c12 72%, #b5e59c35 99%, transparent); pointer-events: none; animation: hc-prompt-scan .55s ease-out both; }
.is-entering .hc-question h2 { animation: hc-prompt-in .35s ease-out both; }
.is-entering .hc-rounds::after { content: ''; position: absolute; bottom: 0; left: calc(var(--round-index) * (100% + var(--round-gap)) / var(--round-count)); width: calc((100% - (var(--round-count) - 1) * var(--round-gap)) / var(--round-count)); height: 2px; background: var(--arrival-color); pointer-events: none; animation: hc-progress-hop .6s ease-in-out both; }
.is-entering.is-first-entry .hc-rounds::after { animation-name: hc-progress-start; }
.is-entering .hc-rounds .is-current { animation: hc-target-pulse var(--entry-duration) ease-out both; }
.is-entering .hc-chevron { animation: hc-caret-ready var(--entry-duration) ease-out both; }
@keyframes hc-connect-wire { 0% { transform: scaleX(0); } 65%, 100% { transform: scaleX(1); } }
@keyframes hc-wire-out { 0%, 68% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hc-bug-hop {
  0% { transform: translate(-78px, 5px) scale(.78); opacity: .3; }
  38% { transform: translate(-24px, -17px) rotate(-6deg) scale(.95); opacity: 1; }
  70% { transform: translate(4px, 3px) rotate(2deg) scale(1.04, .94); }
  100% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
}
@keyframes hc-quip-in { 0%, 30% { opacity: 0; transform: translateY(4px); } 85%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes hc-prompt-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes hc-prompt-in { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hc-progress-hop { from { transform: translateX(calc(-100% - var(--round-gap))); } to { transform: translateX(0); } }
@keyframes hc-progress-start { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hc-target-pulse { 0%, 100% { box-shadow: inset 0 0 0 0 transparent; } 50% { box-shadow: inset 0 0 0 1px var(--arrival-color); } }
@keyframes hc-caret-ready { 0% { opacity: .3; } 50% { opacity: 1; text-shadow: 0 0 10px var(--hc-accent); } 100% { opacity: 1; text-shadow: none; } }

dialog { background: #111b15; color: #e8f0e4; border: 1px solid #526248; border-radius: 8px; box-shadow: 0 24px 100px #0008; max-width: 560px; width: calc(100% - 40px); max-height: 80svh; overflow: auto; padding: 24px; font: 1rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
dialog::backdrop { background: #030b07c9; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-head h2 { font-size: 1.125rem; font-weight: 500; margin: 0; color: #b5e59c; }
.dialog-head button { font-size: .875rem; color: #96a994; background: none; border: 0; min-height: 44px; padding: 8px 0; }
dialog p { margin: 16px 0; }
.dialog-note { font-size: .875rem; color: #96a994; }
.help-ranks { list-style: none; padding: 0; margin: 20px 0; }
.help-ranks li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #2c3b2e; }
.help-ranks b { font-weight: 500; color: #b5e59c; }
.help-ranks li:last-child b { color: #f0ca82; }
.answers-content details { margin-top: 18px; }
.answers-content summary { cursor: pointer; font-size: 1rem; color: #b5e59c; }
.answer-list { padding: 0; margin: 16px 0; list-style: none; }
.answer-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #2c3b2e; font-size: .875rem; }
.answer-list li span:first-child { overflow-wrap: anywhere; }
.answer-list li span:last-child { color: #96a994; white-space: nowrap; }
.answer-list .is-your-answer { color: #f0ca82; }
.answer-sources { font-size: .75rem; color: #96a994; }
.hc-share-text { width: 100%; min-height: 180px; background: #0e1713; color: #e8f0e4; border: 1px solid #526248; padding: 12px; font-size: 1rem; resize: vertical; }
.noscript { max-width: 800px; margin: 16px auto; color: #efa891; }

/* The launch screen has one invitation. Live rounds keep just their HUD. */
#hackerllion-chain[data-state=ready] .hc-rounds,
#hackerllion-chain[data-state=ready] .hc-score,
#hackerllion-chain[data-state=ready] .hc-entry-head,
#hackerllion-chain[data-state=ready] #hc-answer,
#hackerllion-chain[data-state=ready] .hc-chevron { display: none; }
#hackerllion-chain[data-state=ready] .hc-entry { padding: 0; background: none; border: 0; }
#hackerllion-chain[data-state=ready] .hc-run { width: 100%; min-height: 52px; font-size: 1rem; }
#hackerllion-chain:not([data-state=ready]):not([data-state=complete]) footer,
#hackerllion-chain:not([data-state=ready]) .hc-page-note { display: none; }
#hackerllion-chain:not([data-state=ready]) h1 { font-size: 1.35rem; letter-spacing: -.8px; }
#hackerllion-chain:not([data-state=ready]) .hc-score { flex-direction: row; align-items: baseline; gap: 10px; }
#hackerllion-chain[data-state=answering] .hc-game .hc-code { display: none; }
#hackerllion-chain[data-state=answering] .hc-character { inset: 0 15px; justify-content: center; flex-direction: column; gap: 10px; }
#hackerllion-chain[data-state=answering] .hc-bug { font-size: 44px; }
#hackerllion-chain[data-state=answering] .hc-result:not(.is-error) { display: none; }
.hc-game[data-state=idle] .hc-character { justify-content: center; }
.hc-game[data-state=idle] .hc-code { color: var(--hc-muted); }
.hc-game[data-state=running] .hc-result { display: none; }

@media (max-width: 600px) {
  #hackerllion-chain { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .hc-terminal { border: 0; border-radius: 0; }
  .hc-chrome { padding-inline: 16px; }
  .hc-modes, .hc-tools { gap: 16px; }
  .hc-screen { padding: 12px; gap: 10px; }
  h1 { font-size: 1.8rem; }
  .hc-score b { font-size: 1.25rem; }
  .hc-rounds { --round-gap: 5px; }
  .hc-rounds li { flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; }
  .hc-round-number { font-size: .75rem; }
  .hc-round-outcome { font-size: .8125rem; }
  .hc-question { padding: 10px 12px 12px; }
  .hc-command { gap: 7px; font-size: .8125rem; }
  .hc-timer { gap: 5px; }
  .hc-countdown { font-size: 1.25rem; }
  .hc-question h2 { font-size: 1.25rem; margin-top: 6px; }
  .hc-question-sub { font-size: .75rem; }
  .hc-session { padding: 7px 12px; gap: 8px; font-size: .75rem; }
  .hc-rail { margin: 10px 12px 0; gap: 6px; }
  .hc-playfield { padding: 12px 12px 0; }
  .hc-code { font-size: .875rem; line-height: 1.5; }
  .hc-line { min-height: 22px; }
  .hc-character { inset: auto 12px 12px; gap: 8px; }
  .hc-bug { min-width: 61px; font-size: 23px; }
  .hc-quip { font-size: .8125rem; }
  .hc-payoff { inset: 62px 12px 10px; }
  .hc-payoff-top { gap: 10px; }
  .hc-rank { font-size: 40px; }
  .hc-points { font-size: .875rem; padding: 4px 6px; }
  .hc-final-bug { font-size: 21px; }
  .hc-payoff-name { font-size: .75rem; }
  .hc-punchline { font-size: .9375rem; }
  .hc-result { padding: 8px 12px; min-height: 48px; font-size: .875rem; }
  .hc-entry { padding: 8px 11px; }
  .hc-entry-label { font-size: .875rem; }
  .hc-login { display: none; }
  .hc-input-row { gap: 8px; }
  #hc-answer { font-size: 1.0625rem; }
  #hackerllion-chain .hc-run { min-width: 72px; padding-inline: 10px; }
  .hc-footer-actions { gap: 16px; }
  .hc-recap-rank { font-size: .75rem; }
  .hc-page-note { display: none; }
  dialog { padding: 18px; }
}

/* A keyboard changes available height, not font legibility. */
#hackerllion-chain.is-compact { padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px); }
.is-compact .hc-screen { gap: 8px; padding-block: 8px; }
.is-compact:not([data-state=ready]) .hc-masthead { display: none; }
.is-compact .hc-question { padding-block: 8px 10px; }
.is-compact .hc-question-sub, .is-compact .hc-page-note { display: none; }
.is-compact .hc-question h2 { font-size: 1.125rem; margin-bottom: 0; }
.is-compact .hc-rounds li { padding-block: 5px; }
.is-compact .hc-entry { padding-block: 5px; }
.is-compact .hc-finale { padding: 14px; }
.is-compact .hc-finale-stamp { margin-bottom: 10px; }
.is-compact .hc-finale-bug { font-size: 28px; margin-bottom: 8px; }
.is-compact .hc-finale h2 { font-size: 1.25rem; margin-bottom: 8px; }
.is-compact .hc-final-score strong { font-size: 3rem; }
.is-compact .hc-final-rank { margin-top: 8px; }
.is-short .hc-chrome { display: none; }
.is-short .hc-screen { padding: 8px 10px; gap: 6px; }
.is-short .hc-question h2 { font-size: 1.0625rem; line-height: 1.25; }
.is-short .hc-question { padding: 7px 10px 10px; }
.is-short .hc-timer-caption { display: none; }
.is-short .hc-prompt-head { min-height: 22px; }
.is-short .hc-entry-head { min-height: 32px; margin: 0; }
.is-short .hc-entry-label { font-size: .8125rem; }
.is-short .hc-round-number { display: none; }
.is-short .hc-login { display: none; }
.is-short .hc-page-note, .is-short footer { display: none; }
.is-short[data-state=ready] .hc-masthead { display: none; }
.is-short .hc-finale { padding: 10px; }
.is-short .hc-finale-stamp { font-size: .6875rem; margin-bottom: 6px; }
.is-short .hc-finale-bug { display: none; }
.is-short .hc-finale h2 { font-size: 1.125rem; margin-bottom: 6px; }
.is-short .hc-final-score strong { font-size: 2.5rem; }
.is-short .hc-final-rank { margin-top: 6px; font-size: .8125rem; }

/* The center can compress independently, without pushing the answer away. */
@container output (max-height: 280px) {
  .hc-game[data-state=result] .hc-code { display: none; }
  .hc-payoff { inset: 8px 12px; }
  .hc-character { inset-block-end: 8px; }
  .hc-memory { margin-top: 6px; }
  .hc-memory span { padding-block: 3px; }
}
@container output (max-height: 210px) {
  .hc-session { min-height: 28px; padding-block: 4px; }
  .hc-rail { margin-top: 7px; }
  .hc-rail li { padding-top: 6px; }
  .hc-game[data-state=running] .hc-character { display: none; }
  .hc-game[data-state=idle] .hc-code { display: none; }
  .hc-game[data-state=idle] .hc-character { inset: 0 12px; }
  .hc-rank { font-size: 32px; }
  .hc-punchline { display: none; }
  .hc-playfield { padding-top: 6px; }
  .hc-result { min-height: 0; padding-block: 6px; }
}
@container output (max-height: 150px) {
  .hc-connection-command { display: none; }
  #hackerllion-chain[data-state=answering] .hc-bug { font-size: 28px; line-height: 1.2; }
  .hc-session-text, .hc-payoff-name { display: none; }
  .hc-game[data-state=result] .hc-rail { display: none; }
  .hc-rail { margin-block: 5px 0; }
  .hc-rail li { padding-top: 4px; }
  .hc-result { max-height: 44px; overflow-y: auto; }
  .hc-result.is-error { max-height: none; }
  .hc-game:has(.hc-result.is-error) .hc-character { display: none; }
  .hc-character .hc-quip { display: none; }
  .hc-payoff { inset-block: 4px; }
  .hc-rank { font-size: 26px; }
  .hc-final-bug { font-size: 16px; }
}
@media (max-width: 360px) {
  .hc-chrome { padding-inline: 12px; }
  .hc-modes, .hc-tools { gap: 12px; }
  .hc-timer-caption { display: none; }
  .hc-rounds li { padding-inline: 2px; }
  .hc-round-number { font-size: .75rem; }
  .hc-round-outcome { font-size: .75rem; }
  .hc-session { gap: 6px; }
  .hc-footer-actions { gap: 10px; }
  #hackerllion-chain:not([data-state=ready]) h1 { font-size: 1.125rem; }
  #hackerllion-chain:not([data-state=ready]) .hc-score { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .hc-entry, .hc-time-track span { transition: none; }
  .hc-summary, .is-entering *, .is-entering *::before, .is-entering *::after { animation: none !important; }
}
