/* ---------- Obsidian Pulse ----------
   The table atmosphere of the player app: the tokens, the app chrome while a table shows
   (.pa[data-match="1"]: the bar, the status line, the controls, the rail and their buttons turn
   aubergine and lavender-silver; the lobby, the site and the side panels and sheets keep their own theme,
   so none of these rules reaches into .pa-panel), and the card states the table sets for Pulse
   Motion. The felt itself is styled in the table section of player.css, the
   cards in pulse-cards.css (the Heartbeat Deck), the motion layer in pulse-motion.css. */

.pa, .hb-lab, .pa-felt {
  --hb-ink: #0a0612;        /* near-black base */
  --hb-surface: #150f22;    /* near-black purple table surface */
  --hb-surface-2: #1e1630;  /* lighter central play area */
  --hb-graphite: #2b2240;   /* rails, pills */
  --hb-smoke: #9a93ad;      /* secondary text */
  --hb-silver: #cfc7e6;     /* accents, lines, rank text on dark */
  --hb-silver-2: #f1edf8;   /* highlights, card paper */
  --hb-crimson: #b3122e;    /* controlled crimson */
  --hb-crimson-2: #d9203f;  /* red suits on card paper */
  --hb-violet: #9b5cff;     /* electric violet: the heartbeat's light (rings, the ripple, the bloom) */
  --hb-violet-2: #7c3aed;   /* royal purple: the heartbeat's deeper tone */
  --hb-warm: #e3c9a3;       /* restrained warm highlight */
  --hb-shadow: 0 10px 24px -10px rgba(0, 0, 0, .75);
  --hb-ease: cubic-bezier(.25, .1, .2, 1);
}

/* ---------- The app around a table ---------- */
.pa[data-match="1"] { color: var(--hb-silver-2); }
.pa[data-match="1"][data-frame="full"], .pa[data-match="1"]:fullscreen {
  background: radial-gradient(1100px 620px at 50% -12%, #1b1428 0%, transparent 62%), linear-gradient(180deg, #0e0917, var(--hb-ink) 70%);
}
.pa[data-match="1"] :is(.pa-bar, .pa-status, .pa-controls, .pa-rail, .pa-felt) :focus-visible { outline-color: var(--hb-silver); }

/* bar (on short screens, the left rail) */
.pa[data-match="1"] .pa-bar { background: rgba(10, 6, 18, .9); border-color: rgba(207, 199, 230, .1); }
.pa[data-match="1"] .pa-brand img { filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .6)); }
.pa[data-match="1"] .pa-title { color: var(--hb-smoke); }
.pa[data-match="1"] .pa-title strong { color: var(--hb-silver-2); }
.pa[data-match="1"] .pa-bar :is(.pa-back, .pa-iconbtn) { border-color: rgba(207, 199, 230, .22); background: rgba(43, 34, 64, .55); color: var(--hb-silver-2); }
.pa[data-match="1"] .pa-bar :is(.pa-back, .pa-iconbtn):hover { border-color: rgba(207, 199, 230, .5); background: rgba(43, 34, 64, .9); }
.pa[data-match="1"] .pa-chip { border-color: rgba(207, 199, 230, .26); background: rgba(207, 199, 230, .06); color: var(--hb-silver-2); }
.pa[data-match="1"] .pa-chip:hover { border-color: rgba(207, 199, 230, .5); }
.pa[data-match="1"] .pa-chip-held { color: var(--hb-smoke); }
.pa[data-match="1"] .pa-conn { color: var(--hb-smoke); }

