:root {
  /* warm 1940s cel palette (docs/cartoon-restyle-plan.json → palette) */
  --ink: #2a1a14; --ink2: #5a3d2e; --ink-rgb: 42, 26, 20; --paper: #fbf1d9; --pink: #f0627a; --yellow: #ffc93c; --teal: #45c49a;
  --sky: #5bb8d6; --purple: #8a6fd1; --red: #d9412b; --orange: #f2913d; --wood: #a8703d; --velvet: #b8322a; --muted: #9a8270;
  --gold: #f6c453; --gold2: #eea43a; --grey: #e2d6c4; --tint: #f6ecdc;
  --bg: #3a1f16; --scrim: 58, 31, 22; --dim: 30, 14, 10;
  --shadow: 0 4px 0 var(--ink); --radius: 16px;
  --cel: inset 0 3px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.12);
  --wob: 18px 14px 20px 13px / 14px 20px 13px 18px;
  --grain: none;
  /* 14-point jagged impact star (clip-path) shared by .sf-burst and .comic.burst */
  --burst: polygon(50.0% 2.9%, 56.7% 20.7%, 71.1% 6.2%, 71.1% 23.6%, 88.9% 19.0%, 77.6% 36.7%, 97.3% 39.2%, 83.3% 50.0%, 97.6% 60.9%, 81.3% 65.1%, 86.8% 79.4%, 71.5% 76.9%, 71.6% 95.0%, 56.8% 79.7%, 50.0% 99.1%, 42.7% 81.9%, 29.1% 93.4%, 27.7% 78.0%, 12.3% 80.1%, 17.8% 65.5%, 1.3% 61.1%, 16.0% 50.0%, 2.9% 39.3%, 20.3% 35.7%, 12.6% 20.2%, 29.7% 24.6%, 28.7% 5.8%, 43.1% 19.8%);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Arial Rounded MT Bold", "Cooper Black", "Arial Black", var(--font);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
/* neon themes keep the original purple sticker palette; main.js mirrors the scene theme on body[data-theme] */
body[data-theme="casino"], body[data-theme="space"] {
  --ink: #2b2140; --ink2: #4a3d66; --ink-rgb: 43, 33, 64; --paper: #fffaf0; --pink: #ff5d8f; --yellow: #ffd23f; --teal: #3ddc97;
  --sky: #4cc9f0; --purple: #7b61ff; --red: #ff4d4d; --orange: #ff9f43; --muted: #8f86a8; --grey: #d7d3e2; --tint: #f4f0fb;
  --bg: #2a0f3d; --scrim: 42, 15, 61; --dim: 20, 10, 35;
  --shadow: 0 4px 0 var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); touch-action: manipulation; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
/* pinned: after a rotation iOS can leave the document scrolled or the page wider than the screen */
body { position: fixed; inset: 0; width: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, textarea { -webkit-user-select: text; user-select: text; font-family: inherit; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; }
button:disabled { cursor: default; opacity: .45; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
/* Layers, bottom to top. The table: #selffx, #clVig 3 · #overlay (plates, chip pills, pot label) ·
   #comics, #curtain, #banner, #clStamps 4. The HUD: #topbar, #dock (its raise panel and fuse) 5 ·
   #fxbar, .gto-panel 6 · #fxbar.open 7 · #approvals 8 · #toasts 9 · #flipBtn 10. Cards that want an
   answer or were opened: #center, the opened .gto-panel 11 · #topbar.more-open 12 · .fullmsg 12 ·
   #pop 15 · #cardTip 16 · #sheet 20 · .tut 25 · #conn 30 · .achpop 40. Then #splash 50, #epcard 61,
   #flipfx 62. */
#overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* ------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border-radius: 14px; font-weight: 900; font-size: 17px;
  background: #fff; border: 3px solid var(--ink); box-shadow: var(--shadow), var(--cel); letter-spacing: .5px; white-space: nowrap; }
/* rubber buttons: squash on press, overshoot on release */
.btn, .chip-btn, .icon-btn, .fxb { transition: transform .32s cubic-bezier(.3,1.9,.5,1), box-shadow .1s; }
.btn:active:not(:disabled), .chip-btn:active, .icon-btn:active, .fxb:active { transform: translateY(3px) scale(1.07,.88); transition-duration: .05s; box-shadow: 0 1px 0 var(--ink), var(--cel); }
.btn.big { min-height: 58px; font-size: 20px; width: 100%; }
.btn.pink { background: var(--pink); color: #fff; } .btn.yellow { background: var(--yellow); } .btn.teal { background: var(--teal); }
.btn.sky { background: var(--sky); } .btn.purple { background: var(--purple); color: #fff; } .btn.red { background: var(--red); color: #fff; } .btn.ghost { background: rgba(255,255,255,.85); }
.btn.sm { min-height: 36px; font-size: 14px; padding: 6px 12px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink), var(--cel); }
.btn small { font-weight: 700; opacity: .85; font-size: .78em; }
.chip-btn { background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 12px; font-weight: 900; box-shadow: 0 3px 0 var(--ink), var(--cel); display: inline-flex; gap: 6px; align-items: center; font-size: 15px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.92); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink), var(--cel); font-size: 20px; display: grid; place-items: center; }
.icon-btn i { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 12px; font-style: normal; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--ink); padding: 0 4px; }
.card { background: var(--paper) var(--grain); border: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 6px 0 var(--ink); padding: 18px; }

/* ------------------------------------------------ home */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); gap: 14px; overflow-y: auto; }
#home { background: linear-gradient(180deg, rgba(var(--scrim),.55), rgba(var(--scrim),.05) 45%, rgba(var(--scrim),.6)); }
.home-top { position: absolute; top: calc(12px + var(--safe-t)); right: 14px; }
.home-top.under-lang { top: calc(64px + var(--safe-t)); } /* the site-wide language switch sits in the corner above */
.brand { text-align: center; color: #fff; }
.logo { display: flex; align-items: center; gap: 10px; justify-content: center; }
.logo h1 { margin: 0; font-size: clamp(44px, 12vw, 76px); letter-spacing: 2px; transform: rotate(-3deg); white-space: nowrap; line-height: 1.15; }
/* en / es titles are longer than 暴打德扑: let them wrap on phones; the room-code hint drops the digit spacing */
html:not([lang^=zh]) .logo h1 { white-space: normal; text-align: center; min-width: 0; }
html:not([lang^=zh]) .logo h1 { font-size: clamp(36px, 10vw, 72px); }
html:not([lang^=zh]) .join-row input::placeholder { letter-spacing: 0; font-size: 17px; }
.fist { font-size: clamp(40px, 11vw, 66px); display: inline-block; animation: jab 1.6s infinite; filter: drop-shadow(0 4px 0 var(--ink)); }
@keyframes jab { 0%, 60%, 100% { transform: translateX(0) rotate(0) } 70% { transform: translateX(22px) rotate(-12deg) scale(1.15) } 80% { transform: translateX(-4px) } }
.brand p { margin: 12px 0 0; }
.home-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink2); }
.field input, .join-row input, .chatbox input { height: 50px; border-radius: 14px; border: 3px solid var(--ink); padding: 0 14px; font-size: 18px; font-weight: 800; background: #fff; color: var(--ink); outline: none; min-width: 0; }
.field input:focus, .join-row input:focus { border-color: var(--red); }
.join-row { display: flex; gap: 10px; }
.join-row input { flex: 1; letter-spacing: 6px; text-align: center; font-size: 22px; }
#recent { display: flex; flex-direction: column; gap: 6px; }
#recent .rec-title { font-weight: 800; font-size: 13px; color: var(--muted); margin-top: 4px; }
.rec { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 6px 6px 6px 12px; }
.rec b { font-size: 18px; letter-spacing: 3px; flex: 1; }
.rec span { font-size: 12px; color: var(--muted); }
.foot { color: rgba(255,255,255,.75); font-size: 12px; font-weight: 700; margin: 0; text-align: center; }

/* ------------------------------------------------ top bar */
#topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 8px calc(10px + var(--safe-l)); z-index: 5; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#topbar .code b { letter-spacing: 2px; font-size: 16px; }
.tb-info { flex: 1; display: flex; flex-flow: row wrap; align-content: center; color: #fff; font-weight: 900; font-size: 13px; text-shadow: 0 2px 0 var(--ink); line-height: 1.25; min-width: 0; }
.tb-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* blinds on the first line; the hand number and a sit & go's next level (#lvlInfo, main.js frame()) on the second */
#blindInfo { flex: 1 0 100%; }
#lvlInfo { order: 1; flex: none; font-variant-numeric: tabular-nums; }
#lvlInfo:not(:empty)::before { content: '·'; margin: 0 5px; opacity: .7; }
.tb-right { display: flex; gap: 6px; }
/* wide screens: one row of buttons; the phones' "more" card (.tb-more) is only a wrapper here */
.tb-more { display: contents; }
.tb-dots, .tb-l, .tb-uni, .tb-info .ic, .vb-k { display: none; }
.vb-k { font-style: normal; opacity: .7; }
#viewBtn { order: 1; } #muteBtn { order: 2; } .tb-players { order: 3; } .tb-score { order: 4; } .tb-chat { order: 5; } .tb-menu { order: 6; }

/* ------------------------------------------------ seat plates */
.plate { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 3px; will-change: transform; cursor: pointer; }
.plate .tag { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.95); border: 2.5px solid var(--ink); border-radius: 12px; padding: 3px 8px 3px 4px; box-shadow: 0 3px 0 var(--ink); min-width: 78px; position: relative; }
.plate .dot { width: 22px; height: 22px; border-radius: 8px; border: 2px solid var(--ink); flex: none; display: grid; place-items: center; font-size: 11px; }
.plate .nm { font-weight: 900; font-size: 12px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.1; }
.plate .st { font-weight: 900; font-size: 13px; color: var(--purple); line-height: 1.1; }
.plate .off { position: absolute; top: -7px; right: -7px; font-size: 12px; background: #fff; border-radius: 50%; border: 2px solid var(--ink); width: 20px; height: 20px; display: grid; place-items: center; }
.plate.me .tag { background: var(--yellow); }
.plate.folded { opacity: .55; }
.plate.active .tag { border-color: var(--pink); box-shadow: 0 3px 0 var(--pink), 0 0 0 4px rgba(240,98,122,.35); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 3px 0 var(--pink), 0 0 0 8px rgba(240,98,122,.12); } }
.plate.winner .tag { background: var(--teal); animation: bounce .5s 4; }
@keyframes bounce { 50% { transform: translateY(-8px) scale(1.06); } }
.plate .ring { position: absolute; inset: -6px; pointer-events: none; }
.plate .ring rect { fill: none; stroke: var(--pink); stroke-width: 4; stroke-linecap: round; }
.badge { font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; white-space: nowrap; box-shadow: 0 2px 0 var(--ink); }
.badge.fold { background: var(--grey); } .badge.check { background: var(--sky); } .badge.call { background: var(--teal); }
.badge.bet, .badge.raise { background: var(--yellow); } .badge.allin { background: var(--pink); color: #fff; } .badge.win { background: var(--teal); }
.badge.sb, .badge.bb { background: #fff; }
.hn { font-size: 11px; font-weight: 900; color: #fff; background: var(--ink); border-radius: 7px; padding: 1px 6px; white-space: nowrap; }
.betlbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font-weight: 900; font-size: 13px; color: #fff; background: rgba(var(--ink-rgb),.85); border-radius: 9px; padding: 1px 7px; white-space: nowrap; will-change: transform; }
.potlbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); text-align: center; will-change: transform; }
.potlbl b { display: inline-block; font-size: 16px; font-weight: 900; color: var(--ink); background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 12px; padding: 2px 12px; box-shadow: 0 3px 0 var(--ink); }
.potlbl small { display: block; margin-top: 4px; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 var(--ink); }
.seatbtn { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.9); border: 3px dashed var(--ink); font-size: 13px; font-weight: 900; display: grid; place-items: center; line-height: 1.05; box-shadow: 0 3px 0 var(--ink); will-change: transform; }
.seatbtn:hover { background: var(--yellow); }
.seatbtn:active { background: var(--yellow); box-shadow: 0 1px 0 var(--ink); }
.bubble { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 7px 12px; font-weight: 900; font-size: 16px; max-width: 230px; z-index: 4; box-shadow: 0 3px 0 var(--ink); animation: popin .25s ease-out; will-change: transform; word-break: break-word; text-align: center; }
.bubble.emoji { font-size: 30px; padding: 2px 8px; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px; background: #fff; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
@keyframes popin { from { opacity: 0; scale: .5; } }

/* ------------------------------------------------ banner / center */
#banner { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 4; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content; max-width: calc(100vw - 20px); }
/* the win banner is a title-card ribbon: red face, cream toon lettering, swallowtails behind */
#banner .win { position: relative; background: var(--red); color: var(--paper); border: 3px solid var(--ink); border-radius: 6px; padding: 6px 18px; margin: 0 26px;
  font: 900 16px/1.35 var(--display); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink);
  box-shadow: 0 4px 0 var(--ink), var(--cel); animation: drop .4s cubic-bezier(.3,1.6,.6,1); text-align: center; }
#banner .win::before, #banner .win::after { content: ''; position: absolute; top: 9px; bottom: -10px; width: 26px;
  background: linear-gradient(var(--ink) 0 3px, var(--velvet) 3px calc(100% - 3px), var(--ink) calc(100% - 3px)); }
