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

:root {
  --purple:       #7B2FBE;
  --purple-dark:  #5B1FA0;
  --purple-light: #B57BFF;
  --btn-gradient: linear-gradient(135deg, #7B2FBE, #B57BFF);
  --bg:           #0D001A;
  --bg-deep:      #070010;
  --surface:      rgba(255, 255, 255, 0.07);
  --surface-2:    rgba(255, 255, 255, 0.10);
  --surface-3:    rgba(255, 255, 255, 0.05);
  --text:         #ffffff;
  --text-muted:   #9ca3af;
  --error:        #ef4444;
  --neon:         #B57BFF;
  --neon-glow:    0 0 28px rgba(181, 123, 255, 0.40);
  --radius:       12px;
  --nav-height:   64px;
}

html, body {
  height: 100%;
  background: linear-gradient(160deg, #0D001A 0%, #1A0533 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ── Pages ── */
.page {
  min-height: 100dvh;
  padding-bottom: 104px;
}

.page.active { display: block; }
.hidden      { display: none !important; }

/* ── Auth screen ── */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 20px;
  max-width: 420px;
  margin: 0 auto;
}

.logo {
  width: 110px;
  height: auto;
  margin-bottom: 20px;
  border-radius: 24px;
}

.app-name {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.tagline {
  color: var(--text-muted);
  margin-bottom: 36px;
  text-align: center;
  text-transform: capitalize;
}

/* ── Auth tabs ── */
.auth-tabs {
  display: flex;
  width: 100%;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.auth-tab.active {
  background: var(--btn-gradient);
  color: #fff;
}

/* ── Forms ── */
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  min-height: 44px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--purple-light);
}

input::placeholder {
  color: var(--text-muted);
}

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--btn-gradient);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 44px;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Error messages ── */
.error-msg {
  color: var(--error);
  font-size: 0.875rem;
  text-align: center;
  padding: 8px;
}

/* ── Loading spinner ── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--purple-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Bottom navigation ── */
#bottom-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 340px;
  height: 64px;
  background: rgba(20, 4, 40, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding: 0 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 4px;
  border-radius: 9999px;
  transition: color 0.2s, background 0.2s;
}

.nav-btn.active {
  color: var(--purple-light);
  background: rgba(181, 123, 255, 0.14);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

/* ── General page header ── */
.page-header {
  padding: 20px 16px 12px;
  font-size: 1.4rem;
  font-weight: 700;
}

/* ── Card ── */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 12px;
}

/* ── Profile screen ── */
.profile-avatar-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0 16px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--btn-gradient);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.profile-value {
  font-size: 1rem;
  font-weight: 500;
}

.profile-points {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--purple-light);
}

/* ── Secondary / danger button (used for log out) ── */
.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--error);
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid var(--error);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--error);
  color: #fff;
}

/* ════════════════════════════════════════
   HOME DASHBOARD — bento grid
   ════════════════════════════════════════ */

.home-dashboard {
  background: var(--bg-deep);
  min-height: 100%;
  padding: 16px 16px 120px;
}

/* Dashboard header — "Matchweek 31" */
.dash-header {
  padding: 8px 0 16px;
}

.dash-header .dash-week-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.dash-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-top: 2px;
}

/* The 2-column bento grid */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Base card — fade-up on load */
.bento-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.4s ease forwards;
}

/* Full-width card spans both columns */
.bento-card--full {
  grid-column: 1 / -1;
}

/* Staggered animation delays */
.bento-card:nth-child(1) { animation-delay: 0.05s; }
.bento-card:nth-child(2) { animation-delay: 0.10s; }
.bento-card:nth-child(3) { animation-delay: 0.15s; }
.bento-card:nth-child(4) { animation-delay: 0.20s; }
.bento-card:nth-child(5) { animation-delay: 0.25s; }
.bento-card:nth-child(6) { animation-delay: 0.30s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Info cards (Rank & Lockdown Timer) ── */
.info-card-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.info-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.info-card-value--green { color: var(--purple-light); }

.info-card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Countdown timer digits */
.timer-display {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 4px;
}

.timer-display--locked {
  color: var(--error);
  font-size: 1rem;
}

/* ── Prediction carousel ── */

/* Scroll-snap track */
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 0;
  scroll-behavior: smooth;
  border-radius: 12px;
}

.carousel-track::-webkit-scrollbar { display: none; }

