/**
 * PuttPoints Wager Modal & UI Styles
 * Uses course brand color and font via CSS custom properties
 */

/* Brand Integration Variables */
:root {
  --pp-brand: var(--scorecard-brand-color, #3B82F6);
  --pp-font: var(--primary-font, 'Rubik', sans-serif);
  --pp-brand-light: color-mix(in srgb, var(--pp-brand) 15%, white);
  --pp-brand-dark: color-mix(in srgb, var(--pp-brand) 80%, black);
  --pp-brand-glow: color-mix(in srgb, var(--pp-brand) 40%, transparent);
}

/* Modal Backdrop & Container */
.putt-points-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.putt-points-modal-backdrop.active {
  opacity: 1;
}

.putt-points-modal-container {
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.putt-points-modal-backdrop.active .putt-points-modal-container {
  transform: scale(1);
}

.putt-points-modal-card {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  border-radius: 24px;
  padding: 26px 22px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--pp-font);
  color: #e2e8f0;
}

/* Header */
.wager-modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.wager-modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #34d399;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--pp-font);
}

@keyframes pulse-brand {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.wager-modal-subtitle {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
}

/* Your Stack Section (Endowment Effect Trigger) */
.your-stack-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 22px;
  text-align: center;
  margin-bottom: 22px;
  box-shadow: none;
}

.stack-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stack-amount-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.stack-amount {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stack-unit {
  font-size: 20px;
  font-weight: 700;
  color: #94a3b8;
}

.earned-reminder {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  margin-top: 6px;
}

/* Wager Options Container */
.wager-options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.wager-option-btn {
  background: #1e293b;
  border: 1.5px solid #334155;
  border-radius: 16px;
  padding: 16px 18px;
  min-height: 60px;
  min-width: 44px; /* Touch target */
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  color: #f1f5f9;
}

.wager-option-btn:hover {
  border-color: #10b981;
  background: #243042;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(16, 185, 129, 0.4);
}

.wager-option-btn:active {
  transform: translateY(0);
}

.wager-option-btn.extreme-risk {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  border-color: #ef4444;
  animation: extreme-pulse 1.5s ease-in-out infinite;
}

@keyframes extreme-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.wager-option-btn.extreme-risk:hover {
  border-color: #f87171;
  background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
}

.wager-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.wager-badge.popular {
  background: #10b981;
  color: white;
}

.wager-badge.extreme {
  background: #ef4444;
  color: white;
  animation: badge-flash 1s ease-in-out infinite;
}

@keyframes badge-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.wager-option-risk {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.wager-option-win {
  font-size: 14px;
  font-weight: 600;
  color: #34d399;
}

/* Loss Handling Info */
.loss-handling-info {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 16px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.loss-handling-info .text-red-600 {
  color: #f87171;
}

/* Skip Button */
.skip-wager-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid #334155;
  border-radius: 16px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.skip-wager-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: #475569;
  color: #cbd5e1;
}

/* Countdown Timer */
.wager-timer {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  padding: 12px;
  background: transparent;
  border-radius: 8px;
}

.wager-timer.urgent {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  animation: timer-urgent 0.5s ease-in-out infinite;
}

#wager-countdown.urgent {
  font-size: 18px;
  font-weight: 800;
}

@keyframes timer-urgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Sticky Points Counter (Always Visible) */
.sticky-points-counter {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #fef3c7 0%, #fde047 100%);
  border-bottom: 3px solid #facc15;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.points-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #fde047;
}

.points-player-row:last-child {
  border-bottom: none;
}

.points-player-name {
  font-weight: 600;
  color: #92400e;
  font-size: 14px;
}

.points-player-points {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.points-value {
  font-size: 20px;
  font-weight: 800;
  color: #92400e;
}

.points-unit {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
}

.points-rank {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-left: 8px;
}

/* Point Counter Animations (Psychological Feedback) */
@keyframes points-gain {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); color: #10b981; }
  100% { transform: scale(1); }
}

@keyframes points-loss {
  0% { transform: scale(1); }
  50% { transform: scale(0.9); color: #ef4444; }
  100% { transform: scale(1); }
}

.points-value.gaining {
  animation: points-gain 0.6s ease;
}

.points-value.losing {
  animation: points-loss 0.6s ease;
}

/* Screen Flash Effects */
@keyframes flash-green {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(16, 185, 129, 0.2); }
}

@keyframes flash-red {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(239, 68, 68, 0.3); }
}

