/* ============================================================
   Oranje Predict — vanilla CSS (no Tailwind, no frameworks)
   ============================================================ */

:root {
  --radius: 0.75rem;
  --background: oklch(0.16 0.03 260);
  --foreground: oklch(0.98 0.005 90);
  --card: oklch(0.21 0.035 260);
  --card-2: oklch(0.21 0.035 260 / 0.7);
  --muted: oklch(0.24 0.03 260);
  --muted-fg: oklch(0.72 0.02 260);
  --primary: oklch(0.72 0.21 47);
  --primary-fg: oklch(0.15 0.02 260);
  --primary-glow: oklch(0.68 0.23 38);
  --accent: oklch(0.4 0.12 155);
  --accent-fg: oklch(0.98 0.005 90);
  --destructive: oklch(0.65 0.23 27);
  --border: rgba(255,255,255,0.1);
  --input: rgba(255,255,255,0.15);
  --ring: oklch(0.72 0.21 47 / 0.6);
  --flag-blue: oklch(0.38 0.18 265);
  --grad-orange: linear-gradient(135deg, oklch(0.72 0.21 47), oklch(0.68 0.23 38));
  --grad-hero: radial-gradient(ellipse 80% 60% at 50% 0%, oklch(0.72 0.21 47 / 0.35), transparent 70%),
               linear-gradient(180deg, oklch(0.18 0.04 265) 0%, oklch(0.13 0.03 260) 100%);
  --shadow-orange: 0 20px 60px -15px oklch(0.72 0.21 47 / 0.5);
  --shadow-glow: 0 0 80px oklch(0.72 0.21 47 / 0.45);
}

*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }
/* Reserve the scrollbar gutter at all times so opening a modal/drawer
   (which sets overflow:hidden) doesn't reflow the page horizontally. */
html { scrollbar-gutter: stable; }
html[data-drawer-open="true"], html[data-drawer-open="true"] body { overflow: hidden; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
/* Universal responsive guard: no descendant of <body> can exceed viewport width.
   Catches stray inline widths, embeds, or generated content that would re-introduce horizontal scroll. */
body { overflow-wrap: anywhere; }
body > * { max-width: 100vw; }
/* Scope to media/embeds only — keep inline icon SVGs at their authored size. */
img, video, iframe, embed, object { max-width: 100%; height: auto; }
pre, code { white-space: pre-wrap; word-break: break-word; }
h1, h2, h3, h4 { font-family: "Poppins", "Inter", sans-serif; letter-spacing: -0.02em; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .container { padding: 0 2rem; } }

.hidden { display: none !important; }
.orange { color: var(--primary); }
.muted { color: var(--muted-fg); font-size: 0.875rem; margin: 0; }
.muted-xs { color: var(--muted-fg); font-size: 0.75rem; margin: 0; }
.muted-strong { color: rgba(255,255,255,0.9); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fine { font-size: 11px; color: var(--muted-fg); margin: 0.75rem 0 0; }
.center { text-align: center; }
.w-full { width: 100%; }
.right { text-align: right; }

.text-gradient-orange {
  background: var(--grad-orange); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn-orange {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--grad-orange); color: var(--primary-fg);
  padding: 0.625rem 1.25rem; border-radius: 0.75rem; font-weight: 700; font-size: 0.875rem;
  box-shadow: var(--shadow-orange); transition: transform 0.2s;
}
.btn-orange:hover:not(:disabled) { transform: scale(1.03); }
.btn-orange:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-orange.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; border-radius: 0.875rem; }
.btn-ghost { padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600; color: rgba(255,255,255,0.9); border-radius: 0.5rem; }
.btn-ghost:hover { color: var(--primary); }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1rem; border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  border-radius: 0.75rem; font-weight: 600; font-size: 0.875rem; color: var(--foreground);
}
.btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,98,0,0.4); }
.btn-muted { padding: 0.5rem 1rem; background: var(--muted); border-radius: 0.75rem; font-weight: 600; font-size: 0.875rem; }
.btn-glass {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.875rem 1.75rem; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05);
  border-radius: 0.875rem; font-weight: 600; font-size: 1rem; backdrop-filter: blur(8px);
}
.btn-glass:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,98,0,0.5); }
.link-orange { color: var(--primary); font-weight: 700; }
.link-orange:hover { text-decoration: underline; }

.icon-btn { padding: 0.5rem; border-radius: 0.5rem; }
.icon-btn:hover { background: rgba(255,255,255,0.05); }

