:root {
  --asphalt: #161615;
  --asphalt-2: #232321;
  --asphalt-3: #33332f;
  --signal: #ffd100;
  --signal-deep: #e0b400;
  --white: #f8f7f2;
  --muted: #c4c2b8;
  --ink: #111110;
  --stop: #ff6a4d;
  --sign: "DIN Alternate", "Bahnschrift", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --edge: 16px;
  --stripe: 0px;
}

.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 22px; max-width: none; margin: 0; border: 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

.game-note, .site-footer { max-width: 34rem; margin: 22px auto 0; }
.game-note h2 { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.2; }
.game-note p { margin: 0; color: var(--muted); line-height: 1.5; }
.game-note a, .site-footer a { color: var(--signal); }
.site-footer { margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--asphalt-3); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.page { margin: 0; min-height: 100dvh; background: var(--asphalt); color: var(--white); font-family: var(--sign); padding-top: 12px; padding-left: var(--edge); padding-right: var(--edge); }
body.page :focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }
body.page { font-weight: 400; font-size: 17px; line-height: 1.6; padding-bottom: 28px; --stripe: 0px; }
body.page::before, body.page::after {
  content: ""; position: fixed; top: 0; bottom: 0; width: var(--stripe);
  background: repeating-linear-gradient(135deg, var(--signal) 0 34px, var(--asphalt) 34px 68px);
}
body.page::before { left: 0; }
body.page::after { right: 0; transform: scaleX(-1); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 42rem; margin: 0 auto; }
.page-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.page-head .mark { display: block; flex: none; width: 46px; height: 46px; }
.wordmark {
  padding: 7px 10px 6px; background: var(--signal); color: var(--ink); border: 3px solid var(--ink);
  border-radius: 10px; box-shadow: 0 0 0 3px var(--signal);
  font-size: clamp(1rem, 4.6vw, 1.3rem); font-weight: 700; line-height: 1; white-space: nowrap;
}
.page-play { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--signal); font-weight: 700; }
.prose { max-width: 42rem; margin: 20px auto 0; overflow-wrap: anywhere; }
.prose h1 { margin: 0 0 12px; font-size: 2rem; line-height: 1.12; font-weight: 700; }
.prose h2 { margin: 30px 0 6px; padding-top: 12px; border-top: 3px solid var(--signal); color: var(--signal); font-size: 1.32rem; line-height: 1.2; }
.prose h3 { margin: 20px 0 2px; font-size: 1.08rem; line-height: 1.3; }
.prose p, .prose ul, .prose ol { margin: 8px 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 5px 0; }
.prose a { color: var(--signal); }
.updated { color: var(--muted); }
.back { margin-top: 28px !important; }
body.page .site-footer { max-width: 42rem; margin-top: 18px; }
@media (min-width: 960px) {
  body.page { --stripe: 72px; padding-left: 112px; padding-right: 112px; padding-top: 26px; }
  .game-note, .site-footer { max-width: 60rem; }
}
@media (min-width: 960px) and (max-width: 1140px) {
  body.page { --stripe: 28px; padding-left: 56px; padding-right: 56px; }
}

