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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #232638;
  --border: #2e3149;
  --accent: #4f8ef7;
  --accent2: #7c5cfc;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --text: #e2e8f0;
  --muted: #8892a4;
  --radius: 10px;
}

html { font-size: 15px; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.header-logo {
  height: 88px;
  width: auto;
  border-radius: 6px;
  display: block;
}
.header-meta { font-size: .78rem; color: var(--muted); }
.header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.lang-toggle { display: flex; gap: .2rem; }
.lang-btn {
  background: var(--surface2);
  border: 1px solid var(--border) !important;
  border-radius: 4px;
  color: var(--muted);
  padding: .2rem .55rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: all .15s;
}
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent) !important;
  color: #fff;
}
.lang-btn:hover:not(.active) { border-color: var(--accent) !important; color: var(--accent); }

/* ── Controls ───────────────────────────────────────────────── */
.controls {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  position: sticky;
  top: 56px;
  z-index: 99;
}
.search-row {
  max-width: 1400px;
  margin: 0 auto .6rem;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
input[type="text"], select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: .45rem .8rem;
  font-size: .88rem;
  outline: none;
  transition: border-color .15s;
}
input[type="text"] { flex: 1; min-width: 200px; }
input[type="text"]:focus, select:focus { border-color: var(--accent); }
select option { background: var(--surface2); }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: .45rem .95rem;
  font-size: .88rem;
  font-weight: 600;
  transition: opacity .15s, transform .1s;
}
button:active { transform: scale(.97); }
#btn-refresh {
  background: var(--accent2);
  color: #fff;
  white-space: nowrap;
}
#btn-refresh:hover { opacity: .88; }

/* ── Filters panel (collapsible) ────────────────────────────── */
.filters-panel {
  overflow: hidden;
  max-height: 500px;
  transition: max-height .3s ease, opacity .3s ease;
  opacity: 1;
}
.filters-panel.collapsed {
  max-height: 0;
  opacity: 0;
}
#btn-toggle-filters {
  background: var(--surface2);
  border: 1px solid var(--border) !important;
  color: var(--muted);
  font-size: .82rem;
  padding: .45rem .8rem;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
#btn-toggle-filters:hover { border-color: var(--accent) !important; color: var(--accent); }
#btn-toggle-filters.collapsed-state { color: var(--accent); border-color: var(--accent) !important; }

/* ── Sport tabs ─────────────────────────────────────────────── */
.sport-tabs {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.sport-tab {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: .25rem .8rem;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.sport-tab.active, .sport-tab:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── League filter ──────────────────────────────────────────── */
.league-filter {
  max-width: 1400px;
  margin: .4rem auto 0;
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
}
.league-filter-label {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: .2rem;
}
.league-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: .2rem .7rem;
  font-size: .76rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.league-chip.active {
  background: #2a4a2a;
  border-color: #4caf50;
  color: #8bc34a;
}
.league-chip:hover:not(.active) {
  border-color: var(--muted);
  color: var(--text);
}
.league-chip.all-chip.active {
  background: var(--surface);
  border-color: var(--muted);
  color: var(--text);
}

/* ── Summary bar ────────────────────────────────────────────── */
.summary-bar {
  max-width: 1400px;
  margin: 1rem auto .5rem;
  padding: 0 .5rem;
  font-size: .82rem;
  color: var(--muted);
}

/* ── Matches list ───────────────────────────────────────────── */
main { max-width: 1400px; margin: 0 auto; padding: 0 1rem 3rem; }

.matches-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

/* ── Match card ─────────────────────────────────────────────── */
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.match-header {
  display: flex;
  flex-direction: column;
  padding: .75rem 1rem;
  cursor: pointer;
  user-select: none;
}
.match-header:hover { background: var(--surface2); }

.match-header-top {
  display: flex;
  align-items: center;
  gap: .7rem;
}

/* ── Collapsed market preview strip ─────────────────────────── */
.match-preview {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .4rem;
  padding-top: .45rem;
  border-top: 1px solid var(--border);
  margin-top: .45rem;
}
.prev-mkt {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem .45rem;
}
.prev-name {
  font-size: .63rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  padding-right: .3rem;
  border-right: 1px solid var(--border);
  margin-right: .05rem;
}
.prev-outcomes {
  display: flex;
  gap: .2rem;
}
.prev-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .3rem;
  min-width: 34px;
}
.prev-lbl {
  font-size: .58rem;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
}
.prev-odds {
  font-size: .74rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1.3;
}

.match-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  font-size: .78rem;
  color: var(--muted);
  gap: .15rem;
}
.match-time .date { font-size: .72rem; }
.match-time .time { font-weight: 700; color: var(--accent); font-size: .92rem; }

