/**
 * Baeond Design System — Canonical CSS Architecture (Prototype v1.6.0)
 * Implements the 10-Work Graphic & UI Design Canon:
 * 1. Sovereign Posture & Chrome Budgeting (Cooper) — >= 85% Canvas, <= 15% persistent HUD chrome
 * 2. 3D Material Space & Dual Light Elevation Hierarchy (Material Design 1) — Tiers 0-7
 * 3. Liquid Glass Layer Separation & Specular Rim Lighting (Apple WWDC25) — Floating Functional Islands
 * 4. Anti-Glass-on-Glass Prohibition — Opaque Content Surfaces
 * 5. Direct Manipulation & 4-State Signifiers (Shneiderman & Norman) — Grab Lift & Drop Sockets
 * 6. Responsive Spring Physics (Apple WWDC18) — Fluid Interruptible Bezier Curves
 */

:root {
  /* ==========================================================================
     0. Canonical Obsidian Card Dimensions (Physical 330gsm Black Core Ratio)
     ========================================================================== */
  --card-w: 375px;
  --card-h: 525px;
  --card-radius: 12px;

  /* ==========================================================================
     1. Elevation Z-Index Tiers (Strict 8-Tier Hierarchy)
     ========================================================================== */
  --z-canvas: 0;
  --z-content-resting: 10;
  --z-content-hover: 20;
  --z-content-grabbed: 40;
  --z-functional-bar: 100;
  --z-functional-popover: 200;
  --z-functional-sheet: 300;
  --z-functional-modal: 400;

  /* ==========================================================================
     2. Dual Key + Ambient Light Elevation Shadows (Material Design 1)
     Key light: Directional cast shadow with Y offset
     Ambient light: Soft, omnidirectional 0-offset penumbra
     ========================================================================== */
  --shadow-z0: none;
  --shadow-z1: 0 1px 2px 0 rgba(0, 0, 0, 0.24), 0 0 1px 0 rgba(0, 0, 0, 0.16);
  --shadow-z2: 0 2px 5px 0 rgba(0, 0, 0, 0.26), 0 0 2px 0 rgba(0, 0, 0, 0.18);
  --shadow-z4: 0 4px 10px 0 rgba(0, 0, 0, 0.30), 0 1px 3px 0 rgba(0, 0, 0, 0.20);
  --shadow-z6: 0 6px 16px -1px rgba(0, 0, 0, 0.34), 0 2px 5px 0 rgba(0, 0, 0, 0.22);
  --shadow-z8: 0 10px 24px -2px rgba(0, 0, 0, 0.38), 0 3px 8px 0 rgba(0, 0, 0, 0.24);
  --shadow-z16: 0 18px 38px -4px rgba(0, 0, 0, 0.44), 0 6px 14px 0 rgba(0, 0, 0, 0.26);
  --shadow-z24: 0 26px 56px -6px rgba(0, 0, 0, 0.52), 0 10px 22px 0 rgba(0, 0, 0, 0.30);

  /* Highlight Shadows & Neon Emissive Halos */
  --glow-emerald: 0 0 18px rgba(74, 222, 128, 0.50);
  --glow-cyan: 0 0 18px rgba(56, 189, 248, 0.50);
  --glow-purple: 0 0 18px rgba(192, 132, 252, 0.50);
  --glow-gold: 0 0 18px rgba(255, 215, 106, 0.50);
  --glow-coral: 0 0 22px rgba(244, 63, 94, 0.55);

  /* ==========================================================================
     3. Fluid Spring Motion Timing Curves (Apple WWDC18)
     ========================================================================== */
  --spring-easing: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.18s var(--spring-easing);
  --transition-smooth: 0.28s var(--spring-easing);
  --transition-drawer: 0.32s var(--spring-easing);

  /* ==========================================================================
     4. Domain Color Palette & Tokens
     ========================================================================== */
  --color-cosmic-bg: #04060a;
  --color-board-slate: #0b0f19;
  --color-surface-card: #0f172a;
  --color-surface-elevated: #161e31;

  --color-aether-cyan: #38bdf8;
  --color-quelled-gold: #ffd76a;
  --color-waell-purple: #c084fc;
  --color-clash-coral: #f43f5e;
  --color-emerald-valid: #4ade80;

  --color-text-primary: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-border-subtle: rgba(255, 255, 255, 0.10);
  --color-border-glass: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   5. Liquid Glass Functional Layer (Apple WWDC25 Specular Rim)
   ========================================================================== */

.liquid-glass-surface {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.94) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  border: 1px solid var(--color-border-glass) !important;
  box-shadow:
    inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0.5px 0 rgba(255, 255, 255, 0.08),
    var(--shadow-z6) !important;
  color: var(--color-text-primary);
}

.liquid-glass-pill {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.94) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 9999px !important;
  box-shadow:
    inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.50),
    inset 0 -1px 0.5px 0 rgba(255, 255, 255, 0.10),
    var(--shadow-z4) !important;
}

.liquid-glass-dock {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(6, 10, 20, 0.92) 100%) !important;
  backdrop-filter: blur(24px) saturate(190%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) contrast(105%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 1.25rem !important;
  box-shadow:
    inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.35),
    var(--shadow-z8) !important;
}

/* ==========================================================================
   6. Anti-Glass-on-Glass Prohibition Rule (Mandatory Canon Law)
   Controls, buttons, cards, and text inside floating glass containers MUST NOT
   stack backdrop-filter on backdrop-filter to prevent muddy rendering.
   ========================================================================== */

.liquid-glass-surface button,
.liquid-glass-surface select,
.liquid-glass-surface input,
.liquid-glass-pill button,
.liquid-glass-pill select,
.liquid-glass-pill input,
.liquid-glass-dock button,
.liquid-glass-dock select,
.liquid-glass-dock input,
.top-bar button,
.top-bar select,
.bottom-bar button,
.content-surface,
.card-item,
.card-elem,
.hand-card,
.hand-card-el,
.card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ==========================================================================
   7. Sovereign Posture & Chrome Budgeting (Cooper)
   Primary viewport allocation: >= 85% Canvas, <= 15% persistent HUD chrome.
   The HUD floats as independent, unconstrained Liquid Glass islands across the
   periphery, leaving the center 3D battlefield canvas completely open.
   ========================================================================== */

/* Full-width container spanning the top with zero background or border */
.top-bar {
  position: fixed !important;
  top: 0.85rem !important;
  left: 1.25rem !important;
  right: 1.25rem !important;
  width: auto !important;
  max-width: none !important;
  min-height: auto !important;
  max-height: none !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
  z-index: var(--z-functional-bar) !important;
}

