:root { --bench:#f6ecd6; --bench2:#efe0bf; --wood:#c79a63; --wood-d:#9a7040; --brass:#d2a336; --brass-d:#8a6a1f; --ink:#3a2a1c; --card:#e3c593; --card-line:#8a6a3b; --seed:#7a4a24; --seed-hl:#a9692f; --ok:#2f6b3a; --focus:#1f5fbf; --shadow:rgba(58,42,28,.22); --line:#4a3320; color-scheme: light; }
:root[data-theme='dark'] { --bench:#2a2118; --bench2:#35291d; --wood:#6b4c2c; --wood-d:#4a331d; --brass:#e0b348; --brass-d:#c9962f; --ink:#f3e6cc; --card:#4a3922; --card-line:#d9b98a; --seed:#e9a762; --seed-hl:#ffd08a; --ok:#8fd49b; --focus:#8fb8ff; --shadow:rgba(0,0,0,.5); --line:#120c06; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bench); color: var(--ink); font: 17px/1.45 Georgia, 'Iowan Old Style', 'Times New Roman', serif; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
header { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; min-height: 48px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--card-line); background: var(--bench2); font-size: 20px; line-height: 1; display: inline-grid; place-items: center; }
#bench { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; gap: 6px; padding: 0 14px 12px; max-width: 980px; width: 100%; margin: 0 auto; min-height: 0; }
#stage { overflow: hidden; border-radius: 16px; flex: 1 1 0; min-height: 0; background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
#machine { width: 100%; flex: 1 1 0; min-height: 0; display: block; }
#cap { margin: 0 6px 4px; position: relative; z-index: 1; color: var(--bench); font-weight: 700; text-shadow: 0 1px 0 rgba(0,0,0,.25); min-height: 2.9em; font-size: 15px; text-align: center; }
#panel { flex: none; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.trail { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; align-items: center; }
.trail li { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--card-line); flex: none; font-size: 0; overflow: hidden; opacity: .7; }
.trail li.done { background: var(--card-line); opacity: 1; }
.trail li.here { width: auto; height: auto; min-width: 16px; border-radius: 999px; background: var(--brass); color: #2a1c0e; opacity: 1; font-size: 14px; font-weight: 700; padding: 1px 10px; border-color: var(--brass-d); }
#q { font-size: 21px; line-height: 1.3; margin: 0; font-weight: 700; }
#coach { margin: 0; font-size: 17px; }
#chips { display: flex; flex-direction: column; gap: 10px; }
.chip { min-height: 48px; text-align: left; padding: 10px 14px; border-radius: 14px; border: 3px dashed var(--card-line); background: var(--card); font-size: 17px; line-height: 1.3; }
.chip:active { transform: translateY(2px); }
#bar { display: flex; gap: 10px; align-items: center; margin-top: auto; }
#act, #next { min-height: 52px; padding: 10px 12px; white-space: nowrap; border-radius: 14px; border: 3px dashed var(--card-line); background: var(--card); font-weight: 700; font-size: 17px; flex: 1; box-shadow: 0 4px 0 var(--shadow); }
#next { background: var(--brass); color: #2a1c0e; }
#act.secondary { background: transparent; flex: 0 1 auto; }
#act:active, #next:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
[hidden] { display: none !important; }
/* machine */
.m-wall { fill: var(--bench2); } .m-peg { fill: var(--card-line); opacity: .4; } .m-tool { fill: none; stroke: var(--card-line); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; opacity: .75; }
.m-ledge { fill: var(--wood); } .m-ledge-top { fill: var(--wood-d); opacity: .5; }
.m-cubby { fill: var(--bench2); stroke: var(--card-line); stroke-width: 2.5; stroke-dasharray: 7 5; transition: filter .3s, opacity .3s, stroke .3s; }
.m-cubby.hl { stroke: var(--brass-d); stroke-width: 5; stroke-dasharray: none; fill: var(--card); }
.m-hop, .m-rim, .m-body, .m-win, .m-plate, .m-dial, .m-chute { stroke: var(--line); stroke-width: 3; stroke-linejoin: round; }
.m-hop { fill: var(--brass); } .m-rim { fill: var(--brass-d); } .m-body { fill: var(--wood); } .m-win { fill: #2a1c0e; } .m-plate { fill: var(--brass); } .m-dial { fill: var(--card); } .m-chute { fill: var(--wood-d); }
.m-read { fill: var(--brass); font: 700 22px Georgia, serif; }
.m-plate.go { animation: press .8s ease-in-out; }
@keyframes press { 0% { transform: translateY(0); } 40% { transform: translateY(-34px); } 70% { transform: translateY(8px); } 100% { transform: translateY(0); } }
.m-label { fill: var(--bench); font: 700 16px Georgia, serif; transition: opacity .3s; }
.m-num { fill: var(--ink); font: 700 26px Georgia, serif; transition: opacity .3s; }
.m-band { transition: opacity .5s; } .m-cap { fill: var(--brass); fill-opacity: .38; stroke: var(--brass-d); stroke-width: 3; } .m-tie { fill: var(--brass); stroke: var(--brass-d); stroke-width: 2; }
.m-seed { fill: var(--seed); stroke: var(--line); stroke-width: 1.6; transition: transform .45s cubic-bezier(.3,.9,.3,1), opacity .3s; }
.m-seed:nth-child(odd) { fill: var(--seed-hl); }
#machine.instant * { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .m-seed, .m-cubby, .m-band { transition: none !important; } .m-plate.go { animation: none; } }
@media (orientation: landscape) and (max-height: 520px) {
  header { min-height: 36px; padding: 0 12px; } .icon { width: 44px; height: 44px; } #cap { min-height: 2.6em; font-size: 14px; }
  #bench { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); grid-template-rows: minmax(0, 1fr); gap: 12px; padding-bottom: 8px; }
  header .icon { width: 44px; height: 44px; } header .brand { margin-right: auto; margin-left: 8px; } #q { font-size: 17px; line-height: 1.25; } #coach, .chip, #act, #next { font-size: 16px; }
  .chip { min-height: 44px; padding: 7px 12px; } #act, #next { min-height: 46px; padding: 6px 14px; }
  #panel { gap: 6px; overflow-y: auto; max-height: calc(100dvh - 50px); } #bar { position: sticky; bottom: 0; background: var(--bench); padding: 4px 0; } body { height: 100dvh; overflow: hidden; }
}
@media (min-width: 900px) and (min-height: 521px) {
  body { font-size: clamp(18px, .75vw + 12px, 28px); }
  #bench { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 3vw; max-width: none; padding: 0 4vw 4vh; align-items: center; }
  #stage { align-self: stretch; } #machine { flex: 1 1 0; min-height: 0; }
  #panel { justify-content: center; gap: 2.2vh; } #bar { margin-top: 2vh; }
  #q { font-size: clamp(28px, 3.1vw, 56px); line-height: 1.12; letter-spacing: -.01em; }
  #coach { font-size: clamp(18px, 1.35vw, 28px); } .chip { font-size: clamp(18px, 1.3vw, 26px); min-height: 56px; padding: 14px 18px; }
  #act, #next { font-size: clamp(20px, 1.6vw, 30px); min-height: clamp(60px, 7vh, 84px); }
  .trail li { width: 20px; height: 20px; } .trail li.here { width: auto; height: auto; font-size: 16px; }
  .brand { font-size: clamp(18px, 1.2vw, 26px); } header { padding: 10px 4vw; } .icon { width: 52px; height: 52px; }
  #cap { font-size: clamp(16px, 1.3vw, 24px); }
}
header .trail { gap: 6px; }
@media (orientation: landscape) and (max-width: 640px) { header .brand { display: none; } header .trail { margin-left: auto; margin-right: 8px; } header { gap: 4px; } }
@media (orientation: landscape) and (max-height: 340px) { #coach { font-size: 15px; line-height: 1.3; } .chip { padding: 4px 12px; font-size: 15px; } #chips { gap: 6px; } #panel { gap: 4px; } }

#cap { color: var(--ink) !important; text-shadow: none !important; }
@media (orientation: landscape) and (max-height: 520px) { body[data-screen='watch'] #bench { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
/* Array Maker */
.m-tray { fill: var(--bench2); stroke: var(--card-line); stroke-width: 3; stroke-dasharray: 8 5; }
.m-post, .m-rim { stroke: var(--line); stroke-width: 3; stroke-linejoin: round; } .m-post { fill: var(--brass-d); } .m-rim { fill: var(--brass-d); }
.m-win { fill: #2a1c0e; stroke: var(--line); stroke-width: 3; transition: opacity .3s; }
.m-read { fill: var(--brass); font: 700 22px Georgia, serif; }
.m-tile { fill: var(--seed); stroke: var(--line); stroke-width: 2; transition: transform .5s cubic-bezier(.3,.9,.3,1), opacity .3s, fill .3s, r .5s; }
.m-tile:nth-child(odd) { fill: var(--seed-hl); }
.m-tile.hl { fill: var(--brass); stroke: var(--focus); stroke-width: 3; } .m-tile.dim { fill-opacity: .35; stroke-opacity: .35; }
.m-stamper.go { animation: stamp .7s ease-in-out; }
@keyframes stamp { 0% { transform: translateY(-14px); } 45% { transform: translateY(26px); } 100% { transform: translateY(0); } }
#machine.instant .m-tile { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .m-tile, .m-win { transition: none !important; } .m-stamper.go { animation: none; } }