.ico { width: 1rem; height: 1rem; flex-shrink: 0; }
.ico.orange { color: var(--primary); }
.ico.big-ico { width: 2rem; height: 2rem; margin: 0 auto; display: block; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 50; transition: all 0.3s; background: transparent;
}
.navbar.scrolled {
  background: rgba(20, 20, 36, 0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.navbar-inner {
  max-width: 80rem; margin: 0 auto; padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
@media (min-width: 768px) { .navbar-inner { padding: 0.75rem 2rem; } }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-logo {
  position: relative; width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center;
  background: var(--grad-orange); border-radius: 0.75rem; box-shadow: var(--shadow-orange); color: var(--primary-fg);
  transition: transform 0.2s;
}
.brand-logo.small { width: 2.5rem; height: 2.5rem; font-size: 1.25rem; }
.brand:hover .brand-logo { transform: scale(1.1); }
.brand-dot { position: absolute; bottom: -3px; right: -3px; width: 0.75rem; height: 0.75rem; border-radius: 999px; background: #fff; border: 2px solid var(--background); }
.brand-text { font-family: "Poppins"; font-weight: 800; letter-spacing: -0.02em; font-size: 1.125rem; }
.nav-links { display: none; align-items: center; gap: 0.25rem; }
.nav-links a { padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: rgba(255,255,255,0.8); transition: all 0.2s; }
.nav-links a:hover { color: var(--primary); background: rgba(255,255,255,0.05); }
.nav-cta { display: none; align-items: center; gap: 0.5rem; }
.nav-burger { display: inline-flex; padding: 0.5rem; border-radius: 0.5rem; }
@media (min-width: 768px) { .nav-cta { display: inline-flex; } .nav-burger { display: none; } }
@media (min-width: 1024px) { .nav-links { display: inline-flex; } }

.drawer { position: fixed; inset: 0; z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(6,6,14,0.96);
}
.drawer-panel {
  position: fixed; right: 0; top: 0; height: 100%; width: 82%; max-width: 22rem;
  background: var(--card); border-left: 1px solid var(--border); padding: 1.5rem;
  transform: translateX(100%); transition: transform 0.3s; box-shadow: -20px 0 40px rgba(0,0,0,0.4);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-top: max(1.5rem, env(safe-area-inset-top));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.drawer-head .icon-btn { position: relative; z-index: 2; padding: 0.75rem; min-width: 2.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; }
.drawer-head .icon-btn * { pointer-events: none; }
.drawer-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.drawer-nav a { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 1rem; font-weight: 500; color: rgba(255,255,255,0.9); }
.drawer-nav a:hover { background: rgba(255,255,255,0.05); color: var(--primary); }
.drawer-cta { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.drawer-cta button { padding: 0.875rem 1rem; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--grad-hero); padding-top: 6rem; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-img {
  position: absolute; inset: 0; opacity: 0.3;
  background: url("https://images.unsplash.com/photo-1574629810360-7efbbe195018?auto=format&fit=crop&w=2400&q=80") center/cover;
}
.hero-fade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20,20,36,0.4), rgba(20,20,36,0.7), var(--background)); }
.hero-glow { position: absolute; top: -10rem; left: 50%; transform: translateX(-50%); width: 1100px; height: 600px; border-radius: 999px; background: oklch(0.72 0.21 47 / 0.25); filter: blur(140px); }
.tulip { position: absolute; left: -2.5rem; bottom: 2.5rem; width: 16rem; height: 16rem; color: rgba(255, 98, 0, 0.1); pointer-events: none; }
.sparks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.spark { position: absolute; bottom: 0; border-radius: 999px; background: var(--primary); animation: spark-rise linear infinite; }

@keyframes spark-rise {
  0% { transform: translateY(20px) scale(0.6); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-120vh) scale(1.2); opacity: 0; }
}
@keyframes float-slow { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 30px oklch(0.72 0.21 47 / 0.4); } 50% { box-shadow: 0 0 60px oklch(0.72 0.21 47 / 0.8); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.75; } 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.float-slow { animation: float-slow 6s ease-in-out infinite; }
.pulse-glow { animation: pulse-glow 2.4s ease-in-out infinite; }
.fade-up { animation: fade-up 0.7s ease-out both; }
.spin { animation: spin 1s linear infinite; }

.hero-wrap { position: relative; max-width: 80rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
@media (min-width: 768px) { .hero-wrap { padding: 2rem 2rem 4rem; } }
.hero-content { max-width: 56rem; margin: 0 auto; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.875rem;
  border: 1px solid rgba(255,98,0,0.3); background: rgba(255,98,0,0.1); color: var(--primary);
  border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
}
.pill-dot { width: 0.5rem; height: 0.5rem; background: var(--primary); border-radius: 999px; animation: pulse-glow 2s infinite; }
.hero-h1 {
  margin-top: 1.5rem; font-family: "Poppins"; font-weight: 900; line-height: 1.05;
  font-size: clamp(2.25rem, 6vw, 5rem);
}
.hero-glow-text { filter: drop-shadow(0 0 40px rgba(255,98,0,0.5)); }
.hero-sub { margin-top: 1.5rem; font-size: 1.125rem; color: rgba(255,255,255,0.75); }
@media (min-width: 768px) { .hero-sub { font-size: 1.25rem; } }
.hero-actions { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
@media (min-width: 640px) { .hero-actions { flex-direction: row; justify-content: center; } }
.hero-badges { margin-top: 2.5rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 2rem; font-size: 0.875rem; color: rgba(255,255,255,0.7); }
.hero-badges span { display: inline-flex; align-items: center; gap: 0.5rem; }

.countdown-card {
  margin: 2.5rem auto 0; max-width: 28rem;
  border: 1px solid var(--border); background: rgba(33,33,57,0.8); backdrop-filter: blur(20px);
  border-radius: 1rem; padding: 1.25rem; box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.countdown-head { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--primary); }
.live-dot { position: relative; display: inline-flex; width: 0.5rem; height: 0.5rem; }
.live-dot::before { content: ""; position: absolute; inset: 0; border-radius: 999px; background: var(--primary); animation: ping 1.5s infinite; }
.live-dot span { position: relative; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--primary); }
.countdown-match { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.countdown-match .flag { font-size: 1.5rem; }
.vs-team { font-family: "Poppins"; font-weight: 700; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; text-align: center; margin-top: 1rem; }
.countdown-grid > div { background: rgba(20,20,36,0.6); padding: 0.5rem; border-radius: 0.5rem; }
.cd-v { font-family: "Poppins"; font-weight: 800; font-size: 1.5rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.cd-l { font-size: 10px; font-weight: 600; color: var(--muted-fg); }

/* ---------- Sections ---------- */
.section { position: relative; padding: 6rem 0; }
.eyebrow { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--primary); }
.h2 { margin-top: 0.5rem; font-family: "Poppins"; font-weight: 900; font-size: clamp(2rem, 4vw, 3rem); }
.h2.big { font-size: clamp(2rem, 5vw, 3.75rem); }
.h3 { margin-top: 0.5rem; font-family: "Poppins"; font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.lead { margin-top: 0.75rem; color: rgba(255,255,255,0.7); font-size: 1rem; max-width: 36rem; }
.center-narrow { max-width: 42rem; margin: 0 auto; text-align: center; }
.row-between { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }
@media (min-width: 768px) { .row-between { flex-direction: row; justify-content: space-between; align-items: flex-end; } }
.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1.2fr 1fr; } }
.two-col-rev { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1024px) { .two-col-rev { grid-template-columns: 1fr 1.2fr; } }
.anchor-offset { position: absolute; top: -5rem; }

/* ---------- Predictions ---------- */
.streak-card { display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem; border: 1px solid var(--border); background: rgba(33,33,57,0.7); border-radius: 1rem; backdrop-filter: blur(10px); }
.streak-item { display: flex; align-items: center; gap: 0.5rem; }
.streak-v { font-family: "Poppins"; font-weight: 800; font-size: 1.25rem; }
.divider-v { width: 1px; height: 2.5rem; background: var(--border); }

.tabs { display: inline-flex; gap: 0.25rem; padding: 0.375rem; border: 1px solid var(--border); background: rgba(33,33,57,0.7); border-radius: 1rem; margin-top: 2.5rem; backdrop-filter: blur(10px); }
.tab { padding: 0.625rem 1.5rem; font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.7); border-radius: 0.75rem; }
.tab.active { background: var(--grad-orange); color: var(--primary-fg); box-shadow: var(--shadow-orange); }

.grid-3 { display: grid; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-3.cards { margin-top: 3rem; }

.grid-4 { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.match-card {
  position: relative; overflow: hidden; border: 1px solid var(--border); background: rgba(33,33,57,0.7);
  border-radius: 1rem; padding: 1.5rem; backdrop-filter: blur(20px); transition: all 0.2s;
}
.match-card:hover { border-color: rgba(255,98,0,0.5); box-shadow: var(--shadow-orange); }
.match-meta { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-fg); }
.match-meta .left { display: inline-flex; align-items: center; gap: 0.4rem; }
.match-meta .left::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--primary); }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.team { display: flex; flex-direction: column; align-items: center; text-align: center; }
.team .flag { font-size: 2.25rem; }
.team .name { margin-top: 0.5rem; font-family: "Poppins"; font-weight: 700; }
.team.nl { color: var(--primary); }
.vs { font-family: "Poppins"; font-weight: 900; font-size: 1.5rem; color: var(--muted-fg); }
.score-box { margin-top: 1.5rem; background: rgba(20,20,36,0.6); padding: 1rem; border-radius: 0.75rem; }
.score-box-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-fg); margin-bottom: 0.75rem; }
.score-row { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.score-input {
  width: 4rem; height: 3.5rem; border: 2px solid var(--border); background: var(--card); border-radius: 0.75rem;
  text-align: center; font-family: "Poppins"; font-weight: 900; font-size: 1.5rem; color: var(--foreground); outline: none;
}
.score-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,98,0,0.2); }
.score-input::-webkit-outer-spin-button, .score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-sep { font-family: "Poppins"; font-weight: 900; font-size: 1.75rem; color: var(--muted-fg); }
.penalty-box { margin-top: 1rem; animation: fade-up 0.4s ease-out both; }
.penalty-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); margin-bottom: 0.5rem; }
.penalty-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pen-btn { padding: 0.5rem 0.75rem; border: 2px solid var(--border); border-radius: 0.5rem; font-size: 0.875rem; font-weight: 700; transition: all 0.15s; }
.pen-btn.active { border-color: var(--primary); background: rgba(255,98,0,0.15); color: var(--primary); }
.pen-btn:hover:not(.active) { border-color: rgba(255,98,0,0.4); }
.community-bar { margin-top: 1.25rem; }
.community-bar-head { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted-fg); margin-bottom: 0.375rem; }
.community-bar-head b { color: var(--foreground); }
.bar-track { height: 0.5rem; background: var(--muted); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--grad-orange); transition: width 0.5s; }
.submit-btn {
  width: 100%; padding: 0.75rem; margin-top: 1.25rem; border-radius: 0.75rem;
  background: var(--grad-orange); color: var(--primary-fg); font-weight: 700; box-shadow: var(--shadow-orange); transition: transform 0.2s;
}
.submit-btn:hover:not(:disabled) { transform: scale(1.02); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.submit-btn.done { background: var(--accent); color: var(--accent-fg); box-shadow: none; }
.alert-error {
  margin-top: 1rem; display: flex; gap: 0.5rem; padding: 0.75rem; border: 1px solid rgba(220,80,80,0.3);
  background: rgba(220,80,80,0.1); color: var(--destructive); border-radius: 0.5rem; font-size: 0.75rem;
}
.alert-error .retry { margin-top: 0.5rem; display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border: 1px solid rgba(220,80,80,0.4); border-radius: 0.375rem; font-weight: 600; }
.alert-error .retry:hover { background: rgba(220,80,80,0.1); }
.status-loading { margin-top: 1rem; display: flex; justify-content: center; align-items: center; gap: 0.5rem; padding: 0.75rem; border: 1px solid rgba(255,98,0,0.25); background: rgba(255,98,0,0.1); color: var(--primary); border-radius: 0.5rem; font-size: 0.75rem; font-weight: 600; }
.sim-result { margin-top: 1rem; padding: 0.75rem; border: 1px solid rgba(255,98,0,0.3); background: rgba(255,98,0,0.1); border-radius: 0.75rem; animation: fade-up 0.4s both; }
.sim-result-head { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); }
.sim-result-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.25rem; }
.sim-pts { font-family: "Poppins"; font-weight: 900; font-size: 1.125rem; color: var(--primary); font-variant-numeric: tabular-nums; }