.match-teams {
  flex: 1;
  min-width: 0;
}
.team-name { font-weight: 600; font-size: .97rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-sep { font-size: .72rem; color: var(--muted); margin: .1rem 0; }

.match-badges {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-live { background: #ef4444; color: #fff; }
.badge-count { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.match-chevron {
  color: var(--muted);
  font-size: .9rem;
  transition: transform .2s;
  flex-shrink: 0;
}
.match-card.open .match-chevron { transform: rotate(180deg); }

/* ── Markets section ─────────────────────────────────────────── */
.markets-section { display: none; border-top: 1px solid var(--border); }
.match-card.open .markets-section { display: block; }

/* ── Market groups ───────────────────────────────────────────── */
.market-group { border-bottom: 1px solid var(--border); }
.market-group:last-child { border-bottom: none; }

.market-group-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  cursor: pointer;
  user-select: none;
  background: color-mix(in srgb, var(--surface) 60%, var(--surface2) 40%);
  transition: background .15s;
}
.market-group-header:hover {
  background: color-mix(in srgb, var(--surface2) 80%, var(--accent) 20%);
}
.group-name {
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.group-count {
  font-size: .68rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .05rem .4rem;
  line-height: 1.4;
}
.group-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: .85rem;
  transition: transform .2s;
  display: inline-block;
}
.market-group.collapsed .group-chevron { transform: rotate(-90deg); }

.market-group-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .22s ease;
}
.market-group.collapsed .market-group-body { grid-template-rows: 0fr; }
.market-group-body > div { overflow: hidden; min-height: 0; }

.markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .55rem;
  padding: 0 .75rem .85rem;
}

.market-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .75rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.market-card:hover { border-color: var(--accent); background: var(--surface2); }

.market-name {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.3;
  min-height: 2em;
}
.market-spread {
  font-size: .7rem;
  color: var(--yellow);
  display: inline-block;
  margin-bottom: .25rem;
}

.outcomes-row {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.outcome-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .5rem;
  min-width: 44px;
  flex: 1;
  cursor: default;
}
.outcome-label {
  font-size: .65rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outcome-odds {
  font-weight: 700;
  font-size: .88rem;
  color: var(--green);
  margin-top: .1rem;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); cursor: pointer; }
.modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 680px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
}
.modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: var(--surface2);
  color: var(--muted);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--text); }
.modal-match-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .25rem; }
.modal-market-name { font-size: .9rem; color: var(--accent); font-weight: 600; margin-bottom: 1rem; }

