/* Shared look for the games hub. Each game sets --accent. */
:root {
  --bg: #0d1420;
  --bg-2: #131c2b;
  --panel: #18233a;
  --panel-2: #1f2c46;
  --line: #2a3a58;
  --text: #e6edf7;
  --muted: #8d9cb5;
  --accent: #f2b544;
  --accent-ink: #1a1306;
  --good: #3ecf8e;
  --bad: #ff5d5d;
  --radius: 12px;
  --tap: 48px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 800px at 80% -10%, #1a2742 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: .01em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(13, 20, 32, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; user-select: none;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted); text-transform: capitalize;
}

/* Segmented control */
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button {
  flex: 1; min-height: 44px; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; text-transform: capitalize; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}

/* Modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5, 9, 16, .72);
  animation: fade .15s ease;
}
.modal {
  width: min(460px, 100%); max-height: 90vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: pop .18s ease;
}
.modal h2 { font-size: 24px; margin-bottom: 8px; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal .actions .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 120;
  transform: translateX(-50%);
  padding: 10px 16px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4);
  animation: fade .2s ease;
}

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile .v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .s { font-size: 13px; color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
.win { color: var(--good); font-weight: 700; }
.loss { color: var(--bad); font-weight: 700; }
.abandoned { color: var(--muted); }
