/* ============================================================
   ESTADIO NOCTURNO — WC 2026 Pool
   Dark stadium-night aesthetic: deep navy, amber gold accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800;900&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --bg:          #060a10;
  --bg-surface:  #0b1422;
  --bg-card:     #0f1d2f;
  --bg-card-alt: #132030;
  --border:      #1e2f44;
  --border-glow: #2a4a6a;

  --accent:      #f5a623;
  --accent-dim:  #b87a1a;
  --accent-glow: rgba(245, 166, 35, 0.15);

  --text:        #e2e8f0;
  --text-sub:    #94a3b8;
  --text-muted:  #4a6080;

  --green:       #22c55e;
  --red:         #ef4444;
  --green-dim:   rgba(34, 197, 94, 0.12);
  --red-dim:     rgba(239, 68, 68, 0.12);

  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   12px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 20px rgba(245,166,35,0.08);

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --transition: 160ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffc04d; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 58px;
  background: rgba(6, 10, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(245, 166, 35, 0.06);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand::before {
  content: '⚽';
  font-size: 1.1rem;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topbar nav a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sub);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.topbar nav a:hover {
  color: var(--text);
  background: var(--bg-card);
}

.topbar nav a.active {
  color: var(--accent);
}

/* Logout form as inline nav item */
.logout {
  display: inline-flex;
  align-items: center;
}

.logout button {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.logout button:hover {
  color: var(--red);
  background: var(--red-dim);
}

/* ── Page layout ────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Page headings ─────────────────────────────────────────── */
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 1.75rem;
}

h1 .sub {
  display: block;
  font-size: 0.65em;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.1em;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 1rem;
}

/* ── Leaderboard / scoreboard ──────────────────────────────── */
.leaderboard-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 2.5rem;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leaderboard thead {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.leaderboard thead th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.85rem 1.25rem;
  text-align: left;
}

.leaderboard thead th:first-child {
  width: 3.5rem;
  text-align: center;
}

.leaderboard thead th:nth-child(3),
.leaderboard thead th:nth-child(4),
.leaderboard thead th:nth-child(5) {
  text-align: right;
}

.leaderboard tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.leaderboard tbody tr:last-child {
  border-bottom: none;
}

.leaderboard tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.leaderboard tbody td {
  padding: 0.9rem 1.25rem;
  color: var(--text);
}

.leaderboard tbody td:first-child {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.leaderboard tbody td:nth-child(3),
.leaderboard tbody td:nth-child(4),
.leaderboard tbody td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.leaderboard .correct-cell small { color: var(--text-muted); font-weight: 400; }

/* Rank badge for top 3 */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
}

