/* ReidXtreme theme shared by the replay viewer, the local arena and the event website.
   Fonts ship in viewer/fonts (SIL Open Font License), so the starter kit works offline. */

@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("fonts/BarlowCondensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/BarlowCondensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/BarlowCondensed-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400 700; font-display: swap; src: url("fonts/Inter-400-700.woff2") format("woff2"); }

:root {
  /* brand palette */
  --mint: #8cf5bd;
  --emerald: #3fb57f;
  --body: #d6e4dc;
  --muted-brand: #a9c2b5;
  --night: #03080a;
  /* surfaces */
  --bg: #03080a;
  --panel: rgba(12, 24, 21, 0.78);
  --panel-solid: #0a1613;
  --panel-raised: rgba(20, 38, 32, 0.85);
  --border: rgba(140, 245, 189, 0.14);
  --border-strong: rgba(140, 245, 189, 0.38);
  --text: #d6e4dc;
  --muted: #a9c2b5;
  --accent: #8cf5bd;
  --accent-strong: #3fb57f;
  --board-bg: #040b0c;
  --code-bg: rgba(3, 8, 10, 0.75);
  --error-bg: rgba(255, 92, 92, 0.12);
  --error-text: #ffb3ad;
  --amber: #ffb454;
  --red: #ff6b6b;
  --ok: #8cf5bd;
  --bar: #4f6b5e;
  /* effects (from the Figma styles) */
  --text-glow: 0 0 14px rgba(110, 231, 168, 0.85), 0 0 44px rgba(62, 181, 127, 0.6);
  --soft-glow: 0 0 14px rgba(110, 231, 168, 0.5);
  --box-glow: 0 0 14px rgba(110, 231, 168, 0.35), 0 0 44px rgba(62, 181, 127, 0.18);
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

.rx, .rx * { box-sizing: border-box; }
body.rx {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(63, 181, 127, 0.16), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(140, 245, 189, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.rx a { color: var(--accent); text-decoration: none; }
.rx a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rx ::selection { background: rgba(140, 245, 189, 0.3); }
.rx :focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.rx h1, .rx h2, .rx h3, .rx .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #ecfff4;
}
.rx h1 { font-size: 40px; margin: 0 0 12px; text-transform: uppercase; }
.rx h2 { font-size: 22px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.rx h3 { font-size: 18px; margin: 18px 0 8px; }
.glow { color: var(--mint); text-shadow: var(--text-glow); }
.soft-glow { text-shadow: var(--soft-glow); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--emerald);
}

/* ------------------------------------------------------------------ top bar */

.rx-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 24px;
  background: rgba(3, 8, 10, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.rx-brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; }
.rx-brand img { height: 42px; width: auto; filter: drop-shadow(0 0 10px rgba(110, 231, 168, 0.45)); }
.rx-brand .rx-wordmark { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; color: #ecfff4; }
.rx-brand .rx-wordmark b { color: var(--mint); font-weight: 700; text-shadow: var(--soft-glow); }
.rx-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.rx-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
}
.rx-nav a:hover { color: var(--mint); text-decoration: none; background: rgba(140, 245, 189, 0.06); }
.rx-nav a[aria-current="page"] { color: var(--mint); text-shadow: var(--soft-glow); background: rgba(140, 245, 189, 0.08); }

/* ------------------------------------------------------------------ cards, chips, badges */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  min-width: 0;
  backdrop-filter: blur(6px);
}
.card > h2:first-child, .card > header h2 { margin-top: 0; }
.card.glow-card { border-color: var(--border-strong); box-shadow: var(--box-glow); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--mint); border-color: var(--border-strong); box-shadow: var(--soft-glow); }
.pill.warn { color: var(--amber); border-color: rgba(255, 180, 84, 0.4); }
.pill.off { color: var(--muted); }

.badge { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 8px; align-self: center; letter-spacing: 0.04em; text-transform: uppercase; }
.badge.ok { background: rgba(140, 245, 189, 0.12); color: var(--mint); }
.badge.err { background: rgba(255, 107, 107, 0.14); color: var(--red); }
.badge.wait { background: rgba(255, 180, 84, 0.14); color: var(--amber); }

/* ------------------------------------------------------------------ forms and buttons */

.rx label { color: var(--muted); font-size: 13px; }
.rx input, .rx select, .rx textarea {
  font: inherit;
  color: var(--text);
  background: rgba(3, 8, 10, 0.7);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rx input:focus, .rx select:focus, .rx textarea:focus { outline: none; border-color: var(--mint); box-shadow: var(--soft-glow); }
.rx input::placeholder, .rx textarea::placeholder { color: rgba(169, 194, 181, 0.5); }

.rx button, .rx .button {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(140, 245, 189, 0.05);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rx button:hover, .rx .button:hover { background: rgba(140, 245, 189, 0.12); color: var(--mint); text-decoration: none; }
.rx button.primary, .rx .button.primary {
  color: var(--night);
  background: linear-gradient(180deg, var(--mint), var(--emerald));
  border-color: transparent;
  box-shadow: var(--soft-glow);
}
.rx button.primary:hover, .rx .button.primary:hover { color: var(--night); box-shadow: var(--box-glow); filter: brightness(1.06); }
.rx button:disabled { opacity: 0.55; cursor: progress; }
.rx button.linkish {
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
}
.rx button.linkish:hover { text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
.rx button.danger:hover { color: var(--red); border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.08); }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 12px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  background: rgba(140, 245, 189, 0.03);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.drop strong { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.04em; color: #ecfff4; }
.drop:hover, .drop:focus-visible, .drop.hover, .drop.over {
  border-color: var(--mint);
  background: rgba(140, 245, 189, 0.07);
  box-shadow: var(--soft-glow);
  outline: none;
}
.drop .file-name, .drop .muted { font-size: 13px; }

.msg { margin-top: 10px; min-height: 1.2em; overflow-wrap: anywhere; }
.msg.error { color: var(--red); white-space: pre-wrap; }
.msg.ok { color: var(--mint); }

.log {
  margin: 10px 0 0;
  padding: 10px 12px;
  max-height: 280px;
  overflow: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 12.5px/1.45 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--body);
}

progress {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(140, 245, 189, 0.1);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: rgba(140, 245, 189, 0.1); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--emerald), var(--mint)); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--emerald), var(--mint)); }

/* ------------------------------------------------------------------ tables */

.rx table.table, .rx .summary table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.rx table.table th, .rx .summary th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
}
.rx table.table td, .rx .summary td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rx table.table tbody tr:hover td { background: rgba(140, 245, 189, 0.04); }
td.win, span.win, .rx tr.win td.outcome { color: var(--mint); font-weight: 600; }
td.loss, span.loss, .rx tr.loss td.outcome { color: var(--red); font-weight: 600; }
td.draw, span.draw, .rx tr.draw td.outcome { color: var(--muted); font-weight: 600; }

/* tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.rx .tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 8px 16px;
  color: var(--muted);
}
.rx .tabs button:hover { color: var(--text); background: none; }
.rx .tabs button[aria-selected="true"] { color: var(--mint); border-bottom-color: var(--mint); text-shadow: var(--soft-glow); }

/* scrollbars */
.rx ::-webkit-scrollbar { width: 10px; height: 10px; }
.rx ::-webkit-scrollbar-thumb { background: rgba(140, 245, 189, 0.18); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.rx ::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .rx * { transition: none !important; }
}
