/* BackgammonX v0.2.18 — 10-dice-animation.css
   Presentation-only. Owns: the compact tray/travel/tumble/bounce/settle
   visuals for BGX.diceAnimation (js/23-dice-animation.js). Never
   referenced by, and never references, any rules/state file. No TX
   source, color token or coordinate was copied — see
   IMPLEMENTATION-NOTE.md for the explicit no-TX-access statement; this
   file's cube-face/pip geometry and motion values are BGX's own,
   written from the two supplied prose reference notes' timing/feel
   description only.

   Every travelling element here computes to pointer-events:none (the
   .dtf-dice-tray container and everything inside it) so it can never
   intercept a checker/board/button click, per the handoff's own
   explicit requirement — confirmed by a real getComputedStyle() test,
   not just asserted here. */

:root { --bgx-css-10: 1; }

/* ==================== stage / tray container ==================== */

.dtf-dice-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 56px;
  min-height: 44px;
}

/* The travelling layer sits above the permanent .dtf-die spans and is
   completely inert to pointer input. It is empty (no children) except
   while BGX.diceAnimation actually owns an active play(). */
.dtf-dice-tray {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  perspective: 600px;
  z-index: 5;
}

/* A small fixed origin marker — the "compact tray/origin" the handoff
   asks for. Purely decorative; travellers begin their travel transform
   from this same relative position.
   v0.2.19 §C — doubled (8px->16px, offset -14px->-28px) to stay
   proportional to the now-doubled traveller cube. */
.dtf-dice-tray-origin {
  position: absolute;
  left: -28px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 4px;
  background: rgba(212, 160, 42, 0.35);
  box-shadow: inset 0 0 0 1px rgba(212, 160, 42, 0.6);
  pointer-events: none;
}

/* While a roll is animating, the real permanent dice are visually
   hidden (never removed from the DOM, never re-created — the exact
   same .dtf-die elements js/22's own renderHud() already wrote
   synchronously stay put underneath, so no flash-of-wrong-value is
   possible: revealing them again on settle is just removing this
   class, not writing new content). */
.dtf-dice.dtf-dice-hidden-for-animation { visibility: hidden; }

/* ==================== traveller cube ==================== */

/* v0.2.21 — .dtf-die-board-static (js/23's placeLandedPairStatic(), for
   prefers-reduced-motion) shares every base wrapper rule below with
   .dtf-die-traveller: same box model, same custom-property contract
   (--dtf-tx/--dtf-ty/--dtf-cube-x/--dtf-cube-y), same translate base
   transform. It never receives a .dtf-phase-* class (built once, in its
   final settled pose, with nothing to transition from), so none of the
   phase-transition rules further below need a matching selector added —
   only this shared box-model rule and the two responsive breakpoints'
   size overrides do. */