.screen-flash-green {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  animation: flash-green 0.5s ease;
}

.screen-flash-red {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  animation: flash-red 0.5s ease;
}

/* Responsive Design - Mobile First */
/* Small screens (mobile) */
@media (max-width: 640px) {
  .putt-points-modal-backdrop {
    padding: 12px;
  }

  .putt-points-modal-card {
    padding: 20px 16px;
    border-radius: 8px;
  }

  .wager-modal-title {
    font-size: 20px;
  }

  .wager-modal-subtitle {
    font-size: 12px;
  }

  .your-stack-section {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 18px;
  }

  .stack-amount {
    font-size: 28px;
  }

  .stack-unit {
    font-size: 14px;
  }

  .earned-reminder {
    font-size: 11px;
  }

  .wager-options-container {
    gap: 8px;
  }

  .wager-option-btn {
    padding: 12px 14px;
    min-height: 52px;
    border-radius: 8px;
  }

  .wager-badge {
    font-size: 9px;
    padding: 3px 8px;
    margin-bottom: 6px;
  }

  .wager-option-risk {
    font-size: 13px;
  }

  .wager-option-win {
    font-size: 12px;
  }

  .loss-handling-info {
    font-size: 11px;
    padding: 6px;
    margin-bottom: 12px;
  }

  .skip-wager-btn {
    padding: 12px;
    min-height: 44px;
    font-size: 13px;
    margin-bottom: 12px;
  }

  .wager-timer {
    padding: 8px;
    font-size: 12px;
  }
}

/* Tablet Portrait (768px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .putt-points-modal-container {
    max-width: 460px;
  }

  .putt-points-modal-card {
    padding: 24px 22px;
    border-radius: 8px;
  }

  .wager-modal-title {
    font-size: 26px;
    margin-bottom: 6px;
  }

  .wager-modal-subtitle {
    font-size: 14px;
  }

  .your-stack-section {
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 22px;
  }

  .stack-amount {
    font-size: 38px;
  }

  .stack-unit {
    font-size: 18px;
  }

  .wager-options-container {
    gap: 10px;
  }

  .wager-option-btn {
    padding: 14px 18px;
    min-height: 58px;
    border-radius: 8px;
  }

  .wager-option-risk {
    font-size: 15px;
  }

  .wager-option-win {
    font-size: 14px;
  }

  .skip-wager-btn {
    padding: 14px;
    min-height: 46px;
    font-size: 15px;
  }

  .wager-timer {
    padding: 11px;
    font-size: 14px;
  }
}

/* Feedback Modal Styles */
.feedback-modal {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.feedback-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
  font-family: var(--pp-font);
}

.feedback-modal.feedback-success .feedback-title {
  color: #10b981;
}

.feedback-modal.feedback-loss .feedback-title {
  color: #ef4444;
}

.feedback-modal.feedback-regret .feedback-title {
  color: #dc2626;
  animation: shake 0.5s ease;
}

.feedback-modal.feedback-near-miss .feedback-title {
  color: #f59e0b;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.feedback-message {
  margin: 20px 0;
  color: #374151;
  line-height: 1.6;
}

.feedback-button {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--pp-brand) 0%, var(--pp-brand-dark) 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
  font-family: var(--pp-font);
}

.feedback-button:hover {
  background: linear-gradient(135deg, var(--pp-brand-dark) 0%, var(--pp-brand) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--pp-brand-glow);
}

.feedback-button:active {
  transform: translateY(0);
}

/* Leaderboard Highlight Animations */
.leaderboard-winning {
  animation: highlight-green 2s ease;
}

.leaderboard-losing {
  animation: highlight-red 2s ease;
}

@keyframes highlight-green {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(16, 185, 129, 0.2); }
}

@keyframes highlight-red {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(239, 68, 68, 0.2); }
}

