:is(#code-room, .masthead) {
  --paper: var(--se-bg, #f6f2e8);
  --surface: var(--v3-paper, #fffdf6);
  --sheet: #fffdf6;
  --ink: var(--se-ink, #192822);
  --muted: var(--se-muted, #545e53);
  --line: var(--se-border, #d4d4c4);
  --frame: var(--v3-line, #17362c);
  --shadow: var(--v3-shadow, #17362c);
  --soft: var(--se-mint, #e7ecdf);
  --hint-paper: #faead9;
  --hint-text: #52412c;
  --accent-text: #a83826;
  --forest: #172922;
  --forest-deep: #10211c;
  --forest-line: #53665b;
  --mint: #d7e9d5;
  --acid: #bbdf96;
  --red: #d94d32;
  --red-dark: #a83826;
  --orange: #fd7657;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: var(--se-font, "Noto Sans TC", "PingFang TC", system-ui, sans-serif);
  --page-width: var(--v3-page, min(1400px, calc(100% - 2 * max(16px, 4.2vw))));
  --radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

#code-room { padding: 0; }

html.dark #code-room {
  --hint-paper: #442d22;
  --hint-text: #ffd1b5;
  --accent-text: #ff987d;
}

/* The shared site sets generic .wrap, heading and paragraph rules. */
:is(#code-room, .masthead) {
*, *::before, *::after { box-sizing: border-box; }

h1, h2, h3, h4, p { margin: 0; }

button, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }
button:disabled { cursor: default; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--se-focus, var(--red-dark));
  outline-offset: 3px;
}

.masthead :focus-visible,
.board-panel :focus-visible,
.console-panel :focus-visible {
  outline-color: var(--acid);
}

[hidden] { display: none !important; }

.wrap {
  width: var(--page-width);
  margin-inline: auto;
}

&.masthead {
  color: var(--mint);
  background: var(--forest-deep);
  border-bottom: 1px solid #42554a;
}

.masthead-inner {
  min-height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand, .back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand {
  font-weight: 750;
  letter-spacing: .035em;
  color: var(--sheet);
}

.brand-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 30px;
  color: var(--acid);
  font: 700 1rem/1 var(--mono);
}

.brand-icon:empty::before {
  content: "";
  width: 17px;
  height: 21px;
  border: 1.5px solid currentColor;
  border-radius: 52% 48% 46% 46% / 64% 64% 36% 36%;
}

.brand-icon:empty::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  top: 14px;
  left: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor;
}

.brand-icon img,
.brand-icon svg {
  display: block;
  width: 100%;
  height: auto;
}

.back-link {
  color: var(--mint);
  font-size: .875rem;
  font-weight: 650;
}
.back-link:hover { color: white; }

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: var(--page-width);
  margin-inline: auto;
  border: 1.5px solid var(--frame);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow);
  color: var(--sheet);
  background: var(--forest);
}

.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  inset: 0 0 0 37%;
  background-image: radial-gradient(circle, #c9dfa44f 1px, transparent 1.35px);
  background-size: 19px 19px;
  mask-image: linear-gradient(90deg, transparent, #000 80%);
  pointer-events: none;
}

.hero-inner.wrap {
  position: relative;
  width: 100%;
  padding: clamp(16px, 2.5vw, 28px) clamp(16px, 3.25vw, 42px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 6px 38px;
}

.hero-inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 250px;
  height: 250px;
  right: 7%;
  bottom: -154px;
  border: 1px solid #afc59044;
  border-radius: 50%;
  box-shadow: 0 0 0 25px #afc59015, 0 0 0 50px #afc59012, 0 0 0 75px #afc5900d;
  pointer-events: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 3px;
  color: var(--acid);
  font: 650 .8rem/1.4 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 17px;
  height: 2px;
  background: var(--orange);
}

.hero h1 {
  color: var(--sheet);
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  letter-spacing: -.055em;
  line-height: 1.13;
  font-weight: 850;
}

.hero h1 em,
.hero h1 span { color: var(--orange); font-style: normal; }

.hero-copy {
  max-width: 43rem;
  margin-top: 6px;
  color: var(--mint);
  font-size: clamp(.95rem, 1.8vw, 1.0625rem);
}

.hero-status {
  grid-column: 2;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  max-width: 22ch;
  padding: 8px 14px;
  border: 1px solid #6f8472;
  border-radius: 3px;
  background: var(--forest-deep);
  color: var(--mint);
  font: 600 .8125rem/1.5 var(--mono);
  letter-spacing: .085em;
}

.hero-status strong { color: var(--sheet); }

.status-light,
.hero-status::before {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px #bbdf9670;
}

.hero-status:not(:has(.status-light))::before { content: ""; }

.game-shell { padding-block: 19px 14px; }

.mode-bar,
.mode-tabs,
.view-actions,
.stage-bar,
.stage-meta,
.board-actions,
.console-actions,
.clue-tools,
.dialog-actions {
  display: flex;
  align-items: center;
}

.mode-bar {
  justify-content: space-between;
  gap: 10px 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.mode-tabs, .view-actions { flex-wrap: wrap; gap: 7px; }

.mode-button,
.button,
.difficulty-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 730;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.mode-button { background: transparent; color: var(--muted); }

.mode-button:hover,
.button.quiet:hover { background: var(--soft); color: var(--ink); }

.mode-button.is-current,
.mode-button[aria-selected="true"],
.mode-button[aria-pressed="true"] {
  background: var(--forest);
  color: var(--sheet);
  border-color: var(--frame);
  box-shadow: 2px 2px 0 var(--shadow);
}

.button { gap: 6px; }

.button.primary {
  color: white;
  background: var(--red-dark);
  border-color: var(--red-dark);
}
.button.primary:hover:not(:disabled) { background: #882d20; border-color: #882d20; }

.button.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--frame);
}
.button.secondary:hover:not(:disabled) { background: var(--soft); }
.button.quiet { background: transparent; color: var(--muted); }
.button.is-current,
.button.is-active,
.button[aria-pressed="true"] {
  color: var(--forest-deep);
  background: var(--acid);
  border-color: #91ab71;
}
.button:disabled { opacity: .48; }

.difficulty-select {
  padding-right: 12px;
  background: var(--surface);
  border-color: var(--frame);
}

.stage-bar {
  justify-content: space-between;
  gap: 12px 22px;
  padding-block: 12px 17px;
}

.stage-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-text);
  font: 750 .78rem/1.5 var(--mono);
  letter-spacing: .12em;
}

.stage-copy h2 {
  color: var(--ink);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: -.055em;
}

.stage-brief {
  margin-top: 5px;
  max-width: 47rem;
  color: var(--muted);
  font-size: .94rem;
}

.stage-meta {
  justify-content: flex-end;
  flex: none;
  gap: 0;
}

.metric {
  display: flex;
  flex-direction: column;
  padding-inline: 14px;
  min-width: 60px;
  border-left: 1px solid var(--line);
}

.metric:last-child { padding-right: 0; }

.metric :is(span, small, dt, .metric-label) {
  color: var(--muted);
  font: 650 .75rem/1.4 var(--sans);
  white-space: nowrap;
}

.metric :is(strong, dd, output, .metric-value) {
  margin: 0;
  color: var(--ink);
  font: 750 1.16rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.78fr) minmax(285px, 1fr);
  align-items: start;
  gap: 18px;
}

.play-column {
  display: grid;
  gap: 15px;
  min-width: 0;
}

.board-panel,
.console-panel,
.clue-panel {
  min-width: 0;
  padding: clamp(14px, 1.6vw, 20px);
  border: 1.5px solid var(--frame);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow);
}

.board-panel,
.console-panel {
  color: var(--sheet);
  background: var(--forest);
}

.console-panel { background: var(--forest-deep); }
.clue-panel { background: var(--surface); }

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 15px;
  margin-bottom: 11px;
}

