/* The pieces the phone's table and the laptop's table share (tablepieces.js; the approved layout sketch of 30 Nov 2026,
   docs/decisions/table-layout-sketch-2026-11-30.html). Only what is the same on both: the rod, the tray's ring and its look, the mark on
   the last thrown tile, the light on the thrower's plate, a called tile in a strip, Kora's bubble beside the tray. Where each piece
   stands is phonetable.css (html.pt) and bigtable.css (html.bt). */

/* ---- the push rod: a gold bar along the front edge of each rack, hinged at the rack's player's left, the wall row standing in front of it ---- */
.tp-rod { position: absolute; z-index: 2; pointer-events: none; border-radius: 3px; box-sizing: border-box;
  background: linear-gradient(180deg, #f6dd8e 0, #d9b25a 45%, #a67c1f 100%); box-shadow: 0 0 0 1px rgba(90, 62, 12, 0.85), 0 1px 2px rgba(0, 0, 0, 0.5); }
.tp-rod.hinge-top, .tp-rod.hinge-bottom { background: linear-gradient(90deg, #f6dd8e 0, #d9b25a 45%, #a67c1f 100%); }
/* the hinge: a small pin at the one end that is fixed */
.tp-rod::before { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c4, #c99a2e 70%);
  box-shadow: 0 0 0 1px rgba(90, 62, 12, 0.85); transform: translate(-50%, -50%); }
.tp-rod.hinge-left::before { left: 3px; top: 50%; transform: translate(0, -50%); }
.tp-rod.hinge-right::before { right: 3px; top: 50%; left: auto; transform: translate(0, -50%); }
.tp-rod.hinge-top::before { top: 3px; left: 50%; transform: translate(-50%, 0); }
.tp-rod.hinge-bottom::before { bottom: 3px; top: auto; left: 50%; transform: translate(-50%, 0); }

/* ---- the tray: three places on the felt where tiles land; not a button. A thin ring round it fills over a call window ---- */
@property --tp-p { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@keyframes tp-fill { from { --tp-p: 0%; } to { --tp-p: 100%; } }
#tray { position: relative; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; pointer-events: auto;
  background: rgba(0, 0, 0, 0.16); border: 1.5px dashed rgba(255, 233, 163, 0.34); }
#tray[hidden] { display: none; }
#tray.tp-holds { background: rgba(8, 36, 25, 0.55); border-style: solid; border-color: rgba(255, 233, 163, 0.5); }
#tray .ask-thrown, #tray .ask-slots { display: flex; align-items: center; gap: 6px; margin: 0; }
#tray .ask-slot-col { display: flex; flex-direction: column; align-items: center; }
#tray .ask-slot-col > span { display: none; }
#tray .ask-slot { box-sizing: border-box; border: 1.5px dashed rgba(255, 233, 163, 0.5); border-radius: 4px; background: rgba(0, 0, 0, 0.14); position: relative; }
#tray .ask-slot.spare, #tray .ask-slot-col.spare .ask-slot { border-color: rgba(255, 233, 163, 0.22); background: none; }
#tray .ask-slot.blind::after { content: "blind"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 0.55rem/1 var(--g-font-body, system-ui); color: rgba(255, 246, 226, 0.7); }
#tray .ask-thrown .tile { box-shadow: 0 0 0 2px #f6c443, 0 0 8px rgba(255, 233, 163, 0.7); }
#tray.drop-ok { border-style: solid; border-color: #ffd34d; background: rgba(24, 78, 54, 0.8); box-shadow: 0 0 0 3px #ffd34d; }
/* the ring: just outside the tray, empty at the start of the window, full at its end */
#tray.tp-timed::after { content: ""; position: absolute; inset: -5px; border-radius: 16px; padding: 3px; pointer-events: none; --tp-p: 0%;
  background: conic-gradient(from 0deg, #ffd34d var(--tp-p), rgba(255, 233, 163, 0.16) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  animation: tp-fill var(--tp-total, 8s) linear forwards; animation-delay: calc(var(--tp-spent, 0s) * -1); }

/* ---- the newest thrown tile: a small mark in its thrower's color on its corner (the gold outline stays) ---- */
.pool .tile.last { position: relative; }
.pool .tile.last::after { content: ""; position: absolute; right: -4px; top: -4px; width: max(8px, 30%); aspect-ratio: 1; border-radius: 50%; z-index: 3; pointer-events: none;
  background: var(--c, #f6c443); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }

/* ---- the plate of the player who has just thrown lights for a moment ---- */
@keyframes tp-lit { 0% { box-shadow: 0 0 0 0 var(--tp-c, #ffd34d); } 15% { box-shadow: 0 0 0 4px var(--tp-c, #ffd34d), 0 0 22px 8px var(--tp-c, #ffd34d); } 100% { box-shadow: 0 0 0 0 transparent; } }
.seat-name.tp-lit, .rack-plate .me-name.tp-lit, .pt-me.tp-lit { animation: tp-lit 1.6s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .seat-name.tp-lit, .rack-plate .me-name.tp-lit, .pt-me.tp-lit { animation: none; box-shadow: 0 0 0 4px var(--tp-c, #ffd34d); } }

/* ---- a called tile in a strip wears the color of the player who threw it, as a thrown tile does ---- */
.seat-sets .tile.called-from, #yourSets .tile.called-from { box-shadow: 0 0 0 2px var(--c), 0 1px 0 var(--tile-shadow, rgba(60, 45, 25, 0.5)) !important; position: relative; z-index: 1; }

/* ---- Kora's bubble, while she speaks about the tile in the tray: beside the tray ---- */
#coachBox.tp-beside { z-index: 48; }

/* ---- a tile in the air: a draw from the wall to a rack (tablewalls.js flyTile). A card with two faces: the tile's back, and, for your own draw, its face, which it turns to on landing ---- */
.tp-flier { position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none; perspective: 500px; transform-origin: 50% 50%; will-change: transform; }
.tp-flier-card { position: absolute; inset: 0; transform-style: preserve-3d; }
.tp-flier-back, .tp-flier .tp-flier-face { position: absolute; inset: 0; box-sizing: border-box; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tp-flier-back { border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.45); background: linear-gradient(160deg, var(--tile-back, #2f5fa8), var(--tile-back-deep, #1d3f7a)); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.tp-flier .tp-flier-face { width: 100% !important; height: 100% !important; margin: 0; transform: rotateY(180deg); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45); }

/* Kora is answering about the call: the ring stands still where the clock stopped, and the tray says so (30 Nov, #209) */
#tray.tp-timed.tp-paused::after { animation-play-state: paused; opacity: 0.75; }
#tray.tp-paused::before { content: "Paused"; position: absolute; left: 50%; top: -22px; transform: translateX(-50%); padding: 0 8px; border-radius: 999px; pointer-events: none;
  background: #2a1a02; color: #ffe9a3; box-shadow: 0 0 0 1.5px #ffd34d; font: 800 11px/16px var(--g-font-body, system-ui); letter-spacing: 0.04em; }

/* Kora's check (30 Nov, round two): her two answer buttons lie side by side in the box beside the tray, so it stays short and on the felt */
#coachBox > .coach-go-row { display: flex !important; gap: 8px; margin: 8px 0 0 !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; width: auto !important; }
#coachBox > .coach-go-row > button { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }

/* ---- no tray (tablepieces.js TRAY_ON is false, 30 Nov): the newest thrown tile stands about one and a half times the pile's size in its thrower's color till the next throw,
   the call window's ring goes round it, a picked tile rises clearly with a colored outline, and a joker that can be traded glows ---- */
/* the newest thrown tile is the last tile of the pile, bigger (a scale, so no tile moves) and on a higher layer, in its thrower's color, till the next throw makes it normal size where it stands (1 Dec) */
.pool .tile.last { position: relative; z-index: 5; scale: var(--newest-scale, 1.4); transform-origin: 50% 50%; outline: 0; box-shadow: 0 0 0 3px var(--c, #f6c443), 0 8px 18px rgba(0, 0, 0, 0.55) !important; }
.pool .tile.last::after { content: ""; position: absolute; right: -4px; top: -4px; width: max(8px, 30%); aspect-ratio: 1; border-radius: 50%; z-index: 3;
  background: var(--c, #f6c443); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.tile.tp-ring::before { content: ""; position: absolute; inset: -9px; border-radius: 9px; padding: 3px; pointer-events: none; --tp-p: 0%; z-index: 4;
  background: conic-gradient(from 0deg, #ffd34d var(--tp-p), rgba(255, 233, 163, 0.2) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  animation: tp-fill var(--tp-total, 8s) linear forwards; animation-delay: calc(var(--tp-spent, 0s) * -1); }
.pool .tile.tp-ring.tp-paused::before { animation-play-state: paused; opacity: 0.75; }
.rack .tiles .tile.selected, .rack .tiles .tile.drawn.selected { box-shadow: 0 0 0 3px #ffd34d, 0 0 14px 4px rgba(255, 211, 77, 0.65), 0 9px 14px rgba(0, 0, 0, 0.42); }
html.pt .table .rack #hand .tile.selected, html.pt .table .rack #hand .tile.drawn.selected { transform: translateY(-30px); z-index: 6; }
@keyframes tp-glow { 0%, 100% { box-shadow: 0 0 0 2px #ffd34d, 0 0 6px 2px rgba(255, 211, 77, 0.6); } 50% { box-shadow: 0 0 0 3px #fff3c4, 0 0 16px 7px rgba(255, 211, 77, 0.95); } }
.tile.swap-glow { animation: tp-glow 1.1s ease-in-out infinite; position: relative; z-index: 3; }
@media (prefers-reduced-motion: reduce) { .tile.swap-glow { animation: none; box-shadow: 0 0 0 3px #ffd34d, 0 0 12px 5px rgba(255, 211, 77, 0.9); } }

/* a tile picked to pass or to throw wears a small tag on top, the size and place of the New tag in another color (blue for Pass, red for Throw) so the three never look alike (30 Nov) */
.rack .tiles .tile.selected.tag-pass::after, .rack .tiles .tile.selected.tag-throw::after { content: "Pass"; position: absolute; left: 50%; right: auto; top: auto; width: auto; height: auto; bottom: calc(100% + 3px); transform: translateX(-50%);
  padding: 0 6px; border-radius: 6px; font: 700 11px/15px system-ui, sans-serif; letter-spacing: 0.02em; pointer-events: none; z-index: 8; background: #0c2a4d; color: #cfe8ff; box-shadow: 0 0 0 1.5px #5db7ff; }
.rack .tiles .tile.selected.tag-throw::after { content: "Throw"; background: #4d0f0c; color: #ffd9d2; box-shadow: 0 0 0 1.5px #ff6a55; }
.rack .tiles .tile.selected.tag-pass, .rack .tiles .tile.selected.tag-throw { overflow: visible; }
html.pt .table .rack #hand .tile.selected.tag-pass::after, html.pt .table .rack #hand .tile.selected.tag-throw::after { font: 700 9px/12px system-ui, sans-serif; padding: 0 3px; left: auto; right: 0; transform: none; }
/* the leftmost tile's tag lies from the tile's left edge, so a tag wider than the tile is not cut by the screen's edge (phone, 30 Nov) */
html.pt .table .rack #hand .tile:first-child.selected.tag-pass::after, html.pt .table .rack #hand .tile:first-child.selected.tag-throw::after { left: 0; right: auto; }

/* no tray (TRAY_ON false): no tray on the felt; the band keeps its three boxes in the Charleston and the courtesy pass only (owner, 30 Nov), app.js drawTray drops them after */
#tray { display: none !important; }