/* Toast Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Confetti fallback (if canvas-confetti not available) */
.confetti-particle {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #10b981;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Game Summary Styles */
.feedback-modal.feedback-summary {
  max-width: 600px;
}

.feedback-modal.feedback-summary .feedback-title {
  color: var(--pp-brand);
}

/* Dark Mode Support - Using html.dark and [data-theme="dark"] selectors */
/* These match the theme-toggle.js implementation */
html.dark .putt-points-modal-card,
[data-theme="dark"] .putt-points-modal-card,
.dark .putt-points-modal-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

html.dark .wager-modal-title,
[data-theme="dark"] .wager-modal-title,
.dark .wager-modal-title {
  color: var(--pp-brand-light) !important;
}

html.dark .wager-modal-subtitle,
[data-theme="dark"] .wager-modal-subtitle,
.dark .wager-modal-subtitle {
  color: #94a3b8 !important;
}

/* Modernized: the wager modal is an always-dark glass surface (light AND dark
   scorecard themes), so these dark overrides now MATCH the base look — keep the
   stack transparent with the gold gradient number rather than the old brown box. */
html.dark .your-stack-section,
[data-theme="dark"] .your-stack-section,
.dark .your-stack-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html.dark .stack-label,
html.dark .earned-reminder,
[data-theme="dark"] .stack-label,
[data-theme="dark"] .earned-reminder,
.dark .stack-label,
.dark .earned-reminder {
  color: #64748b !important;
}

html.dark .stack-unit,
[data-theme="dark"] .stack-unit,
.dark .stack-unit {
  color: #94a3b8 !important;
}

html.dark .wager-option-btn,
[data-theme="dark"] .wager-option-btn,
.dark .wager-option-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

html.dark .wager-option-btn:hover,
[data-theme="dark"] .wager-option-btn:hover,
.dark .wager-option-btn:hover {
  background: #243042 !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 12px var(--pp-brand-glow) !important;
}

html.dark .wager-option-btn.extreme-risk,
[data-theme="dark"] .wager-option-btn.extreme-risk,
.dark .wager-option-btn.extreme-risk {
  background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%) !important;
  border-color: #dc2626 !important;
}

html.dark .wager-option-btn.extreme-risk:hover,
[data-theme="dark"] .wager-option-btn.extreme-risk:hover,
.dark .wager-option-btn.extreme-risk:hover {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

html.dark .wager-option-risk,
[data-theme="dark"] .wager-option-risk,
.dark .wager-option-risk {
  color: #e2e8f0 !important;
}

html.dark .wager-option-win,
[data-theme="dark"] .wager-option-win,
.dark .wager-option-win {
  color: #4ade80 !important;
}

html.dark .loss-handling-info,
[data-theme="dark"] .loss-handling-info,
.dark .loss-handling-info {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border: 1px solid #334155 !important;
}

html.dark .loss-handling-info .text-red-600,
[data-theme="dark"] .loss-handling-info .text-red-600,
.dark .loss-handling-info .text-red-600 {
  color: #f87171 !important;
}

html.dark .skip-wager-btn,
[data-theme="dark"] .skip-wager-btn,
.dark .skip-wager-btn {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}

html.dark .skip-wager-btn:hover,
[data-theme="dark"] .skip-wager-btn:hover,
.dark .skip-wager-btn:hover {
  background: #475569 !important;
  border-color: #64748b !important;
  color: #f1f5f9 !important;
}

html.dark .wager-timer,
[data-theme="dark"] .wager-timer,
.dark .wager-timer {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border: 1px solid #334155 !important;
}

html.dark .wager-timer.urgent,
[data-theme="dark"] .wager-timer.urgent,
.dark .wager-timer.urgent {
  background: #7f1d1d !important;
  color: #fecaca !important;
  border-color: #dc2626 !important;
}

html.dark .feedback-message,
[data-theme="dark"] .feedback-message,
.dark .feedback-message {
  color: #cbd5e1 !important;
}

/* Feedback message text classes with dark mode support */
.feedback-text-primary {
  color: #374151;
}

.feedback-text-secondary {
  color: #6b7280;
}

.feedback-text-highlight {
  color: #92400e;
}

html.dark .feedback-text-primary,
[data-theme="dark"] .feedback-text-primary,
.dark .feedback-text-primary {
  color: #e2e8f0 !important;
}

html.dark .feedback-text-secondary,
[data-theme="dark"] .feedback-text-secondary,
.dark .feedback-text-secondary {
  color: #94a3b8 !important;
}

html.dark .feedback-text-highlight,
[data-theme="dark"] .feedback-text-highlight,
.dark .feedback-text-highlight {
  color: #fef3c7 !important;
}

/* Dark mode for regret box */
html.dark .feedback-regret-box,
[data-theme="dark"] .feedback-regret-box,
.dark .feedback-regret-box {
  background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%) !important;
  border-color: #dc2626 !important;
}

