/* DOT MATGO — table.css (table agent): 맞고 board. Geometry is computed in js/ui/table.js (inline px); this file is the look. */

.tb { background: var(--night); color: var(--white); overflow: hidden; }
.tb * { box-sizing: border-box; }
.tb-shake { position: absolute; inset: 0; }
.tb-bg { position: absolute; left: 0; top: 0; image-rendering: pixelated; filter: brightness(.48) saturate(.85); }
.tb-vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(16,22,46,0) 55%, rgba(16,22,46,.55) 100%); }

/* ---------------------------------------------------------------- play surface (mat) */
.tb-mat { position: absolute; left: 6px; right: 6px; overflow: hidden;
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px #6b4a2a, 0 0 0 6px var(--ink), 0 6px 0 4px rgba(0,0,0,.35); }
.tb-mat canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.tb-mat::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), inset 0 10px 18px rgba(0,0,0,.25), inset 0 -10px 18px rgba(0,0,0,.25); }

/* empty month slots ("열두 달 시계") */
.tb-slot { position: absolute; width: 56px; height: 84px; border: 2px dashed rgba(255,244,220,.16); border-radius: 3px;
  display: flex; align-items: center; justify-content: center; font: 10px var(--font-small); color: rgba(255,244,220,.28);
  pointer-events: none; transition: opacity .2s steps(3); }
.tb-slot.used { opacity: 0; }
.tb-slot.glow { border-color: var(--yellowL); color: var(--yellowL); opacity: 1; box-shadow: 0 0 0 2px rgba(254,231,97,.35); }

/* ---------------------------------------------------------------- cards */
.tb-board { position: absolute; inset: 0; pointer-events: none; }
.tc { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; will-change: transform; pointer-events: none; }
.tc canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.tc.shadow canvas { box-shadow: 0 2px 0 rgba(0,0,0,.38); border-radius: 2px; }
.tc.hand { pointer-events: auto; cursor: pointer; }
.tc.hand.dim canvas { filter: brightness(.78) saturate(.8); }   /* the non-matching cards of my turn: lighter than .7 for the big lg hand */
/* my hand (table.js layoutHand): two rows of lg cards side by side (6+ cards; the bottom row overlaps the top row's lower part).
   One-row hands raise a playable card's picture 6 px; the selected card's picture always rises 13 px (and comes to the front).
   The card element (its tap area) stays put, so a tap low on a raised card never hits the card under it */
.tc.hand canvas { transition: transform 90ms steps(3); }
.tc.hand.lift canvas { transform: translateY(-6px); }
.tc.hand.sel canvas { transform: translateY(-13px); box-shadow: 0 0 0 2px var(--yellowL), 0 6px 0 rgba(0,0,0,.35); }
/* ▼ match marker over a hand card (table.js setMark): blue = can take it (the rest of the month still unseen), white = a sure
   capture (the rest of the month is already taken / in sight), green = bonus card. 9×8 art px at 2×, bobbing gently */
.tc .tc-mark { position: absolute; left: 50%; top: -10px; width: 18px; height: 16px; margin-left: -9px; z-index: 1; pointer-events: none;
  background: no-repeat 0 0 / 18px 16px; image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.45)); animation: tb-mark-bob .8s steps(2) infinite; transition: top 90ms steps(3); }
