/* The rendered cabinet sits inside the same family UI and responds to its width. */
@import url('./styles-cabinet-v7.css?v=9');
/* Revision 09 inherits the transparent layers and exact #040406 stage from
   revision 07. The enlarged wood reaches the edges, so keep the whole plate
   visible with the shared cabinet sheet's mask:none. */
/* The bars are see-through, so the rendered stage runs the whole height. */
html[data-board-renderer="3d"] :is(.gheader,.brandhead,.gfooter){background:transparent}
/* One surface, top to bottom: the header and footer bars carried their own
   navy, which cut the render's dark into a band and made the board read as a
   small inset. They keep their hairline separators, not their fills. */
html[data-board-renderer="3d"] :is(.gheader,.brandhead){border-bottom:1px solid #ffffff14}
html[data-board-renderer="3d"] .gfooter{border-top:1px solid #ffffff10}
html[data-board-renderer="3d"] .app::before,
html[data-board-renderer="3d"] .app::after,
html[data-board-renderer="3d"] .app>.sv-sweep,
/* The ambient layer is the one that kept the page green: .amb-tex is the
   bokeh photo and .amb-field a/b/c are three big radial washes (green, teal,
   violet) that sit over the whole app. The board hid them in the middle of the
   screen, so only the strips above and below it looked tinted. */
html[data-board-renderer="3d"] :is(.ambient,.amb-tex,.amb-field){display:none}

/* ═══ ONE NEUTRAL SHELL, IN BOTH TELEGRAM THEMES (owner, 2026-09-18) ═══════
   "Since the background has changed to black, change the other elements of
   the UI to more neutral colours to match, and ensure all text is visible."

   The family sheet is a navy/cyan/emerald pachinko cabinet, and every card,
   chip, strip and bar on this page was still painted in it — navy panels on
   a graphite page, cyan room code, blue links, a seat-coloured wash across
   the turn bar. Worse, the page is the render's dark in BOTH themes (there is
   no light cabinet), but the tokens still followed Telegram's theme: in light
   mode the title, labels and the "Match over" bar were drawn in near-black
   ink on this dark page, and the cards went white. That is the "text not
   visible" report.

   So the tokens are re-declared here for BOTH themes at once — a warm-grey
   graphite set tuned to the wood and brass of the cabinet, one card fill,
   light ink, grey hints, steel-grey links, brass kept for prizes and the
   primary action. `html[...]` outranks `:root`, and `.app[data-theme=…]`
   outranks the sheet's bare `[data-theme=…]`, so nothing in styles.css has to
   move. The theme attribute itself is still Telegram's (app.js follows
   tg.colorScheme; the 2026-09-13 no-theme-switch rule is untouched) — it just
   no longer changes any colour on this entry. Every hint sits at ≥6.8:1 on
   the darkest card and ≥4.7:1 on the lightest part of the vignette.

   Seat colours are NOT flattened: they are how a player tells whose ball and
   whose card is whose. They stay as accents — a card's top edge, its dot, its
   name and the DROP NOW chip — instead of filling the card. */
html[data-board-renderer="3d"],
html[data-board-renderer="3d"] .app[data-theme="dark"],
html[data-board-renderer="3d"] .app[data-theme="light"]{
  --bg:#101315; --header:#141719; --panel:#1b1e21; --tile:#272a2e; --edge:#3b3f44;
  --tshadow:#08090b; --text:#ecebe6; --hint:#a3a5a8; --line:rgba(255,255,255,.1);
  --chip:#212428; --blue:#9cb8cc; --blue-ink:#9cb8cc;
  --navy:#16191c; --navy-edge:#33373c;
  /* the signature accents, desaturated: the room code, the LIVE PRIZE note
     and the safe-table ink read as parchment against the wood, not neon */
  --arcade-cyan:#cfc8ba; --arcade-violet:#aaa6b8; --arcade-pink:#c9a3ad;
  /* light mode re-inks gold and red for white panels; there are none here */
  --gold-text:#E9A83F; --gold-line:#E9A83F; --gold-text-lg:#E9A83F; --red-text:#FF5A4E;
}
/* The scroll halo under a header was a blue wash. */
html[data-board-renderer="3d"] .brandhead::after,
html[data-board-renderer="3d"] .gheader::after{background:linear-gradient(180deg,#ffffff14,#ffffff06 40%,transparent)}
/* Titles: the family paints the match title in the viewer's seat colour and
   the home title in --text; both are plain ink here. */
html[data-board-renderer="3d"] .brandhead .btitle,
html[data-board-renderer="3d"] .gheader .htitle b,
html[data-board-renderer="3d"] .app.seat-themed .gheader .htitle b{color:var(--text)}
html[data-board-renderer="3d"] .gheader .htitle span{color:var(--hint)}
/* .flabel/.hint-line carry an opaque --bg backing against the family's moving
   wash. The wash is hidden here, and a backing in one flat dark on a vignette
   page draws a rectangle behind every bare label. */
html[data-board-renderer="3d"] .flabel,
html[data-board-renderer="3d"] .hint-line{background:transparent}
/* The room-creation screen gets a little warmth from the cabinet's walnut
   without changing the exact black stage behind the live board. */
html[data-board-renderer="3d"] #scr-home{
  background:radial-gradient(ellipse 105% 48% at 50% 0%,rgba(92,57,31,.25),transparent 78%),
    linear-gradient(180deg,#1a1410 0%,#15110e 55%,#100e0c 100%)}
/* The hero card was the one navy gradient left on the home screen. */
html[data-board-renderer="3d"] .introcard{background:linear-gradient(180deg,#22262a,#16191c);border-color:#3b3f44;
  box-shadow:0 5px 0 #08090b,inset 0 1px 0 #ffffff0b;color:var(--text)}
html[data-board-renderer="3d"] .introcard .mtitle{color:var(--text)}
html[data-board-renderer="3d"] .introcard .msub,
html[data-board-renderer="3d"] .introhelp-body{color:var(--hint)}
html[data-board-renderer="3d"] .introhelp summary{color:var(--blue)}
/* Room code: parchment, not cyan. */
html[data-board-renderer="3d"] .roomcode .code{color:#e6d3ad}
/* Lobby player rows: flat chip, seat colour on the avatar and (for you) a ring. */
html[data-board-renderer="3d"] .prow{background:var(--chip);border-color:var(--edge)}
html[data-board-renderer="3d"] .prow.me{box-shadow:inset 0 0 0 1px var(--seat-color)}
/* Two light-theme re-inks written for white panels. */
html[data-board-renderer="3d"] .app[data-theme="light"] .przsum-more{color:var(--blue)}
html[data-board-renderer="3d"] .app[data-theme="light"] .przbox .przrow:not(.on) b{color:var(--gold-text)}
html[data-board-renderer="3d"] .toast{background:rgba(12,13,15,.92);border-color:#ffffff1f}
html[data-board-renderer="3d"] .sheetback{background:rgba(6,7,9,.78)}

/* ---- the match footer -------------------------------------------------
   The turn bar wore a seat-coloured gradient and drew its text in --hint —
   in light mode that was near-black on gold ("Round 3 of 3" and "Match over"
   were unreadable). Flat chip, light ink; the table name keeps its risk
   colour (inline, from app.js riskColor). The DROP button was the seat
   colour too (blue for seat 1, pink for seat 3); the family's action colour
   is gold and the cabinet is brass, so it is the gold slab for every seat. */
html[data-board-renderer="3d"] .app.seat-themed .turnbar{background:var(--chip);border-color:var(--line)}
html[data-board-renderer="3d"] .turnbar .tb-wait{color:var(--text)}
html[data-board-renderer="3d"] .turnbar .tb-right{color:var(--hint)}
html[data-board-renderer="3d"] .app.seat-themed #drop-btn:not(.dim){background:linear-gradient(180deg,#EDB85B,#D2913A);
  border-color:#96651B;box-shadow:0 5px 0 #6C4512,inset 0 1px 0 rgba(255,255,255,.26);color:var(--gold-ink)}

/* PRESS FEEL (owner, 2026-09-25: "add some subtle animation when pressing").
   Two parts, both deliberately small.
   · SINK — the slab drops onto its bevel. The 3D rule above sets its own
     box-shadow at higher specificity than the family .gold-slab:active, so
     that rule's bevel change never applied here: the slab moved 3px but its
     5px bevel stayed put. This restates both. It keys on .is-pressing (set
     by app.js on pointerdown and held for 90ms) as well as :active, because
     a phone often releases a fast tap before :active paints.
   · FLASH — a soft light that blooms from the centre and fades, restarted on
     every accepted press so a double-tap reads as two. It stays INSIDE the
     button (.gold-slab clips its overflow): nothing may glow onto the board,
     which is where the player is looking. */
html[data-board-renderer="3d"] #drop-btn{transition:transform .07s ease-out,box-shadow .07s ease-out,filter .07s ease-out}
html[data-board-renderer="3d"] #drop-btn.is-pressing:not(.dim){transform:translateY(3px) scale(.99)}
html[data-board-renderer="3d"] .app.seat-themed #drop-btn:not(.dim):active,
html[data-board-renderer="3d"] .app.seat-themed #drop-btn.is-pressing:not(.dim){transform:translateY(3px) scale(.99);
  box-shadow:0 2px 0 #6C4512,inset 0 1px 0 rgba(255,255,255,.2);filter:brightness(1.05)}
html[data-board-renderer="3d"] #drop-btn.dim.is-pressing{transform:translateY(2px)}
html[data-board-renderer="3d"] #drop-btn.drop-fired::after{content:'';position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(closest-side,rgba(255,247,222,.42),rgba(255,247,222,0));
  animation:pk-drop-flash .36s ease-out forwards}
@keyframes pk-drop-flash{0%{opacity:1;transform:scale(.35)}100%{opacity:0;transform:scale(1.4)}}
@media(prefers-reduced-motion:reduce){
  html[data-board-renderer="3d"] #drop-btn{transition:none}
  html[data-board-renderer="3d"] #drop-btn.drop-fired::after{animation:none;opacity:0}
}

/* ---- score cards --------------------------------------------------------
   The viewer's card was FILLED with the seat colour (a solid yellow / blue /
   green / pink block above the board) and every other card carried a wash of
   its seat colour. Now every card is the same graphite panel; the seat colour
   is the 3px top edge, the dot, the name, the YOU tag and the DROP NOW chip —
   your card is the one with the coloured border all the way round. */
html[data-board-renderer="3d"] .scard{background:var(--panel);border:1px solid var(--edge);
  border-top:3px solid var(--seat-color);box-shadow:none}
html[data-board-renderer="3d"] .scard.on{box-shadow:none}
html[data-board-renderer="3d"] .scard.you{background:var(--panel);border-color:var(--seat-color);box-shadow:0 3px 0 var(--seat-edge)}
html[data-board-renderer="3d"] .scard .sname{color:var(--hint)}
html[data-board-renderer="3d"] .scard.on .sname,
html[data-board-renderer="3d"] .scard.you .sname{color:var(--seat-color)}
html[data-board-renderer="3d"] .scard .sname em{background:var(--seat-color);color:var(--seat-ink)}
html[data-board-renderer="3d"] .scard .sclaim{color:var(--text)}
html[data-board-renderer="3d"] .scard.claiming .sclaim,
html[data-board-renderer="3d"] .scard.you.claiming .sclaim{color:var(--text);text-shadow:none}
/* Projected claim status appears only after a ball lands. The amount and TON
   unit share the same color on every seat card, including the viewer's. */
html[data-board-renderer="3d"] .scard.claim-ahead .sclaim,
html[data-board-renderer="3d"] .scard.you.claim-ahead .sclaim{color:#78dfa2;text-shadow:none}
html[data-board-renderer="3d"] .scard.claim-behind .sclaim,
html[data-board-renderer="3d"] .scard.you.claim-behind .sclaim{color:#ff7770;text-shadow:none}
html[data-board-renderer="3d"] .scard .spoints,
html[data-board-renderer="3d"] .scard.you .spoints{color:var(--hint)}
html[data-board-renderer="3d"] .scard.you .spoints b.neg{color:var(--red-text)}
html[data-board-renderer="3d"] .scard.you .seatdot{background:var(--seat-color);border-color:var(--seat-edge);box-shadow:inset 0 1px 1px #ffffffa6}
/* Score card: the ball pips sit BESIDE the claim + points as a small block —
   one row per round, one pip per ball of that round (2×3 for the cabinet's
   3 rounds × 2 balls) — instead of a row of their own under the points. That
   row was pure height; the board is flex:1, so every pixel given back here
   goes straight to the table. The name keeps the full card width because at a
   full 4-seat table (81px cards) it already truncates. Two flexible outer
   tracks centre the claim+pips pair, so on a wide 2-seat card the pips stay
   beside the claim instead of drifting to the far edge; min-width:0 on the
   full-width rows stops a long name from widening the pair's tracks. */
html[data-board-renderer="3d"] .scard{display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,max-content) max-content minmax(0,1fr);
  grid-template-areas:"name name name name" ". claim balls ." ". points balls ." "drop drop drop drop";
  column-gap:3px;row-gap:1px;justify-items:center;align-items:center}
html[data-board-renderer="3d"] .scard .sname{grid-area:name;min-width:0}
html[data-board-renderer="3d"] .scard{padding-left:2px;padding-right:2px}
html[data-board-renderer="3d"] .scard .sclaim{grid-area:claim;min-width:0;gap:1px}
html[data-board-renderer="3d"] .scard .sclaim small{letter-spacing:0}
html[data-board-renderer="3d"] .scard .spoints{grid-area:points}
html[data-board-renderer="3d"] .scard .sballs{grid-area:balls;display:grid;height:auto;
  grid-template-columns:repeat(var(--per-round,2),5px);grid-auto-rows:5px;gap:2px}
html[data-board-renderer="3d"] .scard .sballs i{width:5px;height:5px}
html[data-board-renderer="3d"] .scard .seatdrop{grid-area:drop;min-width:0}
html[data-board-renderer="3d"] .scard .sballs i,
html[data-board-renderer="3d"] .scard.you .sballs i{background:var(--edge)}
html[data-board-renderer="3d"] .scard .sballs i.left,
html[data-board-renderer="3d"] .scard.you .sballs i.left{background:var(--seat-color)}
html[data-board-renderer="3d"] .scard.you .seatdrop{background:var(--seat-color);color:var(--seat-ink);box-shadow:0 2px 0 var(--seat-edge)}

/* ---- the settlement board (post-game) ----------------------------------
   Every colour on .end-summary is hard-coded navy/steel in styles.css (it is
   "always dark" and never read the theme), so it is re-inked line by line.
   Gold title, green/red net figures and the seat-coloured row edges stay —
   they carry meaning. */
html[data-board-renderer="3d"] .end-summary{border-color:#3b3f44;
  background:linear-gradient(180deg,#ffffff0a,transparent 26%),#16191c;
  box-shadow:0 5px 0 #08090b,inset 0 0 34px #ffffff05}
html[data-board-renderer="3d"] .end-summary::before{background:linear-gradient(90deg,transparent,#c9b58a,transparent)}
html[data-board-renderer="3d"] .end-kicker,
html[data-board-renderer="3d"] .end-ledger-title b{color:#b5b1a8}
html[data-board-renderer="3d"] .end-detail,
html[data-board-renderer="3d"] .end-ledger-title span,
html[data-board-renderer="3d"] .end-totals small,
html[data-board-renderer="3d"] .end-cell small,
html[data-board-renderer="3d"] .end-person small,
html[data-board-renderer="3d"] .end-note,
html[data-board-renderer="3d"] .end-balance,
html[data-board-renderer="3d"] .end-empty,
html[data-board-renderer="3d"] .end-summary .flat{color:var(--hint)}
html[data-board-renderer="3d"] .end-totals b,
html[data-board-renderer="3d"] .end-person b,
html[data-board-renderer="3d"] .end-cell b{color:var(--text)}
html[data-board-renderer="3d"] .end-totals>span,
html[data-board-renderer="3d"] .end-player{border-color:#33373c;background:#1e2124}
html[data-board-renderer="3d"] .end-player.winner{background:linear-gradient(90deg,color-mix(in srgb,var(--row-color) 14%,#1e2124),#1e2124 48%)}
html[data-board-renderer="3d"] .end-receipt{border-color:#3b3f44;background:#212428;color:#d8d4cb}

html[data-board-renderer="3d"] .boardwrap{background:#0f1214;border-color:#594638;box-shadow:0 4px 12px #0005}
html[data-board-renderer="3d"] .boardwrap>.glow{display:none}
/* The warm halo belongs to the ball, not its stationary 56px host. Its round
   shadows follow the ball's transform through the whole bounce. The host is
   transparent, so no fixed glow lingers when the ball rises. */
html[data-board-renderer="3d"] .hero-orb{background:none}
html[data-board-renderer="3d"] .hero-orb .orb{
  box-shadow:0 0 0 1px #9c6a1cb3,0 0 12px 5px #b28d5440,0 0 25px 9px #b28d541a;
  animation-duration:1.5s}
html[data-board-renderer="3d"] .hero-orb::after{animation-duration:1.5s}
/* AS LARGE AS THE SPACE ALLOWS. The wrap is a flex child of the game column,
   so `flex:1` hands it whatever the prize cards and the footer do not use —
   no magic height, and it re-fits every phone. (The provably-fair strip that
   used to sit under it is a header square now, so that row is the board's
   too.) The canvas is then blown up past the wrap and CLIPPED: the cabinet
   is 89.7707824% of the plate width and 97.0000043% of its height. Revision
   09 framing.json gives 100/.897707824 = 111.3948184% width and
   100/.970000043 = 103.0927790% max-height, placing the wood at the edges, and the surround that gets
   cropped is the same colour as the page behind it. The pocket overlay is
   positioned in PERCENTAGES of this same box (board-cabinet.js), so it scales
   with it and its landing anchors stay aligned with the rendered pockets. */
html[data-board-renderer="3d"] .boardwrap.machine-3d{flex:1 1 auto;min-height:0;position:relative;overflow:hidden;
 margin-inline:calc(-1 * var(--pk-col-pad,16px));padding:0;border:0;box-shadow:none;border-radius:0;background:transparent}
html[data-board-renderer="3d"] .machine-3d canvas,
html[data-board-renderer="3d"] .machine-3d .slotrow{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
 width:111.3948184%;max-width:none;height:auto;aspect-ratio:686/920;max-height:103.0927790%}
html[data-board-renderer="3d"] .machine-3d .slotrow{margin:0;display:block;pointer-events:none}
html[data-board-renderer="3d"] .machine-3d .slotrow .slot{position:absolute;display:flex;align-items:center;justify-content:center;
 left:var(--pocket-left);top:var(--pocket-top);width:var(--pocket-width);height:var(--pocket-height);padding:0;
 background:transparent;border:0;border-radius:1px;box-shadow:none;animation:none;overflow:visible;color:transparent;
 font:700 clamp(5.5px,1.55vw,8px)/1 "Space Grotesk",Manrope,sans-serif;text-shadow:none}
html[data-board-renderer="3d"] .machine-3d .slotrow .slot:first-child,
html[data-board-renderer="3d"] .machine-3d .slotrow .slot:last-child{color:transparent;text-shadow:none}
html[data-board-renderer="3d"] .machine-3d .slotrow .slot::before,
html[data-board-renderer="3d"] .machine-3d .slotrow .slot::after{display:none!important}
html[data-board-renderer="3d"] .machine-3d .slotrow .slot.landed{background:transparent;color:transparent;box-shadow:none;text-shadow:none}
html[data-board-renderer="3d"] .machine-3d .slotrow .slot.impact{animation:pk-cabinet-number .65s ease-out}
@keyframes pk-cabinet-number{0%,100%{transform:scale(1)}35%{transform:scale(1.075)}}
@media(prefers-reduced-motion:reduce){html[data-board-renderer="3d"] .machine-3d .slotrow .slot.impact{animation:none}}

/* The source turn bar remains in the DOM for accessible text. On the cabinet,
   its two live strings are mirrored onto the wood rails flanking the pins. */
html[data-board-renderer="3d"] #claim-note{display:none}
html[data-board-renderer="3d"] #turnbar{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
 clip:rect(0 0 0 0);white-space:nowrap;border:0}
/* Owner, 2026-09-21: read them where the eye already is — ON the playfield,
   not turned sideways on the wood. The pin triangle has its apex at the top
   centre and widens downward, so the two upper corners of the green are the
   only permanently empty space inside the board; these two blocks sit in them,
   horizontal and wrapping, and stop above the row where the triangle reaches
   them. Percentages are of .boardwrap: the green starts at ~12.2% from the
   left and ends at ~90.5%, its top edge is at ~7.1%. */
html[data-board-renderer="3d"] .rail{position:absolute;z-index:1;width:23%;display:block;
 text-align:center;pointer-events:none;
 font:700 clamp(7px,2.05vw,10.5px)/1.4 "Space Grotesk",Manrope,sans-serif;
 letter-spacing:.11em;text-transform:uppercase;
 color:#e5d4b0;text-shadow:0 1px 2px #000A,0 0 6px #0006}
html[data-board-renderer="3d"] .rail-l{left:11.5%;top:12%}
html[data-board-renderer="3d"] .rail-r{right:10.5%;top:12%}

/* The live strings sit on the inset enamel faces exported from Blender.
   Projection is tied to the canvas, including a height-constrained board. */
html[data-board-renderer="3d"] .cabinet-readouts{position:absolute;left:0;top:0;z-index:1;pointer-events:none}
html[data-board-renderer="3d"] .cabinet-readout-plane{position:absolute;left:0;top:0;transform-origin:0 0;
  display:flex;align-items:center;justify-content:center}
html[data-board-renderer="3d"] .cabinet-readout-plane .rail{position:static;inset:auto;width:100%;max-height:100%;
  margin:0;padding:0;box-sizing:border-box;overflow-wrap:anywhere;
  font-family:"Avenir Next",Manrope,sans-serif;font-size:23px;font-weight:700;line-height:1.28;
  letter-spacing:.06em;color:#e1d4b7;text-shadow:0 1px 1px #0008}
html[data-board-renderer="3d"] .cabinet-readout-plane .rail b{white-space:nowrap}

/* NOTHING MAY LIGHT THE PAGE (owner, 2026-09-18: "everything needs to have the
   same background"). The seat theme glows outward — a 26px wash around the app
   column, 14px around each prize card, 16px under the drop button — and the
   column clips its own, so the page showed a lighter panel with a hard cutoff
   at the column edge, above the board and under the buttons. The bevels (the
   solid 4-5px offsets) and every colour stay; only the outward glow goes.
   (The card and drop-button bevels themselves are set in the neutral-shell
   block above.) */
html[data-board-renderer="3d"] .app.seat-themed{box-shadow:none}
/* The "your turn" pulse is a real cue, so it stays — turned INWARD. The family
   pulse (pk-drop-ready) grows an 18px glow OUTSIDE the card, which is the
   brightest thing painting the page around it; this lights the card's own edge
   instead, so the cue reads and the background stays one colour. */
@keyframes pk-drop-ready-inset{0%,100%{box-shadow:inset 0 0 10px var(--seat-wash)}50%{box-shadow:inset 0 0 20px var(--seat-color)}}
html[data-board-renderer="3d"] .scard.drop-ready{animation-name:pk-drop-ready-inset}
