:root {
  --bg: #070a11;
  --bg-soft: #0b101b;
  --panel: rgba(15, 21, 34, 0.82);
  --panel-strong: #101728;
  --line: rgba(177, 194, 228, 0.12);
  --line-strong: rgba(177, 194, 228, 0.2);
  --text: #edf1fa;
  --muted: #8b96ad;
  --muted-strong: #b3bdd0;
  --gold: #e4bd67;
  --gold-soft: rgba(228, 189, 103, 0.14);
  --cyan: #74e4d3;
  --cyan-soft: rgba(116, 228, 211, 0.12);
  --violet: #a294ff;
  --red: #ff7188;
  --green: #7be0a7;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::selection { color: #081019; background: var(--gold); }

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* El atributo hidden debe ganarle a los `display` de .loading/.empty-state/etc. */
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ */
/* Header                                                             */
/* ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 32px;
  background: rgba(7, 10, 17, 0.76);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 32px; right: 32px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  letter-spacing: -0.04em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #10131b;
  border-radius: 10px;
  background: linear-gradient(135deg, #f4d98d, #c9963f);
  box-shadow: 0 0 28px rgba(228, 189, 103, 0.2);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-word { font-family: var(--display); font-size: 21px; font-weight: 700; }
.brand-word span { color: var(--gold); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 14px;
  font-size: 13px;
  color: var(--muted);
}
.main-nav a { transition: color 180ms ease; }
.main-nav a:hover, .main-nav a.is-active { color: var(--text); }
.main-nav a.is-active { position: relative; }
.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -9px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(18, 25, 40, 0.62);
}
.control-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.select-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.select-shell select {
  appearance: none;
  min-width: 58px;
  max-width: 118px;
  padding: 2px 22px 2px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.select-shell select option { color: #111827; background: #f6f7fb; }
.server-flag { font-size: 15px; line-height: 1; filter: saturate(0.85); }
.chevron { width: 13px; height: 13px; color: var(--muted); pointer-events: none; }
.calendar-icon { width: 14px; height: 14px; color: var(--muted); }

.geo-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 210px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.geo-hint b { color: var(--gold); font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Cabecera de pagina / resumen                                        */
/* ------------------------------------------------------------------ */
.shell {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 42px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 0.85fr);
  align-items: end;
  gap: 44px;
  padding: 38px 0 24px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow-line { width: 22px; height: 1px; background: var(--gold); }
.slash { color: var(--muted); font-weight: 400; }

.lead {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.65;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
}
.stat { padding: 12px 15px; background: var(--bg-soft); }
.stat dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.stat dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat dd small {
  color: var(--muted);
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0;
}
/* Ventana y zona son texto, no cifras: bajan de tamano para no romper la fila. */
.stat--text dd strong { font-size: 12.5px; letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ */
/* Panels / board                                                      */
/* ------------------------------------------------------------------ */
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 354px;
  align-items: start;
  gap: 22px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.board-panel { min-width: 0; padding: 26px 28px 0; }
.panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.panel-eyebrow, .side-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.panel-eyebrow span { color: var(--muted-strong); }
.panel-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.panel-subtitle {
  max-width: 420px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.tab-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 11, 19, 0.5);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: #0d1119;
  background: var(--gold);
  box-shadow: 0 5px 18px rgba(228, 189, 103, 0.16);
}
.tab-icon { font-size: 12px; }

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.window-label { color: var(--muted-strong); }
.data-label { letter-spacing: 0.04em; }

.loading, .empty-state, .error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 310px;
  color: var(--muted);
  font-size: 12px;
}
.loading-ring {
  width: 15px; height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state, .error-state { flex-direction: column; text-align: center; }
.empty-icon { font-size: 42px; line-height: 1; color: var(--gold); opacity: 0.65; }
.empty-state h3 { margin: 4px 0 0; font-family: var(--display); font-size: 17px; }
.empty-state p { max-width: 340px; margin: 3px 0 0; font-size: 12px; }
.error-state { gap: 8px; }
.error-state strong { color: var(--text); font-size: 13px; }
.error-state span { font-size: 12px; }
.button-ghost {
  margin-top: 7px;
  padding: 7px 12px;
  color: var(--gold);
  border: 1px solid rgba(228, 189, 103, 0.3);
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
}
.button-ghost:hover { background: var(--gold-soft); }

/* ------------------------------------------------------------------ */
/* Leaderboard table                                                   */
/* ------------------------------------------------------------------ */
.table-scroll { overflow-x: auto; margin: 0 -4px; scrollbar-width: thin; }
.leaderboard-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}
.leaderboard-table th {
  padding: 11px 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}