.tc .tc-mark.sure { animation-duration: 1.2s; }
.tc.hand.lift .tc-mark { top: -16px; }
.tc.hand.sel .tc-mark { visibility: hidden; }   /* the raised, framed card speaks for itself (and the ▼ would cover my name line) */
@keyframes tb-mark-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.tc.glow canvas { filter: drop-shadow(0 0 2px var(--yellowL)) drop-shadow(0 0 3px var(--yellow)); }
.tc.gold canvas { filter: drop-shadow(0 0 2px #fff6b0) drop-shadow(0 0 4px var(--gold)); }
.tc .tc-key { position: absolute; left: 50%; top: -13px; transform: translateX(-50%); font: 9px var(--font-num); color: var(--grayL);
  text-shadow: 0 1px 0 var(--ink); pointer-events: none; }
.tc.wobble { animation: tb-wobble .5s steps(6) 2; }
@keyframes tb-wobble { 0%,100% { rotate: 0deg; } 25% { rotate: -6deg; } 75% { rotate: 6deg; } }

/* pile */
.tb-pile { position: absolute; width: 62px; height: 92px; pointer-events: none; }
.tb-pile canvas { position: absolute; image-rendering: pixelated; }
.tb-pile-n { position: absolute; left: 50%; bottom: -15px; transform: translateX(-50%); white-space: nowrap;
  font: 10px var(--font-num); color: var(--cream); background: rgba(24,20,37,.78); padding: 0 4px; box-shadow: 0 0 0 1px var(--ink); }

/* 뻑 marker on a floor stack */
.tb-ppuk { position: absolute; padding: 0 3px; font: 700 10px var(--font); color: var(--white); background: var(--rust);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 0 1px rgba(0,0,0,.4); pointer-events: none; z-index: 30; animation: tb-bob 1.2s steps(2) infinite; }
.tb-ppuk.mine { background: var(--hwaBlue); }
@keyframes tb-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* ---------------------------------------------------------------- top HUD */
.tb-hud { position: absolute; left: 0; right: 0; top: 0; height: 52px; z-index: 5;
  background: linear-gradient(#1f2547, #161b36); box-shadow: 0 2px 0 var(--ink); }
.tb-hud::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 4px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--hwaRed) 0 6px, var(--green) 6px 12px, var(--hwaBlue) 12px 18px, var(--yellow) 18px 24px);
  box-shadow: 0 2px 0 var(--ink); }
.tb-pframe { position: absolute; width: 44px; height: 44px; overflow: hidden; background: var(--slate);
  box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 2px rgba(255,255,255,.12); }
.tb-pframe canvas { position: absolute; image-rendering: pixelated; }
.tb-pframe.turn { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--yellowL), 0 0 0 6px var(--ink); }
.tb-pframe.small { width: 22px; height: 22px; box-shadow: 0 0 0 2px var(--ink); }
.tb-pframe.small.turn { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--yellowL); }
.tb-name { position: absolute; font: 700 12px var(--font); color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); }
.tb-name .tb-seon { display: inline-block; margin-left: 4px; padding: 0 3px; font: 9px var(--font-small); color: var(--ink); background: var(--gold);
  box-shadow: 0 0 0 1px var(--ink); vertical-align: 1px; text-shadow: none; }
.tb-hp { position: absolute; height: 8px; }
.tb-hp-txt { position: absolute; font: 9px var(--font-num); color: var(--cream); white-space: nowrap; text-shadow: 0 1px 0 var(--ink); }
.tb-coins { position: absolute; display: flex; align-items: center; gap: 3px; font: 11px var(--font-num); color: var(--gold);
  text-shadow: 0 1px 0 var(--ink); white-space: nowrap; }
.tb-badges { position: absolute; display: flex; gap: 3px; flex-wrap: nowrap; pointer-events: none; }
.tb-badges.mine { justify-content: flex-end; }   /* my tags hang on the corner of my score box (right: 4px, set in table.js) */
.tb-badge { font: 9px var(--font-small); line-height: 11px; padding: 0 3px; color: var(--white); background: var(--slate);
  box-shadow: 0 0 0 1px var(--ink); white-space: nowrap; }
.tb-badge.go { background: var(--hwaRed); }
.tb-badge.shake { background: var(--plum); }
.tb-badge.bomb { background: var(--orange); color: var(--ink); }
.tb-badge.ppuk { background: var(--rust); }
.tb-badge.wins { background: var(--jade); color: var(--ink); }
.tb-fan { position: absolute; height: 26px; pointer-events: none; }
.tb-fan-n { position: absolute; font: 9px var(--font-num); color: var(--grayL); white-space: nowrap; text-shadow: 0 1px 0 var(--ink); }
.tb-menu-btn { position: absolute !important; right: 4px; top: 9px; width: 32px; height: 32px; padding: 0 !important; margin: 0 !important; z-index: 6; }
.tb-menu-btn canvas { margin: 0 auto; }
.tb-round { position: absolute; font: 9px var(--font-small); color: var(--grayL); white-space: nowrap; text-shadow: 0 1px 0 var(--ink); }