.modal-outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .6rem;
}
.modal-outcome {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.modal-outcome-label { font-size: .8rem; color: var(--muted); }
.modal-outcome-odds { font-size: 1.15rem; font-weight: 800; color: var(--green); }

/* ── States ──────────────────────────────────────────────────── */
.loading {
  text-align: center;
  color: var(--muted);
  padding: 3rem;
  font-size: 1rem;
}
.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: .5rem;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg {
  text-align: center;
  color: var(--red);
  padding: 2rem;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius);
  margin-top: 1rem;
}
.hidden { display: none !important; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: .95rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .markets-grid { grid-template-columns: 1fr 1fr; }
  .modal-outcomes { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GROUP STAGE PREDICTIONS  –  groupstage.html / groupstage.js
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Header extras ───────────────────────────────────────────── */
.gs-header-sep  { color: var(--muted); margin: 0 .4rem; font-weight: 400; }
.gs-page-title  { font-size: 1rem; font-weight: 600; color: var(--text); }

.gs-user-pill {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .85rem;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.gs-user-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.gs-user-logo-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}
.gs-user-flag {
  display: inline-flex;
  align-items: center;
}
.gs-pill-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}
.gs-pill-profile-trigger:hover .gs-pill-name,
.gs-pill-profile-trigger:focus-visible .gs-pill-name {
  color: var(--accent);
}
.gs-pill-name  {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-pill-profile-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
.gs-pill-admin {
  font-size: .65rem;
  font-weight: 700;
  background: var(--accent2);
  color: #fff;
  border-radius: 4px;
  padding: .1rem .4rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Shared buttons ──────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: .45rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .88rem;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .4rem .9rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: .3rem .7rem;
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.btn-ghost:hover { color: var(--red); border-color: var(--red); }

/* ── Main controls bar ───────────────────────────────────────── */
.gs-controls {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.gs-main-tabs {
  display: flex;
  gap: .35rem;
}
.gs-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: .35rem .85rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.gs-tab.active, .gs-tab:hover {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}
.gs-tab.active { border-color: var(--accent); color: var(--accent); }

.gs-login-cta {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  color: var(--muted);
}

/* ── Group tabs ──────────────────────────────────────────────── */
.gs-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .75rem 1rem .35rem;
  max-width: 1200px;
  margin: 0 auto;
}
.gs-group-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: .25rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.gs-group-tab.active, .gs-group-tab:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Tab content wrapper ─────────────────────────────────────── */
.gs-tab-content { padding-bottom: 3rem; }

.gs-form-hint {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .35rem;
}

/* ── Match grid ──────────────────────────────────────────────── */
.gs-matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: .25rem 1rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}
.gs-matches-grid.cols-1 { grid-template-columns: repeat(1, minmax(280px, 480px)); }
.gs-matches-grid.cols-2 { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
.gs-matches-grid.cols-3 { grid-template-columns: repeat(3, minmax(280px, 1fr)); }
.gs-matches-grid.cols-4 { grid-template-columns: repeat(4, minmax(280px, 1fr)); }

/* ── Date section header (spans full grid width) ─────────────── */
.gs-date-header {
  grid-column: 1 / -1;
  padding: .9rem .1rem .35rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  margin-bottom: -.25rem;
}
.gs-date-header:first-child { padding-top: .1rem; }

/* ── Match card ──────────────────────────────────────────────── */
.gs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .2s;
}
.gs-card:hover { border-color: var(--accent); }
.gs-card-locked { border-color: var(--border); opacity: .95; }
.gs-card-locked:hover { border-color: var(--border); }

.gs-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem .45rem;
  gap: .5rem;
}
.gs-card-teams {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  flex-wrap: wrap;
}
.gs-team1, .gs-team2 {
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-vs {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 400;
}

.gs-status-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.gs-status-upcoming  { background: var(--surface2);            color: var(--muted); }
.gs-status-live      { background: var(--red);                 color: #fff; animation: gs-pulse 1.4s infinite; }
.gs-status-finished  { background: rgba(34,197,94,.12);        color: var(--green); }

@keyframes gs-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .65; }
}

.gs-admin-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: .2rem .45rem;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.gs-admin-btn:hover { border-color: var(--accent); color: var(--accent); }

.gs-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .7rem;
  padding: 0 1rem .55rem;
  font-size: .72rem;
  color: var(--muted);
}
.gs-meta-date { color: var(--accent); font-weight: 600; }

.gs-card-body { padding: .5rem 1rem .9rem; }

/* ── Guess form ──────────────────────────────────────────────── */
.gs-guess-form { display: flex; flex-direction: column; gap: .65rem; }
.gs-guess-section-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.gs-score-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.gs-team-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  flex: 1;
}
.gs-team-name-small {
  font-size: .72rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
.gs-score-input {
  width: 58px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: .4rem .3rem;
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
  -moz-appearance: textfield;
}
.gs-score-input::-webkit-inner-spin-button { display: none; }
.gs-score-input:focus { border-color: var(--accent); }
.gs-score-sep {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0 .1rem;
  margin-top: 1.2rem;
}

/* ── Bonus inputs ────────────────────────────────────────────── */
.gs-bonus-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.gs-bonus-label {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  font-size: .78rem;
  color: var(--text);
  line-height: 1.35;
}
.gs-bonus-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .65rem;
  padding: .05rem .3rem;
  color: var(--accent2);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: .05rem;
}
.gs-player-input-wrap { position: relative; }
.gs-player-input, .gs-minute-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: .4rem .7rem;
  font-size: .85rem;
  outline: none;
}
.gs-player-input:focus, .gs-minute-input:focus { border-color: var(--accent); }
.gs-minute-input { -moz-appearance: textfield; }
.gs-minute-input::-webkit-inner-spin-button { display: none; }

