@font-face {
  font-family: Montreal;
  font-display: swap;
  src: url('/bpa-challenge/assets/fonts/PPNeueMontreal-Book.woff2');
}
@font-face {
  font-family: Montreal;
  font-weight: 600;
  font-display: swap;
  src: url('/bpa-challenge/assets/fonts/PPNeueMontreal-Medium.woff2');
}
@font-face {
  font-family: Media;
  font-display: swap;
  src: url('/bpa-challenge/assets/fonts/Mediamoure-Regular.woff2');
}
@font-face {
  font-family: Media;
  font-style: italic;
  font-display: swap;
  src: url('/bpa-challenge/assets/fonts/Mediamoure-Italic.woff2');
}
:root {
  --ink: #231f20;
  --paper: #fdfcfb;
  --green: #51b04c;
  --light: #c5e5c3;
  --mid: #a8d8a6;
  --muted: #615e5a;
  --line: #d6dbd2;
  --forest: #193d2b;
  --soft: #eff5eb;
  --display: Media, Georgia, serif;
  font:
    16px Montreal,
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body,
figure,
p,
h1,
h2,
h3 {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a {
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
a {
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid #367533;
  outline-offset: 4px;
}
::selection {
  background: var(--light);
  color: var(--ink);
}
input {
  caret-color: var(--forest);
}
.sitehead {
  border-bottom: 1px solid var(--line);
}
.headinner,
main {
  width: min(1240px, 90%);
  margin-inline: auto;
}
.headinner,
.brand,
.library,
.startrow,
.playhead,
.stats,
.wordmark,
.run-actions {
  display: flex;
  align-items: center;
}
.headinner {
  min-height: 64px;
  justify-content: space-between;
}
.brand,
.library {
  min-height: 44px;
  font-size: 14px;
  gap: 10px;
}
.brand {
  gap: 16px;
}
.brand img {
  width: 50px;
  height: 24px;
  object-fit: contain;
}
.brand > span {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.back-arrow {
  font-style: normal;
}
.library span {
  color: var(--forest);
}
.library:hover,
.brand:hover > span,
.textbutton:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.wordmark {
  font-size: 20px;
  letter-spacing: -0.035em;
  font-weight: 600;
  gap: 9px;
}
.mark {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(3, 6px);
}
.mark i {
  background: var(--green);
}
.mark i:first-child,
.mark i:last-child {
  background: var(--light);
}
.mark i:nth-child(n + 3) {
  grid-column: 2;
}
.mark i:nth-child(3) {
  background: var(--mid);
}
.brand-mark { grid-template-columns: repeat(3, 6px); }
.brand-mark i:nth-child(3) { grid-column: 3; grid-row: 1; }
.brand-mark i:nth-child(4) { background: var(--mid); }
h1,
h2 {
  font: 400 clamp(64px, 7vw, 96px)/0.94 var(--display);
  letter-spacing: -0.04em;
}
h1 {
  margin: 22px 0 16px;
}
h1 em {
  font-weight: 400;
  color: #367533;
}

h3,
.sectionlabel {
  font-size: 14px;
  font-weight: 600;
}

.primary,
.smallbtn,
.power,
dialog button {
  border: 0;
  border-radius: 100px;
  font-weight: 600;
}
.primary {
  color: #f1f9e9;
  background: var(--forest);
  padding: 14px 20px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 32px;
}
.primary span {
  font-size: 22px;
  line-height: 18px;
}
.primary:hover {
  background: #2c5738;
}
.startrow {
  gap: 17px;
  flex-wrap: wrap;
}
.textbutton {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  text-underline-offset: 4px;
}
.music {
  border: 0;
  background: transparent;
  min-height: 44px;
  min-width: 44px;
  padding: 5px 2px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 14px;
}
.music:hover:not(:disabled) [data-music-label] {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.levels {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  height: 16px;
}
.levels i {
  width: 3px;
  height: 7px;
  background: var(--forest);
}
.levels i:nth-child(2) {
  height: 15px;
}
.levels i:nth-child(3) {
  height: 10px;
}
.music[aria-pressed='false'] .levels i {
  height: 3px;
}
.afterword {
  display: grid;
  grid-template-columns: 1fr 1.28fr;
  column-gap: 5%;
  border-top: 1px solid var(--ink);
  padding: 30px 0 48px;
}
.afterword h2 {
  font-size: clamp(32px, 3vw, 46px);
  margin: 0 0 17px;
  line-height: 1;
}
.daily-offer {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
}
.daily-offer p {
  max-width: 34ch;
  line-height: 1.4;
  color: var(--muted);
}
.daily-offer small {
  display: block;
  color: var(--forest);
  margin-top: 8px;
}
.daily-offer button {
  flex: none;
}
.scores #ranking {
  color: var(--muted);
  line-height: 1.45;
  max-width: 35ch;
}
.scoreitem {
  display: grid;
  grid-template-columns: 2ch 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.rank {
  color: var(--muted);
  font-size: 13px;
}
#play {
  max-width: 1210px;
  margin: 16px auto 28px;
}
.arena {
  display: grid;
  grid-template-columns: minmax(155px, 0.8fr) minmax(0, 2fr) minmax(175px, 0.94fr);
  gap: clamp(14px, 2vw, 32px);
  margin-top: 18px;
  align-items: start;
}
.console {
  background: #edf3e9;
  border: 1px solid #cddbc7;
  border-radius: 6px;
  padding: 7px 12px 3px;
  min-width: 0;
}
.film-credit { font-size: 13px; font-weight: 600; color: var(--muted); }
.discover h2 { font: 400 clamp(24px, 2.3vw, 36px)/1.04 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.film-poster {
  display: block;
  width: 100%;
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e6e0dc;
  border-radius: 4px;
  background: #faf6f5;
}
.film-poster img { display: block; width: 100%; height: auto; }
.film-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(48px, 5vw, 66px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #fff9;
  color: white;
  background: #143b29ed;
  box-shadow: 0 3px 16px #14261f33;
}
.film-poster:is(:hover, :focus-visible) .film-play { background: #2d6140; }
.film-play::after {
  content: '';
  margin-left: 4px;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent currentColor;
}
.runtime {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 7px;
  color: white;
  background: #231f20;
  border-radius: 3px;
  font-size: 12px;
}
.film-credit { margin: 12px 0 6px; }
.film-credit span { margin: 0 3px; color: #8b9489; }
.stats .point-total b { font-size: clamp(24px, 2.2vw, 32px); color: var(--forest); }
#speedGoal { margin-top: 8px; color: var(--forest); font-weight: 600; }
#runMode {
  color: var(--muted);
  font:
    400 14px Montreal,
    Arial,
    sans-serif;
  margin-left: 7px;
}
#dailyProgress {
  margin: 8px 0 0;
  color: var(--forest);
  font-weight: 600;
}
.well {
  position: relative;
  box-shadow: 0 3px 12px #14261f23;
}
#board {
  touch-action: none;
  user-select: none;
}
#clearCall {
  color: #cee7c8;
  border-top: 1px solid #aec9a938;
  padding-top: 12px;
  margin-top: 15px;
  font-variant-numeric: tabular-nums;
}
#clearValue, #clearName { display: block; }
#clearValue { font: 400 clamp(28px, 3vw, 46px)/1 var(--display); }
#clearName { margin-top: 4px; font-size: 13px; }
#clearCall.fresh { color: #ffdfaa; }
#personalBest {
  color: var(--forest);
  margin: 6px 0;
}
#shareStatus {
  color: var(--forest);
}
#shareStatus textarea {
  width: min(100%, 430px);
  height: 86px;
  font: inherit;
}
.touchline {
  display: none;
}
.playhead {
  justify-content: space-between;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.stats {
  gap: 18px;
}
.stats span {
  font-size: 13px;
}
.stats b {
  font-size: 18px;
  display: block;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.playhead .wordmark {
  font-family: Montreal, Arial, sans-serif;
}
.run-actions {
  gap: 16px;
}
.smallbtn {
  min-height: 44px;
  border: 1px solid var(--ink);
  padding: 8px 14px;
  background: var(--paper);
}
.station {
  display: flex;
  justify-content: center;
  margin: 15px auto 10px;
  gap: 20px;
  outline: none;
}
.station:focus-visible .well {
  outline: 2px solid #648661;
  outline-offset: 3px;
}
.well {
  background: var(--ink);
  height: min(62dvh, 580px);
  aspect-ratio: 1/2;
}
.well canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.hud {
  width: clamp(142px, 15vw, 180px);
  min-width: 0;
}
.pieces {
  display: flex;
  gap: 12px;
}
.pieces > div {
  flex: 1;
  min-width: 0;
}
.pieces canvas {
  display: block;
  background: var(--ink);
  width: 100%;
  margin-top: 5px;
}
.progress {
  padding: 14px 0 10px;
}
.progress h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
}
.tiles {
  display: flex;
  gap: 3px;
  margin: 8px 0;
}
.tiles i {
  background: #dfdad5;
  height: 7px;
  flex: 1;
}
.tiles i.on {
  background: #367533;
}
.power {
  background: var(--green);
  padding: 11px;
  min-height: 44px;
  width: 100%;
}
.power:disabled {
  background: #f0eae4;
  color: var(--muted);
}
kbd {
  font: inherit;
  font-size: 0.8em;
}
.hud p {
  font-size: 13px;
  line-height: 1.28;
}
.pad {
  display: flex;
  justify-content: center;
  gap: 5px;
}
.pad button {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 44px;
  min-width: 44px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pad button:active {
  background: var(--light);
}
.touchline {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}
@media (pointer: coarse) {
  .touchline {
    display: block;
  }
  .console .keyline {
    display: none;
  }
}
.keyline {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 10px;
}
.sr {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
#results {
  padding: 20px 0 28px;
  max-width: 760px;
}
#results h2 {
  margin: 2px 0 8px;
  font: 400 clamp(34px, 3.8vw, 48px)/1.02 var(--display);
  letter-spacing: -0.025em;
}
#endTitle:focus {
  outline: none;
}
#results p,
#modalBody {
  line-height: 1.45;
}
.result-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.result-kicker {
  font: 600 11px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #367533;
}
.result-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  padding: 8px 0;
  border-block: 1px solid var(--line);
}
.result-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.result-stat span {
  font: 600 11px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-stat strong {
  font: 400 clamp(22px, 2.2vw, 28px)/1.05 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.result-stat--primary strong {
  font-size: clamp(28px, 2.9vw, 38px);
  color: var(--forest);
}
.result-best {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid #c8d8c3;
  color: #367533;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.result-earned {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
}
.result-earned[hidden] {
  display: none;
}
#results .result-earned h3 {
  margin: 0;
  font: 600 11px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
#recap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.recap-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  line-height: 1.2;
}
.recap-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, var(--green));
}
.startrow {
  margin-top: 14px;
}
.result-actions {
  margin-top: 10px;
  gap: 10px 14px;
}
#results #again {
  background: var(--forest);
  color: var(--paper);
  border: 1px solid var(--forest);
  border-radius: 999px;
  padding: 11px 20px;
  min-height: 44px;
  gap: 10px;
  font-weight: 600;
}
#results #again:hover {
  background: #22543a;
  border-color: #22543a;
}
#results #copyResult {
  border-radius: 999px;
  border-color: var(--line);
  padding: 8px 16px;
  font-size: 14px;
}
#results #copyResult:hover {
  border-color: var(--ink);
}
#shareStatus {
  margin-top: 6px;
  font-size: 13px;
  color: #367533;
}
#shareStatus:empty {
  margin: 0;
}
#claim:empty {
  display: none;
}
#claim:not(:empty) {
  margin-top: 10px;
  padding: 11px 14px;
  border: 1px solid var(--green);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--soft);
}
.claim-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.claim-kicker {
  margin: 0;
  font: 600 11px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #367533;
}
.claim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.claim-row label {
  font-weight: 600;
  font-size: 15px;
}
input[type='text'],
input[type='email'] {
  border: 1px solid var(--muted);
  padding: 10px;
  width: 12em;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
#claim .initials-input {
  width: 4.4em;
  min-height: 44px;
  padding: 8px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  font-weight: 600;
  font-size: 17px;
  background: #fff;
}
#claim .initials-input[readonly] {
  background: #f3f1ec;
  border-color: var(--line);
  color: var(--muted);
}
.claim-save {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #367533;
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}
.claim-save:hover:not(:disabled) {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
}
.claim-save:disabled {
  opacity: 0.7;
}
.claim-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.claim-hint:empty {
  margin: 0;
}
.claim-hint[data-tone='error'] {
  color: #b91c1c;
  font-weight: 600;
}
.claim-saved {
  margin: 0;
  color: #367533;
  font-weight: 600;
  font-size: 15px;
}
.result-explore {
  margin-top: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.result-eyebrow {
  margin: 0;
  font: 600 11px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #367533;
}
#results .result-explore h3 {
  margin: 2px 0 8px;
  font: 400 clamp(21px, 2.1vw, 25px)/1.08 var(--display);
  letter-spacing: -0.02em;
}
.result-doors {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 12px;
}
@media (max-width: 640px) {
  .result-doors {
    grid-template-columns: 1fr;
  }
}
.result-door {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  min-width: 0;
}
.result-door:hover {
  border-color: #367533;
  background: var(--soft);
}
.result-door-thumb {
  width: 112px;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #191e2b;
}
.result-door-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.result-door-tag {
  font: 600 10px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #367533;
}
.result-door-body strong {
  font-size: 15px;
  line-height: 1.25;
  color: var(--ink);
}
.result-door-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
}
.result-door:hover .result-door-cta {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-news {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.result-news-preview {
  margin: 0 0 6px;
  font: 600 11px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-news-preview[hidden] {
  display: none;
}
.result-news-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 4px;
}
.result-news-head strong {
  font-size: 14px;
  color: var(--ink);
}
.result-news-audience {
  font: 600 11px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-news-desc {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.35;
  color: #474d49;
}
.result-news-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.result-news-row input[type='email'] {
  flex: 1 1 200px;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
}
.result-news-row input[type='email']:focus {
  border-color: #367533;
}
.result-news-row button {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.result-news-row button:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}
.result-news-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.result-news-status {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
}
.result-news-status:empty {
  margin: 0;
}
.result-news-status[data-tone='ok'] {
  color: #367533;
  font-weight: 600;
}
.result-news-status[data-tone='error'] {
  color: #b91c1c;
  font-weight: 600;
}
.result-news-status a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.result-news-reset {
  margin: 4px 0 0;
  padding: 0;
  min-height: 24px;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.result-news-reset[hidden] {
  display: none;
}
.result-news-note {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.38;
  color: var(--muted);
}
.result-news-note a {
  color: var(--forest);
  text-decoration: underline;
}
.noscript-note {
  max-width: 1120px;
  margin: 12px auto;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.noscript-note a {
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
}
dialog {
  width: min(460px, 91vw);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: clamp(20px, 4vw, 30px);
  max-height: 90dvh;
}
dialog::backdrop {
  background: #231f2099;
}
dialog h2 {
  font-size: clamp(34px, 5vw, 46px);
  margin-bottom: 14px;
}
dialog button {
  margin-top: 18px;
}
.pause-options { display: grid; gap: 10px; }
.pause-options > p { color: var(--muted); font-variant-numeric: tabular-nums; }
.pause-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pause-links button { margin: 0; }
#modal:has(.pause-options) { width: min(365px, 92vw); border-radius: 6px; }
#modal:has(.pause-options) #close { justify-content: center; width: 100%; }
@media (max-height: 460px) {
  #modal:has(.pause-options) { padding: 14px 20px; }
  #modal:has(.pause-options) h2 { font-size: 34px; margin-bottom: 5px; }
  #modal:has(.pause-options) #close { margin-top: 8px; }
  .pause-options { gap: 2px; }
}
.controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 16px;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.controls dt {
  font-weight: 600;
}
.controls dd {
  margin: 0;
}
#modalBody video {
  display: block;
  width: 100%;
  height: min(48dvh, 460px);
  background: #151e17;
  margin: 0 auto 12px;
}
#modal.film-dialog .film-modal p {
  text-align: center;
  margin: 0;
}
#modal.film-dialog #close {
  display: flex;
  justify-content: center;
  width: fit-content;
  margin: 14px auto 0;
}
#modal.film-dialog #close[hidden] {
  display: none;
}
dialog ul {
  padding-left: 18px;
}
dialog li {
  margin: 4px 0;
}

@media (max-width: 700px) {
  .headinner,
  main {
    width: 91%;
  }
  .headinner {
    min-height: 54px;
  }
  .brand {
    gap: 10px;
  }
  .brand span {
    padding-left: 10px;
  }

  .wordmark {
    font-size: 18px;
  }
  h1 {
    font-size: clamp(58px, 12vw, 78px);
    margin: 15px 0 12px;
  }

  .startrow {
    gap: 14px;
  }

  .afterword {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 22px 0 38px;
  }
  .afterword h2 {
    margin-bottom: 13px;
  }
  .discover {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .run-actions {
    gap: 8px;
  }
  .playhead .wordmark {
    font-size: 14px;
  }
  .stats {
    gap: 7px;
  }
  .stats b {
    font-size: 15px;
  }
  .stats span {
    font-size: 11px;
  }
  .station {
    gap: 9px;
  }
  .well {
    width: min(59vw, calc((100dvh - 203px) / 2));
    height: auto;
    align-self: start;
  }
  .hud {
    width: clamp(98px, 29vw, 145px);
  }
  .hud h3 {
    font-size: 14px;
  }
  .hud p {
    font-size: 12px;
  }
  .pieces {
    gap: 5px;
  }
  .pieces canvas {
    max-height: 110px;
  }
  .pad {
    gap: 3px;
    flex-wrap: wrap;
  }
  .pad button {
    padding: 4px;
  }
  .keyline {
    display: none;
  }
  .progress {
    padding-top: 10px;
  }
  .playhead {
    padding: 4px 0;
  }
  .power kbd {
    display: none;
  }
  #play {
    margin: 8px auto;
  }
  .smallbtn {
    padding: 8px 10px;
  }
}

.power {
  touch-action: none;
  user-select: none;
}
@media (max-width: 420px) {
  .playhead .wordmark {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .stats {
    gap: 13px;
  }
  .stats b {
    font-size: 18px;
  }
  .startrow {
    column-gap: 12px;
    row-gap: 1px;
  }
  .startrow .primary {
    gap: 14px;
    padding-inline: 15px;
  }
}
@media (min-width: 701px) and (max-width: 900px) {

  .well {
    width: min(28vw, 31dvh);
    height: auto;
    align-self: start;
  }
  .station {
    gap: 12px;
  }
  .daily-offer {
    display: grid;
  }
}
@media (max-width: 700px) {

  .daily-offer {
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }
  .arena {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
  }
  .console {
    width: 100%;
    padding: 5px 4px 2px;
  }
  .station {
    margin: 4px auto 8px;
    gap: 8px;
  }
  .well {
    width: min(55vw, calc((100dvh - 235px) / 2));
  }
  .hud {
    width: clamp(92px, 28vw, 146px);
  }
  .pieces canvas {
    max-height: 96px;
    object-fit: contain;
  }
  .progress {
    padding: 7px 0;
  }
  .discover {
    width: 100%;
    border-top: 0;
    padding: 0;
  }
}

@media (max-height: 610px) and (orientation: landscape) {
  .well {
    height: min(62dvh, 360px);
    width: auto;
  }
}
@media (max-width: 700px) {

  #clearCall {
    font-size: 14px;
    padding: 4px 2px;
  }
}
@media (min-width: 701px) and (max-width: 1060px) {
  .arena { grid-template-columns: minmax(140px, .8fr) minmax(0, 2.15fr) minmax(135px, .85fr); gap: 12px; }
  .console { padding-inline: 6px; }
  .station { gap: 8px; }
  .well { width: min(58%, 30dvh); height: auto; align-self: start; }
  .hud { width: 36%; }
  .pad { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .arena { gap: 8px; }
  .discover { width: min(100%, 260px); align-self: center; margin-block: 20px; }
  .well { width: min(55vw, calc((100dvh - 325px) / 2)); }
}
@media (max-width: 700px) and (max-height: 650px) {
  .hud { flex: 1; max-width: 165px; }
  .pieces canvas { max-height: 68px; }
}
.expand { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.corners {
  width: 17px;
  height: 17px;
  background: linear-gradient(currentColor,currentColor) left top / 7px 2px,
    linear-gradient(currentColor,currentColor) left top / 2px 7px,
    linear-gradient(currentColor,currentColor) right top / 7px 2px,
    linear-gradient(currentColor,currentColor) right top / 2px 7px,
    linear-gradient(currentColor,currentColor) left bottom / 7px 2px,
    linear-gradient(currentColor,currentColor) left bottom / 2px 7px,
    linear-gradient(currentColor,currentColor) right bottom / 7px 2px,
    linear-gradient(currentColor,currentColor) right bottom / 2px 7px;
  background-repeat: no-repeat;
}
#pocketGoal { display: none; }
.game-expanded .sitehead, .game-expanded .discover { display: none; }
.game-expanded { background: var(--paper); }
.game-expanded main { width: min(96%, 1220px); }
.game-expanded #play { margin-top: max(3px, env(safe-area-inset-top)); }
@media (min-width: 701px) {
  .game-expanded .arena { grid-template-columns: minmax(140px, .6fr) minmax(0, 2fr); }
  .game-expanded .well { height: min(76dvh, 850px, 66vw); width: auto; }
}
#secondChance { max-width: 810px; margin: clamp(20px, 8dvh, 90px) auto; }
.chance-card {
  display: grid; grid-template-columns: minmax(126px, .7fr) minmax(0, 1.45fr);
  gap: clamp(20px, 4vw, 48px); align-items: center;
  padding: clamp(14px, 3vw, 36px); border: 1px solid #c8d8c3; border-radius: 8px; background: var(--soft);
}
.chance-card h2 { font: 400 clamp(40px, 5vw, 72px)/.98 var(--display); margin: 12px 0 16px; }
.chance-card h2:focus { outline: none; }
.chance-score { color: var(--forest); font-weight: 600; font-variant-numeric: tabular-nums; }
.chance-copy { line-height: 1.4; }
.chance-film { margin: 20px 0 12px; font-weight: 600; }
.chance-film span { color: var(--muted); white-space: nowrap; }
.chance-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; }
@media (max-width: 700px) {
  main:has(#play:not([hidden])) { width: 100%; padding-inline: max(4px, env(safe-area-inset-left)) max(4px, env(safe-area-inset-right)); }
  #play { margin-block: 2px 12px; }
  .playhead { padding: 1px 4px; gap: 3px; }
  .playhead .wordmark { display: none; }
  .run-actions { gap: 2px; }
  .run-actions .music { width: 44px; justify-content: center; padding: 0; }
  .run-actions [data-music-label] { display: none; }
  .run-actions .smallbtn { font-size: 12px; padding-inline: 9px; }
  .expand[aria-pressed="true"] #expandLabel { display: none; }
  .expand[aria-pressed="true"]::after { content: 'Exit'; }
  .station:focus-visible .well { outline-offset: -2px; }
  .arena { margin-top: 4px; gap: 4px; }
  .console { padding: 3px 2px; }
  .station { gap: 4px; margin: 0 auto 4px; }
  .well {
    width: min(calc(100% - 59px), calc((100dvh - 260px - env(safe-area-inset-bottom)) / 2));
    height: auto;
  }
  .hud { flex: 0 0 55px; width: 55px; }
  .pieces { display: grid; gap: 5px; }
  .pieces h3 { font-size: 11px; }
  .pieces canvas { height: auto; max-height: none; margin-top: 2px; }
  .progress h3, .progress .tiles, #objective, #speedGoal, #dailyProgress { display: none; }
  #pocketGoal { display: block; font-size: 11px; margin-top: 3px; line-height: 1.2; }
  .pad { gap: 2px; flex-wrap: nowrap; }
  .pad button { flex: 1; min-width: 0; max-width: 66px; min-height: 46px; padding: 0; }
  .touchline { padding: 4px 0; }
  .game-expanded #play { padding-bottom: env(safe-area-inset-bottom); }
  .game-expanded .well { width: min(calc(100% - 59px), calc((100dvh - 208px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2)); }
  .game-expanded .touchline, .game-expanded .keyline { display: none; }
  .chance-card { grid-template-columns: 72px 1fr; padding: 16px; gap: 12px; }
  .chance-card .film-play { width: 42px; }
  .chance-card h2 { font-size: 40px; margin: 8px 0 10px; }
  .chance-film, .chance-copy { font-size: 14px; }
}
@media (max-height: 470px) and (orientation: landscape) and (max-width: 1000px) {
  :root { --landscape-chrome: 144px; }
  :root.game-expanded { --landscape-chrome: 84px; }
  :root .discover { grid-column: 1 / -1; width: min(240px, 65%); justify-self: center; }
  :root main { width: min(97%, 840px); }
  :root .arena { margin-top: 3px; display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 2.5fr); gap: 8px; }
  :root .console { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; }
  :root .station { gap: 6px; margin: 0; }
  :root .well { width: min(calc((100dvh - var(--landscape-chrome) - env(safe-area-inset-bottom)) / 2), 60%); height: auto; }
  :root .hud { flex: 0 0 52px; width: 52px; }
  :root .pieces { display: grid; gap: 3px; }
  :root .pieces canvas { max-height: 74px; object-fit: contain; }
  :root .progress :is(h3, .tiles, #objective, #speedGoal, #dailyProgress) { display: none; }
  :root #pocketGoal { display: block; font-size: 11px; color: inherit; }
  :root .pad { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
  :root .pad button { min-width: 44px; }
  :root .console :is(.keyline,.touchline) { display: none; }
}
.well { border-radius: 4px; }
.well canvas { border-radius: inherit; }
#chancePoster { align-self: center; }
@media (max-width: 700px), (max-height: 470px) and (orientation: landscape) and (pointer: coarse) {
  .console {
    color: #e6f0e5;
    background: #1c332b;
    border-color: #304f3f;
    box-shadow: inset 0 1px #ffffff18, 0 2px 5px #11291c19;
    border-radius: 7px;
  }
  .console .well { box-shadow: 0 0 0 1px #a5cab12e; }
  .console .pieces h3 {
    color: #c1d8bf;
    font: 600 10px/1.4 Montreal, sans-serif;
    text-transform: uppercase;
    letter-spacing: .07em;
  }
  .console .pieces canvas { border-radius: 3px; box-shadow: 0 1px #a5cab12e; }
  .console #pocketGoal, .console #speedGoal, .console .touchline { color: #c5d9ca; }
  .pad button {
    color: #f0f6eb;
    background: #304d40;
    border: 1px solid #526b5a;
    box-shadow: inset 0 1px #ffffff15, inset 0 -2px #132d20;
    -webkit-tap-highlight-color: transparent;
  }
  .pad button[data-act="drop"] {
    background: #bce795;
    color: #102b20;
    font-weight: 600;
    border-color: #c9ecab;
    box-shadow: inset 0 1px #e5fbc9, inset 0 -2px #79a95e;
  }
  .pad button:active { box-shadow: inset 0 2px 4px #10271c55; }
  .run-actions .corners { width: 19px; height: 19px; }

}
.chance-card { grid-template-areas: "poster heading" "poster film" "poster actions"; row-gap: 14px; }
#chancePoster { grid-area: poster; }
.chance-heading { grid-area: heading; align-self: end; }
.chance-film { grid-area: film; margin: 0; }
.chance-film small { display: block; margin-bottom: 5px; color: var(--muted); font-weight: 400; }
.chance-film strong { display: block; }
.chance-actions { grid-area: actions; align-self: start; }
@media (max-width: 700px) {
  #secondChance { margin: clamp(14px, 5dvh, 38px) auto; }
  .chance-card {
    grid-template-areas: "heading heading" "poster film" "actions actions";
    grid-template-columns: minmax(84px, .72fr) minmax(0, 1fr);
    padding: clamp(14px, 5vw, 24px); gap: 14px;
  }
  .chance-film strong { font: 400 clamp(23px,6.6vw,34px)/1.02 var(--display); }
  .chance-actions { border-top: 1px solid #c8d8c3; padding-top: 13px; }
}
.clip-earned #chancePoster .film-play::after {
  width: 14px; height: 7px; margin: -3px 0 0; border: solid white;
  border-width: 0 0 3px 3px; transform: rotate(-45deg);
}
.motion-setting { display: flex; align-items: center; gap: 8px; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  .motion-setting { display: none; }
}
.motion-setting input { width: 18px; height: 18px; accent-color: var(--forest); }
.console {
  color: #f5f2e8;
  background: var(--night-surface);
  border-color: #424655;
  box-shadow: inset 0 1px #ffffff20, 0 4px 16px #15182418;
}
.console .well { box-shadow: 0 0 0 1px #8e94ae70, 0 4px 14px #0a0d1848; }
.console .pieces canvas { background: #101522; }
.console .keyline, .console .touchline { color: #c9cbd8; }
.console .pad button { background: #303444; color: #f5f2e8; border-color: #606577; box-shadow: inset 0 -2px #1c202e; }
.console .pad button:active { background: #414658; }
.console .pad button[data-act="drop"] { background: var(--light); color: #132b1a; border-color: #c2debb; }
.console :is(#dailyProgress, #speedGoal) { color: #c3e8a4; }
.console .tiles i { background: #405448; }
.console .tiles i.on { background: #bce795; }
@media (min-width: 701px) and (min-height: 471px) {
  .console { border-radius: 9px; }
  .station { gap: clamp(13px, 1.65vw, 24px); }
  .hud {
    display: flex; flex-direction: column;
    padding: 2px 4px 6px;
  }
  .hud .pieces { display: grid; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid #b8d3bf38; }
  .pieces h3 {
    font: 600 10px/1.4 Montreal, sans-serif;
    text-transform: uppercase;
    letter-spacing: .095em;
    color: #c5d6c7;
  }
  .pieces > div:first-child { display: flex; justify-content: space-between; align-items: center; }
  .pieces canvas { margin-top: 6px; border-radius: 3px; box-shadow: inset 0 0 0 1px #a2c5a130; }
  .pieces #hold { width: 52%; max-width: 78px; margin: 0; }
  .pieces #next { width: min(100%, 15dvh, 158px); height: auto; margin: 9px auto 0; }
  .progress { padding: 18px 0 0; }
  .progress h3 { font-size: clamp(22px, 2.4vw, 36px); line-height: 1.03; margin: 7px 0 11px; }
  .progress .tiles { margin: 0 0 9px; gap: 4px; }
  .progress .tiles i { height: 4px; }
  #speedGoal { margin-top: 10px; }
  #clearCall { margin-top: auto; }
  .progress:has(+ #clearCall:not([hidden])) { padding-bottom: 10px; }

}
@media (max-width: 700px), (max-height: 470px) and (orientation: landscape) {
  #clearCall:not(.fresh) { display: none; }
  .hud { position: relative; }
  #clearCall.fresh {
    position: absolute; left: 0; right: 0; margin: 0; padding: 4px 1px;
    background: #173229; color: #ffdfaa; text-align: center;
  }
  #clearValue { font: 600 13px/1.1 Montreal, sans-serif; }
  #clearName { font-size: 10px; line-height: 1.16; margin-top: 2px; }
}

/* The playing field, collection and film share one reading direction. */
.run-title { min-width: 0; }
.run-title h2 { margin: 0; font: 600 19px/1.15 Montreal, sans-serif; letter-spacing: -.04em; }
#runMode { font-size: 12px; color: var(--forest); }
.card-rail { display: grid; min-width: 0; }
.card-stack { list-style: none; display: grid; grid-auto-rows: 1fr; gap: clamp(12px, 1.1vw, 18px); margin: 0; padding: 0; }
.power-card {
  --card-paper: #f1e3cc;
  --card-ink: #5c4229;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 7px; min-height: 143px; padding: 15px clamp(15px, 1.25vw, 20px);
  color: #332f28; background: #f7f5ee;
  border: 1px solid #d8d2c5; border-radius: 5px;
}
.card-status { display: block; font-size: 12px; font-weight: 600; line-height: 1.3; }
.card-status::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border: 1px solid #72816d; }
.power-card[data-power=tclear] { --card-paper: #dfe9ed; --card-ink: #304e5c; }
.power-card[data-power=explore] { --card-paper: #e9e2ee; --card-ink: #584566; }
.power-card[data-power=scatter] { --card-paper: #e3edda; --card-ink: #2d5039; }
.power-card h3 { margin: 0; font: 400 clamp(19px, 1.6vw, 25px)/1.1 var(--display); letter-spacing: -.015em; }
.power-card p { margin: 0; font-size: 14px; line-height: 1.38; }
.power-card.collected {
  background: var(--card-paper); color: var(--card-ink);
  border-color: color-mix(in srgb, var(--card-ink) 33%, white);
}
.collected .card-status::before {
  width: 9px; height: 5px; border: solid #2d663a; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg);
}
.power-name { font: inherit; letter-spacing: inherit; text-align: left; border: 0; padding: 0; color: inherit; background: transparent; }
.power-name:hover, .power-name:focus-visible { text-decoration: underline; text-underline-offset: .12em; }
.power-card .card-action {
  border: 1px solid var(--card-ink); background: transparent; color: inherit; border-radius: 4px;
  min-height: 44px; padding: 6px 12px; font: 600 14px Montreal, sans-serif; margin: auto 0 0;
}
.card-action:enabled:hover, .card-action:enabled:focus-visible { background: var(--card-ink); color: white; }
.card-action:disabled { border-color: transparent; padding-inline: 0; }
#modal:has(.card-book)[open] { display: flex; flex-direction: column; }
#modal:has(.card-book) #modalBody { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
#modal:has(.card-book) #close { flex-shrink: 0; align-self: start; }
#modalTitle:focus { outline: none; }
.card-book > h3 { margin: 20px 0 9px; font: 400 24px/1.1 var(--display); }
.card-book ol { padding: 0; }
.card-book .power-card p { margin: 5px 0 0; }

@media (min-width: 701px) and (min-height: 471px) {
  .arena > :is(.console, .card-rail) { align-self: stretch; }
  .arena > .console { display: flex; flex-direction: column; justify-content: center; }
  .card-rail .power-card { justify-content: center; min-height: 0; }
  .card-rail .card-status { margin-bottom: auto; }
  .card-rail .power-card p { margin-bottom: auto; }
  .card-rail .card-action { margin-top: 0; }
  .arena { grid-template-columns: minmax(0, 2.15fr) minmax(180px, .94fr) minmax(160px, .84fr); }
  .game-expanded .arena { grid-template-columns: minmax(0, 2.2fr) minmax(210px, .88fr); }
  .game-expanded .well { height: min(76dvh, calc(100dvh - 235px), 850px); }
  .console { padding-block: 12px 15px; }
  .station { margin: 8px auto 0; }
  .console .pad { gap: clamp(6px, .65vw, 11px); margin: 23px auto 12px; }
  .pad button { min-width: 46px; min-height: 46px; }
  .pad :is([data-act=ccw],[data-act=soft]) { margin-left: 4px; }
  .console .keyline { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px 13px; padding: 0 4px; font-size: 12px; }
  .keyline span { white-space: nowrap; }
  .keyline kbd { font: inherit; color: #eff6e9; font-weight: 600; }
  .progress { padding: 0; }
  #speedGoal { font-size: 13px; }
}
@media (min-width: 701px) and (max-width: 1040px) and (min-height: 471px) {
  .arena { grid-template-columns: minmax(0, 2fr) minmax(205px, 1fr); }
  .discover { grid-column: 2; width: min(100%, 245px); }
  .console .hud { width: min(28%, 150px); }
}
@media (max-width: 700px), (max-height: 470px) and (max-width: 1000px) and (orientation: landscape) {
  .card-rail { width: 100%; }
  .card-rail .card-stack { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
  .card-rail .power-card { position: relative; justify-content: center; gap: 3px; padding: 5px 7px; min-height: 48px; }
  .card-rail .power-card h3 { font: 600 13px/1.12 Montreal, sans-serif; }
  .card-rail .power-card :is(p, .card-action, .card-kind) { display: none; }
  .card-rail .card-status { font-size: 11px; }
  .card-rail .power-name::after { content: ''; position: absolute; inset: 0; }
  .card-rail .power-card:focus-within { outline: 2px solid var(--forest); }
}
@media (max-width: 700px) {
  .playhead { display: grid; grid-template-columns: 1fr auto; gap: 0 5px; padding-top: 3px; }
  .run-title { grid-column: 1/-1; display: flex; align-items: baseline; gap: 7px; }
  .run-title h2 { font-size: 14px; }
  #runMode { font-size: 12px; }
  .arena .card-rail { order: -1; min-height: 48px; }
  .console .pad { gap: clamp(2px, 1.1vw, 6px); padding-inline: 3px; margin: 14px 0 6px; }
  .game-expanded .console { padding-bottom: 5px; }
}
@media (max-width: 360px) and (orientation: portrait) {
  main:has(#play:not([hidden])) { width: 100%; padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
  .console .pad { gap: 1px; padding: 0; }

}
@media (max-height: 470px) and (max-width: 1000px) and (orientation: landscape) {
  :root .arena { grid-template-columns: minmax(0, 2.7fr) minmax(122px, 1fr); }
  :root .arena .card-rail { grid-column: 2; grid-row: 1; align-self: stretch; }
  .card-rail .card-stack { grid-auto-flow: row; }

  :root .discover { grid-column: 2; }
  :root .console .pad { margin: 0; padding-inline: 2px; gap: 5px; }
}

/* A card token in flight from the board to the card rail. */
.power-token {
  position: fixed; z-index: 40; width: 22px; height: 22px; pointer-events: none;
  border-radius: 4px; background: var(--accent); border: 2px solid #fffbe9;
  box-shadow: 0 0 14px 3px var(--accent), 0 0 36px var(--accent);
}
/* The stack is close to the top: the well breathes a warm warning. */
@keyframes well-danger {
  0%, 100% { box-shadow: 0 0 0 1px #ff9e7a66, 0 0 10px #ff8a6022; }
  50% { box-shadow: 0 0 0 2px #ffb08acc, 0 0 28px #ff8a6066; }
}
.well.danger { animation: well-danger 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .well.danger { animation: none; box-shadow: 0 0 0 2px #ffb08acc; }
}

/* A ready power that has waited too long: a light runs around the card's border and its key taps. */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes card-sweep { to { --sweep: 360deg; } }
@keyframes card-call {
  0%, 100% { box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
  50% { box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); }
}
@keyframes key-tap { 0%, 60%, 100% { transform: none; } 75% { transform: translateY(-3px); } }
#play .power-card.collected.nudge {
  margin: -1px; border: 2px solid transparent;
  background:
    linear-gradient(color-mix(in srgb, #1b2030 88%, var(--accent)), color-mix(in srgb, #1b2030 88%, var(--accent))) padding-box,
    conic-gradient(from var(--sweep), color-mix(in srgb, var(--accent) 30%, transparent) 0 62%, var(--accent) 80%, #fffbe9 86%, var(--accent) 92%, color-mix(in srgb, var(--accent) 30%, transparent)) border-box;
  animation: card-sweep 2.2s linear infinite, card-call 2.2s ease-in-out infinite;
}
#play .power-card.nudge .card-action kbd { display: inline-block; animation: key-tap 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  #play .power-card.nudge, #play .power-card.nudge .card-action kbd { animation: none; }
}

/* Leaderboard below the title (dark) and beside results (light vertical panel). */
.afterword { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); row-gap: 28px; }
.scores #ranking { max-width: none; }
.scores-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 14px; }
.afterword .scores-head h2 { margin: 0; }
.scores-head p { margin: 0; color: var(--muted); font-size: 14px; }
.score-list { margin: 0; padding: 0; list-style: none; columns: 2 230px; column-gap: 40px; }
.score-list .scoreitem { break-inside: avoid; align-items: center; min-height: 44px; padding-block: 4px; border-top: 1px solid var(--line); border-bottom: 0; }
.score-list .scoreitem span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-list .scoreitem strong { font: 400 20px/1 var(--display); }
.score-list .podium .rank { color: var(--forest); font-weight: 600; }
.score-player { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.you-pill, .best-new-pill { display: none; }
.best-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.best-card { align-self: start; padding: 20px; border: 1px solid var(--line); border-radius: 6px; }
#extras #bestTitle { margin: 0; font: 600 11px/1.2 Montreal, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.best-score { margin: 8px 0 0; font: 400 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.best-meter { display: block; margin-top: 16px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.best-meter i { display: block; height: 100%; background: var(--green); }
.best-note { margin: 10px 0 14px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.best-note strong { color: var(--forest); font-weight: 600; }
@media (max-width: 700px) {
  .afterword { grid-template-columns: 1fr; }
}
/* The best card spans exactly the rows of the score list on the title screen. */
@media (min-width: 701px) {
  .afterword { grid-template-rows: auto auto; row-gap: 0; align-items: start; }
  .afterword .scores { grid-row: 1 / span 2; display: grid; grid-template-rows: subgrid; }
  .afterword .best-card { grid-row: 2; align-self: stretch; display: flex; flex-direction: column; padding-block: 18px; }
  .afterword .best-card .smallbtn { align-self: flex-start; margin-top: auto; }
}

/* Game Over: unified 2-column desktop layout with vertical Top 10 + Your Best on the right. */
main:has(#results:not([hidden])) {
  padding: clamp(12px, 1.8dvh, 24px) 0 clamp(20px, 2.5dvh, 32px);
}
main:has(#results:not([hidden])) #results {
  padding: 0;
  max-width: none;
}
main:has(#results:not([hidden])) #extras {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 20px;
}
main:has(#results:not([hidden])) #extras .scores {
  display: block;
}
main:has(#results:not([hidden])) #extras .scores-head {
  margin-bottom: 10px;
  gap: 4px 12px;
}
main:has(#results:not([hidden])) #extras .scores-head h2 {
  font-size: 24px;
}
main:has(#results:not([hidden])) #extras .scores-head p {
  font-size: 12px;
}
main:has(#results:not([hidden])) #extras .score-list {
  columns: 1;
}
main:has(#results:not([hidden])) #extras .score-list .scoreitem {
  min-height: 34px;
  padding: 4px 6px;
}
main:has(#results:not([hidden])) #extras .score-list .scoreitem strong {
  font-size: 18px;
}
main:has(#results:not([hidden])) .score-list .scoreitem.is-you {
  background: var(--soft);
  border-radius: 4px;
}
main:has(#results:not([hidden])) .score-list .scoreitem.is-you .you-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font: 600 10px/1 Montreal, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
main:has(#results:not([hidden])) #extras .best-card {
  align-self: stretch;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0 0;
  margin-top: 12px;
  background: transparent;
}
main:has(#results:not([hidden])) .best-card[data-new-best='true'] .best-new-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid #c8d8c3;
  color: #367533;
  font: 600 10px/1.2 Montreal, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
main:has(#results:not([hidden])) #extras .best-score {
  font-size: 28px;
  margin-top: 4px;
}
main:has(#results:not([hidden])) #extras .best-meter {
  margin-top: 10px;
}
main:has(#results:not([hidden])) #extras .best-note {
  margin: 8px 0 0;
  font-size: 13px;
}
main:has(#results:not([hidden])) #extras #bestPlay {
  display: none;
}
@media (min-width: 960px) {
  main:has(#results:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(290px, 0.88fr);
    gap: clamp(20px, 2.8vw, 40px);
    align-items: start;
  }
  main:has(#results:not([hidden])) #extras {
    margin-top: 0;
  }
}
/* Medium desktop height tier (e.g. 1280x800): keeps thumbs/earned visible while compacting newsletter vertical rhythm. Placed before the <=780px/narrow tier so shorter tiers always win. */
@media (min-width: 960px) and (max-height: 840px) {
  .result-explore {
    margin-top: 10px;
    padding: 10px 14px;
  }
  .result-news {
    margin-top: 6px;
    padding-top: 6px;
  }
  .result-news-head {
    margin-bottom: 3px;
  }
  .result-news-desc {
    margin: 0 0 5px;
    font-size: 12.5px;
    line-height: 1.3;
  }
  .result-news-note {
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.3;
  }
}
/* Deterministic collapse rules for short or narrow desktop viewports on Game Over (1280x720, 1024x768, <=780px height). */
@media (min-width: 960px) and (max-height: 780px), (min-width: 960px) and (max-width: 1120px) {
  main:has(#results:not([hidden])) {
    padding: 10px 0 14px;
  }
  #results h2 {
    margin: 2px 0 6px;
    font-size: clamp(30px, 3.4vw, 40px);
  }
  .result-stats {
    padding: 6px 0;
  }
  .result-stat--primary strong {
    font-size: clamp(26px, 2.6vw, 34px);
  }
  .result-stat strong {
    font-size: 22px;
  }
  .result-earned {
    display: none;
  }
  .result-actions {
    margin-top: 8px;
  }
  #claim:not(:empty) {
    margin-top: 8px;
    padding: 8px 12px;
  }
  .claim-form {
    gap: 4px;
  }
  .claim-row {
    gap: 8px;
  }
  .claim-row label {
    font-size: 14px;
  }
  .claim-hint {
    font-size: 12px;
    line-height: 1.25;
  }
  .result-explore {
    margin-top: 10px;
    padding: 10px 14px;
  }
  #results .result-explore h3 {
    margin: 2px 0 6px;
    font-size: 20px;
  }
  .result-door-thumb {
    display: none;
  }
  .result-doors {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .result-door {
    padding: 8px 10px;
  }
  .result-door-body strong {
    font-size: 14px;
  }
  .result-news {
    margin-top: 6px;
    padding-top: 6px;
  }
  .result-news-head {
    margin-bottom: 3px;
  }
  .result-news-desc {
    margin: 0 0 5px;
    font-size: 12px;
    line-height: 1.28;
  }
  .result-news-status {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.25;
  }
  .result-news-note {
    margin-top: 3px;
    font-size: 11.5px;
    line-height: 1.28;
  }
  main:has(#results:not([hidden])) #extras {
    padding: 14px 16px;
  }
  main:has(#results:not([hidden])) #extras .score-list .scoreitem {
    min-height: 30px;
    padding-block: 3px;
  }
  main:has(#results:not([hidden])) #extras .best-card {
    padding-top: 10px;
    margin-top: 8px;
  }
  main:has(#results:not([hidden])) #extras .best-score {
    font-size: 24px;
  }
}

/* Second chance: 2-column desktop layout (One more try? on the left, 4 power lessons on the right). */
.chance-card { grid-template-areas: "poster heading" "poster film" "poster actions" "rank rank"; }
.chance-rank { grid-area: rank; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 12px 14px; border: 1px solid #c8d8c3; border-radius: 6px; background: var(--paper); }
.chance-rank[hidden] { display: none; }
.chance-rank > div:first-child { flex: 1 1 200px; }
.chance-rank-label { margin: 0; font: 600 11px/1.2 Montreal, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #367533; }
#chanceRankText { margin: 4px 0 0; font-size: 14px; line-height: 1.35; }
.chance-rank-meter { flex: 1 1 150px; display: flex; flex-direction: column; gap: 5px; }
.chance-rank-meter > span { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.chance-rank-meter i { display: block; height: 100%; background: var(--green); }
.chance-rank-meter small { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chance-lessons { margin-top: 28px; }
.chance-lessons-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 4px 16px; }
.chance-lessons h2 { margin: 0; font: 400 clamp(24px, 2.4vw, 32px)/1.04 var(--display); letter-spacing: -.02em; }
.chance-lessons-head p { margin: 6px 0 0; max-width: 44ch; color: var(--muted); font-size: 14px; line-height: 1.4; }
.chance-lessons a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--forest); font-weight: 600; font-size: 14px; text-underline-offset: 3px; }
.chance-lessons a:hover { text-decoration: underline; }
.lesson-cards { margin: 14px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr; gap: 10px; }
.lesson-cards li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; background: #fff; transition: border-color .15s, background-color .15s; }
.lesson-cards li:hover { border-color: #367533; background: var(--soft); }
.lesson-cards li:has(a:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px; }
.lesson-card--sample { background: var(--soft); border-color: #c8d8c3; }
.lesson-card-main { min-width: 0; flex: 1; }
.lesson-tag { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 600 11px/1.25 Montreal, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: #367533; }
.lesson-tag span + span { color: var(--muted); }
.lesson-tag .lesson-open-badge { color: #367533; background: #fff; border: 1px solid #c8d8c3; border-radius: 999px; padding: 1px 7px; font-size: 10px; }
.lesson-cards h3 { margin: 4px 0 2px; font: 400 20px/1.1 var(--display); }
.lesson-cards li p:not(.lesson-tag) { margin: 0; color: #3b3735; font-size: 13px; line-height: 1.38; }
.lesson-cards a { flex-shrink: 0; white-space: nowrap; min-height: 44px; padding: 0 2px; }
.lesson-cards a::after { content: ''; position: absolute; inset: 0; }
@supports selector(:has(*)) {
  .lesson-cards a:focus-visible { outline: none; }
}
.lesson-cards li:hover a { text-decoration: underline; }
@media (min-width: 960px) {
  #secondChance {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.98fr);
    gap: clamp(20px, 2.5vw, 36px);
    align-items: start;
    max-width: 1200px;
    margin: clamp(16px, 3dvh, 32px) auto clamp(24px, 4dvh, 44px);
  }
  .chance-card {
    grid-template-columns: minmax(112px, 160px) minmax(0, 1fr);
    gap: 14px 24px;
    padding: clamp(18px, 2.2vw, 28px);
  }
  .chance-card h2 {
    font-size: clamp(34px, 3.6vw, 54px);
    margin: 8px 0 10px;
  }
  .chance-film {
    margin: 0;
  }
  .chance-lessons {
    margin-top: 0;
  }
}
@media (min-width: 960px) and (max-width: 1120px), (min-width: 960px) and (max-height: 760px) {
  #secondChance {
    margin: 12px auto 18px;
    gap: 18px;
  }
  .chance-card {
    grid-template-columns: minmax(96px, 124px) minmax(0, 1fr);
    gap: 10px 18px;
    padding: 16px 18px;
  }
  .chance-card h2 {
    font-size: clamp(28px, 3vw, 38px);
    margin: 4px 0 6px;
  }
  .chance-copy {
    font-size: 14px;
  }
  .chance-actions {
    gap: 8px 12px;
  }
  .chance-actions .primary {
    padding: 10px 16px;
    min-height: 44px;
  }
  .chance-rank {
    padding: 10px 12px;
  }
  .chance-lessons h2 {
    font-size: 24px;
  }
  .chance-lessons-head p {
    margin-top: 4px;
    font-size: 13px;
  }
  .lesson-cards {
    margin-top: 10px;
    gap: 8px;
  }
  .lesson-cards li {
    padding: 9px 12px;
    gap: 10px;
  }
  .lesson-cards h3 {
    font-size: 18px;
  }
  .lesson-cards li p:not(.lesson-tag) {
    font-size: 12.5px;
    line-height: 1.32;
  }
  .lesson-cards a {
    min-height: 36px;
    font-size: 13px;
  }
}
@media (max-width: 700px) {
  .chance-card { grid-template-areas: "heading heading" "poster film" "actions actions" "rank rank"; }
  .lesson-cards li { flex-direction: column; align-items: flex-start; gap: 6px; }
  .lesson-cards a { min-height: 40px; }
}
