:root {
  --navy: #0b1d33;
  --navy-2: #14304f;
  --accent: #2fd480;
  --accent-dark: #1fae66;
  --ink: #1a2433;
  --muted: #64748b;
  --line: #e4e9f0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --danger: #e0453f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* --- Top nav --- */
header.topnav {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topnav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: 0.2px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
nav.links { display: flex; gap: 4px; }
nav.links a {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
}
nav.links a.active { background: rgba(255,255,255,0.12); color: #fff; }
nav.links a:hover { color: #fff; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
}
.icon-btn:hover { background: rgba(255,255,255,0.2); }

/* mobile nav */
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }
@media (max-width: 640px) {
  nav.links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--navy-2); flex-direction: column; padding: 8px; gap: 2px; box-shadow: var(--shadow); }
  nav.links.open { display: flex; }
  .hamburger { display: block; }
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

h1.page-title { font-size: 22px; margin: 4px 0 20px; }
h2.section-title { font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 28px 0 12px; font-weight: 600; }

/* --- Cards --- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-list { display: flex; flex-direction: column; gap: 12px; }

.stat-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-tile { flex: 1; min-width: 90px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-align: center; }
.stat-tile .num { font-size: 22px; font-weight: 700; white-space: nowrap; }
/* Record (W-L-D) gets its own full-width row on phones so it never wraps. */
@media (max-width: 640px) { .stat-tile.record { flex: 1 1 100%; } .stat-tile.record .num { font-size: 28px; } }
.stat-tile .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* --- Game row / card --- */
.game-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.game-row:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(16,24,40,0.1); }
.game-row .date-badge {
  width: 52px; text-align: center; flex-shrink: 0;
  background: var(--bg); border-radius: 10px; padding: 6px 0;
}
.date-badge .mon { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.date-badge .day { font-size: 18px; font-weight: 700; }
.game-row .details { flex: 1; min-width: 0; }
.game-row .opponent { font-weight: 600; font-size: 15px; }
.game-row .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.game-row .result {
  font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 20px; flex-shrink: 0;
}
.result.win { background: #e6f9ef; color: var(--accent-dark); }
.result.loss { background: #fdeceb; color: var(--danger); }
.result.draw { background: #eef1f5; color: var(--muted); }
.goal-icons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.goal-chip { font-size: 12px; background: var(--bg); border-radius: 20px; padding: 3px 9px; display: inline-flex; align-items: center; gap: 4px; }

/* --- Roster --- */
.player-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: pointer;
}
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--bg); flex-shrink: 0; }
.avatar.lg { width: 96px; height: 96px; }
.player-row .name { font-weight: 600; }
.player-row .jersey { color: var(--muted); font-size: 13px; }

/* --- Buttons / forms --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: none; font-weight: 600; font-size: 14.5px;
  cursor: pointer; transition: opacity .12s;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--accent); color: #04351d; }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; }

input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--line);
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }

.form-card { max-width: 380px; margin: 60px auto; }
.form-card .logo { text-align: center; font-weight: 800; font-size: 20px; margin-bottom: 4px; }
.form-card .tagline { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.error-box { background: #fdeceb; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-top: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* --- Video player --- */
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.player-wrap video { width: 100%; display: block; }

/* --- Misc --- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; font-weight: 600; }
.section-actions { display: flex; gap: 10px; margin-top: 18px; }

/* --- Team switcher (only when the account has 2+ teams) --- */
.teambar { display: flex; align-items: center; gap: 10px; margin: 0 -20px; padding: 8px 20px; background: rgba(255,255,255,.06); border-top: 1px solid rgba(255,255,255,.08); }
.teambar label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.6); margin: 0; }
.teambar select { flex: 1; min-width: 0; max-width: 340px; margin: 0; padding: 6px 10px; font-size: 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; }
.teambar select option { color: #111; }

/* --- Account menu (top right) --- */
.account { position: relative; }
.account-btn { font-weight: 700; letter-spacing: .02em; }
.account-menu {
  position: absolute; right: 0; top: 44px; z-index: 30;
  width: 240px; max-width: calc(100vw - 32px);
  background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
}
.account-head { padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.account-name { font-weight: 700; font-size: 15px; word-break: break-word; }
.account-email { font-size: 13px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.account-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #04351d; font-size: 11px; font-weight: 700; vertical-align: middle; }
.account-menu a, .account-menu button {
  display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--bg); }
.account-menu .danger { color: var(--danger); margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