html.dark .feedback-regret-box .regret-label,
[data-theme="dark"] .feedback-regret-box .regret-label,
.dark .feedback-regret-box .regret-label {
  color: #fecaca !important;
}

/* Dark mode for game summary */
html.dark .feedback-summary .podium-row,
[data-theme="dark"] .feedback-summary .podium-row,
.dark .feedback-summary .podium-row {
  color: #f1f5f9 !important;
}

html.dark .pool-distribution,
[data-theme="dark"] .pool-distribution,
.dark .pool-distribution {
  background: linear-gradient(135deg, #422006 0%, #78350f 100%) !important;
}

html.dark .pool-distribution .pool-title,
[data-theme="dark"] .pool-distribution .pool-title,
.dark .pool-distribution .pool-title {
  color: #fef3c7 !important;
}

html.dark .pool-distribution .pool-row,
[data-theme="dark"] .pool-distribution .pool-row,
.dark .pool-distribution .pool-row {
  color: #e2e8f0 !important;
}

html.dark .feedback-button,
[data-theme="dark"] .feedback-button,
.dark .feedback-button {
  background: linear-gradient(135deg, var(--pp-brand) 0%, var(--pp-brand-dark) 100%) !important;
}

html.dark .feedback-button:hover,
[data-theme="dark"] .feedback-button:hover,
.dark .feedback-button:hover {
  background: linear-gradient(135deg, var(--pp-brand-light) 0%, var(--pp-brand) 100%) !important;
}

/* Dark mode for wager badges */
html.dark .wager-badge.popular,
[data-theme="dark"] .wager-badge.popular,
.dark .wager-badge.popular {
  background: #059669 !important;
}

html.dark .wager-badge.extreme,
[data-theme="dark"] .wager-badge.extreme,
.dark .wager-badge.extreme {
  background: #dc2626 !important;
}

/* System preference dark mode (fallback - only if no explicit theme set) */
@media (prefers-color-scheme: dark) {
  html:not(.dark):not([data-theme="light"]) .putt-points-modal-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    border: 1px solid #334155;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.3);
  }

  html:not(.dark):not([data-theme="light"]) .wager-modal-title {
    color: var(--pp-brand-light);
  }

  html:not(.dark):not([data-theme="light"]) .wager-modal-subtitle {
    color: #94a3b8;
  }

  html:not(.dark):not([data-theme="light"]) .your-stack-section {
    background: transparent;
    border: none;
  }

  html:not(.dark):not([data-theme="light"]) .stack-label,
  html:not(.dark):not([data-theme="light"]) .earned-reminder {
    color: #64748b;
  }

  html:not(.dark):not([data-theme="light"]) .stack-unit {
    color: #94a3b8;
  }

  html:not(.dark):not([data-theme="light"]) .wager-option-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
    box-shadow: none;
  }

  html:not(.dark):not([data-theme="light"]) .wager-option-btn:hover {
    background: color-mix(in srgb, var(--pp-brand) 20%, #1e293b);
    border-color: var(--pp-brand);
    box-shadow: 0 4px 12px var(--pp-brand-glow);
  }

  html:not(.dark):not([data-theme="light"]) .wager-option-btn.extreme-risk {
    background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
    border-color: #dc2626;
  }

  html:not(.dark):not([data-theme="light"]) .wager-option-risk {
    color: #e2e8f0;
  }

  html:not(.dark):not([data-theme="light"]) .wager-option-win {
    color: #4ade80;
  }

  html:not(.dark):not([data-theme="light"]) .loss-handling-info {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
  }

  html:not(.dark):not([data-theme="light"]) .loss-handling-info .text-red-600 {
    color: #f87171;
  }

  html:not(.dark):not([data-theme="light"]) .skip-wager-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
  }

  html:not(.dark):not([data-theme="light"]) .skip-wager-btn:hover {
    background: #475569;
    color: #f1f5f9;
  }

  html:not(.dark):not([data-theme="light"]) .wager-timer {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
  }

  html:not(.dark):not([data-theme="light"]) .feedback-message {
    color: #cbd5e1;
  }
}