/* Individual match prediction card */
.match-card {
  min-width: 100%;
  scroll-snap-align: start;
  background: var(--surface-3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 20px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Neon glow applied after a prediction is saved */
.match-card.saved {
  box-shadow: var(--neon-glow);
  border-color: var(--neon);
}

/* Team row */
.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 8px;
}

.match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.team-crest {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.team-name {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
}

.match-vs {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.match-kickoff {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Score steppers — minus / number / plus */
.score-steppers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.stepper {
  display: flex;
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 10px;
  overflow: hidden;
}

.stepper-btn {
  width: 40px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s;
}

.stepper-btn:active { background: var(--surface-2); }

.stepper-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.stepper-value {
  min-width: 36px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.score-dash {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Lock In button */
.btn-lock-in {
  width: 100%;
  padding: 12px;
  background: var(--btn-gradient);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
  transition: opacity 0.2s;
}

.btn-lock-in:hover { opacity: 0.88; }

.btn-lock-in:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Carousel navigation — arrows + dots */
.carousel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.carousel-arrow {
  width: 36px;
  height: 36px;
  background: var(--surface-2);
  border: none;
  border-radius: 50%;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  min-height: 36px;
}

.carousel-arrow:disabled { opacity: 0.3; cursor: not-allowed; }

.carousel-dots {
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface-2);
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
  background: var(--purple-light);
  transform: scale(1.3);
}

/* Counter showing "3 / 10" */
.carousel-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Missed matchweek banner ── */
.missed-banner {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
}

.missed-banner .missed-icon { font-size: 2rem; margin-bottom: 8px; }
.missed-banner p { font-size: 0.9rem; line-height: 1.5; }

/* ── Season progress card ── */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-pct {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--purple-light);
}

.progress-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.progress-bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--btn-gradient);
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* ── Recent results ── */
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.result-info { flex: 1; }

.result-match {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.result-prediction {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.result-points {
  font-size: 1rem;
  font-weight: 800;
  color: var(--purple-light);
  white-space: nowrap;
  margin-left: 8px;
}

/* ════════════════════════════════════════
   SEASON PREDICTIONS SCREEN
   ════════════════════════════════════════ */

.season-locked-banner {
  border: 1px solid var(--error) !important;
}

.season-locked-msg {
  text-align: center;
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 0;
}

/* Section title and subtitle inside each card */
.season-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.season-section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
}

/* Pick row: position label (1st / 18th) + team dropdown */
.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pick-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pick-position {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 40px;
}

.pick-select {
  flex: 1;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  min-height: 44px;
  cursor: pointer;
  outline: none;
  max-width: 100%;
}

.pick-select:focus { border-color: var(--purple-light); }

.pick-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pick-select option {
  background: #1A0533;
  color: #fff;
}

/* Award row: icon + label + pts chip, then a text input below */
.award-row {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-bottom: 8px;
}

.award-row:last-child {
  margin-bottom: 0;
}

.award-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.award-icon { font-size: 1.1rem; flex-shrink: 0; }

.award-label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.award-pts {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--purple-light);
  background: rgba(123, 47, 190, 0.15);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Override global input[type="text"] background so it shows inside the card */
input.award-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  border-radius: 9999px;
  font-size: 0.875rem;
  padding: 10px 18px;
}

input.award-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Season timer card — matches home screen timer style */
.season-timer-card {
  text-align: center;
  padding: 20px 16px;
}

.season-timer-card .info-card-label {
  margin-bottom: 6px;
}

.season-timer-card .timer-display {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

/* Autocomplete wrapper and dropdown */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(26, 5, 51, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  z-index: 50;
  overflow: hidden;
}

.ac-item {
  padding: 12px 14px;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.ac-item:last-child { border-bottom: none; }

.ac-item:hover,
.ac-item:active { background: var(--surface-3); }

/* ════════════════════════════════════════
   LEADERBOARD SCREEN
   ════════════════════════════════════════ */

.lb-screen {
  padding: 24px 16px;
}

.lb-header {
  margin-bottom: 20px;
}

.lb-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
}

.lb-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Tab switcher ── */
.lb-tabs {
  display: flex;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.lb-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
  min-height: 44px;
}

.lb-tab--active {
  background: var(--btn-gradient);
  color: #fff;
}

/* ── Current user's rank card ── */
.lb-my-rank {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.lb-my-rank-shield {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.lb-my-rank-info {
  flex: 1;
  min-width: 0;
}

.lb-my-rank-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-my-rank-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.lb-my-rank-score {
  text-align: right;
  flex-shrink: 0;
}

.lb-my-rank-pts {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple-light);
}

/* ── Ranked list of all players ── */
.lb-list {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  overflow: hidden;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

/* Highlight the current user's row in the list */
.lb-row--me {
  background: rgba(123, 47, 190, 0.12);
}

.lb-rank {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 36px;
  color: var(--text-muted);
}

.lb-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
}

.lb-pts {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--purple-light);
}

/* ── Private Leagues coming-soon panel ── */
.lb-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  margin-top: 8px;
}

.lb-coming-soon-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.lb-coming-soon-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.lb-coming-soon-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 260px;
  margin-bottom: 20px;
}

.lb-coming-soon-pill {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════
   PROFILE REVAMP
═══════════════════════════════════════════ */

.profile-screen {
  padding: 0 0 120px;
}

/* Avatar + username block at the top of the profile */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 20px;
  gap: 12px;
}

.profile-hero-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

/* Wrapper for the side-by-side bento stats (reuses .bento-grid + .bento-card) */
.profile-bento-wrap {
  padding: 0 16px 16px;
}

/* Clickable nav cards — Rules + Prediction History */
.profile-nav-card {
  display: flex;
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 12px;
  cursor: pointer;
  min-height: 64px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.profile-nav-card:active {
  background: var(--surface-2);
}

.profile-nav-card-text {
  flex: 1;
}

.profile-nav-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.profile-nav-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-nav-card-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 12px;
}

/* Wrapper for the log out button */
.profile-logout-wrap {
  padding: 8px 16px 0;
}

/* ═══════════════════════════════════════════
   PREDICTION HISTORY + PUBLIC PROFILE VIEWS
═══════════════════════════════════════════ */

/* Outer wrapper for both private history and public profile pages */
.history-screen {
  padding: 0 0 120px;
}

/* Back button bar across the top */
.history-back-bar {
  display: flex;
  align-items: center;
  padding: 16px 16px 8px;
}

.history-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--purple-light);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
  -webkit-tap-highlight-color: transparent;
}