.dtf-die-traveller,
.dtf-die-board-static {
  position: absolute;
  top: 50%;
  left: 0;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  pointer-events: none;
  transform-style: preserve-3d;
  /* v0.2.19 PATCH-1 §5 — single inherited half-depth token. The
     desktop-only red-team blocker: every .dtf-die-face-N rule below
     hardcoded translateZ(18px) regardless of breakpoint, while this
     rule's own width/height DID change responsively (36->32->30px) —
     producing 32x32x36 and 30x30x36 rectangular prisms, not cubes, at
     tablet/phone. Each breakpoint below now sets ONLY this one
     variable alongside its own width/height/margin-top change; every
     face rule reads it, so there is exactly one place that can ever
     drift out of sync with the cube's own rendered size, and setting
     it here (rather than on each face) means the six faces cannot
     independently disagree with each other either. */
  --dtf-half-depth: 18px;
  /* --dtf-tx / --dtf-ty: per-traveller JS-set travel destination
     (landing offset from the origin, in px), starting from the origin
     marker's own position (js/23's ORIGIN_X/ORIGIN_Y) so both dice
     have real spatial travel. --dtf-cube-x / --dtf-cube-y: v0.2.18.1
     §C — the ONE pair of custom properties that drives cube rotation
     through EVERY phase (travel, bounce, settle). js/23 only ever
     updates these two values at each phase transition; .dtf-die-cube's
     own base rule below always reads them, so there is no separate
     phase-specific transform rule for the rotation to "fall back" to
     — the cube can never snap to the identity orientation between
     phases, only ever transition smoothly from whatever value it last
     had to the next one. */
  --dtf-tx: 0px;
  --dtf-ty: 0px;
  --dtf-cube-x: 0deg;
  --dtf-cube-y: 0deg;
  /* v0.2.18.1 §B — THE actual fix for "first die does not travel":
     this base rule must itself read translate(var(--dtf-tx),
     var(--dtf-ty)) unconditionally. Previously only the phase-specific
     rules (.dtf-phase-travel/-bounce/-settle) applied a transform using
     these variables — so setting --dtf-tx to the origin's own x BEFORE
     any phase class existed had NO visible effect at all (nothing was
     reading it yet), and the very first transition (identity ->
     .dtf-phase-travel's own landing value) necessarily started from
     identity (0,0), not from the origin. Both dice "travelled" only in
     the loose sense of ending at their own landing offset from 0 — die
     0's own landing offset (x:0) is IDENTICAL to identity, so it never
     moved at all, which is exactly BLOCKER 2. With this base rule
     always active, setting --dtf-tx to ORIGIN_X (js/23) before adding
     any phase class now REALLY moves the traveller there, so the
     following .dtf-phase-travel transition has a real, non-zero
     distance to cover for BOTH dice. */
  transform: translate(var(--dtf-tx), var(--dtf-ty));
}

.dtf-die-cube {
  /* v0.2.19 PATCH-2 §E — the cube is a <span>; an inline, non-replaced
     element has no width/height box and is not transformable, so the
     old cube neither took its traveller's size nor actually rotated
     as a 3-D object. An explicit block box fixes both. */
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--dtf-cube-x, 0deg)) rotateY(var(--dtf-cube-y, 0deg));
}

.dtf-die-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 6px;
  box-sizing: border-box;
  border-radius: 6px;
  background: linear-gradient(160deg, #fbf6ea, #d9cfae);
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}
.dtf-die-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #241a08;
  align-self: center;
  justify-self: center;
  opacity: 0;
}
.dtf-die-pip.on { opacity: 1; }

/* Physical face placement — half the cube's own current rendered size,
   via the single --dtf-half-depth token each breakpoint below sets
   alongside its own width/height (v0.2.19 PATCH-1 §5: was a hardcoded
   18px regardless of breakpoint). A REAL die's own opposite-faces-
   sum-to-7 convention (1<->6, 2<->5, 3<->4); this is public-domain die
   geometry, not TX-specific. */
.dtf-die-face-1 { transform: rotateY(0deg)    translateZ(var(--dtf-half-depth, 18px)); }
.dtf-die-face-6 { transform: rotateY(180deg)  translateZ(var(--dtf-half-depth, 18px)); }
.dtf-die-face-2 { transform: rotateY(90deg)   translateZ(var(--dtf-half-depth, 18px)); }
.dtf-die-face-5 { transform: rotateY(-90deg)  translateZ(var(--dtf-half-depth, 18px)); }
.dtf-die-face-3 { transform: rotateX(90deg)   translateZ(var(--dtf-half-depth, 18px)); }
.dtf-die-face-4 { transform: rotateX(-90deg)  translateZ(var(--dtf-half-depth, 18px)); }

/* ==================== pip layouts (3x3 grid positions) ==================== */
.dtf-die-face-1 .dtf-die-pip:nth-child(1) { grid-area: 2 / 2; opacity: 1; }

.dtf-die-face-2 .dtf-die-pip:nth-child(1) { grid-area: 1 / 1; opacity: 1; }
.dtf-die-face-2 .dtf-die-pip:nth-child(2) { grid-area: 3 / 3; opacity: 1; }

