/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  /* Prevent pull-to-refresh interfering */
  overscroll-behavior-y: contain;
}

/* Prevent iOS double-tap zoom on buttons */
button, input { touch-action: manipulation; }

.hidden { display: none !important; }

/* ─── Name Screen ───────────────────────────────────────────────────────────── */
.name-screen {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: linear-gradient(135deg, #001f5b 0%, #0a3d8f 55%, #1565c0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.name-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo-icon { font-size: 34px; }

.logo-text {
  font-size: 30px;
  font-weight: 800;
  color: #001f5b;
  letter-spacing: -1px;
}

.logo-text-sm {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo-accent { color: #1493ff; }

.name-couple {
  font-size: 22px;
  font-weight: 800;
  color: #001f5b;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.name-tagline {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.name-heading {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 24px;
  line-height: 1.45;
}

.name-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.name-fields input {
  width: 100%;
  padding: 15px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px; /* must be ≥16px to prevent iOS zoom */
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  color: #1a1a2e;
  -webkit-appearance: none;
  appearance: none;
}

.name-fields input:focus { border-color: #1493ff; }

.btn-primary {
  width: 100%;
  padding: 16px;
  background: #1493ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.2px;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover  { background: #0d7de0; }
.btn-primary:active { transform: scale(0.98); background: #0d7de0; }

.name-tagline-sub {
  font-size: 22px;
  font-weight: 800;
  color: #1493ff;
  margin-top: 14px;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.name-disclaimer {
  margin-top: 14px;
  font-size: 15px;
  color: #374151;
}

.name-disclaimer strong {
  color: #001f5b;
}

.name-action-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #1493ff;
  text-decoration: none;
  letter-spacing: 0.2px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
  width: 100%;
  text-align: center;
}
.name-action-link:hover { color: #0d7de0; }

/* ─── Header ────────────────────────────────────────────────────────────────── */
.header {
  background: #001f5b;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav { display: flex; gap: 4px; }

.nav-link {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sign-out-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.sign-out-btn:hover  { background: rgba(255,255,255,0.1); color: #fff; }
.sign-out-btn:active { background: rgba(255,255,255,0.2); }

/* ─── Name Screen Countdown ─────────────────────────────────────────────────── */
.name-countdown {
  background: #001f5b;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: center;
}
.name-cd-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.name-cd-timer {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}
.name-countdown.urgent .name-cd-timer { color: #f87171; }
.name-countdown.closed .name-cd-timer { color: #f87171; font-size: 20px; }

/* ─── Betting Page Countdown Strip ──────────────────────────────────────────── */
.countdown-strip {
  background: #001433;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid #1493ff;
}
.cd-flag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  white-space: nowrap;
}
.cd-blocks {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 4px 10px;
  min-width: 48px;
}
.cd-num {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cd-unit {
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.8px;
  margin-top: 2px;
}
.cd-sep {
  font-size: 20px;
  font-weight: 800;
  color: rgba(255,255,255,0.3);
  padding-bottom: 12px;
}

/* Urgent state (< 10 min) */
.countdown-strip.urgent { background: #7f1d1d; border-bottom-color: #f87171; }
.countdown-strip.urgent .cd-num { color: #fca5a5; }
.countdown-strip.urgent .cd-flag { color: #fca5a5; animation: blink 1s infinite; }

/* Closed state */
.countdown-strip.closed { background: #1a1a1a; border-bottom-color: #6b7280; }
.countdown-strip.closed .cd-flag { color: #9ca3af; letter-spacing: 1px; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ─── Promo Bar ─────────────────────────────────────────────────────────────── */
.promo-bar {
  background: #0a3d8f;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.promo-badge {
  background: #e91e63;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.promo-text {
  font-size: 12px;
  line-height: 1.4;
}

/* ─── Desktop Layout ────────────────────────────────────────────────────────── */
.main-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px;
  /* On mobile we add bottom padding for the floating slip bar */
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 900px) {
  .main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
    padding-bottom: 40px;
  }
}

/* ─── Promo Banner ──────────────────────────────────────────────────────────── */
.promo-banner {
  background: linear-gradient(135deg, #001f5b 0%, #1493ff 100%);
  border-radius: 10px 10px 0 0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 3px solid #f59e0b;
}

.promo-banner-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.promo-banner-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #f59e0b;
  text-transform: uppercase;
}

.promo-banner-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.promo-banner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
  margin-top: 2px;
}

.promo-banner-right {
  font-size: 22px;
  font-weight: 900;
  color: #f59e0b;
  letter-spacing: -1px;
  text-align: center;
  line-height: 1;
  background: rgba(255,255,255,0.1);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 14px;
  flex-shrink: 0;
}

/* ─── Section Header ────────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 14px 16px;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #e5e7eb;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
}

.section-more {
  color: #1493ff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* ─── Prop Card ─────────────────────────────────────────────────────────────── */
.prop-card {
  background: #fff;
  border-bottom: 2px solid #1493ff;
}
.prop-card:last-child {
  border-bottom: none;
  border-radius: 0 0 10px 10px;
}

.prop-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 8px;
}

.prop-emoji {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.prop-question {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.45;
}

/* Options grid — columns determined by option count class */
.prop-btns {
  display: grid;
  gap: 7px;
  padding: 0 14px 12px;
}
.opts-2 { grid-template-columns: repeat(2, 1fr); }
.opts-3 { grid-template-columns: repeat(3, 1fr); }
.opts-4 { grid-template-columns: repeat(2, 1fr); }
.opts-5 { grid-template-columns: repeat(3, 1fr); }

.prop-meta {
  padding: 0 14px 12px calc(14px + 30px);
  font-size: 11px;
  color: #9ca3af;
  margin-top: -4px;
}

/* ─── Tiebreaker Time Picker ────────────────────────────────────────────────── */
.tiebreaker-wrap {
  padding: 0 14px 14px;
}

.tb-inputs-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin-bottom: 14px;
}

.tb-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tb-num-input {
  width: 64px;
  padding: 10px 6px;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  border: 2px solid #1493ff;
  border-radius: 8px;
  font-family: inherit;
  color: #001f5b;
  outline: none;
  background: #fff;
  -webkit-appearance: none;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
}
.tb-num-input::-webkit-inner-spin-button,
.tb-num-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.tb-num-input:focus { border-color: #001f5b; }

.tb-field-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #9ca3af;
  text-transform: uppercase;
}

.tb-colon {
  font-size: 28px;
  font-weight: 800;
  color: #1493ff;
  padding-bottom: 18px;
}

.tb-pm-badge {
  font-size: 22px;
  font-weight: 800;
  color: #001f5b;
  padding-bottom: 16px;
  margin-left: 6px;
}

.tb-hint {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin: 0;
}
.tiebreaker-wrap.filled .tb-hint {
  color: #16a34a;
}
.tiebreaker-wrap.filled .tb-hint::before {
  content: "✓ ";
  font-weight: 800;
}
.tiebreaker-wrap.filled .tb-num-input {
  border-color: #16a34a;
  background: #f0fdf4;
}

/* ─── Odds Button ───────────────────────────────────────────────────────────── */
.odds-btn {
  border: 1.5px solid #1493ff;
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.odds-btn:active { background: #e8f4ff; }

.odds-btn.selected {
  background: #1493ff;
  border-color: #1493ff;
}

.odds-btn.selected .odds-top,
.odds-btn.selected .odds-bottom { color: #fff; }

.odds-top {
  font-size: 11px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  word-break: break-word;
}

.odds-bottom {
  font-size: 12px;
  font-weight: 700;
  color: #1493ff;
  line-height: 1.3;
}

.odds-btn.selected .odds-bottom { color: rgba(255,255,255,0.85); }

.odds-na {
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  color: #d1d5db;
  font-size: 12px;
  background: #f9fafb;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ─── ───────────────────────────────────────────────────────────────────────── */
/*    DESKTOP BET SLIP (sidebar, ≥900px)                                        */
/* ─── ───────────────────────────────────────────────────────────────────────── */
.bet-slip-desktop {
  display: none;
}

@media (min-width: 900px) {
  .bet-slip-desktop {
    display: block;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    position: sticky;
    top: 72px;
  }
}

/* ─── ───────────────────────────────────────────────────────────────────────── */
/*    MOBILE FLOATING BAR + BOTTOM SHEET (< 900px)                              */
/* ─── ───────────────────────────────────────────────────────────────────────── */
.slip-fab {
  display: none;
}

@media (max-width: 899px) {
  .slip-fab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #001f5b;
    color: #fff;
    padding: 20px 22px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 200;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -4px 14px rgba(0,0,0,0.18);
  }

  .slip-fab-left {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .slip-fab-count {
    background: #1493ff;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .slip-fab-label {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.2px;
  }

  .slip-fab-action {
    font-size: 17px;
    font-weight: 700;
    color: #1493ff;
  }
}

/* ─── Bottom Sheet ──────────────────────────────────────────────────────────── */
.sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.sheet-overlay.open { display: block; }

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 400;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 12px auto 4px;
  flex-shrink: 0;
}

.sheet-scroll {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* ─── Shared Slip Styles (used in both desktop sidebar + mobile sheet) ────── */
.slip-header {
  background: #001f5b;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.slip-clear {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.slip-clear:hover { background: rgba(255,255,255,0.1); color: #fff; }

.slip-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
}

.slip-empty-icon { font-size: 36px; display: block; margin-bottom: 12px; }
.slip-empty p    { font-size: 14px; }

.slip-item {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f2f5;
}

.slip-item-question {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.slip-item-pick {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.slip-item-odds {
  color: #1493ff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.slip-remove {
  background: none;
  border: none;
  color: #d1d5db;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slip-remove:hover { color: #ef4444; }

.slip-footer {
  padding: 16px 18px;
  background: #f8f9fb;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.btn-submit {
  font-size: 16px;
  padding: 15px;
}

.slip-disclaimer {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 10px;
}

/* ─── See The Action Button (mobile strip) ──────────────────────────────────── */
.action-btn-mobile {
  display: block;
  background: #e8f4ff;
  color: #1493ff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  padding: 11px 16px;
  border-bottom: 2px solid #1493ff;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.1px;
}
.action-btn-mobile:hover { background: #d0eaff; }

@media (min-width: 900px) {
  .action-btn-mobile { display: none; }
}

/* ─── Site Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: #9ca3af;
  font-size: 11px;
  line-height: 1.8;
}
.site-footer strong { color: #6b7280; }

/* ─── Prop Card Error State ─────────────────────────────────────────────────── */
.prop-card.error {
  background: #fff5f5;
  box-shadow: inset 4px 0 0 #ef4444;
  border-bottom-color: #fca5a5;
}

.prop-card.error .prop-question {
  color: #b91c1c;
}

.prop-card.error .tb-num-input {
  border-color: #ef4444;
  background: #fef2f2;
}

/* ─── Validation Message ────────────────────────────────────────────────────── */
.validation-msg {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #991b1b;
  line-height: 1.5;
}

/* ─── Slip Success ──────────────────────────────────────────────────────────── */
.slip-success {
  padding: 40px 20px;
  text-align: center;
}

.success-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.slip-success h3 { font-size: 20px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }
.slip-success p  { font-size: 14px; color: #6b7280; }