/* Page title on private history view */
.history-title {
  font-size: 1.4rem;
  font-weight: 800;
  padding: 4px 16px 16px;
}

/* Hero block at the top of a public profile — shows username + subtitle */
.public-profile-hero {
  padding: 24px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

.public-profile-name {
  font-size: 1.3rem;
  font-weight: 800;
}

.public-profile-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* One matchweek's group of predictions */
.history-mw-group {
  margin: 0 16px 20px;
}

/* Header row for a matchweek group — shows "Matchweek X" + pts total */
.history-mw-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  margin-bottom: 4px;
}

.history-mw-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.history-mw-pts {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--purple-light);
}

/* Outcome badge shown inline next to each match row */
.history-outcome {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 5px;
  vertical-align: middle;
}

/* Exact score — purple */
.history-outcome--exact {
  background: rgba(181, 123, 255, 0.18);
  color: var(--purple-light);
}

/* Correct outcome only — green */
.history-outcome--correct {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

/* Wrong or no prediction — red */
.history-outcome--zero {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Empty state shown when there are no scored predictions yet */
.history-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Loading spinner state for history and public profile pages */
.history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   LEADERBOARD — CLICKABLE ROWS
═══════════════════════════════════════════ */

/* Added to lb-rows for other players (not the current user) */
.lb-row--clickable {
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.lb-row--clickable:active {
  background: var(--surface-2);
}

/* Timestamp shown below the global leaderboard list */
.lb-updated {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 8px 0 16px;
}

/* Pending prediction badge — shown when a past-matchweek prediction hasn't been scored yet */
.badge-pending {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════
   RULES MODAL — BOTTOM SHEET
═══════════════════════════════════════════ */

/* Dark overlay behind the sheet — covers the full screen */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: overlayFadeIn 0.25s ease forwards;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* The card that slides up from the bottom */
.modal-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #1A0533;
  border-radius: 20px 20px 0 0;
  padding: 0 0 48px;
  max-height: 85dvh;
  overflow-y: auto;
  animation: sheetSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0);    }
}

/* Drag-handle pill at the very top of the sheet */
.modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 12px auto 20px;
}

/* Title + close button row */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
}

/* ✕ close button — circular */
.modal-close-btn {
  background: var(--surface-2);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Section separator label inside the modal (e.g. "Match Predictions") */
.rules-section-label {
  padding: 16px 20px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* One scoring rule row — chip on left, description on right */
.rules-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

/* Purple points chip on the left of each rule row */
.rules-pts-chip {
  background: rgba(123, 47, 190, 0.18);
  color: var(--purple-light);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 56px;
  text-align: center;
}

.rules-desc {
  flex: 1;
}

.rules-desc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.rules-desc-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}
