@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #0b0f19;
  --panel-bg: rgba(17, 24, 39, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* GTO Action Colors */
  --color-fold: #374151; /* Dark Grey/Slate */
  --color-fold-hover: #4b5563;
  --color-call: #10b981; /* Emerald Green */
  --color-call-hover: #059669;
  --color-raise: #ef4444; /* Crimson Red */
  --color-raise-hover: #dc2626;
  --color-shove: #8b5cf6; /* Violet */
  --color-shove-hover: #7c3aed;
  --color-mixed: #f59e0b; /* Amber */
  
  /* Suit Colors (4-color Deck) */
  --suit-spades: #334155;    /* Black (Spades) */
  --suit-hearts: #ef4444;    /* Red (Hearts) */
  --suit-diamonds: #2563eb;  /* Blue (Diamonds) */
  --suit-clubs: #059669;     /* Green (Clubs) */
  
  --font-family: 'Outfit', sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-neon: 0 0 20px rgba(99, 102, 241, 0.15);
  
  --safe-area-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
}

/* Scrollbar Style */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 15, 25, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Header & Navigation */
header {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
  padding: 12px 24px;
  padding-top: calc(12px + var(--safe-area-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #818cf8 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo i {
  -webkit-text-fill-color: initial;
  background: none;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.scenario-selector {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}

.scenario-selector:hover {
  border-color: #818cf8;
}

/* Main Layout */
.app-container {
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 24px;
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

/* Panels (Glassmorphism) */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

/* Playzone (Left Column) */
.playzone {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* HUD / Stats Bar */
.hud-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.hud-card {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid var(--panel-border);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hud-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #6366f1;
}

.hud-card.accuracy::before { background: #10b981; }
.hud-card.streak::before { background: #f59e0b; }
.hud-card.best-streak::before { background: #ec4899; }

.hud-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.hud-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Table Area */
.table-area {
  flex: 1;
  background: radial-gradient(circle at center, rgba(31, 41, 55, 0.4) 0%, rgba(17, 24, 39, 0.8) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

/* Visual Poker Table */
.poker-table {
  width: 85%;
  max-width: 540px;
  height: 160px;
  background: linear-gradient(135deg, #0f5132 0%, #198754 100%);
  border: 10px solid #111827;
  border-radius: 100px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.6), var(--shadow-lg);
  position: relative;
  margin: 40px 0;
  overflow: visible; /* Prevent dynamic seats from being clipped */
}

.table-felt-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  user-select: none;
  z-index: 1;
}

/* Seat positions around table */
.seat {
  position: absolute;
  width: 48px;
  height: 48px;
  background: rgba(31, 41, 55, 0.9);
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  color: var(--text-secondary);
  transition: var(--transition-normal);
  transform: translate(-50%, -50%); /* Centered geometrically */
  z-index: 10; /* Ensure seats sit on top of parent background/borders */
}

.seat.active {
  border-color: #818cf8;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
  color: var(--text-primary);
  background: #1e1b4b;
}

.seat.folded {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.seat.acting {
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.7);
  animation: pulseBlueBorder 1s infinite alternate;
}

@keyframes pulseBlueBorder {
  0% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.4); }
  100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.8); }
}

.seat.dealer-btn::after {
  content: 'D';
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: #f3f4f6;
  border: 1px solid #111827;
  color: #111827;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 800;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

/* Dealer Button and Action Badge */
.action-bubble {
  position: absolute;
  background: var(--color-fold);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 30;
}

.action-bubble.raise { background: var(--color-raise); }
.action-bubble.call { background: var(--color-call); }

/* Floating action bubbles relative to parent seat coordinates */
.bubble-top {
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
}

.bubble-bottom {
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
}

.bubble-left {
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
}

.bubble-right {
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
}

/* Cards Area */
.cards-container {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  z-index: 10;
}

.card {
  width: 90px;
  height: 126px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  color: #111827;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  user-select: none;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: dealCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card.spades   { color: var(--suit-spades); }
.card.hearts   { color: var(--suit-hearts); }
.card.diamonds { color: var(--suit-diamonds); }
.card.clubs    { color: var(--suit-clubs); }

.card .suit-icon {
  align-self: flex-end;
  font-size: 2.2rem;
  line-height: 1;
}

/* Prompt Scenario Text */
.scenario-prompt {
  text-align: center;
  max-width: 90%;
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 15px;
  border-radius: 8px;
  border-left: 4px solid var(--color-mixed);
}

.scenario-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 5px;
}

#prompt-scenario-desc {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-mixed); /* Amber for high visibility */
  margin: 0;
}

/* User Action Options Area */
.actions-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.action-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
}

.btn-action {
  flex: 1;
  padding: 16px 20px;
  border-radius: 12px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
  color: white;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.btn-action span.shortcut {
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-fold {
  background: var(--color-fold);
}
.btn-fold:hover {
  background: var(--color-fold-hover);
  box-shadow: 0 0 15px rgba(55, 65, 81, 0.4);
}

.btn-call {
  background: var(--color-call);
}
.btn-call:hover {
  background: var(--color-call-hover);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.btn-raise {
  background: var(--color-raise);
}
.btn-raise:hover {
  background: var(--color-raise-hover);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-shove {
  background: var(--color-shove);
}
.btn-shove:hover {
  background: var(--color-shove-hover);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Feedback HUD Overlay */
.feedback-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 50;
  padding: 30px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border-radius: 16px;
}

.feedback-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.feedback-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.feedback-title.perfect {
  color: var(--color-call);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.feedback-title.mixed {
  color: var(--color-mixed);
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.feedback-title.mistake {
  color: var(--color-raise);
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.feedback-desc {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.feedback-desc strong {
  color: #818cf8;
}

/* Distribution bar chart in feedback */
.gto-dist-bar {
  width: 100%;
  max-width: 320px;
  height: 24px;
  background: rgba(31, 41, 55, 0.8);
  border-radius: 12px;
  display: flex;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.05);
}

.gto-dist-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  transition: width 0.3s ease;
}

.btn-next {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  padding: 12px 32px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.5);
}

/* Range Matrix Panel (Right Column) */
.range-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 12px;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-fold  { background: var(--color-fold); }
.legend-call  { background: var(--color-call); }
.legend-raise { background: var(--color-raise); }
.legend-shove { background: var(--color-shove); }

/* 13x13 Grid Matrix Container */
.matrix-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111827;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(13, 1fr);
  gap: 2px;
  position: relative;
}

.matrix-cell {
  background: var(--color-fold);
  border-radius: 2px;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  cursor: default;
  position: relative;
  user-select: none;
  transition: transform 0.15s ease;
}

.matrix-cell.highlight {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
  z-index: 10;
  border: 2px solid white;
  font-weight: 800;
}

/* History List style */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  max-height: 150px;
}

.history-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(31, 41, 55, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 0.8rem;
}

.history-hand {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

.history-badge.perfect { background: rgba(16, 185, 129, 0.2); color: var(--color-call); }
.history-badge.mixed { background: rgba(245, 158, 11, 0.2); color: var(--color-mixed); }
.history-badge.mistake { background: rgba(239, 68, 68, 0.2); color: var(--color-raise); }

/* Animations */
@keyframes dealCard {
  0% {
    transform: translateY(100px) rotate(15deg) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translateY(0) rotate(0) scale(1);
    opacity: 1;
  }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Shake effect for mistakes */
.shake {
  animation: shakeAnimation 0.5s ease;
}

@keyframes shakeAnimation {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Green glow pulse for correct */
.pulse-green {
  animation: pulseGreenAnimation 0.8s ease;
}

@keyframes pulseGreenAnimation {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Instructions footer */
.footer-info {
  margin-top: auto;
  padding: 24px 32px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 14, 20, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--panel-border);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.footer-logo i {
  color: #f43f5e;
}

.footer-langs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.lang-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.lang-buttons {
  display: flex;
  gap: 6px;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 30px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.lang-btn.active {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(124, 58, 237, 0.2));
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.15);
  color: #ff4d6d;
}

.lang-btn.active::after {
  content: '';
  width: 4px;
  height: 4px;
  background: #f43f5e;
  border-radius: 50%;
  margin-left: 2px;
}

/* Responsive Footer */
@media (max-width: 900px) {
  .footer-grid {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .footer-brand, .footer-langs {
    align-items: center;
    justify-content: center;
  }
}

/* Mobile optimizations */
@media (max-width: 600px) {
  body {
    font-size: 14px;
  }
  header {
    padding: 8px 12px;
    padding-top: calc(8px + var(--safe-area-top));
  }
  .app-container {
    padding: 12px;
  }
  .glass-panel {
    padding: 16px;
  }
  .hud-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .poker-table {
    width: 90%;
    height: 100px;
  }
  .seat {
    width: 38px;
    height: 38px;
    font-size: 0.65rem;
  }
  .card {
    width: 70px;
    height: 100px;
    font-size: 1.2rem;
  }
  .card .suit-icon {
    font-size: 1.6rem;
  }
  .btn-action {
    padding: 12px 10px;
    font-size: 0.9rem;
  }
}

/* SPA SCREEN TRANSITIONS & CONTROLS */
.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  width: 100%;
  box-sizing: border-box;
}

.screen.active {
  display: flex !important;
  flex-direction: column;
  flex-grow: 1;
  opacity: 1;
}

/* HEADER GLOBAL ADJUSTMENTS */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  position: relative;
  z-index: 100;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-nav-auth {
  background: linear-gradient(135deg, var(--color-raise), #b91c1c);
  color: white;
  border: none;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.btn-nav-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.user-welcome {
  color: #a5b4fc;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-nav-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-nav-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

/* HERO SECTION (LANDING) */
#landing-screen {
  flex-direction: column;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 60px;
}

.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 40px;
  width: 100%;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg, #ef4444, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 600px;
}

.hero-actions {
  margin-top: 15px;
}

.btn-primary-glow {
  background: linear-gradient(135deg, var(--color-raise), #b91c1c);
  color: white;
  border: none;
  padding: 16px 36px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
}

.hero-showcase {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.card-glow-wrapper {
  position: relative;
  width: 240px;
  height: 340px;
}

.card-showcase {
  position: absolute;
  width: 160px;
  height: 240px;
  border-radius: 16px;
  background: white;
  color: #111827;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  font-size: 2.5rem;
  font-weight: 900;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transition: all 0.5s ease;
}

.card-showcase .suit {
  font-size: 4rem;
  align-self: flex-end;
  line-height: 1;
}

.spade-card {
  z-index: 2;
  transform: rotate(-10deg) translate(-20px, 10px);
}

.heart-card {
  color: #ef4444;
  z-index: 1;
  transform: rotate(10deg) translate(50px, 20px);
}

.hero-showcase:hover .spade-card {
  transform: rotate(-15deg) translate(-35px, 0);
}

.hero-showcase:hover .heart-card {
  transform: rotate(15deg) translate(65px, 10px);
}

/* FEATURES SECTION */
.features-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  width: 100%;
}

.feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 30px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all var(--transition-fast);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  font-size: 2rem;
  color: #818cf8;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* LOGIN & REGISTER SCREEN */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: calc(100vh - 120px);
  padding: 20px;
  box-sizing: border-box;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: 24px;
}

.login-container h2 {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
}

.login-container p {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 8px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 1rem;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: white;
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  border-color: #818cf8;
  background: rgba(31, 41, 55, 0.8);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.2);
}

.btn-full {
  width: 100%;
  text-align: center;
  justify-content: center;
  border-radius: 12px;
  padding: 14px;
}

.auth-toggle {
  margin-top: 25px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.link-btn {
  background: none;
  border: none;
  color: #818cf8;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  margin-left: 5px;
  transition: color var(--transition-fast);
}

.link-btn:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

/* RESPONSIVE DESIGN - SCREENS */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }
  
  .hero-content {
    align-items: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-showcase {
    display: none; /* Hide cards on smaller screens to prioritize text */
  }

  .features-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
    justify-content: space-between;
    height: auto;
    padding: 15px;
    padding-top: calc(15px + var(--safe-area-top));
  }

  .game-only {
    width: 100%;
    order: 3;
    justify-content: center;
    margin-top: 10px;
  }

  .login-container {
    padding: 24px;
  }
}

/* PAYWALL OVERLAY */
.paywall-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.98);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  z-index: 60;
  padding: 100px 20px 40px 20px;
  text-align: center;
  border-radius: 16px;
}

.paywall-content {
  max-width: 420px;
  width: 100%;
  padding: 35px;
  border-radius: 24px;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.paywall-icon {
  font-size: 3.5rem;
  color: #f59e0b;
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.6));
  margin-bottom: 10px;
  animation: crownPulse 2s infinite alternate;
}

@keyframes crownPulse {
  from { transform: scale(1); filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5)); }
  to { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.8)); }
}

/* PLAN BADGES */
.plan-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
}

.plan-badge.free {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.25);
}

