/* RivalBracket Tennis — Wimbledon 2026 theme
   Dark base · Wimbledon green + cream/gold accents · grass-court motif
   --------------------------------------------------------------------- */

:root {
  --bg:        #06120a;
  --bg-deep:   #030806;
  --card:      #0c1e15;
  --card-2:    #112a1d;
  --line:      #1c3a29;
  --line-soft: #163024;
  --text:      #ecf3ed;
  --text-dim:  #8da394;
  --text-mute: #5d7367;
  --accent:    #e0b977;      /* championship gold/cream */
  --accent-2:  #f5e9d0;
  --grass:     #2c8f4c;      /* fresh court grass */
  --grass-2:   #145e2f;
  --purple:    #5a3a73;      /* Wimbledon's secondary */
  --red:       #e74c3c;
  --blue:      #5fa9e0;
  --live:      #d33;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
               Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Wimbledon scrollbars (gold thumb on deep-green track) ─── */
* {
  scrollbar-color: var(--accent) var(--bg-deep);
  scrollbar-width: thin;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track {
  background: var(--bg-deep);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent) 0%, #c69f5a 100%);
  border-radius: 4px;
  border: 1px solid var(--bg-deep);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
}
*::-webkit-scrollbar-corner { background: var(--bg-deep); }
body { min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: "Playfair Display", "Times New Roman", Georgia, serif;
  font-weight: 700; letter-spacing: -.01em;
}
h1 { font-size: 2.8rem; line-height: 1.05; margin: 0 0 .2em; }
h2 { font-size: 1.65rem; margin: 0 0 .4em; }
h3 { font-size: 1.15rem; margin: 0 0 .3em; }
small, .small { font-size: .82rem; color: var(--text-dim); }

/* ─── Wimbledon Centre Court background ───
   Real photo of Wimbledon Centre Court (Delfort, 2009, CC BY-SA 3.0)
   used as a subtle textured backdrop. The dark theme dominates; the
   court is visible mostly behind the hero and fades to texture elsewhere.
   Attribution is rendered in the footer. */
/* The court image is fixed + cover-sized so it scales to ANY viewport.
   `background-attachment: scroll` on mobile (iOS Safari treats `fixed`
   inconsistently and lifts performance). `background-position` defaults
   to centering on the grass + net + lines (the iconic Wimbledon band of
   the photo) so cropping at narrow widths still preserves the subject. */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("/tennis/shared/centre-court.jpg?v=panorama2004");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  filter: saturate(1.05) brightness(.85);
  pointer-events: none; z-index: 0;
}
/* Tablet + smaller — switch to scroll so iOS Safari doesn't fight us */
@media (max-width: 920px) {
  body::before {
    background-attachment: scroll;
    background-position: center top;
  }
}
/* Mobile portrait — keep the image readable on a tall narrow viewport.
   "cover" can over-crop wide panoramas; shift the focal point upward so
   the subject (court / net / players) stays in frame. */
@media (max-width: 540px) {
  body::before {
    background-position: 50% 30%;
    /* Slightly stronger filter so the photo stays as ambient texture even
       when scaled down — prevents the mobile view from looking washed-out
       around the top nav. */
    filter: saturate(1.0) brightness(.75);
  }
}
/* Ultra-wide — anchor the background so the focal point doesn't drift to
   the right edge on 21:9 / 32:9 monitors. */
@media (min-width: 1800px) {
  body::before {
    background-size: cover;
    background-position: center 40%;
  }
}
/* Landscape phones (e.g. iPhone in landscape) — the viewport is wide but
   very short, so we need more aggressive cropping to keep the court band
   in frame. */
@media (max-height: 500px) and (orientation: landscape) {
  body::before {
    background-position: center 60%;
  }
}
/* Dark overlay so foreground text stays readable.
   Keep the top 30vh slightly less dark (so the hero hints at the court),
   then deepen toward bottom for full card legibility. */
body::after {
  content: "";
  position: fixed; inset: 0;
  background:
    /* Top-light, bottom-dark linear so cards stay readable */
    linear-gradient(180deg,
      rgba(3,16,8,.30) 0%,
      rgba(3,16,8,.50) 30vh,
      rgba(3,16,8,.85) 65vh,
      rgba(3,16,8,.95) 100%),
    /* Edge vignette so the photo blends to the dark theme at the corners */
    radial-gradient(ellipse 140% 120% at center, rgba(3,16,8,0) 30%, rgba(3,16,8,.55) 100%);
  pointer-events: none; z-index: 0;
}
/* Hero zone: punch a lighter window in the dark overlay so the actual
   court photo shows through at hero level, but still tinted enough that
   the gold trophies + title pop. */
