/* ============================================================
   BracketBoss - Premium Light UI
   Fonts: Outfit (headings) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700;800&display=swap');

:root {
  /* Surface & background */
  --bg: #F4F2EE;
  --bg-warm: #FAF9F7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-solid: #ffffff;
  --panel-hover: rgba(255, 255, 255, 0.92);

  /* Borders */
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --border-accent: rgba(200, 145, 30, 0.22);

  /* Text */
  --text: #1A1A2E;
  --text-secondary: #4A4A68;
  --muted: #8888A4;

  /* Accent - World Cup Gold */
  --accent: #C8911E;
  --accent-light: #E6A817;
  --accent-glow: rgba(200, 145, 30, 0.15);
  --accent-surface: rgba(200, 145, 30, 0.06);
  --gold: #E6A817;
  --gold-light: #F5CD5A;
  --gold-surface: rgba(230, 168, 23, 0.08);

  /* Status */
  --green: #16A34A;
  --green-bg: rgba(22, 163, 74, 0.08);
  --green-fg: #15803D;
  --red: #DC2626;
  --red-bg: rgba(220, 38, 38, 0.06);

  /* Round-specific tints */
  --r32: rgba(0, 0, 0, 0.02);
  --r16: rgba(200, 145, 30, 0.04);
  --qf: rgba(200, 145, 30, 0.07);
  --sf: rgba(200, 145, 30, 0.10);
  --final: rgba(200, 145, 30, 0.14);
  --elim: #B0A99E;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 0 3px var(--accent-glow);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Warm radial gradient background overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(200, 145, 30, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(230, 168, 23, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(255, 255, 255, 0.6) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body>* {
  position: relative;
  z-index: 1;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.mono {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.muted {
  color: var(--muted);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s var(--ease-out);
}

.brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
  background: linear-gradient(135deg, #A67413 0%, var(--accent) 40%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.8;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  animation: fadeUp 0.5s var(--ease-out) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  max-width: 640px;
  margin: 24px auto 8px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  margin: 0 0 10px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.6s var(--ease-out) 0.1s both;
}

.sub {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto;
  animation: fadeUp 0.6s var(--ease-out) 0.2s both;
}

/* ---------- Cards grid ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 28px;
}

@media (max-width: 640px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* ---------- Panel (glass card) ---------- */
.panel {
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.panel:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.panel h2 {
  margin: 0 0 4px;
  font-size: 19px;
  color: var(--text);
}

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  padding: 11px 14px;
  margin: 10px 0;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-warm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  background: #fff;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--panel-solid);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0px) scale(0.98);
  box-shadow: var(--shadow-sm);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 12px rgba(200, 145, 30, 0.3);
  padding: 11px 20px;
}

.btn.primary:hover {
  box-shadow: 0 4px 20px rgba(200, 145, 30, 0.4);
  transform: translateY(-2px);
  color: #fff;
}

.btn.primary:active {
  transform: translateY(0px) scale(0.98);
  box-shadow: 0 2px 8px rgba(200, 145, 30, 0.25);
}

.btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--muted);
  box-shadow: none;
}

.btn.secondary:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--bg-warm);
}

/* ---------- Output / status ---------- */
.out {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.out a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.out a:hover {
  text-decoration: underline;
}

.wallet-note {
  margin-top: 32px;
  font-size: 13px;
  text-align: center;
}

.status-bar {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 14px;
}

.hidden {
  display: none;
}

/* ---------- Score pill ---------- */
.pill {
  background: linear-gradient(135deg, var(--gold-surface) 0%, var(--green-bg) 100%);
  color: var(--green-fg);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  border: 1px solid rgba(22, 163, 74, 0.12);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.08);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0;
}

/* ---------- Bracket layout ---------- */
.bracket {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 18px;
}

.round h3 {
  margin: 0 0 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.round h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.round-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

/* ---------- Match card ---------- */
.match {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--panel-solid);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.match:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.match.done {
  opacity: 0.92;
}

/* Round-specific accents */
.round.r32 .match {
  border-left: 3px solid rgba(0, 0, 0, 0.06);
}

.round.r16 .match {
  border-left: 3px solid rgba(200, 145, 30, 0.25);
}

.round.qf .match {
  border-left: 3px solid rgba(200, 145, 30, 0.40);
}

.round.sf .match {
  border-left: 3px solid var(--gold);
}

.round.final .match {
  border: 2px solid var(--gold);
  box-shadow: 0 4px 20px rgba(230, 168, 23, 0.12);
  background: linear-gradient(135deg, #fff 0%, rgba(230, 168, 23, 0.04) 100%);
}

/* ---------- Team row ---------- */
.team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  border: none;
  width: 100%;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  color: var(--text);
  transition: background 0.2s ease, box-shadow 0.15s ease;
}

.team+.team {
  border-top: 1px solid var(--border);
}

.team:hover:not(.locked):not(.tbd) {
  background: var(--accent-surface);
}

.team.picked {
  background: linear-gradient(90deg, var(--accent-surface) 0%, transparent 100%);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.team.correct {
  background: linear-gradient(90deg, var(--green-bg) 0%, transparent 100%);
  color: var(--green-fg);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--green);
}

.team.eliminated {
  color: var(--elim);
  text-decoration: line-through;
  opacity: 0.7;
}

.team.tbd {
  color: var(--muted);
  font-style: italic;
  cursor: default;
  font-weight: 400;
}

.team.locked {
  cursor: default;
}

.match-meta {
  padding: 3px 12px 5px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, .02);
}
.match-meta .kick { white-space: nowrap; }

.team .tag {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.team.correct .tag {
  color: var(--green-fg);
  font-weight: 700;
}

/* ---------- Leaderboard table ---------- */
.lb {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 18px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.lb th,
.lb td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.lb th {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg-warm);
}

.lb td {
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.lb tbody tr:hover td {
  background: var(--accent-surface);
}

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

.lb td a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.lb td a:hover {
  text-decoration: underline;
}

.lb td b {
  color: var(--text);
  font-weight: 700;
}

.lb .me {
  background: var(--green-bg);
}

.lb .me td {
  background: var(--green-bg);
}

/* ---------- Your stuff (home page groups/brackets list) ---------- */
ul.ys {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

ul.ys li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  transition: padding-left 0.2s var(--ease-out);
}

ul.ys li:hover {
  padding-left: 4px;
}

ul.ys li:last-child {
  border-bottom: none;
}

ul.ys a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

ul.ys a:hover {
  text-decoration: underline;
}

#wallet-btn {
  font-variant-numeric: tabular-nums;
}

/* ---------- Modal ---------- */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 300px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s var(--ease-spring) both;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-family: 'Outfit', sans-serif;
}

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-glow);
  color: var(--accent);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive refinements ---------- */
@media (max-width: 640px) {
  .wrap {
    padding: 24px 16px 64px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .panel {
    padding: 18px 16px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .round-matches {
    grid-template-columns: 1fr;
  }
}