:root {
  --page: #f3e8d2;
  --manila: #f8eeda;
  --manila-2: #eedfc1;
  --kraft: #7a5a3a;
  --kraft-deep: #5f452b;
  --kraft-line: #94724d;
  --ink: #33261a;
  --ink-soft: #5a4632;
  --cream: #fbf3e2;
  --rule-red: #d68d80;
  --rule-blue: #c3cdd2;
  --tab-sage: #93a57a;
  --tab-teal: #5d8f8a;
  --tab-ochre: #d2a64f;
  --tab-rose: #c98476;
  --pick: #2c6a66;
  --brass: #a98a52;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --strip: 29px;
  --card: 70px;
}

.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 { padding: 0 4px; }
.game-note { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--kraft-line); }
.game-note h2 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; }
.game-note p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.game-note a, .site-footer a { color: var(--pick); }
.site-footer { margin-top: 8px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.page { margin: 0 auto; background: var(--page); color: var(--ink); font-family: var(--serif); }
body.page :focus-visible { outline: 3px solid var(--pick); outline-offset: 2px; }
body.page { max-width: 42rem; padding: 12px 12px 18px; font-size: 18px; line-height: 1.6; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.page-head .mark { display: block; flex: none; width: 46px; height: 46px; border-radius: 9px; }
.wordmark { font-size: 1.6rem; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }
.page-play { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; background: var(--kraft-deep); color: var(--cream); border-radius: 5px; text-decoration: none; }
.prose { margin-top: 18px; padding: 16px 16px 8px; background: var(--manila); border: 1px solid var(--kraft-line); border-radius: 4px; border-top: 9px solid var(--tab-teal); overflow-wrap: anywhere; }
.prose h1 { margin: 0 0 10px; font-size: 2.05rem; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
.prose h2 { margin: 26px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--rule-red); font-size: 1.32rem; font-weight: 600; line-height: 1.25; }
.prose h3 { margin: 18px 0 2px; font-size: 1.08rem; font-weight: 600; font-style: italic; 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(--pick); }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .92em; }
.prose th, .prose td { padding: 5px 6px; border-bottom: 1px solid var(--kraft-line); text-align: left; }
.updated { color: var(--ink-soft); font-style: italic; }
.back { margin-top: 24px !important; }
body.page .site-footer { margin-top: 10px; padding: 0; }
@media (min-width: 960px) { .game-note, .site-footer { max-width: 74rem; } }

/* 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: 5px; --rt-tile: var(--manila-2); --rt-tile-ink: var(--ink); --rt-btn: var(--kraft-deep); --rt-btn-ink: var(--cream); --rt-field: var(--manila); --rt-field-ink: var(--ink); --rt-sheet: var(--page); --rt-sheet-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(--manila); --ob-ink: var(--ink); --ob-line: var(--kraft-deep); --ob-btn: var(--kraft-deep); --ob-btn-ink: var(--cream); --ob-tap: var(--pick); --ob-cue: var(--pick); }
@media (max-width: 959px) { body > header { padding-right: 50px; } }
#trays:empty { min-height: 124px; }
#columns:empty { min-height: calc(9px + var(--card) + 3 * var(--strip)); }
.ob-card { left: 8px; right: 8px; bottom: 8px; }
.ob-demo { --card: 28px; --strip: 16px; }
.ob-demo .card { font-style: normal; font-size: .72rem; cursor: default; transition: transform .3s ease-out; }
.ob-col, .ob-pile { position: absolute; top: 8px; width: 54px; height: 82px; padding-top: 6px; background: var(--kraft-deep); border-radius: 4px; }
.ob-col { left: 0; z-index: 1; }
.ob-pile { right: 0; }
.ob-theme { position: absolute; left: 0; right: 0; bottom: 0; color: var(--ink); font-size: .8rem; text-align: center; opacity: 0; transition: opacity .25s; }
.ob-tap { transform: translate(27px, 22px); opacity: 0; }
.ob-demo[data-s="1"] .ob-tap { opacity: .85; }
.ob-demo[data-s="2"] .ob-tap { transform: translate(27px, 40px); opacity: .85; }
.ob-demo[data-s="3"] .ob-tap { transform: translate(97px, 62px); opacity: .85; }
.ob-demo[data-s="1"] .sofa { transform: translateX(4px); }
.ob-demo[data-s="2"] .lime { background: var(--pick); color: var(--cream); }
.ob-demo[data-s="2"] .ob-pile { outline: 2px dashed var(--cream); outline-offset: -2px; }
.ob-demo:is([data-s="3"], [data-s="4"]) .lime { transform: translate(70px, 32px); }
.ob-demo[data-s="4"] .ob-theme { opacity: 1; }
.ob-sw.card { --card: 30px; --strip: 30px; width: 54px; font-style: normal; font-size: .8rem; cursor: default; }
.ob-drop { display: block; width: 54px; height: 30px; background: var(--kraft-deep); outline: 2px dashed var(--cream); outline-offset: -2px; border-radius: 4px; }
@media (min-width: 960px) {
  #trays:empty { min-height: 138px; }
  .ob-card { left: auto; right: max(28px, calc(50vw - 37rem + 28px)); bottom: 20px; width: 21rem; }
}
