:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --ms: 180ms;

}
[data-theme="light"] {
  --bg: #f5f5f7; --e1: #fff; --e2: #ebebef; --text: #1d1d1f; --grey: #86868b; --ink: #000;
  --sq-l: #f0f0f3; --sq-d: #c6c6ce; --coord-l: #a6a6ad; --coord-d: #f5f5f7;
  --seam: #8c8c96; --tape: rgba(255, 246, 220, .66); --tshade: rgba(20, 20, 22, .32); --lip: rgba(255, 255, 255, .7);
  --hl: rgba(0, 0, 0, .14); --sel: rgba(0, 0, 0, .18);
  --hint: rgba(0, 0, 0, .17); --aim: rgba(0, 0, 0, .42);
  --glass: rgba(0, 0, 0, .05); --nav: rgba(255, 255, 255, .72);
}
[data-theme="dark"] {
  --bg: #000; --e1: #151517; --e2: #232326; --text: #f5f5f7; --grey: #86868b; --ink: #f5f5f7;
  --sq-l: #9a9aa2; --sq-d: #6a6a72; --coord-l: #6a6a72; --coord-d: #9a9aa2;
  --seam: #2c2c31; --tape: rgba(236, 226, 196, .5); --tshade: rgba(0, 0, 0, .5); --lip: rgba(255, 255, 255, .28);
  --hl: rgba(255, 255, 255, .24); --sel: rgba(255, 255, 255, .3);
  --hint: rgba(0, 0, 0, .24); --aim: rgba(0, 0, 0, .55);
  --glass: rgba(255, 255, 255, .07); --nav: rgba(20, 20, 22, .7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body { color: var(--text); font: 15px/1.4 var(--sans); -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- stage ---------- */
.stage {
  --bw: max(280px, min(calc(100vw - 320px), calc(100vh - 190px)));
  min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; gap: 21px;
  padding: max(76px, calc((100vh - var(--bw) - 54px) / 2)) 16px 72px;
}
.game { display: flex; flex-direction: column; gap: 13px; }
.board-wrap { position: relative; width: var(--bw); aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
.board { position: absolute; inset: 0; display: grid; border-radius: 14px; overflow: hidden; container-type: inline-size; }
.pieces { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.board-wrap.can { cursor: pointer; }

/* ---------- squares ---------- */
.sq { position: relative; }
.sq.l, .sq.d { background: transparent; }
.sq::before { content: ""; position: absolute; inset: 0; background: transparent; transition: background .18s ease; }
/* last move: a mild rounded square on both squares (captures use circles, so the two never look alike) */
.sq.last::before { inset: 6%; border-radius: 20%; background: var(--hl); animation: frame-in .3s var(--spring); }
.sq.check::before { background: radial-gradient(circle, rgba(0, 0, 0, .3) 0 32%, transparent 70%); }
[data-theme="dark"] .sq.check::before { background: radial-gradient(circle, rgba(255, 255, 255, .5) 0 32%, transparent 70%); }


.sq i { position: absolute; font: 600 1.55cqw/1 var(--sans); font-style: normal; pointer-events: none; }
.sq i.rk { top: 6%; left: 7%; }
.sq i.fl { bottom: 6%; right: 8%; }
.sq.l i { color: var(--coord-l); }
.sq.d i { color: var(--coord-d); }

/* ---------- pieces ---------- */
.piece { position: absolute; left: 0; top: 0; display: grid; place-items: center; transition: transform var(--ms) var(--ease); will-change: transform; }
.piece.moving { z-index: 5; }
.piece.dragging { transition: none; z-index: 10; }
.piece.dead { z-index: 1; }
.piece.in .pc { animation: pop .22s var(--spring); }

.pc {
  display: block; width: 100%; height: 100%;
  -webkit-user-drag: none; user-select: none; pointer-events: none;
  transform-origin: 50% 86%;
  transition: transform .16s var(--ease), filter .16s var(--ease);
}
.dragging .pc { transform: scale(1.14) translateY(-4%); filter: drop-shadow(0 8px 1.5px rgba(0, 0, 0, .2)); }


/* ---------- promotion ---------- */
.promo { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; border-radius: 14px; background: var(--nav); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .15s; }
.promo[hidden] { display: none; }
.promo-choices { display: flex; gap: 6px; padding: 10px; border-radius: 18px; background: var(--e1); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .35); animation: pop .2s var(--spring); }
.promo-choices button { width: 70px; height: 70px; border-radius: 12px; background: var(--sq-l); display: grid; place-items: center; transition: background .15s, transform .2s var(--spring); }
.promo-choices button:hover { background: var(--sq-d); transform: translateY(-3px); }
.promo-choices .pc { width: 84%; height: 84%; }

/* ---------- bar ---------- */
.bar { width: var(--bw); display: flex; align-items: center; justify-content: space-between; gap: 13px; min-height: 40px; }
.status { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.score { min-width: 34px; padding: 5px 8px; border-radius: 8px; background: var(--glass); font: 600 13px/1 var(--sans); text-align: center; font-variant-numeric: tabular-nums; }
.score[hidden] { display: none; }
.score.bump { animation: bump .32s var(--spring); }
.actions { display: flex; gap: 6px; }
/* take back: the one solid control on the page */
.btn.undo { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px 10px 11px; background: var(--ink); color: var(--bg); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .45); }
.btn.undo:hover { background: var(--ink); opacity: .88; }
.btn.undo:disabled { opacity: .25; box-shadow: none; }
.pips { display: inline-flex; gap: 3px; margin-left: 2px; }
.pips i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; transition: opacity .25s, transform .3s var(--spring); }
.pips i.used { opacity: .28; transform: scale(.7); }
.thinking { display: inline-flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.thinking.on { opacity: 1; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--grey); animation: blink 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
.btn { font: 600 14px/1 var(--sans); padding: 11px 16px; border-radius: 10px; background: var(--glass); transition: background .2s, opacity .2s, transform .2s var(--spring); }
.btn:hover { background: var(--e2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn-ink { background: var(--ink); color: var(--bg); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }
.btn-ink:hover { background: var(--ink); opacity: .88; }
.link { font-size: 13px; color: var(--grey); padding: 6px; }
.link:hover { color: var(--text); }

/* ---------- end banner ---------- */
.banner { position: absolute; inset: 0; z-index: 15; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .35s ease-out; }
.banner[hidden] { display: none; }
.banner-card { display: flex; flex-direction: column; align-items: center; gap: 5px; width: min(61.8%, 340px); padding: 34px 21px 13px; border-radius: 21px; background: color-mix(in srgb, var(--e1) 88%, transparent); box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .4); text-align: center; animation: rise .5s .05s var(--spring) both; }
.banner-art { display: flex; gap: 2px; height: 64px; margin-bottom: 4px; }
.banner-art .pc { width: 64px; height: 64px; animation: rise .55s .18s var(--spring) both; }
.banner-art .pc + .pc { animation-delay: .26s; }
.banner-art.tipped .pc { animation: tip .7s .25s var(--spring) both; transform-origin: 50% 86%; }
.banner h2 { font-size: 26px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.banner p { color: var(--grey); font-size: 16px; margin-bottom: 13px; }
.banner .btn-ink { padding: 13px 26px; font-size: 15px; }

/* ---------- moves ---------- */
.side { width: clamp(216px, calc(var(--bw) * .382), 260px); height: var(--bw); padding: 13px 8px 8px 13px; border-radius: 14px; background: var(--e1); display: flex; flex-direction: column; gap: 8px; }
.moves { list-style: none; flex: 1; min-height: 0; overflow-y: auto; font: 500 14px/1 var(--sans); font-variant-numeric: tabular-nums; scrollbar-width: thin; }
.moves li { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr); align-items: center; height: 30px; }
.moves li > span:first-child { color: var(--grey); font-size: 12px; }
.moves .m { padding: 6px 7px; border-radius: 7px; color: var(--grey); cursor: pointer; transition: background .15s, color .15s; }
.moves .m:hover { color: var(--text); background: var(--glass); }
.moves .m.cur { color: var(--text); background: var(--glass); font-weight: 600; }
.moves .m.in { animation: fade .25s ease-out; }
.moves .end { grid-column: 1 / -1; padding: 6px 0 0; color: var(--grey); font-size: 13px; }
.nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nav button { height: 33px; display: grid; place-items: center; border-radius: 11px; color: var(--text); background: var(--e2); transition: background .15s, opacity .15s, transform .18s var(--spring), box-shadow .15s; }
.nav button:hover { background: var(--bg); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .35); }
.nav button:active { transform: scale(.92); }
.nav button:disabled { opacity: .3; cursor: default; background: var(--e2); box-shadow: none; transform: none; }
.nav svg { width: 17px; height: 17px; fill: currentColor; stroke: currentColor; stroke-width: 2.8; stroke-linejoin: round; stroke-linecap: round; }
.board-wrap.past .board { filter: saturate(.85); }
.board-wrap.past::after { content: ""; position: absolute; inset: 0; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--glass); pointer-events: none; z-index: 3; }

/* narrow screens: moves wrap like a printed score, newest at the bottom; big thumb-sized controls */
@media (max-width: 760px) {
  .stage { --bw: min(calc(100vw - 32px), calc(100vh - 290px)); flex-direction: column; align-items: center; padding-top: 72px; gap: 12px; }
  .side { width: var(--bw); height: auto; padding: 8px; }
  .moves { max-height: 96px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0 2px; }
  .moves li { display: flex; height: 32px; flex: none; }
  .moves li > span:first-child { padding: 0 1px 0 6px; }
  .moves li > span:empty { display: none; }
  .moves .end { padding: 0 8px; display: flex; align-items: center; }
  .nav button { height: 42px; }
  .nav svg { width: 19px; height: 19px; }
}

/* demo mode (?demo=…), used by preview.html: just the board */
[data-demo] .side, [data-demo] .corner, [data-demo] .bar .actions { display: none; }
[data-demo] .stage { --bw: min(calc(100vw - 24px), calc(100vh - 70px)); min-height: 0; padding: 12px; flex-direction: column; align-items: center; }
[data-demo] body { overflow: hidden; }

.pieces { container-type: inline-size; }

/* ---------- corner menu ---------- */
.corner { position: fixed; top: 16px; right: 16px; z-index: 30; }
.icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--text); background: var(--nav); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: background .2s, transform .2s var(--spring); }
.icon:hover, .icon[aria-expanded="true"] { background: var(--e1); }
.icon:active { transform: scale(.94); }
.menu { position: absolute; right: 0; top: 52px; width: 236px; padding: 14px; border-radius: 18px; background: var(--e1); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: 8px; animation: pop .18s var(--spring); transform-origin: top right; }
.menu[hidden] { display: none; }
.menu-label { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); font-weight: 600; }
.menu-label output { color: var(--text); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.menu-note { font-size: 12px; color: var(--grey); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 10px; background: var(--glass); margin-bottom: 6px; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; font: 600 13px/1 var(--sans); padding: 8px; border-radius: 7px; color: var(--grey); transition: color .15s, background .15s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--e1); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

input[type=range] { width: 100%; height: 24px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--p, 38%), var(--e2) var(--p, 38%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--e1); box-shadow: 0 0 0 1.5px var(--ink), 0 2px 6px rgba(0, 0, 0, .15); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--e2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--e1); box-shadow: 0 0 0 1.5px var(--ink); }

