/* KAZE — app styles. Taisho-roman look (Japanese retro-modern, 1910s-20s): wine red, mustard gold, cream paper, indigo;
   shippo and yagasuri patterns, serif display type. No shogi imagery: round tokens on a cream tiled board. */
:root {
  --bg0: #24101a; --bg1: #3a1826; --ink: #f6ead2; --muted: #cdb7a8; --line: rgba(246, 234, 210, .17);
  --glass: rgba(246, 234, 210, .07); --glass2: rgba(246, 234, 210, .13);
  --gold: #e3b04b; --gold-ink: #2a1a08; --red: #d7372c; --gain: #a6dba0;
  --sheet: #2b1420; --sheet2: #3d1c2b;
  --serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "Noto Serif JP", "Source Han Serif JP", Georgia, "Times New Roman", serif;
  --deco: "Bodoni MT", "Didot", "Bodoni 72", "Playfair Display", Georgia, "Times New Roman", serif;
  --shippo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23f6ead2' stroke-opacity='.055' stroke-width='1'%3E%3Ccircle cx='0' cy='0' r='22'/%3E%3Ccircle cx='44' cy='0' r='22'/%3E%3Ccircle cx='0' cy='44' r='22'/%3E%3Ccircle cx='44' cy='44' r='22'/%3E%3Ccircle cx='22' cy='22' r='22'/%3E%3C/g%3E%3C/svg%3E");
  --yagasuri: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Crect width='28' height='28' fill='%23f3e7cf'/%3E%3Cpath d='M0 0 14 9v14L0 14ZM14 9 28 0v14L14 23Z' fill='%236b3f73'/%3E%3Cpath d='M7 0v28M21 0v28' stroke='%23f3e7cf' stroke-width='1.2'/%3E%3C/svg%3E");
  --chrome: 362px;
  --cell: max(26px, min(calc((100vw - 40px) / 7), calc((100vh - var(--chrome) - var(--tipx, 0px)) / 7), 68px));
}
@supports (height: 100dvh) {
  :root { --cell: max(26px, min(calc((100vw - 40px) / 7), calc((100dvh - var(--chrome) - var(--tipx, 0px)) / 7), 68px)); }
}
:root.duo { --chrome: 410px; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg0);
  background-image: var(--shippo), radial-gradient(120% 70% at 15% -10%, #6b2234 0, transparent 60%), radial-gradient(90% 60% at 110% 110%, #3a2a5c 0, transparent 55%);
  background-attachment: fixed;
  font: 14px/1.45 system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", sans-serif;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent; overflow: hidden;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; border: none; background: none; padding: 0; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
/* scrollbars: a thin, faint gold thumb on no track (the default bright bar does not belong in this look) */
/* Firefox only: in Chromium these standard properties would switch off the rules below and bring back the arrows */
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: rgba(227, 176, 75, .32) transparent; } }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(227, 176, 75, .32); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(227, 176, 75, .55); }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.defs { position: absolute; width: 0; height: 0; }

/* ---------- game screen ---------- */
.app { display: flex; justify-content: center; height: 100%;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left)); }
/* the strips may be wider than the board (on short screens the board shrinks to fit the height) */
.stage { width: max(calc(var(--cell) * 7 + 24px), min(calc(100vw - 16px), 460px)); display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }

