/* PLAY ENGINE · the dice tray (specs/play_engine.md). From the TS tray (T-136/T-140); the panel is .play-dice-show. */
.play-dice-show { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--k-black) 60%, transparent); }
.play-dice-show[hidden] { display: none; }
body.vig-held .play-dice-show { background: transparent; align-items: end; padding-bottom: max(16px, 7vh); } /* over the held card's lower half */
.td-box { width: min(660px, 100%); display: grid; gap: 12px; justify-items: center; padding: 14px 14px 18px; border-radius: var(--k-r-l); border: 1px solid var(--k-line); background: color-mix(in srgb, var(--k-bg) 82%, transparent); box-shadow: 0 18px 40px var(--k-shade); }
.td-head { display: grid; justify-items: center; gap: 2px; text-align: center; }
.td-head small { color: var(--k-muted); font-size: 12px; }
.td-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 12px; padding-bottom: 16px; }
.td { position: relative; width: 74px; height: 74px; display: grid; place-items: center; }
.td svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.td polygon { fill: color-mix(in srgb, var(--c) 14%, var(--k-card-bot)); stroke: var(--c); stroke-width: 3; stroke-linejoin: round; transition: fill 0.2s, stroke 0.2s; }
.td-face { position: relative; font: 800 26px var(--k-mono); color: var(--k-text); }
.td i { position: absolute; top: 100%; margin-top: 2px; font: normal 10px var(--k-mono); color: var(--k-muted); white-space: nowrap; }
.m-full .td:not(.landed) svg { animation: td-tumble 0.32s linear infinite; }
.m-full .td:not(.landed) { animation: td-hop 0.32s ease-in-out infinite alternate; }
@keyframes td-tumble { to { transform: rotate(360deg); } }
@keyframes td-hop { to { transform: translateY(-8px); } }
.m-full .td.landed { animation: td-land 0.22s ease-out; }
@keyframes td-land { from { transform: scale(1.25); } }
.td.one polygon { fill: color-mix(in srgb, var(--k-grn) 30%, var(--k-card-bot)); stroke: var(--k-grn); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--k-grn) 70%, transparent)); }
.td.two polygon { fill: color-mix(in srgb, var(--k-grn) 50%, var(--k-card-bot)); stroke: var(--k-grn); stroke-width: 5; filter: drop-shadow(0 0 14px var(--k-grn)); }
.td.two::after { content: "✓✓"; position: absolute; top: -6px; right: -6px; padding: 0 5px; border-radius: var(--k-pill); background: var(--k-grn); color: var(--k-ink); font: 800 10px/16px var(--k-mono); }
.td.bane polygon { stroke: var(--k-red); stroke-dasharray: 6 4; }
.td.bane .td-face { color: var(--k-red); }
.td-vs { display: grid; justify-items: center; gap: 6px; width: 100%; border-top: 1px solid var(--k-line-soft); padding-top: 8px; }
.td-row.foe .td { width: 60px; height: 60px; }
.td-row.foe .td-face { font-size: 21px; }
.td-stamp { min-height: 1em; font: 900 clamp(30px, 6vw, 54px)/1.1 var(--k-mono); letter-spacing: 0.18em; padding: 2px 18px; border: 4px solid currentColor; border-radius: 8px; opacity: 0; transform: scale(1.7) rotate(-8deg); }
.td-stamp:empty { display: none; }
.td-stamp.on { opacity: 1; transform: rotate(-4deg); transition: transform 0.22s cubic-bezier(0.2, 1.6, 0.4, 1), opacity 0.12s; }
html[data-motion="off"] .td-stamp.on { transition: none; }
.td-stamp.ok { color: var(--k-grn); text-shadow: 0 0 18px color-mix(in srgb, var(--k-grn) 60%, transparent); }
.td-stamp.bad { color: var(--k-red); text-shadow: 0 0 18px color-mix(in srgb, var(--k-red) 60%, transparent); }
.td-stamp.mishap { color: var(--k-yel); text-shadow: 0 0 18px color-mix(in srgb, var(--k-yel) 60%, transparent); }
@media (max-width: 600px) {
  .td { width: 60px; height: 60px; }
  .td-face { font-size: 21px; }
  .td-row.foe .td { width: 50px; height: 50px; }
}
.td .td-facet { fill: none; stroke: var(--c); stroke-width: 1.5; opacity: 0.55; }
.td.one .td-facet, .td.two .td-facet { stroke: var(--k-grn); }
.play-dice-show { display: flex; flex-direction: column; overflow-y: auto; }
.play-dice-show > .td-box { margin: auto; }
body.vig-held .play-dice-show > .td-box { margin: auto auto 0; }
.td-acts { width: 100%; }
.td-acts:empty { display: none; }
.play-dice-show.push.m-full .td-box { animation: td-shake 0.15s linear; }
@keyframes td-shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.td-say { font: 700 13px var(--k-mono); letter-spacing: 0.12em; color: var(--k-cyan); text-align: center; }
.td-count { min-height: 28px; font: 800 20px var(--k-mono); letter-spacing: 0.08em; color: var(--k-muted); }
.td-count.got { color: var(--k-grn); }
.play-dice-show.wait .td:not(.landed), .play-dice-show.wait .td:not(.landed) svg { animation: none !important; }
/* PLAY ENGINE: while the roll's choices are dealt (PlayRoll), the tray sits at the top so both are seen */
body.roll-choose .play-dice-show > .td-box { margin: 1vh auto auto; }
body.roll-choose .play-dice-show { padding-bottom: 0; }
body.roll-choose .play-dice-show { pointer-events: none; } /* the choice cards (the pick deck) take the taps */