.rank-1 { background: rgba(245,166,35,0.18); color: var(--accent); }
.rank-2 { background: rgba(148,163,184,0.12); color: #94a3b8; }
.rank-3 { background: rgba(205,127,50,0.12); color: #cd7f32; }

/* Points pill */
.pts {
  display: inline-block;
  background: rgba(245,166,35,0.1);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.55em;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* "Me" row highlight */
.leaderboard tbody tr.me {
  background: rgba(245, 166, 35, 0.05);
  border-left: 2px solid var(--accent);
  border-right: 2px solid transparent;
}

.leaderboard tbody tr.me td:nth-child(2)::after {
  content: ' ←';
  font-size: 0.75em;
  color: var(--accent);
  opacity: 0.7;
}

/* Accuracy bar */
.accuracy-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-end;
}

.accuracy-bar {
  width: 56px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.accuracy-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ── Today's matches (dashboard) ───────────────────────────── */
.today-section h2 {
  margin-bottom: 0.75rem;
}

.match-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  transition: border-color var(--transition);
}

.match-line:hover {
  border-color: var(--border-glow);
}

.match-line .ml-teams {
  flex: 1;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.match-line .ml-score {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  min-width: 3rem;
  text-align: center;
}

.match-line .status {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
}

/* ── Day block (predict page) ──────────────────────────────── */
.day-block {
  margin-bottom: 2.5rem;
}

.day-block h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.day-block h2::before {
  content: '';
  display: block;
  width: 3px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Match card ────────────────────────────────────────────── */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.match-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.match-card.locked {
  opacity: 0.82;
  border-color: var(--border);
}

/* Teams display */
.teams {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  font-size: 1.3rem;
}

.teams span:first-child,
.teams span:last-child {
  color: var(--text);
}

.teams a.team-link { color: inherit; text-decoration: none; transition: color .15s; }
.teams a.team-link:hover { color: var(--accent); }
.teams a.vs:hover, .teams a.score:hover { color: #ffc04d; }

/* Venue line under the matchup on a match card (links to Google Maps) */
.mc-venue { align-self: flex-start; color: var(--text-muted); font-size: 0.82rem; transition: color .15s; }
.mc-venue:hover { color: var(--accent); }

.teams .vs {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2em 0.45em;
}

/* Locked pick display */
.locked-pick {
  font-size: 0.85rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.locked-pick strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-dim);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
}

.no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red-dim);
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── H/D/A pick form — segmented button control ────────────── */
.pick-form {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
}

.pick-form label {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.pick-form input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* The visible button segment */
.pick-form label span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.35em 0.85em;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  user-select: none;
  white-space: nowrap;
  min-width: 2.6rem;
  text-align: center;
}

.pick-form label:hover span {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.pick-form input[type="radio"]:checked + span {
  background: var(--accent);
  color: #060a10;
  box-shadow: 0 1px 4px rgba(245,166,35,0.4);
}

/* HTMX loading indicator on pick form */
.pick-form.htmx-request {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Hint / info bar ────────────────────────────────────────── */
.hint {
  font-size: 0.84rem;
  color: var(--text-sub);
  background: rgba(245,166,35,0.06);
  border: 1px solid rgba(245,166,35,0.15);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hint::before {
  content: '⏱';
  font-size: 1rem;
  flex-shrink: 0;
}

/* Lock countdown */
.lock-countdown {
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Login / auth card ──────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: auth-enter 0.4s ease both;
}

@keyframes auth-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.auth-card .auth-tagline {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  letter-spacing: 0.04em;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sub);
}

/* Django renders the input directly — style all inputs inside auth-card */
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-top: 0.25rem;
}

.auth-card input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.12);
}

.auth-card button[type="submit"] {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: #060a10;
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.5rem;
  transition: background var(--transition), transform 80ms ease, box-shadow var(--transition);
  box-shadow: 0 2px 12px rgba(245,166,35,0.25);
}

.auth-card button[type="submit"]:hover {
  background: #ffc04d;
  box-shadow: 0 4px 20px rgba(245,166,35,0.35);
}

.auth-card button[type="submit"]:active {
  transform: scale(0.98);
}

/* ── Error message ──────────────────────────────────────────── */
.error {
  font-size: 0.85rem;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.5rem;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

/* ── Section label ──────────────────────────────────────────── */
.section-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: block;
}

/* ── HTMX transition polish ─────────────────────────────────── */
.htmx-swapping { opacity: 0.4; transition: opacity 200ms ease; }
.htmx-added    { animation: card-pop 0.2s ease; }

@keyframes card-pop {
  from { opacity: 0.5; transform: scale(0.99); }
  to   { opacity: 1;   transform: scale(1); }
}

/* ── Scrollbar theming ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-glow); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 1.25rem 1rem 5.5rem; }   /* bottom room for the tab bar */

  /* Top bar shrinks to just the brand; nav becomes a bottom tab bar */
  /* NB: backdrop-filter creates a containing block for fixed children, which
     would trap the bottom nav at the top — so disable it here. */
  .topbar { padding: 0 1rem; height: 54px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .brand { font-size: 1.15rem; }

  .topbar nav.mainnav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 60px;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    padding: 0;
    background: rgba(6, 10, 16, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 18px rgba(0,0,0,0.45);
    z-index: 120;
  }
  .mainnav .nav-link,
  .mainnav .logout { flex: 1; display: flex; }
  .mainnav .nav-link,
  .mainnav .nav-logout {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    padding: 0;
    border-radius: 0;
    font-size: 0.6rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-sub);
    background: transparent;
    border: none;
  }
  .mainnav .nav-link::before,
  .mainnav .nav-logout::before { font-size: 1.25rem; line-height: 1; }
  .nav-scoreboard::before { content: '🏆'; }
  .nav-predict::before    { content: '⚽'; }
  .nav-played::before     { content: '🏁'; }
  .nav-profile::before    { content: '👤'; }
  .nav-logout::before     { content: '🚪'; }
  .mainnav .nav-link.active { color: var(--accent); background: transparent; }
  .mainnav .nav-logout:hover { color: var(--red); background: transparent; }
  .mainnav .u-name { display: none; }   /* hide username on the tab */

  /* Predict cards stack */
  .match-card { grid-template-columns: 1fr; gap: 0.75rem; }
  .pick-form { width: 100%; justify-content: stretch; }
  .pick-form label { flex: 1; }
  .pick-form label span { width: 100%; text-align: center; }

  /* Leaderboard: tighten, and drop the Accuracy column (it's on the profile) */
  .leaderboard { font-size: 0.88rem; }
  .leaderboard thead th,
  .leaderboard tbody td { padding: 0.75rem 0.8rem; }
  .leaderboard thead th:nth-child(5),
  .leaderboard tbody td:nth-child(5) { display: none; }

  /* Today's matches: wrap + truncate so long names never overflow */
  .match-line { padding: 0.7rem 0.85rem; gap: 0.45rem; font-size: 0.85rem; flex-wrap: wrap; }
  .match-line .ml-teams { min-width: 0; }
  .match-line .ml-teams span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .match-line .ml-score { min-width: 2.6rem; font-size: 1rem; }

  /* Profile result/upcoming cards: keep long team names inside the card */
  .rc-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Page headings a touch smaller */
  h1 { font-size: 1.7rem; }
}

/* ---- Player profile ---- */
.player-link { color: var(--text); text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.player-link:hover { color: var(--accent); border-bottom-color: var(--accent-dim); }

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--text-sub);
  text-decoration: none;
  transition: color .15s;
}
.back-link:hover { color: var(--accent); }