.top-bar>* {
  pointer-events: auto !important;
}

/* Island 1: Left Brand & Turn Initiative Indicator */
.top-left-cluster {
  display: flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.94) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 9999px !important;
  padding: 0.35rem 0.85rem !important;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.45),
    var(--shadow-z6) !important;
}

.brand-pill {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.brand-title {
  font-size: 0.92rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  color: var(--color-quelled-gold) !important;
  text-decoration: none !important;
}

.rules-tag {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: var(--color-text-muted) !important;
  background: rgba(255, 215, 106, 0.12) !important;
  border: 1px solid rgba(255, 215, 106, 0.30) !important;
  padding: 0.15rem 0.45rem !important;
  border-radius: 9999px !important;
}

.call-right-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding: 0.25rem 0.7rem !important;
  border-radius: 9999px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  background: rgba(255, 215, 106, 0.15) !important;
  border: 1.2px solid rgba(255, 215, 106, 0.50) !important;
  color: var(--color-quelled-gold) !important;
  box-shadow: 0 0 12px rgba(255, 215, 106, 0.30) !important;
  white-space: nowrap !important;
}

/* Island 2: Center Match Status & Phase */
.center-hud-bar {
  display: flex !important;
  align-items: center !important;
  gap: 1.25rem !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.94) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 9999px !important;
  padding: 0.4rem 1.4rem !important;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.45),
    var(--shadow-z6) !important;
}

.hud-stat {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
}

#hud-sealing-container {
  display: none !important;
}

#hud-sealing-container.active {
  display: flex !important;
}

.stat-label {
  color: var(--color-text-muted) !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.stat-value {
  color: var(--color-text-primary) !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
}

.stat-value.gold {
  color: var(--color-quelled-gold) !important;
}

/* Island 3: Right Opponent Info & System Utilities */
.top-right-cluster {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

/* Spacious, Un-Crushed Player Cards */
.player-card {
  display: flex !important;
  align-items: center !important;
  gap: 0.9rem !important;
  padding: 0.4rem 1rem !important;
  border-radius: 9999px !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.94) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.40),
    var(--shadow-z6) !important;
}

.player-card.p1 {
  border-color: rgba(56, 189, 248, 0.45) !important;
}

.p1-actions-dock {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-left: 0.5rem !important;
  padding-left: 0.75rem !important;
  border-left: 1px solid rgba(255, 255, 255, 0.16) !important;
}

.p1-actions-dock .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 9999px;
  white-space: nowrap;
}

.p1-actions-dock #btn-dynamic-cancel {
  display: none;
}

.p1-actions-dock #btn-commit-contest {
  padding: 0.32rem 0.95rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
}

.player-card.p2 {
  border-color: rgba(192, 132, 252, 0.45) !important;
}

.player-card.active-turn {
  border-color: #ffd76a !important;
  box-shadow: 0 0 16px rgba(255, 215, 106, 0.40) !important;
}

.player-name {
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: var(--color-text-primary) !important;
}

.player-quelled {
  font-size: 0.72rem !important;
  color: var(--color-quelled-gold) !important;
  font-weight: 700 !important;
}

.reward-meter-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.15rem !important;
}

.meter-label {
  font-size: 0.62rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--color-text-muted) !important;
}

.gem-pips-row {
  display: flex !important;
  gap: 0.3rem !important;
}

.gem-pip {
  width: 12px !important;
  height: 12px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.seal-pile-badge {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 0.15rem 0.5rem !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0.45rem !important;
}

.seal-count {
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: var(--color-text-primary) !important;
}

.seal-label {
  font-size: 0.58rem !important;
  text-transform: uppercase !important;
  color: var(--color-text-muted) !important;
}

/* Utility Pills in Top Right Island */
.top-utility-cluster {
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(6, 10, 20, 0.90) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 9999px !important;
  padding: 0.25rem 0.5rem !important;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.35),
    var(--shadow-z4) !important;
}

#hud-clock-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 215, 106, 0.35) !important;
  border-radius: 9999px !important;
  padding: 0.25rem 0.65rem !important;
  font-size: 0.72rem !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

/* Action Buttons in HUD */
.action-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--color-text-primary) !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  padding: 0.32rem 0.75rem !important;
  cursor: pointer !important;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  white-space: nowrap !important;
}

.action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: var(--shadow-z2) !important;
}

.action-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98) !important;
}

/* Prominent Primary Clash Button */
.action-btn.clash {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), var(--glow-coral) !important;
}

.action-btn.clash:hover:not(:disabled) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 25px rgba(244, 63, 94, 0.75) !important;
  transform: translateY(-2px) scale(1.03) !important;
}

/* ==========================================================================
   4b. Responsive Canon: Responsive Liquid Glass Stacking (Zero Data Loss)
   ========================================================================== */

/* Tablet & Intermediate Desktop Viewports (821px - 1180px): 2-Tier Stack */
@media (max-width: 1180px) and (min-width: 821px) {
  .top-bar {
    top: 0.5rem !important;
    left: 0.65rem !important;
    right: 0.65rem !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    gap: 0.35rem 0.65rem !important;
    align-items: center !important;
  }

  .top-right-cluster {
    display: contents !important;
  }

  /* Row 1: Left Brand & Turn Initiative | Right Lucien P2 */
  .top-left-cluster {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    padding: 0.3rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .player-card.p2 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    padding: 0.3rem 0.85rem !important;
    gap: 0.75rem !important;
  }

  /* Row 2: Left Match Telemetry | Right Utilities */
  .center-hud-bar {
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    padding: 0.3rem 1rem !important;
    gap: 0.85rem !important;
  }

  .top-utility-cluster {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    padding: 0.25rem 0.5rem !important;
    gap: 0.35rem !important;
  }
}