@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
@keyframes frame-in { from { opacity: 0; transform: scale(.82); } }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes tip { 0% { opacity: 0; transform: none; } 30% { opacity: 1; transform: none; } 100% { opacity: 1; transform: rotate(-82deg) translate(8%, 6%); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  .corner, .bar .actions, .thinking, .promo, .banner, .nav { display: none !important; }
  .stage { min-height: 0; padding: 0; --bw: 150mm; flex-direction: column; }
  .side { height: auto; }
  .moves { overflow: visible; }
}

/* capture: the attacker's shadow on the square */

/* ---------- hints: one shared 1.5 s pulse (kept in phase by app.js) ----------
   dots are smallest at rest and largest mid-pulse; capturable pieces are dimmest exactly then */
.sq::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 17%; height: 17%; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0); background: var(--hint); transition: background .12s ease;
}
.sq.dot::after { transform: translate(-50%, -50%) scale(1); animation: breathe 1.5s ease-in-out infinite; }
.sq.dot.aim::after { animation: none; transform: translate(-50%, -50%) scale(1.4); background: var(--aim); transition: transform .14s var(--ease), background .12s ease; }
@keyframes breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .7; } 50% { transform: translate(-50%, -50%) scale(1.32); opacity: 1; } }

.piece.prey .pc { animation: prey-w 1.5s ease-in-out infinite; }
.piece.prey.b .pc { animation-name: prey-b; }
@keyframes prey-w { 50% { filter: brightness(.72); } }
@keyframes prey-b { 50% { opacity: .5; } }