#banner .win::before { left: -29px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); }
#banner .win::after { right: -29px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%); }
#banner .win hr { border: 0; border-top: 2px dashed rgba(var(--ink-rgb), .45); margin: 4px 0; }
#banner .win.paused, #banner .win.rit { color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }
#banner .win.paused { background: var(--yellow); } #banner .win.rit { background: var(--sky); }
#banner .win.paused::before, #banner .win.paused::after { background: linear-gradient(var(--ink) 0 3px, #d99a2a 3px calc(100% - 3px), var(--ink) calc(100% - 3px)); }
#banner .win.rit::before, #banner .win.rit::after { background: linear-gradient(var(--ink) 0 3px, #3f8fae 3px calc(100% - 3px), var(--ink) calc(100% - 3px)); }
#banner .win small { display: block; font-size: 12px; opacity: .9; -webkit-text-stroke: 2px var(--ink); }
#banner .next { color: #fff; font-weight: 900; font-size: 13px; text-shadow: 0 2px 0 var(--ink); }
@keyframes drop { from { transform: translateY(-30px) scale(.7); opacity: 0; } }
#center { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 11; width: min(420px, calc(100vw - 24px)); max-height: 70dvh; overflow-y: auto; }
.lobby h3, .sheet-card h3 { margin: 0 0 10px; font-size: 20px; font-weight: 900; font-family: var(--display); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.num { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink2); }
.num input { height: 44px; border-radius: 12px; border: 3px solid var(--ink); font-size: 18px; font-weight: 900; padding: 0 10px; width: 100%; background: #fff; color: var(--ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 14px; padding: 8px 0; }
.toggle input { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--grey); border: 3px solid var(--ink); position: relative; flex: none; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: left .15s; }
.toggle input:checked { background: var(--teal); } .toggle input:checked::after { left: 22px; }
.hint { font-size: 13px; font-weight: 700; color: var(--muted); margin: 8px 0 0; text-align: center; }
.wait-pill { background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 999px; padding: 8px 16px; font-weight: 900; text-align: center; box-shadow: 0 4px 0 var(--ink); }

/* ------------------------------------------------ dock */
#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0 calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); pointer-events: none; }
#dock > * { pointer-events: auto; }
/* turn timer = a lit dynamite fuse: the rope slides left (translateX, never scaleX, so the spark
   stays round) and burns toward the stick at the left end */