/* thinking dots / emotes over a portrait */
.tb-emote { position: absolute; z-index: 40; pointer-events: none; animation: px-float 1s steps(2) infinite; }

/* ---------------------------------------------------------------- captured strips */
.tb-strip { position: absolute; left: 0; right: 0; height: 44px; pointer-events: none; }
.tb-grp { position: absolute; height: 42px; background: rgba(10,8,18,.34); border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,244,220,.14), inset 0 2px 0 rgba(0,0,0,.25); }
.tb-grp-l { position: absolute; left: 3px; bottom: 1px; font: 9px var(--font-small); color: rgba(255,244,220,.55); }
.tb-grp-n { position: absolute; right: -3px; bottom: -4px; min-width: 15px; height: 13px; padding: 0 2px; text-align: center;
  font: 10px/13px var(--font-num); color: var(--ink); background: var(--cream); box-shadow: 0 0 0 1px var(--ink); z-index: 35; }
.tb-grp-n.zero { opacity: 0; }
.tb-grp-n.hot { background: var(--yellowL); }
.tb-strip-hit { position: absolute; pointer-events: auto; cursor: pointer; z-index: 36; }

.tb-score { position: absolute; width: 56px; height: 42px; text-align: center; pointer-events: auto; cursor: pointer; z-index: 36;
  background: linear-gradient(#2a1d3a, #1c142a); box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 1px rgba(255,213,65,.35); }
.tb-score-n { font: 22px/24px var(--font-title); color: var(--gold); text-shadow: 0 2px 0 var(--hwaRedD), 0 -1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); margin-top: 1px; }
.tb-score-u { font: 9px var(--font-small); color: var(--cream); line-height: 10px; }
.tb-score.hot .tb-score-n { color: var(--yellowL); }
.tb-score.win { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold), inset 0 0 0 1px rgba(255,213,65,.5); }

/* ---------------------------------------------------------------- my info bar + hand tray */
.tb-info { position: absolute; left: 0; right: 0; height: 24px; z-index: 6; pointer-events: none;
  background: linear-gradient(rgba(22,27,54,.92), rgba(16,22,46,.92)); box-shadow: 0 -2px 0 var(--ink), inset 0 1px 0 rgba(255,255,255,.08); }
.tb-info .tb-name { font-size: 11px; }
.tb-status { position: absolute; right: 6px; top: 4px; max-width: 170px; font: 10px var(--font-small); color: var(--yellowL); text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 var(--ink); }
.tb-status.wait { color: var(--grayL); }
.tb-tray { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  background: linear-gradient(#5a3a22, #3e2716); box-shadow: 0 -2px 0 var(--ink), inset 0 2px 0 rgba(255,220,170,.25); }
.tb-tray::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: rgba(0,0,0,.25); }
.tb-tray.turn { box-shadow: 0 -2px 0 var(--ink), 0 -4px 0 var(--yellowL), inset 0 2px 0 rgba(255,220,170,.25); }

/* ---------------------------------------------------------------- overlays inside the table */
.tb-fx { position: absolute; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.tb-fx.top { z-index: 86; }
.tb-ui { position: absolute; inset: 0; pointer-events: none; z-index: 70; }
.tb-ui > * { pointer-events: auto; }
.tfx-sprite { position: absolute; pointer-events: none; z-index: 65; }
.tfx-banner { position: absolute; pointer-events: none; z-index: 80; filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)); }
.tfx-banner-txt { font: 28px var(--font-title); color: var(--yellowL); text-shadow: 0 3px 0 var(--hwaRedD); }
.tfx-float { position: absolute; pointer-events: none; z-index: 85; white-space: nowrap; font: 16px var(--font-title); color: var(--yellowL);
  text-shadow: 0 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); transform: translate(-50%, 0); }
