/* ── Sapience Brand Fonts ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap');

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

:root {
  /* Sapience brand */
  --accent:    #2563EB;      /* primary brand */
  --accent-2:  #1e4fbf;      /* darker shade for gradients */
  --secondary: #EC4E20;      /* secondary brand */

  /* Surfaces — light enterprise theme */
  --bg:      #f5f7fb;        /* page background */
  --surface: #ffffff;        /* main panels */
  --card:    #ffffff;        /* card panels */
  --card-2:  #f8fafc;        /* subtle alt fill (table headers, hovers) */
  --border:  #e2e8f0;        /* light gray border */
  --text:    #1e293b;        /* primary text */
  --muted:   #64748b;        /* secondary text */

  /* Status / podium */
  --gold:    #d4a017;
  --silver:  #94a3b8;
  --bronze:  #b45309;
  --green:   #16a34a;
  --red:     #dc2626;

  /* Levels */
  --elite:   #d4a017;
  --pro:     #2563EB;
  --rookie:  #0891b2;

  --radius:  12px;
  --shadow:  0 1px 3px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);

  /* Brand fonts */
  --font-heading: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Calibri', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--font-heading); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, background .15s, transform .1s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .88; }

.btn-ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(37,99,235,.05); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .85; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  font-size: .9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-edit   { background: rgba(37,99,235,.15); color: var(--accent); border: 1px solid rgba(37,99,235,.3); }
.btn-edit:hover   { background: rgba(37,99,235,.28); }
.btn-delete { background: rgba(220,38,38,.12);  color: var(--red);    border: 1px solid rgba(220,38,38,.3); }
.btn-delete:hover { background: rgba(220,38,38,.25); }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.site-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 60%, var(--secondary) 100%);
}
.header-inner {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.1rem;
}
.site-logo {
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
}
.header-title-block {
  display: flex;
  flex-direction: column;
  padding-left: 1.1rem;
  border-left: 1px solid var(--border);
}

.event-badge {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  padding: .18em .65em;
  border-radius: 4px;
  margin-bottom: .5rem;
  width: fit-content;
  animation: blink 2s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(236,78,32,.35);
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.5} }

.site-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.event-subtitle { color: var(--muted); font-size: .88rem; margin-top: .25rem; }

.header-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.header-nav {
  display: flex;
  gap: .5rem;
  margin-right: .25rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--border);
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .15s, background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.nav-link:visited { color: var(--muted); }
.nav-link:hover   { border-color: var(--accent); color: var(--accent); background: rgba(37,99,235,.05); }
.nav-link:active  { transform: scale(.97); }
.nav-link.active,
.nav-link.active:visited {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.nav-link.active:hover { color: #fff; opacity: .92; background: var(--accent); }

.admin-badge {
  background: rgba(22,163,74,.15);
  color: var(--green);
  border: 1px solid rgba(22,163,74,.35);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25em .7em;
  border-radius: 20px;
}

/* ── Layout ───────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1rem 4rem; }

/* ── Page Layout (leaderboard + sidebar) ─────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}
.leaderboard-col { min-width: 0; }

/* ── Points Rules Sidebar ─────────────────────────────── */
.rules-sidebar { position: sticky; top: 1.5rem; }

.rules-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.06);
  overflow: hidden;
}

.rules-header {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1.15rem 1.25rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  position: relative;
  overflow: hidden;
}
.rules-header::after {
  content: '⭐';
  position: absolute;
  right: -6px; top: -10px;
  font-size: 4.5rem;
  opacity: .08;
  line-height: 1;
  pointer-events: none;
}
.rules-icon { font-size: 1.3rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.rules-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
  margin: 0;
}

.rules-list {
  list-style: none;
  padding: .9rem .9rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .7rem .85rem;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-left-width: 3px;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
}
.rule-item:hover {
  transform: translateX(3px);
  box-shadow: 0 3px 12px rgba(15,23,42,.1);
}
.rule-participate { border-left-color: var(--accent); }
.rule-win         { border-left-color: var(--gold); }
.rule-impromtu    { border-left-color: var(--secondary); }

