/* ==========================================================================
   PokerExpert — First-Principles Mobile & Desktop Design System
   Grounded in 4/8dp spatial rhythm, 100dvh viewport locking, safe-area insets,
   48dp Android / 44pt iOS touch targets, and Portrait Stadium vs Landscape Oval.
   ========================================================================== */

:root {
  /* Semantic Color Tokens */
  --bg-app: #070b14;
  --surface-1: #0d1424;
  --surface-2: #141e33;
  --surface-3: #1e2b45;
  --surface-glass: rgba(11, 17, 30, 0.88);
  --border-hairline: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-amber: #f59e0b;
  --accent-amber-strong: #d97706;
  --accent-emerald: #10b981;
  --accent-blue: #2563eb;
  --accent-crimson: #e11d48;
  --accent-cyan: #06b6d4;

  /* Table Felt Tokens */
  --table-felt: radial-gradient(ellipse at 50% 46%, #0f6b4e 0%, #074734 64%, #03281d 100%);
  --table-rail: #261912;
  --table-trim: rgba(217, 119, 6, 0.38);

  /* Safe-Area Insets */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Motion Tokens */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* ==================== ZONE 1: ULTRA-SLIM TOP HUD BAR ==================== */
.app-topbar {
  height: calc(44px + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: max(12px, var(--safe-left));
  padding-right: max(12px, var(--safe-right));
  background: rgba(10, 15, 28, 0.94);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  z-index: 35;
}

@media (min-width: 1024px) {
  .app-topbar {
    height: 48px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

.topbar-icon-btn {
  min-width: 40px;
  height: 34px;
  padding: 0 9px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease;
  position: relative;
}

.topbar-icon-btn:not(.hidden) {
  display: inline-flex;
}

/* Expand touch hit target cleanly to >=44px without inflating visual chrome */
.topbar-icon-btn::after {
  content: "";
  position: absolute;
  inset: -5px -2px;
}

.topbar-icon-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.topbar-icon-btn:active {
  opacity: 0.82;
}

.topbar-icon-btn.is-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}

/* ==================== ZONE 2: ADAPTIVE FELT ARENA ==================== */
.table-arena {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px max(10px, var(--safe-left)) 8px max(10px, var(--safe-right));
  overflow: hidden;
}

.poker-table-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1080px;
  max-height: 580px;
  margin: 0 auto;
}

/* Portrait Stadium Geometry: Tall vertical casino capsule utilizing full height */
@media (max-aspect-ratio: 1/1) {
  .table-arena {
    padding: 8px 10px 6px 10px;
  }
  .poker-table-container {
    width: 94%;
    height: 98%;
    max-width: 460px;
    max-height: none;
  }
}

/* Tablet Portrait Stadium Geometry (iPad / Android Tablet): Generous full-felt stadium */
@media (min-width: 768px) and (max-aspect-ratio: 1/1) {
  .poker-table-container {
    width: 88%;
    height: 95%;
    max-width: 740px;
  }
}

.poker-table-felt {
  position: absolute;
  inset: 14px 16px;
  border-radius: 9999px;
  background: var(--table-felt);
  border: 10px solid var(--table-rail);
  box-shadow:
    0 0 0 2px #473223,
    inset 0 0 0 1.5px var(--table-trim),
    inset 0 0 54px rgba(0, 0, 0, 0.72),
    0 18px 40px rgba(0, 0, 0, 0.75);
}

@media (max-width: 640px) {
  .poker-table-felt {
    inset: 12px 12px;
    border-width: 7px;
  }
}

.felt-emerald {
  background: radial-gradient(ellipse at 50% 46%, #0f6b4e 0%, #074734 64%, #03281d 100%) !important;
}
.felt-midnight {
  background: radial-gradient(ellipse at 50% 46%, #1d3f8a 0%, #0f1d3d 66%, #060b19 100%) !important;
}
.felt-crimson {
  background: radial-gradient(ellipse at 50% 46%, #7f1d1d 0%, #450a0a 66%, #1c0404 100%) !important;
}
.felt-obsidian {
  background: radial-gradient(ellipse at 50% 46%, #334155 0%, #192231 66%, #090d16 100%) !important;
}

.table-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.03);
  letter-spacing: 0.22em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* ==================== PLAYING CARDS ==================== */
.poker-card {
  width: 44px;
  height: 62px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px;
  font-weight: 800;
  user-select: none;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.poker-card-placeholder {
  width: 44px;
  height: 62px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(5, 12, 20, 0.22);
  flex-shrink: 0;
}

.poker-card-back {
  width: 34px;
  height: 48px;
  border-radius: 5px;
  background: linear-gradient(145deg, #1e3a8a 0%, #0f172a 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

/* Tucked Mini Card-Backs on Opponent Pods (Zero Vertical Clutter & Clear of Position Pill) */
.mini-hole-backs {
  position: absolute;
  top: -11px;
  left: 24px;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.mini-card-back {
  width: 13px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(145deg, #2563eb 0%, #1e1b4b 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.mini-card-back + .mini-card-back {
  margin-left: -6px;
  transform: rotate(5deg);
}

/* Hero Hole Cards in Bottom Cockpit */
.poker-card-hero {
  width: 46px;
  height: 64px;
  padding: 4px 5px;
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

/* Showdown Opponent Revealed Cards */
.poker-card-showdown-opp {
  width: 32px;
  height: 45px;
  padding: 2px 3px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .poker-card,
  .poker-card-placeholder {
    width: 36px;
    height: 51px;
    border-radius: 5px;
    padding: 2px 3px;
  }

  .poker-card-hero {
    width: 40px;
    height: 56px;
    padding: 3px 4px;
    border-radius: 6px;
  }

  /* When playing 4-card or 5-card PLO on mobile, tighten hero card overlap cleanly */
  .hero-cards-many .poker-card-hero {
    width: 34px;
    height: 48px;
    padding: 2px 3px;
  }
  .hero-cards-many .poker-card-hero + .poker-card-hero {
    margin-left: -7px;
  }

  .poker-card-showdown-opp {
    width: 24px;
    height: 34px;
    padding: 1px 2px;
  }
}

/* Fanned Showdown Opponent Hands (Keeps 4- and 5-Card PLO Hands Within Pod Width!) */
.showdown-opp-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.showdown-opp-fan .poker-card-showdown-opp + .poker-card-showdown-opp {
  margin-left: -4px;
}
.showdown-opp-fan-many .poker-card-showdown-opp + .poker-card-showdown-opp {
  margin-left: -8px;
}

/* Winning Card Highlighting at Showdown */
.winning-card-glow {
  border: 2px solid #fbbf24 !important;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.85), 0 4px 10px rgba(0, 0, 0, 0.6) !important;
  transform: translateY(-2px);
  z-index: 25;
}

.dimmed-card {
  opacity: 0.45;
  filter: saturate(60%);
}

/* Keep Hero's own hole cards crisp & readable in the dock even when non-winning at showdown */
.poker-card-hero.dimmed-card {
  opacity: 0.86;
  filter: none;
}

/* ==================== PLAYER SEAT PODS ==================== */
.player-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 15;
  transition: opacity 0.2s ease;
}

.player-card-box {
  position: relative;
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  padding: 4px 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.48);
  min-width: 104px;
  max-width: 132px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.player-card-box:hover {
  border-color: rgba(56, 189, 248, 0.55);
}

.player-card-box.active-actor {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 1px var(--accent-amber), 0 0 16px rgba(245, 158, 11, 0.45);
}

.player-card-box.folded {
  opacity: 0.42;
}

@media (max-width: 640px) {
  .player-card-box {
    min-width: 78px;
    max-width: 104px;
    padding: 3px 5px;
    border-radius: 8px;
  }
  .table-crowded .player-card-box {
    min-width: 68px;
    max-width: 77px;
    padding: 2.5px 4px;
  }
}

/* Monogram Avatar Chip (Zero OS Emoji Dependency) */
.seat-monogram {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 8.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f8fafc;
  letter-spacing: -0.02em;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dealer Button Puck */
.dealer-button {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f8fafc;
  color: #090d16;
  font-weight: 900;
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}

.dealer-button-corner {
  position: absolute;
  top: -7px;
  left: -6px;
  z-index: 4;
}

/* Position & Action Pills */
.pos-badge {
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 3.5px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.mood-pill-steaming {
  font-size: 7.5px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 3.5px;
  background: rgba(225, 29, 72, 0.28);
  border: 1px solid rgba(251, 113, 133, 0.55);
  color: #fda4af;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.mood-pill-heater {
  font-size: 7.5px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 3.5px;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.mood-dot-steaming,
.mood-dot-heater {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}

.mood-dot-steaming {
  background: #fb7185;
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.85);
}

.mood-dot-heater {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.85);
}

@keyframes seatThinkPulse {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(56, 189, 248, 0.65), 0 4px 12px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 0 0 2.5px rgba(245, 158, 11, 0.9), 0 6px 16px rgba(245, 158, 11, 0.32); }
}

.player-card-box.seat-thinking {
  border-color: #38bdf8 !important;
  animation: seatThinkPulse 420ms ease-in-out infinite;
}

.action-pill-check {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.action-pill-call {
  background: rgba(37, 99, 235, 0.28);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.48);
}
.action-pill-raise {
  background: rgba(245, 158, 11, 0.24);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.action-pill-allin {
  background: rgba(225, 29, 72, 0.32);
  color: #fda4af;
  border: 1px solid #f43f5e;
}
.action-pill-fold {
  background: rgba(51, 65, 85, 0.45);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.28);
}
.chip-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 800;
}

/* Speech Bubbles (Orientation & Edge Aware so Top/Side Seats Never Clip!) */
.speech-bubble {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  z-index: 28;
  pointer-events: none;
}

.speech-bubble.bubble-below {
  bottom: auto;
  top: calc(100% + 4px);
}
.speech-bubble.bubble-align-left {
  left: 0;
  transform: none;
}
.speech-bubble.bubble-align-right {
  left: auto;
  right: 0;
  transform: none;
}

/* ==================== ZONE 3: BOTTOM HERO & THUMB-ZONE ACTION DOCK ==================== */
.hero-action-dock {
  flex-shrink: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(13, 20, 36, 0.97) 0%, rgba(8, 12, 22, 0.99) 100%);
  border-top: 1px solid var(--border-hairline);
  padding: 8px max(12px, var(--safe-right)) calc(8px + var(--safe-bottom)) max(12px, var(--safe-left));
  z-index: 30;
}

.hero-dock-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 1024px) {
  .hero-action-dock {
    background: transparent;
    border-top: none;
    padding: 0 20px 12px 20px;
  }
  .hero-dock-inner {
    background: rgba(13, 20, 36, 0.94);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 10px 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  }
}

/* Primary 48dp Android / 44pt iOS Touch Targets */
.cta-action-btn {
  min-height: 48px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 120ms ease, filter 120ms ease;
  border: 1px solid transparent;
  user-select: none;
}

.cta-action-btn:active:not(:disabled) {
  filter: brightness(0.92);
}

.cta-action-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.preset-pill-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.preset-pill-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.stepper-btn {
  width: 34px;
  height: 32px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.stepper-btn:hover {
  background: var(--surface-3);
}

/* ==================== COMPACT PHONE LANDSCAPE MODE (e.g. 844x390) ==================== */
@media (max-height: 500px) and (orientation: landscape) {
  .app-topbar {
    height: 36px;
    padding-top: 0;
  }
  .topbar-icon-btn {
    height: 28px;
    min-width: 34px;
    font-size: 11px;
  }
  .table-arena {
    padding: 3px 12px 2px 12px;
  }
  .poker-table-felt {
    inset: 6px 18px;
    border-width: 6px;
  }
  #centerPotPill {
    padding: 2px 10px !important;
    margin-bottom: 3px !important;
  }
  #communityBoardsWrap {
    gap: 2px !important;
  }
  #showdownBanner {
    margin-top: 3px !important;
    padding: 2px 10px !important;
  }
  .poker-card,
  .poker-card-placeholder {
    width: 30px;
    height: 42px;
    padding: 1.5px 2.5px;
  }
  /* Scale community cards slightly tighter when 2 boards are stacked in short landscape */
  .two-boards-active .poker-card,
  .two-boards-active .poker-card-placeholder {
    width: 26px;
    height: 36px;
    padding: 1px 2px;
    border-radius: 4px;
  }
  .two-boards-active #board1Cards .poker-card div,
  .two-boards-active #board2Cards .poker-card div {
    font-size: 9px !important;
  }
  .poker-card-hero {
    width: 31px;
    height: 44px;
    padding: 2px 3px;
  }
  .hero-cards-many .poker-card-hero {
    width: 26px;
    height: 37px;
    padding: 1px 2px;
  }
  .hero-cards-many .poker-card-hero + .poker-card-hero {
    margin-left: -7px;
  }
  .poker-card-showdown-opp {
    width: 22px;
    height: 31px;
    padding: 1px 1.5px;
  }
  .player-card-box {
    min-width: 74px;
    max-width: 102px;
    padding: 2.5px 5px;
  }
  .table-crowded .player-card-box {
    min-width: 68px;
    max-width: 84px;
    padding: 2.5px 4px;
  }
  .hero-action-dock {
    padding: 3px max(10px, var(--safe-right)) calc(4px + var(--safe-bottom)) max(10px, var(--safe-left));
  }
  #dockCoachStrip {
    margin-bottom: 3px !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow: hidden;
  }
  #actionFeedbackBanner {
    max-width: 340px !important;
    padding: 2px 8px !important;
  }
  #feedbackMessage {
    max-width: 165px !important;
  }
  .hero-dock-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    max-width: 100%;
  }
  #heroInfoRow {
    flex: 0 1 auto;
    min-width: 0;
  }
  #heroHandStrengthDesc {
    max-width: 112px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
  }
  #btnMoveMathDock {
    height: 36px;
    padding: 0 8px;
  }
  .math-btn-label {
    display: none;
  }
  #betControlRow {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  #betControlRow .preset-pill-btn:nth-child(1),
  #betControlRow .preset-pill-btn:nth-child(3),
  #betControlRow .stepper-btn {
    display: none;
  }
  #betSlider {
    max-width: 72px !important;
    min-width: 48px;
  }
  #betControlRow > div:last-child {
    min-width: 0 !important;
  }
  #livePlayButtonsRow,
  #showdownButtonsRow {
    flex-shrink: 0;
    gap: 5px;
  }
  .cta-action-btn {
    min-height: 36px;
    min-width: 64px;
    padding: 0 9px;
    font-size: 11px;
    white-space: nowrap;
  }
  .preset-pill-btn {
    min-height: 26px;
    height: 26px;
    padding: 0 6px;
    font-size: 10px;
  }
}

