/* Fan Ring MVP — Global Dark Theme */
:root {
  --bg: #0d0e14;
  --surface: #13131a;
  --surface2: #1a1b24;
  --line: rgba(255,255,255,0.09);
  --gold: #d4a64f;
  --gold-dim: rgba(212,166,79,0.18);
  --gold-border: rgba(212,166,79,0.36);
  --text: #f0f0f4;
  --muted: rgba(240,240,244,0.45);
  --danger: #e05252;
  --success: #4caf7d;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

/* ── Layout ── */
.container, .shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

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

/* ── Nav ── */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 24px;
}

.logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* ── Panels & Cards ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.card {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 800; line-height: 1.2; }
h1 { font-size: 38px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }

.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.lead { font-size: 16px; color: var(--muted); margin-top: 8px; }
.small, .mini { font-size: 12px; color: var(--muted); }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; }
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ── Forms ── */
.form {
  display: grid;
  gap: 10px;
}

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* Ripple animation on button click */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.12);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.btn:active::after {
  opacity: 1;
  transform: scale(1);
  transition: none;
}
.btn:active { transform: scale(0.97); }

.btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18); }

.btn.primary {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  color: var(--gold);
}
.btn.primary:hover { background: rgba(212,166,79,0.26); }

/* ── Table ── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; word-break: break-all; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ── Badges ── */
.badges { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.badge {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

/* ── Utility ── */
.hidden { display: none !important; }

a { color: inherit; }

.success {
  color: var(--success);
  font-weight: 600;
}

.error-msg {
  color: var(--danger);
  font-weight: 600;
}

/* ── Skeleton loading ── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
  color: transparent !important;
}
.skeleton-line { height: 14px; border-radius: 6px; margin-bottom: 8px; }
.skeleton-line.wide { width: 80%; }
.skeleton-line.narrow { width: 45%; }

/* ── Glass panel variant ── */
.panel-glass {
  background: rgba(19,19,26,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 20px;
}

/* ── Goal flash modal ── */
.goal-flash-modal {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  z-index: 200;
  background: rgba(19,19,26,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  padding: 18px 28px;
  text-align: center;
  min-width: 280px;
  max-width: 92vw;
  box-shadow: 0 8px 40px rgba(212,166,79,0.25);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
.goal-flash-modal.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@keyframes goalPulse {
  0%,100% { box-shadow: 0 8px 40px rgba(212,166,79,0.25); }
  50% { box-shadow: 0 8px 60px rgba(212,166,79,0.55); }
}
.goal-flash-modal.show { animation: goalPulse 1.2s ease-in-out 3; }

/* ── Nearby fans panel ── */
.nearby-fan-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}
.nearby-fan-chip .team-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

/* ── Fluid typography ── */
h1 { font-size: clamp(28px, 5vw, 38px); }
h2 { font-size: clamp(22px, 4vw, 28px); }

/* ── Competition filter select ── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.filter-bar select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}
.filter-bar select:focus { outline: none; border-color: var(--gold-border); }