.court-hero { position: relative; z-index: 1; }
.court-hero::before {
  content: "";
  position: absolute;
  left: -60vw; right: -60vw; top: -40px; bottom: -40px;
  background: radial-gradient(ellipse 60% 100% at 50% 50%,
    rgba(3,16,8,-.05) 0%, rgba(3,16,8,.2) 60%, rgba(3,16,8,0) 100%);
  /* lighten the overlay over the hero — mix-blend "screen" raises brightness
     of whatever's behind */
  mix-blend-mode: screen;
  opacity: .35;
  pointer-events: none; z-index: -1;
}
.wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 22px; }

/* ────────────── nav ────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6,18,10,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; gap: 22px;
  max-width: 1240px; margin: 0 auto; padding: 12px 22px;
}
.brand {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.005em;
  white-space: nowrap; flex-shrink: 0;
}
.brand .ball {
  display: inline-block; width: 11px; height: 11px;
  background: var(--accent); border-radius: 50%;
  margin-right: 8px; box-shadow: 0 0 0 2px var(--grass-2) inset;
  position: relative; top: 1px;
}
.brand-sub { color: var(--text-dim); font-weight: 400; font-style: italic; }
.nav-links {
  display: flex; gap: 18px; flex: 1;
  flex-wrap: nowrap; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--text-dim); font-size: .92rem; padding: 4px 0;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 12px; font-size: .9rem; flex-shrink: 0; }
.nav-right .pill {
  padding: 4px 10px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text-dim); font-size: .82rem;
}
.nav-right .pill.live {
  background: rgba(211,51,51,.16); border-color: var(--live); color: #ffb1b1;
}
.nav-right .pill.live::before {
  content: ""; display: inline-block; width: 7px; height: 7px;
  background: var(--live); border-radius: 50%; margin-right: 6px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ────────────── hero ────────────── */