/* ==================== FEEDBACK & PRO BADGES ==================== */
.badge-optimal {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}
.badge-marginal {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}
.badge-blunder {
  background: rgba(225, 29, 72, 0.18);
  border-color: rgba(244, 63, 94, 0.55);
  color: #fda4af;
}

.pro-gold-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #090d16;
  border: none;
}

.coach-hud-bar {
  background: rgba(10, 16, 29, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* ==================== NATIVE BOTTOM SHEETS & MODALS ==================== */
.modal-scrim.hidden,
.cta-action-btn.hidden,
.preset-pill-btn.hidden,
.stepper-btn.hidden {
  display: none !important;
}

.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-sheet {
  background: var(--surface-1);
  border-top: 1px solid var(--border-strong);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
  padding-bottom: var(--safe-bottom);
  overflow: hidden;
  animation: sheetSlideUp 200ms var(--ease-out-expo);
}

.sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.35);
  margin: 8px auto 2px auto;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .modal-scrim {
    align-items: center;
    padding: 16px;
  }
  .modal-sheet {
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding-bottom: 0;
  }
  .sheet-grabber {
    display: none;
  }
}

@keyframes sheetSlideUp {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes cardDealIn {
  0% { opacity: 0; transform: translateY(-8px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.card-deal-anim {
  animation: cardDealIn 180ms var(--ease-out-expo) backwards;
}

@keyframes potPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pot-pulse-anim {
  animation: potPulse 260ms ease-out;
}

/* Reduced Motion Accessibility Compliance */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Custom Scrollbar inside Modal Sheets */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
