/* AURORA ASSISTANT (2026-07-26 rewrite)
   Replaces the old persistent left "game dock" (~15vw permanently reserved
   from the felt) with a single small on-demand trigger + popover panel —
   owner call: switch the left rail off for good, the felt gets that space
   back. Presentation-only. No engine, board geometry, betting or
   multiplayer changes.
*/
:root{
  --ax-gold: var(--tt-gold, #c9a04a);
  --ax-gold-hi: var(--tt-gold-hi, #e2c36e);
  --ax-text: var(--text, #f4f1e8);
  --ax-muted: var(--muted, #91a0ad);
  --ax-surface: rgba(7, 12, 17, .94);
  --ax-surface-soft: rgba(8, 16, 20, .78);
  --ax-line: rgba(201,160,74,.24);
  --ax-ease: cubic-bezier(.22,.82,.3,1);
}

.aurora-assistant-btn,
.aurora-assistant-panel,
.aurora-assistant-full{
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Trigger button — small, fixed, left edge, lower-left of the freed rail
   (owner spec, 2026-07-26 follow-up: pot info moves into this same column
   above the trigger — see .aurora-pot-rail below — so the trigger itself
   moved down to make room and to sit closer to the hero's own thumb-
   reachable zone: read-only pot info belongs near the top where the eye
   already is, the tappable trigger belongs near the bottom where the
   fingers already are).
   NOT a return to the original bottom-left anchor that was tried and
   rejected pre-launch: that one collided with the hero hole-card fan at max
   ESG on the two shortest viewports (740x360/780x360) — a 13-card fan
   sprawls low and wide enough to reach that exact corner (verified via the
   geometry test suite, not guessed). This position is lower than the old
   vertical-center default but was re-verified against that same
   validation_state_a_hlh_8p_maxesg fixture before landing here — see
   test/visual/geometry.js's assistantBtn prohibited-pairs checks. Still
   deliberately allowed to float over the felt rather than reserve layout
   space (owner precedent for the old dock-menu popup: "if the popup even
   overlays parts of the game, I think that should be acceptable"). No
   board-stage margin/width reservation exists for this at all — the felt is
   always full width now. */
.aurora-assistant-btn{
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  top: 72%;
  transform: translateY(-50%);
  z-index: 180;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 9px;
  border: 1px solid var(--ax-line);
  border-radius: 999px;
  color: var(--ax-text);
  background: linear-gradient(180deg, rgba(15,22,28,.94), rgba(5,10,14,.91));
  box-shadow: 0 10px 26px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 200ms ease, transform 200ms var(--ax-ease);
}
.aurora-assistant-btn:hover{ border-color: var(--ax-gold); }
.aurora-assistant-btn:focus-visible{ outline: 2px solid var(--ax-gold-hi); outline-offset: 2px; }
.aurora-assistant-btn__ic{ font-size: 13px; line-height: 1; }
.aurora-assistant-btn__label{ letter-spacing: -.01em; }
.aurora-assistant-btn__tag{
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(201,160,74,.16);
  color: #eadcae;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .04em;
}

/* ── Pot Rail — the felt's old #feltPot pill, relocated (owner spec,
   2026-07-26): pot info now lives permanently in this left column instead
   of the board's own vertical stack, freeing that space for board-stage.js's
   fitCardBox() to give back to card size. Same left edge and z-index family
   as the Assistant trigger below it, but anchored near the TOP of the
   column (under the opponent rail) rather than the trigger's own lower
   anchor — read-only status info near the eye, the tappable trigger near
   the thumb. A visible gap between the two blocks is deliberate (owner
   spec) so they never read as one merged element.
   Single-pot hands (the overwhelming majority) render one line, same
   "Pot {total}" text #feltPot always showed. Multi-pot hands (a genuine
   multi-way all-in with unequal stacks) expand to one row per
   buildSidePots() entry — max-height+overflow bounds the rare case of more
   than a handful of pots, same defensive pattern .aurora-assistant-panel
   already uses below, so this can never grow tall enough to reach the
   trigger regardless of how many pots a hand produces. */
.aurora-pot-rail{
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  /* --pot-rail-safe-top (aurora-table.js's updatePotRailSafeTop(),
     2026-07-26 follow-up) is the leftmost seat's real measured bottom
     edge + gap this frame — folded into the max() so the rail drops
     into the open space below the seat row instead of hugging a static
     px guess, but still never sits above these floors when no seat is
     visible to measure (defaults to 0px via var()'s fallback). */
  top: max(88px, env(safe-area-inset-top) + 88px, var(--pot-rail-safe-top, 0px));
  z-index: 170;
  max-width: min(46vw, 190px);
  max-height: min(28dvh, 150px);
  overflow-y: auto;
  padding: 7px 10px;
  border: 1px solid var(--ax-line);
  border-radius: 14px;
  color: var(--ax-text);
  background: linear-gradient(160deg, rgba(18,25,31,.96), rgba(6,10,14,.96));
  box-shadow: 0 10px 26px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font: inherit;
  font-size: 12px;
  pointer-events: none; /* read-only status, never a tap target */
  transition: opacity 200ms ease;
}
.aurora-pot-rail[hidden]{ display: none; }
.aurora-pot-rail__eyebrow{
  color: var(--ax-gold-hi);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.aurora-pot-rail__row{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}
.aurora-pot-rail__row + .aurora-pot-rail__row{ margin-top: 2px; }
.aurora-pot-rail__label{ color: var(--ax-gold); font-weight: 700; }
.aurora-pot-rail__row--total .aurora-pot-rail__label{ color: var(--ax-muted); font-weight: 600; }
.aurora-pot-rail__amt{ font-weight: 800; font-variant-numeric: tabular-nums; }
.aurora-pot-rail__elig{ color: var(--ax-muted); font-size: 10px; }

@media (max-height: 450px){
  .aurora-pot-rail{
    /* 96px, not the original 78px guess: the geometry test suite's
       validation_state_a_hlh_8p_maxesg fixture (8-handed, max ESG) measured
       the leftmost opponent pill's real bottom edge as low as 85px at this
       tier — 78px collided with it (prohibited-overlap, confirmed via
       test/visual/run.js across every ≤450px-height viewport, not guessed).
       96px clears the worst case observed with an ~11px buffer. */
    top: max(96px, env(safe-area-inset-top) + 96px, var(--pot-rail-safe-top, 0px));
    padding: 5px 8px;
    font-size: 10.5px;
    max-width: min(48vw, 150px);
  }
  .aurora-pot-rail__eyebrow{ font-size: 8px; }
  .aurora-pot-rail__elig{ font-size: 9px; }
}

/* Real hide state (showdown recap — carried over from the old dock's
   aurora-dock-showdown-hidden: without an explicit opacity:0/visibility:
   hidden/pointer-events:none class, this sits above the recap overlay's own
   z-index and renders on top of it). */
.aurora-assistant-btn.aurora-assistant-hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Panel — opened from the trigger, positioned via JS (measure-then-clamp,
   openPanel() in aurora-experience-layer.js) the same way the old dock
   menu's popup was. Deliberately allowed to sit on top of the felt — a
   player-initiated, low-frequency action, not ambient status. */
.aurora-assistant-panel{
  position: fixed;
  z-index: 9300;
  width: min(80vw, 260px);
  max-height: min(80vh, 420px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--ax-line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(18,25,31,.98), rgba(6,10,14,.98));
  box-shadow: 0 20px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
}
.aurora-assistant-panel__row{
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 4px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: var(--ax-text);
  font: inherit;
  cursor: pointer;
}
.aurora-assistant-panel__row:hover{ background: rgba(255,255,255,.06); }
.aurora-assistant-panel__row .row-icon{ flex: 0 0 auto; font-size: 15px; }
.aurora-assistant-panel__row .row-label{ flex: 1 1 auto; font-size: 12px; font-weight: 800; }
.aurora-assistant-panel__row .row-label-block{ flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.aurora-assistant-panel__row .row-sub{ font-size: 10px; font-weight: 600; color: var(--ax-muted); line-height: 1.35; }
.aurora-assistant-panel__row .row-chevron{ flex: 0 0 auto; color: var(--ax-muted); font-size: 13px; }
.aurora-assistant-panel__chevron--toggle{ transition: transform 160ms ease; }
.aurora-assistant-panel__chevron--toggle.is-open{ transform: rotate(180deg); }

.aurora-assistant-panel__answer{
  padding: 8px 10px 4px;
  margin: -2px 0 8px;
}
.aurora-assistant-panel__note{
  font-size: 11px;
  line-height: 1.45;
  color: rgba(244,241,232,.9);
  margin-bottom: 6px;
}
.aurora-assistant-panel__note--muted{ color: var(--ax-muted); font-size: 10.5px; }
.aurora-assistant-panel__cat{
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
}
.aurora-assistant-panel__cat .ic{ font-size: 14px; text-align: center; }
.aurora-assistant-panel__cat .lb{ font-size: 11px; font-weight: 800; color: var(--ax-text); }
.aurora-assistant-panel__cat .ru{ font-size: 10px; color: #aab5bd; margin-top: 1px; line-height: 1.35; }

.aurora-assistant-panel__divider{
  height: 1px;
  background: var(--ax-line);
  margin: 8px 0;
}
.aurora-assistant-panel__row--calm{
  background: rgba(91,139,214,.14);
  border-color: rgba(91,139,214,.45);
}
.aurora-assistant-panel__row--calm .row-label{ color: #8fb6ec; }
.aurora-assistant-panel__row--calm:hover{ background: rgba(91,139,214,.24); }
.aurora-assistant-panel__row--danger{
  background: rgba(239,68,68,.13);
  border-color: rgba(239,68,68,.42);
}
.aurora-assistant-panel__row--danger .row-label{ color: #f7a8a8; }
.aurora-assistant-panel__row--danger:hover{ background: rgba(239,68,68,.22); }
.aurora-assistant-panel__row:focus-visible{
  outline: 2px solid var(--ax-gold-hi);
  outline-offset: 1px;
}

@media (orientation: portrait){
  .aurora-assistant-btn, .aurora-assistant-panel{ display: none !important; }
}

@media (prefers-reduced-motion: reduce){
  .aurora-assistant-btn{ transition-duration: .01ms !important; }
  .aurora-assistant-panel__chevron--toggle{ transition-duration: .01ms !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Pre-hand game announcement (2026-07-23) — lighter, copy-only replacement
   for the Dealer Corner/Round Introduction cinematic removed 2026-07-22
   ("we tried our best... but it doesn't work well"). Board-anchored text and
   real per-category win-ways, nothing voiced or animated in from off-table.

   NOT a descendant of #boardStage — deliberately a sibling of it inside
   .table-wrap instead (see aurora-experience-layer.js's ensureAnnounceDom()).
   #boardStage's own stacking context is kept below #oppStrip's z-index:5 on
   purpose (aurora-table.css) so seats sit visibly on the rail during real
   play; a descendant's z-index can never escape its ancestor's stacking
   context, so anything nested inside #boardStage is structurally trapped
   under the opponent pods no matter its own z-index value. Found exactly
   this bug (the takeover's text visually colliding with seat pods) in
   mockups/game-announcement-flow-mockup.html's first draft — fixed there
   first by promoting it to a table-wrap-level sibling, verified clean, then
   ported here the same way. */
.aurora-announce{
  position: absolute; inset: 0; z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 4vh 4vw; text-align: center;
  background: linear-gradient(180deg, rgba(4,9,7,.72), rgba(3,7,6,.86));
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transform: scale(.94); pointer-events: none;
  transition: opacity 480ms var(--ax-ease), transform 480ms var(--ax-ease);
}
.aurora-announce.is-active{ opacity: 1; transform: scale(1); pointer-events: auto; }
.aurora-announce.aurora-announce--collapsing{
  opacity: 0;
  transform: scale(.22) translate(var(--ax-ann-tx, 0), var(--ax-ann-ty, 0));
}
.aurora-announce__eyebrow{
  color: var(--ax-gold-hi); font-size: clamp(10px,1.6vw,13px); font-weight: 800;
  letter-spacing: .28em; text-transform: uppercase; opacity: .85;
}
.aurora-announce__title{
  color: var(--ax-text); font-size: clamp(24px,4.6vw,46px); font-weight: 900;
  letter-spacing: -.01em; line-height: 1.05; text-shadow: 0 2px 22px rgba(0,0,0,.5);
  text-wrap: balance;
}
.aurora-announce__subtitle{ color: var(--ax-gold-hi); font-size: clamp(12px,2vw,17px); font-weight: 700; letter-spacing: .05em; }
.aurora-announce__chips{ display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.aurora-announce__chip{
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px;
  background: rgba(8,16,20,.75); border: 1px solid var(--ax-line); color: #eadcae;
  font-size: clamp(11px,1.4vw,13.5px); font-weight: 800;
}
.aurora-announce__ways{ display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; max-width: min(94vw,780px); }
.aurora-announce__way{
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 112px;
  padding: 9px 8px; border-radius: 12px; background: rgba(6,12,15,.6); border: 1px solid rgba(201,160,74,.22);
}
.aurora-announce__way-icon{ font-size: 19px; }
.aurora-announce__way-label{ color: var(--ax-text); font-size: 11px; font-weight: 800; }
.aurora-announce__count{ margin-top: 8px; color: var(--ax-muted); font-size: 12px; font-weight: 700; }
.aurora-announce__count b{ color: #8fd6a8; font-size: 14px; }

/* On-demand full-screen fact panel — currently only ESG details uses this
   (openESGFull() in aurora-experience-layer.js). Same table-wrap-sibling
   placement/reasoning as .aurora-announce above; visually descended from
   the old "Game Info" rules panel this replaces. */
.aurora-assistant-full{
  position: absolute; inset: 0; z-index: 410;
  display: flex; align-items: center; justify-content: center; padding: 3vh 3vw;
  background: rgba(3,7,6,.82); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 260ms ease;
}
.aurora-assistant-full.is-active{ opacity: 1; pointer-events: auto; }
.aurora-assistant-full__card{
  width: min(96vw,480px); max-height: 92%; overflow: auto;
  background: linear-gradient(180deg, rgba(16,23,29,.97), rgba(6,10,14,.97));
  border: 1px solid var(--ax-line); border-radius: 18px; padding: 20px 22px 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.aurora-assistant-full__head{ display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.aurora-assistant-full__eyebrow{ color: var(--ax-gold-hi); font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.aurora-assistant-full__title{ color: var(--ax-text); font-size: clamp(19px,2.6vw,26px); font-weight: 900; margin-top: 3px; }
.aurora-assistant-full__close{
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ax-line);
  background: rgba(255,255,255,.04); color: #eadcae; font-size: 14px; cursor: pointer; line-height: 1;
}
.aurora-assistant-full__close:hover{ border-color: var(--ax-gold); }
.aurora-assistant-full__label{ color: var(--ax-gold-hi); font-size: 10.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; margin: 14px 0 8px; }
.aurora-assistant-full__row{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  background: rgba(255,255,255,.02); margin-bottom: 6px; font-size: 12px;
}
.aurora-assistant-full__row span{ color: var(--ax-muted); }
.aurora-assistant-full__row strong{ color: #eadcae; }

@media (prefers-reduced-motion: reduce){
  .aurora-announce, .aurora-assistant-full{ transition-duration: .01ms !important; }
}