/* status line: silver text; the last seconds turn crimson and stay still */
.pa[data-match="1"] .pa-status { background: rgba(14, 9, 22, .78); border-color: rgba(207, 199, 230, .1); color: var(--hb-silver); }
.pa[data-match="1"] .pa-status[data-kind="turn"] { color: var(--hb-silver-2); }
.pa[data-match="1"] .pa-status[data-kind="urgent"] { color: #f0566e; }
.pa[data-match="1"] .pa-status[data-kind="urgent"] .pa-status-txt { animation: none; }
.pa[data-match="1"] .pa-status[data-kind="warn"] { color: var(--hb-warm); background: rgba(227, 201, 163, .07); }
.pa[data-match="1"] .pa-status[data-kind="bad"] { color: #f6a9b5; background: rgba(179, 18, 46, .14); }
.pa[data-match="1"] .pa-status[data-kind="good"] { color: var(--hb-silver-2); }
.pa[data-match="1"] .pa-status-act { border-color: rgba(207, 199, 230, .3); background: rgba(43, 34, 64, .7); color: var(--hb-silver-2); }

/* controls row and the quick rail */
.pa[data-match="1"] .pa-controls { background: rgba(14, 9, 22, .78); border-color: rgba(207, 199, 230, .1); }
.pa[data-match="1"] .pa-hint { color: var(--hb-smoke); }
.pa[data-match="1"] .pa-rail { background: rgba(10, 6, 18, .72); border-color: rgba(207, 199, 230, .1); }
.pa[data-match="1"] .pa-rbtn { color: var(--hb-smoke); }
.pa[data-match="1"] .pa-rbtn:hover { color: var(--hb-silver-2); background: rgba(207, 199, 230, .07); }
.pa[data-match="1"] .pa-rbtn[aria-pressed="true"] { color: var(--hb-silver-2); background: rgba(207, 199, 230, .1); border-color: rgba(207, 199, 230, .24); }
.pa[data-match="1"] .pa-rbtn[data-id="sound"][aria-pressed="true"] { background: none; border-color: transparent; color: var(--hb-silver); }
.pa[data-match="1"] .pa-rbtn[data-id="sound"][aria-pressed="false"] { color: var(--hb-smoke); }

/* buttons in the bar, the controls row and the table box (Capture, Buy, the result card's
   actions): primary actions in crimson with silver text, ghost and quiet buttons with a hairline
   silver border */
.pa[data-match="1"] :is(.pa-bar, .pa-controls, .pa-felt) .btn-primary { background: var(--hb-crimson); color: var(--hb-silver-2); box-shadow: 0 10px 24px -12px rgba(179, 18, 46, .75), inset 0 1px 0 rgba(255, 255, 255, .14); }
.pa[data-match="1"] :is(.pa-bar, .pa-controls, .pa-felt) .btn-primary:hover:not(:disabled) { background: var(--hb-crimson-2); transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(217, 32, 63, .7), inset 0 1px 0 rgba(255, 255, 255, .16); }
.pa[data-match="1"] :is(.pa-bar, .pa-controls, .pa-felt) .btn-primary::after { content: none; }
.pa[data-match="1"] :is(.pa-bar, .pa-controls, .pa-felt) .btn-ghost { border-color: rgba(207, 199, 230, .32); background: rgba(43, 34, 64, .5); color: var(--hb-silver-2); }
.pa[data-match="1"] :is(.pa-bar, .pa-controls, .pa-felt) .btn-ghost:hover { border-color: var(--hb-silver); background: rgba(43, 34, 64, .85); }
.pa[data-match="1"] :is(.pa-bar, .pa-controls, .pa-felt) .btn-quiet { border-color: rgba(207, 199, 230, .16); color: var(--hb-smoke); }
.pa[data-match="1"] :is(.pa-bar, .pa-controls, .pa-felt) .btn-quiet:hover:not(:disabled) { color: var(--hb-silver-2); border-color: rgba(207, 199, 230, .4); }

/* ---------- Card states for Pulse Motion ----------
   The real nodes are always the state; these classes only decorate the moment between two
   payloads. The table adds them (never under reduced motion) and every one ends at rest:
   the keyframes fill backwards only, so a finished state animation leaves nothing running.
   On the stage a card's transform is the stage's placement (translate3d + rotate, with its
   height in z), so no rule here touches transform: a lift is the stage placing the card 24 units
   above the felt with its cast shadow, and these keyframes animate the separate `translate`
   property (composed before the transform) from the felt up to that height, or back down. A
   card the engine moves carries its own .hb-flying, styled in pulse-motion.css. */
/* waits for its card: the node is there but unseen and inert until the dealt card lands on it */
.pa-felt .card.hb-undealt { opacity: 0; pointer-events: none; }

/* my move, sent and not yet answered: the card stands lifted and fades in place (220 ms) */
.pa-felt .pa-hand .card.played { --hb-card-dim: .6; pointer-events: none; animation: hb-rise 220ms var(--hb-ease) backwards; }
.pa-felt .pa-hand .card.played > .hb-front { animation: hb-fade 220ms var(--hb-ease) backwards; }
.pa-felt .pa-hand .card.played.hb-from-chosen { animation: none; } /* already raised: only the fade */
.pa-felt .pa-hand .card.played.hb-held, .pa-felt .pa-hand .card.played.hb-held > .hb-front { animation: none; } /* redrawn while the move is in flight */
/* selecting and deselecting a hand card: from the felt up to its lifted place, or back down */
.pa-felt .pa-hand .card.hb-lift { animation: hb-rise 140ms var(--hb-ease) backwards; }
.pa-felt .pa-hand .card.hb-drop { animation: hb-sink 140ms var(--hb-ease) backwards; }
/* the cast shadow the stage puts before a lifted card fades in with it */
.pa-felt .pa-hand > .hb-shadow:has(+ .card.hb-lift), .pa-felt .pa-hand > .hb-shadow:has(+ .card.played:not(.hb-from-chosen):not(.hb-held)) { animation: hb-fade-in 140ms var(--hb-ease) backwards; }
@keyframes hb-rise { from { translate: 0 0 -24px; } }
@keyframes hb-sink { from { translate: 0 0 24px; } }
@keyframes hb-fade { from { opacity: 1; } }
@keyframes hb-fade-in { from { opacity: 0; } }

/* Reduced motion (the system setting, or the app's own switch: .pa-reduce on the felt): every state
   change in the table is instant. No transition at all in the felt (the site stylesheet's
   near-zero transition-duration for the page would still turn every placement the stage writes
   into a transition with its events), and the card state animations are off. */
@media (prefers-reduced-motion: reduce) {
  .pa-felt, .pa-felt *, .pa-felt *::before, .pa-felt *::after { transition: none !important; }
  .pa-felt .pa-hand .card.played, .pa-felt .pa-hand .card.played > .hb-front, .pa-felt .pa-hand .card.hb-lift, .pa-felt .pa-hand .card.hb-drop, .pa-felt .pa-hand > .hb-shadow { animation: none; }
}
.pa-felt.pa-reduce, .pa-felt.pa-reduce *, .pa-felt.pa-reduce *::before, .pa-felt.pa-reduce *::after { transition: none !important; }
.pa-felt.pa-reduce .pa-hand .card.played, .pa-felt.pa-reduce .pa-hand .card.played > .hb-front, .pa-felt.pa-reduce .pa-hand .card.hb-lift, .pa-felt.pa-reduce .pa-hand .card.hb-drop, .pa-felt.pa-reduce .pa-hand > .hb-shadow { animation: none; }