/* ── Player autocomplete dropdown ───────────────────────────── */
.gs-ac-dropdown {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #12151f;
  border: 1px solid #2a2a3e;
  border-radius: 7px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 28px rgba(0,0,0,.7);
  min-width: 280px;
}
.gs-ac-dropdown.ac-open { display: block; }
.gs-ac-opt {
  padding: .38rem .7rem;
  cursor: pointer;
  font-size: .82rem;
  color: #d0d0d0;
  border-bottom: 1px solid #1c1f2e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}
.gs-ac-opt:last-child { border-bottom: none; }
.gs-ac-opt.home { background: rgba(41,128,185,.10); }
.gs-ac-opt.home:hover, .gs-ac-opt.home.ac-focused { background: rgba(41,128,185,.28); }
.gs-ac-opt.away { background: rgba(39,174,96,.08); }
.gs-ac-opt.away:hover, .gs-ac-opt.away.ac-focused { background: rgba(39,174,96,.22); }
.gs-ac-meta {
  font-size: .72rem;
  color: #777;
  white-space: nowrap;
  flex-shrink: 0;
}
.gs-ac-sep {
  padding: .22rem .7rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #555;
  background: #0e1018;
  border-bottom: 1px solid #1c1f2e;
  pointer-events: none;
}

/* ── Save button ─────────────────────────────────────────────── */
.gs-save-btn {
  align-self: flex-end;
  min-width: 90px;
}
.gs-save-btn.gs-saved {
  background: var(--surface2);
  color: var(--green);
  border: 1px solid var(--green);
}

/* ── No-user message ─────────────────────────────────────────── */
.gs-no-user-msg {
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
  padding: .5rem 0;
  font-style: italic;
}

/* ── Locked view ─────────────────────────────────────────────── */
.gs-locked-grid { display: flex; flex-direction: column; gap: .3rem; }
.gs-locked-row {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  font-size: .83rem;
}
.gs-locked-key {
  color: var(--muted);
  min-width: 90px;
  font-size: .78rem;
}
.gs-locked-val { color: var(--text); }
.gs-bonus-mini { font-size: .72rem; }
.gs-correct    { color: var(--green); font-weight: 700; }
.gs-answer-hint { font-size: .75rem; color: var(--muted); margin-left: .35rem; }

/* ── Outcome icons ───────────────────────────────────────────── */
.gs-icon         { display: inline-block; font-weight: 800; margin-left: .35rem; font-size: .9rem; vertical-align: middle; }
.gs-icon-correct { color: var(--green); }
.gs-icon-partial { color: var(--yellow); }
.gs-icon-wrong   { color: var(--red); }

/* ── Points badge ────────────────────────────────────────────── */
.gs-pts-badge {
  display: inline-block;
  margin-top: .55rem;
  font-size: .78rem;
  font-weight: 700;
  padding: .22rem .6rem;
  border-radius: 6px;
}
.gs-pts-red    { background: rgba(239,68,68,.14);  color: var(--red);    border: 1px solid rgba(239,68,68,.35); }
.gs-pts-yellow { background: rgba(245,158,11,.18); color: var(--yellow); border: 1px solid rgba(245,158,11,.35); }
.gs-pts-green  { background: rgba(34,197,94,.12);  color: var(--green);  border: 1px solid rgba(34,197,94,.25); }

/* ── Auth modal ──────────────────────────────────────────────── */
.gs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gs-modal-backdrop.hidden { display: none; }
.gs-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: min(420px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.gs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.gs-modal-header h3 { font-size: 1rem; font-weight: 700; }
.gs-modal-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gs-modal-close:hover { color: var(--text); }

.gs-modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.gs-modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: .55rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.gs-modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.gs-modal-tab:hover:not(.active) { color: var(--text); }

.gs-auth-form {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.gs-auth-form label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .83rem;
  color: var(--muted);
}
.gs-auth-form input[type="text"],
.gs-auth-form input[type="password"],
.gs-auth-form input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: .45rem .8rem;
  font-size: .9rem;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
.gs-auth-form input:focus { border-color: var(--accent); }

.gs-form-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: var(--red);
  border-radius: 6px;
  padding: .45rem .7rem;
  font-size: .82rem;
}

/* ── Admin panel ─────────────────────────────────────────────── */
.gs-admin-match-title {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .75rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border);
}
.gs-admin-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

/* ── Admin score row (reuse gs-score-row, but labels are spans not small) */
.gs-score-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  flex: 1;
  font-size: .82rem;
  color: var(--muted);
}
.gs-score-label input[type="number"] {
  width: 64px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: .45rem .3rem;
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
}
.gs-score-label input[type="number"]:focus { border-color: var(--accent); }

/* ── Leaderboard ─────────────────────────────────────────────── */
.gs-lb-wrap {
  max-width: 640px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}