.hero {
  padding: 80px 0 56px;
  text-align: center;
}
.hero .crown {
  display: inline-block;
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero h1 .accent { color: var(--accent); }
.hero .sub {
  font-size: 1.18rem; color: var(--text-dim); max-width: 580px;
  margin: 16px auto 0;
}
.hero .countdown {
  display: inline-flex; gap: 24px; margin: 36px auto 24px;
  padding: 18px 36px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: 12px;
}
.hero .countdown .cell { text-align: center; min-width: 64px; }
.hero .countdown .num {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.4rem; line-height: 1; font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(224,185,119,.3);
}
@keyframes countdownTick {
  0% { transform: scale(1); }
  10% { transform: scale(1.08); color: var(--accent-2); }
  100% { transform: scale(1); }
}
.hero .countdown .num.ticking { animation: countdownTick .6s ease; }
.hero .countdown .lbl {
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim); margin-top: 4px;
}
.hero .cta-row { display: flex; gap: 14px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* ────────────── buttons ────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
  color: #1a1006;
  font-weight: 600; font-size: .95rem;
  border: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
  box-shadow: 0 2px 0 #8a6a3c, 0 4px 12px -4px rgba(224,185,119,.3);
}
.btn:hover {
  background: linear-gradient(180deg, #fff3d6 0%, var(--accent-2) 100%);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #8a6a3c, 0 8px 18px -6px rgba(224,185,119,.5);
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #8a6a3c; }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 7px 14px; font-size: .85rem; border-radius: 7px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ────────────── cards / sections ────────────── */
.section { padding: 56px 0; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h2 { margin-bottom: 6px; }
.section-title p { color: var(--text-dim); margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover {
  border-color: rgba(224,185,119,.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.6),
              0 0 24px -10px rgba(224,185,119,.25);
}
.card.tight { padding: 16px; }
.card .label {
  font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}

/* ────────────── prize blurb ────────────── */
.prize {
  background: linear-gradient(180deg, rgba(224,185,119,.06), transparent);
  border: 1px solid var(--accent);
  border-radius: 14px; padding: 26px 28px;
  display: flex; gap: 22px; align-items: flex-start;
}
.prize .ico {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #1a1006;
  display: grid; place-items: center; font-size: 1.6rem; font-weight: 800;
  flex-shrink: 0;
}
.prize h3 { color: var(--accent); margin-bottom: 6px; }

/* ────────────── score / match tiles ────────────── */
.match {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px; align-items: center; font-size: .92rem;
}
.match.live { border-color: var(--live); }
.match .players { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.match .player { display: flex; gap: 10px; align-items: center; }
.match .player .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .seed { font-size: .72rem; color: var(--text-dim); width: 22px; }
.match .nm.win { color: var(--accent); font-weight: 600; }
.match .sets { display: flex; gap: 6px; font-variant-numeric: tabular-nums; }
.match .sets .s { min-width: 18px; text-align: center; font-weight: 600; }
.match .sets .s.lo { color: var(--text-mute); }
.match .meta { font-size: .78rem; color: var(--text-dim); margin-top: 6px; }
.match .live-badge {
  display: inline-block; padding: 1px 8px; font-size: .68rem;
  background: var(--live); color: #fff; border-radius: 99px;
  letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
}

/* ────────────── tour tabs (M/W) ────────────── */
.tabs {
  display: inline-flex; background: var(--card); border: 1px solid var(--line);
  border-radius: 99px; padding: 4px; margin-bottom: 22px;
}
.tabs button {
  background: transparent; color: var(--text-dim);
  border: none; padding: 8px 22px; border-radius: 99px;
  font-size: .9rem; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.tabs button.active {
  background: var(--accent); color: #1a1006; font-weight: 600;
}

/* ────────────── tables ────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.tbl th {
  background: var(--bg-deep); color: var(--text-dim);
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600;
}
.tbl tr:hover td { background: rgba(28,58,41,.25); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ────────────── player card ────────────── */
.player-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
  cursor: pointer; transition: all .15s;
  position: relative; min-width: 0;
}
.player-card > div { min-width: 0; }
.player-card .nm {
  font-weight: 600; font-size: .98rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.player-card.picked {
  border-color: var(--accent);
  background: rgba(224,185,119,.06);
  box-shadow: 0 0 20px -8px rgba(224,185,119,.4),
              inset 0 0 0 1px rgba(224,185,119,.25);
}
.player-card.picked .seed-badge {
  background: var(--accent); color: #1a1006; border-color: var(--accent);
}
@keyframes pickPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.player-card.picked .price { animation: pickPulse .35s ease; }
.player-card .seed-badge {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-deep); color: var(--accent);
  display: grid; place-items: center;
  font-weight: 700; font-size: .82rem;
  border: 1px solid var(--line);
}
.player-card .seed-badge.unseeded { color: var(--text-mute); border-style: dashed; }
.player-card .meta {
  font-size: .76rem; color: var(--text-dim); margin-top: 2px;
  display: flex; gap: 10px; flex-wrap: wrap;
  overflow: hidden;
}
.player-card .price {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.6rem; font-weight: 700; color: var(--accent);
  min-width: 36px; text-align: center;
}
.player-card .price small { font-size: .55em; color: var(--text-dim); margin-left: 2px; }
.player-card.withdrawn { opacity: .55; cursor: not-allowed; }
.player-card.withdrawn:hover { border-color: var(--line); transform: none; }
.player-card.withdrawn .nm { text-decoration: line-through; text-decoration-color: var(--red); }
.wd-badge {
  display: inline-block; font-size: .6rem; font-weight: 700;
  background: var(--red); color: #fff; padding: 1px 6px; border-radius: 4px;
  vertical-align: middle; margin-left: 6px; letter-spacing: .08em;
}

/* ────────────── budget bar ────────────── */
.budget {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 22px; margin-bottom: 22px;
  display: flex; align-items: center; gap: 18px;
}
.budget .row1 { display: flex; gap: 30px; align-items: baseline; }
.budget .big { font-family: "Playfair Display", Georgia, serif; font-size: 2rem; color: var(--accent); }
.budget .lbl { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.budget .bar { flex: 1; height: 10px; background: var(--bg-deep); border-radius: 99px; overflow: hidden; }
.budget .bar > div { height: 100%; background: var(--accent); transition: width .25s; }
.budget.over .big { color: var(--red); }
.budget.over .bar > div { background: var(--red); }

/* ────────────── footer ────────────── */
.footer {
  margin-top: 80px; padding: 30px 22px;
  border-top: 1px solid var(--line);
  text-align: center; color: var(--text-dim); font-size: .85rem;
}
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--accent); }

/* ────────────── responsive ────────────── */
@media (max-width: 920px) {
  .nav-inner { gap: 14px; padding: 10px 16px; }
  .brand-sub { display: none; }
}
@media (max-width: 720px) {
  h1 { font-size: 2.1rem; }
  .hero { padding: 40px 0 32px; }
  .hero .countdown { padding: 12px 18px; gap: 14px; }
  .hero .countdown .num { font-size: 1.7rem; }
  .nav-inner { gap: 12px; padding: 10px 14px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: .86rem; }
  .nav-right .pill:not(.live) { display: none; }
  .nav-right { gap: 8px; }
  .player-card { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 11px; }
  .player-card .price { font-size: 1.3rem; }
  .prize { flex-direction: column; gap: 14px; padding: 18px; }
  .wrap { padding: 0 16px; }
  .section { padding: 28px 0; }
  .section-title { margin-bottom: 22px; }
  /* Table wrappers — any .tbl gets horizontal scroll inside its container */
  .tbl { font-size: .85rem; }
  .tbl th, .tbl td { padding: 9px 10px; }
  /* Tabs (M/W) — smaller on mobile */
  .tabs button { padding: 7px 16px; font-size: .85rem; }
  /* Budget bar on draft — keep readable when stacked */
  .budget { padding: 14px 16px; flex-wrap: wrap; gap: 12px; }
  .budget .big { font-size: 1.5rem; }
  /* Hero countdown more compact */
  .hero .countdown .cell { min-width: 50px; }
  .hero .countdown .num { font-size: 1.5rem; }
  /* CTAs / buttons */
  .btn { padding: 11px 18px; font-size: .9rem; }
}
@media (max-width: 480px) {
  .nav-links a { font-size: .82rem; }
  .nav-right .pill { padding: 3px 8px; font-size: .76rem; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.35rem; }
}
/* Horizontally-scrollable wrapper for wide tables on narrow screens */
.tbl-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}
.tbl-wrap .tbl { border: none; margin: 0; }

/* ─── Tennis-ball loader ─── */
@keyframes ballBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(180deg); }
}
.tennis-ball {
  display: inline-block; width: 26px; height: 26px;
  background: radial-gradient(circle at 35% 35%, #f0d97a, var(--accent) 60%, #b18941 100%);
  border-radius: 50%;
  animation: ballBounce 1.1s ease-in-out infinite;
  position: relative;
  box-shadow: 0 4px 8px -2px rgba(0,0,0,.4);
}
.tennis-ball::before, .tennis-ball::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.55);
}
.tennis-ball::before {
  border-color: transparent transparent rgba(255,255,255,.55) rgba(255,255,255,.55);
  transform: rotate(45deg);
}
.tennis-ball::after {
  border-color: rgba(255,255,255,.55) rgba(255,255,255,.55) transparent transparent;
  transform: rotate(45deg);
}
.loader-row {
  display: flex; align-items: center; gap: 14px;
  color: var(--text-dim); font-size: .9rem; padding: 20px 0;
}