/* ============================================ */
/* UTILITY CLASSES (for JS inline style removal) */
/* ============================================ */

.wager-helper-text {
  font-size: 16px;
  color: #94a3b8;
  font-family: var(--pp-font);
}

.wager-confirmed-text {
  font-size: 24px;
  font-weight: 800;
  color: #4ade80;
  margin-bottom: 24px;
  font-family: var(--pp-font);
}

.wager-highlight-text {
  color: var(--pp-brand-light);
  font-weight: 700;
}

.wager-player-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  font-family: var(--pp-font);
}

/* Feedback modal utility classes */
.feedback-points-won {
  font-size: 48px;
  font-weight: 900;
  color: #10b981;
  margin: 20px 0;
  font-family: var(--pp-font);
}

.feedback-points-lost {
  font-size: 36px;
  font-weight: 800;
  color: #ef4444;
  margin: 20px 0;
  font-family: var(--pp-font);
}

.feedback-near-miss-distance {
  font-size: 36px;
  font-weight: 800;
  color: #ef4444;
  margin: 20px 0;
  font-family: var(--pp-font);
}

.regret-missed-amount {
  font-size: 56px;
  font-weight: 900;
  color: #dc2626;
  font-family: var(--pp-font);
}

/* Points toast */
.points-toast {
  position: fixed;
  bottom: 280px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: linear-gradient(135deg, #fef3c7 0%, #fde047 100%);
  border: 2px solid #facc15;
  border-radius: 8px;
  padding: 8px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: fadeInUp 0.3s ease;
  text-align: center;
  white-space: nowrap;
  font-family: var(--pp-font);
}

.points-toast-name {
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
}

.points-toast-value {
  font-size: 16px;
  font-weight: 900;
  color: #059669;
  margin-left: 8px;
}

.points-toast-reason {
  font-size: 11px;
  color: #b45309;
  margin-left: 6px;
}

/* Game summary podium */
.podium-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  margin: 8px 0;
  border-radius: 12px;
  border-width: 2px;
  border-style: solid;
  font-family: var(--pp-font);
}

.podium-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.podium-medal {
  font-size: 32px;
}

.podium-name {
  font-size: 18px;
  font-weight: 700;
}

.podium-score {
  font-size: 24px;
  font-weight: 900;
}

/* Dark mode for utility classes */
html.dark .feedback-points-won,
[data-theme="dark"] .feedback-points-won,
.dark .feedback-points-won {
  color: #4ade80 !important;
}

html.dark .feedback-points-lost,
html.dark .feedback-near-miss-distance,
[data-theme="dark"] .feedback-points-lost,
[data-theme="dark"] .feedback-near-miss-distance,
.dark .feedback-points-lost,
.dark .feedback-near-miss-distance {
  color: #f87171 !important;
}

html.dark .regret-missed-amount,
[data-theme="dark"] .regret-missed-amount,
.dark .regret-missed-amount {
  color: #f87171 !important;
}

html.dark .podium-name,
[data-theme="dark"] .podium-name,
.dark .podium-name {
  color: #f1f5f9 !important;
}

html.dark .podium-score,
[data-theme="dark"] .podium-score,
.dark .podium-score {
  color: #f1f5f9 !important;
}

/* ============================================ */
/* PASS-THE-PHONE WAGER COLLECTION OVERLAY      */
/* ============================================ */

/* Overlay Container */
.wager-overlay {
  background: radial-gradient(ellipse at center top, #1e293b 0%, #0f172a 50%, #020617 100%);
  border-top: 3px solid var(--pp-brand);
  font-family: var(--pp-font);
}

/* Brand accent glow at top */
.wager-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 80px;
  background: radial-gradient(ellipse, var(--pp-brand-glow) 0%, transparent 70%);
  pointer-events: none;
}

/* Screen Titles */
.wager-screen-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-family: var(--pp-font);
}

.wager-screen-subtitle {
  font-size: 20px;
  font-weight: 700;
  color: var(--pp-brand);
  margin-bottom: 24px;
  font-family: var(--pp-font);
}

