*{box-sizing:border-box}body.kariuchi{margin:0;color:#302d22;background:#ebe3cc;font-family:system-ui,-apple-system,sans-serif;font-size:16px;line-height:1.6;background-image:radial-gradient(ellipse at 5% 40%,#b2b89060,transparent 42%),radial-gradient(ellipse at 95% 70%,#ddac8060,transparent 45%)}button,select{font:inherit;color:inherit}button,select,a{-webkit-tap-highlight-color:transparent}button,select{border:1px solid #aaa187;background:#f5eedc;min-height:44px;border-radius:6px;padding:8px 12px}button{cursor:pointer;touch-action:manipulation;max-width:100%;white-space:normal;overflow-wrap:anywhere}button:hover:not(:disabled){background:#e6d6b7}button:disabled{opacity:.5;cursor:default}button:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #3c7561;outline-offset:4px}a{color:inherit;text-underline-offset:4px}h1,h2,p{margin:0}button[aria-pressed=true]{background:#e9c799;border-color:#79432a;box-shadow:inset 0 0 0 1px #79432a}[hidden]{display:none!important}.sitebar{max-width:1440px;margin:auto;padding:19px 4%;display:flex;align-items:center;gap:24px;border-bottom:1px solid #b0a68b}.brand{font-weight:750;text-decoration:none;letter-spacing:-.03em;white-space:nowrap}.sitebar nav{display:flex;flex-wrap:wrap;column-gap:16px;row-gap:4px;min-width:0;margin-left:auto;font-size:.85rem}.sitebar nav a{padding:5px 0;text-decoration:none}.sitebar nav [aria-current]{border-bottom:2px solid #a0472d}.rules-link{font-size:.85rem}main{max-width:1320px;margin:auto;padding:0 32px}.hero{padding:30px 0 24px;display:flex;align-items:center;justify-content:space-between;gap:30px}.hero>div{min-width:0}.eyebrow{font-size:.75rem;letter-spacing:.2em;font-weight:600;color:#685d45}.hero h1{font-family:'Noto Serif JP',Georgia,serif;font-size:clamp(2.7rem,5vw,4.9rem);line-height:1.3;font-weight:900;letter-spacing:.04em;display:flex;align-items:center;flex-wrap:wrap;gap:24px;overflow-wrap:anywhere}.seal{flex-shrink:0;display:inline-grid;place-items:center;background:#a33e28;color:#f5e5c6;border:3px double #ecd9b5;font-size:24px;line-height:1;width:40px;height:48px;transform:rotate(-7deg)}.lead{font-family:'Noto Serif JP',Georgia,serif;font-size:1.05rem;margin-top:8px}.hero-note{max-width:300px;display:flex;gap:18px;align-items:center;font-size:.88rem;color:#655b45}.hero-note>span{font-family:serif;font-size:3.7rem;color:#8a7a52;line-height:1}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:36px;align-items:start;padding-top:20px}.stage{min-width:0;position:relative}.scoreboard{display:flex;align-items:center;justify-content:space-between;padding:0 22px;gap:12px}.score{display:grid;grid-template-columns:minmax(0,auto) auto;min-width:0;align-items:center;column-gap:12px;font-size:.85rem;padding:8px 0;border-bottom:2px solid transparent}.score.active{border-color:currentColor}.player-name{overflow-wrap:anywhere;font-family:'Noto Serif JP',serif;font-size:1.2rem;font-weight:bold}.score-dots{display:flex;gap:4px}.score-dots i{width:9px;height:9px;border-radius:50%;border:1px solid currentColor}.score-dots i.done{background:currentColor}.score [id^=scoretext]{font-size:.75rem;grid-column:2}.red{color:#9a3627}.jade{color:#2b6151}.score-vs{color:#8c7a53;font-family:serif;font-size:1.3rem}.board-wrap{width:min(100%,650px);margin:0 auto;position:relative;isolation:isolate}.board{width:100%;display:block;overflow:visible;position:relative;z-index:2}.wood-rings{opacity:.33;stroke-width:1}.board-node{fill:#302b20;stroke:#d6b582;stroke-width:1.5}.board-node.major{fill:#d0af71;stroke:#edcf94;stroke-width:2}.board-path{fill:none;stroke:#f4d67d;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;opacity:.9}.board-piece{stroke:#f4cf91;stroke-width:1.8;filter:drop-shadow(0 3px 2px #20150f88)}.piece-number{fill:#fff4d9;font:700 15px system-ui;text-anchor:middle;dominant-baseline:central;pointer-events:none}.board-label{fill:#f6dbac;font:600 14px system-ui;text-anchor:middle}.board-label.center-label{fill:#edcd95;font-size:11px}.reserves{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:0 24px;font-size:.8rem}.reserves>div{min-width:0;flex:1 1 0;overflow-wrap:anywhere}.reserves>div:last-child{text-align:right}.reserves>div:last-child .reserve-pieces{justify-content:flex-end}.reserves>p{min-width:0;flex:1 1 0;overflow-wrap:anywhere;font-size:.75rem;color:#695d46;text-align:center;max-width:140px}.reserve-pieces{display:flex;flex-wrap:wrap;gap:6px;min-height:28px;margin-top:4px}.reserve-pieces i{flex-shrink:0;width:22px;height:22px;background:radial-gradient(at 30% 20%,#e88655,#9e3623);border:1px solid #c59465;border-radius:50%;box-shadow:0 2px 0 #6c3523}.reserve-pieces.jade-pieces i{background:radial-gradient(at 30% 20%,#a8d2ad,#356956);box-shadow:0 2px 0 #244c40}.controls{background:#f5efde;border:1px solid #b4a587;box-shadow:5px 6px 0 #baad8b35;padding:20px;border-radius:4px;margin-top:8px;min-width:0}.controls>*{min-width:0}.control-top{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:end;gap:8px;padding-bottom:18px;border-bottom:1px solid #cabea3}.control-top label{display:grid;min-width:0;gap:4px;font-size:.75rem}.control-top select{font-size:.9rem;min-width:0;max-width:min(180px,100%)}.text-button{border:0;background:none;padding:6px;font-size:.8rem}.turn-line{display:flex;justify-content:space-between;gap:12px;overflow-wrap:anywhere;font-size:.85rem;padding:18px 0 6px;font-weight:650}.turn-line #move-number{font-family:Georgia,serif;color:#8a7753;font-size:1.25rem}.casting{background:radial-gradient(ellipse,#dfcda4,#eae0c6);border:1px solid #c7b997;border-radius:50% 43% 47% 45% / 20% 25% 20% 25%;padding:24px 12px 12px;margin:6px 0 10px;box-shadow:inset 0 0 30px #aa906835}.sticks{display:flex;gap:15px;justify-content:center;height:95px;align-items:center;perspective:500px}.sticks i{display:block;width:18px;height:85px;border-radius:8px 9px 5px 6px;transform:rotate(var(--angle,-16deg));background:repeating-linear-gradient(90deg,#58351d 0px,#694329 3px,#83582f 5px,#684325 7px);box-shadow:3px 5px 3px #513c3455,inset 1px 0 #c59153;border:1px solid #593a21}.sticks i:nth-child(2){--angle:14deg}.sticks i:nth-child(3){--angle:-5deg}.sticks i:nth-child(4){--angle:22deg}.sticks i.flat{background:repeating-linear-gradient(90deg,#e1bd7e 0,#ddb272 3px,#efcf94 5px,#ddb475 7px);box-shadow:3px 5px 3px #513c3455,inset 1px 0 #f4d7a0}.casting.throwing i{animation:cast .55s ease-out both}.casting.throwing i:nth-child(2){animation-delay:30ms}.casting.throwing i:nth-child(3){animation-delay:60ms}.casting.throwing i:nth-child(4){animation-delay:90ms}@keyframes cast{0%{transform:translateY(0) rotate(var(--angle))}40%{transform:translateY(-25px) rotateX(250deg) rotate(25deg)}100%{transform:translateY(0) rotateX(360deg) rotate(var(--angle))}}.cast-result{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;column-gap:12px;row-gap:0;min-width:0;min-height:70px}.cast-result strong{font:700 3.5rem Georgia,serif;color:#8e3d24}.cast-result span{font-size:.8rem;max-width:150px;overflow-wrap:anywhere;color:#65583c}.status{font-size:1rem;margin:6px 0 0;color:#4c4433;line-height:1.7;overflow-wrap:anywhere}.primary{background:#a43f29;border-color:#86321f;color:#fff4dc;width:100%;font-weight:700;min-height:52px;border-radius:4px;box-shadow:0 3px 0 #743724;letter-spacing:.04em}.primary:hover:not(:disabled){background:#87331f}.primary:disabled{box-shadow:none}.controls h2{font-size:.85rem;margin:15px 0 7px}.piece-choices{display:flex;gap:6px;flex-wrap:wrap}.piece-choices button{min-width:min(52px,100%);flex:1 1 90px;font-size:.9rem}.count-label{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;font-size:.85rem;margin-top:10px}.count-label select{min-width:65px}.route-choices{display:grid;gap:6px;margin-bottom:14px}.route-choices button{text-align:left;min-width:0;font-size:.9rem}.route-choices small{display:block;color:#65583c}.preferences{border-top:1px solid #cabea3;margin-top:24px;padding-top:14px;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:end;gap:8px;font-size:.8rem}.preferences label{display:grid;min-width:0;gap:5px}.preferences select{min-width:0;max-width:min(150px,100%)}.preferences button{font-size:.8rem;margin-left:auto}.record{border-top:1px solid #d5cab3;margin-top:16px;padding-top:12px;font-size:.8rem}.record summary{cursor:pointer}.record ol{padding-left:20px;max-height:180px;overflow:auto}.record li{margin:7px 0}.history{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:70px;margin:50px 0 30px;padding:32px 0;border-top:1px solid #b0a68b}.history>div{min-width:0;overflow-wrap:anywhere}.history h2{font-family:'Noto Serif JP',Georgia,serif;font-size:1.5rem;margin-bottom:18px}.history p{font-size:.95rem;margin-bottom:16px}.history li{margin-bottom:12px;font-size:.9rem}.history ol{padding-left:20px}.history .fine{font-size:.8rem;color:#665b46}footer{padding:24px 0 40px;border-top:1px solid #b0a68b;font-size:.75rem;color:#665b46}footer div{display:flex;flex-wrap:wrap;column-gap:24px;row-gap:12px;margin-top:12px}footer a{overflow-wrap:anywhere}dialog{border:1px solid #a59575;border-radius:6px;max-width:min(450px,90vw);background:#f5efde;color:#302d22;padding:28px}dialog::backdrop{background:#25251dcc}dialog p{margin:18px 0}dialog form>div{display:flex;flex-wrap:wrap;gap:10px}dialog .primary{width:auto}select{padding-right:25px;max-width:100%}.burst{position:absolute;inset:3%;z-index:1;border-radius:50%;pointer-events:none;opacity:0;background:repeating-conic-gradient(from 20deg,#bc4e2f 0deg 10deg,#d4a23d 10deg 20deg,#477c66 20deg 30deg,#8d6090 30deg 40deg);filter:blur(12px)}.burst.show{animation:bloom 1.5s ease-out both}.event-banner{position:absolute;top:40%;left:5%;right:5%;z-index:4;text-align:center;font-family:'Noto Serif JP',Georgia,serif;font-weight:900;font-size:clamp(1.5rem,4vw,3.4rem);color:#fff2c9;text-shadow:0 2px 0 #562f20,0 0 25px #59250e;background:#643b1fdf;padding:12px;border-block:2px solid #dbb675;opacity:0;pointer-events:none}.event-banner.show{animation:announce 1.5s ease both}.leaf{position:absolute;left:50%;top:50%;width:10px;height:24px;border-radius:90% 0 90% 0;background:var(--c);z-index:5;pointer-events:none;animation:scatter 1.4s ease-out both}@keyframes bloom{0%{opacity:0;transform:scale(.8) rotate(0)}25%{opacity:.65}100%{opacity:0;transform:scale(1.18) rotate(35deg)}}@keyframes announce{0%,100%{opacity:0;transform:translateY(10px)}15%,75%{opacity:1;transform:translateY(0)}}@keyframes scatter{0%{opacity:0;transform:translate(0,0)}15%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(var(--r))}}.kariuchi[data-effects=quiet] .throwing i,.kariuchi[data-effects=quiet] .show,.kariuchi[data-effects=quiet] .leaf{animation:none}.kariuchi[data-effects=quiet] .event-banner.show{opacity:1}.kariuchi[data-effects=color] .burst{filter:blur(18px);background:radial-gradient(ellipse,#da9c58,#56836e,transparent 70%)}

/* Keep the result, instruction and single next action in one panel. */
.quick-start{border-block:1px solid #b0a68b;padding:8px 0;font-size:.95rem;overflow-wrap:anywhere}
.quick-start summary{cursor:pointer;min-height:44px;padding:9px 0;font-weight:650}
.quick-start>p{margin:6px 0 12px;color:#4c4433;max-width:70ch}
.quick-start ol{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 32px;margin:8px 0 14px;padding-left:24px}
.quick-start li{padding-left:3px;min-width:0}
.quick-start li::marker{color:#94402b;font-weight:700}
.side-note{margin:14px 0 10px;color:#655b45;font-size:.9rem;overflow-wrap:anywhere}
.reserve-pieces.selected-reserve i:first-child{outline:2px solid #9a6b24;outline-offset:2px}
.turn-guide{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,320px);gap:18px 28px;align-items:center;padding:20px 22px;background:#f7f0dd;border:1px solid #b4a587;border-left:4px solid #a43f29;border-radius:4px;box-shadow:3px 4px 0 #baad8b35;scroll-margin-top:16px}
.guide-copy,.guide-actions{min-width:0}
.guide-eyebrow{color:#8c412d;font-size:.75rem;font-weight:700;letter-spacing:.12em}
#guide-title{font-size:clamp(1.15rem,2vw,1.45rem);line-height:1.5;margin-top:2px;overflow-wrap:anywhere}
.guide-actions{display:grid;gap:8px;align-content:center}
.guide-actions .primary{min-height:56px;padding:12px 16px;line-height:1.5;letter-spacing:.02em}
#change-selection{display:flex;align-items:center;justify-content:center;min-height:44px;min-width:0;padding:6px 2px;text-align:center;font-size:.9rem;line-height:1.5;overflow-wrap:anywhere}
.last-action{margin:8px 0 12px;font-size:.875rem;color:#655b45;overflow-wrap:anywhere}
#choices{margin-top:14px;padding-top:10px;border-top:1px solid #cabea3;min-width:0;scroll-margin-top:20px}
#selection-help,#selection-note{margin:4px 0 10px;font-size:.875rem;color:#4c4433;overflow-wrap:anywhere}
#piece-options,#route-options{min-width:0}
.selection-return{display:inline-flex;align-items:center;min-height:44px;max-width:100%;padding:6px 0;font-size:.9rem;line-height:1.5;overflow-wrap:anywhere}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;scroll-behavior:auto!important}
  .burst,.leaf{display:none!important}
  .event-banner.show{opacity:1}
}


/* Native buttons keep board selection available to touch and keyboard users. */
.board-controls{position:absolute;inset:0;pointer-events:none}
.board-choice{position:absolute;transform:translate(-50%,-50%);width:44px;height:44px;min-height:44px;padding:0;border:2px dashed #ffe8a2;border-radius:50%;background:transparent;box-shadow:0 0 0 2px #372316;pointer-events:auto;font-size:0;color:transparent}
.board-choice:hover,.board-choice[aria-pressed="true"]{border-style:solid;background:#ffe8a22b;box-shadow:0 0 0 3px #ffe8a266}
.board-choice:focus-visible{outline:3px solid white;outline-offset:4px}
.board-controls~.burst,.board-controls~.event-banner{pointer-events:none}
.reserve-pieces{flex-wrap:wrap}
.reserve-pieces button{min-height:44px;font-size:.8rem;width:100%;margin-top:.25rem}
.piece-choices button small{display:block;font-size:.8rem;font-weight:400;line-height:1.6;margin-top:.4rem}
.move-outcome{margin:.3rem 0;font-size:.85rem;line-height:1.6}
.practice-entry{margin:0 0 1rem}.practice-entry button{min-height:44px}
.practice-panel{border:1px solid var(--line,#b4a482);border-left:4px solid #477d60;padding:1rem;margin:0 0 1rem;border-radius:12px;background:#f7f0dd}
.practice-panel h2{font-size:1.1rem;margin:0 0 .5rem}.practice-panel p{line-height:1.7}
.practice-panel>div{display:flex;flex-wrap:wrap;gap:.5rem}.practice-panel button{min-height:44px}
.board-controls{z-index:3}

.board-controls .board-choice:hover:not(:disabled){background:#ffe8a22b}

/* Match the selectable object to its card; selection and destination have different shapes. */
.game-icon{width:24px;height:24px;flex-shrink:0;vertical-align:middle;margin-right:7px}
.piece-badge{display:inline-grid;place-items:center;min-width:34px;height:34px;padding:0 5px;margin-right:9px;border-radius:50%;border:2px solid #f6d59a;color:#fff8e7;font:750 15px system-ui;box-shadow:0 3px 0 #542e1e,0 4px 8px #30201640;background:radial-gradient(at 30% 20%,#e88655,#9e3623 75%)}
.piece-badge.jade{background:radial-gradient(at 30% 20%,#80b998,#285442 75%);box-shadow:0 3px 0 #203f34,0 4px 8px #30201640}
.board-choice{border:0;box-shadow:none;background:transparent!important;color:inherit;font-size:1rem;overflow:visible}
.board-choice .piece-badge{margin:0;min-width:36px;height:36px;outline:2px solid #fff2c5;outline-offset:2px}
.board-choice[aria-pressed=true]{box-shadow:none}
.board-choice[aria-pressed=true]::after{content:'✓';position:absolute;right:-2px;top:-7px;background:#fff0a3;color:#3e2d17;border:1px solid #65451f;border-radius:50%;font:bold 15px system-ui;width:22px;height:22px}
.board-choice:hover .piece-badge{transform:translateY(-3px)}
.piece-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.piece-choices button{text-align:left;padding:12px 10px;border-radius:10px;border-bottom-width:3px;background:#fff9eb;transition:background .15s,border-color .15s}
.piece-choices button[aria-pressed=true]{background:#f6dfaf;border-color:#8b542b}
.outcome-badges{display:flex;flex-wrap:wrap;gap:4px;margin-top:12px}
.outcome-badge{display:inline-flex;align-items:center;gap:2px;font-size:.78rem;font-weight:750;line-height:1.4;padding:5px 7px;border-radius:5px;background:#e5e4ce;color:#3d5137;overflow-wrap:anywhere}
.outcome-badge .game-icon{width:20px;height:20px;margin-right:3px}
.outcome-badge[data-kind=capture]{background:#f4d7c8;color:#7b3021}
.outcome-badge[data-kind=finish]{background:#f4e3ac;color:#674513}
.outcome-badge[data-kind=stack]{background:#dceade;color:#28543e}
.route-choices .outcome-badge{margin:5px 0 5px 8px}
.event-banner{display:flex;justify-content:center;align-items:center;gap:10px;border-radius:10px;box-shadow:0 8px 25px #21180f55}
.event-banner .game-icon{width:1.15em;height:1.15em;margin:0}
.event-banner[data-kind=capture]{background:#7d3025ed}
.event-banner[data-kind=stack]{background:#285440ed}
.event-banner[data-kind=finish],.event-banner[data-kind=win]{background:#644713f0;border-color:#ffe39a}
.primary:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #743724}
@media(max-width:760px){.board-wrap{max-width:min(100%,420px)}.board-choice .piece-badge{min-width:30px;height:30px;font-size:13px}.event-banner{font-size:1.5rem}.piece-choices button{font-size:.875rem}}
@media(prefers-reduced-motion:reduce){.piece-choices button{transition:none}.board-choice:hover .piece-badge,.primary:active:not(:disabled){transform:none}}
.kariuchi[data-effects=quiet] .board-choice:hover .piece-badge,.kariuchi[data-effects=quiet] .primary:active:not(:disabled){transform:none}


/* The start is above the board; an active match keeps its controls beside it. */
.game-layout { gap: 20px 28px; padding-top: 4px; scroll-margin-top: max(8px, env(safe-area-inset-top)); }
.game-layout > .practice-panel, .game-layout > .turn-guide, .secondary-actions { grid-column: 1 / -1; }
.secondary-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 24px; align-items: start; }
.secondary-actions .quick-start { min-width: 0; }
.secondary-actions .practice-entry { margin: 0; padding-top: 8px; }
.secondary-actions .practice-entry button { min-height: 44px; }
.stage .side-note { margin: 0 0 10px; }
.board-start-hint { max-width: 62ch; margin: 12px auto 0; color: #4c4433; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.board-label { font-size: 20px; }
#board-labels text:first-child { paint-order: stroke fill; stroke: #50391f; stroke-width: 3px; stroke-linejoin: round; }
.last-action:empty, .move-outcome:empty { display: none; }
.record summary { min-height: 44px; padding-block: 10px; }
.kariuchi { padding-bottom: env(safe-area-inset-bottom); }
.kariuchi[data-play-started=false] .turn-line, .kariuchi[data-play-started=false] .casting { display: none; }
.kariuchi[data-play-started=true] .hero { padding-block: 8px; }
.kariuchi[data-play-started=true] .hero h1 { font-size: clamp(1.5rem,3vw,2.2rem); }
.kariuchi[data-play-started=true] .hero :is(.eyebrow,.lead,.hero-note),
.kariuchi[data-play-started=true] :is(.side-note,.board-start-hint,.board-start-direction) { display: none; }
.kariuchi[data-play-started=true] .hero .seal { width: 26px; height: 30px; font-size: 16px; }

/* Opening throws label each number rather than presenting an unexplained ratio. */
#roll-value.opening-roll-values { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; max-width: 100%; font-family: inherit; }
#roll-value .roll-side { display: grid; gap: 2px; min-width: 0; max-width: none; text-align: center; color: #8e3d24; }
#roll-value .roll-side-label { font: 600 .8rem/1.4 system-ui,-apple-system,sans-serif; color: #65583c; overflow-wrap: anywhere; }
#roll-value .roll-side-value { max-width: none; font: 700 2rem/1.2 Georgia,serif; color: #8e3d24; }

@media (min-width:1100px) {
  .board-wrap { max-width: 580px; }
  .game-layout { grid-template-columns: minmax(0,1fr) 350px; }
}
@media (min-width:761px) and (min-height:541px), (min-width:1001px) {
  .kariuchi[data-play-started=true] .game-layout {
    grid-template-columns: minmax(0,1fr) minmax(280px,350px);
    grid-template-rows: min-content min-content min-content minmax(0,1fr) auto auto auto auto;
    grid-template-areas: "stage turn" "stage throw" "stage guide" "stage choices" "practice practice" "help help" "mode prefs" "record record";
    row-gap: 10px;
  }
  .kariuchi[data-play-started=true] .controls { display: contents; }
  .kariuchi[data-play-started=true] .stage { grid-area: stage; }
  .kariuchi[data-play-started=true] .turn-line { grid-area: turn; padding: 0; align-items: center; }
  .kariuchi[data-play-started=true] .casting { grid-area: throw; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; margin: 0; padding: 12px; border-radius: 10px; }
  .kariuchi[data-play-started=true] .sticks { height: 54px; gap: 8px; }
  .kariuchi[data-play-started=true] .sticks i { height: 46px; width: 10px; }
  .kariuchi[data-play-started=true] .cast-result { min-height: 54px; }
  .kariuchi[data-play-started=true] .cast-result strong { font-size: 2.4rem; }
  .kariuchi[data-play-started=true] .game-layout > .turn-guide { grid-area: guide; grid-template-columns: minmax(0,1fr); padding: 16px; gap: 10px; }
  .kariuchi[data-play-started=true] .guide-eyebrow { display: none; }
  .kariuchi[data-play-started=true] #choices { grid-area: choices; margin: 0; padding: 0; border: 0; }
  .kariuchi[data-play-started=true] .practice-panel { grid-area: practice; }
  .kariuchi[data-play-started=true] .secondary-actions { grid-area: help; }
  .kariuchi[data-play-started=true] .control-top { grid-area: mode; padding-top: 12px; }
  .kariuchi[data-play-started=true] .preferences { grid-area: prefs; margin-top: 0; padding-top: 12px; }
  .kariuchi[data-play-started=true] .record { grid-area: record; margin-top: 0; }
}
@media (max-width:760px), (orientation:landscape) and (max-width:1000px) and (max-height:540px) {
  /* Selection and resolving turns must not drag the viewport down to a new control. */
  html:has(> body.kariuchi) { overflow-anchor: none; }
  main { padding-inline: max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right)); }
  .sitebar { padding: 10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left)); gap: 8px 12px; flex-wrap: wrap; }
  .sitebar nav { column-gap: 12px; font-size: .75rem; }
  .sitebar nav a { min-height: 28px; }
  .brand { font-size: .85rem; }
  .rules-link { display: none; }
  .hero { display: block; padding: 12px 0; }
  .hero h1 { font-size: 2.3rem; gap: 16px; }
  .eyebrow { font-size: .7rem; letter-spacing: .12em; }
  .seal { font-size: 20px; width: 32px; height: 40px; }
  .lead, .hero-note > span { display: none; }
  .hero-note { display: block; max-width: none; font-size: .875rem; }
  .hero-note p { margin-top: 8px; }
  .game-layout {
    grid-template-columns: minmax(0,1fr);
    grid-template-areas: "guide" "turn" "stage" "throw" "choices" "practice" "help" "mode" "prefs" "record";
    gap: 6px;
    padding-top: 0;
  }
  .kariuchi[data-play-started=true] .game-layout {
    grid-template-areas: "turn" "stage" "throw" "guide" "choices" "practice" "help" "mode" "prefs" "record";
  }
  .game-layout .controls { display: contents; }
  .stage { grid-area: stage; min-width: 0; }
  .stage .side-note { margin: 2px 0 8px; font-size: .875rem; }
  .game-layout > .turn-guide { grid-area: guide; grid-template-columns: minmax(0,1fr); gap: 6px; padding: 10px 12px; }
  .controls .casting { grid-area: throw; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin: 0; min-height: 44px; padding: 5px 10px; border-radius: 7px; }
  .controls .sticks { flex-shrink: 0; height: 28px; gap: 5px; }
  .controls .sticks i { height: 24px; width: 7px; }
  .cast-result { min-height: 30px; gap: 4px 8px; }
  .cast-result strong { font-size: 1.65rem; }
  .cast-result span { max-width: none; font-size: .8rem; }
  #roll-value.opening-roll-values { gap: 6px 14px; }
  #roll-value .roll-side { gap: 0; }
  #roll-value .roll-side-label { font-size: .75rem; }
  #roll-value .roll-side-value { font-size: 1.6rem; }
  #choices { grid-area: choices; margin: 0; padding: 0; border: 0; }
  .last-action { margin: 3px 0; font-size: .875rem; line-height: 1.5; }
  .practice-panel { grid-area: practice; margin: 0; padding: 10px; }
  .practice-panel p { font-size: .875rem; }
  .secondary-actions { grid-area: help; grid-template-columns: minmax(0,1fr); gap: 4px; margin-top: 12px; }
  .secondary-actions .practice-entry { padding: 4px 0; }
  .quick-start { font-size: .9rem; }
  .quick-start ol { grid-template-columns: minmax(0,1fr); gap: 8px; padding-left: 22px; }
  .control-top { grid-area: mode; margin-top: 10px; padding: 12px 0; align-items: center; }
  .control-top label { display: flex; flex: 1 1 180px; flex-wrap: wrap; align-items: center; gap: 6px 8px; white-space: normal; }
  .control-top select { max-width: 100%; min-height: 44px; padding: 6px 8px; }
  .control-top .text-button { margin-left: auto; min-height: 44px; }
  .preferences { grid-area: prefs; margin-top: 4px; padding-top: 12px; align-items: center; }
  .preferences label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  .preferences select, .preferences button { min-height: 44px; padding: 6px 8px; }
  .record { grid-area: record; margin-top: 4px; padding-top: 2px; }
  .turn-line { grid-area: turn; align-items: center; min-height: 26px; padding: 0 4px; font-size: .875rem; }
  .turn-line #move-number { flex-shrink: 0; font: 650 .875rem/1.5 system-ui,-apple-system,sans-serif; }
  .score-vs, .score-dots, .guide-eyebrow { display: none; }
  .scoreboard { min-height: 28px; padding: 0 4px; gap: 12px; }
  .score { display: flex; flex: 1 1 0; flex-wrap: wrap; gap: 0 6px; padding: 2px 0; }
  .score.jade { justify-content: flex-end; text-align: right; }
  .player-name { font-size: 1rem; }
  .score [id^=scoretext] { font-size: .8rem; }
  .board-wrap { max-width: min(100%,clamp(248px,38svh,352px)); }
  .board-label { font-size: 24px; }
  .board-start-hint { margin-top: 8px; font-size: .875rem; }
  .reserves { padding: 0 4px; gap: 8px; font-size: .78rem; }
  .reserves > p { display: none; }
  .reserve-pieces { align-items: center; gap: 4px; min-height: 22px; margin: 0; }
  .reserve-pieces i { width: 16px; height: 16px; }
  .reserve-pieces button { width: auto; margin: 0; padding: 3px 7px; min-height: 44px; }
  #guide-title { font-size: 1.05rem; line-height: 1.4; }
  .status, .move-outcome { margin: 2px 0; font-size: .875rem; line-height: 1.5; }
  .guide-actions { gap: 4px; }
  .guide-actions .primary { min-height: 48px; padding: 8px 12px; font-size: 1rem; }
  #change-selection, #selection-help, #selection-note { display: none; }
  #back-to-move { margin-top: 2px; }
  #piece-options h2, #route-options h2 { margin: 4px 0; font-size: .9rem; }
  .count-label { margin-top: 6px; }
  .piece-choices, .route-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 0; }
  .piece-choices button, .route-choices button { padding: 6px 8px; min-height: 44px; font-size: .875rem; line-height: 1.4; }
  .piece-choices .piece-badge { min-width: 26px; height: 26px; font-size: .8rem; margin-right: 4px; }
  .outcome-badges { margin-top: 4px; }
  .outcome-badge, .route-choices .outcome-badge { margin: 1px; padding: 2px 4px; }
  .piece-choices button small, .route-choices button small { display: block; margin-top: 4px; font-size: .8rem; font-weight: 400; line-height: 1.5; }
  .piece-choices button[aria-pressed=false] small, .route-choices button[aria-pressed=false] small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .route-help { font-size: .8rem; line-height: 1.5; }
  .history { grid-template-columns: minmax(0,1fr); gap: 24px; margin: 28px 0 20px; }
  .history h2 { font-size: 1.3rem; }
  .event-banner { font-size: 1.5rem; }
}
@media (orientation:landscape) and (min-width:560px) and (max-width:1000px) and (max-height:540px) {
  .game-layout {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    grid-template-areas: "guide guide" "stage turn" "stage throw" "stage choices" "practice practice" "help help" "mode prefs" "record record";
    column-gap: 12px;
  }
  .kariuchi[data-play-started=true] .game-layout {
    grid-template-areas: "stage turn" "stage throw" "stage guide" "stage choices" "practice practice" "help help" "mode prefs" "record record";
  }
  .board-wrap { max-width: min(100%,clamp(220px,64svh,320px)); }
  .game-layout > .turn-guide { padding: 8px 10px; }
  .secondary-actions { grid-template-columns: minmax(0,1fr) auto; }
  .control-top { margin-top: 4px; padding-top: 12px; }
}
@media (max-width:359px) {
  main { padding-inline: max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right)); }
  .sitebar nav { column-gap: 10px; }
}
@keyframes kariuchi-choice-lift {
  0%, 100% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-3px) rotate(-3deg); }
  72% { transform: translateY(-1px) rotate(1deg); }
}
@media (prefers-reduced-motion:no-preference) {
  .kariuchi:not([data-effects=quiet]) :is(.board-choice,.piece-choices button,.route-choices button)[aria-pressed=false] > :is(.piece-badge,.game-icon),
  .kariuchi:not([data-effects=quiet]) .reserve-pieces button[aria-pressed=false] > .piece-badge {
    animation: kariuchi-choice-lift 2s ease-in-out infinite;
  }
  .board-choice:nth-child(even) > .piece-badge { animation-delay: -.45s; }
}

.reserve-pieces button .piece-badge { min-width: 23px; height: 23px; margin-right: 4px; font-size: .78rem; }