/* ─── Trophy SVG sizing ─── */
.trophy { display: inline-block; vertical-align: middle; }
.trophy-cup { color: var(--accent); }
.trophy-dish { color: #c8c6b8; }
@keyframes trophyShimmer {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(224,185,119,.4)); }
  50%      { filter: drop-shadow(0 0 18px rgba(224,185,119,.7)); }
}
.trophy.shimmer { animation: trophyShimmer 3.5s ease-in-out infinite; }

/* utility */
.flag { font-size: 1rem; }
.muted { color: var(--text-dim); }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 14px; } .mb-3 { margin-bottom: 22px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.bg-card { background: var(--card); }
.divider {
  height: 1px; background: var(--line); margin: 28px 0;
}
.banner {
  background: rgba(224,185,119,.08); border: 1px solid var(--accent);
  border-radius: 10px; padding: 14px 18px; color: var(--accent-2); margin-bottom: 22px;
}
.banner.err { background: rgba(231,76,60,.08); border-color: var(--red); color: #ffb1b1; }
.banner.ok { background: rgba(44,143,76,.08); border-color: var(--grass); color: #b6e5c4; }

/* form */
input[type="text"], input[type="email"], textarea, select {
  background: var(--bg-deep); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: .95rem; font-family: inherit;
  width: 100%; box-sizing: border-box;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: 6px; }

/* country flag chip */
.cflag { font-size: .82rem; color: var(--text-dim); }