/* Animated Brand Coin Icon */
.wager-coin-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--pp-brand) 0%, var(--pp-brand-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 30px var(--pp-brand-glow), 0 0 60px color-mix(in srgb, var(--pp-brand) 15%, transparent);
  animation: coin-glow 2s ease-in-out infinite;
  border: 3px solid var(--pp-brand-light);
}

.wager-coin-icon svg {
  width: 40px;
  height: 40px;
  color: #fffbeb;
}

@keyframes coin-glow {
  0%, 100% { box-shadow: 0 0 30px var(--pp-brand-glow), 0 0 60px color-mix(in srgb, var(--pp-brand) 15%, transparent); }
  50% { box-shadow: 0 0 40px var(--pp-brand-glow), 0 0 80px color-mix(in srgb, var(--pp-brand) 25%, transparent); }
}

/* Player Count Pill */
.wager-player-pill {
  display: inline-block;
  background: color-mix(in srgb, var(--pp-brand) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--pp-brand) 30%, transparent);
  color: var(--pp-brand-light);
  font-size: 16px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 8px;
}

/* First Up Text */
.wager-first-up {
  font-size: 18px;
  color: #94a3b8;
  margin-bottom: 32px;
}

.wager-first-up span {
  color: #ffffff;
  font-weight: 700;
}

/* Primary CTA Button (Brand Gradient) */
.wager-cta-btn {
  background: linear-gradient(135deg, var(--pp-brand) 0%, var(--pp-brand-dark) 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  padding: 18px 40px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px var(--pp-brand-glow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 200px;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--pp-font);
}

.wager-cta-btn:hover {
  background: linear-gradient(135deg, var(--pp-brand-light) 0%, var(--pp-brand) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px var(--pp-brand-glow);
}

.wager-cta-btn:active {
  transform: scale(0.97);
}

/* Green CTA Variant — "Let's Play!" confirmation */
.wager-cta-btn.green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.wager-cta-btn.green:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.45);
}