/* Hero */
.profile-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-glow), transparent 55%),
    linear-gradient(180deg, var(--bg-card), var(--bg-surface));
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: profileUp .45s ease both;
}
.profile-hero::after {   /* faint pitch line */
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(90deg, transparent 49.6%, rgba(255,255,255,.04) 50%, transparent 50.4%);
  pointer-events: none;
}
.monogram {
  flex: none;
  width: 76px; height: 76px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: #1a1206;
  background: linear-gradient(150deg, #ffd166, var(--accent) 60%, var(--accent-dim));
  box-shadow: 0 0 0 4px rgba(245,166,35,.12), var(--shadow-glow);
}
.rank-1 .monogram { box-shadow: 0 0 0 4px rgba(245,197,24,.22), 0 0 26px rgba(245,197,24,.35); }
.rank-2 .monogram { background: linear-gradient(150deg,#e8edf4,#c0c8d4 60%,#9aa3b2); box-shadow:0 0 0 4px rgba(192,200,212,.2); }
.rank-3 .monogram { background: linear-gradient(150deg,#e8a566,#cd7f32 60%,#9c5f24); box-shadow:0 0 0 4px rgba(205,127,50,.2); }
.profile-id { position: relative; z-index: 1; }
.profile-kicker { font-size:.7rem; letter-spacing:.18em; text-transform:uppercase; color:var(--text-muted); }
.profile-id h1 { font-size: 2.4rem; line-height: 1; margin: .15rem 0 .55rem; }
.profile-meta { display:flex; flex-wrap:wrap; gap:.4rem .7rem; font-size:.85rem; color:var(--text-sub); }
.profile-meta .rank-medal {
  font-family: var(--font-display); font-weight:700; color: var(--accent);
  background: var(--accent-glow); border-radius: 999px; padding: .05rem .55rem;
}

/* Stat band */
.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 1.1rem 0 2rem;
}
.statx {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem .85rem .9rem;
  animation: profileUp .45s ease both; animation-delay: 60ms;
}
.statx-num { display:block; font-family:var(--font-display); font-weight:700; font-size:2rem; line-height:1; color:var(--text); }
.statx-num small { font-size: 1rem; color: var(--text-sub); font-weight:600; }
.statx-label { display:block; margin-top:.35rem; font-size:.7rem; letter-spacing:.08em; text-transform:uppercase; color:var(--text-sub); }
.statx-bar { margin-top:.6rem; height:5px; border-radius:999px; background: var(--bg-card-alt); overflow:hidden; }
.statx-bar span { display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,var(--accent-dim),var(--accent)); }

/* Section heading */
.section-title { display:flex; align-items:baseline; gap:.6rem; margin: 1.8rem 0 .9rem; }
.section-title .count {
  font-family: var(--font-body); font-size:.75rem; font-weight:600;
  color: var(--text-sub); background: var(--bg-card-alt);
  border:1px solid var(--border); border-radius:999px; padding:.05rem .5rem;
}

/* Pick cards */
.pick-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.result-card, .pending-card {
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: .85rem 1rem .8rem;
  animation: profileUp .4s ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .15s, border-color .15s;
}
.result-card:hover, .pending-card:hover { transform: translateY(-2px); border-color: var(--border-glow); }
.result-card.is-hit { border-left: 3px solid var(--green); }
.result-card.is-miss { border-left: 3px solid var(--red); }
.pending-card { border-left: 3px solid var(--accent-dim); }

.rc-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:.55rem; }
.rc-group { font-size:.66rem; letter-spacing:.07em; text-transform:uppercase; color:var(--text-sub); background:var(--bg-card-alt); border-radius:999px; padding:.1rem .5rem; }
.rc-verdict { font-family:var(--font-display); font-weight:700; font-size:.95rem; }
.is-hit .rc-verdict { color: var(--green); }
.is-miss .rc-verdict { color: var(--red); }
.rc-date { font-size:.72rem; color:var(--text-muted); }

.rc-score { display:flex; align-items:center; gap:.6rem; }
.rc-team { flex:1; font-weight:600; font-size:.95rem; }
.rc-team.rc-away { text-align:right; }
.rc-picked { color: var(--accent); }
.rc-picked::after { content:" ◂"; font-size:.7em; color:var(--accent-dim); }
.rc-away.rc-picked::after { content:none; }
.rc-away.rc-picked::before { content:"▸ "; font-size:.7em; color:var(--accent-dim); }
.rc-num { font-family:var(--font-display); font-weight:700; font-size:1.5rem; color:var(--text); letter-spacing:.02em; }
.rc-num i { color: var(--text-muted); font-style:normal; padding:0 .12rem; }
.rc-vs { font-size:.7rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; }
.rc-team a.team-link { color: inherit; text-decoration: none; }
.rc-team a.team-link:hover { color: var(--accent); }
a.rc-num, a.rc-vs { text-decoration: none; transition: color .15s; }
a.rc-num:hover, a.rc-vs:hover { color: var(--accent); }

.rc-bottom { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin-top:.6rem; padding-top:.55rem; border-top:1px solid var(--border); }
.rc-call { font-size:.78rem; color:var(--text-sub); }
.rc-call strong { color: var(--text); }
.empty-note { grid-column: 1 / -1; }

@keyframes profileUp { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform:none; } }

@media (max-width: 600px) {
  .profile-hero { gap: 1rem; padding: 1.2rem; }
  .monogram { width:60px; height:60px; font-size:2rem; }
  .profile-id h1 { font-size: 1.9rem; }
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .pick-grid { grid-template-columns: 1fr; }
}

/* Knockout round badge on match cards */
.round-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: .12rem .6rem;
  margin-bottom: .6rem;
}