.panel-heading h3,
.result-panel h3 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -.03em;
}

.panel-heading h3::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--orange);
}

.panel-heading :is(p, small, .panel-note) {
  font-size: .8125rem;
  color: var(--muted);
}
.board-panel .panel-heading :is(p, small, .panel-note),
.console-panel .panel-heading :is(p, small, .panel-note) { color: var(--mint); }

.signal-board {
  --columns: min(6, var(--card-count, 6));
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: 8px;
}

.signal-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: clamp(72px, 6.6vw, 94px);
  padding: 7px 5px 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  gap: 4px;
  background: #263c32;
  color: var(--sheet);
  border: 1px solid #5e7464;
  border-radius: 5px;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.signal-card:hover:not(:disabled) { background: #334d3f; border-color: var(--acid); }
.signal-card:active:not(:disabled) { transform: translateY(1px); }

.signal-card.is-used {
  border-style: dashed;
  border-color: #617b69;
  background: #192f25;
  color: #b1c3b0;
}
.signal-card.is-used .signal-glyph { opacity: .55; }
.signal-card.is-marked {
  border-color: #718374;
  background: #1d3027;
  color: #b3c0b2;
}
.signal-card.is-marked::after {
  position: absolute;
  content: "";
  left: 8%;
  right: 8%;
  top: 50%;
  border-top: 2px solid var(--orange);
  transform: rotate(-34deg);
  pointer-events: none;
}

.signal-card.is-hint {
  border-color: var(--acid);
  background: #385041;
  box-shadow: inset 0 0 0 1px var(--acid);
}

.signal-key {
  justify-self: start;
  align-self: start;
  margin-left: 3px;
  color: #b7cdb9;
  font: 650 .75rem/1 var(--mono);
  letter-spacing: .035em;
}

.signal-glyph {
  display: inline-block;
  width: 23px;
  height: 23px;
  flex: none;
  line-height: 1;
  color: var(--glyph, currentColor);
}

.signal-glyph:is(.shape-circle, [data-shape="circle"]) { --glyph: #f68d72; }
.signal-glyph:is(.shape-diamond, [data-shape="diamond"]) { --glyph: #f4c474; }
.signal-glyph:is(.shape-triangle, [data-shape="triangle"]) { --glyph: #bede98; }
.signal-glyph:is(.shape-cross, [data-shape="cross"]) { --glyph: #93d3e2; }

.signal-glyph:empty {
  background: currentColor;
}
.signal-glyph:is(.shape-circle, [data-shape="circle"]):empty {
  border-radius: 50%;
  background: transparent;
  border: 3px solid currentColor;
}
.signal-glyph:is(.shape-diamond, [data-shape="diamond"]):empty {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.signal-glyph:is(.shape-triangle, [data-shape="triangle"]):empty {
  clip-path: polygon(50% 2%, 99% 96%, 1% 96%);
}
.signal-glyph:is(.shape-cross, [data-shape="cross"]):empty {
  clip-path: polygon(37% 2%, 63% 2%, 63% 37%, 98% 37%, 98% 63%, 63% 63%, 63% 98%, 37% 98%, 37% 63%, 2% 63%, 2% 37%, 37% 37%);
}

.signal-frequency {
  color: inherit;
  font: 700 1.08rem/1.15 var(--mono);
  font-variant-numeric: tabular-nums;
}

.signal-frequency :is(span, small) {
  color: #b6cbb9;
  font-size: .68em;
  font-weight: 550;
}

.board-actions,
.console-actions,
.clue-tools,
.dialog-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.board-actions,
.console-actions { margin-top: 12px; }

:is(.board-panel, .console-panel) .button.secondary {
  color: var(--sheet);
  background: #2b4237;
  border-color: #64816d;
}
:is(.board-panel, .console-panel) .button.secondary:hover:not(:disabled) {
  background: #3d5848;
  border-color: var(--mint);
}
:is(.board-panel, .console-panel) .button.quiet { color: var(--mint); }
:is(.board-panel, .console-panel) .button.quiet:hover:not(:disabled) { background: #30483b; }
:is(.board-panel, .console-panel) .button:is(.is-current, .is-active, [aria-pressed="true"]) {
  background: var(--acid);
  border-color: var(--acid);
  color: var(--forest-deep);
}
:is(.board-panel, .console-panel) .button:is(.is-current, .is-active, [aria-pressed="true"]):hover {
  background: #d5edaf;
  border-color: #d5edaf;
  color: var(--forest-deep);
}
:is(.board-panel, .console-panel) .button.primary {
  color: #201710;
  background: var(--orange);
  border-color: var(--orange);
}
:is(.board-panel, .console-panel) .button.primary:hover:not(:disabled) {
  background: #ff9479;
  border-color: #ff9479;
}

.code-slots {
  display: flex;
  gap: 8px;
}

.code-slot {
  min-width: 0;
  min-height: 69px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 3px;
  border: 1px dashed #678171;
  border-radius: 5px;
  background: #162c22;
  color: var(--sheet);
  transition: background-color 120ms ease, border-color 120ms ease;
}
.code-slot:hover:not(:disabled) { border-color: var(--mint); }
.code-slot.is-filled {
  background: #2d4538;
  border-color: #708977;
  border-style: solid;
}
.code-slot.is-active,
.code-slot.is-hint {
  border-color: var(--orange);
  border-style: solid;
  box-shadow: inset 0 0 0 1px var(--orange);
}
.code-slot.is-hint {
  border-color: var(--acid);
  box-shadow: inset 0 0 0 1px var(--acid);
}

.slot-index {
  color: #bfd4c2;
  font: 600 .72rem/1.1 var(--mono);
  letter-spacing: .07em;
}
.slot-empty {
  color: #8da694;
  line-height: 1.2;
}
.slot-signal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: 700 1rem/1.1 var(--mono);
}
.slot-signal .signal-glyph {
  width: 15px;
  height: 15px;
}
.slot-signal .shape-circle:empty { border-width: 2px; }

.console-actions { justify-content: flex-end; }
.console-actions .primary { min-width: 125px; }

.clue-panel .panel-heading {
  padding-bottom: 13px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.clue-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.clue-item {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.clue-toggle {
  width: 100%;
  min-height: 52px;
  padding: 9px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 2px;
  text-align: left;
}
.clue-toggle:hover { background: var(--soft); }

.clue-index {
  display: grid;
  place-items: center;
  align-self: start;
  min-width: 27px;
  min-height: 25px;
  padding: 1px 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: var(--paper);
  font: 650 .73rem/1 var(--mono);
}

.clue-text { font-size: .9375rem; line-height: 1.5; }

.clue-state {
  width: 20px;
  height: 20px;
  border: 1px solid #a3aa9b;
  border-radius: 3px;
  color: var(--forest);
  font: 750 .875rem/18px var(--sans);
  text-align: center;
}

.is-checked :is(.clue-index, .clue-state),
.clue-toggle[aria-pressed="true"] :is(.clue-index, .clue-state) {
  color: var(--forest);
  background: #dcebd2;
  border-color: #83a179;
}
.is-checked .clue-state:empty::after,
.clue-toggle[aria-pressed="true"] .clue-state:empty::after { content: "✓"; }

:is(.clue-item, .clue-toggle).is-hint {
  background: var(--hint-paper);
}
.is-hint .clue-index {
  color: #52412c;
  background: #ffdec8;
  border-color: #d68d72;
}

.clue-tools {
  justify-content: space-between;
  margin-top: 13px;
}
.clue-tools .button { padding-inline: 10px; }

.feedback {
  margin-top: 10px;
  min-height: 1.3em;
  color: var(--muted);
  font-size: .875rem;
}
.feedback:empty { display: none; }

:is(.board-panel, .console-panel) .feedback { color: var(--mint); }
.feedback.is-error { color: var(--red-dark); }
:is(.board-panel, .console-panel) .feedback.is-error { color: #ffa98e; }
.feedback.is-success { color: #276044; }
:is(.board-panel, .console-panel) .feedback.is-success { color: var(--acid); }

.result-panel {
  padding: 16px;
  border: 1px solid #829d75;
  border-radius: 5px;
  background: #e4edd8;
  color: var(--forest);
}

.result-panel :where(p) { margin-block: 5px 9px; }

.footer {
  padding-block: 20px 27px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
}

.footer :is(.wrap, .footer-inner) {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 14px;
}

.footer a:hover { color: var(--ink); }

.dialog {
  width: min(634px, calc(100% - 26px));
  max-height: calc(100vh - 26px);
  max-height: calc(100dvh - 26px);
  padding: 0;
  border: 1.5px solid var(--frame);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 75px #0e1c1760;
  overscroll-behavior: contain;
}
.dialog::backdrop { background: #10211cc7; }

.dialog-head,
.dialog-body,
.dialog-actions {
  padding-inline: clamp(14px, 4vw, 25px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 13px;
  color: var(--sheet);
  background: var(--forest);
}
.dialog-head :is(h2, h3) {
  color: var(--sheet);
  font-size: 1.3rem;
  line-height: 1.25;
}
.dialog-head .button.quiet,
.dialog-head .button.secondary { color: var(--sheet); background: #334d3f; border-color: #6a8270; }
.dialog-head :focus-visible { outline-color: var(--acid); }

.dialog-body { padding-block: 14px 17px; }
.dialog-body > * + * { margin-top: 12px; }
.dialog-body :is(ol, ul):not(.level-grid) {
  padding-inline-start: 1.55em;
  line-height: 1.6;
}
.dialog-body :is(ol, ul):not(.level-grid) li + li { margin-top: 7px; }

.dialog-actions {
  justify-content: flex-end;
  padding-block: 11px 15px;
  border-top: 1px solid var(--line);
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.level-button {
  min-height: 60px;
  min-width: 0;
  padding: 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #a7ab9a;
  border-radius: 4px;
  font-size: .88rem;
  line-height: 1.4;
}
.level-button:hover:not(:disabled), .level-button.is-current {
  background: var(--soft);
  border-color: #829d75;
}
.level-button.is-completed { border-color: #829d75; }
.level-button:disabled { opacity: .55; }
.level-button :is(small, span) { color: var(--muted); font-size: .75rem; }
.level-grid > li > .level-button { width: 100%; }

@media (min-width: 980px) {
  .clue-panel { position: sticky; top: 12px; }
}

@media (min-width: 741px) and (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1.45fr) minmax(275px, 1fr); }
  .signal-board { --columns: min(4, var(--card-count, 4)); }
}

@media (max-width: 740px) {
  .masthead-inner { min-height: 56px; }
  .hero-inner.wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-status { display: none; }
  .hero-inner::before { right: -84px; }
  .hero-copy { margin-top: 5px; }
  .game-shell { padding-top: 14px; }
  .mode-bar { flex-wrap: wrap; padding-bottom: 12px; }
  .stage-bar { min-height: 0; padding-block: 15px 16px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .clue-panel { position: static; }
  .signal-board { --columns: min(6, var(--card-count, 6)); }
  .signal-card { min-height: 78px; }
}

@media (max-width: 520px) {
  .signal-board { --columns: min(4, var(--card-count, 4)); }
}

@media (max-width: 470px) {
  .mode-button, .button, .difficulty-select { padding-inline: 10px; }
  .mode-bar { column-gap: 4px; padding-bottom: 9px; }
  .mode-bar :is(.mode-button, .button) { padding-inline: 7px; }
  .mode-tabs, .view-actions { column-gap: 3px; }

  .stage-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }
  .stage-meta { flex-direction: column; align-items: flex-end; gap: 3px; }
  .metric {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .metric :is(strong, dd, output, .metric-value) { font-size: .9rem; }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

.code-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.hero-status :is(strong, small) { display: block; }
.hero-status small { font-size: .65rem; white-space: nowrap; }

.clue-jump.button { display: none; }

.hint-note {
  margin-top: 12px;
  padding: 8px 10px;
  color: var(--hint-text);
  background: var(--hint-paper);
  border-left: 3px solid var(--red);
  font-size: .875rem;
}

.result-panel { margin-top: 13px; }
.result-panel .result-stars {
  margin: 0 0 2px;
  color: #843823;
  font-size: 1.2rem;
  letter-spacing: .16em;
}

.result-panel .console-actions { justify-content: flex-start; }
.dialog textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #a7ab9a;
  border-radius: 4px;
  background: var(--paper);
  font: inherit;
  resize: vertical;
}

.level-chapter + .level-chapter { margin-top: 16px; }
.level-chapter h3 { margin-bottom: 7px; font-size: 1rem; }

@media (min-width: 981px), (min-width: 521px) and (max-width: 740px) {
  .signal-board:has(> :nth-child(7):last-child),
  .signal-board:has(> :nth-child(8):last-child) { --columns: 4; }
  .signal-board:has(> :nth-child(9):last-child),
  .signal-board:has(> :nth-child(10):last-child) { --columns: 5; }
}

@media (min-width: 741px) and (max-width: 980px), (max-width: 520px) {
  .signal-board:has(> :nth-child(9):last-child) { --columns: 3; }
}

@media (max-width: 740px) {
  .clue-jump.button { display: inline-flex; }
  .board-actions .clue-jump { margin-left: auto; }
}

@media (max-width: 350px) {
  .board-panel, .console-panel, .clue-panel { padding: 12px; }
  .board-actions .clue-jump { margin-left: 0; }
}

.signal-unit { margin-inline-start: .2em; }
.level-group + .level-group { margin-top: 16px; }
.level-group-title { margin-bottom: 8px; }
#share-text { width: 100%; resize: vertical; font: inherit; padding: 10px; }
#clue-title, #board-title { scroll-margin-top: 16px; }
}