.dtf-die-face-3 .dtf-die-pip:nth-child(1) { grid-area: 1 / 1; opacity: 1; }
.dtf-die-face-3 .dtf-die-pip:nth-child(2) { grid-area: 2 / 2; opacity: 1; }
.dtf-die-face-3 .dtf-die-pip:nth-child(3) { grid-area: 3 / 3; opacity: 1; }

.dtf-die-face-4 .dtf-die-pip:nth-child(1) { grid-area: 1 / 1; opacity: 1; }
.dtf-die-face-4 .dtf-die-pip:nth-child(2) { grid-area: 1 / 3; opacity: 1; }
.dtf-die-face-4 .dtf-die-pip:nth-child(3) { grid-area: 3 / 1; opacity: 1; }
.dtf-die-face-4 .dtf-die-pip:nth-child(4) { grid-area: 3 / 3; opacity: 1; }

.dtf-die-face-5 .dtf-die-pip:nth-child(1) { grid-area: 1 / 1; opacity: 1; }
.dtf-die-face-5 .dtf-die-pip:nth-child(2) { grid-area: 1 / 3; opacity: 1; }
.dtf-die-face-5 .dtf-die-pip:nth-child(3) { grid-area: 2 / 2; opacity: 1; }
.dtf-die-face-5 .dtf-die-pip:nth-child(4) { grid-area: 3 / 1; opacity: 1; }
.dtf-die-face-5 .dtf-die-pip:nth-child(5) { grid-area: 3 / 3; opacity: 1; }

.dtf-die-face-6 .dtf-die-pip:nth-child(1) { grid-area: 1 / 1; opacity: 1; }
.dtf-die-face-6 .dtf-die-pip:nth-child(2) { grid-area: 1 / 3; opacity: 1; }
.dtf-die-face-6 .dtf-die-pip:nth-child(3) { grid-area: 2 / 1; opacity: 1; }
.dtf-die-face-6 .dtf-die-pip:nth-child(4) { grid-area: 2 / 3; opacity: 1; }
.dtf-die-face-6 .dtf-die-pip:nth-child(5) { grid-area: 3 / 1; opacity: 1; }
.dtf-die-face-6 .dtf-die-pip:nth-child(6) { grid-area: 3 / 3; opacity: 1; }

/* ==================== motion phases ====================
   JS toggles these classes; every duration/easing value below is the
   owner's own reference-note target, applied by BGX (never read from
   or dependent on any TX file). Each phase below sets BOTH the
   traveller's own translate transition AND its .dtf-die-cube child's
   rotate transition — v0.2.18.1 §C's fix for BLOCKER 3: the bounce
   phase previously had no cube rule at all here, so the cube fell back
   to .dtf-die-cube's own base rotateX(0)/rotateY(0) the instant
   dtf-phase-travel was removed. Now every phase, bounce included,
   keeps a live transition targeting the same --dtf-cube-x/--dtf-cube-y
   properties js/23 updates at each transition, so rotation is
   continuous across the whole travel -> bounce -> settle sequence. */

.dtf-die-traveller.dtf-phase-travel {
  transition: transform 320ms cubic-bezier(.32, .04, .52, .98);
  transform: translate(var(--dtf-tx), var(--dtf-ty));
}
.dtf-die-traveller.dtf-phase-travel .dtf-die-cube {
  transition: transform 320ms cubic-bezier(.32, .04, .52, .98);
}

.dtf-die-traveller.dtf-phase-bounce {
  transition: transform 170ms ease-out;
  transform: translate(var(--dtf-tx), calc(var(--dtf-ty) - 4px));
}
.dtf-die-traveller.dtf-phase-bounce .dtf-die-cube {
  transition: transform 170ms ease-out;
}

.dtf-die-traveller.dtf-phase-settle {
  transition: transform 320ms cubic-bezier(.22, .61, .36, 1);
  transform: translate(var(--dtf-tx), var(--dtf-ty));
}
.dtf-die-traveller.dtf-phase-settle .dtf-die-cube {
  transition: transform 320ms cubic-bezier(.22, .61, .36, 1);
}

/* Reduced motion: no travel/tumble/bounce at all -- travellers (if ever
   briefly created) never transition, so the module's own JS timing
   collapses to effectively 0ms and the real dice are revealed
   immediately. This rule is a defensive backstop; js/23's own reduced-
   motion branch does not create travellers at all in that path. */