.tfx-float.dmg { font-size: 28px; color: #ff5060; text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); }
.tfx-float.heal { color: var(--green); }
.tfx-float.coin { color: var(--gold); font-size: 14px; }
.tfx-float.small { font-size: 12px; }
.tfx-flash { position: absolute; inset: 0; pointer-events: none; z-index: 90; opacity: 0; }

/* speech bubble */
.tb-bubble { position: absolute; z-index: 75; max-width: 210px; padding: 4px 7px 5px; font: 11px/1.35 var(--font); color: var(--ink);
  background: var(--white); box-shadow: 0 0 0 2px var(--ink), 0 3px 0 2px rgba(0,0,0,.35); pointer-events: none; animation: px-pop .18s steps(4); }
.tb-bubble::before { left: 12px; }   /* stepped pixel tail: shape in base.css (speech-bubble tail) */
.tb-bubble.out { opacity: 0; transition: opacity .2s steps(3); }

/* seal (봉인 부적) */
.tb-seal { position: absolute; z-index: 20; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.tb-seal .tb-seal-cap { position: absolute; left: 50%; top: auto; bottom: 100%; transform: translateX(-50%); margin: 0 0 2px; white-space: nowrap;
  font: 9px var(--font-small); color: rgba(255,244,220,.9); text-shadow: 0 1px 0 var(--ink); background: rgba(24,20,37,.6); padding: 0 3px; }
.tb-seal.open .tb-seal-cap { color: var(--green); }
.tb-seal.open canvas { filter: saturate(.6) brightness(1.15); }
.tb-seal .tb-seal-ok { position: absolute; right: -6px; top: -4px; font: 700 11px var(--font); color: var(--white); background: var(--greenD);
  width: 14px; height: 14px; line-height: 14px; text-align: center; box-shadow: 0 0 0 1px var(--ink); }

/* center info (round · 나가리 배수) */
.tb-center-info { position: absolute; z-index: 15; text-align: center; font: 10px var(--font-small); color: var(--cream);
  white-space: nowrap; pointer-events: none;
  text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); }   /* outlined like .tb-name: it lies directly on the mat (pink, straw, …) */
.tb-center-info b { color: var(--yellowL); font-weight: 400; }
/* 나가리 ×N: a small plate on the pile (the only centre label left, shown only after a 나가리) */
.tb-center-info .tb-center-badge { display: inline-block; padding: 1px 5px 2px; color: var(--yellowL); background: var(--hwaRedD);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 0 rgba(0,0,0,.4); text-shadow: none; }
/* 고/스톱 panel open (table.js showGoStop / closePops): the centre labels it would cut in half are hidden meanwhile */
.tb-board.gs .tb-seal-cap, .tb-board.gs .tb-pile-n, .tb-board.gs .tb-center-info { visibility: hidden; }

/* lg flip reveal glow */
.tc.reveal canvas { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 4px rgba(255,255,255,.8)) drop-shadow(0 4px 0 rgba(0,0,0,.4)); }

/* ---------------------------------------------------------------- popups (choose / shake / bomb / go-stop / 총통) */
.tb-pop { position: absolute; left: 50%; transform: translateX(-50%); z-index: 72; min-width: 240px; max-width: 340px; padding: 8px 10px 10px;
  background: var(--hanji); color: var(--ink); text-align: center; animation: px-pop .18s steps(4);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--hwaRed), 0 0 0 6px var(--ink), 0 8px 0 4px rgba(0,0,0,.35); }
.tb-pop-t { font: 15px var(--font-title); margin-bottom: 4px; }
.tb-pop-s { font: 11px var(--font); color: var(--brown); margin-bottom: 6px; white-space: pre-line; }
.tb-pop-cards { display: flex; justify-content: center; gap: 18px; margin: 4px 0 8px; }
.tb-pop-card { position: relative; cursor: pointer; padding: 3px; transition: transform .1s steps(2); }
.tb-pop-card:hover, .tb-pop-card:focus-visible { transform: translateY(-3px); }
.tb-pop-card .tb-pop-k { display: block; margin-top: 3px; font: 10px var(--font-small); color: var(--brown); }
.tb-pop-card .tb-pop-num { position: absolute; left: -4px; top: -4px; width: 14px; height: 14px; font: 10px/14px var(--font-num); color: var(--white);
  background: var(--ink); text-align: center; }