.spinner { width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; display: inline-block; animation: spin 0.8s linear infinite; }

.rules-foot { margin-top: 2.5rem; text-align: center; font-size: 0.75rem; color: var(--muted-fg); }

/* ---------- Player Ratings ---------- */
.ratings-section .ratings-bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, transparent, rgba(255,98,0,0.05), transparent); }
.filter-row { margin-top: 2.5rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.filter-chip { padding: 0.5rem 1.25rem; border-radius: 999px; font-size: 0.875rem; font-weight: 700; border: 1px solid var(--border); background: rgba(33,33,57,0.7); color: rgba(255,255,255,0.7); transition: all 0.15s; }
.filter-chip.active { background: var(--grad-orange); color: var(--primary-fg); border-color: transparent; box-shadow: var(--shadow-orange); }
.filter-chip:hover:not(.active) { color: var(--foreground); border-color: rgba(255,98,0,0.4); }

.player-card {
  position: relative; overflow: hidden; border: 1px solid var(--border); background: rgba(33,33,57,0.8);
  border-radius: 1rem; transition: all 0.2s; backdrop-filter: blur(20px);
}
.player-card:hover { transform: translateY(-4px); border-color: rgba(255,98,0,0.5); box-shadow: var(--shadow-orange); }
.player-portrait { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.player-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.7s; }
.player-card:hover .player-portrait img { transform: scale(1.05); }
.portrait-fade { position: absolute; inset-inline: 0; bottom: 0; height: 6rem; background: linear-gradient(to top, var(--card), transparent); }
.portrait-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 110%, oklch(0.62 0.22 38) 0%, oklch(0.32 0.18 35) 30%, oklch(0.15 0.06 265) 75%); }
.portrait-initials { font-family: "Poppins"; font-weight: 900; font-size: 8rem; color: rgba(255,255,255,0.95); letter-spacing: -0.05em; text-shadow: 0 6px 30px rgba(0,0,0,0.6); }
.portrait-num { position: absolute; bottom: 0.75rem; left: 0.75rem; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); padding: 2px 0.5rem; border-radius: 0.375rem; font-family: "Poppins"; font-weight: 900; font-size: 0.75rem; color: var(--primary); }
.portrait-cap { position: absolute; top: 0.75rem; left: 0.75rem; background: var(--primary); color: var(--primary-fg); padding: 0.25rem 0.625rem; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; box-shadow: var(--shadow-orange); }
.portrait-pos { position: absolute; top: 0.75rem; right: 0.75rem; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); color: #fff; padding: 0.25rem 0.625rem; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; }
.player-body { padding: 1.25rem; }
.player-row { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.player-name { font-family: "Poppins"; font-weight: 800; font-size: 1.125rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-club { font-size: 0.75rem; color: var(--muted-fg); margin-top: 0.125rem; }
.player-club b { color: var(--foreground); font-weight: 500; }
.rating-pill { display: inline-flex; align-items: center; gap: 0.25rem; background: rgba(255,98,0,0.15); padding: 0.25rem 0.5rem; border-radius: 0.5rem; }
.rating-pill .star { color: var(--primary); fill: var(--primary); width: 0.875rem; height: 0.875rem; }
.rating-v { font-family: "Poppins"; font-weight: 900; color: var(--primary); font-variant-numeric: tabular-nums; }
.votes { font-size: 10px; color: var(--muted-fg); margin-top: 0.25rem; text-align: right; }

.rate-row { margin-top: 1.25rem; }
.rate-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.rate-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-fg); }
.rate-v { font-family: "Poppins"; font-weight: 900; font-size: 1.875rem; background: var(--grad-orange); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
input[type="range"].rate-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--muted); outline: none; }
input[type="range"].rate-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 1.125rem; height: 1.125rem; border-radius: 999px; background: var(--primary); border: 2px solid #fff; cursor: pointer; }
input[type="range"].rate-slider::-moz-range-thumb { width: 1.125rem; height: 1.125rem; border-radius: 999px; background: var(--primary); border: 2px solid #fff; cursor: pointer; }

.photo-cta {
  margin-top: 0.625rem; width: 100%; padding: 0.625rem; border: 1px solid rgba(255,98,0,0.4);
  background: linear-gradient(to right, rgba(255,98,0,0.1), rgba(255,98,0,0.05), transparent);
  border-radius: 0.75rem; font-size: 0.875rem; font-weight: 700; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; transition: all 0.2s;
}
.photo-cta:hover { border-color: var(--primary); background: rgba(255,98,0,0.15); }

/* ---------- Leaderboard ---------- */
.leaderboard { margin-top: 2rem; overflow: hidden; border: 1px solid var(--border); background: rgba(33,33,57,0.7); border-radius: 1rem; backdrop-filter: blur(20px); }
.lb-row { display: flex; align-items: center; gap: 1rem; padding: 1rem; transition: background 0.15s; }
.lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-row:hover { background: rgba(255,255,255,0.05); }
.lb-rank { width: 3rem; height: 3rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 0.75rem; font-family: "Poppins"; font-weight: 900; font-size: 1.25rem; }
.lb-rank.r1 { background: var(--grad-orange); color: var(--primary-fg); box-shadow: var(--shadow-orange); }
.lb-rank.r2 { background: rgba(255,255,255,0.15); }
.lb-rank.r3 { background: rgba(64,180,100,0.4); color: var(--accent-fg); }
.lb-rank.rd { background: var(--muted); color: var(--muted-fg); }
.lb-avatar { position: relative; width: 3rem; height: 3rem; flex-shrink: 0; border-radius: 999px; border: 2px solid rgba(255,98,0,0.4); overflow: hidden; }
.lb-avatar-bg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary), var(--flag-blue)); }
.lb-avatar-i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: "Poppins"; font-weight: 800; font-size: 0.875rem; color: #fff; }
.lb-info { min-width: 0; flex: 1; }
.lb-info .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-info .meta { font-size: 0.75rem; color: var(--muted-fg); }
.lb-pts { text-align: right; }
.lb-pts .v { font-family: "Poppins"; font-weight: 800; font-size: 1.125rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.lb-pts .l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-fg); }