/* Retention: end panel, challenge notes, stats dialog */
.rt-title { margin: 0; font-size: 1.5rem; line-height: 1.12; }
.rt-detail { margin: 4px 0 6px; font-weight: 700; }
.rt-line, .rt-countdown { margin: 2px 0 8px; }
.rt-verdict { margin: 2px 0 6px; font-size: 1.1rem; font-weight: 700; }
.rt-versus { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.rt-versus div { padding: 6px 8px; background: var(--rt-tile); color: var(--rt-tile-ink); border-radius: var(--rt-radius); }
.rt-versus dt { font-size: .8rem; }
.rt-versus dd { margin: 0; font-weight: 700; }
.rt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px; background: var(--rt-btn); color: var(--rt-btn-ink); border: 0; border-radius: var(--rt-radius); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.rt-primary { display: flex; width: 100%; min-height: 52px; font-size: 1.15rem; margin: 4px 0 8px; }
.rt-quiet { background: transparent; color: inherit; border: 2px solid currentColor; min-height: 44px; font-weight: 600; }
.rt-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.rt-row > .rt-btn { flex: 1 1 8rem; }
.rt-row--quiet:empty { display: none; }
.rt-challenge { margin-bottom: 8px; }
.rt-name, .rt-manual, .rt-code { display: block; width: 100%; padding: 8px; background: var(--rt-field); color: var(--rt-field-ink); border: 2px solid currentColor; border-radius: var(--rt-radius); font: inherit; font-size: 16px; }
.rt-sendto { display: flex; gap: 8px; margin-top: 8px; }
.rt-sendto[hidden] { display: none; }
.rt-sendto > * { flex: 1 1 0; }
.rt-status { margin: 0; min-height: 1.2em; font-weight: 700; }
.rt-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 8px; padding: 8px 10px; background: var(--rt-tile); color: var(--rt-tile-ink); border-radius: var(--rt-radius); font-weight: 700; }
.rt-note span { flex: 1 1 10rem; }
.rt-note-play { min-height: 40px; padding: 0 12px; background: var(--rt-btn); color: var(--rt-btn-ink); border: 0; border-radius: var(--rt-radius); font: inherit; font-weight: 700; cursor: pointer; }
.rt-note-close { min-width: 40px; min-height: 40px; background: none; border: 0; color: inherit; font-size: 1.3rem; cursor: pointer; }
.rt-dialog { width: min(32rem, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 14px; background: var(--rt-sheet); color: var(--rt-sheet-ink); border: 3px solid var(--rt-btn); border-radius: var(--rt-radius); overflow-y: auto; }
.rt-dialog::backdrop { background: #0009; }
.rt-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rt-dialog h2 { margin: 0; font-size: 1.35rem; }
.rt-dialog h3 { margin: 14px 0 6px; font-size: 1rem; }
.rt-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 6px; }
.rt-tiles div { padding: 6px 8px; background: var(--rt-tile); color: var(--rt-tile-ink); border-radius: var(--rt-radius); }
.rt-tiles dt { font-size: .75rem; line-height: 1.15; }
.rt-tiles dd { margin: 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rt-spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.rt-spark i { flex: 1 1 0; background: var(--rt-btn); border-radius: 2px 2px 0 0; }
.rt-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; max-width: 16rem; }
.rt-day { height: 18px; background: var(--rt-tile); border-radius: 3px; opacity: .55; }
.rt-day--on { background: var(--rt-btn); opacity: 1; }
.rt-day--today { outline: 2px solid currentColor; outline-offset: -1px; }
.rt-day--future { opacity: .2; }
.rt-top { margin: 0; padding-left: 1.4em; font-variant-numeric: tabular-nums; }
.rt-h2h { list-style: none; padding: 0; }
.rt-backup { margin-top: 14px; }
.rt-backup summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.rt-backup .rt-row { margin-top: 8px; }
.rt-ladder { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.rt-ladder i { display: block; height: 14px; background: var(--rt-tile); border-radius: 2px; opacity: .5; }
.rt-ladder i.on { background: var(--rt-btn); opacity: 1; }
.rt-ladder i.perfect { background: var(--rt-btn); opacity: 1; box-shadow: inset 0 0 0 2px var(--rt-sheet); }
.rt-mastery { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rt-mastery td { padding: 3px 0; border-bottom: 1px solid var(--rt-tile); }
.rt-mastery td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
:root { --rt-radius: 8px; --rt-tile: var(--asphalt-3); --rt-tile-ink: var(--white); --rt-btn: var(--signal); --rt-btn-ink: var(--ink); --rt-field: var(--asphalt-2); --rt-field-ink: var(--white); --rt-sheet: var(--asphalt); --rt-sheet-ink: var(--white); }
#result { --rt-tile: var(--ink); --rt-tile-ink: var(--signal); --rt-btn: var(--ink); --rt-btn-ink: var(--signal); --rt-field: var(--signal); --rt-field-ink: var(--ink); }

/* First-visit walkthrough: fixed, so nothing in the page moves */
.ob-help { position: fixed; z-index: 4; top: 4px; right: calc(var(--stripe, 0px) + 6px); display: grid; place-items: center; width: 44px; height: 44px; background: var(--ob-bg); color: var(--ob-ink); border: 2px solid var(--ob-line); border-radius: 50%; font-size: 1.25rem; font-weight: 700; line-height: 1; text-decoration: none; }
.ob-card { position: fixed; z-index: 20; display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 6px 12px; padding: 10px; background: var(--ob-bg); color: var(--ob-ink); border: 2px solid var(--ob-line); border-radius: 12px; box-shadow: 0 6px 18px #0006; animation: ob-in .2s ease-out; }
.ob-card p, .ob-dialog p { margin: 0; font-size: .95rem; line-height: 1.3; }
.ob-stage { display: flex; justify-content: center; gap: 8px; min-width: 0; }
.ob-frame { margin: 0; text-align: center; font-size: .75rem; }
.ob-demo { position: relative; flex: none; width: 124px; height: 104px; overflow: hidden; color: var(--ob-ink); }
.ob-tap { position: absolute; z-index: 3; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: var(--ob-tap); border: 2px solid var(--ob-bg); border-radius: 50%; opacity: .85; transition: transform .28s ease-out, opacity .2s; }
.ob-actions { display: flex; gap: 8px; }
.ob-primary, .ob-skip, .ob-pause { min-height: 44px; padding: 0 12px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.ob-primary { flex: 1; background: var(--ob-btn); color: var(--ob-btn-ink); border: 0; }
.ob-skip, .ob-pause { background: none; color: inherit; border: 2px solid var(--ob-line); }
.ob-link { min-height: 44px; padding: 0 2px; background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.ob-strip { display: flex; justify-content: space-between; padding: 4px 10px; }
.ob-rule { margin: 0 0 8px; font-size: .92rem; line-height: 1.3; }
.ob-dialog { width: min(26rem, calc(100vw - 24px)); max-height: 90dvh; padding: 0; background: var(--ob-bg); color: var(--ob-ink); border: 2px solid var(--ob-line); border-radius: 12px; }
.ob-dialog::backdrop { background: #0009; }
.ob-inner { display: grid; gap: 10px; padding: 14px; }
.ob-inner h2 { margin: 0; font-size: 1.2rem; }
.ob-inner .ob-pause { justify-self: center; }
.ob-legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .92rem; line-height: 1.25; }
.ob-legend li { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 10px; }
.ob-more { color: inherit; font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
.ob-cue { z-index: 2; outline: 3px solid var(--ob-cue); outline-offset: -3px; animation: ob-pulse .9s ease-in-out 2; }
@keyframes ob-pulse { 50% { transform: scale(1.08); } }
@keyframes ob-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .ob-card, .ob-cue, .ob-tap { animation: none; transition: none; } .ob-card { grid-template-columns: 1fr; } }

:root { --ob-bg: var(--asphalt-2); --ob-ink: var(--white); --ob-line: var(--signal); --ob-btn: var(--signal); --ob-btn-ink: var(--ink); --ob-tap: var(--white); --ob-cue: var(--white); }
@media (max-width: 959px) { body > header h1 { margin-right: 50px; } }
.ob-card { top: 54px; left: 8px; right: 8px; }
.ob-strip { top: auto; bottom: 8px; }
.ob-lives { height: 20px; color: var(--signal); font-size: .8rem; }
.ob-lives .l2 { display: none; }
.ob-demo:not([data-s="0"]) .l3 { display: none; }
.ob-demo:not([data-s="0"]) .l2 { display: inline; }
.ob-grid { display: grid; grid-template: repeat(2, 38px) / repeat(3, 38px); width: 118px; margin-left: 3px; padding: 2px; background: var(--signal); border-radius: 6px; overflow: hidden; }
.ob-grid .arrow { transition: transform .3s ease-in, opacity .3s ease-in; cursor: default; }
.ob-tap { transform: translate(24px, 81px); }
.ob-demo:is([data-s="2"], [data-s="3"]) .ob-tap { transform: translate(100px, 81px); }
.ob-demo[data-s="6"] .ob-tap { opacity: 0; }
.ob-demo[data-s="1"] .a { background: var(--stop); color: var(--ink); border-color: var(--ink); transform: translateX(8px); }
.ob-demo[data-s="1"] .b { background: var(--signal); color: var(--ink); border-color: var(--ink); }
.ob-demo:is([data-s="3"], [data-s="4"], [data-s="5"], [data-s="6"]) .b { transform: translateY(-100px); opacity: 0; }
.ob-demo:is([data-s="5"], [data-s="6"]) .a { transform: translateX(130px); opacity: 0; }
.ob-sw { width: 38px; height: 38px; cursor: default; }
.ob-legend .ob-red { background: var(--stop); color: var(--ink); border-color: var(--ink); }
.ob-legend .ob-yellow { background: var(--signal); color: var(--ink); border-color: var(--ink); }
@media (min-width: 960px) { .ob-card { top: auto; bottom: 24px; left: auto; right: max(var(--edge), calc(50vw - 30rem)); width: 23.5rem; } }
