@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #0b1220;
  --bg-2: #101a2b;
  --ink: #eaf2ff;
  --muted: #c3cfdd;
  --line: #1c2e46;
  --card: #0f1a2b;
  --accent: #35ff72;
  --accent-ink: #06180d;
  --success: #41e38b;
  --warning: #ffc857;
  --danger: #ff5d5d;
  --focus: rgba(53, 255, 114, 0.45);
  --shadow: 0 10px 30px rgba(3, 10, 20, 0.55);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(900px 500px at 10% -20%, rgba(53, 255, 114, 0.12) 0%, transparent 60%),
              radial-gradient(900px 400px at 100% 0%, rgba(74, 116, 255, 0.12) 0%, transparent 55%),
              var(--bg);
  font-family: "Space Grotesk", "Sora", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 10px);
}

h1, h2, h3 {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

a { color: inherit; text-decoration: none; }
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.app-shell { padding: 24px; }
.page { max-width: 1200px; margin: 0 auto; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(15, 26, 43, 0.9);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.site-header .brand-wordmark { color: var(--ink); }
.site-header .brand-submark { color: var(--muted); }
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nav.nav-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  gap: 8px;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.nav.nav-tabs::-webkit-scrollbar { height: 6px; }
.nav.nav-tabs::-webkit-scrollbar-thumb { background: #243750; border-radius: 999px; }
.nav-item {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.nav-item:hover,
.nav-item:focus-visible {
  color: var(--ink);
  border-color: #2a3e5b;
  background: #0b1526;
  outline: none;
}
.nav-item--active {
  color: var(--accent);
  border-color: rgba(53, 255, 114, 0.35);
  background: rgba(53, 255, 114, 0.08);
}
.section { margin: 24px 0; }
.section-title {
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 8px;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  animation: fade-up 220ms ease both;
}
.card:hover { transform: translateY(-2px); border-color: #2a3e5b; }
.card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3) { animation-delay: 120ms; }
.card:nth-child(4) { animation-delay: 180ms; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { font-size: 22px; font-weight: 700; }
.card-meta { color: var(--muted); font-size: 14px; }
.card-next {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b1526;
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.card-next .next-cta { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; }
.card-next .next-deadline { color: var(--warning); font-size: 12px; }
.card-round { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.card-footer { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-kpi { color: var(--muted); font-size: 13px; }

.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.admin-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.admin-grid .card-meta { display: none; }
.tile-list { display: grid; gap: 12px; }
.tile { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 8px; transition: transform 180ms ease, border-color 180ms ease; animation: fade-up 220ms ease both; }
.tile:hover { transform: translateY(-1px); border-color: #2a3e5b; }
.tile:nth-child(2) { animation-delay: 60ms; }
.tile:nth-child(3) { animation-delay: 120ms; }
.tile:nth-child(4) { animation-delay: 180ms; }
.tile-top { display: flex; align-items: center; gap: 10px; }
.tile-meta { color: var(--muted); font-size: 14px; }
.tile-deadline { color: var(--muted); font-size: 12px; }
.tile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #152742;
  font-weight: 600;
}
.status-pill.is-open { border-color: #4aa3ff; background: rgba(74, 163, 255, 0.15); }
.status-pill.is-proposed { border-color: var(--warning); background: rgba(255, 200, 87, 0.16); }
.status-pill.is-scheduled { border-color: var(--success); background: rgba(65, 227, 139, 0.16); }
.status-pill.is-dispute { border-color: var(--danger); background: rgba(255, 93, 93, 0.18); }
.status-pill.is-closed { border-color: #2c3e57; background: #111c2d; }
.vs { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(53, 255, 114, 0.3); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }

.field { margin-bottom: 12px; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #0b1526;
  color: var(--ink);
}
.select,
.search-input,
.datetime-input,
.file-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #0b1526;
  color: var(--ink);
}
.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}
.select:focus,
.search-input:focus,
.datetime-input:focus,
.file-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}
.help { color: var(--muted); font-size: 13px; min-height: 18px; }
.help.is-success { color: #15803d; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }

.select-wrap { position: relative; }
.select { appearance: none; }
.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.select-meta { color: var(--muted); font-size: 12px; }

.club-chip { display: inline-flex; align-items: center; gap: 10px; }
.club-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0b1526;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.club-name { font-weight: 600; }

.match-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.match-hero .vs { color: var(--muted); }
.match-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.meta-row { background: #0b1526; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.meta-row .label { margin-right: 6px; }
.plan-grid { display: grid; gap: 16px; }
.plan-card { background: #0b1526; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.plan-date { font-weight: 600; }
.plan-form { border-top: 1px dashed var(--line); padding-top: 12px; }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.score-actions { display: grid; gap: 12px; }

.upload-box {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: #0b1526;
}
.upload-preview {
  display: block;
  max-width: 100%;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.chat { display: grid; gap: 10px; }
.chat-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #0b1526; }
.chat-meta { font-size: 12px; color: var(--muted); }
.chat-body { font-size: 14px; }

.standings-mini { display: grid; gap: 8px; }
.standings-row { display: grid; grid-template-columns: 30px 1fr 70px 90px; gap: 8px; }
.flag-up { color: var(--success); }
.flag-down { color: var(--danger); }

.state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  margin-bottom: 10px;
}
.state-success {
  border-color: rgba(65, 227, 139, 0.35);
  color: #b7f7d4;
  background: rgba(65, 227, 139, 0.08);
}
.state-detail {
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
}
.state-error { border-color: #7f1d1d; color: #fecaca; background: #2a1111; }
.state-loading { background: #0b1526; }

.empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  background: #0b1526;
}
.empty-title { font-size: 18px; font-weight: 700; }
.empty-copy { color: var(--muted); margin: 6px 0 16px; }

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.brand-panel {
  padding: 48px;
  background: linear-gradient(140deg, #0b1220 0%, #101a2b 60%, #1a2f4a 100%);
  color: var(--ink);
}
.brand-mark { font-size: 56px; letter-spacing: 1px; text-transform: uppercase; }
.brand-tag { color: var(--muted); }
.auth-card { padding: 48px; display: flex; flex-direction: column; justify-content: center; }

.brand-wordmark {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: 48px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-wordmark::after {
  content: "";
  display: inline-block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
}
.brand-submark { color: var(--muted); font-size: 14px; letter-spacing: 1px; }

.competition-card { display: grid; gap: 8px; }
.match-card { display: grid; gap: 6px; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.skeleton {
  background: linear-gradient(90deg, #0b1526 25%, #12203a 50%, #0b1526 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 10px;
}
.skeleton-line { height: 12px; margin: 8px 0; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.reveal { animation: fade-up 420ms ease both; }
.delay-1 { animation-delay: 60ms; }
.delay-2 { animation-delay: 120ms; }
.delay-3 { animation-delay: 180ms; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .brand-panel { min-height: 40vh; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .nav { gap: 8px; }
  .nav-item { padding: 6px 8px; }
}