.leaderboard-table th:first-child { width: 44px; text-align: center; }
.leaderboard-table th:nth-child(2) { text-align: left; width: 32%; }
.leaderboard-table td {
  padding: 12px 10px;
  border-top: 1px solid rgba(177, 194, 228, 0.075);
  color: var(--muted-strong);
  font-size: 12px;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
.leaderboard-table td:first-child { text-align: center; }
.leaderboard-table td:nth-child(2) { text-align: left; }
.leaderboard-table tbody tr {
  cursor: pointer;
  transition: background 160ms ease;
}
.leaderboard-table tbody tr:hover { background: rgba(228, 189, 103, 0.045); }
.leaderboard-table tbody tr:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: -1px;
}
.leaderboard-table tbody tr:first-child td { border-top-color: transparent; }
.leaderboard-table tbody tr.top-row {
  background: linear-gradient(90deg, rgba(228, 189, 103, 0.075), transparent 72%);
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 23px; height: 23px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 7px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 650;
}
.rank-badge--1 { color: #14121a; background: linear-gradient(135deg, #f6dc95, #c9953f); box-shadow: 0 0 18px rgba(228, 189, 103, 0.2); }
.rank-badge--2 { color: #d9e0ea; background: rgba(200, 211, 226, 0.14); border-color: rgba(200, 211, 226, 0.2); }
.rank-badge--3 { color: #d9a27c; background: rgba(198, 116, 78, 0.16); border-color: rgba(198, 116, 78, 0.24); }
.rank-badge--rest { color: var(--muted); }

.player-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.player-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px; height: 30px;
  color: var(--gold);
  border: 1px solid rgba(228, 189, 103, 0.25);
  border-radius: 9px;
  background: rgba(228, 189, 103, 0.08);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 650;
}
.player-meta { min-width: 0; }
.player-link {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-link:hover { color: var(--gold); }
.player-tag {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  color: var(--gold);
  font-size: 10px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 160ms ease, max-width 220ms ease, transform 180ms ease, margin 180ms ease;
}
tr:hover .player-tag, tr:focus-within .player-tag, .player-link:focus-visible .player-tag {
  max-width: 120px;
  margin-left: 2px;
  opacity: 1;
  transform: translateX(0);
}
.player-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.02em;
}
.stat-main { color: var(--text); font-weight: 650; }
.stat-sub { color: var(--muted); font-size: 10px; }
.winrate-track {
  display: inline-block;
  width: 45px;
  height: 4px;
  margin-right: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  vertical-align: 1px;
}
.winrate-fill { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.winrate-fill--mid { background: var(--gold); }
.winrate-fill--low { background: var(--red); }
.kda-value { color: var(--cyan); font-family: var(--display); font-size: 14px; font-weight: 650; }
.kda-value--top { text-shadow: 0 0 18px rgba(116, 228, 211, 0.3); }
.kda-detail { color: var(--muted); font-size: 10px; }
.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0 16px;
  color: var(--muted);
  font-size: 9px;
}
.footer-pulse {
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.footer-hint { text-align: right; }

/* ------------------------------------------------------------------ */
/* Side column                                                         */
/* ------------------------------------------------------------------ */
.side-column { display: grid; gap: 18px; }
.search-panel, .formula-panel { padding: 20px; }
.search-panel h2, .formula-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.side-copy { margin: 8px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(5, 8, 14, 0.5);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search-input-wrap:focus-within {
  border-color: rgba(228, 189, 103, 0.5);
  box-shadow: 0 0 0 3px rgba(228, 189, 103, 0.06);
}
.search-input-wrap > svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--muted); }
.search-input-wrap input {
  min-width: 0;
  flex: 1;
  padding: 7px 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}
.search-input-wrap input::placeholder { color: #5e6a80; }
.search-button {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: #11151d;
  border: 0;
  border-radius: 7px;
  background: var(--gold);
  font-size: 10px;
  font-weight: 750;
}
.search-button:hover { background: #f0cf87; }
.hint { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.hint code, .formula-row code {
  padding: 1px 4px;
  color: var(--gold);
  border-radius: 4px;
  background: rgba(228, 189, 103, 0.09);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.95em;
}

.formula-panel { display: grid; gap: 14px; }
.formula-row { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.formula-row:first-of-type { padding-top: 5px; border-top: 0; }
.formula-row h3 { margin: 0 0 2px; font-size: 11px; font-weight: 700; }
.formula-row p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.formula-row strong { color: var(--muted-strong); font-weight: 600; }
.mini-note {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  padding: 9px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 10, 17, 0.4);
  font-size: 9px;
  line-height: 1.55;
}
.mini-note-dot {
  flex: 0 0 auto;
  width: 5px; height: 5px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--cyan);
}

/* ------------------------------------------------------------------ */
/* Info / footer                                                       */
/* ------------------------------------------------------------------ */
.info-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
}
.info-item {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(11, 16, 27, 0.8);
}
.info-number { color: var(--gold); font-family: var(--display); font-size: 10px; font-weight: 650; opacity: 0.75; }
.info-item strong { display: block; margin-bottom: 2px; font-size: 10px; font-weight: 650; }
.info-item p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-brand { display: flex; align-items: baseline; gap: 14px; }
.footer-brand .brand-word { font-size: 16px; color: var(--text); }
.footer-brand p { margin: 0; font-size: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 10px; }
.footer-links a:hover { color: var(--gold); }
.riot-policy {
  max-width: 760px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #6d778b;
  font-size: 9px;
  line-height: 1.65;
}
.footer-fine { margin: 8px 0 0; color: #596477; font-size: 9px; }

/* ------------------------------------------------------------------ */
/* Dialog / toast                                                      */
/* ------------------------------------------------------------------ */
.player-dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #0d1421;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.player-dialog::backdrop { background: rgba(3, 5, 9, 0.72); backdrop-filter: blur(5px); }
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { margin: 0; font-family: var(--display); font-size: 24px; letter-spacing: -0.04em; }
.dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.dialog-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px; height: 28px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}
.dialog-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
#dialogBody { padding: 18px 22px 22px; }
.dialog-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.dialog-stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}
.dialog-stat span { display: block; color: var(--muted); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.dialog-stat strong { display: block; margin-top: 3px; font-family: var(--display); font-size: 17px; }
.dialog-stat--kda strong { color: var(--cyan); }
.dialog-stat--win strong { color: var(--green); }
.dialog-matches { margin-top: 18px; }
.dialog-matches h3 { margin: 0 0 8px; color: var(--muted); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.match-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.match-row:first-of-type { border-top: 0; }
.match-result { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-strong); }
.match-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.match-dot--loss { background: var(--red); }
.match-champion { color: var(--muted); font-size: 10px; }
.match-kda { font-variant-numeric: tabular-nums; color: var(--muted-strong); }
.dialog-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 11px;
  color: var(--gold);
  border: 1px solid rgba(228, 189, 103, 0.25);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 650;
}
.dialog-profile:hover { background: var(--gold-soft); }
.dialog-empty { margin: 12px 0 0; color: var(--muted); font-size: 11px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  max-width: min(460px, calc(100vw - 32px));
  padding: 10px 14px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #121a29;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ */
/* Legal pages                                                         */
/* ------------------------------------------------------------------ */
.legal-shell { max-width: 860px; margin: 0 auto; padding: 58px 32px 80px; }
.legal-shell h1 { margin: 0; font-family: var(--display); font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.05em; }
.legal-shell .legal-lead { max-width: 650px; color: var(--muted-strong); font-size: 14px; line-height: 1.7; }
.legal-card { margin-top: 24px; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.legal-card h2 { margin: 22px 0 6px; font-family: var(--display); font-size: 17px; letter-spacing: -0.02em; }
.legal-card h2:first-child { margin-top: 0; }
.legal-card p, .legal-card li { color: var(--muted-strong); font-size: 12px; line-height: 1.75; }
.legal-card a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.legal-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 22px; color: var(--muted); font-size: 11px; }
.legal-back:hover { color: var(--gold); }
/* En las legales no hay selectores de servidor/día: la nav ocupa el extremo. */
.topbar--legal .main-nav { margin-left: auto; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1160px) {
  .topbar { gap: 18px; padding-left: 24px; padding-right: 24px; }
  .topbar::after { left: 24px; right: 24px; }
  .main-nav { gap: 16px; margin-left: 0; }
  .shell { padding-left: 24px; padding-right: 24px; }
  .page-head { gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(330px, 0.85fr); }
  .board-layout { grid-template-columns: minmax(0, 1fr) 318px; }
  .board-panel { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 960px) {
  .main-nav { display: none; }
  .page-head { grid-template-columns: 1fr; align-items: start; gap: 20px; padding-top: 30px; }
  .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .board-layout { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: 1fr 1fr; }
  .info-strip { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; padding-top: 13px; padding-bottom: 13px; }
  .topbar-actions { width: 100%; margin-left: 0; }
  .control { flex: 1; }
  .select-shell { flex: 1; }
  .select-shell select { width: 100%; max-width: none; }
  .geo-hint { display: none; }
  .shell { padding-left: 16px; padding-right: 16px; }
  .page-head { padding: 24px 0 18px; }
  .page-head h1 { font-size: clamp(26px, 8vw, 34px); }
  .lead { font-size: 13px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .board-panel { padding: 18px 16px 0; }
  .panel-top { flex-direction: column; gap: 14px; }
  .tab-switch { align-self: stretch; }
  .tab { flex: 1; justify-content: center; }
  .board-toolbar { align-items: flex-start; flex-direction: column; gap: 3px; }
  .side-column { grid-template-columns: 1fr; }
  .board-footer { align-items: flex-start; flex-direction: column; gap: 6px; }
  .footer-hint { text-align: left; }
  .info-item { padding: 13px 14px; }
  .site-footer { padding: 24px 16px 28px; }
  .footer-brand { display: block; }
  .footer-brand p { margin-top: 5px; }
  .legal-shell { padding: 38px 16px 60px; }
  .legal-card { padding: 20px; }
  .dialog-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .brand-word { font-size: 19px; }
  .control { padding-left: 8px; }
  .control-label { display: none; }
  .stat-strip { gap: 1px; }
  .stat { padding: 10px 12px; }
  .stat dd { font-size: 17px; }
  .stat--text dd strong { font-size: 11.5px; }
  .panel-subtitle { font-size: 11px; }
  .leaderboard-table { min-width: 570px; }
  .player-tag { max-width: 0 !important; }
  .board-footer { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