@media (prefers-reduced-motion: reduce) {
  .dtf-die-traveller,
  .dtf-die-traveller .dtf-die-cube {
    transition: none !important;
  }
}

/* ==================== v0.2.18.1 §E — permanent settled dice, visible pips ====================
   .dtf-die itself (size/background/border/shadow) is UNCHANGED — owned
   by css/09, not touched this pass. This block only adds what's needed
   for the new pip-face child to lay out inside that same square:
   position:relative on the (untouched) .dtf-die square, plus the new
   pip-face/pip/value rules themselves. The visible pip layout matches
   the SAME physical-die language the travelling cubes already use
   (public-domain opposite-faces convention; layout data lives in
   js/22's own PIP_LAYOUTS, not duplicated here).
   v0.2.19 §C — inset/pip dimensions doubled (2px->4px, 3.5px->7px) to
   match css/09's own doubled .dtf-die square (22px->44px desktop);
   like the original v0.2.18.1 design, these do not vary by breakpoint
   (the die's own outer size already does, in css/09). */
.dtf-die { position: relative; }

.dtf-die-pip-face {
  position: absolute;
  inset: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.dtf-die-pip-face .dtf-die-pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #241a08;
  align-self: center;
  justify-self: center;
  /* .dtf-die-pip's own base rule (used by the travelling cube faces,
     above) defaults to opacity:0 there, needing an explicit .on class
     per-position since a single cube face template holds every
     possible pip position at once. This permanent-die layer only ever
     creates the exact pips a value needs (see js/22's own
     PIP_LAYOUTS), so they must be opaque unconditionally — this was
     the actual cause of the pips existing in the DOM (correct count,
     correct position, correct color) but not visually rendering,
     caught by a real screenshot showing blank dice despite passing
     DOM-level checks. */
  opacity: 1;
}

/* Standard visually-hidden pattern: present in the accessibility tree
   and in .dtf-die's own textContent (so every existing test reading
   .dtf-die.textContent for the exact numeric result keeps working
   unchanged — the pip-face layer above contributes no text at all),
   but never visually rendered and never announced twice (aria-hidden;
   the parent .dtf-die's own aria-label="die showing N" is what a
   screen reader actually announces). */
.dtf-die-value {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Presentation-only input gate — applied to <body> (and, redundantly,
   to .dtf-hud's own root) only while a roll animation is actively
   travelling, removed on settle/cancel/error (js/23's own
   releaseInputGate()). This NEVER touches js/21: it is a pure CSS
   pointer-events override on the same hit-target elements js/21's own
   click listeners are already attached to, so a click during the brief
   gated window simply never reaches those listeners — js/21's own
   legality/candidate logic is completely unaware this class exists. */
body.dtf-dice-settling-body .hti-point-target,
body.dtf-dice-settling-body #bgx-bar-rail .bgx-rail-blue,
body.dtf-dice-settling-body #bgx-bar-rail .bgx-rail-red,
body.dtf-dice-settling-body #bgx-borne-off-rail .bgx-rail-blue,
body.dtf-dice-settling-body #bgx-borne-off-rail .bgx-rail-red {
  pointer-events: none !important;
}

/* Responsive — keep the stage/tray compact and clear of overflow at
   every breakpoint .dtf-hud itself already defines (css/09).
   v0.2.19 §C — doubled: 16px->32px tablet, 15px->30px phone. */
@media (max-width: 1023px) {
  .dtf-die-traveller,
  .dtf-die-board-static { width: 32px; height: 32px; margin-top: -16px; --dtf-half-depth: 16px; }
  .dtf-die-face { padding: 4px; }
}
@media (max-width: 639px) {
  .dtf-dice-tray-origin { left: -20px; width: 12px; height: 12px; margin-top: -6px; }
  .dtf-die-traveller,
  .dtf-die-board-static { width: 30px; height: 30px; margin-top: -15px; --dtf-half-depth: 15px; }
}