@media (hover: none) { .tb-pop-num { display: none; } }   /* the 1 / 2 key chips mean nothing on a touch screen */
.tb-pop-btns { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* 고/스톱: a compact panel centred over the pile (top set in table.js) — floor stacks, strips and the hand stay visible */
.tb-gostop { position: absolute; left: 96px; right: 96px; z-index: 74; padding: 6px 6px 8px; text-align: center; animation: px-pop .18s steps(4);
  background: rgba(24,20,37,.94); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold), 0 0 0 6px var(--ink); }
.tb-gostop-t { font: 12px var(--font-title); color: var(--yellowL); margin-bottom: 2px; }
.tb-gostop-p { font: 10px/1.4 var(--font); color: var(--cream); margin-bottom: 6px; white-space: pre-line; word-break: keep-all; }
.tb-gostop-p b { color: var(--gold); font-weight: 700; }
.tb-gostop-btns { display: flex; gap: 6px; justify-content: center; }
.tb-gostop-btns .px-btn { flex: 1; font-family: var(--font-title); font-size: 17px; padding: 8px 2px 9px; min-width: 0; }
.tb-gostop-btns .px-btn small { display: block; font: 9px/10px var(--font-small); margin-top: 2px; opacity: .85; white-space: normal; word-break: keep-all; }
.tb-gostop-btns .px-btn.go { background: var(--hwaRed); color: var(--white); }
.tb-gostop-btns .px-btn.stop { background: var(--hwaBlue); color: var(--white); }
.tb-gostop-btns .px-btn .col { gap: 0; }

/* ---------------------------------------------------------------- settlement panel */
.tb-settle { position: absolute; left: 14px; right: 14px; z-index: 76; padding: 6px 12px 10px; background: var(--hanji); color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--goldD), 0 0 0 6px var(--ink), 0 10px 0 4px rgba(0,0,0,.4); animation: px-pop .2s steps(4);
  display: flex; flex-direction: column; }
.tb-settle-head { display: flex; justify-content: center; min-height: 40px; margin-top: -26px; }
.tb-settle-who { text-align: center; font: 12px var(--font); color: var(--brown); margin: 2px 0 4px; }
.tb-settle-body { overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; }
.tb-sl { display: flex; justify-content: space-between; align-items: baseline; font: 12px/1.55 var(--font); padding: 0 2px;
  border-bottom: 1px dashed rgba(115,62,57,.25); }
.tb-sl .v { font-family: var(--font-num); }
.tb-sl.sum { border-bottom: 0; border-top: 2px solid var(--brown); margin-top: 2px; font-weight: 700; }
.tb-sl.mult { color: var(--hwaRedD); font-weight: 700; }
.tb-sl.mult .v { color: var(--hwaRed); }
.tb-sl.go .v { color: var(--hwaRed); }
.tb-sl.hide { visibility: hidden; }
/* the 1.6× slam grows upward from the row's bottom edge: nothing pokes out below the list, so no scrollbar flashes for the last row */
.tb-sl.in { animation: tb-slam .22s steps(4); transform-origin: 50% 100%; }
@keyframes tb-slam { 0% { transform: scale(1.6); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } 100% { transform: scale(1); } }
.tb-final { text-align: center; margin: 6px 0 2px; font: 13px var(--font); }
.tb-final b { display: block; font: 34px/1.1 var(--font-title); color: var(--hwaRed); text-shadow: 0 2px 0 var(--ink); }
.tb-final.lose b { color: var(--hwaBlueD); }
.tb-final .sub { font: 11px var(--font); color: var(--brown); }
/* stage H < 700: tighter rows so 8 score rows + the total fit; the rows scroll, the total (.tb-final, outside the list) never does */
.tb-settle.compact .tb-sl { line-height: 1.3; }
.tb-settle.compact .tb-final { margin: 3px 0 0; font-size: 12px; }
.tb-settle.compact .tb-final b { font-size: 28px; }
.tb-settle-seal { display: flex; align-items: center; justify-content: center; gap: 6px; font: 10px var(--font-small); color: var(--greenD); margin: 2px 0 6px; }
.tb-settle-seal.bad { color: var(--hwaRed); }
.tb-settle-btns { display: flex; gap: 8px; justify-content: center; }
.tb-settle-btns .px-btn { min-width: 110px; }
.tb-opphand { position: absolute; z-index: 45; display: flex; gap: 2px; padding: 3px 5px 4px; background: rgba(24,20,37,.85);
  box-shadow: 0 0 0 2px var(--ink); pointer-events: none; }