/* ---- Match detail (pick reveal) ---- */
.match-hero {
  text-align: center;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-surface));
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}
.match-hero .round-badge { margin: 0 auto .8rem; }
/* Inside the flex-column match card, keep badges sized to their content
   instead of stretching to full width via align-items: stretch. */
.match-card .round-badge { align-self: flex-start; margin-bottom: 0; }
.mh-teams { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.mh-team { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; text-align: right; }
.mh-team.mh-away { text-align: left; }
.mh-score { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--accent); }
.mh-score i { color: var(--text-muted); font-style: normal; padding: 0 .15rem; }
.mh-vs { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.mh-meta { margin-top: .7rem; font-size: .8rem; color: var(--text-sub); }

.tally { margin-bottom: 1.5rem; }
.tally-row { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.tally-label { flex: 0 0 7.5rem; font-size: .85rem; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--bg-card-alt); overflow: hidden; }
.tally-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); }
.tally-n { flex: 0 0 1.6rem; text-align: right; font-family: var(--font-display); font-weight: 700; }

.picks-list { display: flex; flex-direction: column; gap: .4rem; }
.pick-row { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.pick-row.is-hit { border-left: 3px solid var(--green); }
.pick-row.is-miss { border-left: 3px solid var(--red); }
.pr-name { font-weight: 600; }
.pr-pick { margin-left: auto; color: var(--text-sub); font-size: .9rem; }
.pr-pick .no-pick { color: var(--text-muted); }

.see-picks { display: inline-block; margin-top: .5rem; font-size: .78rem; color: var(--text-sub); }
.see-picks:hover { color: var(--accent); }

a.match-line { color: var(--text); text-decoration: none; }
a.match-line:hover { border-color: var(--border-glow); }

@media (max-width: 600px) {
  .tally-label { flex-basis: 5.5rem; }
  .mh-team { font-size: 1.15rem; }
}

/* ---- Group standings ---- */
.standings-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-card); margin-bottom: 2.5rem; }
.standings { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: .86rem; }
.standings thead { background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.standings th { font-family: var(--font-display); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: .8rem .55rem; text-align: center; }
.standings th.t-team { text-align: left; padding-left: 1.1rem; }
.standings td { padding: .75rem .55rem; text-align: center; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; color: var(--text-sub); }
.standings tbody tr:first-child td { border-top: none; }
.standings tbody tr:hover td { background: rgba(255,255,255,.025); }
.standings .t-pos { color: var(--text-muted); font-weight: 700; width: 2.4rem; position: relative; }
.standings .t-team { text-align: left; padding-left: 1.1rem; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text); letter-spacing: .01em; }
.standings .t-gd { color: var(--text); }
.standings .t-pts { color: var(--accent); font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
/* top-2 qualify marker */
.standings tr.qualify .t-pos { color: var(--green); }
.standings tr.qualify .t-pos::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 0 2px 2px 0; background: var(--green); }
.standings tr.is-self td { background: var(--accent-glow); }
.standings .t-team a.team-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.standings .t-team a.team-link:hover { color: var(--accent); border-bottom-color: var(--accent-dim); }