/* All Mobile & Narrow Viewports (max-width: 820px down to 320px): 3-Tier Clean Vertical Stack */
@media (max-width: 820px) {

  /* TOP BAR: 3-Tier Clean Vertical Stack (Never Closes or Clips!) */
  .top-bar {
    top: 0.35rem !important;
    left: 0.35rem !important;
    right: 0.35rem !important;
    width: auto !important;
    max-width: calc(100vw - 0.7rem) !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto auto !important;
    gap: 0.22rem !important;
  }

  .top-right-cluster {
    display: contents !important;
  }

  /* Tier 1: Left Identity & Priority | Right Opponent */
  .top-left-cluster {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    padding: 0.2rem 0.45rem !important;
    gap: 0.3rem !important;
    max-width: calc(62vw - 0.5rem) !important;
    overflow: hidden !important;
  }

  .brand-title {
    font-size: 0.74rem !important;
  }

  .rules-tag {
    font-size: 0.52rem !important;
    padding: 0.08rem 0.25rem !important;
  }

  .call-right-badge {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.38rem !important;
    max-width: 105px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .player-card.p2 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    padding: 0.2rem 0.45rem !important;
    gap: 0.35rem !important;
    max-width: calc(42vw - 0.5rem) !important;
  }

  .player-card.p2 .player-name {
    font-size: 0.7rem !important;
  }

  .player-card.p2 .player-quelled {
    font-size: 0.6rem !important;
  }

  .player-card.p2 .reward-meter-group {
    display: flex !important;
    gap: 0.08rem !important;
  }

  .player-card.p2 .meter-label {
    font-size: 0.5rem !important;
  }

  .player-card.p2 .gem-pip {
    width: 8px !important;
    height: 8px !important;
  }

  .player-card.p2 .seal-pile-badge {
    padding: 0.08rem 0.3rem !important;
  }

  .player-card.p2 .seal-count {
    font-size: 0.7rem !important;
  }

  .player-card.p2 .seal-label {
    font-size: 0.48rem !important;
  }

  /* Tier 2: Match Telemetry Chip Centered Spanning Full Width */
  .center-hud-bar {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    justify-self: center !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 0.2rem 0.65rem !important;
    gap: 0.55rem !important;
    justify-content: center !important;
  }

  .hud-stat {
    gap: 0.25rem !important;
  }

  .stat-label {
    font-size: 0.52rem !important;
  }

  .stat-value {
    font-size: 0.72rem !important;
  }

  /* Tier 3: Utility Controls Dock Centered Spanning Full Width */
  .top-utility-cluster {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    justify-self: center !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 0.18rem 0.4rem !important;
    gap: 0.22rem !important;
    justify-content: center !important;
  }

  .top-utility-cluster .action-btn {
    padding: 0.2rem 0.42rem !important;
    font-size: 0.66rem !important;
    min-height: 26px !important;
  }

  #hud-clock-pill {
    padding: 0.2rem 0.42rem !important;
    font-size: 0.66rem !important;
    min-height: 26px !important;
  }

  /* BOTTOM BAR: Stacked Player Status + Full Un-clipped Controls */
  .bottom-bar {
    position: fixed !important;
    bottom: 0.35rem !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: calc(100vw - 0.7rem) !important;
    gap: 0.25rem !important;
  }

  .bottom-controls-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0.25rem !important;
  }

  /* Tier B1: P1 Player Status Pill Centered */
  .player-card.p1 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.2rem 0.6rem !important;
    gap: 0.55rem !important;
    border-radius: 9999px !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .player-card.p1 .player-name {
    font-size: 0.7rem !important;
  }

  .player-card.p1 .player-quelled {
    font-size: 0.6rem !important;
  }

  .player-card.p1 .reward-meter-group {
    display: flex !important;
    gap: 0.08rem !important;
  }

  .player-card.p1 .meter-label {
    font-size: 0.5rem !important;
  }

  .player-card.p1 .gem-pip {
    width: 8px !important;
    height: 8px !important;
  }

  .player-card.p1 .seal-pile-badge {
    padding: 0.08rem 0.3rem !important;
  }

  .player-card.p1 .seal-count {
    font-size: 0.7rem !important;
  }

  .player-card.p1 .seal-label {
    font-size: 0.48rem !important;
  }

  /* Tier B2: P1 Integrated Action Dock (100% Visible, Never Clipped) */
  .p1-actions-dock {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    margin-left: 0.35rem !important;
    padding-left: 0.45rem !important;
    border-left: 1px solid rgba(255, 255, 255, 0.16) !important;
  }

  .p1-actions-dock .action-btn {
    padding: 0.2rem 0.55rem !important;
    font-size: 0.68rem !important;
    min-height: 26px !important;
    white-space: nowrap !important;
  }

  .p1-actions-dock #btn-commit-contest {
    padding: 0.22rem 0.75rem !important;
    font-weight: 800 !important;
  }

  /* Tier B3: Hand Dock */
  .hand-dock {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.25rem 0.45rem !important;
    gap: 0.4rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 108px !important;
  }

  /* Drawers */
  #jev-inspector-drawer,
  #playtest-tools-drawer,
  #chat-drawer {
    top: 5.6rem !important;
    max-height: calc(100vh - 13.5rem) !important;
  }
}

/* Ultra-Narrow Viewports (max-width: 480px down to 320px): Maximum Touch Fit */
@media (max-width: 480px) {
  .top-left-cluster {
    padding: 0.16rem 0.35rem !important;
    gap: 0.22rem !important;
    max-width: calc(58vw - 0.4rem) !important;
  }

  .brand-title {
    font-size: 0.68rem !important;
  }

  .call-right-badge {
    max-width: 88px !important;
    font-size: 0.55rem !important;
    padding: 0.1rem 0.3rem !important;
  }

  .player-card.p2 {
    padding: 0.16rem 0.35rem !important;
    gap: 0.25rem !important;
    max-width: calc(45vw - 0.4rem) !important;
  }

  .player-card.p2 .player-name {
    font-size: 0.64rem !important;
  }

  .player-card.p2 .player-quelled {
    font-size: 0.55rem !important;
  }

  .center-hud-bar {
    padding: 0.16rem 0.5rem !important;
    gap: 0.4rem !important;
  }

  .stat-label {
    font-size: 0.48rem !important;
  }

  .stat-value {
    font-size: 0.68rem !important;
  }

  .top-utility-cluster {
    padding: 0.15rem 0.3rem !important;
    gap: 0.18rem !important;
  }

  .top-utility-cluster .action-btn,
  #hud-clock-pill {
    padding: 0.16rem 0.32rem !important;
    font-size: 0.6rem !important;
    min-height: 24px !important;
  }

  .player-card.p1 {
    padding: 0.16rem 0.4rem !important;
    gap: 0.25rem !important;
  }

  .p1-actions-dock {
    gap: 0.25rem !important;
    margin-left: 0.2rem !important;
    padding-left: 0.3rem !important;
  }

  .p1-actions-dock .action-btn {
    padding: 0.16rem 0.42rem !important;
    font-size: 0.62rem !important;
    min-height: 24px !important;
  }

  #jev-inspector-drawer,
  #playtest-tools-drawer,
  #chat-drawer {
    top: 6.2rem !important;
    max-height: calc(100vh - 14.5rem) !important;
  }
}