.rule-points {
  font-family: var(--font-heading);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .05rem;
  min-width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
}
.rule-points .star-emoji { font-size: .9rem; line-height: 1; }
.rule-points .star-num   { font-size: 1.15rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }

.rule-item.rule-participate .rule-points { background: rgba(37,99,235,.1);  color: var(--accent);    border: 1px solid rgba(37,99,235,.2);  }
.rule-item.rule-win         .rule-points { background: rgba(212,160,23,.13); color: #a07808;          border: 1px solid rgba(212,160,23,.3); }
.rule-item.rule-impromtu    .rule-points { background: rgba(236,78,32,.1);   color: var(--secondary); border: 1px solid rgba(236,78,32,.25); }

.rule-title { font-size: .87rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.rule-desc  { font-size: .74rem; color: var(--muted); margin-top: .18rem; line-height: 1.45; }

.rules-divider {
  height: 1px;
  background: var(--border);
  margin: .1rem .9rem;
}

.rules-reward {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .95rem 1rem;
  margin: .6rem .9rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212,160,23,.1) 0%, rgba(236,78,32,.08) 100%);
  border: 1px solid rgba(212,160,23,.3);
  border-left: 3px solid var(--gold);
}
.reward-icon { font-size: 1.75rem; line-height: 1; flex-shrink: 0; }
.reward-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.reward-desc  { font-size: .74rem; color: var(--muted); margin-top: .2rem; line-height: 1.5; }

.rules-footer-note {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .6rem 1.1rem .9rem;
  font-size: .73rem;
  color: var(--muted);
  line-height: 1.5;
  background: var(--card-2);
  border-top: 1px solid var(--border);
}
.rules-note-icon { flex-shrink: 0; font-size: .82rem; margin-top: .1rem; }