.top { display: flex; align-items: center; gap: 10px; height: 44px; flex: none; margin-bottom: auto; }
.ib { width: 42px; height: 42px; border-radius: 13px; background: var(--glass); border: 1px solid var(--line); display: grid; place-items: center; flex: none; transition: transform .1s, background .15s, opacity .15s; }
.ib:active { transform: scale(.93); background: var(--glass2); }
.ib:disabled { opacity: .32; }
.clock { flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.clock b { color: var(--ink); font-size: 15px; font-family: var(--deco); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.clock .bar { width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.clock .bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: linear-gradient(90deg, #8fbfae, var(--gold)); transition: width .4s; }
.clock.late .bar i { background: linear-gradient(90deg, var(--gold), #ff7a59); }

/* player strips */
.strip { flex: none; container-type: inline-size; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 6px 10px 8px; position: relative;
  transition: border-color .25s, box-shadow .25s, background .25s; }
.strip.turn { border-color: rgba(240, 189, 79, .75); background: rgba(240, 189, 79, .07); box-shadow: 0 0 0 1px rgba(240, 189, 79, .35), 0 0 22px -6px rgba(240, 189, 79, .6); }
.strip.danger { border-color: rgba(255, 99, 82, .9); box-shadow: 0 0 0 1px rgba(255, 99, 82, .5), 0 0 22px -4px rgba(255, 80, 60, .8); }
.head { display: flex; align-items: center; gap: 8px; height: 28px; font-size: 13px; white-space: nowrap; min-width: 0; }
.head .stats { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.mark { width: 18px; height: 18px; border-radius: 50%; flex: none; display: inline-block; vertical-align: -3px;
  background: radial-gradient(circle at 35% 30%, #fffdf5, #f1e3c4 60%, #cfb88e); box-shadow: 0 0 0 1px #6b4a3a, 0 1px 2px rgba(0, 0, 0, .5); }
.mark.d { background: radial-gradient(circle at 35% 30%, #50659b, #26365f 60%, #121b36); box-shadow: 0 0 0 1px rgba(246, 234, 210, .45), 0 1px 2px rgba(0, 0, 0, .5); }
.who { font-weight: 800; overflow: hidden; text-overflow: ellipsis; letter-spacing: .03em; min-width: 0; flex: 0 1 auto; }
.mark, .dots { flex: none; }
/* narrow strips: drop the word "Played" (the tile chip stays), tighten the spacing, then shrink the type */
@container (max-width: 380px) { .played .pl { display: none; } .head, .head .stats { gap: 6px; } }
@container (max-width: 300px) { .head { font-size: 12px; } .pts { font-size: 15px; } .shopbtn { padding: 0 9px; font-size: 12px; } .head, .head .stats { gap: 5px; } }
@container (max-width: 270px) { .played { display: none; } .mark { width: 15px; height: 15px; } }
/* online games also show a clock in this line: make room for it sooner */
@container (max-width: 380px) { .head:has(.clk) .played { display: none; } }
@container (max-width: 320px) { .head:has(.clk) .clk { font-size: 13px; padding: 1px 5px; } }
.badge { position: absolute; top: -9px; left: 12px; z-index: 2; font-size: 11px; font-weight: 900; color: #fff; background: var(--red); border-radius: 9px; padding: 1px 8px; letter-spacing: .06em; line-height: 16px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); animation: pulse-red 1s infinite; }
.pts { font-weight: 900; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--gold); display: inline-flex; align-items: center; gap: 3px; }
.pts::before { content: "★"; font-size: 13px; }
.pts.bump { animation: bump .5s ease-out; }
.mat { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.played { color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.played i { font-style: normal; font-weight: 900; font-size: 12px; color: #fff; background: var(--lc); border-radius: 5px; min-width: 20px; text-align: center; line-height: 18px; }
.played b { color: var(--gain); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
.shopbtn { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--glass); font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px; flex: none; transition: transform .1s; }
.shopbtn:active { transform: scale(.95); }
.shopbtn.can { background: linear-gradient(180deg, #efc56a, #d49a2e); color: var(--gold-ink); border-color: transparent; box-shadow: 0 3px 10px -3px rgba(227, 176, 75, .8); }
.shopbtn.must { animation: pulse-gold .9s infinite; }
.shopbtn:disabled { opacity: .4; }
.rowx { display: flex; align-items: center; gap: 6px; }
.rowx .tiles { display: flex; align-items: center; gap: 5px; }
/* reserve tray: its own inset box, one fixed slot per piece type */
.tray { margin-left: auto; flex: none; display: grid; gap: 3px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .3);
  box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .4), inset 0 2px 6px rgba(0, 0, 0, .35); }
.strip.big .tray { --slot: min(40px, calc(var(--cell) * .7)); grid-template-columns: repeat(3, var(--slot)); grid-auto-rows: 34px; }
.strip.small .tray { --slot: min(25px, calc(var(--cell) * .5)); grid-template-columns: repeat(6, var(--slot)); grid-auto-rows: 26px; }
.slot { position: relative; display: grid; place-items: center; border-radius: 8px; transition: background .15s; }
.slot .pc { --s: min(30px, calc(var(--cell) * .62)); }
.strip.small .slot .pc { --s: min(22px, calc(var(--cell) * .44)); }
.slot.empty { cursor: default; }
.slot.empty .pc { opacity: .15; filter: grayscale(1); }
.slot:not(.empty):not([data-hand]) { cursor: default; }
.slot.sel { background: rgba(227, 176, 75, .28); box-shadow: inset 0 0 0 1.5px var(--gold); }
.slot.sel .pc { transform: scale(1.1); }
.slot.fresh .pc { animation: deal .5s cubic-bezier(.2, .9, .3, 1.2); }
.slot .cnt { position: absolute; bottom: -1px; right: -1px; z-index: 5; font-size: 11px; font-weight: 900; background: var(--gold); color: var(--gold-ink); border-radius: 8px; padding: 0 4px; line-height: 14px; }
.strip.small .slot .cnt { font-size: 11px; line-height: 13px; padding: 0 3px; right: -3px; bottom: -3px; }
.strip.big .rowx { height: 80px; }
.strip.small .rowx { height: 36px; }

/* wind tiles */
.tile { --w: min(48px, calc(var(--cell) * .9)); width: var(--w); height: calc(var(--w) * 1.24); border-radius: 8px; position: relative; flex: none;
  background: linear-gradient(165deg, color-mix(in srgb, var(--lc) 86%, #fff) 0%, var(--lc) 45%, color-mix(in srgb, var(--lc) 80%, #000) 100%);
  color: #fff8e6; font-family: var(--deco); font-weight: 700; font-variant-numeric: lining-nums; font-size: calc(var(--w) * .56); line-height: 1; display: grid; place-items: center; padding-bottom: 2px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .3); box-shadow: 0 3px 0 color-mix(in srgb, var(--lc) 55%, #000), 0 6px 10px -4px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .14s cubic-bezier(.2, .9, .3, 1.3), box-shadow .14s, filter .14s; }
.tile::before { content: ""; position: absolute; inset: 3px; border-radius: 5px; border: 1px solid rgba(255, 248, 230, .75); outline: 1px solid rgba(255, 248, 230, .3); outline-offset: -3px; pointer-events: none; }
.strip.small .tile { --w: min(27px, calc(var(--cell) * .56)); border-radius: 7px; box-shadow: 0 2px 0 color-mix(in srgb, var(--lc) 55%, #000), inset 0 1px 0 rgba(255, 255, 255, .4); }
.strip.small .tile::before { inset: 2px; border-radius: 4px; outline: none; }
.tile.sel { transform: translateY(-6px); box-shadow: 0 3px 0 color-mix(in srgb, var(--lc) 55%, #000), 0 0 0 2.5px var(--gold), 0 12px 16px -6px rgba(0, 0, 0, .7); }
.tile.ask { animation: ask .9s infinite; }
.tile.fresh { animation: deal .5s cubic-bezier(.2, .9, .3, 1.2); }
/* while the player chooses a tile, the one that scores carries a +1 */
.tile.gain::before { content: "+1"; inset: auto -6px auto auto; top: -8px; border: none; border-radius: 8px; padding: 0 4px; font: 900 10px/15px system-ui, sans-serif; color: #fff; background: #1f9d49; text-shadow: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); z-index: 2; }
.tile.new::after { content: ""; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid var(--gold); }
.tile.static { cursor: default; }

/* board: cream paper tiles on a dark lacquer tray with a gold line */
.frame { position: relative; flex: none; align-self: center; padding: 5px; border-radius: 12px; background: linear-gradient(160deg, #3b2620, #1a100e); border: 1px solid rgba(227, 176, 75, .75);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, .75), inset 0 0 0 2px #1a100e, inset 0 0 0 3px rgba(227, 176, 75, .35); }
.frame.shake { animation: shake .4s; }
.board { display: grid; grid-template-columns: repeat(7, var(--cell)); grid-template-rows: repeat(7, var(--cell)) 20px; gap: 2px; }
.cell { position: relative; display: grid; place-items: center; border-radius: 5px; background: #eedfc0; cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(110, 70, 30, .2), inset 0 1px 0 rgba(255, 255, 255, .65); transition: background .15s; }
.cell.zone { background: #e6c7b0; }
.cell.last { background: #e9b458; }
.cell.lane { background: color-mix(in srgb, var(--lc) 40%, #f6ecd6); }
.cell.lane.last { background: color-mix(in srgb, var(--lc) 30%, #e9b458); }
.cell.target::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(70, 36, 24, .62); box-shadow: 0 0 0 3px rgba(255, 250, 235, .6); pointer-events: none; z-index: 3; animation: pop .18s ease-out; }
.cell.target.cap::after { width: 96%; height: 96%; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 3.5px rgba(215, 55, 44, .95); }
.cell.chosen { box-shadow: inset 0 0 0 3px #7a2030; }
.cell.check { background: #ff7a66; animation: throb-bg .8s infinite; }
.cell.mated { background: #e23a2c; }
.cell.checker { box-shadow: inset 0 0 0 3px rgba(215, 55, 44, .95); }
.cell.movable .pc { animation: bob 1s infinite; }

/* tokens */
.pc { --s: calc(var(--cell) * .88); width: var(--s); height: var(--s); position: relative; z-index: 1; flex: none; display: block;
  filter: drop-shadow(0 2px 1.5px rgba(50, 25, 10, .55)); }
.pc svg { width: 100%; height: 100%; display: block; }
.tk .rim { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.tk .pips { opacity: .42; } /* movement marks: there to read, quieter than the icon */
.tk.l .base { fill: url(#tkL); } .tk.l .rim { stroke: #6b4a3a; } .tk.l .ink { color: #2a1e1a; fill: #2a1e1a; }
.tk.d .base { fill: url(#tkD); } .tk.d .rim { stroke: #0d1530; } .tk.d .ink { color: #f6ead2; fill: #f6ead2; }
.tk .pip-ring { fill: none; stroke: currentColor; stroke-width: 2.6; }
.tk.pro .rim { stroke: var(--gold); stroke-width: 6; }
.tk.l.pro .icon { color: #a22c38; } .tk.d.pro .icon { color: #f0c463; }
.pc.sel { transform: translateY(-6%) scale(1.08); z-index: 4; filter: drop-shadow(0 0 3px #fff8e0) drop-shadow(0 0 8px #b8394a); }
.pc.ghost { position: absolute; z-index: 0; pointer-events: none; }
.cell.promoted::after { content: ""; position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 230, 140, .95) 0, rgba(255, 150, 60, .6) 40%, transparent 70%); animation: burst .55s ease-out forwards; pointer-events: none; z-index: 5; }
.plus { position: absolute; top: 0; right: 0; z-index: 3; font-size: clamp(10px, calc(var(--cell) * .24), 12px); line-height: 1.35; font-weight: 900; color: #fff; background: #1f9d49; border-radius: 7px; padding: 0 3px; pointer-events: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.float { position: absolute; z-index: 6; top: 0; left: 50%; font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 0 4px #1f9d49, 0 0 8px #1f9d49, 0 1px 0 #0b4d20; pointer-events: none; animation: rise 1s ease-out forwards; }
.flabel { display: flex; align-items: center; justify-content: center; gap: 3px; }
.flabel b { font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 12px; line-height: 16px; color: #fff; background: var(--lc); border-radius: 5px; min-width: 18px; text-align: center; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.flabel i { width: 6px; height: 6px; border-radius: 50%; background: var(--lc); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }


.hint { flex: none; height: 32px; margin-bottom: auto; padding: 0 4px; text-align: center; font-size: 13px; line-height: 1.2; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; text-wrap: balance; }
.hint b { color: var(--ink); }
.hint .g { color: var(--gain); font-weight: 800; }
.hint .warn { color: #ff8a78; font-weight: 800; }
.hint button { height: 28px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass2); padding: 0 14px; font-weight: 700; color: var(--ink); flex: none; }
.hint button:disabled { opacity: .35; }
.hint .nav { width: 38px; padding: 0; font-size: 12px; }
.hint.tipon { height: auto; min-height: 32px; padding: 6px 8px; border-radius: 12px; background: rgba(227, 176, 75, .12); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .5); color: var(--ink); text-align: left; justify-content: space-between; }
.hint .tip { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.45; min-width: 0; }
.hint .tip > i { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-style: normal; font-weight: 900; font-size: 12px; display: grid; place-items: center; }
.hint .tip b { color: #f6d98c; }
.hint .mv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 12.5px; }
.hint button, .hint b { white-space: nowrap; }

/* a reserve piece arriving on the wind */
.gust { position: absolute; width: 2.5px; border-radius: 2px; opacity: 0; transform-origin: center bottom;
  background: linear-gradient(0deg, transparent, rgba(255, 250, 235, .95) 72%, transparent); animation: gust-up .5s cubic-bezier(.2, .7, .3, 1) forwards; }
.gust.down { transform-origin: center top; background: linear-gradient(180deg, transparent, rgba(255, 250, 235, .95) 72%, transparent); animation-name: gust-down; }
.gust:nth-child(odd) { width: 1.5px; }
.puff { position: absolute; border-radius: 50%; border: 2px solid rgba(255, 250, 235, .95); opacity: 0; transform: translate(-50%, -50%) scale(.4); animation: puff .45s ease-out .32s forwards; }

/* board effects */
.fx { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; pointer-events: none; z-index: 8; }
.marks { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.marks svg { position: absolute; left: 0; top: 0; overflow: visible; }
.marks .mkdrop { position: absolute; opacity: .72; filter: drop-shadow(0 0 6px rgba(63, 191, 111, .9)); animation: pop .3s cubic-bezier(.2, 1.5, .4, 1) both; }
.marks .mkdrop svg { position: static; width: 100%; height: 100%; display: block; }
.marks .mk { position: absolute; transform: translate(-50%, -55%); font-size: 11px; padding: 2px 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); animation: mkpop .3s cubic-bezier(.2, 1.5, .4, 1) both; }
.banner { position: absolute; left: -12%; right: -12%; top: 50%; height: 22%; display: grid; place-items: center;
  background: linear-gradient(90deg, transparent, rgba(110, 18, 34, .96) 16%, rgba(176, 40, 58, .98) 50%, rgba(110, 18, 34, .96) 84%, transparent);
  box-shadow: 0 -3px 0 var(--gold) inset, 0 -5px 0 rgba(110, 18, 34, .9) inset, 0 -6px 0 rgba(227, 176, 75, .6) inset, 0 3px 0 var(--gold) inset, 0 5px 0 rgba(110, 18, 34, .9) inset, 0 6px 0 rgba(227, 176, 75, .6) inset;
  animation: sweep 1.2s cubic-bezier(.2, .8, .2, 1) forwards; }
.banner span { font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 10.5vw, 54px); line-height: 1; color: #fff3d6; letter-spacing: .2em; padding-left: .2em; text-shadow: 0 3px 0 rgba(0, 0, 0, .3), 0 0 18px rgba(255, 220, 160, .6); }
.banner.info { background: linear-gradient(90deg, transparent, rgba(22, 32, 62, .96) 16%, rgba(40, 58, 104, .98) 50%, rgba(22, 32, 62, .96) 84%, transparent); height: 18%;
  box-shadow: 0 -2px 0 var(--gold) inset, 0 2px 0 var(--gold) inset; }
.banner.info span { font-size: clamp(18px, 6vw, 28px); letter-spacing: .18em; padding-left: .18em; }
.stamp { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(8, 12, 24, .45), rgba(8, 12, 24, .8)); animation: fadein .25s both; }
.stamp.out { animation: fadeout .35s both; }
.stamp b { display: block; width: 130%; text-align: center; padding: .4em 0 .44em; font-family: var(--serif); font-weight: 900; font-size: clamp(34px, 12vw, 64px); line-height: 1; letter-spacing: .14em; color: #fff3d6;
  background: linear-gradient(90deg, #5a0e1c, #a8263a 30%, #c8384c 50%, #a8263a 70%, #5a0e1c);
  box-shadow: 0 -4px 0 var(--gold) inset, 0 -7px 0 #7a1626 inset, 0 -8px 0 rgba(227, 176, 75, .7) inset, 0 4px 0 var(--gold) inset, 0 7px 0 #7a1626 inset, 0 8px 0 rgba(227, 176, 75, .7) inset, 0 14px 40px rgba(0, 0, 0, .6);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .28); transform: rotate(-6deg); animation: stampin .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.stamp.long b { font-size: clamp(26px, 9.2vw, 50px); }
.stamp.gold b { color: var(--gold-ink); background: linear-gradient(90deg, #a8730c, #e3b04b 30%, #f6d98c 50%, #e3b04b 70%, #a8730c); text-shadow: 0 2px 0 rgba(255, 255, 255, .35);
  box-shadow: 0 -4px 0 #5a0e1c inset, 0 4px 0 #5a0e1c inset, 0 14px 40px rgba(0, 0, 0, .6); }

/* ---------- sheets ---------- */
#scrim { position: fixed; inset: 0; background: rgba(16, 6, 10, .64); z-index: 60; animation: fadein .2s both; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; margin: 0 auto; max-width: 520px; max-height: min(92vh, 760px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sheet2), var(--sheet)); border: 1px solid var(--line); border-bottom: none; border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); animation: up .26s cubic-bezier(.2, .9, .3, 1) both; }
/* 2026-11-16: on phones 100vh is the height with the browser's bars hidden, so a sheet of 92vh went under the address
   bar (iPhone, Chrome). The dynamic height is what is visible now; the sheet keeps a gap above it. */
@supports (height: 100dvh) {
  .sheet { max-height: min(92dvh, calc(100dvh - 20px - env(safe-area-inset-top)), 760px); }
}
.sheet::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); margin: 8px auto 0; flex: none; }
.sheet .sh { display: flex; align-items: center; gap: 10px; padding: 8px 16px 6px; flex: none; }
.sheet .sh h3 { margin: 0; font-size: 19px; flex: 1; font-family: var(--serif); font-weight: 800; letter-spacing: .08em; }
.sheet .sb { padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet p.sub { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.xbtn { width: 36px; height: 36px; border-radius: 50%; background: var(--glass); display: grid; place-items: center; }
.xbtn svg { width: 18px; height: 18px; }
@media (min-width: 700px) and (min-height: 700px) {
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 22px; border-bottom: 1px solid var(--line); animation: popin .22s ease-out both; }
  .sheet::before { display: none; }
  .sheet .sh { padding-top: 16px; }
}

.btn { height: 50px; padding: 0 20px; border-radius: 12px; border: 1px solid rgba(227, 176, 75, .38); background: var(--glass); font-weight: 800; font-size: 15px; letter-spacing: .04em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #efc56a, #d49a2e); color: var(--gold-ink); border-color: #f6dfa4; box-shadow: 0 6px 18px -6px rgba(227, 176, 75, .8), inset 0 0 0 2px #d49a2e, inset 0 0 0 3px rgba(255, 246, 220, .55); }
.btn.danger { color: #ff9c8c; border-color: rgba(255, 120, 100, .4); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .4; }
.col { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lbl { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; margin: 14px 0 6px; }
.lbl:first-child { margin-top: 2px; }
.seg { display: flex; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1 1 auto; min-width: 0; padding: 0 6px; white-space: nowrap; height: 38px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--glass2); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.seg .mark { width: 14px; height: 14px; vertical-align: 0; }
/* 1st-9th dan in three rows, then Meijin, then Fujin (the hidden boss) across the width */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.level { height: 46px; padding: 0 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--glass); font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: .08em; display: grid; place-items: center; transition: border-color .15s, background .15s; }
.level.meijin, .level.fujin { grid-column: 1 / -1; letter-spacing: .3em; }
.level.fujin { color: #f6d98c; background: linear-gradient(135deg, rgba(38, 54, 95, .9), rgba(18, 27, 54, .95)); border-color: rgba(127, 155, 216, .6); }
.level.on { border-color: var(--gold); background: rgba(227, 176, 75, .13); }
select { font: inherit; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: #2b1420; color: var(--ink); width: 100%; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.opt:last-child { border-bottom: none; }
.opt > span { flex: 1; font-weight: 600; }
.opt > span small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); line-height: 1.45; margin: 2px 0 8px; }
.opt:has(small) { padding-top: 8px; }
.opt .seg { width: 176px; flex: none; }
.opt .seg button { height: 34px; font-size: 13px; }
.opt.wrap { flex-wrap: wrap; row-gap: 0; padding-top: 6px; }
.opt .note { flex-basis: 100%; font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 4px 0 10px; }
.sw { width: 52px; height: 30px; border-radius: 15px; background: rgba(255, 255, 255, .16); position: relative; transition: background .2s; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.sw.on { background: #5c9a6c; }
.sw.on::after { transform: translateX(22px); }

/* starting-position preview in the new-game sheet */
.laynote { margin: 8px 0 0; min-height: 2.9em; }
.laypv { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 5px; border-radius: 10px; margin-top: 6px; background: linear-gradient(160deg, #3b2620, #1a100e); border: 1px solid rgba(227, 176, 75, .6); }
.laypv .c { aspect-ratio: 1; display: grid; place-items: center; border-radius: 4px; background: #eedfc0; }
.laypv .pc { width: 86%; height: auto; aspect-ratio: 1; }
.laypv .c.q { color: rgba(110, 70, 30, .5); font: 700 20px var(--deco); }

/* online play */
.field { width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--ink); font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text; }
.field:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(227, 176, 75, .25); }
.sub.nr { margin: 6px 2px 0; }
.netcard { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); }
.netcard > b { font-family: var(--serif); font-size: 16px; letter-spacing: .06em; }
.netcard > span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.netcard .lbl { margin-top: 4px; }
.joinrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.joinrow .btn { padding: 0 18px; }
.clk { flex: none; font-family: var(--deco); font-variant-numeric: lining-nums tabular-nums; font-weight: 700; font-size: 14px; padding: 1px 7px; border-radius: 8px; background: rgba(0, 0, 0, .3); color: var(--muted); }
.clk.run { color: var(--ink); background: rgba(227, 176, 75, .22); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .6); }
.clk.low.run { color: #fff; background: var(--red); box-shadow: none; }
.sb.center { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sb.center .btn.wide { margin-top: 8px; }
.sb .big { margin: 0; font-weight: 800; font-size: 15px; }
.bigcode { font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 44px; font-weight: 700; letter-spacing: .12em; color: var(--gold); line-height: 1.1; -webkit-user-select: text; user-select: text; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(227, 176, 75, .25); border-top-color: var(--gold); animation: spin 1s linear infinite; margin: 6px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* shop */
.items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--glass); font-size: 12px; position: relative; transition: transform .1s; }
.item .pc { --s: 44px; margin-bottom: 3px; }
.item b { font-size: 13px; }
.item .cost { font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.item .cost::before { content: "★"; font-size: .85em; margin-right: 1px; }
.item .left { color: var(--muted); font-size: 11px; }
.item:disabled { opacity: .38; }
.item:not(:disabled) { border-color: rgba(227, 176, 75, .8); background: rgba(227, 176, 75, .1); }
.item:not(:disabled):active { transform: scale(.96); }

/* review screen (after the game): the board stays; one panel under it (beside it on wide screens) holds the result,
   the advantage chart whose cursor follows the board, the step buttons, the moves and what to do next */
.review { display: none; }
:root.rv { --chrome: 530px; }
:root.rv .hint { display: none; }
/* a very short screen cannot fit board and panel: the page scrolls instead of hiding the buttons */
:root.rv .app { overflow-y: auto; }
:root.rv .review { display: flex; flex-direction: column; gap: 6px; flex: none; margin-bottom: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 7px 9px 9px; }
.rvhead { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.rvt { display: flex; flex-direction: column; flex: none; max-width: 55%; } /* the title keeps its line; the chips wrap */
.rvt small { font-family: var(--serif); font-size: 11px; letter-spacing: .26em; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.rvhead.win .rvt small { color: var(--gold); }
.rvt b { font-family: var(--serif); font-size: 19px; font-weight: 900; letter-spacing: .06em; line-height: 1.25; overflow-wrap: anywhere; }
.rvhead.win .rvt b { background: linear-gradient(180deg, #fff3c9, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rvhead.lose .rvt b { color: #d9c7b8; }
.rvchips { margin-left: auto; flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.rvchips > span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(246, 234, 210, .12); white-space: nowrap; }
.rate b { font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 12px; color: var(--ink); }
.rate i { font-style: normal; font-weight: 900; margin-left: 2px; } .rate .up { color: var(--gain); } .rate .down { color: #ff9c8c; }
.rvwhy { display: none; margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
/* the chart: the line is an SVG stretched to the box; dots and labels are HTML on top so they stay round */
.gwrap { position: relative; }
.gbox { position: relative; height: 56px; border-radius: 8px; background: rgba(246, 234, 210, .035); }
.gbox svg.graph { width: 100%; height: 100%; display: block; }
.ghit { position: absolute; inset: 0; z-index: 3; cursor: pointer; touch-action: none; }
.gdot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; border: 1.5px solid #2b1420; pointer-events: none; z-index: 1; }
.gdot.win, .gdot.lose { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.gdot.win { background: #e3b04b; } .gdot.lose { background: #d7372c; } .gdot.good { background: #7cc48c; } .gdot.bad { background: #e08a3c; }
.gdot.cur { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #fff3d6; border: 2px solid #ff6b5a; z-index: 2; }
.gbox .gl { position: absolute; left: 6px; font-size: 11px; font-weight: 700; pointer-events: none; opacity: .85; line-height: 1.2; }
.gbox .gl.up { top: 3px; color: var(--gold); } .gbox .gl.dn { bottom: 3px; color: #a9bdea; }
.gprog { position: absolute; right: 6px; top: 3px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.gprog.deep { color: #9fe0b4; }
/* asks for the deep review: a chip in the result head */
.rvchips .gdeep { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; color: #9fe0b4; background: rgba(16, 34, 22, .7); box-shadow: inset 0 0 0 1px rgba(63, 191, 111, .65); }
.rvchips .gdeep:active { transform: scale(.95); }
.gwrap .ticks { position: relative; height: 13px; display: none; }
.gwrap .ticks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; line-height: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gwrap .ticks span:first-child { transform: none; } .gwrap .ticks span:last-child { transform: translateX(-100%); }
/* a move: number, piece, notation */
.mvchip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.mvchip em { font-style: normal; font-family: var(--deco); font-variant-numeric: lining-nums tabular-nums; font-weight: 700; color: var(--muted); min-width: 1.6em; text-align: right; }
.mvchip .mini { width: 20px; height: 20px; flex: none; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.mvchip .mini svg { width: 100%; height: 100%; display: block; }
.mvchip > span:not(.mini):not(.x) { min-width: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mvchip .x { color: var(--muted); font-size: 11px; margin: 0 -3px; }
/* step buttons around the move on the board and the chances after it */
/* a fixed height whatever the two lines hold, so stepping never moves the board (the page may be scrolled) */
.rvstep { display: flex; align-items: center; gap: 4px; height: 38px; flex: none; }
.rvstep .nav { width: 34px; height: 34px; border-radius: 10px; background: var(--glass2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; transition: transform .1s; }
.rvstep .nav:active { transform: scale(.93); }
.rvstep .nav svg { width: 18px; height: 18px; }
.rvstep .nav:disabled { opacity: .3; }
/* the move on the board, and under it the viewed side's chances after it */
.rvcur { flex: 1; min-width: 0; height: 38px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 4px; }
.rvcur > * { flex: none; height: 18px; }
.rvcur .mvchip { overflow: hidden; }
/* two lines in the height of the step buttons */
.rvcur .mvchip .mini { width: 16px; height: 16px; }
.rvcur .mvchip > span:not(.mini):not(.x) { line-height: 16px; }
.rvl1 { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.rvl1 .pct { font-family: var(--deco); font-variant-numeric: lining-nums tabular-nums; font-size: 13px; line-height: 1; flex: none; }
.rvbest { display: flex; align-items: center; gap: 6px; min-width: 0; color: #9fe0b4; }
.rvbest em { font-style: normal; font-size: 11px; font-weight: 800; color: #3fbf6f; white-space: nowrap; flex: none; }
.rvbest .mvchip { font-size: 12px; gap: 4px; overflow: hidden; }
.rvbest .mvchip .mini { width: 16px; height: 16px; }
.rvbest .ok { font-style: normal; color: #3fbf6f; font-weight: 900; }
button.rvbest.alt { width: 100%; text-align: left; padding: 0 6px; margin: 0 -6px; border-radius: 7px; background: rgba(63, 191, 111, .12); box-shadow: inset 0 0 0 1px rgba(63, 191, 111, .45); }
button.rvbest.alt .go { margin-left: auto; display: grid; place-items: center; color: #3fbf6f; flex: none; }
button.rvbest.alt .go svg { width: 14px; height: 14px; }
.rvpraise { font-size: 12px; font-weight: 800; color: #9fe0b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chance { display: flex; align-items: center; gap: 6px; }
.chance .bar { flex: 1; height: 5px; border-radius: 3px; background: #7f9bd8; overflow: hidden; }
.chance .bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px 0 0 3px; }
/* the moves: one scrolling row (a column on wide screens); the key moments carry their tag */
.rvlist { display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden; padding-bottom: 3px; overscroll-behavior: contain; }
.rvm { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 5px; border-radius: 9px; background: rgba(0, 0, 0, .2); border: 1.5px solid transparent; text-align: left; }
.rvm .mvchip { font-size: 12px; gap: 4px; }
.rvm .mvchip .mini { width: 17px; height: 17px; }
.rvm.on { border-color: rgba(255, 107, 90, .9); background: rgba(255, 107, 90, .13); }
.tag { font-weight: 900; font-size: 11px; padding: 1px 5px; border-radius: 5px; white-space: nowrap; }
.tag.win { background: var(--gold); color: var(--gold-ink); } .tag.lose { background: var(--red); color: #fff; }
.tag.good { background: #4f8a5f; color: #fff; } .tag.bad { background: #c1762b; color: #fff; }
.rvbtns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 6px; margin-top: 1px; }
.rvbtns.three { grid-template-columns: 1.3fr 1fr 1fr; }
.rvbtns .btn { height: 42px; padding: 0 8px; font-size: 13.5px; gap: 5px; white-space: nowrap; }
.rvbtns .btn svg { width: 17px; height: 17px; flex: none; }
@media (max-width: 374px) {
  .rvbtns .btn { font-size: 12.5px; letter-spacing: 0; }
  .rvbtns.three .btn svg { display: none; }
  .rvchips > span:nth-child(2) { display: none; }
}
/* wide screens: the panel stands beside the board, with room for the reason, a taller chart and a list of moves */
@media (min-width: 900px) {
  :root.rv { --chrome: 262px; }
  :root.rv .stage { display: grid; grid-template-columns: calc(var(--cell) * 7 + 24px) 360px; grid-template-rows: auto auto auto auto; column-gap: 20px; row-gap: 6px; align-content: center; width: auto; }
  :root.rv .stage > * { grid-column: 1; }
  :root.rv .top { margin-bottom: 0; }
  /* size containment: the long list scrolls inside the panel instead of stretching the board's rows */
  :root.rv .review { grid-column: 2; grid-row: 1 / 5; margin: 0; padding: 14px 14px 14px; gap: 10px; min-height: 0; contain: size; }
  .rvt b { font-size: 24px; }
  .rvwhy { display: block; }
  .gbox { height: 118px; }
  .gwrap .ticks { display: block; }
  .rvlist { flex-direction: column; gap: 3px; overflow-x: hidden; overflow-y: auto; flex: 1; min-height: 90px; padding: 0 2px 0 0; }
  .rvm { width: 100%; height: auto; min-height: 32px; padding: 3px 9px 3px 5px; justify-content: space-between; }
  .rvm .mvchip { font-size: 12.5px; }
  .rvbtns .btn { height: 46px; }
}

/* help */
.help h4 { margin: 16px 0 6px; font-size: 15px; font-family: var(--serif); letter-spacing: .08em; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.help h4:first-child { margin-top: 2px; }
.help h4 i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-size: 12px; font-weight: 900; display: grid; place-items: center; flex: none; }
.help p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.65; }
.help p b { color: #f6d98c; }
.help .demo { display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .22); border-radius: 14px; padding: 10px 12px; margin: 8px 0; font-size: 12.5px; }
.help .demo .tile { --w: 34px; flex: none; }
.help .demo .pc { --s: 38px; }
.help .demo .arrow { color: var(--muted); font-size: 16px; }
.help .demo .gain { color: var(--gain); font-weight: 900; font-size: 16px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12.5px; margin-top: 8px; }
.legend div { display: flex; align-items: center; gap: 10px; }
.legend .pc { --s: 46px; }
.legend b { display: block; font-size: 13.5px; }
.legend small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.prices { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.prices span { background: rgba(0, 0, 0, .22); border-radius: 10px; padding: 4px 10px; font-size: 12.5px; }
.prices span b { color: var(--gold); }
.log { font: 12px/1.6 ui-monospace, Consolas, monospace; -webkit-user-select: text; user-select: text; }
.log div { border-bottom: 1px dashed rgba(255, 255, 255, .1); padding: 2px 0; }

/* ---------- home ---------- */
.home { position: fixed; inset: 0; z-index: 40; background: var(--bg0); overflow: hidden; display: flex; align-items: center; justify-content: center;
  background-image: var(--shippo), radial-gradient(120% 70% at 15% -10%, #7a2638 0, transparent 60%), radial-gradient(90% 60% at 110% 110%, #40306a 0, transparent 55%);
  transition: opacity .35s, visibility .35s; }
.home::before, .home::after { content: ""; position: absolute; left: 0; right: 0; height: 28px; background: var(--yagasuri) repeat-x; box-shadow: 0 0 0 2px var(--gold), 0 0 0 5px var(--bg0), 0 0 0 6px rgba(227, 176, 75, .5); }
.home::before { top: calc(14px + env(safe-area-inset-top)); }
.home::after { bottom: calc(14px + env(safe-area-inset-bottom)); }
.home.off { opacity: 0; visibility: hidden; pointer-events: none; }
.wind i { position: absolute; left: -40%; height: 2px; width: 40%; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: gust 6s linear infinite; opacity: 0; }
.wind i:nth-child(1) { top: 14%; animation-delay: 0s; } .wind i:nth-child(2) { top: 27%; animation-delay: 2.2s; width: 55%; }
.wind i:nth-child(3) { top: 43%; animation-delay: 1.1s; width: 30%; } .wind i:nth-child(4) { top: 62%; animation-delay: 3.6s; }
.wind i:nth-child(5) { top: 78%; animation-delay: .5s; width: 60%; } .wind i:nth-child(6) { top: 90%; animation-delay: 4.4s; width: 35%; }
.home-in { position: relative; width: min(100%, 400px); padding: calc(20px + env(safe-area-inset-top)) 28px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; max-height: 100%; }
.hero { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 10px; }
.hero::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, rgba(227, 176, 75, .34), transparent 68%); }
.hero::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid rgba(227, 176, 75, .7); outline: 1px dashed rgba(227, 176, 75, .45); outline-offset: 6px; }
.hero svg { width: 112px; height: 112px; position: relative; animation: floaty 5s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
/* the name (2026-11-16): Windcrown, nine capitals where KAZE had four: smaller and tighter, and it fits 320px */
.logo { margin: 0; font-family: var(--deco); font-size: clamp(26px, 9.4vw, 44px); line-height: 1; font-weight: 700; letter-spacing: .1em; padding-left: .1em; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(180deg, #fff6df 20%, #e3b04b 110%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin: 12px 0 0; color: var(--ink); font-family: var(--serif); font-size: 14px; letter-spacing: .34em; padding-left: .34em; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.tagline::before, .tagline::after { content: ""; width: 26px; height: 1px; background: var(--gold); }
.home-btns { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.home .btn { height: 54px; font-size: 16px; border-radius: 16px; }
.home-top { position: absolute; top: calc(54px + env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: flex; gap: 8px; z-index: 2; }
/* the three ways to play on the home screen, and the two choices of "play someone" (same look) */
.modebtn, .choice { display: grid; grid-template-columns: 40px 1fr 18px; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 8px 12px 8px 12px; text-align: left;
  border-radius: 16px; border: 1px solid rgba(227, 176, 75, .32); background: var(--glass); transition: transform .1s, background .15s, border-color .15s; }
.modebtn:active, .choice:active { transform: scale(.98); background: var(--glass2); }
.modebtn i, .choice i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(227, 176, 75, .14); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .45); }
.modebtn span, .choice span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.modebtn b, .choice b { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; line-height: 1.25; }
.modebtn small, .choice small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.modebtn em, .choice em { color: var(--muted); display: grid; place-items: center; }
.modebtn em svg, .choice em svg { width: 18px; height: 18px; }
.modebtn.hot, .choice.hot { border-color: rgba(227, 176, 75, .8); background: linear-gradient(135deg, rgba(227, 176, 75, .18), rgba(227, 176, 75, .05)); box-shadow: 0 6px 18px -10px rgba(227, 176, 75, .8); }
.modebtn.hot i, .choice.hot i { background: linear-gradient(180deg, #efc56a, #d49a2e); color: var(--gold-ink); box-shadow: none; }
.choice { margin-top: 10px; }
.choice:disabled { opacity: .5; }
/* "play someone": name and rating */
.profile { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .22); }
.profile label { display: flex; flex-direction: column; min-width: 0; }
.profile .lbl { margin: 0 0 6px; }
.ratingbox { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 84px; height: 66px; padding: 4px 10px; border-radius: 12px; border: 1px solid rgba(227, 176, 75, .45); background: rgba(227, 176, 75, .08); }
.ratingbox span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.ratingbox b { font-family: var(--deco); font-variant-numeric: lining-nums tabular-nums; font-size: 24px; line-height: 1.1; color: var(--gold); }
.ratingbox small { font-size: 11px; color: var(--muted); }
.sub.lead { margin: 2px 0 12px; font-size: 12.5px; line-height: 1.6; }
.seg + .sub.lead { margin-top: 12px; }
.sub.note { margin: 14px 0 0; text-align: center; }
.codefield { height: 60px; text-align: center; font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 32px; letter-spacing: .35em; padding-left: calc(12px + .35em); }
/* watch: the two AIs */
.vs { display: flex; flex-direction: column; gap: 8px; }
.vsrow { display: grid; grid-template-columns: 18px 44px 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .22); }
.vsrow span { font-weight: 700; font-size: 13px; }
.vsrow select { height: 40px; }
.home .ver { margin-top: 18px; font-size: 11px; font-family: var(--deco); font-variant-numeric: lining-nums; color: rgba(246, 234, 210, .5); letter-spacing: .2em; }
@media (max-height: 620px) { .hero { width: 96px; height: 96px; } .hero svg { width: 74px; height: 74px; } .logo { font-size: clamp(24px, 8.4vw, 36px); } .tagline { margin-top: 8px; } .home-btns { margin-top: 18px; gap: 8px; } .home .btn { height: 46px; } .modebtn { min-height: 54px; } .home::before, .home::after { height: 14px; } .home-top { top: calc(38px + env(safe-area-inset-top)); } }
@media (max-height: 700px) and (min-height: 621px) { .hero { width: 120px; height: 120px; } .hero svg { width: 92px; height: 92px; } .home-btns { margin-top: 22px; } }

#toast { position: fixed; top: calc(56px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -10px); background: rgba(255, 250, 240, .97); color: #22190f; padding: 8px 16px; border-radius: 18px; font-size: 13px; font-weight: 800; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 80; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

@keyframes mkpop { from { transform: translate(-50%, -55%) scale(.4); opacity: 0; } to { transform: translate(-50%, -55%); opacity: 1; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes popin { from { transform: translateY(-50%) scale(.92); opacity: 0; } to { transform: translateY(-50%); opacity: 1; } }
@keyframes deal { 0% { transform: translateY(-26px) scale(.6) rotate(-14deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes ask { 50% { transform: translateY(-5px); box-shadow: 0 3px 0 color-mix(in srgb, var(--lc) 55%, #000), 0 0 0 2.5px rgba(255, 255, 255, .85), 0 10px 14px -6px rgba(0, 0, 0, .7); } }
@keyframes rise { from { transform: translate(-50%, 10%) scale(.7); opacity: 0; } 20% { transform: translate(-50%, -20%) scale(1.25); opacity: 1; } to { transform: translate(-50%, -130%) scale(1); opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes dot { 0%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes bump { 30% { transform: scale(1.5); } 100% { transform: none; } }
@keyframes bob { 50% { transform: translateY(-6%); } }
@keyframes throb-bg { 50% { background: #ffc2b6; } }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 4px rgba(215, 55, 44, .35); } }
@keyframes pulse-gold { 50% { box-shadow: 0 0 0 5px rgba(240, 189, 79, .4); } }
@keyframes burst { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.1); opacity: 0; } }
@keyframes shake { 15% { transform: translate(-5px, 2px); } 30% { transform: translate(5px, -2px); } 45% { transform: translate(-4px, -1px); } 60% { transform: translate(3px, 1px); } 80% { transform: translate(-2px, 0); } }
@keyframes sweep { 0% { transform: translate(-105%, -50%) skewY(-4deg); opacity: 0; } 16% { transform: translate(0, -50%) skewY(-4deg); opacity: 1; } 74% { transform: translate(0, -50%) skewY(-4deg); opacity: 1; } 100% { transform: translate(105%, -50%) skewY(-4deg); opacity: 0; } }
@keyframes stampin { from { transform: rotate(-6deg) scale(2.6); opacity: 0; } to { transform: rotate(-6deg); opacity: 1; } }
@keyframes gust-up { 0% { transform: translateY(70%) scaleY(.4); opacity: 0; } 35% { opacity: .95; } 100% { transform: translateY(-6%) scaleY(1); opacity: 0; } }
@keyframes gust-down { 0% { transform: translateY(-70%) scaleY(.4); opacity: 0; } 35% { opacity: .95; } 100% { transform: translateY(6%) scaleY(1); opacity: 0; } }
@keyframes puff { 0% { transform: translate(-50%, -50%) scale(.4); opacity: .9; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@keyframes gust { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: .7; } 60% { opacity: .5; } 100% { transform: translateX(480%); opacity: 0; } }
@keyframes floaty { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-7px); } }
/* short screens: slimmer player strips (16px less each) so the board keeps a playable size */
@media (max-height: 700px) {
  :root { --chrome: 346px; } /* these come last so they override the strip rules above */
  :root.duo { --chrome: 378px; }
  .strip.big .rowx { height: 64px; padding-top: 4px; }
  .strip.big .tray { grid-auto-rows: 27px; }
  .strip.big .tile { --w: min(42px, calc(var(--cell) * .9)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; } }

/* rankings */
.ladder .lme { font-size: 13px; line-height: 1.6; margin: 2px 0 14px; padding: 10px 12px; border-radius: 12px; background: rgba(227, 176, 75, .1); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .4); }
.ladder .lme b { font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 16px; color: var(--gold); }
.ldist { margin: 6px 0 16px; }
.ldist .bars { height: 86px; display: flex; align-items: flex-end; gap: 2px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.ldist .bars i { flex: 1; min-width: 3px; border-radius: 3px 3px 0 0; background: rgba(127, 155, 216, .55); }
.ldist .bars i.me { background: var(--gold); }
.ldist .axis { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ldist .axis { position: relative; }
.ldist .axis b { position: absolute; top: 15px; transform: translateX(-50%); color: var(--gold); font-weight: 800; white-space: nowrap; }
.ldist { margin-bottom: 26px; }
.ltop { list-style: none; margin: 6px 0 12px; padding: 0; }
.ltop li { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 10px; }
.ltop li:nth-child(odd) { background: rgba(0, 0, 0, .18); }
.ltop li.me { background: rgba(227, 176, 75, .14); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .5); }
.ltop em { font-style: normal; font-family: var(--deco); font-variant-numeric: lining-nums tabular-nums; width: 1.8em; text-align: right; color: var(--muted); font-weight: 700; }
.ltop li:nth-child(-n+3) em { color: var(--gold); }
.ltop span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ltop b { font-family: var(--deco); font-variant-numeric: lining-nums tabular-nums; font-size: 15px; }
.ltop small { font-size: 11px; color: var(--muted); width: 3.6em; text-align: right; }

/* how a piece moves: the long-press card */
.pc { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pinfo { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); z-index: 60; width: min(300px, calc(100vw - 32px)); transform: translate(-50%, -8px) scale(.97);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; padding: 14px 16px 10px; border-radius: 18px;
  background: linear-gradient(180deg, #4a2232, #2c1520); border: 1px solid rgba(227, 176, 75, .6); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8); }
.pinfo.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.pinfo .phead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.pinfo .phead b { font-family: var(--serif); font-size: 19px; letter-spacing: .06em; color: var(--gold); }
.pinfo .phead small { font-size: 13px; color: var(--ink); line-height: 1.45; }
.pgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 190px; margin: 0 auto; }
.pgrid i { aspect-ratio: 1; border-radius: 6px; background: rgba(246, 234, 210, .08); position: relative; display: grid; place-items: center; }
.pgrid i.me { background: rgba(227, 176, 75, .18); }
.pgrid i.me svg { width: 92%; height: 92%; }
.pgrid i.step, .plegend i.step { background: rgba(63, 191, 111, .55); }
.pgrid i.slide, .plegend i.slide { background: rgba(63, 191, 111, .3); }
.pgrid i.slide.end::after { content: '›'; color: #9fe0b4; font-style: normal; font-weight: 900; font-size: 18px; line-height: 1; transform: rotate(var(--deg)); }
.pgrid i.jump, .plegend i.jump { background: transparent; box-shadow: inset 0 0 0 2.5px #3fbf6f; }
.plegend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.plegend span { display: inline-flex; align-items: center; gap: 5px; }
.plegend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pinfo .pnote { font-size: 12px; line-height: 1.5; margin: 10px 0 0; color: var(--ink); }
.pinfo .pclose { font-size: 11px; color: var(--muted); text-align: center; margin: 8px 0 0; }
/* settings: the online account */
.acctl { margin-top: 18px; }
.acct { padding: 10px 12px 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); display: flex; flex-direction: column; gap: 8px; }
.acct .who { margin: 0; font-size: 13px; }
.acct .tcode { font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 22px; letter-spacing: .12em; color: var(--gold); text-align: center; user-select: all; }
.acct .sub { margin: 0; font-size: 11.5px; }
.acct .sub.warn { color: #ff9c8c; }
.acct .acctin { display: flex; gap: 8px; }
.acct .acctin .field { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .08em; }
.acct .acctin .btn { flex: none; padding: 0 12px; }
.level.fujin.on { background: linear-gradient(135deg, rgba(38, 54, 95, .9), rgba(18, 27, 54, .95)); border-color: var(--gold); box-shadow: 0 0 16px -4px rgba(227, 176, 75, .7); }

/* solo setup: the player's rating, then the opponent as a drop-down */
.myrate { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; margin-bottom: 4px; border-radius: 12px; background: rgba(227, 176, 75, .1); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .4); }
.myrate span { font-size: 12.5px; font-weight: 700; }
.myrate b { font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 20px; color: var(--gold); }
.myrate small { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.levelsel { height: 48px; font-size: 16px; font-family: var(--serif); letter-spacing: .04em; }
.ratenote { margin: 6px 0 0; font-size: 11.5px; }

/* tutorial: the lesson card in the far strip's place */
.strip.tutbox { padding: 10px 12px 12px; border-color: rgba(227, 176, 75, .6); background: linear-gradient(180deg, rgba(227, 176, 75, .14), rgba(227, 176, 75, .05)); }
.tuthd { display: flex; align-items: center; gap: 8px; }
.tuthd .tutn { font-family: var(--deco); font-variant-numeric: lining-nums; font-size: 12px; color: var(--gold-ink); background: var(--gold); border-radius: 999px; padding: 1px 8px; font-weight: 700; flex: none; }
.tuthd b { font-family: var(--serif); font-size: 16px; letter-spacing: .06em; flex: 1; min-width: 0; }
.tuthd .tutx { font-size: 12px; color: var(--muted); padding: 4px 6px; }
.tutp, .tutok, .tutng { margin: 6px 0 0; font-size: 13px; line-height: 1.55; }
.tutp b { color: #f6d98c; }
.tutok { color: #9fe0b4; font-weight: 700; }
.tutng { color: #ff9c8c; font-weight: 700; }
.tutbtns { display: flex; gap: 8px; margin-top: 8px; }
.tutbtns .btn { flex: 1; height: 40px; }
.cell.tuthl::after { content: ''; position: absolute; inset: 2px; border-radius: 6px; box-shadow: inset 0 0 0 3px rgba(227, 176, 75, .9); animation: tutpulse 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes tutpulse { 50% { box-shadow: inset 0 0 0 3px rgba(227, 176, 75, .25); } }
.help .tutstart { margin: 2px 0 14px; }
.tutoffer { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin-bottom: 12px; border-radius: 14px; background: rgba(127, 155, 216, .12); box-shadow: inset 0 0 0 1px rgba(127, 155, 216, .45); }
.tutoffer b { font-size: 14px; }
.tutoffer span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tutoffer .btn { height: 42px; margin-top: 2px; }

/* settings: feedback, the version (five taps: the speed check) - release tasks A6, A7 */
.fbopen { margin-top: 18px; justify-content: flex-start; gap: 8px; }
.fbopen .ic { width: 16px; height: 16px; opacity: .7; }
.setver { margin: 16px 0 2px; text-align: center; font-size: 11px; font-family: var(--deco); font-variant-numeric: lining-nums; color: var(--muted); letter-spacing: .2em; padding: 6px 0; cursor: default; }
.fbtext { height: 150px; padding: 10px 12px; resize: none; line-height: 1.55; font-size: 15px; margin-top: 12px; }
.fbcount { text-align: right; font-size: 11px; color: var(--muted); margin-top: 4px; }
.benchout { margin: 10px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .28); font: 11.5px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }

/* home: a new version is ready (release task B1) */
.swnew { display: flex; align-items: center; gap: 10px; width: 100%; margin: 14px 0 -4px; padding: 8px 8px 8px 14px; border-radius: 14px; background: rgba(227, 176, 75, .12); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .45); font-size: 13px; font-weight: 700; }
.swnew span { flex: 1; }
.swnew .btn { height: 36px; padding: 0 16px; flex: none; }
/* settings: delete the online account (release task B3) */
.acctdel { margin-top: 12px; height: 42px; }
.noscript { position: fixed; inset: 0; z-index: 100; margin: 0; padding: 40px 24px; background: var(--bg0); color: var(--ink); text-align: center; line-height: 1.8; }
/* a short screen with the update notice and Continue both shown: the emblem gives way so nothing overlaps */
@media (max-height: 620px) {
  .swnew { margin: 10px 0 -8px; padding: 4px 4px 4px 12px; }
  .swnew .btn { height: 32px; }
  .home-in:has(.swnew) .hero { display: none; }
}

/* online: few players waiting (release task C3); the waiting room's invitation (C4) */
.fewp { width: 100%; margin: 6px 0 12px; padding: 12px; border-radius: 14px; background: rgba(127, 155, 216, .12); box-shadow: inset 0 0 0 1px rgba(127, 155, 216, .4); }
.fewp p { margin: 0 0 10px; font-size: 13px; font-weight: 700; }
.invrow { width: 100%; margin: 4px 0 8px; }
.sub.lead.invited { color: var(--gold); font-weight: 700; }
.sb label + .codefield { margin-top: 12px; }

/* home: the tutorial offered on a first start (release task D1) */
.hometut { display: flex; flex-direction: column; gap: 6px; width: 100%; margin: 16px 0 -6px; padding: 12px; border-radius: 14px; background: rgba(127, 155, 216, .14); box-shadow: inset 0 0 0 1px rgba(127, 155, 216, .5); text-align: left; }
.hometut b { font-size: 14px; }
.hometut span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hometut .row2 { margin-top: 4px; grid-template-columns: 1.6fr 1fr; }
.hometut .btn { height: 40px; }
@media (max-height: 700px) { .home-in:has(.hometut) .hero { display: none; } }
/* the record sheet (D2) */
.stchart { width: 100%; height: 92px; display: block; margin: 4px 0 0; background: rgba(0, 0, 0, .18); border-radius: 10px; }
.stchart polyline { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stchart circle { fill: var(--gold); }
.stchl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 2px 2px 0; font-variant-numeric: lining-nums tabular-nums; }
.sttab { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: 13px; font-variant-numeric: lining-nums tabular-nums; }
.sttab th { font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.sttab td { text-align: right; padding: 6px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sttab th:first-child, .sttab td:first-child { text-align: left; }
.sttab td:first-child { font-family: var(--serif); font-weight: 700; }
/* review: the share button, a square at the end of the row (D3) */
.rvbtns.share { grid-template-columns: 1.4fr 1fr 42px; }
.rvbtns.three.share { grid-template-columns: 1.3fr 1fr 1fr 42px; }
.rvbtns .btn.shr { padding: 0; }
/* review step line on phones (2026-11-16, D5): the longest names ("Gold Cyclone" taking a piece) were cut off.
   Narrower step buttons; on phones narrower than 371px (360-wide Androids too) the first/last buttons go (the move list and the chart reach both ends). */
@media (max-width: 420px) {
  .rvstep { gap: 2px; }
  .rvstep .nav { width: 29px; }
}
@media (max-width: 370px) {
  .rvstep .nav:first-child, .rvstep .nav:last-child { display: none; }
}
/* review on short screens (2026-11-16, D5): board, chart, moves and buttons do not fit 568 px; the screen scrolls
   instead of cutting the buttons off (playing never scrolls) */
@media (max-height: 640px) {
  html.rv .app { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; align-items: flex-start; }
  html.rv .stage { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
/* home layout (2026-11-16, user report on iPhone Safari): with the first-start card the content was taller than the
   space between the bands, so it spilled under the top band and the buttons at the top right. The content now keeps
   clear of the bands and buttons (padding), centres only while it fits (auto margins) and scrolls when it does not.
   With the card, the emblem gives way on screens under 800 px (measured: it needs about 790). */
.home { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.home-in { margin: auto 0; max-height: none; padding-top: calc(104px + env(safe-area-inset-top)); padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
@media (max-height: 620px) { .home-in { padding-top: calc(84px + env(safe-area-inset-top)); padding-bottom: calc(50px + env(safe-area-inset-bottom)); } }
@media (max-height: 800px) { .home-in:has(.hometut) .hero { display: none; } }
@media (max-height: 620px) { .hometut { margin-top: 12px; padding: 10px 12px; } .hometut span { display: none; } }
/* short screens: the rule tips (hint line) in a smaller size so the board keeps its place (11px is the floor) */
@media (max-height: 620px) { .hint.tipon { padding: 4px 8px; } .hint .tip { font-size: 11.5px; line-height: 1.32; } .hint .tip > i { width: 16px; height: 16px; font-size: 11px; } }
/* a rule tip makes the hint line taller (2-3 lines): on screens where the height decides the board size, the board gives that room back */
:root:has(.hint.tipon) { --tipx: 24px; }

/* fast animations (release task Q3): the same effects in 55% of the time */
:root.fast .pts.bump { animation-duration: .28s; }
:root.fast .slot.fresh .pc, :root.fast .tile.fresh { animation-duration: .28s; }
:root.fast .frame.shake { animation-duration: .22s; }
:root.fast .cell.promoted::after { animation-duration: .3s; }
:root.fast .float { animation-duration: .55s; }
:root.fast .gust { animation-duration: .28s; }
:root.fast .puff { animation-duration: .25s; animation-delay: .18s; }
:root.fast .banner { animation-duration: .66s; }
:root.fast .stamp b { animation-duration: .28s; }
/* milestones (Q2) */
.firstwin { color: var(--gold-ink); background: var(--gold); border-radius: 999px; padding: 1px 8px; font-weight: 800; }
.banner.boss { background: linear-gradient(90deg, transparent, rgba(40, 6, 12, .96) 14%, rgba(118, 22, 40, .98) 50%, rgba(40, 6, 12, .96) 86%, transparent); height: 22%; }
.banner.boss span { color: #ffe7a8; text-shadow: 0 0 18px rgba(227, 176, 75, .8), 0 3px 0 rgba(0, 0, 0, .35); }
/* the hint button (Q5) */
#hintBtn:not([hidden]) { color: var(--gold); }
#hintBtn:disabled { opacity: .35; }
/* squares under attack (Q6): a red dot and a "!" (not colour alone) */
.cell.target.danger::after { background: rgba(215, 55, 44, .85); box-shadow: 0 0 0 3px rgba(255, 235, 230, .7); }
.cell.danger::before { content: "!"; position: absolute; top: 1px; right: 3px; z-index: 4; font: 900 calc(var(--cell) * .3)/1 system-ui, sans-serif; color: #ff5a48; text-shadow: 0 1px 0 rgba(0, 0, 0, .55), 0 0 3px rgba(255, 255, 255, .6); pointer-events: none; }

/* home: the Android testers call, at the top left (web only, 2026-11-19) */
.testchip { position: absolute; top: calc(58px + env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); z-index: 2; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 18px; background: rgba(227, 176, 75, .14); box-shadow: inset 0 0 0 1px rgba(227, 176, 75, .6); color: var(--gold); font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
.testchip .ic { width: 16px; height: 16px; }
.teststeps { margin: 4px 0 14px; padding-left: 1.4em; font-size: 13px; line-height: 1.6; }
.teststeps li { margin: 4px 0; }