.plan-badge.pro {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: goldGlow 2s infinite alternate;
}

@keyframes goldGlow {
  from { box-shadow: 0 0 4px rgba(245, 158, 11, 0.1); }
  to { box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
}

/* TESTIMONIALS SECTION */
.testimonials-section {
  padding: 40px 20px;
  background: rgba(11, 15, 25, 0.4);
  border-top: 1px solid var(--panel-border);
  margin-top: 40px;
}

.testimonials-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.testimonial-card {
  background: var(--surface-light);
  padding: 25px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.testimonial-stars {
  color: #f59e0b;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-style: italic;
}

.testimonial-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 5px;
}


/* ==========================================================================
   THEME: LIGHT MODE
   ========================================================================== */
[data-theme="light"] {
  --bg-color: #e5e7eb;
  --panel-bg: #ffffff;
  --panel-border: rgba(0, 0, 0, 0.15);
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --color-fold: #6b7280;
  --color-fold-hover: #4b5563;
  --color-call: #059669;
  --color-call-hover: #047857;
  --color-raise: #dc2626;
  --color-raise-hover: #b91c1c;
  --color-mixed: #d97706;
  --suit-spades: #0f172a;
  --suit-hearts: #dc2626;
  --suit-diamonds: #2563eb;
  --suit-clubs: #059669;
}

[data-theme="light"] body {
  background-image: none;
}

[data-theme="light"] .glass-panel {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(15px);
}

/* ==========================================================================
   ANIMATIONS & EFFECTS
   ========================================================================== */
@keyframes dealCard {
  0% { opacity: 0; transform: translateY(-50px) scale(0.8) rotate(-10deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

.card-deal {
  animation: dealCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.modal-animate {
  animation: fadeInScale 0.3s var(--transition-normal) forwards;
}

/* Custom Premium Select / Dropdown */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}
.custom-select-display {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}
.custom-select-display:hover {
  border-color: rgba(255,255,255,0.2);
}
.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 5px;
  background: var(--bg-color);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.custom-select-options.open {
  display: flex;
  animation: fadeInScale 0.15s ease forwards;
}
.custom-select-option {
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.custom-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
[data-theme="light"] .custom-select-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Time Attack Timer */
.time-attack-hud {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}
.time-attack-hud.critical {
  animation: pulse-red 1s infinite;
}
@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(239, 68, 68, 0.6); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
}

/* Stats Modal Container */
#stats-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}


/* ==========================================================================
   SIDEBAR & ROUTING (Postflop+ Style)
   ========================================================================== */
.sidebar-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

.sidebar-menu {
  position: fixed; top: 0; left: -300px; bottom: 0;
  width: 280px;
  background: #1e1e1e;
  z-index: 1001;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}
[data-theme="light"] .sidebar-menu {
  background: #ffffff;
}

.sidebar-menu.open {
  left: 0;
}

.sidebar-header {
  background: #f04e23; /* Postflop+ style orange/red */
  padding: 30px 20px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.sidebar-header .user-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 2px solid white;
  display: flex; justify-content: center; align-items: center;
  font-size: 2rem;
}

.sidebar-links {
  list-style: none;
  padding: 10px 0;
}
.sidebar-links li {
  padding: 15px 25px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-links li:hover {
  background: rgba(255,255,255,0.05);
}
[data-theme="light"] .sidebar-links li:hover {
  background: rgba(0,0,0,0.05);
}
.sidebar-links li i {
  color: var(--text-secondary);
  width: 20px; text-align: center;
}

/* ==========================================================================
   ALL SPOTS SCREEN
   ========================================================================== */
.top-tabs {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  background: var(--bg-color);
  position: sticky; top: 0; z-index: 10;
}
.top-tab {
  flex: 1; text-align: center; padding: 15px 0;
  color: var(--text-secondary);
  font-weight: 700; font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.top-tab.active {
  color: var(--text-primary);
  border-bottom-color: #f04e23;
}
.top-tab .soon-badge {
  font-size: 0.6rem; background: var(--color-mixed); color: #000; padding: 2px 5px; border-radius: 4px; margin-left: 5px;
}

.spots-container {
  padding: 20px;
}
.stack-group {
  margin-bottom: 25px;
}
.stack-title {
  font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); font-style: italic; margin-bottom: 10px;
}
.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.spot-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 15px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  position: relative;
}
.spot-card .spot-count {
  position: absolute; top: -8px; right: -8px;
  background: #374151; font-size: 0.6rem; padding: 3px 6px; border-radius: 10px; color: white; border: 1px solid var(--panel-border);
}
.spot-card i { font-size: 1.5rem; color: var(--text-primary); }
.spot-card span { font-size: 0.85rem; font-weight: 600; }

/* LEADERBOARD & HISTORY */
#leaderboard-screen button.top-tab { background: transparent; border: 0; color: var(--text-secondary); font: inherit; cursor: pointer; }
#leaderboard-screen button.top-tab.active { color: var(--accent-color, #10b981); border-bottom: 2px solid currentColor; }
#lb-refresh { padding: 9px 20px; margin: 0 0 16px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); color: var(--text-primary); font: inherit; cursor: pointer; }
#progress-sync-status { position: fixed; bottom: 12px; left: 5%; width: 90%; box-sizing: border-box; padding: 10px; background: #34271b; color: #fff; border: 1px solid #e9a348; border-radius: 8px; z-index: 99999; font-size: .85rem; pointer-events: none; }
.list-item {
  background: var(--panel-bg); border-bottom: 1px solid var(--panel-border);
  padding: 15px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.list-item .rank-crown { color: #f59e0b; font-size: 1.2rem; }

/* BADGES GALLERY & TOAST */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
  margin-top: 10px;
}
.badge-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-color); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 15px 10px; text-align: center;
  transition: all 0.3s ease;
}
.badge-card.unlocked {
  box-shadow: inset 0 0 15px rgba(255,255,255,0.05);
}
.badge-card.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.badge-card.locked {
  opacity: 0.4;
  filter: grayscale(100%);
}
.badge-icon {
  width: 45px; height: 45px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 8px;
  background: rgba(255,255,255,0.05);
}
.badge-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text-secondary);
  line-height: 1.1;
}

.badge-toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  padding: 10px 20px 10px 10px;
  display: flex; align-items: center; gap: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.badge-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.badge-toast-icon {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.badge-toast-content {
  display: flex; flex-direction: column; justify-content: center;
}
.badge-toast-header {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: #f59e0b; font-weight: 800;
}
.badge-toast-title {
  font-size: 1.1rem; font-weight: 700; color: #ffffff;
}
.badge-toast-desc {
  font-size: 0.8rem; color: #94a3b8;
}

/* Exam mode keeps every answer and score outside the active decision view. */
#menu-exam button { background: none; border: 0; color: inherit; font: inherit; text-align: left; width: 100%; cursor: pointer; display: flex; align-items: center; gap: 12px; }
#exam-screen { width: 100%; }
.exam-wrap { max-width: 850px; margin: 0 auto; padding: 24px 16px 48px; }
.exam-heading { margin-bottom: 22px; }
.exam-heading h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.exam-eyebrow { font-size: .7rem; color: var(--color-call); letter-spacing: .16em; }
.exam-panel { padding: 24px; margin-bottom: 20px; border: 1px solid var(--panel-border); border-radius: 20px; background: var(--panel-bg); }
.exam-panel h2 { font-size: 1.2rem; margin-bottom: 14px; }
.exam-panel h3 { font-size: 1rem; margin-top: 22px; }
.exam-lead { color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.exam-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.exam-form label { display: grid; gap: 8px; color: var(--text-secondary); font-size: .9rem; min-width: 0; }
.exam-form select { padding: 12px; border-radius: 10px; border: 1px solid var(--panel-border); color: var(--text-primary); background: var(--bg-color); font: inherit; width: 100%; }
.exam-note { font-size: .84rem; line-height: 1.6; color: var(--text-secondary); margin: 16px 0; }
.exam-btn { padding: 12px 18px; min-height: 46px; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--bg-color); color: var(--text-primary); font: inherit; font-weight: 600; cursor: pointer; }
.exam-btn:hover { border-color: var(--color-call); }
.exam-btn:focus-visible, .exam-form select:focus-visible, .exam-review-item summary:focus-visible { outline: 3px solid #818cf8; outline-offset: 3px; }
.exam-btn:disabled { opacity: .5; cursor: wait; }
.exam-primary { background: #047857; color: #fff; border-color: #059669; }
.exam-progress-label { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.exam-progress-label span { color: var(--text-secondary); }
.exam-panel progress { width: 100%; height: 7px; accent-color: var(--color-call); margin-top: 12px; }
.exam-table { text-align: center; border-radius: 22px; background: radial-gradient(ellipse at center, #124c3c, #09281f); padding: 25px 16px; color: #f3f4f6; border: 1px solid #25634d; }
.exam-table p { color: #c5d8d2; font-size: .92rem; line-height: 1.5; }
.exam-table h2 { margin-top: 14px; }
.exam-position { display: inline-block; border: 1px solid #72a795; padding: 5px 14px; border-radius: 30px; font-weight: 700; }
.exam-cards { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.exam-card { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; width: 82px; height: 116px; padding: 10px 12px; background: #fff; color: #1e293b; border-radius: 10px; font-size: 1.8rem; font-weight: 800; box-shadow: 0 6px 18px #0004; }
.exam-card span { align-self: flex-end; font-size: 2rem; }
.exam-suit-h { color: #c52828; } .exam-suit-d { color: #1d4ed8; } .exam-suit-c { color: #047857; }
.exam-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.exam-actions .exam-btn { flex: 1; }
.exam-footer { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
#exam-live { color: var(--text-secondary); min-height: 24px; line-height: 1.5; }
#exam-error { color: #f87171; line-height: 1.5; }
.exam-score { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0; }
.exam-score strong { font-size: 3.4rem; color: var(--color-call); }
.exam-score span { color: var(--text-secondary); }
.exam-counts { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
.exam-spots p { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--panel-border); }
.exam-spots span { color: var(--text-secondary); }
.exam-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.exam-filters [aria-pressed="true"] { border-color: var(--color-call); }
.exam-review-item { border-top: 1px solid var(--panel-border); padding: 14px 0; }
.exam-review-item summary { cursor: pointer; line-height: 1.5; }
.exam-review-item summary > span:first-child { margin-right: 12px; }
.exam-review-item p { line-height: 1.6; color: var(--text-secondary); margin: 12px 0 0; }
.exam-result-perfect { color: var(--color-call); } .exam-result-mixed { color: var(--color-mixed); } .exam-result-mistake { color: #ef4444; }
@media (max-width: 480px) { .exam-panel { padding: 18px 14px; } .exam-form { grid-template-columns: 1fr; gap: 14px; } .exam-wrap { padding: 20px 12px 36px; } .exam-footer .exam-btn { width: 100%; } }

/* One-time feature announcement: native dialog supplies focus trapping and Escape. */
.exam-announcement { margin: auto; box-sizing: border-box; width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 28px; border-radius: 22px; border: 1px solid var(--border-color, #334155); background: var(--bg-secondary, #111827); color: var(--text-primary, #f8fafc); box-shadow: 0 24px 80px #0009; }
.exam-announcement::backdrop { background: #020617bb; backdrop-filter: blur(5px); }
.exam-announcement h2 { margin: 10px 0 18px; font-size: 1.65rem; line-height: 1.25; }
.exam-announcement p { line-height: 1.6; }
.exam-announcement .exam-footer { margin-top: 22px; }

/* Browser release: native purchase and rewarded-ad controls are unavailable. */
body.is-web #menu-pro,
body.is-web #btn-open-paywall,
body.is-web #btn-paywall-subscribe,
body.is-web #btn-paywall-watch-ad,
body.is-web #btn-paywall-restore {
  display: none !important;
}