/* sizes, golden ratio: selected = 1 + 1/φ⁴ (114.6 %), aimed-at target = 1 + 1/φ⁵ (109 %).
   Both grow from the base, so the piece stays standing on its square and never covers a neighbour. */
.piece.sel { z-index: 4; }
.piece.sel .pc { transform-origin: 50% 87%; transform: scale(1.146); transition: transform .18s var(--ease); }
.piece.prey.aim, .piece.hov { z-index: 4; }
.piece.prey.aim .pc, .piece.hov .pc { animation: none; transform-origin: 50% 87%; transform: scale(1.09); transition: transform .14s var(--ease); }
.piece.dragging .pc { animation: none; }

/* ================= combos ================= */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }

/* crit numbers: heavy italic, tilted away from the attack; dark outline keeps every level readable on any square */
.crit { position: fixed; left: 0; top: 0; transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(var(--s, 1)); will-change: left, top, transform; }
.crit span {
  display: block; font: 800 italic 1em/1 var(--sans); letter-spacing: -.02em; white-space: nowrap;
  color: var(--c); -webkit-text-stroke: calc(var(--line) * 2) #141416; paint-order: stroke fill;
  text-shadow: 0 .08em 0 rgba(0, 0, 0, .35), 0 .16em 0 rgba(0,0,0,.18);
}
.crit.lv1 { --c: #f4f4f6; --glow: rgba(255, 255, 255, .35); }
.crit.lv2 { --c: #4fc6ff; --glow: rgba(79, 198, 255, .6); }
.crit.lv3 { --c: #ffd60a; --glow: rgba(255, 214, 10, .6); }
.crit.lv4 { --c: #ff4fae; --glow: rgba(255, 79, 174, .65); }

/* the counter takes the number: grows, flashes green (won material) or red (lost), then settles back */
.score.gain { animation: take-gain .6s var(--spring); }
.score.loss { animation: take-loss .6s var(--spring); }
@keyframes take-gain { 0% { transform: scale(1); } 22% { transform: scale(1.38); background: #22c55e; color: #fff; } 60% { background: #22c55e; color: #fff; } }
@keyframes take-loss { 0% { transform: scale(1); } 22% { transform: scale(1.38); background: #ff3b30; color: #fff; } 60% { background: #ff3b30; color: #fff; } }

/* ---------- combo levels: board effects ----------
   One look: flat cut-out layers with a dark ink outline and a short, nearly sharp shadow. */
.cfx { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.cfx.burst, .cfx.torch, .cfx.bombs { z-index: 7; }
.cfx svg { position: absolute; display: block; overflow: visible; }

/* ink splats (level 2 blue under the attacker, level 4 pink under the blast) */
.pool .splat { left: -35%; top: -12%; width: 170%; height: 170%; transform-origin: 50% 50%; }
.pool.big .splat { left: -100%; top: -95%; width: 300%; height: 300%; }

/* level 3: spray can + flame jet (drawn facing right, mirrored for the other side) */
.torch .mir { position: absolute; inset: 0; }
.torch .can { left: 26%; top: 30%; width: 13%; height: 26%; transform-origin: 50% 80%; filter: drop-shadow(0 var(--cut) 0 rgba(0,0,0,.26)); }
.torch .jet { left: 40%; top: 36%; width: 46%; height: 20%; transform-origin: 0 50%; filter: drop-shadow(0 var(--cut) 0 rgba(0,0,0,.26)); }

/* level 3: burning front + flames + ash */
.front, .ash { position: absolute; inset: 0; pointer-events: none; }
.front { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.front b {
  position: absolute; left: 0; right: 0; height: 12%; transform: translateY(50%);
  background: linear-gradient(to top, rgba(255, 60, 0, 0) 0, #ff5a00 22%, #ffb020 45%, #fff3b0 55%, #ffb020 66%, rgba(255, 90, 0, .55) 82%, rgba(255, 90, 0, 0));
}
.blaze { position: absolute; left: 0; right: 0; height: 0; pointer-events: none; filter: drop-shadow(0 var(--cut) 0 rgba(0,0,0,.26)); }
.blaze b, .crit.hot b {
  position: absolute; bottom: 0; width: 17%; height: 0; padding-bottom: 17%;
  transform: translateX(-50%) scale(1, var(--h, 1));
}
.blaze b::before, .blaze b::after, .crit.hot b::before, .crit.hot b::after {
  content: ""; position: absolute; inset: 0; border-radius: 50% 0 50% 50%;
  transform: rotate(-45deg); transform-origin: 50% 50%;
}
.blaze b::before, .crit.hot b::before { background: #ff5a1f; box-shadow: 0 0 0 var(--line) #141416; animation: lick .3s ease-in-out infinite alternate; animation-delay: inherit; }
.blaze b::after, .crit.hot b::after { inset: 30% 22% 6% 22%; background: #ffd60a; animation: lick .24s ease-in-out infinite alternate-reverse; animation-delay: inherit; }
@keyframes lick {
  from { transform: rotate(-45deg) scale(1); }
  to { transform: rotate(-38deg) scale(.82, 1.1) translate(6%, -10%); }
}
.ash i { position: absolute; display: block; border-radius: 30%; }
.ash i.spark { width: 3.5%; height: 3.5%; border-radius: 50%; background: #ffc233; box-shadow: 0 0 0 var(--line) #141416; }
.ash u { position: absolute; left: 50%; bottom: 11%; width: 46%; height: 7%; border-radius: 50% 50% 40% 40% / 100% 100% 30% 30%; background: #2e2e33; box-shadow: 0 2px 0 rgba(0,0,0,.25); transform-origin: 50% 100%; }

/* level 4+: ink bomb, blast, shards, stains on the neighbours */
.bombs .bomb { width: 36%; height: 40%; left: 0; top: 0; filter: drop-shadow(0 var(--cut) 0 rgba(0,0,0,.26)); }
.bomb .fuse { transform-box: fill-box; transform-origin: 50% 50%; animation: fizz .09s steps(2) infinite; }
@keyframes fizz { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.35) rotate(30deg); } }
.burst .blast { left: 50%; top: 52%; width: 240%; height: 240%; filter: drop-shadow(0 var(--cut) 0 rgba(0,0,0,.26)); }
.burst u, .burst i { position: absolute; left: 50%; top: 52%; display: block; }
.burst u { width: 90%; height: 90%; border-radius: 50%; border: 0 solid #ff2e9a; box-sizing: border-box; }
.burst i { border-radius: 2px; box-shadow: 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0,0,0,.25); }
.stain { position: absolute; inset: 0; pointer-events: none; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.stain .splat { position: absolute; display: block; overflow: visible; width: 62%; height: 62%; }

/* 5+: the crit number burns on its way to the counter */
.crit { isolation: isolate; }
.crit span { position: relative; z-index: 1; }
.crit.hot b { width: .42em; padding-bottom: .42em; bottom: auto; z-index: 0; filter: drop-shadow(0 .05em 0 rgba(0,0,0,.3)); }

/* banners: roll through two rows, in the level's colour */
.lane { position: absolute; left: 0; right: 0; z-index: 8; overflow: hidden; pointer-events: none; display: grid; align-items: center; }
.roll {
  height: 76%; display: grid; place-items: center; background: var(--c);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .4);
}
.roll.lv3 { --c: #ffd60a; }
.roll.lv4 { --c: #ff4fae; }
.roll.tb { --c: #4ade80; }
.roll span { font: 900 italic 1em/1 var(--sans); letter-spacing: -.03em; color: #141416; white-space: nowrap; }
.roll i { display: inline-block; font-style: italic; }

/* one outline for every effect, whatever its size: a square ÷ φ⁷ (≈ 2.7 px on an 80 px square).
   SVG strokes keep it in screen pixels; text strokes are drawn behind the fill, so they need twice the width. */
:root { --line: 2.5px; --cut: 4px; }
.cfx [stroke="#141416"]:not([style]) { stroke-width: var(--line); vector-effect: non-scaling-stroke; }

/* ---------- board: raised cut-out tiles ----------
   Light tiles stand a little proud (a short dark edge at the bottom, a lit top edge);
   dark tiles sit lower (the tile above casts a short hard shadow onto them). Thin seams between all. */

/* the board's fixed marks (chips, drips, tape) and the game's battle scars: under the pieces */
.marks, .scars { position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: 14px; overflow: hidden; }
.marks svg { display: block; width: 100%; height: 100%; overflow: visible; }
.scars [stroke="#141416"]:not([style]) { stroke-width: var(--line); vector-effect: non-scaling-stroke; }
.marks .tape { filter: drop-shadow(0 calc(var(--cut) * .5) 0 rgba(0, 0, 0, .14)); }
.marks .tape path { fill: var(--tape); }
.scar { position: absolute; }
.scar .splat { display: block; width: 100%; height: 100%; overflow: visible; opacity: .85; filter: drop-shadow(0 calc(var(--cut) * .6) 0 rgba(0,0,0,.2)); }

/* ---------- take back: the opponent king talks ---------- */
.bubble {
  position: absolute; left: 0; top: 0; z-index: 9; opacity: 0; pointer-events: none; white-space: nowrap;
  padding: .5em .8em .55em; border-radius: 1em; background: #fff; color: #141416;
  font-weight: 800; font-style: italic; letter-spacing: -.02em; line-height: 1;
  box-shadow: 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0, 0, 0, .25);
}
.bubble span { position: relative; z-index: 1; }
.bubble i {
  position: absolute; left: var(--tail); width: .9em; height: .9em; background: #fff;
  transform: translateX(-50%) rotate(45deg); box-shadow: var(--line) var(--line) 0 0 #141416;
}
.bubble.above i { bottom: -.42em; }
.bubble.below i { top: -.42em; box-shadow: calc(var(--line) * -1) calc(var(--line) * -1) 0 0 #141416; }

/* ---------- levels 6+: inverted freeze-frame flash · 7+: ink rain · 10: black hole ---------- */
.pool.rain .splat { left: 0; top: 0; width: 100%; height: 100%; }
.cfx.hole { z-index: 7; }
.hole .dim { position: absolute; left: 50%; top: 50%; width: 700%; height: 700%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 20, 22, .55) 0, rgba(20, 20, 22, .32) 22%, rgba(20, 20, 22, 0) 60%); }
.hole .core { left: 50%; top: 50%; width: 170%; height: 170%; filter: drop-shadow(0 var(--cut) 0 rgba(0, 0, 0, .3)); }
.hole .core [stroke="#141416"], .hole .core [stroke="#fff"] { stroke-width: var(--line); vector-effect: non-scaling-stroke; }
.hole .spin { animation: whirl .5s linear infinite; transform-origin: 0 0; }
.hole .spin.rev { animation-duration: .34s; animation-direction: reverse; }
@keyframes whirl { to { transform: rotate(360deg); } }

/* ---------- board: hand-cut tiles (drawn once, fixed) ---------- */
.board { background: var(--seam); }
.tiles { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.tiles .tl { fill: var(--sq-l); }
.tiles .td { fill: var(--sq-d); }
.tiles .tgrain { opacity: .55; mix-blend-mode: multiply; }

/* level 6+: comic freeze-frame (no flashing; the frame is dark ink, the lines are thin) */
.panel { position: absolute; inset: 0; z-index: 9; pointer-events: none; border-radius: 14px; }
.panel svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.panel .frame { fill: #141416; filter: drop-shadow(0 var(--cut) 0 rgba(0, 0, 0, .3)); }
.panel .frame-hi { fill: none; stroke: #ff2e9a; stroke-width: calc(var(--line) * 1.6); vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.panel .speed { fill: #141416; opacity: 0; }
[data-theme="dark"] .panel .speed { fill: #f4f4f6; }

/* level 8+: grave, clods, the RIP stone; the stone also stays as a battle scar */
.cfx.grave svg { left: -25%; top: -5%; width: 150%; height: 150%; transform-origin: 50% 55%; }
.cfx.grave .clod { position: absolute; left: 50%; top: 60%; display: block; border-radius: 40% 55% 45% 50%; background: #6b4a2f; box-shadow: 0 0 0 var(--line) #141416; }

/* ---------- end of game: comic panel slam ---------- */
.banner { background: color-mix(in srgb, var(--bg) 22%, transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
.banner-card {
  position: relative; isolation: isolate; background: none; box-shadow: none; border-radius: 0; color: #141416;
  padding: 30px 24px 14px; transform: rotate(-3deg);
  filter: drop-shadow(var(--line) 0 0 #141416) drop-shadow(calc(var(--line) * -1) 0 0 #141416) drop-shadow(0 var(--line) 0 #141416) drop-shadow(0 calc(var(--line) * -1) 0 #141416) drop-shadow(0 calc(var(--cut) * 1.6) 0 rgba(0, 0, 0, .3));
  animation: slam .46s .45s cubic-bezier(.3, 1.35, .5, 1) both;
}
.banner-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pc, #f4f4f6); clip-path: var(--torn, none); }
.banner[data-kind="win"] { --pc: #ffd60a; }
.banner[data-kind="loss"] { --pc: #ff4fae; }
.banner[data-kind="resign"] { --pc: #f4f4f6; }
.banner[data-kind="draw"] { --pc: #4fc6ff; }
.banner h2 { font-size: 36px; font-weight: 900; font-style: italic; letter-spacing: -.04em; color: #141416; }
.banner h2 i { display: inline-block; font-style: italic; }
.banner p { color: rgba(20, 20, 22, .74); font-weight: 600; }
.banner-art .pc { animation-delay: .7s; }
.banner-art .pc + .pc { animation-delay: .78s; }
.banner-art.tipped .pc { animation-delay: .8s; }
@keyframes slam {
  0% { opacity: 0; transform: scale(1.7) rotate(-14deg); }
  55% { opacity: 1; transform: scale(.94) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-3deg); }
}

/* the board drains when you lose; what's on it stays as it is */
.board, .marks, .scars { transition: filter 1.2s ease; }
.board-wrap.drained .board, .board-wrap.drained .marks, .board-wrap.drained .scars { filter: grayscale(1) brightness(.7) contrast(1.08); }

.endfx { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.confetti { position: absolute; translate: -50% -50%; }
.confetti .splat { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 var(--cut) 0 rgba(0, 0, 0, .22)); }
.endfx [stroke="#141416"], .stamp [stroke="#141416"] { stroke-width: var(--line); vector-effect: non-scaling-stroke; }
.stamp { position: absolute; left: 50%; top: -6%; width: 50%; z-index: 2; pointer-events: none; filter: drop-shadow(0 var(--cut) 0 rgba(0, 0, 0, .26)); }
.stamp svg { display: block; width: 100%; overflow: visible; }
.cracks { position: absolute; inset: 0; pointer-events: none; transform-origin: 50% 87%; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.cracks svg { width: 100%; height: 100%; display: block; }
.cracks path { fill: none; stroke: #141416; stroke-width: calc(var(--line) * 1.3); vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- review hint: the rest of the page steps back, only the browse buttons stay ---------- */
.coach { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 12, .42); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .3s ease-out; cursor: pointer; }
.coach[hidden] { display: none; }
body.coaching .nav { position: relative; z-index: 51; }
.coach p {
  position: fixed; left: var(--nx); top: var(--ny); transform: translate(-50%, calc(-100% - 16px));
  padding: 10px 14px; border-radius: 13px; background: #fff; color: #141416; white-space: nowrap; text-align: center;
  font: 800 italic 15px/1.25 var(--sans); letter-spacing: -.02em;
  box-shadow: 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0, 0, 0, .25);
  animation: rise .4s .1s var(--spring) both;
}
.coach p span { display: block; font: 600 12px/1.3 var(--sans); color: rgba(20, 20, 22, .6); }
.coach p::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); box-shadow: var(--line) var(--line) 0 0 #141416; }

/* tiles: each its own cut; light stand higher than dark; a few raised, sunk, chipped, cracked, speckled, worn, coarse */
.tiles .tshade { fill: var(--tshade); }
.tiles .tone.up { fill: #fff; }
.tiles .tone.down { fill: #000; }
.tiles .lip.l { fill: var(--lip); }
.tiles .lip.d { fill: var(--lip); opacity: .4; }
.tiles .inshade { fill: rgba(0, 0, 0, .16); }
.tiles .crack { fill: var(--seam); }
.tiles .crack-hi { fill: var(--lip); opacity: .7; }
.tiles .speck { fill: var(--seam); opacity: .6; }
.tiles .speck.hi { fill: #fff; opacity: .5; }
.tiles .worn { fill: #fff; opacity: .13; }
.tiles .mottle.lt { fill: #fff; opacity: .1; }
.tiles .mottle.dk { fill: #000; opacity: .07; }
.marks .drip-edge { stroke: #141416; stroke-width: 2.2; stroke-linejoin: round; vector-effect: none; }
.marks .drip { filter: drop-shadow(0 calc(var(--cut) * .45) 0 rgba(0, 0, 0, .2)); }

/* level 8+: the gravestone, laid flat; it falls onto the square, then stays as the square's scar */
.slab { display: block; width: 100%; height: 100%; overflow: visible; }
.slab .slab-edge { fill: none; stroke: #141416; stroke-width: 3; }
.slab .slab-face { fill: #9a9aa2; }
.slab .slab-hi { fill: rgba(255, 255, 255, .55); }
.slab text { font: 900 italic 21px/1 var(--sans); letter-spacing: -.02em; fill: rgba(20, 20, 22, .55); }
.slab image { opacity: .32; filter: grayscale(1) brightness(.35); }
.cfx.tombfall { z-index: 4; }
.cfx.tombfall .slab { position: absolute; inset: 0; }
.scar.tomb .slab { opacity: .42; }
[data-theme="dark"] .scar.tomb .slab { opacity: .5; }
.cfx.dust { z-index: 4; }
.cfx.dust i { position: absolute; left: 50%; top: 50%; display: block; border-radius: 50%; background: #b8b2a6; }

/* end panel: depth, title fitting, decor, two equal buttons */
.banner-card::after {                            /* a darker cut layer underneath, so the panel sits on something */
  content: ""; position: absolute; inset: 0; z-index: -2; clip-path: var(--torn, none);
  background: color-mix(in srgb, var(--pc, #f4f4f6) 62%, #141416); transform: translate(calc(var(--cut) * .9), calc(var(--cut) * 1.3)) rotate(.8deg);
}
.banner-card::before {
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .14)),
    var(--pc, #f4f4f6);
}
.banner-card .decor { position: absolute; inset: 0; z-index: -1; clip-path: var(--torn, none); pointer-events: none; }
.banner-card .decor svg { display: block; }
.banner h2 { width: 100%; text-wrap: balance; }
.banner h2 .w { display: inline-block; white-space: nowrap; }
.banner-card > *:not(.decor) { position: relative; }
.banner .btn-ink, .banner .btn-alt { width: 100%; max-width: 240px; padding: 13px 26px; font-size: 15px; font-weight: 700; border-radius: 13px; }
.banner .btn-alt { margin-top: 8px; background: #fff; color: #141416; box-shadow: 0 var(--cut) 0 rgba(0, 0, 0, .22); }
.banner .btn-alt:hover { background: #f4f4f6; }
.banner .btn-ink { box-shadow: 0 var(--cut) 0 rgba(0, 0, 0, .28); }
.banner .btn-ink, .banner .btn-ink:hover { background: #141416; color: #fff; }

/* en passant: the empty square you land on gets a ring (a dot means "move here"; the ring means "capture from here"),
   pulsing on the same clock as the pawn it takes */
.sq.ep::after {
  width: 46%; height: 46%; background: none; box-shadow: inset 0 0 0 calc(var(--line) * 1.6) var(--hint);
  transform: translate(-50%, -50%) scale(1); animation: breathe 1.5s ease-in-out infinite;
}
.sq.ep.aim::after { animation: none; transform: translate(-50%, -50%) scale(1.12); box-shadow: inset 0 0 0 calc(var(--line) * 2) var(--aim); }

/* ---------- corner stickers: material count (yours, bottom-left) and combo tabs (both sides) ----------
   Cut-out pieces hanging off the board's corners: ink outline, short hard shadow, a slight tilt. */
.tally { position: absolute; z-index: 11; display: flex; align-items: center; pointer-events: none; --t: calc(var(--bw) * .052); }
.tally.me { left: 0; bottom: 0; transform: translate(-26%, 46%) rotate(-4deg); }
.tally.foe { right: 0; top: 0; transform: translate(26%, -46%) rotate(3deg); flex-direction: row-reverse; --t: calc(var(--bw) * .036); }
.tally .score {
  position: relative; z-index: 2; min-width: 2.1em; padding: .22em .42em .26em; border-radius: .34em;
  background: #f4f4f6; color: #141416; font: 900 italic var(--t)/1 var(--sans); letter-spacing: -.03em; text-align: center;
  box-shadow: 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0, 0, 0, .25);
}
.tally .tab {
  position: relative; z-index: 1; display: inline-flex; align-items: baseline; gap: .04em;
  margin-left: -.3em; padding: .14em .38em .16em .58em; border-radius: 0 .3em .3em 0;
  background: var(--c, #f4f4f6); color: #141416; font: 900 italic calc(var(--t) * .78)/1 var(--sans); letter-spacing: -.02em;
  box-shadow: 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0, 0, 0, .22);
  transform: translateX(-80%) scale(.7); opacity: 0;
  transition: transform .42s cubic-bezier(.3, 1.4, .5, 1), opacity .2s ease, filter .3s ease;
}
.tally.foe .tab { margin: 0 -.3em 0 0; padding: .14em .48em .16em .38em; border-radius: .3em; }
.tally.foe .tab, .tally.foe .tab:not(.on) { transform-origin: 100% 50%; }
.tally.foe .tab:not(.on) { transform: translateX(80%) scale(.7); }
.tally .tab i { font-size: .62em; font-style: normal; opacity: .75; }
.tally .tab.on { transform: none; opacity: 1; }
.tally .tab.lv2 { --c: #4fc6ff; }
.tally .tab.lv3 { --c: #ffd60a; }
.tally .tab.lv4 { --c: #ff4fae; }
.tally .tab.idle { filter: saturate(.55) brightness(.92); }
.tally .tab.warn { animation: teeter 1.1s ease-in-out infinite; }
@keyframes teeter { 0%, 100% { rotate: 0deg; } 20% { rotate: -5deg; } 40% { rotate: 4deg; } 55% { rotate: 0deg; } }
.tally .tab.torn { position: absolute; margin: 0; transition: none; }
/* the banner carries the count too */
.roll em { display: inline-block; margin-left: .28em; font-style: italic; font-size: .62em; vertical-align: .12em; padding: .06em .28em .1em; border-radius: .22em; background: #141416; color: var(--c); }
/* room for the sticker in the bar below the board */
.bar .status { padding-left: calc(var(--bw) * .1); }
@media (max-width: 760px) {
  .tally.me { transform: translate(-6%, 52%) rotate(-4deg); --t: calc(var(--bw) * .068); }
  .tally.foe { transform: translate(4%, -52%) rotate(3deg); --t: calc(var(--bw) * .05); }
  .bar .status { padding-left: calc(var(--bw) * .16); }
}

/* stickers, round 2: sit mostly off the board, tell you whose they are, carry the turn */
.tally.me { transform: translate(-34%, 60%) rotate(-4deg); }
.tally.foe { transform: translate(34%, -60%) rotate(3deg); }
/* whose sticker: the side's own king, punched into a round badge */
.tally .who {
  position: relative; z-index: 3; width: calc(var(--t) * 1.5); height: calc(var(--t) * 1.5); margin-right: -.35em; border-radius: 50%;
  background: var(--sq-d); box-shadow: 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0, 0, 0, .25); display: grid; place-items: center;
  font-size: var(--t);
}
.tally.foe .who { margin: 0 0 0 -.35em; }
.tally .who .pc { width: 86%; height: 86%; }
.tally .score { padding-left: .55em; }
.tally.noscore .score { display: none; }
.tally.noscore .tab { margin-left: -.1em; }
/* the turn tag slides out beside the sticker of the side that's up */
.tally .turn {
  position: relative; z-index: 0; margin-left: .45em; padding: .3em .6em .34em; border-radius: .4em; white-space: nowrap;
  background: #141416; color: #f4f4f6; font: 800 italic calc(var(--t) * .5)/1 var(--sans); letter-spacing: -.01em;
  box-shadow: 0 var(--cut) 0 rgba(0, 0, 0, .2);
  opacity: 0; transform: translateX(-30%) scale(.8); transition: transform .38s cubic-bezier(.3, 1.4, .5, 1), opacity .2s ease;
}
.tally.foe .turn { margin: 0 .45em 0 0; transform: translateX(30%) scale(.8); }
.tally.up .turn { opacity: 1; transform: none; }
.tally.check .turn { background: #ff3b30; color: #fff; }
.tally .turn u { display: inline-block; width: .32em; height: .32em; margin-left: .14em; border-radius: 50%; background: currentColor; animation: dots 1s ease-in-out infinite; }
.tally .turn u:nth-child(2) { animation-delay: .15s; }
.tally .turn u:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-25%); } }
.bar .thinking { display: none; }
.bar .status { padding-left: calc(var(--bw) * .14); }


@media (max-width: 760px) {
  .tally.me { transform: translate(-4%, 64%) rotate(-3deg); }
  .tally.foe { transform: translate(4%, -64%) rotate(3deg); }
  .bar .status { padding-left: 0; }
}

/* stickers fade in place as the pointer nears them; no movement, no scaling */
.tally { --near: 0; opacity: calc(1 - var(--near) * .82); transition: opacity .18s ease; }

/* ×5+: a black tab with a brass rim; the number is solid fire-yellow with a hard orange cut,
   and a cut-out flame flickers behind it on an uneven beat */
.tally .tab.hot { background: #141416; box-shadow: inset 0 0 0 calc(var(--line) * .9) #ff8a00, 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0, 0, 0, .22); }
.tally .tab.hot i { color: #ffb020; opacity: 1; }
.tally .tab.hot b { position: relative; z-index: 0; display: inline-block; color: #fff3a3; text-shadow: 0 .07em 0 #ff5a1f; }
.tally .tab.hot b::before, .tally .tab.hot b::after {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: .02em; border-radius: 50% 0 50% 50%;
  transform-origin: 50% 100%;
}
.tally .tab.hot b::before { width: 1.05em; height: 1.05em; margin-left: -.52em; background: #ff3d00; opacity: .9; animation: flick 1.3s infinite; }
.tally .tab.hot b::after { width: .66em; height: .66em; margin-left: -.33em; background: #ff9d00; animation: flick 1s -.4s infinite; }
@keyframes flick {
  0%   { transform: rotate(-45deg) scale(1); }
  17%  { transform: rotate(-41deg) scale(.92, 1.08); }
  31%  { transform: rotate(-48deg) scale(1.05, .95); }
  52%  { transform: rotate(-43deg) scale(.88, 1.12); }
  64%  { transform: rotate(-47deg) scale(1.02); }
  83%  { transform: rotate(-42deg) scale(.95, 1.04); }
  100% { transform: rotate(-45deg) scale(1); }
}

/* whose move: a ring around the king badge.
   your move: a green ring that breathes · check: red, with a little shake · thinking: a yellow ring of dashes that turns */
.tally .who::after {
  content: ""; position: absolute; inset: calc(var(--line) * -3.2); border-radius: 50%; opacity: 0; transform: scale(.8);
  transition: opacity .25s ease, transform .35s cubic-bezier(.3, 1.4, .5, 1);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--line) * 1.8), #000 calc(100% - var(--line) * 1.8));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--line) * 1.8), #000 calc(100% - var(--line) * 1.8));
}
.tally.up .who::after { opacity: 1; transform: none; }
.tally.me .who::after { background: #22c55e; }
.tally.me.up .who::after { animation: ringbreathe 1.5s ease-in-out infinite; }
.tally.check .who::after { background: #ff3b30; animation: ringshake .5s ease-in-out infinite; }
.tally.foe .who::after { background: conic-gradient(#ffd60a 0 18%, transparent 0 25%, #ffd60a 0 43%, transparent 0 50%, #ffd60a 0 68%, transparent 0 75%, #ffd60a 0 93%, transparent 0); }
.tally.foe.up .who::after { animation: ringspin 1.6s linear infinite; }
@keyframes ringbreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes ringshake { 0%, 100% { rotate: 0deg; } 25% { rotate: -9deg; } 75% { rotate: 9deg; } }
@keyframes ringspin { to { transform: rotate(360deg); } }

/* hovering the part of a sticker that hangs off the board: it lifts a touch and explains itself */
.tally.peek { opacity: 1; filter: brightness(1.04); }
.tip {
  position: fixed; z-index: 60; pointer-events: none; display: flex; flex-direction: column; gap: 4px;
  padding: 10px 13px 11px; border-radius: 12px; background: #fff; color: #141416; white-space: nowrap;
  font: 600 13px/1.25 var(--sans); box-shadow: 0 0 0 var(--line) #141416, 0 var(--cut) 0 var(--line) rgba(0, 0, 0, .25);
  animation: rise .22s var(--spring) both;
}
.tip[hidden] { display: none; }
.tip.below { transform: translate(-50%, 0); }
.tip.above { transform: translate(-50%, -100%); }
.tip b { font: 900 italic 15px/1.1 var(--sans); letter-spacing: -.02em; }
.tip em { font-style: italic; font-weight: 900; }
.tip span { color: rgba(20, 20, 22, .72); }
.tip .t { color: #141416; font-weight: 800; }

/* turn ring entrances: three ways in, cycling per move; all end as the same ring, then the same idle loop
   0 · sprayed on: the ring draws itself clockwise from the top
   1 · stamped: drops from above, slams down, settles
   2 · whipped in: spins in from small, overshoots, settles */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 360deg; }
.tally .who::after {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--line) * 1.8), #000 calc(100% - var(--line) * 1.8)), conic-gradient(#000 var(--sweep), transparent 0);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--line) * 1.8), #000 calc(100% - var(--line) * 1.8)), conic-gradient(#000 var(--sweep), transparent 0);
  mask-composite: intersect;
}
.tally.me.up[data-intro] .who::after { animation: ring-in-0 .6s ease-out both, ringbreathe 1.5s .6s ease-in-out infinite; }
.tally.me.up[data-intro="1"] .who::after { animation-name: ring-in-1, ringbreathe; }
.tally.me.up[data-intro="2"] .who::after { animation-name: ring-in-2, ringbreathe; }
.tally.foe.up[data-intro] .who::after { animation: ring-in-0 .6s ease-out both, ringspin 1.6s .6s linear infinite; }
.tally.foe.up[data-intro="1"] .who::after { animation-name: ring-in-1, ringspin; }
.tally.foe.up[data-intro="2"] .who::after { animation-name: ring-in-2, ringspin; }
.tally.me.up.check[data-intro] .who::after { animation: ring-in-1 .45s ease-out both, ringshake .5s .45s ease-in-out infinite; }
@keyframes ring-in-0 { from { --sweep: 0deg; opacity: 1; transform: none; } to { --sweep: 360deg; opacity: 1; transform: none; } }
@keyframes ring-in-1 {
  0% { transform: scale(2.4); opacity: 0; }
  50% { transform: scale(.86); opacity: 1; }
  72% { transform: scale(1.07); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes ring-in-2 {
  0% { transform: rotate(-300deg) scale(.2); opacity: 0; }
  68% { transform: rotate(18deg) scale(1.08); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* credits: quiet, always there */
.credits { position: fixed; left: 0; right: 0; bottom: 10px; text-align: center; font: 500 11px/1.4 var(--sans); color: var(--grey); opacity: .7; pointer-events: none; }
.credits a { color: inherit; text-decoration: underline; text-decoration-color: rgba(127, 127, 127, .4); text-underline-offset: 2px; pointer-events: auto; }
.credits a:hover { color: var(--ink); }
@media (max-width: 760px) { .credits { position: static; padding: 0 16px 18px; } }