.tb-opphand-l { position: absolute; left: 4px; top: -13px; font: 9px var(--font-small); color: var(--cream); background: var(--ink); padding: 0 3px; white-space: nowrap; }
/* round end: the opponent's leftover hand shown in the HUD where the fan was (cards overlap, label below) */
.tb-opphand.hud { gap: 0; padding: 2px 4px 3px; }
.tb-opphand.hud .tb-opphand-l { top: auto; bottom: -11px; left: 0; }

/* ---------------------------------------------------------------- 선 정하기 / hot-seat cover / tips / menu */
.tb-ritual { position: absolute; left: 20px; right: 20px; z-index: 78; padding: 10px 12px 12px; text-align: center; background: var(--hanji);
  color: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--hwaRed), 0 0 0 6px var(--ink), 0 8px 0 4px rgba(0,0,0,.35);
  animation: px-pop .2s steps(4); }
.tb-ritual-t { font: 18px var(--font-title); }
.tb-ritual-s { font: 11px var(--font); color: var(--brown); margin: 2px 0 8px; white-space: pre-line; }
.tb-ritual-cards { display: flex; justify-content: center; gap: 26px; margin: 6px 0; }
.tb-ritual-card { cursor: pointer; animation: px-float 1.4s steps(3) infinite; position: relative; }
.tb-ritual-card:nth-child(2) { animation-delay: .3s; }
.tb-ritual-card.picked { animation: none; }
.tb-ritual-card .who { display: block; font: 11px var(--font); margin-top: 3px; min-height: 16px; }
.tb-ritual-msg { font: 12px var(--font); min-height: 36px; white-space: pre-line; color: var(--hwaRedD); }

.tb-cover { position: absolute; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(ellipse at 50% 40%, #2a2f5a, #10162e 70%); color: var(--white); text-align: center; animation: px-fade-in .2s steps(4); }
.tb-cover-t { font: 22px var(--font-title); color: var(--yellowL); text-shadow: 0 2px 0 var(--hwaRedD); }
.tb-cover-s { font: 12px var(--font); color: var(--grayL); white-space: pre-line; }

.tb-tip { position: absolute; left: 12px; right: 44px; z-index: 82; display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px 8px;
  background: var(--cream); color: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--dokFireD), 0 0 0 6px var(--ink), 0 6px 0 4px rgba(0,0,0,.35);
  animation: px-pop .2s steps(4); cursor: pointer; }
.tb-tip-h { font: 700 11px var(--font); color: var(--hwaBlue); }
.tb-tip-t { font: 11px/1.45 var(--font); }
.tb-tip-ok { font: 10px var(--font-small); color: var(--grayD); text-align: right; margin-top: 2px; }

.tb-menu { display: flex; flex-direction: column; gap: 6px; }
.tb-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 12px var(--font); min-height: 34px; }
.tb-menu-row.tog { cursor: pointer; }   /* the whole row toggles (table.js toggleRow) */
.tb-menu-row .px-btn { min-width: 86px; }
.tb-menu .px-btn { min-height: 32px; }
.tb-menu .px-btn.wide { margin: 0 2px; }   /* width is 100% - 4px: 2px each side keeps it centred on the other buttons' edge line */
.tb-menu-note { font: 10px var(--font-small); color: var(--grayD); text-align: center; }
.tb-hash { font: 10px/1.4 var(--font-num); word-break: break-all; background: var(--white); padding: 4px 6px; box-shadow: 0 0 0 1px var(--ink); margin: 6px 0;
  -webkit-user-select: text; user-select: text; }