.gs-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.gs-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.gs-lb-table th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--border);
}
.gs-lb-table td {
  padding: .6rem .6rem;
  border-bottom: 1px solid var(--border);
}
.gs-lb-table tr:last-child td { border-bottom: none; }
.gs-lb-rank { font-size: 1.1rem; min-width: 40px; }
.gs-lb-name { font-weight: 600; }
.gs-lb-user {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.gs-lb-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.gs-lb-logo-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.gs-lb-flag { display: inline-flex; align-items: center; }
.gs-flag-img {
  width: 18px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--surface2);
  object-fit: cover;
}
.gs-lb-pts  { text-align: right; font-weight: 700; color: var(--accent); font-size: 1rem; }
.gs-lb-me   { background: rgba(79,142,247,.07); }

/* ── Submitted guesses ───────────────────────────────────────── */
.gs-guess-list {
  max-width: 900px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.gs-guess-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}
.gs-guess-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .65rem;
}
.gs-guess-card-title {
  font-weight: 700;
  font-size: .95rem;
}
.gs-guess-result {
  font-size: .78rem;
  color: var(--muted);
}
.gs-guess-result strong { color: var(--green); }
.gs-guess-rows {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.gs-guess-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  font-size: .85rem;
}
.gs-guess-user {
  font-weight: 600;
  color: var(--text);
  min-width: 140px;
}
.gs-guess-name { display: block; }
.gs-guess-bonuses {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .4rem;
  margin-top: .2rem;
}
.gs-guess-bonus {
  font-size: .7rem;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .08rem .4rem;
}
.gs-guess-score {
  font-weight: 700;
  color: var(--accent);
}
.gs-guess-points {
  font-size: .78rem;
  font-weight: 700;
  padding: .12rem .5rem;
  border-radius: 6px;
}
.gs-guess-empty {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 1.5rem 0;
}

/* ── Toast ───────────────────────────────────────────────────── */
.gs-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .65rem 1.2rem;
  font-size: .88rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.gs-toast.gs-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.gs-toast.gs-toast-error {
  border-color: rgba(239,68,68,.5);
  color: var(--red);
}

/* ── Guest banner ────────────────────────────────────────────── */
.gs-guest-banner {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: .8rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  z-index: 900;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

/* ── Empty state ─────────────────────────────────────────────── */
.gs-empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  font-size: .9rem;
  grid-column: 1 / -1;
}

/* ── Responsive: group stage layout ─────────────────────────── */
@media (max-width: 980px) {
  .header-inner {
    height: auto;
    padding: .75rem 0;
    flex-wrap: wrap;
    gap: .75rem;
  }
  .logo {
    flex-wrap: wrap;
    gap: .4rem;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .gs-user-pill {
    max-width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  header { padding: 0 1rem; }
  .header-logo { height: 64px; }
  .gs-page-title { font-size: .95rem; }
  .gs-user-logo { width: 24px; height: 24px; }
  .gs-pill-name { max-width: 140px; }
  .gs-controls {
    padding: .6rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .gs-main-tabs {
    width: 100%;
    flex-wrap: wrap;
  }
  .gs-tab { flex: 1 1 auto; text-align: center; }
  .gs-login-cta {
    width: 100%;
    justify-content: space-between;
  }
  .gs-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .gs-card-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .gs-locked-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
  }
  .gs-guess-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .gs-guess-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .gs-lb-table { font-size: .85rem; }
}

@media (max-width: 520px) {
  .gs-pill-name { max-width: 110px; }
  .gs-user-pill button.btn-ghost,
  .gs-user-pill .btn-secondary {
    padding: .25rem .55rem;
    font-size: .75rem;
  }
  .gs-lb-user { gap: .35rem; }
  .gs-lb-logo { width: 20px; height: 20px; }
  .gs-flag-img { width: 16px; height: 12px; }
  .gs-guest-banner {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
    width: auto;
    justify-content: space-between;
  }
}

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 640px) {
  .gs-matches-grid,
  .gs-matches-grid.cols-1,
  .gs-matches-grid.cols-2,
  .gs-matches-grid.cols-3,
  .gs-matches-grid.cols-4 { grid-template-columns: 1fr; padding: .5rem; }
  .gs-group-tabs   { padding: .5rem .5rem .25rem; }
  .gs-controls     { padding: .45rem .75rem; }
  .gs-locked-key   { min-width: 70px; }
  .gs-admin-actions { flex-direction: column; }
  .gs-lb-wrap      { padding: 0 .5rem; }
}