#timerbar { display: flex; align-items: center; gap: 0; height: 26px; margin: 0 auto 2px; max-width: 640px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#timerbar.on { opacity: 1; }
#timerbar .dyn { width: 28px; height: 28px; flex: none; position: relative; z-index: 1; transform-origin: 60% 70%; filter: drop-shadow(0 2px 0 rgba(var(--ink-rgb), .45)); }
#timerbar .fuse { position: relative; flex: 1; height: 26px; margin-left: -3px; overflow: hidden; }
#timerbar .fuse i { position: absolute; left: 0; right: 12px; top: 0; bottom: 0; display: block; will-change: transform; }
#timerbar .fuse i::before { content: ''; position: absolute; left: -4px; right: 0; top: 8px; height: 10px; border: 2px solid var(--ink); border-radius: 5px;
  background: repeating-linear-gradient(-45deg, #c99a5b 0 4px, #8a5a2b 4px 8px); }
#timerbar .fuse i::after { content: ''; position: absolute; right: -9px; top: 4px; width: 18px; height: 18px;
  background: radial-gradient(circle, #fff 0 16%, rgba(255,255,255,0) 30%), conic-gradient(var(--yellow) 0 45deg, var(--orange) 45deg 90deg, var(--yellow) 90deg 135deg, var(--orange) 135deg 180deg, var(--yellow) 180deg 225deg, var(--orange) 225deg 270deg, var(--yellow) 270deg 315deg, var(--orange) 315deg);
  clip-path: polygon(50% 0, 60% 32%, 93% 22%, 72% 48%, 100% 64%, 66% 66%, 70% 100%, 50% 75%, 26% 98%, 32% 66%, 0 62%, 28% 46%, 8% 20%, 40% 32%);
  animation: fusespark .166s steps(2) infinite; }
@keyframes fusespark { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(24deg) scale(1.2); } }
#timerbar.low .fuse i::after { width: 24px; height: 24px; top: 1px; right: -12px; }
#timerbar.low .dyn { animation: dynshake .12s steps(2) infinite; }
@keyframes dynshake { 0% { transform: rotate(-7deg) translateX(-1px); } 50% { transform: rotate(7deg) translateX(1px); } }
/* the acting seat's plate: the same rope, thinner, no stick */
.plate .ptimer { height: 6px; width: 100%; border-radius: 3px; overflow: hidden; background: rgba(var(--ink-rgb), .25); }
.plate .ptimer i { display: block; height: 100%; border-radius: 3px; background: repeating-linear-gradient(-45deg, #c99a5b 0 3px, #8a5a2b 3px 6px); box-shadow: inset -4px 0 0 var(--orange); will-change: transform; }
#dockMain { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.myrow { display: flex; align-items: flex-end; gap: 10px; }
.mycards { display: flex; gap: 4px; flex: none; }
.pcard { width: 52px; height: 74px; border-radius: 8px; background: #fffdf7; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); position: relative; font-weight: 900; line-height: 1; animation: flipin .35s ease-out; }
.pcard .r { position: absolute; left: 5px; top: 5px; font-size: 24px; font-family: "Arial Black", var(--font); }
.pcard .s { position: absolute; right: 4px; bottom: 3px; font-size: 30px; }
.pcard.back { background: repeating-linear-gradient(45deg, var(--pink) 0 8px, var(--yellow) 8px 14px); }
.pcard.dim { filter: grayscale(.8) brightness(.8); }
@keyframes flipin { from { transform: rotateY(90deg); } }
.myinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: #fff; text-shadow: 0 2px 0 var(--ink); font-weight: 900; }
.myinfo .stk { font-size: 20px; }
.myinfo .hand { font-size: 13px; color: var(--yellow); }
.myinfo .sub { font-size: 12px; opacity: .9; }
.fxrow { display: flex; gap: 6px; flex: none; }
.fxrow .icon-btn { width: 46px; height: 46px; font-size: 22px; }
.acts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.acts .btn { min-height: 56px; font-size: 18px; flex-direction: column; gap: 0; padding: 4px 6px; }
.acts .btn small { font-size: 13px; }
.pre { display: flex; gap: 8px; }
.pre button { flex: 1; min-height: 44px; border-radius: 12px; border: 3px solid var(--ink); background: rgba(255,255,255,.85); font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 var(--ink); }
.pre button.on { background: var(--sky); }
.raise { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 10px; box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; gap: 8px; }
.raise .presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.raise .presets button { min-height: 38px; border-radius: 10px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 13px; }
.raise .row { display: flex; align-items: center; gap: 8px; }
.raise .amt { flex: 1; text-align: center; font-size: 26px; font-weight: 900; }
.raise input[type=range] { width: 100%; height: 34px; accent-color: var(--pink); }
.raise .step { width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; font-size: 22px; font-weight: 900; }
.miscrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.miscrow .btn { flex: 1; min-width: 120px; }

/* ------------------------------------------------ sheet / pop */
#sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(var(--dim),.55); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet-card { position: relative; width: min(560px, 100%); max-height: 88dvh; overflow-y: auto; background: var(--paper) var(--grain); border: 3px solid var(--ink); border-bottom: 0; border-radius: 26px 20px 0 0 / 20px 26px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .25s cubic-bezier(.2,1.2,.4,1); }
@media (min-width: 700px) and (min-height: 600px) { #sheet { align-items: center; } .sheet-card { border-bottom: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 8px 0 var(--ink); } }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.sheet-card .x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); font-weight: 900; }
.sec { margin: 14px 0 6px; font-weight: 900; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 8px 12px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 14px; }
.opt.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.slider { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; }
.slider input { flex: 1; accent-color: var(--purple); }
.chargrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 420px) { .chargrid { grid-template-columns: repeat(4, 1fr); } }
.charopt { border: 3px solid var(--ink); border-radius: 16px; background: #fff; padding: 4px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 900; position: relative; }
.charopt img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.charopt.on { background: var(--yellow); box-shadow: 0 4px 0 var(--ink); transform: translateY(-3px); }
.charopt.taken { opacity: .35; }
.charopt.taken::after { content: attr(data-taken); position: absolute; top: 40%; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 10px; }
.li .nm { flex: 1; font-weight: 900; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .on { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex: none; border: 2px solid var(--ink); }
.li .on.no { background: #ccc; }
table.score { width: 100%; border-collapse: collapse; font-weight: 800; font-size: 14px; }
table.score th { text-align: left; font-size: 12px; color: var(--muted); padding: 4px; }
table.score td { padding: 7px 4px; border-top: 2px dashed #e4dfd0; }
.pos { color: #1f9e6e; } .neg { color: #e63946; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.award { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px; text-align: center; font-weight: 900; }
.award .ic { font-size: 26px; } .award small { display: block; color: var(--muted); font-size: 11px; }
.emogrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.emogrid button { min-height: 44px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 14px; padding: 4px; }
.chatlog { max-height: 34dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 14px; font-weight: 700; user-select: text; -webkit-user-select: text; }
.chatlog b { color: var(--purple); }
.chatbox { display: flex; gap: 8px; }
.chatbox input { flex: 1; height: 46px; font-size: 16px; }
.share { text-align: center; }
.share .bigcode { font-size: 46px; font-weight: 900; letter-spacing: 8px; color: var(--pink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.share canvas { width: 180px; height: 180px; image-rendering: pixelated; border: 3px solid var(--ink); border-radius: 12px; background: #fff; padding: 6px; }
.share .url { font-size: 12px; color: var(--muted); word-break: break-all; margin: 6px 0; user-select: text; -webkit-user-select: text; }
#pop { position: fixed; z-index: 15; transform: translate(-50%, -100%); display: flex; gap: 8px; padding: 8px; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); animation: popin .2s; }
#pop button { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding: 6px 2px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-size: 26px; font-weight: 900; }
#pop button span { font-size: 11px; }
#pop button:active { transform: scale(.92); }
#pop .who { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; padding: 2px 10px; border-radius: 10px; white-space: nowrap; }

/* ------------------------------------------------ approvals / toasts / conn */
#approvals { position: fixed; top: calc(62px + var(--safe-t)); right: 10px; z-index: 8; display: flex; flex-direction: column; gap: 8px; width: min(320px, calc(100vw - 20px)); }
.appr { display: flex; align-items: center; gap: 8px; background: var(--paper) var(--grain); border: 3px solid var(--ink); border-radius: var(--wob); padding: 8px 8px 8px 12px; box-shadow: 0 4px 0 var(--ink); animation: slidein .3s cubic-bezier(.2,1.4,.4,1); font-weight: 900; }
.appr span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes slidein { from { transform: translateX(110%); } }
/* signs stand clear of the dock, and of the GTO panel riding on it while it shows (gto-ui.js publishes
   --gto-h; the min() adds room for the stick only then) */
#toasts { position: fixed; left: 50%; bottom: calc(max(210px, var(--dock-h, 190px) + 40px + var(--gto-h, 0px) + min(var(--gto-h, 0px) * 99, 18px)) + var(--safe-b)); transform: translateX(-50%); z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: calc(100vw - 30px); }
/* wide screens (room left of the centred panel): while the GTO panel shows (gto-ui.js: body.gto-up,
   --gto-l) the signs keep their old height and stand beside it, not up over the first-person pot
   label and my "your turn" stamp */
@media (min-width: 1000px) and (min-height: 501px) {
  body.gto-up:not(.raise-open) #toasts { bottom: calc(max(210px, var(--dock-h, 190px) + 40px) + var(--safe-b)); left: calc(15px + var(--safe-l)); right: calc(100% - var(--gto-l, 0px) + 12px);
    width: auto; max-width: none; transform: none; align-items: flex-end; }
}
/* toasts are sign-gag placards: a wood-grain board, the newest one held up on a stick */
.toast { position: relative; color: var(--ink); padding: 7px 14px; border: 3px solid var(--ink); border-radius: var(--wob); font-weight: 900; font-size: 14px; text-align: center;
  background: #f6e3b4 repeating-linear-gradient(92deg, rgba(138,90,43,0) 0 11px, rgba(138,90,43,.12) 11px 13px, rgba(138,90,43,0) 13px 24px);
  box-shadow: 0 4px 0 rgba(var(--ink-rgb), .55), var(--cel); animation: signUp .5s cubic-bezier(.2,1.7,.4,1) both; }
.toast:last-child::after { content: ''; position: absolute; left: 50%; top: calc(100% + 3px); width: 8px; height: 22px; margin-left: -4px; background: var(--wood); border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 3px 3px; }
@keyframes signUp { from { transform: translateY(40px) rotate(-8deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
#conn { position: fixed; top: calc(62px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 800; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: var(--yellow); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fullmsg { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; background: rgba(var(--dim),.6); padding: 16px; }
.fullmsg .card { text-align: center; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.fullmsg .big-emoji { font-size: 60px; animation: bounce 1s infinite; }

@media (max-height: 560px) and (orientation: landscape) {
  .acts .btn { min-height: 46px; font-size: 16px; }
  .pcard { width: 42px; height: 60px; } .pcard .r { font-size: 19px; } .pcard .s { font-size: 24px; }
  #dockMain { max-width: 560px; margin-right: 0; }
}
@media (max-width: 440px) {
  #topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .icon-btn { width: 38px; height: 38px; font-size: 17px; border-radius: 12px; }
  .tb-right { gap: 4px; }
  #topbar .code { padding: 5px 9px; } #topbar .code b { font-size: 14px; letter-spacing: 1px; }
  .tb-info { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ------------------------------------------------ icon system */
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.28em; overflow: visible; }
.icon-btn .ic { width: 26px; height: 26px; }
.chip-btn .ic { width: 20px; height: 20px; }
.ic.h { width: 28px; height: 28px; margin-right: 8px; vertical-align: -7px; }
.ic.lg { width: 24px; height: 24px; }
.btn .ic { width: 22px; height: 22px; }
.btn.sm .ic { width: 18px; height: 18px; }
.btn.sq { padding: 6px 8px; }
.logo .fist { width: clamp(52px, 13vw, 84px); height: clamp(52px, 13vw, 84px); animation: jab 1.6s infinite; filter: drop-shadow(0 4px 0 var(--ink)); overflow: visible; }
.big-ic .ic { width: 72px; height: 72px; animation: bounce 1s infinite; }
.h-ic .ic { width: 30px; height: 30px; vertical-align: -8px; }
.wait-pill { display: inline-flex; align-items: center; gap: 8px; }
.wait-pill .ic { width: 22px; height: 22px; }
.toast { display: flex; align-items: center; gap: 8px; }
.toast .ic { width: 22px; height: 22px; }
.appr .ic { width: 24px; height: 24px; }
.badge .ic { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.plate .dot .ic { width: 16px; height: 16px; }
.plate .off .ic { width: 14px; height: 14px; }
.plate.edge .tag { border-style: dashed; }
.myinfo .ic { width: 22px; height: 22px; vertical-align: -4px; filter: drop-shadow(0 2px 0 var(--ink)); }
.seatbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.seatbtn .ic { width: 22px; height: 22px; }
.seatbtn span { font-size: 11px; }
.award .aw-ic .ic { width: 34px; height: 34px; }
.thic .ic { width: 16px; height: 16px; margin-right: 1px; }
.slider .ic { width: 24px; height: 24px; }
.opt .ic { width: 18px; height: 18px; }
.sheet-card .x { display: grid; place-items: center; padding: 0; }
.sheet-card .x .ic { width: 18px; height: 18px; }
#banner .win .ic { vertical-align: -5px; }
#banner .next .ic { width: 18px; height: 18px; }

/* ------------------------------------------------ interaction bar (right edge) */
#fxbar { position: fixed; right: calc(10px + var(--safe-r)); z-index: 6; bottom: calc(var(--dock-h, 190px) + 14px); display: flex; flex-direction: column; gap: 8px; }
/* the phones' folded button and its fan wrapper (see "phones"): not used on wide screens */
#fxbar .fab { display: none; }
#fxbar .fan { display: contents; }
/* five stickers: on short screens (landscape phones) the column wraps into a second one to the left
   instead of running under the top bar */
#fxbar { flex-wrap: wrap-reverse; max-height: calc(100vh - var(--dock-h, 190px) - 76px); max-height: max(110px, calc(100dvh - var(--dock-h, 190px) - 76px)); }
.fxb { width: 60px; min-height: 60px; border-radius: 18px; border: 3px solid var(--ink); background: var(--paper); box-shadow: 0 4px 0 var(--ink), var(--cel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 2px; font-weight: 900; font-size: 11px; line-height: 1.1; }
.fxb .ic { width: 30px; height: 30px; }
@media (hover: hover) { .fxb:not(.ready):hover .ic { animation: wiggle .36s ease-in-out 2; } }
@keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.fxb.punch { background: #ffe1e1; } .fxb.poop { background: #f3e2cf; } .fxb.coffee { background: #e3f6ff; } .fxb.talk { background: #fff4c9; }
@media (max-width: 440px) { .fxb { width: 52px; min-height: 52px; border-radius: 15px; font-size: 10px; } .fxb .ic { width: 26px; height: 26px; } }
@media (max-height: 560px) and (orientation: landscape) { #fxbar { gap: 6px; right: 8px; } .fxb { width: 46px; min-height: 46px; border-radius: 14px; } .fxb .ic { width: 26px; height: 26px; } .fxb span { display: none; } }

/* popovers: player actions & target picker share one sticker card */
#pop.fxpop .fxb { width: 66px; }
#pop.picker { flex-direction: column; align-items: stretch; min-width: 170px; max-height: 60dvh; overflow-y: auto; padding-top: 10px; }
/* the picker scrolls, so a tab floating over its top edge would be clipped: the title sits inside instead */
#pop.picker .who { position: static; transform: none; align-self: center; margin-bottom: 2px; }
#pop .who { display: inline-flex; align-items: center; gap: 4px; }
#pop .who .ic { width: 16px; height: 16px; }
#pop .tgt { width: auto; flex-direction: row; justify-content: flex-start; gap: 8px; font-size: 15px; padding: 8px 10px; }
#pop .tgt i { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--ink); flex: none; }

/* ------------------------------------------------ first-person hit overlays */
#selffx { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.sf-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,243,214,0) 22%, rgba(255,243,214,.38) 78%); animation: sfimpact .28s ease-out forwards; }
@keyframes sfflash { from { opacity: 1; } to { opacity: 0; } }
/* warm-white impact frame: ~60 ms hold, then a quick low-contrast fade (no strobe) */
@keyframes sfimpact { 0%, 22% { opacity: 1; } 100% { opacity: 0; } }
.sf-pow { position: absolute; left: 50%; top: 42%; width: 260px; height: 260px; transform: translate(-50%, -50%); display: grid; place-items: center; animation: sfpow 1.1s cubic-bezier(.2,1.6,.4,1) forwards; }
.sf-pow .ic { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-pow b { position: relative; font-size: 54px; font-weight: 900; color: var(--pink); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; transform: rotate(-8deg); font-family: "Arial Black", var(--font); }
@keyframes sfpow { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-20deg); opacity: 0; } 20% { opacity: 1; } 35% { transform: translate(-50%, -50%) scale(1.1) rotate(4deg); } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 0; } }
.sf-star { position: absolute; left: 50%; top: 30%; width: 40px; height: 40px; margin: -20px 0 0 -20px; animation: sfstar 1.6s linear forwards; }
.sf-star .ic { width: 100%; height: 100%; }
@keyframes sfstar { from { transform: rotate(var(--a)) translateX(90px); opacity: 1; } to { transform: rotate(calc(var(--a) + 540deg)) translateX(90px); opacity: 0; } }
.sf-splat { position: absolute; transform: translate(-50%, -50%); animation: sfsplat 4.5s ease-in forwards; filter: drop-shadow(0 4px 0 rgba(var(--ink-rgb),.4)); }
.sf-splat .drip { animation: drip 4.5s ease-in forwards; transform-box: fill-box; transform-origin: top; }
.sf-splat .drip.d2 { animation-duration: 3.6s; }
@keyframes sfsplat { 0% { transform: translate(-50%, -50%) scale(.2); } 8% { transform: translate(-50%, -50%) scale(1.15); } 14% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { transform: translate(-50%, -38%) scale(1, 1.1); opacity: 0; } }
@keyframes drip { 0%, 12% { transform: scaleY(.3); } 100% { transform: scaleY(2.6); } }
.sf-word { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) rotate(-6deg); font-size: 48px; font-weight: 900; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; animation: sfword 1.2s cubic-bezier(.2,1.6,.4,1) forwards; font-family: "Arial Black", var(--font); white-space: nowrap; }
.sf-word.poo { color: #c98a4b; } .sf-word.cof { color: #7ee8ff; }
@keyframes sfword { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15) rotate(-6deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1) rotate(-6deg); opacity: 0; } }
.sf-buzz { position: absolute; inset: 0; background: radial-gradient(circle, rgba(126,232,255,0) 45%, rgba(126,232,255,.4) 100%); animation: buzz 2.6s linear forwards; }
@keyframes buzz { 0%, 100% { opacity: 0; } 10%, 80% { opacity: 1; } 12%, 16%, 20%, 24%, 28%, 32% { transform: translate(3px, -2px); } 14%, 18%, 22%, 26%, 30% { transform: translate(-3px, 2px); } }

/* ------------------------------------------------ loading screen: theatrical title card */
#splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; background: #3a1f16; color: var(--paper);
  /* pinned warm tokens: the card keeps its look while it irises open, whatever theme body switches to */
  --ink: #2a1a14; --paper: #fbf1d9; --red: #d9412b; --velvet: #b8322a; --yellow: #ffc93c; --gold: #f6c453; --gold2: #eea43a; }
#splash.gone { opacity: 0; pointer-events: none; transition: opacity .5s; }
#splash.opening { pointer-events: none; }
/* sunburst: static on phones (a huge rotating conic layer is too heavy at DPR 3); no concentric rings */
#splash .tc-rays { position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 45%, var(--gold) 0deg 7.5deg, var(--gold2) 7.5deg 15deg); }
@media (pointer: fine) and (min-width: 900px) {
  #splash .tc-rays { inset: auto; left: 50%; top: 45%; width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; background: repeating-conic-gradient(var(--gold) 0deg 7.5deg, var(--gold2) 7.5deg 15deg); animation: tcspin 90s linear infinite; }
}
@keyframes tcspin { to { transform: rotate(360deg); } }
#splash .tc-grain { position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
#splash::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(58,31,22,0) 42%, rgba(58,31,22,.72) 100%); }
#splash .sp-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; font-weight: 900; padding: 16px; }
#splash .tc-frame { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: min(330px, calc(100vw - 60px)); padding: 16px 18px 20px;
  background: #fbf1d9 var(--grain); color: var(--ink); border: 5px solid var(--ink); border-radius: 50px 40px 54px 38px / 40px 52px 38px 50px;
  box-shadow: 0 0 0 8px var(--red), 0 0 0 13px var(--ink), 0 14px 0 13px rgba(0,0,0,.3); }
#splash .tc-badge { font: 900 11px/1.2 var(--display); letter-spacing: 2px; color: var(--velvet); font-variant: small-caps; text-align: center; padding: 2px 10px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
#splash .sp-logo { width: 72px; height: 72px; margin-top: 6px; animation: jab 1.2s infinite; filter: drop-shadow(0 4px 0 var(--ink)); overflow: visible; }
#splash .tc-title { margin: 0; font-size: clamp(50px, 15vw, 78px); line-height: 1.15; letter-spacing: 2px; white-space: nowrap; transform: rotate(-3deg); }
#splash .tc-ribbon { margin-top: 4px; }
#splash .tc-film { position: relative; width: 200px; height: 26px; border: 3px solid var(--ink); border-radius: 4px; background: var(--ink); overflow: hidden; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
#splash .tc-film::before, #splash .tc-film::after { content: ''; position: absolute; left: 0; right: 0; height: 4px; z-index: 1; background: repeating-linear-gradient(90deg, var(--paper) 0 6px, transparent 6px 12px); animation: tcfilm .5s linear infinite; }
#splash .tc-film::before { top: 1px; } #splash .tc-film::after { bottom: 1px; }
#splash .tc-film i { position: absolute; top: 6px; bottom: 6px; left: 0; width: 40%; background: var(--yellow); border-radius: 2px; animation: spbar 1.1s ease-in-out infinite; }
@keyframes tcfilm { to { background-position: 12px 0; } }
@keyframes spbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
#spText { font-size: 13px; color: var(--paper); text-shadow: 0 2px 0 var(--ink); max-width: 300px; text-align: center; line-height: 1.4; }
.splash-err { max-width: 340px; text-align: center; font-weight: 800; line-height: 1.5; }

/* home: practice */
.home-card .btn.purple .ic { width: 26px; height: 26px; }
.home-card .sub { display: block; font-size: 12px; font-weight: 700; opacity: .85; }
.btn.big.purple { flex-direction: row; }

/* ------------------------------------------------ tabs */
.tabs { display: flex; gap: 6px; margin: 0 40px 12px 0; }
.tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 42px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 13px; padding: 4px 6px; }
.tabs button.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.tabs .ic { width: 20px; height: 20px; }

/* mini cards (history / rankings) */
.mcard { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 32px; padding: 0 2px; margin-right: 2px; border-radius: 5px; border: 2px solid var(--ink); background: #fffdf7; font-weight: 900; font-size: 13px; font-family: "Arial Black", var(--font); letter-spacing: -1px; }
.mcard.back { background: repeating-linear-gradient(45deg, var(--pink) 0 5px, var(--yellow) 5px 9px); }

/* hand history */
.hist { display: flex; flex-direction: column; gap: 8px; }
.hh { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 10px; }
.hh summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 900; }
.hh summary::-webkit-details-marker { display: none; }
.hh .hid { color: var(--muted); font-size: 13px; min-width: 34px; }
.hh .hbd { flex: 1; display: flex; flex-wrap: wrap; gap: 1px; align-items: center; }
.hh .hbd i { margin: 0 4px; color: var(--muted); font-style: normal; }
.hh .hpot { font-size: 13px; white-space: nowrap; }
.hps { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.hp { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; font-size: 13px; font-weight: 800; }
.hp.me .nm { color: var(--purple); } .hp.fold { opacity: .55; }
.hp .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp .hn2 { font-size: 11px; color: var(--muted); }
.hp .mcard { min-width: 22px; height: 26px; font-size: 11px; }
.hlog { margin-top: 8px; border-top: 2px dashed #e4dfd0; padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.hl { font-size: 12px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.hl b { color: var(--ink2); }
.hl .hb .mcard { min-width: 20px; height: 24px; font-size: 10px; }
.hl .ha { background: var(--tint); border-radius: 6px; padding: 1px 6px; }

/* rankings */
.ranks { display: flex; flex-direction: column; gap: 6px; }
.rk { display: flex; align-items: center; gap: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 6px 10px; }
.rk .rn { width: 24px; height: 24px; border-radius: 8px; background: var(--yellow); border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; }
.rk .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rk .rt small { color: var(--muted); font-weight: 700; font-size: 11px; }
.rk .rc { white-space: nowrap; }
@media (max-width: 440px) { .rk .rc .mcard { min-width: 20px; height: 26px; font-size: 10px; } }

/* ------------------------------------------------ tutorial */
.tut { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(var(--dim),.5); padding: 16px; animation: fade .25s; }
.tut-card { width: min(360px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tut-card p { margin: 0; font-weight: 800; line-height: 1.55; font-size: 15px; }
.tut-ic .ic { width: 64px; height: 64px; animation: bounce 1s infinite; }
.tut-dots { display: flex; gap: 6px; }
.tut-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--grey); border: 2px solid var(--ink); }
.tut-dots i.on { background: var(--pink); }
.tut .btn { width: 100%; }

/* ------------------------------------------------ live equity, keys, achievements */
.badge.eq { background: var(--sky); font-size: 12px; animation: pulse 1s infinite; }
.myinfo .eqme { align-self: flex-start; background: var(--sky); color: var(--ink); text-shadow: none; border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; font-size: 13px; }
kbd { display: none; }
.acts.kb .btn { position: relative; }
.acts.kb kbd { display: block; position: absolute; top: 4px; right: 6px; font: 900 10px/1 var(--font); padding: 2px 4px; border-radius: 5px; border: 1.5px solid currentColor; opacity: .55; }
/* achievement = a small title card: cream plaque, red + ink rings, a 64px sunburst behind the icon */
.achpop { position: fixed; left: 50%; top: calc(76px + var(--safe-t)); z-index: 40; display: flex; align-items: center; gap: 14px; background: var(--paper) var(--grain); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--wob); padding: 8px 20px 8px 12px; max-width: calc(100vw - 40px);
  box-shadow: 0 0 0 5px var(--red), 0 0 0 8px var(--ink), 0 10px 0 8px rgba(0,0,0,.3); animation: achin 4.2s cubic-bezier(.2,1.4,.4,1) forwards; pointer-events: none; }
.achpop .ach-sun { position: relative; width: 50px; height: 50px; flex: none; display: grid; place-items: center; }
.achpop .ach-sun::before { content: ''; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 2px solid var(--ink);
  background: repeating-conic-gradient(var(--gold) 0 15deg, var(--gold2) 15deg 30deg); animation: tcspin 6s linear infinite; }
.achpop .ic { position: relative; width: 40px; height: 40px; }
.achpop small { display: block; color: var(--velvet); font: 900 12px/1.2 var(--display); letter-spacing: 2px; font-variant: small-caps; }
.achpop b { display: block; font-size: 22px; line-height: 1.2; white-space: nowrap; }
@keyframes achin { 0% { transform: translate(-50%, -40px) scale(.6); opacity: 0; } 10% { transform: translate(-50%, 0) scale(1.05); opacity: 1; } 15% { transform: translate(-50%, 0) scale(1); } 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -20px); } }
.achs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 440px) { .achs { grid-template-columns: 1fr; } }
.ach { display: flex; align-items: center; gap: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 10px; opacity: .55; filter: grayscale(.9); }
.ach.on { opacity: 1; filter: none; background: #fff7d6; box-shadow: 0 3px 0 var(--ink); }
.ach .ai .ic { width: 34px; height: 34px; }
.ach b { display: block; font-size: 14px; }
.ach small { color: var(--muted); font-weight: 700; font-size: 11px; }

/* ------------------------------------------------ game mode switch & podium */
.seg { display: flex; gap: 6px; margin-bottom: 6px; }
.seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 15px; }
.seg button.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.seg button .ic { width: 22px; height: 22px; }
.seg-hint { margin: 0 0 10px !important; text-align: left !important; }
.num select { height: 44px; border-radius: 12px; border: 3px solid var(--ink); font-size: 16px; font-weight: 900; padding: 0 8px; background: #fff; color: var(--ink); width: 100%; }
.num[hidden] { display: none !important; }
.podium { text-align: center; }
.pods { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 6px; margin: 8px 0 12px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 900; }
.pod img { width: 72px; height: 72px; }
.pod.p1 img { width: 96px; height: 96px; animation: bounce 1s infinite; }
.pod b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod span { width: 100%; border: 3px solid var(--ink); border-radius: 10px 10px 0 0; font-size: 22px; background: var(--grey); }
.pod.p1 span { height: 78px; background: var(--yellow); line-height: 70px; }
.pod.p2 span { height: 56px; background: #e3e8f5; line-height: 48px; }
.pod.p3 span { height: 42px; background: #f3d3b0; line-height: 34px; }
.places { text-align: left; font-weight: 800; margin: 0 0 12px; padding-left: 28px; color: var(--ink2); }

.practice-row { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; align-items: center; }
.practice-row .pr-label { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 14px; color: var(--ink2); }
.practice-row .pr-label .ic { width: 26px; height: 26px; }
.practice-row .btn { min-height: 46px; font-size: 15px; padding: 6px 8px; }

/* ------------------------------------------------ promo / store art mode */
.promo #home, .promo #splash, .promo #toasts, .promo #conn { display: none !important; }
.promo-brand { position: fixed; z-index: 30; display: flex; align-items: center; gap: 2vmin; left: 50%; bottom: 8vh; transform: translateX(-50%) rotate(-3deg); pointer-events: none; }
.promo-brand .fist { width: 22vmin; height: 22vmin; filter: drop-shadow(0 1vmin 0 var(--ink)); }
.promo-brand h1 { margin: 0; font-size: 17vmin; line-height: 1; font-weight: 900; color: var(--yellow); -webkit-text-stroke: 1.6vmin var(--ink); paint-order: stroke fill; text-shadow: 0 1.4vmin 0 var(--ink); white-space: nowrap; }
.promo-brand p { margin: 1vmin 0 0; font-size: 5.5vmin; font-weight: 900; color: #fff; -webkit-text-stroke: .6vmin var(--ink); paint-order: stroke fill; letter-spacing: .4vmin; }
@media (min-aspect-ratio: 2/1) { .promo-brand { left: 6vw; bottom: auto; top: 50%; transform: translateY(-50%) rotate(-3deg); } .promo-brand h1 { font-size: 22vmin; } .promo-brand .fist { width: 28vmin; height: 28vmin; } }
@media (max-aspect-ratio: 4/5) { .promo-brand { flex-direction: column; text-align: center; bottom: 6vh; } .promo-brand h1 { font-size: 15vw; -webkit-text-stroke: 1.2vw var(--ink); } .promo-brand .fist { width: 30vw; height: 30vw; } .promo-brand p { font-size: 5vw; } }
body.promo-logo #gl, body.promo-logo #overlay { display: none; }
body.promo-logo .promo-brand { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%) rotate(-3deg); }
body.promo-hero .promo-brand { display: none; }


/* enlarged card on hover / tap */
#cardTip { position: fixed; left: 0; top: 0; z-index: 16; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; will-change: transform; }
#cardTip .pcard.big { width: 110px; height: 156px; border-radius: 14px; border-width: 3.5px; box-shadow: 0 6px 0 var(--ink), 0 12px 24px rgba(0,0,0,.35); animation: tipin .14s ease-out; }
#cardTip .pcard.big .r { font-size: 48px; left: 10px; top: 10px; }
#cardTip .pcard.big .s { font-size: 62px; right: 8px; bottom: 6px; }
#cardTip > span { background: var(--ink); color: #fff; font-weight: 900; font-size: 13px; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
@keyframes tipin { from { transform: scale(.7); opacity: 0; } }

/* ------------------------------------------------ invincible button & flight overlays */
.fxb.rage { position: relative; background: #fff; overflow: hidden; }
.fxb.rage .rg { position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(#ffc233 calc(var(--pct, 0) * 360deg), rgba(var(--ink-rgb),.1) 0); }
.fxb.rage .ic, .fxb.rage span { position: relative; }
.fxb.rage:not(.ready):not(.active) .ic { filter: grayscale(.6) opacity(.75); }
.fxb.rage.ready { animation: rageReady .8s ease-in-out infinite; box-shadow: 0 4px 0 var(--ink), 0 0 0 4px rgba(255,210,63,.6), 0 0 22px rgba(255,210,63,.9); }
.fxb.rage.ready .rg { background: var(--yellow); }
.fxb.rage.active .rg { background: linear-gradient(135deg, #ffe98a, #ffb000); }
@keyframes rageReady { 50% { transform: scale(1.1) rotate(-4deg); } }

/* ------------------------------------------------ cigar button: an ember ring burns down while lit */
.fxb.cigar { position: relative; overflow: hidden; background: #f6e6cc; }
.fxb.cigar .cg { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: conic-gradient(rgba(242,145,61,.6) calc(var(--left, 0) * 360deg), transparent 0); }
.fxb.cigar .ic, .fxb.cigar span { position: relative; }
.fxb.cigar:disabled { opacity: 1; }
.fxb.cigar.lit { background: #fff3dc; box-shadow: 0 4px 0 var(--ink), 0 0 0 3px rgba(242,145,61,.45), var(--cel); }
.fxb.cigar.lit span { font-variant-numeric: tabular-nums; }
.fxb.cigar.lit .ic { animation: emberGlow 1.6s ease-in-out infinite; }
@keyframes emberGlow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255,120,40,0)); } 50% { filter: drop-shadow(0 0 5px rgba(255,120,40,.9)); } }
html.rm .fxb.cigar.lit .ic { animation: none; filter: drop-shadow(0 0 3px rgba(255,120,40,.7)); }
@media (prefers-reduced-motion: reduce) { .fxb.cigar.lit .ic { animation: none; filter: drop-shadow(0 0 3px rgba(255,120,40,.7)); } }
.badge.inv { background: var(--yellow); }
.sf-gold { position: absolute; inset: 0; box-shadow: inset 0 0 80px 24px rgba(255,210,63,.55); animation: sfgold var(--dur, 15s) linear forwards; }
@keyframes sfgold { 0% { opacity: 0; } 6% { opacity: 1; } 92% { opacity: .8; } 100% { opacity: 0; } }
.sf-word.fly { color: var(--yellow); font-size: 54px; top: 26%; }
.sf-ping { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,233,138,.0) 30%, rgba(255,210,63,.35) 80%); animation: sfflash .5s ease-out forwards; }
.sf-word.ping { color: #fff3a8; font-size: 40px; top: 40%; }

.sf-word.fly2 { color: var(--pink); font-size: 64px; top: 38%; }

/* ------------------------------------------------ first-person slapstick gags (#selffx), transform/opacity only */
/* impact star + onomatopoeia: cream 14-point star over a slightly larger ink copy */
.sf-burst { position: absolute; left: 50%; top: 42%; width: min(300px, 78vw); aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; animation: sfpow 1.1s cubic-bezier(.2,1.6,.4,1) forwards; }
.sf-burst::before, .sf-burst::after { content: ''; position: absolute; clip-path: var(--burst); transform: rotate(var(--rot, 0deg)); }
.sf-burst::before { inset: 0; background: var(--ink); }
.sf-burst::after { inset: 9px; background: radial-gradient(circle, var(--yellow) 0 18%, #fff6d0 48%); }
.sf-burst b { position: relative; z-index: 1; font: 900 calc(min(300px, 78vw) * var(--k, .17))/1 var(--display); color: var(--red); -webkit-text-stroke: .07em var(--ink); paint-order: stroke fill; text-shadow: .05em .09em 0 var(--ink); transform: rotate(-8deg); white-space: nowrap; }
.sf-burst.heavy b { color: var(--orange); }
/* stars + birdies circling on a flat ellipse near the top of the view (0.9 s per lap, 2 laps) */
.sf-orbit { position: absolute; left: 50%; top: 16%; width: 0; height: 0; --R: min(140px, 34vw); transform: scaleY(.32); animation: sforbitfade 1.8s linear forwards; }
.sf-orbit > i { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; animation: sforbit .9s linear 2 both; }
.sf-orbit > i.bird { left: -20px; top: -20px; width: 40px; height: 40px; }
.sf-orbit > i .ic { width: 100%; height: 100%; transform: scaleY(3.125); }
.sf-orbit > i.bird .ic { animation: sfflap .18s steps(2) infinite; }
@keyframes sforbit { from { transform: rotate(var(--a)) translateX(var(--R)) rotate(calc(-1 * var(--a))); } to { transform: rotate(calc(var(--a) + 360deg)) translateX(var(--R)) rotate(calc(-1 * var(--a) - 360deg)); } }
@keyframes sforbitfade { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sfflap { from { translate: 0 -2px; } to { translate: 0 2px; } }
/* screen crack (gags.js crackSVG), held, then the shards drop away */
.sf-crack { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 45%; animation: sfcrackin .12s ease-out; }
.sf-crack.fall { animation: sfcrackfall .35s ease-in forwards; }
@keyframes sfcrackin { from { opacity: 0; transform: scale(1.04); } }
@keyframes sfcrackfall { to { transform: translateY(60px) rotate(4deg); opacity: 0; } }
/* splats get a rubber squeegee wipe: the blade sweeps across, the splat layer is clipped behind it */
.sf-splats { position: absolute; inset: 0; }
.sf-splats.wipe { animation: sfwipe .55s cubic-bezier(.5,0,.75,.6) forwards; }
@keyframes sfwipe { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); } }
.sf-blade { position: absolute; top: -6%; left: 0; width: 22px; height: 112%; border-radius: 11px; background: linear-gradient(90deg, var(--ink) 0 55%, var(--ink2) 55% 75%, var(--ink) 75%); animation: sfblade .55s cubic-bezier(.5,0,.75,.6) forwards; }
@keyframes sfblade { from { transform: translateX(-30px) rotate(3deg); } to { transform: translateX(calc(100vw + 8px)) rotate(-3deg); } }
/* slipper: teeth-rattle the whole overlay (12 Hz, 300 ms) */
#selffx.sf-rattle { animation: sfrattle .083s steps(1) 4; }
@keyframes sfrattle { 0% { translate: -7px 0; } 50% { translate: 7px 0; } }
/* coffee: vibration tick marks on the four edges, jittering at steps(2) ~16 Hz */
.sf-vib { position: absolute; inset: 0; animation: sfgold 1.6s linear forwards; }
.sf-vib > i { position: absolute; width: 48px; height: 64px; }
.sf-vib > i.l { left: 3%; top: 46%; }
.sf-vib > i.r { right: 3%; top: 46%; transform: scaleX(-1); }
.sf-vib > i.t { left: calc(50% - 24px); top: 11%; transform: rotate(90deg); }
.sf-vib > i.b { left: calc(50% - 24px); bottom: 22%; transform: rotate(-90deg); }
.sf-vib > i b { position: absolute; left: 0; top: 0; width: 22px; height: 100%; border-left: 5px solid var(--ink); border-radius: 50%; animation: sfvib .125s steps(2) infinite; }
.sf-vib > i b:nth-child(2) { left: 11px; top: 8%; height: 84%; animation-delay: -.06s; }
.sf-vib > i b:nth-child(3) { left: 22px; top: 16%; height: 68%; }
@keyframes sfvib { from { translate: -2px 1px; } to { translate: 2px -1px; } }
/* shield block: ricochet streaks from one edge with a spark */
.sf-rico { position: absolute; inset: 0; }
.sf-rico.r { transform: scaleX(-1); }
.sf-rico > i { position: absolute; left: 0; top: var(--y); width: 55vw; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(255,246,208,0), #fff6d0 45%, #fff); box-shadow: 0 0 0 2px rgba(var(--ink-rgb), .7); transform-origin: 0 50%; transform: rotate(var(--r)) scaleX(0); animation: sfrico .5s ease-out var(--d, 0s) forwards; }
@keyframes sfrico { 0% { transform: rotate(var(--r)) scaleX(0); opacity: 1; } 45% { transform: rotate(var(--r)) scaleX(1); opacity: 1; } 100% { transform: rotate(var(--r)) translateX(18%) scaleX(1); opacity: 0; } }
.sf-rico > b { position: absolute; left: -14px; top: var(--y); width: 44px; height: 44px; margin-top: -22px; animation: sfspark .45s ease-out forwards; }
.sf-rico > b .ic { width: 100%; height: 100%; }
@keyframes sfspark { 0% { transform: scale(.2) rotate(0); opacity: 1; } 40% { transform: scale(1.1) rotate(40deg); opacity: 1; } 100% { transform: scale(.6) rotate(90deg); opacity: 0; } }
/* flight: a small (60vmin) sunburst turning slowly behind the word */
.sf-rays { position: absolute; left: 50%; top: 26%; width: 60vmin; height: 60vmin; margin: -30vmin 0 0 -30vmin; border-radius: 50%; background: repeating-conic-gradient(var(--gold) 0 7.5deg, rgba(246,196,83,0) 7.5deg 15deg); -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 70%); mask-image: radial-gradient(circle, #000 25%, transparent 70%); animation: tcspin 12s linear infinite, sfraysfade 2.6s linear forwards; }
@keyframes sfraysfade { 0% { opacity: 0; } 12%, 80% { opacity: .35; } 100% { opacity: 0; } }
/* reduced motion: words only (the global rule would otherwise fast-forward them to invisible) */
@media (prefers-reduced-motion: reduce) {
  .sf-flash, .sf-orbit, .sf-crack, .sf-vib, .sf-rico, .sf-rays, .sf-blade, .sf-splats, .sf-burst::before, .sf-burst::after, .sf-star, .sf-buzz, .sf-ping { display: none; }
  .sf-word, .sf-burst, .sf-pow { animation: none !important; }
  #selffx.sf-rattle { animation: none; }
}

/* Two independent poker universes. */
.home-top { display:flex; gap:8px; align-items:center; }
.universe-link { color:var(--ink); text-decoration:none; font-size:12px; min-height:36px; }
@media(max-width:440px) { #topbar .universe-link { max-width:62px; padding:5px; font-size:11px; } }

/* ------------------------------------------------ props box */
.fxb.box { background: #ffe9cf; }
#pop.propbox { flex-wrap: wrap; width: min(300px, calc(100vw - 20px)); justify-content: center; padding-top: 18px; transform: translate(-50%, -100%); }
#pop.propbox .fxb, #pop.fxpop .fxb { width: 64px; min-height: 60px; }
#pop.fxpop { flex-wrap: wrap; width: min(310px, calc(100vw - 20px)); justify-content: center; }
.fxb.tomato { background: #ffe1e1; } .fxb.chicken { background: #fff4c9; } .fxb.water { background: #e3f6ff; } .fxb.slipper { background: #ffe3ef; } .fxb.mahjong { background: #e4f7ee; }
.sf-word.wet { color: #7fd8ff; }

/* ------------------------------------------------ wardrobe */
.wd-preview { display: grid; place-items: center; background: radial-gradient(circle, #fff7d6, #ffe9cf); border: 2.5px solid var(--ink); border-radius: 18px; margin-bottom: 4px; }
.wd-preview img { width: 170px; height: 170px; }
.wd-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.wd-item { border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; text-align: center; font-weight: 900; font-size: 14px; }
.wd-item small { font-size: 10px; color: var(--muted); font-weight: 700; min-height: 12px; }
.wd-item small .ic { width: 11px; height: 11px; vertical-align: -1px; }
.wd-item.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.wd-item.locked { opacity: .5; }

/* all-in runout drama: darkened edges */
#selffx::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 45%, rgba(var(--dim),.7) 100%); opacity: 0; transition: opacity 1.2s; }
#selffx.drama::before { opacity: 1; }

/* comic callouts (POW!, 中国人能飞…) — above seat plates, below the HUD */
#comics { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.comic { position: absolute; left: 0; top: 0; white-space: nowrap; font: 900 40px var(--display); line-height: 1.1; -webkit-text-stroke: .16em var(--ink, #2a1a14); paint-order: stroke fill; text-shadow: .05em .09em 0 var(--ink, #2a1a14); will-change: transform, opacity; transform-origin: 50% 50%; isolation: isolate; }
/* short words (scene.js comic() adds .burst + --rot for <= 6 glyphs): a jagged cream star behind, ink copy under it */
.comic.burst::before, .comic.burst::after { content: ''; position: absolute; z-index: -1; clip-path: var(--burst); transform: rotate(var(--rot, 0deg)); }
.comic.burst::before { inset: calc(-.95em - 5px) calc(-.75em - 5px); background: var(--ink, #2a1a14); }
.comic.burst::after { inset: -.95em -.75em; background: radial-gradient(circle, #fff6d0 45%, #ffe7a0 100%); }

/* first / third person switch in the topbar */
.view-btn { display: inline-flex; align-items: center; gap: 5px; pointer-events: auto; }
.view-btn .ic { width: 22px; height: 22px; }
@media (max-width: 760px) { .view-btn span { display: none; } .view-btn { padding: 0 8px; }
  /* narrow wide-layout screens (a foldable opened upright, small tablets): the coin in place of the
     words and no buy-in, as on phones, so the blinds never cut off */
  .tb-info .tb-w { display: none; } .tb-info .ic { display: inline-block; width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px; } }
#muteBtn { pointer-events: auto; }
#muteBtn.off { background: var(--grey); }

/* ------------------------------------------------ phones: portrait up to 480 wide, landscape up to 500 tall
   (main.js PHONE is the same query). The felt gets the screen: a short top bar with the rest of its
   buttons in a "more" card, the five interaction stickers folded into one button that fans them
   out, smaller name plates, signs held up over the near felt instead of the middle of the table. */
@media (max-width: 480px), (max-height: 500px) {
  /* top bar: room code · info chip (blinds; the hand number or a sit & go's next level) · mute · chat · more */
  #topbar { gap: 6px; padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) 6px calc(8px + var(--safe-l)); }
  #topbar > .universe-link { display: none; }
  #topbar .code { padding: 6px 9px; gap: 4px; }
  #topbar .code b { font-size: 14px; letter-spacing: 1px; }
  #topbar .code .ic { width: 16px; height: 16px; }
  .tb-info { flex: 0 1 auto; flex-flow: column; align-items: flex-start; min-width: 0; padding: 2px 10px 2px 7px; border-radius: 12px;
    background: rgba(var(--ink-rgb), .62); font-size: 12px; line-height: 1.25; text-shadow: none; }
  .tb-info > span { max-width: 100%; }
  .tb-info .ic { display: inline-block; width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px; }
  .tb-info .tb-w { display: none; }
  #blindInfo { flex: none; }
  /* the second line: a sit & go's next level (hourglass + m:ss) in place of the hand number */
  #handInfo { padding-left: 19px; font-size: 11px; opacity: .85; }
  #handInfo:empty, #lvlInfo:empty, #lvlInfo:not(:empty) ~ #handInfo { display: none; }
  #lvlInfo:not(:empty)::before { content: none; }
  .tb-right { position: relative; margin-left: auto; gap: 5px; }
  #topbar .icon-btn { width: 36px; height: 36px; border-radius: 12px; }
  #topbar .icon-btn .ic { width: 22px; height: 22px; }
  .tb-dots { display: grid; order: 9; }
  #moreBtn[aria-expanded="true"] { background: var(--yellow); }
  /* the "more" card drops from its button: one sticker row per item, icon + word */
  .tb-more { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1; display: flex; flex-direction: column; gap: 6px; min-width: 176px; padding: 8px;
    background: var(--paper) var(--grain); border: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 5px 0 var(--ink);
    transform-origin: 88% 0; visibility: hidden; opacity: 0; transform: translateY(-8px) scale(.85); pointer-events: none;
    transition: transform .24s cubic-bezier(.3,1.6,.5,1), opacity .12s, visibility 0s .24s; }
  #topbar.more-open { z-index: 12; } /* over the folded sticker button and a vote card */
  #topbar.more-open .tb-more { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
  #topbar .tb-more > * { order: 0; display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: auto; min-height: 42px; max-width: none;
    padding: 5px 10px 5px 6px; border-radius: 12px; border-width: 2.5px; box-shadow: 0 2px 0 var(--ink), var(--cel); font-size: 14px; font-weight: 900; white-space: nowrap; }
  #topbar .tb-more .ic { width: 24px; height: 24px; }
  .tb-more .tb-l, .tb-more .view-btn span, .tb-more .vb-k { display: inline; }
  .tb-more .icon-btn i { position: static; margin-left: auto; }
  #topbar .tb-more .tb-uni { display: flex; font-size: 13px; }

  /* the stickers: one round button above the dock (clear of the fuse) that fans them out upward */
  #fxbar { bottom: calc(var(--dock-h, 190px) + 34px); right: calc(10px + var(--safe-r)); max-height: none; gap: 0; }
  body.raise-open #fxbar { visibility: hidden; } /* the raise panel lifts the dock: out of the way while I size it */
  #fxbar .fab { display: grid; place-items: center; width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50%; position: relative; overflow: visible; background: var(--paper); }
  #fxbar .fab > .ic { width: 32px; height: 32px; position: relative; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
  /* 无敌 charge: a ring round the inside of the rim fills up; full = gold ring, glow and a shield pip */
  #fxbar .fab .rg { position: absolute; inset: 2px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(var(--yellow) calc(var(--pct, 0) * 360deg), rgba(var(--ink-rgb), .12) 0);
    -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%); mask: radial-gradient(circle, transparent 60%, #000 62%); }
  #fxbar .fab .fab-inv { position: absolute; left: -7px; top: -7px; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center;
    background: #fff; border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
  #fxbar .fab .fab-inv .ic { width: 18px; height: 18px; }
  #fxbar.inv-ready .fab { box-shadow: 0 4px 0 var(--ink), 0 0 0 4px rgba(255,210,63,.6), 0 0 22px rgba(255,210,63,.9); animation: rageReady .8s ease-in-out infinite; }
  #fxbar.inv-ready .fab .fab-inv, #fxbar.inv-on .fab .fab-inv { display: grid; }
  #fxbar.inv-on .fab { background: linear-gradient(135deg, #ffe98a, #ffb000); }
  /* a burning cigar: warm face and the seconds left in an ember pip */
  #fxbar.cig-lit .fab { background: #fff3dc; }
  #fxbar .fab .cs { position: absolute; right: -7px; top: -7px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; border: 2px solid var(--ink);
    background: var(--orange); color: #fff; font: 900 12px/18px var(--font); text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 2px 0 var(--ink); }
  #fxbar .fab .cs[hidden] { display: none; }
  #fxbar.open { z-index: 7; } /* the fan over the GTO panel (landscape opens it leftward, along the panel) */
  #fxbar.open .fab { background: var(--yellow); }
  #fxbar.open .fab > .ic { transform: rotate(-25deg) scale(.9); }
  #fxbar .fan { position: absolute; right: 2px; bottom: calc(100% + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px;
    visibility: hidden; pointer-events: none; transition: visibility 0s .26s; }
  #fxbar.open .fan { visibility: visible; pointer-events: auto; transition-delay: 0s; }
  #fxbar .fan > .fxb { opacity: 0; transform: translateY(calc(18px + var(--k, 0) * 14px)) scale(.4);
    transition: transform .26s cubic-bezier(.3,1.6,.5,1) calc(var(--k, 0) * 30ms), opacity .14s calc(var(--k, 0) * 30ms), box-shadow .1s; }
  #fxbar.open .fan > .fxb { opacity: 1; transform: none; }
  #fxbar.open .fan > .fxb:active { transform: translateY(3px) scale(1.07, .88); transition-duration: .05s; }

  /* name plates and the pot: a size down (the chip pills and plate timers: callouts.css) */
  .plate { gap: 2px; }
  .plate .tag { gap: 4px; min-width: 60px; padding: 2px 6px 2px 3px; border-width: 2px; border-radius: 10px; box-shadow: 0 2px 0 var(--ink); }
  .plate .dot { width: 18px; height: 18px; border-radius: 6px; }
  .plate .dot .ic { width: 13px; height: 13px; }
  .plate .nm { font-size: 11px; max-width: 64px; }
  .plate .st { font-size: 12px; }
  .badge { font-size: 10px; padding: 1px 5px; border-radius: 7px; }
  .hn { font-size: 10px; }
  .potlbl b { font-size: 15px; padding: 1px 10px; }
  .bubble { font-size: 14px; padding: 5px 10px; max-width: 190px; }

  /* signs stand on the near felt above the dock (left of the folded button), two at a time; while
     the GTO panel shows (gto-ui.js publishes --gto-h) they rest right on it, the stick tucked away */
  #toasts { left: calc(10px + var(--safe-l)); right: calc(78px + var(--safe-r)); width: auto; max-width: none; transform: none;
    bottom: calc(var(--dock-h, 190px) + 40px + var(--gto-h, 0px)); }
  .toast:last-child::after { clip-path: inset(0 0 min(var(--gto-h, 0px) * 99, 100%) 0); }
  .toast { font-size: 13px; padding: 5px 10px; max-width: 100%; }
  .toast .ic { width: 20px; height: 20px; }
  /* banners (result, pause, votes): under the top bar, or in first person upright over the felt
     just in front of the board (main.js measureHud sets --banner-top) */
  #banner { top: var(--banner-top, calc(54px + var(--safe-t))); }
  #approvals, #conn { top: calc(54px + var(--safe-t)); }
  #approvals { right: calc(8px + var(--safe-r)); }
  #dock { padding: 0 calc(8px + var(--safe-r)) calc(8px + var(--safe-b)) calc(8px + var(--safe-l)); }
}
/* short portrait phones (SE-size): a slightly smaller hand and action row */
@media (max-width: 480px) and (max-height: 700px) {
  .pcard { width: 46px; height: 66px; } .pcard .r { font-size: 21px; } .pcard .s { font-size: 26px; }
  .acts .btn { min-height: 50px; font-size: 17px; }
  #dockMain { gap: 6px; }
}
/* landscape phones: cards + stack on the left, the actions beside them (one short row instead of
   two), the fan opens leftward, signs stand in the bottom-left corner */
@media (max-height: 500px) {
  #dockMain { max-width: none; margin: 0; display: grid; grid-template-columns: auto minmax(0, 540px); justify-content: end; align-items: end; gap: 0 12px; }
  #dockMain > * { grid-column: 2; }
  #dockMain > :not(.myrow) + :not(.myrow) { margin-top: 6px; }
  #dockMain > .myrow { grid-column: 1; grid-row: 1 / span 3; }
  .myinfo .stk { font-size: 17px; }
  .myinfo .hand { font-size: 12px; }
  .acts .btn { min-height: 44px; font-size: 16px; }
  /* the raise panel in two rows (presets beside the stepper, then the slider) so the board stays in view */
  .raise { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px; gap: 6px 10px; }
  .raise .presets button { min-height: 36px; padding: 0 3px; font-size: 12px; white-space: nowrap; }
  .raise .amt { min-width: 52px; font-size: 22px; }
  .raise input[type=range] { grid-column: 1 / -1; height: 26px; }
  .raise .step { width: 38px; height: 38px; }
  /* the fuse rides on the actions' column (main.js measureHud: --acts-l), never across the felt over
     my cards (the raise panel lifts it to the middle of the table there) */
  #timerbar { max-width: none; margin-left: max(0px, calc(var(--acts-l, 0px) - 8px - var(--safe-l))); }
  .tb-more { display: grid; grid-template-columns: 1fr 1fr; min-width: 320px; }
  #topbar .tb-more > * { min-height: 38px; }
  #fxbar .fan { flex-direction: row; right: calc(100% + 10px); bottom: 4px; }
  #fxbar .fan > .fxb { transform: translateX(calc(18px + var(--k, 0) * 14px)) scale(.4); }
  #toasts { right: auto; max-width: min(320px, 42vw); align-items: flex-start; }
  /* the raise panel lifts only the actions' column: the signs stay on my cards' column, left of it,
     under the board (main.js measureHud: --row-h, --acts-l) */
  body.raise-open #toasts { bottom: calc(var(--row-h, var(--dock-h, 190px)) + 40px); max-width: min(320px, calc(var(--acts-l, 42vw) - 20px - var(--safe-l))); }
  /* banners (result, versus board, pause, votes) ride in the top bar's free middle (main.js
     measureHud: --tb-gap-l / --tb-gap-r), clear of the far side's plates right under the bar */
  #banner { top: calc(6px + var(--safe-t)); left: var(--tb-gap-l, 30%); right: var(--tb-gap-r, 30%); width: auto; max-width: none; transform: none;
    flex-flow: row wrap; justify-content: center; gap: 4px 8px; }
  #banner .win { padding: 3px 14px; font-size: 15px; }
  #banner .win small { display: inline; margin-left: 6px; }
}
html.rm #fxbar .fan > .fxb, html.rm .tb-more, html.rm #fxbar .fab > .ic { transition: none; }
@media (prefers-reduced-motion: reduce) { #fxbar .fan > .fxb, .tb-more, #fxbar .fab > .ic { transition: none !important; } }

/* ------------------------------------------------ toon lettering: ink stroke, red+ink extrude, glyph hop + line boil */
.toon-type { font-family: var(--display); font-weight: 900; color: var(--yellow); -webkit-text-stroke: .12em var(--ink); paint-order: stroke fill;
  text-shadow: .04em .07em 0 var(--red), .06em .12em 0 var(--ink); }
/* three independent properties so tilt (rotate), hop (translate) and boil (transform) never fight */
.toon-type .g { display: inline-block; rotate: var(--r, 0deg); animation: tchop 1.6s ease-in-out infinite, tcboil .36s steps(1) infinite;
  animation-delay: calc(var(--i, 0) * -90ms), calc(var(--i, 0) * -120ms); }
@keyframes tchop { 0%, 40%, 100% { translate: 0 0; } 20% { translate: 0 -.07em; } }
@keyframes tcboil { 0% { transform: translate(0, 0) rotate(0deg); } 33% { transform: translate(.012em, -.01em) rotate(.9deg); } 66% { transform: translate(-.01em, .008em) rotate(-.7deg); } }

/* swallowtail ribbon: ink silhouette + inset red face, no filters */
.brand p, #splash .tc-ribbon, #epcard .ep-ribbon { position: relative; isolation: isolate; display: inline-block; padding: 7px 34px 10px; color: var(--paper); font: 900 15px/1.2 var(--display);
  letter-spacing: 1px; text-shadow: 0 2px 0 rgba(0,0,0,.25); background: var(--ink); white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%); }
.brand p::before, #splash .tc-ribbon::before, #epcard .ep-ribbon::before { content: ''; position: absolute; inset: 3px 4px 6px; z-index: -1; background: var(--red);
  clip-path: polygon(0 0, 100% 0, calc(100% - 13px) 50%, 100% 100%, 0 100%, 13px 50%); }
#splash .tc-ribbon { letter-spacing: 4px; }

/* ------------------------------------------------ theatre: episode / THE END card, curtain, KO / blackout / soot */
/* The iris itself is gags.js's DPR-capped canvas at z 60; the card sits on the black above it. */
body.ep-on #conn { display: none !important; }
#home.leaving { pointer-events: none; }
#epcard { position: fixed; inset: 0; z-index: 61; display: grid; place-items: center; padding: 16px; pointer-events: none; overflow: hidden; color: var(--ink);
  /* pinned warm tokens: the card looks the same whatever theme body carries */
  --ink: #2a1a14; --ink2: #5a3d2e; --paper: #fbf1d9; --red: #d9412b; --velvet: #b8322a; --yellow: #ffc93c; --gold: #f6c453; --gold2: #eea43a; }
/* sunburst disc behind the plaque: static on phones, turning slowly only on big pointer screens */
#epcard .ep-rays { position: absolute; left: 50%; top: 50%; width: min(92vmin, 560px); height: min(92vmin, 560px); margin: calc(min(92vmin, 560px) / -2) 0 0 calc(min(92vmin, 560px) / -2);
  border-radius: 50%; background: repeating-conic-gradient(var(--gold) 0 7.5deg, var(--gold2) 7.5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 42%, transparent 71%); mask-image: radial-gradient(circle, #000 42%, transparent 71%); animation: eprays .6s ease-out both; }
@media (pointer: fine) and (min-width: 900px) { #epcard .ep-rays { animation: eprays .6s ease-out both, tcspin 40s linear infinite; } }
@keyframes eprays { from { opacity: 0; scale: .6; } }
#epcard .ep-frame { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(380px, calc(100vw - 60px)); padding: 14px 16px 18px; text-align: center;
  background: var(--paper) var(--grain); border: 5px solid var(--ink); border-radius: 50px 40px 54px 38px / 40px 52px 38px 50px;
  box-shadow: 0 0 0 8px var(--red), 0 0 0 13px var(--ink), 0 14px 0 13px rgba(0,0,0,.3); animation: epin .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes epin { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }
#epcard .ep-badge { font: 900 11px/1.2 var(--display); letter-spacing: 2px; color: var(--velvet); font-variant: small-caps; padding: 2px 10px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
#epcard .ep-head { margin: 4px 0 2px; font-size: clamp(28px, 8vw, 40px); line-height: 1.15; letter-spacing: 1px; white-space: nowrap; transform: rotate(-3deg); }
#epcard.end .ep-head { font-size: clamp(40px, 12vw, 60px); }
#epcard .ep-ribbon { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#epcard .ep-film { position: relative; width: 150px; height: 20px; margin-top: 8px; border: 3px solid var(--ink); border-radius: 4px; background: var(--ink); overflow: hidden; }
#epcard .ep-film::before, #epcard .ep-film::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; z-index: 1; background: repeating-linear-gradient(90deg, var(--paper) 0 5px, transparent 5px 10px); animation: tcfilm .5s linear infinite; }
#epcard .ep-film::before { top: 1px; } #epcard .ep-film::after { bottom: 1px; }
#epcard .ep-film i { position: absolute; top: 5px; bottom: 5px; left: 0; width: 40%; background: var(--yellow); border-radius: 2px; animation: spbar 1.1s ease-in-out infinite; }
#epcard .ep-load { font: 800 13px/1.3 var(--font); color: var(--ink2); }

/* tournament curtain: velvet folds (18px period) with a gold fringe, parting with overshoot */
#curtain { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
#curtain::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(34px + var(--safe-t)); z-index: 1; background: var(--velvet); border-bottom: 5px solid var(--gold); box-shadow: 0 3px 0 var(--ink); }
#curtain i { position: absolute; top: 0; bottom: 0; width: 53%; will-change: transform; transition: transform .7s cubic-bezier(.3,1.35,.5,1);
  background: repeating-linear-gradient(90deg, #8f231d 0 3px, #b8322a 3px 8px, #d44b3a 8px 11px, #b8322a 11px 16px, #8f231d 16px 18px); }
#curtain i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; border-top: 3px solid var(--ink);
  background: linear-gradient(var(--gold) 0 5px, transparent 5px), repeating-linear-gradient(90deg, var(--gold2) 0 3px, transparent 3px 6px); }
#curtain .cl { left: 0; transform: translateX(-105%); border-right: 4px solid var(--ink); }
#curtain .cr { right: 0; transform: translateX(105%); border-left: 4px solid var(--ink); }
#curtain.shut .cl, #curtain.shut .cr { transform: none; }
#curtain.closing i { transition: transform .45s cubic-bezier(.5,0,.8,.6); }
#curtain.still i { transition: none; }
body.curtain-hold #center { visibility: hidden; }

/* KO / blackout: an ink sheet inside #selffx (under the HUD) whose hole gags.iris animates as a mask */
.sf-iris { position: absolute; inset: 0; background: #14090a; }
.sf-orbit.ko { top: 42%; --R: min(64px, 16vw); }
.sf-word.ko { top: 51%; font-size: 30px; color: var(--paper); }
.sf-word.ko.out { top: 58%; }
.sf-flash.white { background: radial-gradient(circle at 50% 45%, rgba(255,248,234,.45) 30%, rgba(255,248,234,.3) 100%); animation: sfimpact .12s linear forwards; }
.sf-burst.boom b { color: var(--orange); }
/* soot face: a dark-brown vignette with soot blobs at the edges */
.sf-soot { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(30,18,12,.5) 20%, rgba(30,18,12,.92) 85%); animation: sfsoot 1.9s ease-in forwards; }
.sf-soot svg { position: absolute; transform: translate(-50%, -50%); fill: #1e120c; }
@keyframes sfsoot { 0% { opacity: 0; } 8%, 70% { opacity: 1; } 100% { opacity: 0; } }
/* two eye-whites in the dark: blink twice (scaleY at 35-40%), pupils glance left then right */
.sf-eyes { position: absolute; left: 50%; top: 44%; display: flex; gap: 16px; transform: translate(-50%, -50%); animation: sfeyes 1.7s linear forwards; }
.sf-eyes i { position: relative; width: 34px; height: 48px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); animation: sfblink .8s ease-in-out .2s 2; }
.sf-eyes i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 13px; height: 16px; margin: -6px 0 0 -6.5px; border-radius: 50%; background: #14090a; animation: sfglance 1.5s ease-in-out forwards; }
.sf-eyes.soot { top: 46%; }
@keyframes sfeyes { 0% { opacity: 0; } 10%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sfblink { 0%, 33%, 42%, 100% { transform: scaleY(1); } 37% { transform: scaleY(.1); } }
@keyframes sfglance { 0%, 20% { translate: 0 0; } 32%, 52% { translate: -8px 0; } 64%, 86% { translate: 8px 0; } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .sf-soot, .sf-eyes, #curtain { display: none; }
  #epcard .ep-rays, #epcard .ep-frame { animation: none; }
}

/* ------------------------------------------------ M4 accessibility: reduced motion + flash safety
   Flashes: every full-screen luminance change is a single low-contrast frame (warm white at
   <= .45 alpha, radial so the centre stays readable), and main.js gates them through
   gags.flashOK() so they never repeat faster than 2.5 Hz. Nothing here strobes.
   Reduced motion: the rules below mirror the prefers-reduced-motion blocks for <html class="rm">,
   which gags.js sets for the OS preference and for the in-game "reduce motion" toggle. */
html.rm *, html.rm *::before, html.rm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
html.rm .sf-flash, html.rm .sf-orbit, html.rm .sf-crack, html.rm .sf-vib, html.rm .sf-rico, html.rm .sf-rays, html.rm .sf-blade, html.rm .sf-splats,
html.rm .sf-burst::before, html.rm .sf-burst::after, html.rm .sf-star, html.rm .sf-buzz, html.rm .sf-ping, html.rm .sf-soot, html.rm .sf-eyes, html.rm #curtain { display: none; }
html.rm .sf-word, html.rm .sf-burst, html.rm .sf-pow { animation: none !important; }
html.rm #selffx.sf-rattle { animation: none; }
html.rm #epcard .ep-rays, html.rm #epcard .ep-frame { animation: none; }
/* words and status must not be fast-forwarded to their invisible end frame: the achievement
   plaque stays put until main.js removes it, and the invincibility glow holds steady */
html.rm .achpop { animation: none !important; transform: translateX(-50%); }
html.rm .sf-gold { animation: none !important; opacity: .8; }
@media (prefers-reduced-motion: reduce) {
  .achpop { animation: none !important; transform: translateX(-50%); }
  .sf-gold { animation: none !important; opacity: .8; }
}

/* ------------------------------------------------ desktop glove cursor (pointer:fine only)
   gags.gloveCursor() draws it as an SVG data URI into --cur-hand / --cur-press; without it
   (or where SVG cursors are unsupported) the value falls back to the system pointer. */
@media (pointer: fine) {
  button:not(:disabled), [data-a]:not(:disabled), .plate, .seatbtn, a[href], summary, label.toggle, .opt { cursor: var(--cur-hand, pointer); }
  button:not(:disabled):active, [data-a]:not(:disabled):active, .fxb:active, .opt:active { cursor: var(--cur-press, var(--cur-hand, pointer)); }
}

/* ------------------------------------------------ cigar: the first-person big drag (猛吸) and its cloud */
.sf-cigdrag { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255,140,50,.16) 0%, rgba(255,140,50,0) 14%),
    radial-gradient(ellipse 75% 70% at 50% 52%, rgba(30,10,4,0) 45%, rgba(30,10,4,.5) 100%);
  animation: sfcigdrag 1.9s ease-in-out forwards; }
@keyframes sfcigdrag { 0% { opacity: 0; } 22% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.sf-cigdrag.rm { animation-duration: 1.9s; background: radial-gradient(ellipse 60% 55% at 50% 54%, rgba(0,0,0,0) 40%, rgba(40,14,6,.4) 100%); }
.sf-cigcloud { position: absolute; inset: 0; pointer-events: none; }
.sf-cigcloud i { position: absolute; left: var(--x); top: var(--y); width: calc(60vmax * var(--s)); height: calc(42vmax * var(--s));
  margin: calc(-21vmax * var(--s)) 0 0 calc(-30vmax * var(--s)); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(246,241,232,.92), rgba(236,229,218,.72) 45%, rgba(230,222,210,0) 100%);
  transform: scale(.15); opacity: 0; animation: sfcigcloud 3s cubic-bezier(.2,.7,.3,1) var(--d) forwards; }
@keyframes sfcigcloud { 0% { transform: translateY(8vh) scale(.15); opacity: 0; } 14% { opacity: 1; } 45% { transform: translateY(-2vh) scale(1); opacity: .95; } 100% { transform: translateY(-14vh) scale(1.45); opacity: 0; } }
.sf-cigcloud.rm i { animation-duration: 2.2s; }
@media (prefers-reduced-motion: reduce) { .sf-cigcloud i { animation-duration: 2s; } }

/* ------------------------------------------------ cigar butt (弹烟头): the lit button, and the first-person hot-head gag */
.fxb.butt { background: #ffe3cc; }
.fxb.cigar.butt { background: #ffe9cf; }
.fxb.cigar.lit:not(:disabled) .ic { animation: emberGlow 1.6s ease-in-out infinite, buttNudge 2.4s ease-in-out infinite; }
@keyframes buttNudge { 0%, 78%, 100% { transform: rotate(0); } 84% { transform: rotate(-16deg) translateY(1px); } 90% { transform: rotate(10deg) translate(1px, -2px); } }
.fxb.cigar .cs { position: absolute; top: 3px; right: 4px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px; border: 2px solid var(--ink);
  background: #fff3dc; color: var(--ink); font: 900 10px/13px var(--font); text-align: center; font-variant-numeric: tabular-nums; z-index: 1; }
.fxb.cigar .cs[hidden] { display: none; }
@media (max-width: 440px) { .fxb.cigar .cs { top: 2px; right: 2px; min-width: 15px; height: 15px; font-size: 9px; line-height: 11px; } }
html.rm .fxb.cigar.lit:not(:disabled) .ic { animation: none; }
@media (prefers-reduced-motion: reduce) { .fxb.cigar.lit:not(:disabled) .ic { animation: none; } }
.sf-burst.hot b { color: var(--orange); }
.sf-burst.hot::after { background: radial-gradient(circle, #ffe08a 0 18%, #fff1d6 48%); }
/* heat at the top edge: warm glow pulses down from where the ember sits on my scalp */
.sf-heat { position: absolute; left: 0; right: 0; top: 0; height: 32vh; pointer-events: none;
  background: radial-gradient(ellipse 55% 100% at 50% 0%, rgba(255,128,40,.42), rgba(255,128,40,0) 70%);
  transform-origin: 50% 0; animation: sfheat 1.3s ease-out forwards; }
@keyframes sfheat { 0% { opacity: 0; transform: scaleY(.4); } 15% { opacity: 1; transform: scaleY(1.05); } 35% { opacity: .7; } 50% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); } }
/* embers: little ink-ringed sparks spat from the top edge, arcing down and winking out */
.sf-embers { position: absolute; inset: 0; pointer-events: none; }
.sf-embers i { position: absolute; left: var(--x); top: -1vh; width: calc(11px * var(--s)); height: calc(11px * var(--s)); border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6c2 0 25%, #ffb23c 45%, #f2602b 100%); border: 2px solid var(--ink);
  box-shadow: 0 0 8px 2px rgba(255,140,40,.65); opacity: 0; animation: sfember 1.1s cubic-bezier(.25,.6,.5,1) var(--d) forwards; }
@keyframes sfember { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 12% { opacity: 1; transform: translate(calc(var(--dx) * .3), 3vh) scale(1.1); }
  70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }
/* a curl of smoke drifting up and out of the top of the view */
.sf-curl { position: absolute; left: var(--x); top: -2vh; width: 70px; height: 170px; margin-left: -35px; pointer-events: none; overflow: visible; }
.sf-curl path { fill: none; stroke: rgba(240,234,224,.9); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220;
  animation: sfcurl 2.3s ease-out forwards; }
.sf-curl path.k { stroke: rgba(var(--ink-rgb),.5); stroke-width: 13; }
@keyframes sfcurl { 0% { stroke-dashoffset: 220; opacity: 0; transform: translateY(14vh); } 15% { opacity: 1; } 55% { stroke-dashoffset: 0; opacity: .9; } 100% { stroke-dashoffset: -60; opacity: 0; transform: translateY(-4vh); } }
html.rm .sf-heat, html.rm .sf-embers, html.rm .sf-curl { display: none; }
@media (prefers-reduced-motion: reduce) { .sf-heat, .sf-embers, .sf-curl { display: none; } }

/* ------------------------------------------------ smoke rings (吐烟圈): the lit button, the picker's mode toggle, and the first-person smoked-out gag */
.fxb.smoke { background: #efeae2; }
.fxb.cigar.smoke { background: #f3eee6; }
/* the cigar picker: 吐烟圈 | 弹烟头 segmented toggle above the targets */
#pop .cmode { display: flex; gap: 6px; padding: 3px; border: 2.5px solid var(--ink); border-radius: 14px; background: rgba(var(--ink-rgb), .08); }
#pop .cmode .cm { flex: 1 1 0; width: auto; min-width: 0; flex-direction: row; justify-content: center; gap: 4px; padding: 5px 6px; border-width: 2px; border-color: transparent; background: transparent; font-size: 13px; color: var(--ink2); }
#pop .cmode .cm span { font-size: 13px; white-space: nowrap; }
#pop .cmode .cm .ic { width: 22px; height: 22px; flex: none; filter: grayscale(.55) opacity(.7); transition: filter .15s, transform .32s cubic-bezier(.3,1.9,.5,1); }
#pop .cmode .cm.on { border-color: var(--ink); color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
#pop .cmode .cm.on .ic { filter: none; transform: rotate(-8deg) scale(1.08); }
#pop .cmode .cm.smoke.on { background: #f3eee6; }
#pop .cmode .cm.butt.on { background: #ffe3cc; }
#pop .cmk { align-self: center; margin: -2px 0 0; font-size: 10px; font-weight: 800; color: var(--muted); }
@media (max-width: 440px) { #pop .cmode .cm { padding: 5px 4px; } #pop .cmode .cm span { font-size: 12px; } #pop .cmode .cm .ic { width: 20px; height: 20px; } }

/* haze: a few soft grey billows over the lens, clearing in ~1.5 s */
.sf-haze { position: absolute; inset: 0; pointer-events: none; background: rgba(206,200,190,.38); animation: sfhaze 1.6s ease-out forwards; }
.sf-haze i { position: absolute; left: var(--x); top: var(--y); width: calc(56vmax * var(--s)); height: calc(40vmax * var(--s));
  margin: calc(-20vmax * var(--s)) 0 0 calc(-28vmax * var(--s)); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(226,221,212,.9), rgba(214,208,198,.6) 50%, rgba(206,200,190,0) 100%);
  animation: sfhazepuff 1.6s cubic-bezier(.2,.7,.3,1) var(--d) both; }
@keyframes sfhaze { 0% { opacity: 0; } 10% { opacity: 1; } 45% { opacity: .9; } 100% { opacity: 0; } }
@keyframes sfhazepuff { 0% { transform: scale(.5); } 100% { transform: translateY(-8vh) scale(1.35); } }
/* the lasso ring from inside: a cream doughnut swelling past the edges of the view and sliding off one side */
.sf-ring { position: absolute; left: 50%; top: 56%; width: 46vmin; height: 30vmin; margin: -15vmin 0 0 -23vmin; pointer-events: none;
  animation: sfring 1.25s cubic-bezier(.3,.5,.4,1) forwards; }
.sf-ring i { position: absolute; inset: 0; border-radius: 50%; border: 6.5vmin solid rgba(243,238,229,.92);
  box-shadow: 0 0 0 3px rgba(var(--ink-rgb), .55), inset 0 0 0 3px rgba(var(--ink-rgb), .55), inset 0 1.2vmin 0 1.2vmin rgba(255,255,255,.35);
  animation: sfringwob .3s ease-in-out 4 alternate; }
@keyframes sfring { 0% { opacity: 0; transform: translateY(18vh) scale(.3) rotate(0); } 14% { opacity: 1; } 55% { opacity: .95; transform: translateY(-4vh) scale(1.7) rotate(var(--r)); }
  100% { opacity: 0; transform: translate(var(--dx), -26vh) scale(3.6) rotate(calc(var(--r) * 2)); } }
@keyframes sfringwob { from { transform: scale(1.06, .94); } to { transform: scale(.95, 1.05); } }
/* watery squint: lids pinch in from top and bottom with each bark, two tears roll down */
.sf-squint { position: absolute; inset: 0; pointer-events: none; }
.sf-squint i { position: absolute; top: 0; left: -5%; right: -5%; height: 16vh; background: var(--ink); border-radius: 0 0 50% 50% / 0 0 100% 100%; transform: translateY(-100%); animation: sflid 1.5s ease-in-out forwards; }
.sf-squint i:nth-child(2) { top: auto; bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; transform: translateY(100%); animation-name: sflidb; }
@keyframes sflid { 0%, 100% { transform: translateY(-100%); } 12%, 30% { transform: translateY(-38%); } 20% { transform: translateY(-55%); } 42%, 70% { transform: translateY(-50%); } }
@keyframes sflidb { 0%, 100% { transform: translateY(100%); } 12%, 30% { transform: translateY(42%); } 20% { transform: translateY(60%); } 42%, 70% { transform: translateY(55%); } }
.sf-squint b { position: absolute; top: 16vh; left: 28%; width: 16px; height: 22px; border-radius: 50% 50% 50% 50% / 62% 62% 40% 40%;
  background: radial-gradient(circle at 38% 60%, #fff 0 18%, #bfe8f7 30%, #6cc4e3 100%); border: 2.5px solid var(--ink); opacity: 0;
  animation: sftear 1.2s cubic-bezier(.5,0,.8,.6) .35s forwards; }
.sf-squint b:last-child { left: auto; right: 28%; animation-delay: .5s; }
@keyframes sftear { 0% { opacity: 0; transform: translateY(0) scale(.4); } 15% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(40vh) scale(.9); } }
/* coughing jerks: three barks, a gasp, two smaller hacks */
#selffx.sf-cough { animation: sfcough 1.3s linear; }
@keyframes sfcough { 0%, 100% { translate: 0 0; } 4% { translate: 0 9px; } 10% { translate: 0 -2px; } 18% { translate: 0 10px; } 24% { translate: 0 -2px; }
  32% { translate: 0 11px; } 40%, 70% { translate: 0 0; } 77% { translate: 0 6px; } 82% { translate: 0 -1px; } 88% { translate: 0 5px; } 94% { translate: 0 0; } }
.sf-burst.cough b { color: #8fa36a; }
.sf-burst.cough::after { background: radial-gradient(circle, #f6f2ea 0 18%, #e2dccf 48%); }
html.rm .sf-ring, html.rm .sf-squint { display: none; }
html.rm #selffx.sf-cough { animation: none; }
html.rm .sf-haze, html.rm .sf-haze i { animation: none !important; opacity: .6; }
@media (prefers-reduced-motion: reduce) {
  .sf-ring, .sf-squint { display: none; }
  #selffx.sf-cough { animation: none; }
  .sf-haze, .sf-haze i { animation: none !important; opacity: .6; }
}

/* ------------------------------------------------ table flip (掀桌): the offer button, and the first-person gags */
/* The offer: a hot-red sticker centred above the dock, boiling over (wobble at 3 Hz, a pulse at
   1.6 Hz, two steam puffs off its top corners), with a ring that drains until the next deal.
   Above the dock and the toasts, below #pop and #sheet. */
.flipbtn { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: calc(var(--dock-h, 200px) + 14px); z-index: 10;
  display: grid; grid-template-columns: 54px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  max-width: calc(100vw - 32px); padding: 8px 18px 9px 10px; border-radius: 20px 16px 22px 15px / 16px 22px 15px 20px;
  background: #d9412b; color: #fff6e0; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,.3), inset 0 -4px 0 rgba(0,0,0,.18);
  transform-origin: 50% 100%; animation: flipwob .1667s ease-in-out infinite alternate, flippulse .3125s ease-in-out infinite alternate; }
.flipbtn .ic { grid-area: 1 / 1 / 3 / 2; width: 46px; height: 46px; place-self: center; position: relative; z-index: 1; filter: drop-shadow(0 2px 0 rgba(var(--ink-rgb), .55)); }
.flipbtn .ring { grid-area: 1 / 1 / 3 / 2; place-self: center; width: 56px; height: 56px; border-radius: 50%;
  background: conic-gradient(#ffd23f calc(var(--p, 1) * 360deg), rgba(42,26,20,.35) 0); border: 2px solid var(--ink);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%); }
.flipbtn b { grid-area: 1 / 2; font: 900 26px/1.05 var(--display); letter-spacing: 1px; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.flipbtn small { grid-area: 2 / 2; font-size: 11.5px; font-weight: 800; line-height: 1.25; opacity: .95; max-width: 230px; }
.flipbtn::before, .flipbtn::after { content: ''; position: absolute; top: -10px; left: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fff 0 18%, #f4efe6 45%, #dcd3c5 100%); border: 2.5px solid var(--ink); opacity: 0; pointer-events: none;
  animation: flipsteam 1s ease-out infinite; }
.flipbtn::after { left: auto; right: 8px; width: 16px; height: 16px; animation-delay: .45s; }
.flipbtn kbd { display: none; }
@media (pointer: fine) { .flipbtn kbd { display: block; position: absolute; top: -11px; right: -9px; padding: 2px 6px; border-radius: 7px; border: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); font: 900 11px/1.2 var(--font); box-shadow: 0 2px 0 var(--ink); } }
.flipbtn:active { animation: none; scale: 1.08 .86; }
@keyframes flipwob { from { rotate: -4deg; } to { rotate: 4deg; } }
@keyframes flippulse { from { scale: 1; } to { scale: 1.06; } }
@keyframes flipsteam { 0% { opacity: 0; transform: translateY(6px) scale(.4); } 25% { opacity: .95; } 100% { opacity: 0; transform: translateY(-34px) scale(1.5); } }
/* pressed: squash, then the button itself is heaved up and away */
.flipbtn.go { animation: flipgo .25s cubic-bezier(.4,0,.7,.4) forwards; pointer-events: none; }
.flipbtn.go::before, .flipbtn.go::after { display: none; }
@keyframes flipgo { 0% { scale: 1.2 .72; rotate: 0deg; } 30% { scale: .9 1.25; translate: 0 -8px; rotate: -6deg; opacity: 1; } 100% { scale: .7 1.3; translate: 0 -46vh; rotate: -40deg; opacity: 0; } }
@media (max-width: 440px) { .flipbtn { grid-template-columns: 46px auto; padding: 6px 12px 7px 8px; left: 10px; right: auto; margin: 0; max-width: calc(100vw - 96px); } /* clear of the #fxbar column */ .flipbtn .ic { width: 38px; height: 38px; } .flipbtn .ring { width: 47px; height: 47px; }
  .flipbtn b { font-size: 22px; } .flipbtn small { font-size: 10.5px; max-width: 190px; } }
@media (max-height: 560px) and (orientation: landscape) { .flipbtn small { display: none; } }
@media (max-width: 480px) and (max-height: 700px) { .flipbtn small { display: none; } } /* short phones: keep the result ribbon above it clear */
/* toasts step up over the button while it is showing */
body.flip-on #toasts { bottom: calc(max(210px, var(--dock-h, 200px) + 104px) + var(--safe-b)); }
/* phones: over the dock's fuse row as well, so the wobble (the corners dip about 10px) never touches
   my cards, stack or hand line; the signs stand on its top edge (main.js paintFlip: --flip-h) */
@media (max-width: 480px), (max-height: 500px) {
  .flipbtn { bottom: calc(var(--dock-h, 200px) + 28px); }
  body.flip-on #toasts { bottom: calc(var(--dock-h, 200px) + 46px + var(--flip-h, 90px)); }
}
/* landscape phones: right of the board, left of the sticker button, so the signs (bottom left) stay
   where they are instead of climbing onto the board */
@media (max-height: 500px) {
  .flipbtn { left: auto; right: calc(76px + var(--safe-r)); margin: 0; }
  body.flip-on #toasts { bottom: calc(var(--dock-h, 200px) + 40px); }
}
/* reduced motion: no wobble or steam, a steady hot glow instead */
html.rm .flipbtn { animation: none; box-shadow: 0 5px 0 var(--ink), 0 0 0 4px rgba(255,93,79,.35), 0 0 22px 6px rgba(255,93,79,.55); }
html.rm .flipbtn::before, html.rm .flipbtn::after { display: none; }
html.rm .flipbtn.go { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .flipbtn { animation: none; box-shadow: 0 5px 0 var(--ink), 0 0 0 4px rgba(255,93,79,.35), 0 0 22px 6px rgba(255,93,79,.55); }
  .flipbtn::before, .flipbtn::after { display: none; }
  .flipbtn.go { animation: none; opacity: 0; }
}

/* the layer above the iris (z 60): words and dizzy stars while I am buried under the pile */
#flipfx { position: fixed; inset: 0; z-index: 62; pointer-events: none; overflow: hidden; }
.sf-burst.top { top: 46%; width: min(380px, 88vw); }
.sf-burst.top b { font-size: calc(min(380px, 88vw) * var(--k, .17)); color: var(--red); }
.sf-burst.top::after { background: radial-gradient(circle, #ffe08a 0 18%, #fff3d0 50%); }
.sf-burst.flip b { color: #ff5d4f; }
.sf-burst.flip::after { background: radial-gradient(circle, #ffb23c 0 20%, #fff1d0 52%); }
.sf-burst.yelp b { color: var(--sky); }
.sf-burst.plink b { color: #4cc9f0; }
.sf-burst.immune b { color: var(--gold2); }
.sf-word.top { top: 46%; color: var(--red); font-size: 56px; }
.sf-orbit.heap { --R: min(96px, 24vw); }
/* I boil over: a red-orange inked vignette pulsing at 1.4 Hz, steam rising off the bottom corners */
.sf-fliprage { position: absolute; inset: 0; pointer-events: none; animation: sffrfade var(--ms, 1150ms) linear forwards; }
.sf-fliprage::before { content: ''; position: absolute; inset: -4%;
  background: radial-gradient(ellipse 72% 64% at 50% 50%, rgba(255,90,40,0) 48%, rgba(232,72,36,.42) 80%, rgba(110,22,10,.66) 100%);
  box-shadow: inset 0 0 0 7px rgba(var(--ink-rgb), .5); animation: sffrpulse .357s ease-in-out infinite alternate; }
.sf-fliprage i { position: absolute; bottom: -8vmin; left: 3vw; width: 17vmin; height: 17vmin; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff 0 16%, #f4efe6 42%, #dcd3c5 100%); border: 3px solid var(--ink); opacity: 0;
  animation: sffrsteam .62s ease-out infinite; }
.sf-fliprage i:nth-child(2) { left: auto; right: 3vw; animation-delay: .2s; }
.sf-fliprage i:nth-child(3) { left: 13vw; width: 11vmin; height: 11vmin; animation-delay: .38s; }
.sf-fliprage i:nth-child(4) { left: auto; right: 13vw; width: 11vmin; height: 11vmin; animation-delay: .52s; }
@keyframes sffrpulse { from { opacity: .62; transform: scale(1.05); } to { opacity: 1; transform: scale(1); } }
@keyframes sffrfade { 0% { opacity: 0; } 12%, 86% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sffrsteam { 0% { opacity: 0; transform: translateY(0) scale(.4); } 20% { opacity: .95; } 100% { opacity: 0; transform: translateY(-36vh) scale(1.6); } }
.sf-fliprage.rm { animation: none; }
.sf-fliprage.rm::before { animation: none; opacity: .55; }
/* sent flying: ink speed streaks rush in from every edge, clay chips tumble across the view */
.sf-flipfly { position: absolute; inset: 0; pointer-events: none; }
.sf-flipfly > i { position: absolute; left: 50%; top: 50%; width: 46vmax; height: 7px; margin-top: -3.5px; transform-origin: 0 50%; border-radius: 4px;
  background: linear-gradient(90deg, rgba(var(--ink-rgb),0), rgba(var(--ink-rgb),.85) 40%, rgba(var(--ink-rgb),.85)); opacity: 0;
  animation: sfflyline .9s cubic-bezier(.2,.6,.3,1) var(--d) forwards; }
@keyframes sfflyline { 0% { opacity: 0; transform: rotate(var(--a)) translateX(62vmax) scaleX(.4); } 25% { opacity: .9; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(12vmax) scaleX(1); } }
.sf-flipfly > b { --w: calc(max(40px, 9vmin) * var(--s, 1)); position: absolute; left: 0; top: 0; width: var(--w); height: var(--w); margin: calc(var(--w) * -.5) 0 0 calc(var(--w) * -.5);
  animation: sfchipfly .95s cubic-bezier(.3,.1,.6,1) var(--d) both; }
.sf-flipfly > b i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--ink);
  background: radial-gradient(circle, var(--c) 0 40%, var(--ink) 41% 46%, transparent 47%), repeating-conic-gradient(from 10deg, var(--c) 0 22deg, #fff6e0 22deg 45deg);
  box-shadow: 0 3px 0 rgba(var(--ink-rgb), .5); animation: sfchipspin .28s linear infinite; }
@keyframes sfchipfly { 0% { transform: translate(var(--x0), var(--y0)); } 50% { transform: translate(var(--xm), var(--ym)); } 100% { transform: translate(var(--x1), var(--y1)); } }
@keyframes sfchipspin { 0% { transform: rotate(0) scaleY(1); } 50% { transform: rotate(200deg) scaleY(.22); } 100% { transform: rotate(400deg) scaleY(1); } }
/* reduced-motion stand-in for the heap / crash iris */
.sf-blackout { position: absolute; inset: 0; background: #14090a; opacity: 0; transition: opacity .15s; pointer-events: none; }
.sf-blackout.half { opacity: .5; }
.sf-blackout.full { opacity: 1; }
html.rm .sf-fliprage i, html.rm .sf-flipfly { display: none; }
@media (prefers-reduced-motion: reduce) { .sf-fliprage i, .sf-flipfly { display: none; } .sf-fliprage::before { animation: none; } }