/* ── Stats Strip ──────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
}
.stat-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ── Podium ───────────────────────────────────────────── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 2.5rem;
  min-height: 220px;
}
.podium-slot {
  flex: 1;
  max-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem .75rem 0;
  transition: transform .2s;
}
.podium-slot:hover { transform: translateY(-4px); }
.podium-slot.first  { border-top: 3px solid var(--gold);   }
.podium-slot.second { border-top: 3px solid var(--silver); }
.podium-slot.third  { border-top: 3px solid var(--bronze); }

.crown { font-size: 1.4rem; margin-bottom: .25rem; line-height: 1; }

.p-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  margin-bottom: .6rem; flex-shrink: 0;
}
.first  .p-avatar { background: rgba(212,160,23,.18);  color: var(--gold);   border: 2px solid var(--gold);   }
.second .p-avatar { background: rgba(148,163,184,.15); color: var(--silver); border: 2px solid var(--silver); }
.third  .p-avatar { background: rgba(180,83,9,.15);  color: var(--bronze); border: 2px solid var(--bronze); }

.podium-name  { font-weight: 700; font-size: .95rem; text-align: center; }
.podium-level { margin-top: .3rem; }
.podium-score { font-size: 1.35rem; font-weight: 800; margin: .5rem 0 .4rem; letter-spacing: -.02em; }
.first  .podium-score { color: var(--gold);   }
.second .podium-score { color: var(--silver); }
.third  .podium-score { color: var(--bronze); }
.podium-base {
  width: 100%;
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center;
  font-weight: 800;
  font-size: 1.5rem;
  padding: .45rem 0;
  margin-top: auto;
}
.first  .podium-base { background: rgba(212,160,23,.1);   color: var(--gold);   }
.second .podium-base { background: rgba(148,163,184,.08); color: var(--silver); }
.third  .podium-base { background: rgba(180,83,9,.08);  color: var(--bronze); }

/* ── Level Badge ──────────────────────────────────────── */
.level-badge {
  display: inline-block;
  padding: .18em .65em;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.level-elite  { background: rgba(212,160,23,.15);  color: var(--elite);  border: 1px solid rgba(212,160,23,.35);  }
.level-pro    { background: rgba(37,99,235,.15);  color: var(--pro);    border: 1px solid rgba(37,99,235,.35);  }
.level-rookie { background: rgba(8,145,178,.13);  color: var(--rookie); border: 1px solid rgba(8,145,178,.3);   }

/* ── Controls ─────────────────────────────────────────── */
.controls {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.controls input,
.controls select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  padding: .55rem .9rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.controls input:focus,
.controls select:focus { box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.controls input { flex: 1; min-width: 160px; }
.controls select { min-width: 150px; }
.controls input:focus,
.controls select:focus { border-color: var(--accent); }
.controls select option { background: var(--card); }

/* ── Table ────────────────────────────────────────────── */
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: var(--shadow);
  /* keep rounded corners without clipping cell content */
  isolation: isolate;
}
.leaderboard-table { border-radius: var(--radius); overflow: visible; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.leaderboard-table thead tr { background: var(--card-2); border-bottom: 1px solid var(--border); }
.leaderboard-table th {
  padding: .85rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.leaderboard-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.leaderboard-table tbody tr:last-child td { border-bottom: none; }
.leaderboard-table tbody tr { transition: background .15s; }
.leaderboard-table tbody tr:hover { background: var(--card-2); }

.rank-cell { display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .95rem; }
.rank-medal { font-size: 1.1rem; line-height: 1; }

.participant-cell { display: flex; align-items: center; gap: .75rem; }
.row-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
  color: var(--accent);
  border: 1px solid rgba(37,99,235,.4);
}
.participant-name { font-weight: 600; }

.score-wrap { display: flex; flex-direction: column; gap: .3rem; min-width: 100px; }
.score-val  { font-weight: 700; font-size: .95rem; }
.score-bar  { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.score-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width .6s ease; }

.change-cell { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.change-up   { color: var(--green); }
.change-down { color: var(--red);   }
.change-same { color: var(--muted); }

.actions-cell { display: flex; gap: .4rem; align-items: center; justify-content: flex-start; }
.col-actions  { width: 100px; vertical-align: middle; white-space: nowrap; padding-right: 1rem !important; }

.no-results { text-align: center; padding: 2.5rem; color: var(--muted); }
.hidden { display: none !important; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
}

/* ── Games Page ───────────────────────────────────────── */
.games-date-strip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}
.games-date-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-right: .5rem;
}
.games-date-value { font-size: 1.05rem; font-weight: 700; }
.games-actions    { display: flex; gap: .5rem; flex-wrap: wrap; }

.games-list { display: flex; flex-direction: column; gap: 1.25rem; }

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
/* ── Today / Past badges ──────────────────────────────── */
.live-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(22,163,74,.12); color: var(--green);
  border: 1px solid rgba(22,163,74,.3);
  padding: .2em .65em; border-radius: 20px; flex-shrink: 0;
}
.past-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(100,116,139,.1); color: var(--muted);
  border: 1px solid rgba(100,116,139,.25);
  padding: .2em .65em; border-radius: 20px; flex-shrink: 0;
}

/* ── Declare Winner button ────────────────────────────── */
.game-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: .85rem;
  margin-top: .5rem;
  border-top: 1px solid var(--border);
}
.btn-sm {
  padding: .4rem .9rem;
  font-size: .8rem;
}
.btn-win {
  background: linear-gradient(135deg, var(--gold) 0%, #e8a800 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212,160,23,.3);
}
.btn-win:hover { opacity: .88; }

/* ── Winner modal game label ──────────────────────────── */
.winner-game-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--accent);
  padding: .5rem .85rem;
  background: rgba(37,99,235,.06);
  border: 1px solid rgba(37,99,235,.15);
  border-radius: 8px;
}