/* ==========================================================================
   8. Bottom Bar & Floating Action Controls
   ========================================================================== */

.bottom-bar {
  position: fixed !important;
  bottom: 0.85rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  max-width: 98vw !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.5rem !important;
  z-index: var(--z-functional-bar) !important;
  pointer-events: none !important;
}

.bottom-bar>* {
  pointer-events: auto !important;
}

.main-controls {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.94) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(105%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: 9999px !important;
  box-shadow:
    inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.40),
    var(--shadow-z6) !important;
}

/* ==========================================================================
   9. Direct Manipulation & Hand Cards (Content Layer)
   ========================================================================== */

.hand-dock {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.65rem !important;
  padding: 0.45rem 1rem !important;
  background: linear-gradient(180deg, rgba(10, 15, 26, 0.80) 0%, rgba(4, 6, 12, 0.90) 100%) !important;
  backdrop-filter: blur(22px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 1.25rem !important;
  box-shadow:
    inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.35),
    var(--shadow-z8) !important;
  overflow-x: auto !important;
  max-width: 96vw !important;
}

/* Hand Card Elements (Strictly Opaque Matte Content Surfaces) */
.hand-card,
.card-item,
.card-elem,
.hand-card-el {
  background: #0f172a !important;
  border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 0.65rem !important;
  box-shadow: var(--shadow-z2) !important;
  cursor: grab !important;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast) !important;
  z-index: var(--z-content-resting) !important;
  user-select: none !important;
}

.hand-card:hover,
.card-item:hover,
.card-elem:hover,
.hand-card-el:hover {
  transform: translateY(-8px) scale(1.03) !important;
  box-shadow: var(--shadow-z4), 0 0 14px rgba(56, 189, 248, 0.4) !important;
  border-color: rgba(56, 189, 248, 0.8) !important;
  z-index: var(--z-content-hover) !important;
}

.hand-card.is-grabbed,
.card-item.is-grabbed,
.card-elem.is-grabbed,
.hand-card-el.is-grabbed {
  transform: translateY(-18px) scale(1.08) !important;
  box-shadow: var(--shadow-z8), 0 0 24px rgba(56, 189, 248, 0.65) !important;
  cursor: grabbing !important;
  z-index: var(--z-content-grabbed) !important;
}

/* Pre-emptive Drop Sockets */
@keyframes pulseDropSocket {
  0% {
    outline-color: rgba(74, 222, 128, 0.55);
    background-color: rgba(74, 222, 128, 0.08);
  }

  100% {
    outline-color: rgba(74, 222, 128, 0.95);
    background-color: rgba(74, 222, 128, 0.22);
  }
}

.drop-socket-valid {
  outline: 2px dashed rgba(74, 222, 128, 0.85) !important;
  outline-offset: -2px;
  animation: pulseDropSocket 1.1s ease-in-out infinite alternate !important;
}

.drop-socket-hover {
  outline: 2.5px solid #4ade80 !important;
  outline-offset: -1px;
  background-color: rgba(74, 222, 128, 0.35) !important;
  box-shadow: var(--glow-emerald) !important;
}

/* ==========================================================================
   10. Tier 6 Drawers & Sheets (Spring Physics)
   ========================================================================== */

#jev-inspector-drawer,
#playtest-tools-drawer,
#zone-inspector-drawer,
#play-by-play-drawer,
#chat-drawer {
  z-index: var(--z-functional-sheet) !important;
  box-shadow: var(--shadow-z16) !important;
  transition: transform var(--transition-drawer), opacity var(--transition-drawer) !important;
}

.jev-drawer-header,
.inspector-header,
.pt-drawer-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
  border-bottom: 1px solid var(--color-border-glass) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

/* Tier 7 Modals */
#game-over-modal,
#modal-multiplayer-lobby {
  z-index: var(--z-functional-modal) !important;
}

#game-over-card-box {
  box-shadow: var(--shadow-z24), 0 0 50px rgba(255, 215, 106, 0.35) !important;
  transition: transform var(--transition-smooth) !important;
}

/* ==========================================================================
   11. JEV Replay Controller & Navigation Dock Tokens
   ========================================================================== */

#replay-control-dock {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.94) 100%) !important;
  backdrop-filter: blur(24px) saturate(190%) contrast(105%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) contrast(105%) !important;
  border: 1px solid rgba(192, 132, 252, 0.40) !important;
  box-shadow:
    inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.40),
    inset 0 -1px 0.5px 0 rgba(255, 255, 255, 0.08),
    var(--shadow-z8),
    0 0 25px rgba(168, 85, 247, 0.20) !important;
  border-radius: 1.15rem !important;
  z-index: var(--z-functional-bar) !important;
}

.replay-nav-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--color-text-primary) !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast) !important;
  backdrop-filter: none !important;
}

.replay-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: var(--shadow-z2) !important;
}

.replay-nav-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98) !important;
}

.replay-nav-btn.primary {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), var(--glow-purple) !important;
}

#btn-expand-jev-drawer {
  z-index: var(--z-functional-sheet) !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.90) 0%, rgba(10, 14, 26, 0.95) 100%) !important;
  backdrop-filter: blur(18px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
  border: 1px solid rgba(192, 132, 252, 0.50) !important;
  border-radius: 9999px !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.3), var(--shadow-z4), var(--glow-purple) !important;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast) !important;
}

#btn-expand-jev-drawer:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.4), var(--shadow-z6), 0 0 25px rgba(192, 132, 252, 0.55) !important;
}


/* ==========================================================================
   12. Canonical Card Frame v0.8 & MTG Arena Bottom Hand Fan
   ========================================================================== */

#hand-dock-container.hand-dock {
  position: relative !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 0 !important;
  padding: 0 0.5rem !important;
  height: var(--dock-height, 160px) !important;
  min-height: var(--dock-height, 160px) !important;
  overflow: visible !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
  z-index: 100 !important;
}

.hand-card-el.obsidian-card {
  pointer-events: auto !important;
  width: 375px !important;
  min-width: 375px !important;
  max-width: 375px !important;
  height: 525px !important;
  min-height: 525px !important;
  max-height: 525px !important;
  box-sizing: border-box !important;
  margin: 0 var(--card-margin, -76px) !important;
  transform-origin: bottom center !important;
  transform: translateY(calc(var(--card-resting-y, 140px) + var(--fan-arch-y, 0px))) rotate(var(--fan-angle, 0deg)) scale(var(--card-scale, 0.45)) !important;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
  cursor: grab !important;
  touch-action: none !important;
  flex-shrink: 0 !important;
  user-select: none !important;
}