.prizes { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.prize-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; border: 1px solid var(--border); background: rgba(33,33,57,0.7); border-radius: 1rem; backdrop-filter: blur(10px); transition: all 0.2s; }
.prize-card:hover { border-color: rgba(255,98,0,0.5); box-shadow: var(--shadow-orange); }
.prize-icon { width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; background: var(--grad-orange); color: var(--primary-fg); border-radius: 0.75rem; box-shadow: var(--shadow-orange); flex-shrink: 0; }
.prize-card:hover .prize-icon { transform: scale(1.1); }
.prize-title { font-family: "Poppins"; font-weight: 800; font-size: 1.125rem; }
.prize-desc { font-size: 0.875rem; color: var(--muted-fg); margin-top: 0.125rem; }
.prize-cta { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid rgba(255,98,0,0.3); background: rgba(255,98,0,0.1); border-radius: 1rem; text-align: center; }
.prize-cta p { font-family: "Poppins"; font-weight: 700; font-size: 1.125rem; margin: 0.5rem 0 0; }

/* ---------- Why Us ---------- */
.why-card { position: relative; overflow: hidden; border: 1px solid var(--border); background: rgba(33,33,57,0.7); padding: 1.5rem; border-radius: 1rem; transition: all 0.2s; backdrop-filter: blur(10px); }
.why-card:hover { border-color: rgba(255,98,0,0.5); transform: translateY(-4px); box-shadow: var(--shadow-orange); }
.why-card .icon { display: inline-flex; width: 3rem; height: 3rem; align-items: center; justify-content: center; background: var(--grad-orange); color: var(--primary-fg); border-radius: 0.75rem; box-shadow: var(--shadow-orange); margin-bottom: 1rem; transition: transform 0.2s; }
.why-card:hover .icon { transform: scale(1.1) rotate(3deg); }
.why-card h3 { font-family: "Poppins"; font-weight: 800; font-size: 1.25rem; }
.why-card p { margin-top: 0.5rem; font-size: 0.875rem; color: rgba(255,255,255,0.7); }