/* ── History Section ──────────────────────────────────── */
.history-section {
  margin-top: 2rem;
  border-top: 2px solid var(--border);
  padding-top: 1.5rem;
}
.history-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.history-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.history-count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: .18em .7em;
  border-radius: 20px;
}

.history-list { display: flex; flex-direction: column; gap: 1.25rem; }

.history-group {}
.history-date-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .6rem;
  padding-left: .1rem;
}
.history-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
  transition: transform .15s, box-shadow .15s;
}
.history-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(15,23,42,.1); }

.history-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .6rem;
}
.history-game-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.history-winner-type {
  display: inline-block;
  margin-top: .25rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .15em .6em;
  border-radius: 20px;
}
.type-individual { background: rgba(37,99,235,.1); color: var(--accent); border: 1px solid rgba(37,99,235,.2); }
.type-team       { background: rgba(212,160,23,.12); color: #a07808; border: 1px solid rgba(212,160,23,.3); }

.history-winner-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
}
.history-members {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.member-chip {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  padding: .18em .6em;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.game-card-header {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}
.game-number {
  background: rgba(37,99,235,.15);
  color: var(--accent);
  border: 1px solid rgba(37,99,235,.35);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25em .7em;
  border-radius: 20px;
  flex-shrink: 0;
}
.game-title  { font-size: 1.2rem; font-weight: 700; flex: 1; }
.game-card-actions { display: flex; gap: .35rem; }

.game-section { margin-bottom: 1rem; }
.game-section:last-child { margin-bottom: 0; }
.game-section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.game-section p { font-size: .92rem; line-height: 1.55; }
.game-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-left: 0;
}
.game-list li {
  position: relative;
  padding-left: 1.2rem;
  font-size: .92rem;
  line-height: 1.55;
}
.game-list li::before {
  content: '';
  position: absolute;
  left: .25rem;
  top: .65em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.game-winning {
  background: rgba(37,99,235,.07);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-top: 1rem;
}
.game-winning p { font-weight: 600; color: var(--text); }

.modal-lg { max-width: 600px; }
.muted-hint { color: var(--muted); font-weight: 400; font-size: .75rem; }
.form-group textarea {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  padding: .6rem .85rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .15s;
  width: 100%;
  resize: vertical;
  min-height: 80px;
}
.form-group textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* ── Modals ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(3px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: slideUp .18s ease;
}
.modal-sm { max-width: 360px; }
@keyframes slideUp { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: 4px;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
}

.form-group { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.form-row   { display: flex; gap: .75rem; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.required { color: var(--red); }

.form-group input,
.form-group select {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .92rem;
  padding: .6rem .85rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .15s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-group select option { background: var(--surface); }

.form-error {
  font-size: .82rem;
  color: var(--red);
  background: rgba(220,38,38,.1);
  border: 1px solid rgba(220,38,38,.25);
  border-radius: 6px;
  padding: .5rem .75rem;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
  .page-layout { grid-template-columns: 1fr; }
  .rules-sidebar { position: static; }
}

@media (max-width: 700px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .leaderboard-table th,
  .leaderboard-table td { padding: .7rem .6rem; }
  .controls { flex-direction: column; }
  .controls input, .controls select, .controls .btn { width: 100%; justify-content: center; }
  .podium { gap: .4rem; }
  .podium-slot { padding: .9rem .5rem 0; }
  .podium-name { font-size: .82rem; }
  .podium-score { font-size: 1.1rem; }
  .score-bar { display: none; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .header-right { align-self: stretch; justify-content: flex-start; }
  .header-nav   { order: -1; width: 100%; margin-right: 0; }
  .nav-link     { flex: 1; justify-content: center; text-align: center; }
  .games-date-strip { flex-direction: column; align-items: flex-start; }
  .site-logo    { height: 32px; }
  .header-title-block { padding-left: .75rem; }
}
@media (max-width: 460px) {
  .col-level { display: none; }
  .form-row  { flex-direction: column; }
}