/* Ensure all internal nodes inside hand cards are inert to pointer hit testing, BUT explicitly allow ability seals to receive hover */
.hand-card-el.obsidian-card * {
  pointer-events: none;
}

.hand-card-el.obsidian-card .glass-ability-seal,
.glass-ability-seal {
  pointer-events: auto !important;
  cursor: help !important;
}

/* Invisible bottom hit bridge so cursor never drops below the card during elevation */
.hand-card-el.obsidian-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -10px;
  right: -10px;
  bottom: -60px;
  pointer-events: auto !important;
  z-index: -1;
}

/* On Hover or Touch Focus: ENLARGE ENOUGH TO READ! */
.hand-card-el.obsidian-card:hover,
.hand-card-el.obsidian-card.is-hovered,
.hand-card-el.obsidian-card.is-focused {
  transform: translateY(var(--card-hover-y, -25px)) rotate(0deg) scale(var(--card-hover-scale, 1.02)) !important;
  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.98),
    0 0 35px var(--strain-glow, rgba(255, 255, 255, 0.45)) !important;
  border-color: var(--strain-secondary, #38bdf8) !important;
  z-index: 500 !important;
}

.hand-card-el.obsidian-card.buffering-selected {
  transform: translateY(calc(var(--card-resting-y, 140px) - 25px + var(--fan-arch-y, 0px))) rotate(var(--fan-angle, 0deg)) scale(calc(var(--card-scale, 0.45) * 1.08)) !important;
  border-color: #ffd76a !important;
  box-shadow: 0 0 28px rgba(255, 215, 106, 0.85) !important;
}

.hand-card-el.obsidian-card.buffering-selected:hover,
.hand-card-el.obsidian-card.buffering-selected.is-hovered,
.hand-card-el.obsidian-card.buffering-selected.is-focused {
  transform: translateY(var(--card-hover-y, -25px)) rotate(0deg) scale(var(--card-hover-scale, 1.02)) !important;
}

.hand-card-el.obsidian-card.is-grabbed,
.hand-card-el.obsidian-card.dragging {
  transform: translateY(var(--card-hover-y, -35px)) rotate(0deg) scale(calc(var(--card-hover-scale, 1.02) * 1.04)) !important;
  cursor: grabbing !important;
  z-index: 600 !important;
}

@media (max-width: 820px) {
  #hand-dock-container.hand-dock {
    height: var(--dock-height, 95px) !important;
    min-height: var(--dock-height, 95px) !important;
    padding: 0 0.25rem !important;
    overflow: visible !important;
  }
}

/* =====================================================================
     CANONICAL PHYSICAL CARD CHASSIS (Black Cardstock Margin)
     ===================================================================== */
.obsidian-card {
  width: var(--card-w, 375px);
  height: var(--card-h, 525px);
  background: #000000;
  /* Pure 330gsm German Black Core Base */
  border-radius: var(--card-radius, 12px);
  padding: 9px;
  /* Standard 9px Black Cardstock Margin */
  box-sizing: border-box;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.98),
    0 0 0 1px rgba(0, 0, 0, 0.9),
    inset 0 1px 1px rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  overflow: hidden;
}

.obsidian-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow:
    0 32px 65px -10px rgba(0, 0, 0, 1),
    0 0 25px var(--strain-glow, rgba(255, 255, 255, 0.25));
}

/* Specular Glare (Physical Spot UV Reflection) */
.specular-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
      transparent 20%,
      rgba(255, 255, 255, 0.08) 45%,
      rgba(255, 255, 255, 0.25) 50%,
      rgba(255, 255, 255, 0.08) 55%,
      transparent 80%);
  opacity: 0.65;
  pointer-events: none;
  mix-blend-mode: overlay;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 50;
}

.obsidian-card:hover .specular-glare {
  opacity: 1;
  transform: translateY(-5px);
}