/* Player Color Indicator with Glow */
.wager-player-indicator {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.wager-player-indicator::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Player Number Pill */
.wager-player-num-pill {
  display: inline-block;
  background: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 12px;
  margin-bottom: 32px;
}

/* Points Display (Gold Stack Style) */
.wager-points-display {
  background: linear-gradient(135deg, #422006 0%, #78350f 100%);
  border: 2px solid #a16207;
  border-radius: 12px;
  padding: 16px 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(161, 98, 7, 0.3);
  width: 100%;
  max-width: 360px;
}

.wager-points-label {
  font-size: 12px;
  font-weight: 600;
  color: #fcd34d;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.wager-points-value {
  font-size: 36px;
  font-weight: 900;
  color: #fef3c7;
  line-height: 1;
}

.wager-points-unit {
  font-size: 16px;
  font-weight: 700;
  color: #fcd34d;
  margin-left: 4px;
}

/* Wager Question */
.wager-question {
  font-size: 20px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 16px;
}

/* Wager Percentage Buttons (Card Style) */
.wager-pct-btn {
  position: relative;
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  border: 2px solid #475569;
  border-radius: 12px;
  padding: 14px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.wager-pct-btn:active {
  transform: scale(0.95);
}

/* Low Risk (Green Tint) */
.wager-pct-btn.low-risk {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #064e3b 0%, #1e293b 100%);
}

.wager-pct-btn.low-risk:hover {
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

/* Medium Risk (Amber Tint) */
.wager-pct-btn.medium-risk {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, #78350f 0%, #1e293b 100%);
}

.wager-pct-btn.medium-risk:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

/* High Risk (Red Tint) */
.wager-pct-btn.high-risk {
  border-color: rgba(239, 68, 68, 0.5);
  background: linear-gradient(135deg, #7f1d1d 0%, #1e293b 100%);
  animation: high-risk-pulse 2s ease-in-out infinite;
}

.wager-pct-btn.high-risk:hover {
  border-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

@keyframes high-risk-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Badge inside wager pct buttons */
.wager-pct-btn .wager-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  border-radius: 0 10px 0 8px;
  font-size: 9px;
  padding: 3px 8px;
  margin-bottom: 0;
}

/* Percentage Label */
.wager-pct-label {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 4px;
}

/* Amount at Risk */
.wager-pct-amount {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 2px;
}

/* Potential Win */
.wager-pct-win {
  font-size: 13px;
  font-weight: 700;
  color: #4ade80;
}

/* Multiplier Info */
.wager-multiplier-info {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
  text-align: center;
}

.wager-multiplier-info span {
  color: var(--pp-brand-light);
  font-weight: 700;
}

/* Skip Wager Button (proper styled button) */
.wager-skip-btn {
  width: 100%;
  max-width: 360px;
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.wager-skip-btn:hover {
  background: rgba(100, 116, 139, 0.25);
  border-color: rgba(100, 116, 139, 0.5);
  color: #cbd5e1;
}

.wager-skip-btn:active {
  transform: scale(0.97);
}

/* Handoff Screen Card */
.wager-handoff-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--pp-brand) 10%, transparent) 0%, color-mix(in srgb, var(--pp-brand) 5%, transparent) 100%);
  border: 2px solid color-mix(in srgb, var(--pp-brand) 25%, transparent);
  border-radius: 16px;
  padding: 24px 32px;
  margin-bottom: 32px;
  text-align: center;
}

.wager-handoff-label {
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.wager-handoff-name {
  font-size: 32px;
  font-weight: 800;
  color: var(--pp-brand-light);
}

.wager-handoff-icon {
  font-size: 14px;
  color: #64748b;
  margin-top: 12px;
}

/* Confirmed Checkmark */
.wager-confirmed-check {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
  border: 3px solid rgba(52, 211, 153, 0.4);
}

.wager-confirmed-check svg {
  width: 36px;
  height: 36px;
  color: #ffffff;
}

/* Complete Screen - Brand Celebratory Check */
.wager-complete-check {
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, var(--pp-brand) 0%, var(--pp-brand-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px var(--pp-brand-glow), 0 0 80px color-mix(in srgb, var(--pp-brand) 15%, transparent);
  border: 3px solid var(--pp-brand-light);
  animation: coin-glow 2s ease-in-out infinite;
}

.wager-complete-check svg {
  width: 48px;
  height: 48px;
  color: #fffbeb;
}

/* Wager Summary Pill */
.wager-summary-pill {
  display: inline-block;
  background: color-mix(in srgb, var(--pp-brand) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--pp-brand) 30%, transparent);
  color: var(--pp-brand-light);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 20px;
  margin-bottom: 32px;
}

/* Wager button grid */
.wager-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 360px;
}

/* Mobile responsive for wager overlay */
@media (max-width: 640px) {
  .wager-screen-title {
    font-size: 26px;
  }

  .wager-screen-subtitle {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .wager-coin-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
  }

  .wager-coin-icon svg {
    width: 32px;
    height: 32px;
  }

  .wager-cta-btn {
    font-size: 18px;
    padding: 16px 32px;
    min-width: 180px;
  }

  .wager-player-indicator {
    width: 80px;
    height: 80px;
  }

  .wager-points-value {
    font-size: 28px;
  }

  .wager-points-display {
    padding: 12px 20px;
  }

  .wager-pct-btn {
    min-height: 80px;
    padding: 12px 8px;
    border-radius: 10px;
  }

  .wager-pct-label {
    font-size: 20px;
  }

  .wager-pct-amount {
    font-size: 11px;
  }

  .wager-pct-win {
    font-size: 12px;
  }

  .wager-btn-grid {
    gap: 8px;
  }

  .wager-handoff-name {
    font-size: 26px;
  }

  .wager-handoff-card {
    padding: 20px 24px;
  }

  .wager-complete-check {
    width: 80px;
    height: 80px;
  }

  .wager-complete-check svg {
    width: 40px;
    height: 40px;
  }
}

/* Light mode overrides for wager overlay */
/* The overlay is always dark-themed since it's a full-screen takeover,
   but we add body.dark-mode compatibility for scorecard context */
body.dark-mode .wager-overlay,
html.dark .wager-overlay,
[data-theme="dark"] .wager-overlay,
.dark .wager-overlay {
  background: radial-gradient(ellipse at center top, #1e293b 0%, #0f172a 50%, #020617 100%);
}