/* score breakdown modal */
.tb-bd-cards { display: flex; flex-wrap: wrap; gap: 2px; margin: 2px 0 6px; }
.tb-bd-h { font: 700 11px var(--font); margin-top: 4px; }

/* talisman panels */
.tb-tal-btn { position: absolute; z-index: 25; padding: 1px 4px 2px; font: 9px var(--font-small); color: var(--ink); background: var(--lilac);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 0 1px rgba(0,0,0,.35); cursor: pointer; pointer-events: auto; }
.tb-tal-btn::after { content: ''; position: absolute; inset: -9px -4px; }   /* touch target ≥ 32px, same look */
.tb-tal-btn.calc { background: var(--jade); }
.tb-memory { position: absolute; z-index: 77; padding: 6px; background: rgba(24,20,37,.94); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--lilac);
  display: grid; grid-template-columns: repeat(2, auto); gap: 3px 10px; pointer-events: auto; }
.tb-memory-row { display: flex; align-items: center; gap: 2px; font: 9px var(--font-num); color: var(--grayL); }
.tb-memory-row span { width: 16px; text-align: right; margin-right: 2px; }
.tb-memory-row canvas.unseen { opacity: .28; }
.tb-memory-t { grid-column: 1 / -1; font: 10px var(--font-small); color: var(--lilac); text-align: center; }
.tb-calc { position: absolute; z-index: 24; max-width: 260px; padding: 1px 6px 2px; font: 10px var(--font-small); color: var(--ink); background: rgba(63,181,158,.92);
  box-shadow: 0 0 0 1px var(--ink); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-calc.warn { background: rgba(228,59,68,.94); color: var(--white); }

/* noanim: final states */
html.dg-noanim .tb *, html.dg-noanim .tb *::before, html.dg-noanim .tb *::after { animation: none !important; transition: none !important; }

/* online: turn timer + emotes */
/* online turn timer: bar + seconds pill (opponent: under the HUD fan · me: top edge of the hand tray) */
.tb-timer { position: absolute; z-index: 40; pointer-events: none; display: flex; align-items: center; gap: 4px; }
.tb-timer-bar { position: relative; flex: 1; height: 4px; background: rgba(0,0,0,.55); box-shadow: 0 0 0 1px var(--ink); overflow: hidden; }
.tb-timer-fill { height: 100%; width: 100%; background: var(--grayL); }
.tb-timer.mine .tb-timer-bar { height: 3px; box-shadow: none; }
.tb-timer.mine .tb-timer-fill { background: var(--yellowL); }
.tb-timer-s { font: 9px var(--font-num); color: var(--grayL); text-shadow: 0 1px 0 var(--ink); white-space: nowrap; min-width: 22px; }
.tb-timer.mine .tb-timer-s { position: absolute; width: 32px; min-width: 0; padding: 1px 0; text-align: center; background: rgba(20,16,30,.85);
  color: var(--yellowL); box-shadow: 0 0 0 1px var(--ink); }
.tb-status.timed { right: 42px; max-width: 140px; }
.tb-timer.hurry .tb-timer-fill { background: var(--hwaRed); }
.tb-timer.hurry .tb-timer-s { color: #ff8a8a; animation: tb-hurry .5s steps(1) infinite; }
@keyframes tb-hurry { 0%, 49% { color: #ff8a8a; } 50%, 100% { color: var(--white); } }
.tb-emote-btn { position: absolute !important; z-index: 30; width: 32px; height: 32px; padding: 0 !important; margin: 0 !important; }
.tb-emotes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; min-width: 300px; }
.tb-emote-pick { font: 9px var(--font-small); color: var(--ink); background: var(--white); border: 0; padding: 4px 2px 3px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--ink), inset 0 -2px 0 rgba(0,0,0,.15); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tb-emote-pick:active { transform: translateY(1px); }