/* Internal Card Chassis Plate with Texture Canvas */
.chassis-plate {
  flex-grow: 1;
  border-radius: 7px;
  background: #090c12;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* High-Resolution Procedural Texture Canvas */
.texture-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Inlaid Shading & Outer Accent Rim */
.chassis-rim-accent {
  position: absolute;
  inset: 2px;
  border: 1.5px solid var(--strain-primary);
  border-radius: 5px;
  opacity: 0.7;
  pointer-events: none;
  box-shadow: inset 0 0 8px var(--strain-glow);
  z-index: 2;
}

/* =====================================================================
     1. SCULPTED NAME BANNER (NOW HOUSING TYPELINE AS SUBLINE)
     ===================================================================== */
.liquid-name-banner {
  height: 52px;
  /* Translucent smoked glass allows mineral texture to poke through! */
  background: linear-gradient(180deg, rgba(14, 18, 28, 0.58) 0%, rgba(6, 9, 15, 0.72) 100%);
  backdrop-filter: blur(2px);
  border-bottom: 2px solid rgba(0, 0, 0, 0.8);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  padding: 0 10px 0 0;
  position: relative;
  z-index: 10;
}

/* Interlocking Cartouche (Primary Potential Coin + Conjoined Strained Notch) */
.cartouche-cluster {
  display: flex;
  align-items: center;
  position: relative;
  margin-left: -2px;
  margin-right: 8px;
  z-index: 15;
}

.primary-potential-coin {
  width: 46px;
  height: 52px;
  background: radial-gradient(circle at 35% 30%, #2a3446 0%, #101520 70%, #05080d 100%);
  border: 2px solid var(--strain-primary);
  border-left: none;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow:
    3px 3px 8px rgba(0, 0, 0, 0.9),
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    0 0 12px var(--strain-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.potential-num {
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 8px var(--strain-foil);
}

.glass-strained-badge {
  background: rgba(185, 28, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.2px solid rgba(248, 113, 113, 0.85);
  border-radius: 6px;
  padding: 3px 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.75),
    0 0 10px rgba(239, 68, 68, 0.65),
    inset 0 1px 1px rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  animation: pulse-strained-glow 2.5s infinite alternate ease-in-out;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.glass-strained-badge:hover {
  transform: scale(1.08);
  border-color: #ffffff;
}

.banner-titles {
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 4px;
  gap: 1px;
}

.card-name-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 3.2vw, 1.05rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.card-subline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* =====================================================================
     2. INSET ARTWORK MAT (LOCKED INVARIANT 172px HEIGHT)
     ===================================================================== */
.artwork-window-frame {
  height: 255px;
  /* Canonical 4:3 Aspect Ratio (300px width x 225px height) */
  min-height: 255px;
  max-height: 255px;
  flex-shrink: 0;
  position: relative;
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid #000000;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
  z-index: 5;
}

.art-inner-mat-bevel {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

/* Illustrator Watermark on the Actual Art (Subtle Lower-Left Watermark) */
.art-illustrator-watermark {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.06em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  z-index: 8;
}

/* Clear Liquid Glass Ability Seals (No color, icons only!) */
.stamped-modifier-stack {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  z-index: 10;
  pointer-events: auto;
}

.glass-ability-seal {
  background: rgba(10, 14, 22, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 3px 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.65),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  cursor: help;
  pointer-events: auto;
  user-select: none;
}

.glass-strained-seal {
  background: rgba(185, 28, 28, 0.45);
  border-color: rgba(248, 113, 113, 0.75);
  color: #fecaca;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.7),
    0 0 10px rgba(239, 68, 68, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  animation: pulse-strained-glow 2.5s infinite alternate ease-in-out;
}

@keyframes pulse-strained-glow {
  0% {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7), 0 0 6px rgba(239, 68, 68, 0.5);
  }

  100% {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7), 0 0 12px rgba(239, 68, 68, 0.9);
  }
}

.glass-ability-seal:hover {
  transform: scale(1.18);
  border-color: #ffd76a;
  background: rgba(15, 23, 42, 0.88);
  box-shadow:
    0 5px 15px rgba(0, 0, 0, 0.85),
    0 0 14px rgba(255, 215, 106, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
  z-index: 20;
}

/* =====================================================================
     3. FLOATING DIAMOND WAELLS (FRONT LAYER z-index: 25, 22px, NO NUMBERS)
     ===================================================================== */
.floating-art-waells {
  position: absolute;
  bottom: -11px;
  /* Spills upward into art, overlaps plate boundary */
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 25;
  /* Brought to the absolute front layer so never cut by text box! */
}

.diamond-socket {
  width: 22px;
  /* Bigger physical diamond! */
  height: 22px;
  transform: rotate(45deg);
  background: #06090e;
  border: 1.8px solid #475569;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.95),
    inset 0 1px 2px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.diamond-socket.charged {
  border-color: #06b6d4;
  background: radial-gradient(circle at 35% 35%, #06b6d4 0%, #0e7490 100%);
  box-shadow: 0 0 12px #06b6d4, inset 0 1px 2px #a5f3fc;
}

/* =====================================================================
     4. TACTILE INSET TEXT PLATE (NO CLIPPING, DYNAMIC RESIZING)
     ===================================================================== */
.obsidian-rules-plate {
  flex-grow: 1;
  background: linear-gradient(180deg, rgba(10, 13, 20, 0.72) 0%, rgba(6, 8, 12, 0.82) 100%);
  backdrop-filter: blur(2px);
  margin: 6px 8px 6px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 12px 12px 10px 24px;
  /* Generous left padding to clear vertical influence pillar */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 5;
  min-height: 0;
  /* Prevents overflow clip */
}

.rules-prose {
  font-family: 'Spectral', serif;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #e2e8f0;
}

.rules-prose strong {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: #ffd76a;
  font-size: 0.8rem;
}

.rules-prose .kw {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: #38bdf8;
  font-size: 0.8rem;
}

/* Inline Text Box Waell Activator Diamond Badges */
.waell-activator-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(6, 182, 212, 0.22);
  border: 1px solid #06b6d4;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 4px;
  vertical-align: middle;
}

.waell-activator-diamond {
  display: inline-block;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: #06b6d4;
  box-shadow: 0 0 5px #06b6d4;
}

.flavor-quote-box {
  font-family: 'Spectral', serif;
  font-style: italic;
  font-size: 0.72rem;
  line-height: 1.32;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 4px;
  margin-top: 4px;
}

/* =====================================================================
     5. BOTTOM METADATA STRIP (CENTERED COLLECTOR NUMBER, NO VERSION)
     ===================================================================== */
.bottom-metadata-strip {
  height: 26px;
  background: rgba(5, 7, 10, 0.65);
  backdrop-filter: blur(2px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 10px 0 38px;
  /* Offset to clear the bottom-left Aether icon */
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #64748b;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.rarity-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rarity-gem {
  display: inline-block;
  width: 6.5px;
  height: 6.5px;
  border-radius: 1px;
  vertical-align: middle;
}

.rarity-rare {
  background: #ffd76a;
  box-shadow: 0 0 6px #ffd76a;
}

.rarity-uncommon {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.collector-number-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

/* =====================================================================
     6. BOTTOM-LEFT AETHER ICON & ASCENDING VERTICAL INFLUENCE PIPS
     ===================================================================== */
.aether-influence-pillar {
  position: absolute;
  bottom: 5px;
  left: 8px;
  display: flex;
  flex-direction: column-reverse;
  /* Aether icon at bottom, pips climb vertically upward */
  align-items: center;
  gap: 4px;
  z-index: 30;
}

/* Corner Aether / Strain Medallion */
.strain-crest-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1c2333 0%, #090c12 100%);
  border: 1.5px solid var(--strain-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.9),
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 0 10px var(--strain-glow);
  flex-shrink: 0;
  overflow: hidden;
  padding: 3.5px;
}

.strain-crest-badge svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 3px var(--strain-glow));
  display: block;
}

/* Vertical Influence Pips Track ascending from Aether icon */
.vertical-influence-track {
  display: flex;
  flex-direction: column-reverse;
  /* Pips 1 to 5 rise upward */
  align-items: center;
  gap: 3.5px;
  padding: 4px 3px;
  background: rgba(10, 14, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.pip-node {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
}

.pip-node.filled {
  background: var(--strain-primary, #38bdf8);
  border-color: #ffffff;
  box-shadow: 0 0 6px var(--strain-primary, #38bdf8), inset 0 1px 1px #ffffff;
}

/* =====================================================================
     STRAIN COLOR BINDINGS (Calibrated: Næther = Almost-Black Accent)
     ===================================================================== */
.obsidian-card.neutral {
  --strain-primary: #94a3b8;
  --strain-glow: rgba(148, 163, 184, 0.7);
  --strain-foil: #f1f5f9;
}

.obsidian-card.naether {
  --strain-primary: #334155;
  /* Almost-Black Accent */
  --strain-glow: rgba(30, 41, 59, 0.9);
  --strain-foil: #64748b;
}

.obsidian-card.mysc {
  --strain-primary: #10b981;
  --strain-glow: rgba(16, 185, 129, 0.8);
  --strain-foil: #34d399;
}

.obsidian-card.oorth {
  --strain-primary: #06b6d4;
  --strain-glow: rgba(6, 182, 212, 0.8);
  --strain-foil: #67e8f9;
}

.obsidian-card.quant {
  --strain-primary: #a855f7;
  --strain-glow: rgba(168, 85, 247, 0.8);
  --strain-foil: #c084fc;
}

.obsidian-card.spark {
  --strain-primary: #ef4444;
  /* Pure Red */
  --strain-glow: rgba(239, 68, 68, 0.85);
  --strain-foil: #fca5a5;
}

.obsidian-card.lux {
  --strain-primary: #eab308;
  --strain-glow: rgba(234, 179, 8, 0.8);
  --strain-foil: #fef08a;
}

.obsidian-card.prax {
  --strain-primary: #ec4899;
  /* Vibrant Pink */
  --strain-glow: rgba(236, 72, 153, 0.85);
  --strain-foil: #f472b6;
}

/* =====================================================================
   BATTLEFIELD & RIFT CARD ZOOM OVERLAY (Properly Oriented & Upright)
   ===================================================================== */
#battlefield-card-zoom-overlay {
  position: fixed;
  z-index: 850;
  pointer-events: auto;
  /* Enables hovering modifier seals & inspecting card text */
  display: none;
  flex-direction: column;
  align-items: center;
  transform-origin: top left;
  transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 25px 60px rgba(0, 0, 0, 0.98)) drop-shadow(0 0 30px rgba(255, 215, 106, 0.35));
}

#tooltip-popup {
  position: fixed !important;
  z-index: 99999 !important;
  pointer-events: none !important;
}

#zoom-card-frame-host {
  width: 375px;
  height: 525px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

#zoom-card-frame-host .obsidian-card {
  width: 375px !important;
  min-width: 375px !important;
  max-width: 375px !important;
  height: 525px !important;
  min-height: 525px !important;
  max-height: 525px !important;
  margin: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.95), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
}

#zoom-card-telemetry {
  width: 375px !important;
  min-width: 375px !important;
  max-width: 375px !important;
  margin-top: 8px;
  box-sizing: border-box;
  background: rgba(9, 14, 26, 0.96);
  border: 1.5px solid rgba(255, 215, 106, 0.5);
  border-radius: 10px;
  padding: 8px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #cbd5e1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  flex-shrink: 0;
}


/* ==========================================================================
   13. Compact Horizontal Phase Timeline (Floating Directly Beneath Top Bar)
   ========================================================================== */
#top-phase-timeline {
  position: fixed !important;
  top: calc(2rem + 56px + 10px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  z-index: 125 !important;
  background: rgba(15, 23, 42, 0.82) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 9999px !important;
  padding: 0.25rem 0.85rem !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0.5px rgba(255, 255, 255, 0.3) !important;
  pointer-events: auto !important;
}

@media (min-width: 800px) {
  #top-phase-timeline {
    top: calc(2.5rem + 56px + 12px) !important;
  }
}

.phase-timeline-track {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.4rem !important;
}

.phase-node {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.25rem !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  opacity: 0.55 !important;
}

.phase-node:hover {
  opacity: 0.9 !important;
  transform: translateY(-1px) scale(1.04) !important;
}

.phase-node.active {
  opacity: 1 !important;
  transform: scale(1.05) !important;
}

.phase-node.completed {
  opacity: 0.8 !important;
}

.phase-node-indicator {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.25s ease !important;
}

.phase-node.active .phase-node-indicator {
  background: radial-gradient(circle at 35% 30%, rgba(255, 215, 106, 0.35) 0%, rgba(230, 168, 23, 0.15) 100%) !important;
  border: 1.5px solid #ffd76a !important;
  box-shadow: 0 0 12px rgba(255, 215, 106, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

.phase-node.completed .phase-node-indicator {
  background: rgba(56, 189, 248, 0.15) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3) !important;
}

.phase-node-glyph {
  font-size: 0.65rem !important;
  line-height: 1 !important;
}

.phase-node-label {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.48rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  color: var(--color-text-muted) !important;
  text-transform: uppercase !important;
}

.phase-node.active .phase-node-label {
  color: #ffd76a !important;
  font-weight: 800 !important;
  text-shadow: 0 0 6px rgba(255, 215, 106, 0.4) !important;
}

.phase-node.completed .phase-node-label {
  color: #38bdf8 !important;
}

.phase-connector {
  width: 14px !important;
  height: 2px !important;
  background: rgba(255, 255, 255, 0.14) !important;
  border-radius: 9999px !important;
  transition: all 0.3s ease !important;
}

.phase-connector.filled {
  background: linear-gradient(90deg, #38bdf8, #ffd76a) !important;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.6) !important;
}

/* ==========================================================================
   14. Floating Opponent (P2) Status Capsule (Near 3D Avatar on the Board)
   ========================================================================== */
#p2-player-card.player-card.p2 {
  position: fixed !important;
  z-index: 90 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.35rem 0.95rem !important;
  border-radius: 9999px !important;
  background: linear-gradient(135deg, rgba(23, 11, 34, 0.92) 0%, rgba(10, 6, 20, 0.96) 100%) !important;
  border: 1px solid rgba(192, 132, 252, 0.55) !important;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(168, 85, 247, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  pointer-events: auto !important;
  transition: left 0.1s ease-out, top 0.1s ease-out !important;
}


/* ==========================================================================
   11. Decision Trees Architecture & Dynamic Action Controls (Prototype v1.8)
   Canonical Tokens: Liquid Glass Modal, Specular Rim, Zone Picker Tray, Dynamic Button
   ========================================================================== */

/* --------------------------------------------------------------------------
   A. Liquid Glass "Choose One" Modal (#modal-choose-one)
   -------------------------------------------------------------------------- */
.decision-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(4, 6, 10, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: auto;
  user-select: none;
  animation: modalFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.decision-modal-container {
  width: min(94vw, 680px);
  background: rgba(14, 20, 36, 0.88);
  border: 1px solid rgba(255, 215, 106, 0.35);
  border-radius: 20px;
  padding: 2rem;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 40px rgba(230, 168, 23, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.decision-modal-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
  align-items: center;
}

.decision-modal-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffd76a;
  background: rgba(255, 215, 106, 0.15);
  border: 1px solid rgba(255, 215, 106, 0.4);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.decision-modal-title {
  font-family: 'Cinzel', 'Space Grotesk', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.decision-modal-prompt {
  font-size: 0.88rem;
  color: #94a3b8;
  margin: 0;
  max-width: 520px;
  line-height: 1.4;
}

.decision-options-grid {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  align-items: stretch;
  justify-content: center;
}

.decision-option-tile {
  flex: 1;
  min-height: 200px;
  background: rgba(22, 32, 54, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}

.decision-option-tile:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: #ffd76a;
  background: rgba(30, 44, 76, 0.85);
  box-shadow:
    0 12px 30px rgba(255, 215, 106, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.decision-option-tile:active {
  transform: translateY(0) scale(0.99);
}

.decision-option-glyph {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.decision-option-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.35rem;
}

.decision-option-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.decision-option-subreq {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.decision-modal-footer {
  display: flex;
  justify-content: center;
}

.decision-cancel-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #94a3b8;
  padding: 0.45rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.decision-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   B. Unified Translucent Glass Zone Card Selection Tray (#drawer-card-picker)
   -------------------------------------------------------------------------- */
.zone-picker-tray {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 450;
  width: min(92vw, 980px);
  padding: 1.25rem 1.75rem;
  border-radius: 24px;
  background: rgba(10, 16, 28, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: auto;
  user-select: none;
  animation: traySlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes traySlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.zone-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zone-picker-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zone-picker-glyph {
  font-size: 1.15rem;
}

.zone-picker-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.02em;
}

.zone-picker-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.15rem 0.65rem;
  border-radius: 9999px;
}

.zone-picker-cards-scroll {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.75rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.zone-picker-card-item {
  width: 120px;
  height: 168px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #0f172a;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  overflow: hidden;
}

.zone-picker-card-item.is-viable {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.zone-picker-card-item.is-viable:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: #38bdf8;
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.4);
}

.zone-picker-card-item.is-selected {
  transform: translateY(-10px) scale(1.06);
  border-color: #ffd76a !important;
  box-shadow: 0 12px 28px rgba(255, 215, 106, 0.5) !important;
}

.zone-picker-card-item.is-non-viable {
  opacity: 0.32;
  filter: grayscale(80%);
  pointer-events: none;
  cursor: not-allowed;
}

.zone-picker-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   C. In-Pill Dynamic Action Button Context Themes
   -------------------------------------------------------------------------- */
.action-btn.canon-btn-clash {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* State: Targeting */
.action-btn.canon-btn-clash.state-targeting {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.6) !important;
  animation: pulseCyan 1.5s infinite ease-in-out;
}

/* State: Seal Pick */
.action-btn.canon-btn-clash.state-seal-pick {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  border-color: #ffd76a !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(255, 215, 106, 0.7) !important;
  animation: pulseGold 1.4s infinite ease-in-out;
}

/* State: Stepping Contest */
.action-btn.canon-btn-clash.state-stepping {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border-color: #fde047 !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.6) !important;
}

/* State: Warning / Mandatory Action */
.action-btn.canon-btn-clash.state-warning {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6) !important;
}

@keyframes pulseCyan {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
  }

  50% {
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.85);
  }
}

@keyframes pulseGold {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(255, 215, 106, 0.5);
  }

  50% {
    box-shadow: 0 0 24px rgba(255, 215, 106, 0.9);
  }
}

/* ============================================================================
   Sub-Header Turn Phase Tracker (Prototype v1.8 - Compact Floating Capsule)
   ============================================================================ */
.sub-header-timeline {
  position: static !important;
  margin: 6px auto 0 auto !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 4px 16px !important;
  background: rgba(10, 15, 26, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 9999px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.15) !important;
  z-index: 105 !important;
  pointer-events: auto !important;
  user-select: none !important;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

.phase-pill:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
}

.phase-pill.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.phase-pill.completed {
  color: #94a3b8;
  opacity: 0.75;
}

.phase-sep {
  color: #334155;
  font-size: 0.65rem;
  font-weight: 700;
  user-select: none;
}

.phase-sep.filled {
  color: #38bdf8;
}


/* ============================================================================
   15. Viewport Edge Card Decks (Prototype v1.8)
   Cards positioned directly along the viewport rails in 2D UI space
   ============================================================================ */
.card-well-rail {
  display: none !important;
}

#p1-card-wells {
  left: 1.25rem !important;
  bottom: 2rem !important;
}

#p2-card-wells {
  right: 1.25rem !important;
  top: 7.5rem !important;
}

.card-well {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.card-well:hover {
  transform: scale(1.06) !important;
}

.deck-top-card {
  position: relative !important;
  width: 58px !important;
  height: 84px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 10px rgba(56, 189, 248, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: #070b14 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.deck-card-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.deck-badge {
  position: absolute !important;
  bottom: 4px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(10, 15, 26, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 9999px !important;
  padding: 1px 6px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.55rem !important;
  font-weight: 700 !important;
  color: #e2e8f0 !important;
  white-space: nowrap !important;
  letter-spacing: 0.04em !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7) !important;
}

.deck-badge b {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

#p2-card-wells .deck-badge b {
  color: #f43f5e !important;
}

.card-well.is-empty {
  opacity: 0.4 !important;
}

.well-empty-placeholder {
  display: none !important;
}

.well-tooltip {
  display: none !important;
}

/* Cancel Button Dynamic Visibility */
.p1-actions-dock .action-btn.is-hidden,
.action-btn.is-hidden {
  display: none !important;
}

/* ============================================================================
   Top Navigation Bar (Exact Placement & Liquid Glass Capsule Treatment)
   ============================================================================ */
.patrons-nav-wrapper.prototype-patrons-nav,
header.prototype-patrons-nav {
  position: fixed !important;
  top: 2rem !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 1376px !important;
  margin: 0 auto !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
  box-sizing: border-box !important;
  z-index: 100 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  pointer-events: none !important;
}

@media (min-width: 800px) {

  .patrons-nav-wrapper.prototype-patrons-nav,
  header.prototype-patrons-nav {
    top: 2.5rem !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

.patrons-nav-wrapper.prototype-patrons-nav .patrons-glass-capsule,
header.prototype-patrons-nav .patrons-glass-capsule {
  width: 100% !important;
  max-width: 100% !important;
  height: 56px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(22px) !important;
  -webkit-backdrop-filter: blur(22px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  padding: 0 1.5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  pointer-events: auto !important;
}