/* ---------- Community ---------- */
.stat-pills { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.stat-pill { padding: 0.625rem 1.25rem; border: 1px solid var(--border); background: rgba(33,33,57,0.7); border-radius: 1rem; backdrop-filter: blur(10px); }
.stat-v { font-family: "Poppins"; font-weight: 800; font-size: 1.5rem; color: var(--primary); }
.feed { display: flex; flex-direction: column; gap: 1rem; }
.post { padding: 1.25rem; border: 1px solid var(--border); background: rgba(33,33,57,0.8); border-radius: 1rem; backdrop-filter: blur(10px); transition: border-color 0.15s; }
.post:hover { border-color: rgba(255,98,0,0.4); }
.post-head { display: flex; align-items: center; gap: 0.75rem; }
.post-avatar { width: 2.5rem; height: 2.5rem; border-radius: 999px; background: var(--grad-orange); color: var(--primary-fg); display: flex; align-items: center; justify-content: center; font-family: "Poppins"; font-weight: 800; }
.post-meta .name { font-weight: 700; }
.post-meta .name span { font-weight: 400; color: var(--muted-fg); font-size: 0.75rem; }
.post-meta .ago { font-size: 0.75rem; color: var(--muted-fg); }
.post-flag { margin-left: auto; font-size: 1.25rem; }
.post-text { margin-top: 0.75rem; color: rgba(255,255,255,0.9); }
.post-actions { margin-top: 1rem; display: flex; gap: 1.25rem; font-size: 0.875rem; color: var(--muted-fg); }
.post-actions span { display: inline-flex; align-items: center; gap: 0.375rem; cursor: pointer; transition: color 0.15s; }
.post-actions span:hover { color: var(--primary); }

/* ---------- Footer ---------- */
.footer { position: relative; border-top: 1px solid var(--border); background: rgba(33,33,57,0.4); backdrop-filter: blur(10px); }
.footer-stripe { position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--grad-orange); }
.footer-grid { padding: 3.5rem 1rem 0; display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; padding: 3.5rem 2rem 0; } }
.footer-brand p { margin-top: 1rem; font-size: 0.875rem; color: var(--muted-fg); max-width: 24rem; }
.footer h4 { font-family: "Poppins"; font-weight: 800; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.15em; }
.footer ul { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; color: var(--muted-fg); }
.footer a:hover { color: var(--primary); }
.footer-bottom { padding: 1.5rem 1rem 2.5rem; margin-top: 2.5rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: space-between; font-size: 0.875rem; color: var(--muted-fg); }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; padding: 1.5rem 2rem 2.5rem; } }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; max-width: 100vw; }
.modal.hidden { display: none; }
.modal {
  /* iOS safe-area padding so panel never sits under notch / home indicator */
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,36,0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal-backdrop { background: rgba(8,8,16,0.96); }
}
.modal-panel {
  position: relative; width: 100%; max-width: 28rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 1rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5); animation: fade-up 0.3s both;
  max-height: calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  contain: paint; -webkit-overflow-scrolling: touch;
}
.modal-panel > * { min-width: 0; max-width: 100%; }
/* Export modal: wider than default modal-panel, must never exceed viewport on mobile */
.export-preview-card { max-width: min(1000px, 100%); }
@media (max-width: 560px) {
  .modal { padding-left: max(0.5rem, env(safe-area-inset-left)); padding-right: max(0.5rem, env(safe-area-inset-right)); align-items: flex-start; }
  .export-preview-card { padding: 1rem; max-height: calc(100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
/* CSS guards: hover/active states on buttons inside a modal must never affect
   layout or trigger a horizontal scrollbar. Neutralize any inherited scale()
   transforms and replace with non-layout-affecting feedback. */
.modal .btn-orange,
.modal .submit-btn,
.modal .social-btn,
.modal .modal-close,
.modal .link-orange,
.modal [data-close-modal] {
  transform: none;
  transform-origin: center center;
  will-change: filter, background-color, color, border-color, box-shadow;
}
.modal .btn-orange:hover:not(:disabled),
.modal .btn-orange:active:not(:disabled),
.modal .btn-orange:focus-visible:not(:disabled),
.modal .submit-btn:hover:not(:disabled),
.modal .submit-btn:active:not(:disabled),
.modal .submit-btn:focus-visible:not(:disabled) {
  transform: none;
  filter: brightness(1.08);
}
.modal .social-btn:hover,
.modal .social-btn:active,
.modal .social-btn:focus-visible,
.modal .modal-close:hover,
.modal .modal-close:active,
.modal .modal-close:focus-visible,
.modal .link-orange:hover,
.modal .link-orange:active,
.modal .link-orange:focus-visible {
  transform: none;
}
.modal-close { position: absolute; top: 0.75rem; right: 0.75rem; padding: 0.5rem; border-radius: 0.5rem; color: var(--muted-fg); z-index: 2; }
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--foreground); }
.modal-close.inline { position: static; }
.modal-stripe { height: 0.5rem; background: var(--grad-orange); border-radius: 1rem 1rem 0 0; }

.auth-panel { max-width: 28rem; }
.auth-body { padding: 1.75rem; }
.auth-logo { width: 3rem; height: 3rem; margin: 0 auto 0.75rem; background: var(--grad-orange); border-radius: 1rem; box-shadow: var(--shadow-orange); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.auth-title { font-family: "Poppins"; font-weight: 900; font-size: 1.5rem; margin-top: 0; }
.social-grid { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.social-btn { padding: 0.625rem; border: 1px solid var(--border); background: rgba(20,20,36,0.6); border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; min-height: 2.75rem; transition: all 0.15s; }
.social-btn:hover { border-color: rgba(255,98,0,0.4); background: rgba(255,255,255,0.05); }
.social-btn svg { width: 1.25rem; height: 1.25rem; }
.divider-or { margin: 1.25rem 0; display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; color: var(--muted-fg); }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
.field-label { font-size: 0.75rem; font-weight: 600; color: var(--muted-fg); }
.field-wrap { margin-top: 0.25rem; display: flex; align-items: center; border: 1px solid var(--border); background: rgba(20,20,36,0.6); border-radius: 0.75rem; }
.field-wrap:focus-within { border-color: var(--primary); }
.field-wrap .ico { margin-left: 0.75rem; color: var(--muted-fg); }
.field-wrap input { flex: 1; padding: 0.75rem; background: transparent; border: none; outline: none; font-size: 0.875rem; }
.auth-switch { margin-top: 1rem; text-align: center; font-size: 0.875rem; color: var(--muted-fg); }
.auth-error { margin-top: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 8px; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-size: 0.875rem; text-align: center; }
.auth-error .auth-error-msg { margin: 0; font-weight: 600; }
.auth-error .auth-error-status { display: block; margin-top: 0.25rem; font-size: 0.75rem; opacity: 0.75; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Shared inline field-level error — same visual language as .auth-error and the
   shared modal error component, but tuned for under-input placement.        */
.field-error { margin: 0.375rem 0 0; padding: 0.5rem 0.625rem; border-radius: 8px; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-size: 0.8125rem; line-height: 1.35; display: flex; align-items: flex-start; gap: 0.375rem; }
.field-error[hidden], .field-error:empty { display: none !important; }
.field-error::before { content: "⚠"; font-size: 0.875rem; line-height: 1.2; flex: 0 0 auto; }
.field-error .field-error-body { flex: 1 1 auto; min-width: 0; }
.field-error .field-error-msg { margin: 0; font-weight: 600; }
.field-error .field-error-status { display: block; margin-top: 0.125rem; font-size: 0.6875rem; opacity: 0.75; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Highlight the invalid input itself so the error is obvious without reading. */
.field-wrap:has(input[aria-invalid="true"]) { border-color: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.18); }
input[aria-invalid="true"], .input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.18); }
.auth-fineprint { margin-top: 1rem; text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-fg); }

/* Photo modal */
.photo-panel { max-width: 32rem; }
.photo-head { position: sticky; top: 0; z-index: 2; background: rgba(33,33,57,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; border-radius: 1rem 1rem 0 0; }
.photo-head .auth-title { font-size: 1.25rem; }
.photo-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.field-group { display: flex; flex-direction: column; gap: 0.5rem; }
.field-group > .field-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-fg); }
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.help-text { font-size: 11px; color: var(--muted-fg); line-height: 1.5; margin: 0; }
/* Legacy alias — kept so existing setErr() calls render in the unified style. */
.error-text { font-size: 0.75rem; color: var(--destructive); margin: 0; min-height: 0; }
.error-text:empty { display: none; }
.input, .select { width: 100%; padding: 0.625rem 0.75rem; border: 1px solid var(--border); background: var(--background); color: var(--foreground); border-radius: 0.75rem; font-size: 0.875rem; outline: none; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(255,98,0,0.25); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chip { padding: 0.375rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; border: 1px solid var(--border); background: rgba(33,33,57,0.7); color: rgba(255,255,255,0.7); }
.chip.active { background: var(--grad-orange); color: var(--primary-fg); border-color: transparent; box-shadow: var(--shadow-orange); }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; color: rgba(255,255,255,0.8); }
.checkbox-row input[type="checkbox"] { margin-top: 2px; width: 1rem; height: 1rem; accent-color: var(--primary); }
.info-btn { margin-left: 0.375rem; width: 1.25rem; height: 1.25rem; border-radius: 999px; border: 1px solid rgba(255,98,0,0.5); color: var(--primary); font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.info-btn:hover { background: rgba(255,98,0,0.1); }
.price-box { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1rem; border: 1px solid rgba(255,98,0,0.3); background: rgba(255,98,0,0.1); border-radius: 0.75rem; }
.price-box p { margin: 0; }
.price-v { font-family: "Poppins"; font-weight: 900; font-size: 1.5rem; }
#filePreview { display: flex; align-items: center; gap: 0.75rem; }
#filePreview.has-file { padding: 0.625rem; border: 1px solid var(--border); border-radius: 0.75rem; }
#filePreview img, #filePreview .ph { width: 4rem; height: 4rem; border-radius: 0.5rem; object-fit: cover; background: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: var(--muted-fg); }
#filePreview .meta { font-size: 0.75rem; flex: 1; min-width: 0; }
#filePreview .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#filePreview .meta span { color: var(--muted-fg); }
#filePreview .rm { font-size: 0.75rem; color: var(--muted-fg); }
#filePreview .rm:hover { color: var(--foreground); }
.upload-progress {
  margin-top: 0.375rem; height: 0.5rem; border-radius: 999px;
  background: rgba(255,255,255,0.08); overflow: hidden; position: relative;
}
.upload-progress-bar {
  height: 100%; background: var(--primary); transition: width 120ms linear;
}
.upload-progress-text {
  margin-top: 0.25rem; font-size: 0.6875rem; color: var(--muted-fg);
}

.terms-panel { max-width: 28rem; padding: 1.25rem; }
.terms-text { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.625rem; font-size: 0.75rem; color: rgba(255,255,255,0.8); line-height: 1.6; max-height: 50vh; overflow-y: auto; }
.terms-text p { margin: 0; }

.pay-panel { max-width: 28rem; padding: 1.5rem; box-shadow: var(--shadow-orange); }
.pay-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-fg); }
.pay-summary { margin-top: 1.25rem; border: 1px solid var(--border); background: rgba(60,60,90,0.3); padding: 1rem; border-radius: 0.75rem; display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.875rem; }
.pay-summary > div { display: flex; justify-content: space-between; }
.pay-summary .row-big { font-size: 1rem; }
.pay-actions { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }

.status-banner { display: flex; gap: 0.5rem; padding: 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; }
.status-banner.success { border: 1px solid rgba(70,200,130,0.3); background: rgba(70,200,130,0.1); color: rgb(140,230,180); }
.status-banner.cancelled { border: 1px solid rgba(220,80,80,0.4); background: rgba(220,80,80,0.1); color: var(--destructive); }
.status-banner b { display: block; }

/* ---------- Toasts ---------- */
/*
 * Positioning is driven by a single JS helper (applyToastsPosition) that sets
 * data-pos on .toasts based on viewport breakpoints + modal state. Keep all
 * placement rules below in sync with TOAST_BREAKPOINTS in public/app.dev.js
 * — do not add ad-hoc @media queries here.
 */