/* ---- Team page ---- */
.team-hero {
  text-align: center;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-surface));
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}
.team-flag { width: 3.5rem; height: auto; border-radius: 4px; margin-bottom: .7rem; box-shadow: var(--shadow-card); }
.team-name { margin: 0 0 .7rem; }
.team-hero .round-badge { margin-bottom: 0; }
a.mh-team.team-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
a.mh-team.team-link:hover { color: var(--accent); border-bottom-color: var(--accent-dim); }

/* group links + dashboard chips */
.group-link { color: var(--accent); }
.group-link:hover { color: #ffc04d; }
.groups-nav { margin-bottom: 2.5rem; }
.group-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.group-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4rem; height: 2.4rem;
  font-family: var(--font-display); font-weight: 700;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text);
  transition: border-color var(--transition), color var(--transition);
}
.group-chip:hover { border-color: var(--accent-dim); color: var(--accent); }

/* scoreline on match cards */
.match-card .score { font-weight: 800; font-size: 1.3rem; color: var(--accent); }
.locked-pick .no-pick { color: var(--text-muted); }

/* match hero venue line */
.mh-venue { display: inline-block; color: var(--text-muted); font-size: .85rem; margin-top: .3rem; transition: color .15s; }
.mh-venue:hover { color: var(--accent); }

/* Player results: inline group filter + team search */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.8rem 0 .9rem;
}
.results-header .section-title { margin: 0; }
.results-filters { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
/* Match-stream filters on the predict/played pages */
.match-filters { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.match-filter-search { flex: 1; min-width: 8rem; }
.results-filter-group,
.results-filter-search,
.match-filter-group,
.match-filter-search {
  font-family: var(--font-body);
  font-size: .85rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .65rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.results-filter-group,
.match-filter-group { cursor: pointer; }
.results-filter-search::placeholder,
.match-filter-search::placeholder { color: var(--text-sub); }
.results-filter-group:focus,
.results-filter-search:focus,
.match-filter-group:focus,
.match-filter-search:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.12);
}
.is-hidden { display: none; }