/* ═══ the GITS-style reel dice (Overlord #1249: "the dice system animation we have in GITS, with the cards that get shot
   when they fail"; from assets/css/dice_tray.css .slot-die / .gits-bullet-hole, renamed pd-*) ═══ */
.pd-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px; padding-bottom: 6px; }
.pd-die { --die-color: var(--k-cyan); --die-ink: #0b0c10; position: relative; width: 88px; flex: 0 0 88px; border-radius: 12px; background: linear-gradient(160deg, #1a2434 0%, #0e1520 100%); border: 2px solid color-mix(in srgb, var(--die-color) 65%, #2a3d5c); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04); overflow: hidden; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.pd-label { font: 800 0.62rem var(--k-mono); letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: 5px 4px 3px; color: var(--die-color); border-bottom: 1px solid var(--k-line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-window { padding: 8px; background: #070b12; }
.pd-face { min-height: 58px; border-radius: 8px; background: color-mix(in srgb, var(--die-color) 20%, #10161f); color: var(--k-text); display: flex; align-items: center; justify-content: center; font: 800 1.6rem/1 var(--k-mono); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); transition: background 0.2s, color 0.2s; }
.pd-die.spinning .pd-face { filter: brightness(1.15); }
.pd-face.pd-tick { animation: pd-tick 0.06s ease-out; }
.pd-face.pd-land { animation: pd-land 0.22s ease-out; }
@keyframes pd-tick { from { transform: translateY(10px); opacity: 0.55; } to { transform: translateY(0); opacity: 1; } }
@keyframes pd-land { 0% { transform: scale(1.12); } 60% { transform: scale(0.96); } 100% { transform: scale(1); } }
/* what counted stays lit; a bane (a 1) is marked */
.pd-die.one, .pd-die.two { border-color: var(--k-grn); box-shadow: 0 0 0 1px color-mix(in srgb, var(--k-grn) 50%, transparent), 0 0 18px color-mix(in srgb, var(--k-grn) 45%, transparent); }
.pd-die.one .pd-face, .pd-die.two .pd-face { background: var(--k-grn); color: #06200f; }
.pd-die.two::after { content: "✓✓"; position: absolute; top: 4px; right: 4px; padding: 0 5px; border-radius: var(--k-pill); background: var(--k-grn); color: #06200f; font: 800 10px var(--k-mono); }
.pd-die.bane .pd-face { color: var(--k-red); }
.pd-die.shot { border-color: var(--k-red); opacity: 0.62; filter: saturate(0.6); }
.pd-die.shot .pd-face { background: var(--k-red); color: #fff; }
.pd-row.foe .pd-die { width: 74px; flex-basis: 74px; }
.pd-row.foe .pd-face { min-height: 46px; font-size: 1.3rem; }
/* the bullet hole and the fling */
.pd-hole { position: absolute; inset: 0; pointer-events: none; z-index: 6; animation: pd-hole 0.14s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.pd-hole svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55)); }
.pd-rim { fill: #0b0c10; stroke: #d4cfc4; stroke-width: 1.6; stroke-linejoin: miter; stroke-miterlimit: 8; }
.pd-core { fill: #050508; }
.pd-glint { fill: #fff; opacity: 0.28; }
.pd-cracks { fill: none; stroke: #1a1a1c; stroke-width: 1.15; stroke-linecap: round; }
@keyframes pd-hole { from { transform: scale(0.12); opacity: 0; } 55% { transform: scale(1.18); opacity: 1; } to { transform: scale(1); opacity: 1; } }
.pd-die.pd-fling { margin: 0 !important; pointer-events: none; will-change: transform; overflow: visible; transition: none !important; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.45)); }
.pd-spacer { flex: 0 0 auto; pointer-events: none; visibility: hidden; transition: width 0.28s ease, height 0.28s ease, margin 0.28s ease; }
.pd-spacer.gone { width: 0 !important; height: 0 !important; margin: 0 -5px; }
@media (max-width: 600px) { .pd-die { width: 74px; flex-basis: 74px; } .pd-face { min-height: 48px; font-size: 1.35rem; } }