.toasts {
  position: fixed; z-index: 200;
  display: flex; flex-direction: column;
  gap: 0.5rem; width: 22rem; max-width: calc(100vw - 2rem);
  bottom: 1rem; right: 1rem;
}
.toasts[data-pos="bottom-right"] { bottom: 1rem; right: 1rem; left: auto; top: auto; transform: none; align-items: stretch; }
.toasts[data-pos="top-center"] { top: 1rem; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); align-items: center; }
.toasts[data-pos="top-center-compact"] {
  top: 0.75rem; left: 50%; right: auto; bottom: auto; transform: translateX(-50%);
  width: calc(100vw - 1.5rem); align-items: center; gap: 0.375rem;
}
.toasts[data-pos="top-center-compact"] .toast { width: 100%; max-width: 22rem; padding: 0.75rem 0.875rem; }
.toasts[data-pos="top-center-compact"] .toast .t-title { font-size: 0.8125rem; }
.toasts[data-pos="top-center-compact"] .toast .t-desc { font-size: 0.75rem; }
.toast { padding: 0.875rem 1rem; border-radius: 0.75rem; background: var(--card); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: fade-up 0.25s both; display: flex; flex-direction: column; gap: 0.375rem; }
.toast .t-title { font-weight: 700; font-size: 0.875rem; }
.toast .t-desc { font-size: 0.8125rem; color: var(--muted-fg); }
.toast .t-action { margin-top: 0.25rem; align-self: flex-end; padding: 0.25rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; font-size: 0.75rem; font-weight: 600; }
.toast .t-action:hover { background: rgba(255,255,255,0.05); border-color: var(--primary); color: var(--primary); }
.toast.error { border-left: 3px solid var(--destructive); }
.toast.warning { border-left: 3px solid var(--primary); }
.toast.success { border-left: 3px solid rgb(70,200,130); }
.toast.loading { border-left: 3px solid var(--primary); }
.toast.loading .t-title::before { content: ""; display: inline-block; width: 0.875rem; height: 0.875rem; border: 2px solid var(--primary); border-right-color: transparent; border-radius: 999px; margin-right: 0.5rem; vertical-align: -2px; animation: spin 0.8s linear infinite; }
.toast .t-count { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.4rem; font-size: 0.7rem; font-weight: 700; border-radius: 999px; background: var(--primary); color: #fff; vertical-align: 1px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* ---------- Post-payment generation modal ---------- */
.gen-panel { max-width: 30rem; padding: 1.5rem; box-shadow: var(--shadow-orange); position: relative; }
.gen-success { text-align: center; padding: 0.5rem 0 0.25rem; }
.gen-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.25rem; height: 3.25rem; border-radius: 999px;
  background: rgba(70,200,130,0.15); color: rgb(140,230,180);
  margin-bottom: 0.75rem;
}
.gen-check svg { width: 1.75rem; height: 1.75rem; }
.gen-order {
  margin-top: 1.25rem; border: 1px solid var(--border); background: rgba(60,60,90,0.3);
  padding: 0.875rem 1rem; border-radius: 0.75rem;
  display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.875rem;
}
.gen-order > div { display: flex; justify-content: space-between; gap: 0.75rem; }
.gen-order .mono { word-break: break-all; text-align: right; }
.gen-progress {
  margin-top: 1.25rem; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem; border-radius: 0.75rem;
  background: rgba(255,98,0,0.08); border: 1px solid rgba(255,98,0,0.25);
  min-height: 3.25rem;
}
.gen-spinner {
  flex-shrink: 0; width: 1.25rem; height: 1.25rem; border-radius: 999px;
  border: 2px solid var(--primary); border-right-color: transparent;
  animation: spin 0.9s linear infinite;
}
.gen-line {
  margin: 0; font-size: 0.9rem; color: rgba(255,255,255,0.92);
  opacity: 0; transition: opacity 400ms ease;
}
.gen-line.fade-in  { opacity: 1; }
.gen-line.fade-out { opacity: 0; }

/* ---------- User menu (logged-in nav) ---------- */
.nav-user { display: none; position: relative; align-items: center; }
@media (min-width: 768px) { .nav-user:not(.hidden) { display: inline-flex; } }
.nav-user.hidden, .drawer-user.hidden { display: none !important; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.2s;
}
.user-chip:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,98,0,0.4); }
.user-chip[aria-expanded="true"] { background: rgba(255,98,0,0.12); border-color: rgba(255,98,0,0.5); }
.user-avatar {
  width: 1.85rem; height: 1.85rem; border-radius: 999px; flex-shrink: 0;
  background: var(--grad-orange); color: var(--primary-fg);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; box-shadow: var(--shadow-orange);
  text-transform: uppercase;
}
.user-avatar.lg { width: 2.75rem; height: 2.75rem; font-size: 1.05rem; }
.user-name { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { opacity: 0.7; transition: transform 0.2s; }
.user-chip[aria-expanded="true"] .user-caret { transform: rotate(180deg); }
.user-menu {
  position: absolute; top: calc(100% + 0.6rem); right: 0; min-width: 16.5rem;
  background: rgba(28, 28, 44, 0.96); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 0.9rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  padding: 0.5rem; z-index: 70;
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.user-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.user-menu-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border-radius: 0.6rem;
  background: rgba(255,98,0,0.07); margin-bottom: 0.4rem;
}
.user-menu-name { font-weight: 700; font-size: 0.95rem; color: #fff; line-height: 1.1; }
.user-menu-email { font-size: 0.78rem; color: rgba(255,255,255,0.6); margin-top: 0.2rem; word-break: break-all; }
.user-menu-item {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  padding: 0.65rem 0.75rem; border-radius: 0.55rem;
  background: transparent; color: rgba(255,255,255,0.9); font-size: 0.92rem; font-weight: 500;
  text-align: left; cursor: pointer; transition: all 0.15s;
}
.user-menu-item svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; opacity: 0.8; }
.user-menu-item:hover { background: rgba(255,255,255,0.07); color: var(--primary); }
.user-menu-item:hover svg { opacity: 1; }
.user-menu-item.danger { color: #ff9a7a; }
.user-menu-item.danger:hover { background: rgba(255, 80, 80, 0.12); color: #ff7a5a; }
.user-menu-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 0.4rem 0.3rem; }

.drawer-user { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 1.5rem; }

/* ---------- Account modals ---------- */
.account-panel { max-width: 38rem; }
.account-body { padding: 1.5rem 1.5rem 1.75rem; }
.account-head { margin-bottom: 1.25rem; }
.account-eyebrow {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--primary);
  background: rgba(255,98,0,0.12); padding: 0.3rem 0.65rem; border-radius: 999px; margin-bottom: 0.6rem;
}
.account-stack { display: flex; flex-direction: column; gap: 0.65rem; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.account-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem; padding: 0.85rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.account-card .ac-main { min-width: 0; flex: 1; }
.account-card .ac-title { font-weight: 600; color: #fff; font-size: 0.95rem; word-break: break-word; }
.account-card .ac-sub { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 0.2rem; }
.account-card .ac-amount { font-weight: 800; color: var(--primary); white-space: nowrap; }
.account-card .ac-status {
  font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.account-card .ac-status.paid { background: rgba(34,197,94,0.15); color: #4ade80; }
.account-card .ac-status.pending { background: rgba(255,193,7,0.15); color: #fbbf24; }
.account-image-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem; padding: 0.65rem;
}
.account-image-thumb {
  aspect-ratio: 1; border-radius: 0.5rem; background: var(--grad-orange);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-fg); font-weight: 900; font-size: 1.5rem;
  box-shadow: var(--shadow-orange);
}
.account-image-meta { font-size: 0.75rem; color: rgba(255,255,255,0.7); text-align: center; }
.account-image-meta b { color: #fff; display: block; font-size: 0.85rem; }
.account-empty {
  padding: 2rem 1rem; text-align: center;
  border: 1px dashed rgba(255,255,255,0.15); border-radius: 0.75rem;
  color: rgba(255,255,255,0.65); font-size: 0.9rem;
}
.account-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 0.6rem;
}
.account-row .label { color: rgba(255,255,255,0.65); font-size: 0.85rem; }
.account-row .value { color: #fff; font-weight: 600; text-align: right; word-break: break-word; }

/* ============================================================
   Toernooi stand (WK 2026)
   ============================================================ */
.standings-section { padding-top: 2rem; padding-bottom: 2rem; }
.standings-grid {
  margin-top: 3rem;
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .standings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.standings-meta {
  margin-top: 1rem; font-size: 0.85rem; color: var(--muted-fg);
  display: flex; align-items: center; gap: 0.6rem; justify-content: flex-end;
}
.standings-meta .dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #69d39a;
  box-shadow: 0 0 6px #69d39a;
}
.standings-meta.is-error { color: #f08a8a; justify-content: space-between; }
.standings-meta.is-error .dot { background: #f08a8a; box-shadow: 0 0 6px #f08a8a; }
.standings-meta button {
  background: rgba(255,255,255,0.06); color: #fff; border: 1px solid var(--border);
  border-radius: 0.5rem; padding: 0.35rem 0.75rem; font-size: 0.8rem; cursor: pointer;
}
.standings-meta button:hover { background: rgba(255,255,255,0.12); }

/* Toolbar met handmatige refresh-knop */
.standings-toolbar {
  margin-top: 1.5rem; display: flex; justify-content: flex-end;
}
.standings-refresh {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  color: #fff; border: 1px solid var(--border); border-radius: 0.6rem;
  padding: 0.55rem 1rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  min-height: 2.5rem;
}
.standings-refresh:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.standings-refresh:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.standings-refresh:disabled { opacity: 0.7; cursor: progress; }
.standings-refresh .refresh-icon { display: inline-block; font-size: 1rem; line-height: 1; }
.standings-refresh.is-loading .refresh-icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.std-skel {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem;
  min-height: 22rem;
}
.std-skel .bar {
  height: 0.9rem; border-radius: 0.4rem;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%; animation: skelShimmer 1.4s linear infinite;
}
.std-skel .bar.sm { height: 0.7rem; width: 50%; }
.std-skel .bar.lg { height: 1.5rem; width: 40%; }
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Error state inside grid */
.std-error-card {
  grid-column: 1 / -1;
  border: 1px solid oklch(0.65 0.23 27 / 0.4);
  background: oklch(0.65 0.23 27 / 0.08);
  color: #ffd2d2; border-radius: 1rem; padding: 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.std-error-card button {
  background: #fff; color: #111; border: 0; border-radius: 0.5rem;
  padding: 0.5rem 1rem; font-weight: 700; cursor: pointer;
}

/* Badge: gaat door als beste 3e */
.std-table tr.qual-third-best td.pos { color: #ffd166; font-weight: 800; }
.std-table tr.qual-third-best { background: linear-gradient(90deg, oklch(0.78 0.16 80 / 0.18), transparent); }
.third-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 900; line-height: 1;
  padding: 0.15rem 0.35rem; border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #f6a300); color: #000;
  margin-left: 0.4rem; vertical-align: 0.05rem;
  box-shadow: 0 0 0 1px rgba(255,209,102,0.5);
}
.third-badge.out {
  background: rgba(255,255,255,0.08); color: var(--muted-fg);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 0.62rem; padding: 0.15rem 0.45rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
}
.standings-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 12px 30px -20px rgba(0,0,0,0.6);
}
.standings-card[open] .std-toggle-hint { transform: rotate(0deg); }
.std-toggle-hint { transition: transform 0.2s ease; color: var(--muted-fg); font-size: 1rem; transform: rotate(-90deg); margin-left: auto; }
.std-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; user-select: none; }
.std-header::-webkit-details-marker { display: none; }
.std-header::marker { content: ""; }
.std-header:hover .std-title { color: var(--primary); }
.std-header:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 0.5rem; }
.std-body { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.75rem; }
.std-title { font-family: "Poppins"; font-size: 1.35rem; font-weight: 800; }
.std-title::before {
  content: ""; display: inline-block; width: 0.4rem; height: 1.1rem;
  background: var(--grad-orange); border-radius: 2px; margin-right: 0.5rem;
  vertical-align: -0.15rem;
}
.std-sub { font-size: 0.8rem; color: var(--muted-fg); }
.std-table-wrap { overflow-x: auto; }
.std-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.std-table th, .std-table td {
  padding: 0.5rem 0.4rem; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.std-table th { color: var(--muted-fg); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.std-table td.team-cell { text-align: left; font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) {
  .std-table td.team-cell { white-space: normal; }
  /* Star badge stays inline behind the team name on mobile (narrow). */
  .std-table td.team-cell .third-badge {
    display: inline-flex; margin: 0 0 0 0.3rem; vertical-align: baseline;
  }
  .std-table { font-size: 0.78rem; }
  .std-table th, .std-table td { padding: 0.4rem 0.3rem; }
}
.std-table td.pos { color: var(--muted-fg); width: 1.5rem; }
.std-table td.pts { font-weight: 800; color: #fff; }
.std-table td.pos-gd { color: #69d39a; }
.std-table td.neg-gd { color: #f08a8a; }
.std-table tr.qual-direct td.pos { color: var(--primary); font-weight: 800; }
.std-table tr.qual-third td.pos { color: #b9e2ff; font-weight: 800; }
.std-table tr.qual-direct { background: linear-gradient(90deg, oklch(0.72 0.21 47 / 0.12), transparent); }
.std-table tr.qual-third { background: linear-gradient(90deg, oklch(0.5 0.15 250 / 0.15), transparent); }
.std-matches { border-top: 1px solid var(--border); padding-top: 0.5rem; }
.std-matches summary {
  cursor: pointer; font-size: 0.8rem; color: var(--muted-fg);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.std-matches ul { list-style: none; padding: 0.5rem 0 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.std-match {
  display: grid;
  grid-template-columns: 5.5rem minmax(0,1fr) 3rem minmax(0,1fr) 5.5rem;
  gap: 0.6rem; align-items: center; font-size: 0.82rem;
  padding: 0.45rem 0.6rem; border-radius: 0.5rem;
  background: rgba(255,255,255,0.025);
}
.std-match > * { min-width: 0; }
.std-match-date { color: var(--muted-fg); font-variant-numeric: tabular-nums; line-height: 1.2; }
.std-team {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-weight: 600; min-width: 0; line-height: 1.2;
}
.std-team .flag { flex: 0 0 auto; }
.std-team .team-name { min-width: 0; overflow-wrap: anywhere; }
.std-team.home { justify-content: flex-end; text-align: right; }
.std-team.home .flag { order: 2; }
.std-team.away { justify-content: flex-start; text-align: left; }
.std-score {
  font-family: "Poppins"; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums; text-align: center;
}
.std-match .status-badge { justify-self: end; }
@media (max-width: 560px) {
  .std-match {
    grid-template-columns: minmax(0,1fr) 3rem minmax(0,1fr);
    row-gap: 0.3rem;
  }
  .std-match-date { grid-column: 1 / -1; font-size: 0.72rem; text-align: center; }
  .std-match .status-badge { grid-column: 1 / -1; justify-self: center; }
}
.status-badge {
  font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
}
.status-played { background: rgba(255,255,255,0.08); color: var(--muted-fg); }
.status-live { background: oklch(0.65 0.23 27 / 0.18); color: #ffb4b4; }
.status-upcoming { background: oklch(0.5 0.15 250 / 0.18); color: #b9d4ff; }
.live-dot-mini {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d;
  animation: livePulse 1.2s infinite;
}
@keyframes livePulse { 0%,100% { opacity:1 } 50% { opacity:0.4 } }
.std-knockout {
  border-top: 1px solid var(--border); padding-top: 0.75rem;
}
.std-knockout-head {
  font-size: 0.72rem; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; margin-bottom: 0.5rem;
}
.std-knockout ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; line-height: 1.45; }
.std-knockout strong { color: var(--primary); font-weight: 700; margin-right: 0.25rem; }
.std-knockout .flag { font-size: 1rem; margin: 0 0.15rem; }
.std-knockout .muted-xs { color: var(--muted-fg); font-size: 0.72rem; margin-left: 0.25rem; }

/* ============= Knockout bracket section ============= */
.knockout-section { padding-top: 2rem; padding-bottom: 2rem; }
.ko-bracket { display: flex; flex-direction: column; gap: 2rem; margin-top: 2rem; }
.ko-round { display: flex; flex-direction: column; gap: 0.75rem; }
.ko-round-title {
  font-size: 0.85rem; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800;
  margin: 0 0 0.25rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.ko-matches { list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.ko-matches .ko-match { flex: 1 1 280px; max-width: 360px; }
.ko-match {
  border: 1px solid var(--border); border-radius: 0.75rem;
  background: var(--card-bg, rgba(255,255,255,0.02));
  padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.6rem;
}
.ko-match[data-status="bezig"] { border-color: #ff4d4d; box-shadow: 0 0 0 1px rgba(255,77,77,0.25); }
.ko-match-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted-fg); }
.ko-match-id { font-weight: 700; color: var(--primary); letter-spacing: 0.05em; }
.ko-match-date { margin-left: auto; }
.ko-match-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.ko-side { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.ko-side:last-child { justify-content: flex-end; text-align: right; }
.ko-side:last-child .ko-team { align-items: flex-end; }
.ko-flag { font-size: 1.25rem; line-height: 1; }
.knockout-section .ko-flag { display: none; }
.ko-team { display: flex; flex-direction: column; min-width: 0; font-size: 0.9rem; font-weight: 600; }
.ko-team .muted-xs { color: var(--muted-fg); font-size: 0.7rem; font-weight: 400; margin-top: 0.1rem; }
.ko-tbd { font-style: italic; color: var(--muted-fg); font-weight: 500; }
.ko-match-score { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.05rem; padding: 0 0.25rem; }
.ko-side.is-winner .ko-team { color: var(--primary); }
.ko-side.is-winner .ko-team::after { content: "✓"; margin-left: 0.35rem; color: var(--primary); font-weight: 800; }

/* ============= Export Preview Modal ============= */
.export-preview-card { max-width: 1000px; width: 100%; }
.export-preview-card { padding: 1.5rem; }
.modal-sub { color: var(--muted-fg); font-size: 0.875rem; margin: 0 0 1rem; }
.export-preview-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; min-width: 0; max-width: 100%; }
@media (max-width: 820px) { .export-preview-body { grid-template-columns: 1fr; } }
.export-preview-stage { position: relative; background: #0f1126; border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; margin: 0 auto; touch-action: pan-y; max-width: 100%; aspect-ratio: 1.91 / 1; }
.export-preview-stage canvas { display: block; width: 100%; height: 100%; max-width: 100%; touch-action: pan-y; pointer-events: none; object-fit: contain; }
/* Hard safety: never let stage push the modal wider than its container,
   even if inline width is set after rendering the source canvas. */
.export-preview-left, .export-preview-right { min-width: 0; max-width: 100%; }
.export-preview-stage { width: min(var(--export-preview-w, 460px), 100%) !important; }
.export-crop-frame { position: absolute; border: 2px solid var(--primary); box-shadow: 0 0 0 9999px rgba(15,17,38,0.55); cursor: move; display: none; }
.export-stage-loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 0.5rem; background: rgba(15,17,38,0.85); color: #fff; font-size: 0.9rem; }
.export-stage-loading .spinner { width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.export-controls { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.export-aspect-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.aspect-btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; font-weight: 600; border-radius: 0.4rem; background: rgba(255,255,255,0.06); color: var(--muted-fg); border: 1px solid var(--border); }
.aspect-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.aspect-btn.is-active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.export-zoom-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--muted-fg); }
.export-zoom-row input[type="range"] { flex: 1; }
.export-hint { font-size: 0.75rem; color: var(--muted-fg); margin: 0; }
.export-caption-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--muted-fg); }
#exportCaption { width: 100%; min-height: 14rem; padding: 0.75rem; border-radius: 0.5rem; background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--foreground); font-family: inherit; font-size: 0.85rem; line-height: 1.5; resize: vertical; }
#exportCaption:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.export-caption-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.export-caption-row > *, .export-share-row > * { min-width: 0; max-width: 100%; }
.export-share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.export-share-row .btn-primary, .export-share-row .btn-ghost { padding: 0.55rem 0.85rem; font-size: 0.85rem; border-radius: 0.5rem; }
.export-share-row .btn-ghost { background: rgba(255,255,255,0.06); border: 1px solid var(--border); }

/* Download buttons — alle drie identieke, prominente layout */
.export-download-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
@media (max-width: 520px) { .export-download-row { grid-template-columns: 1fr; } }
.export-dl-btn { padding: 0.7rem 0.9rem; font-size: 0.9rem; font-weight: 700; border-radius: 0.55rem; text-align: center; cursor: pointer; background: var(--primary); color: var(--primary-fg); border: 1px solid var(--primary); box-shadow: 0 2px 0 rgba(0,0,0,0.15); transition: transform 0.05s ease, filter 0.15s ease; }
.export-dl-btn:hover { filter: brightness(1.07); }
.export-dl-btn:active { transform: translateY(1px); box-shadow: none; }
.export-dl-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Brand input row deelt look met group-row */
.export-group-row input[type="text"] { flex: 1; padding: 0.4rem 0.55rem; border-radius: 0.4rem; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--foreground); font-size: 0.8rem; }
.export-group-row input[type="text"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.export-share-note { margin-top: 0.6rem; font-size: 0.8rem; color: var(--muted-fg); min-height: 1.2em; }
.export-share-note.is-ok { color: #69d39a; }
.export-share-note.is-err { color: #f08a8a; }
.export-share-note.has-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; color: var(--foreground); }
.export-status-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.55rem; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); font-size: 0.75rem; font-weight: 600; line-height: 1; color: var(--foreground); }
.export-status-pill[data-pill="ok"] { background: rgba(105,211,154,0.12); border-color: rgba(105,211,154,0.4); color: #b6f0ce; }
.export-status-pill[data-pill="err"] { background: rgba(240,138,138,0.12); border-color: rgba(240,138,138,0.4); color: #ffc2c2; }
.export-status-pill[data-pill="info"] { background: rgba(255,182,114,0.12); border-color: rgba(255,182,114,0.4); color: #ffd6a8; }
.export-status-log { margin-top: 0.55rem; border: 1px solid var(--border); border-radius: 0.55rem; background: rgba(255,255,255,0.02); }
.export-status-log > summary { list-style: none; cursor: pointer; padding: 0.45rem 0.6rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted-fg); font-weight: 600; user-select: none; }
.export-status-log > summary::-webkit-details-marker { display: none; }
.export-status-log > summary::before { content: "▸"; display: inline-block; transition: transform 0.15s ease; }
.export-status-log[open] > summary::before { transform: rotate(90deg); }
.export-status-log.has-error > summary .export-status-log-title { color: #ffc2c2; }
.export-status-log-title { flex: 1 1 auto; }
.export-status-log-count { color: var(--muted-fg); font-weight: 500; margin-left: 0.25rem; }
.export-status-log-copy, .export-status-log-clear { padding: 0.2rem 0.5rem; font-size: 0.7rem; border-radius: 0.35rem; }
.export-status-log-pre { margin: 0; padding: 0.6rem 0.75rem; border-top: 1px solid var(--border); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; line-height: 1.45; color: var(--foreground); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; background: rgba(0,0,0,0.25); border-radius: 0 0 0.5rem 0.5rem; }
.export-stage-loading { flex-direction: column; padding: 1rem 1.25rem; }
.export-progress { width: min(260px, 80%); height: 6px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; margin-top: 0.5rem; }
.export-progress-bar { height: 100%; width: 0%; background: var(--primary); transition: width 0.25s ease; }

/* Group filter row */
.export-group-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted-fg); }
.export-group-row select { flex: 1; padding: 0.4rem 0.55rem; border-radius: 0.4rem; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--foreground); font-size: 0.8rem; }
.export-group-row select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.export-group-row select option { color: #111; background: #fff; }

/* Print-PDF row */
.spinner-inline { display: inline-block; width: 0.75rem; height: 0.75rem; border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 0.35rem; }
