/* ClashXP — shared design tokens and components */
:root {
  --ink: #1d1d1f;
  --muted: #48484d;
  --line: #e8e8ed;
  --line-strong: #d2d2d7;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --radius-lg: 24px;
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.topnav { display: flex; gap: 32px; font-size: 12px; font-weight: 600; }
.topnav a { color: var(--ink); opacity: .75; }
.topnav a:hover { color: var(--ink); opacity: 1; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 44px; height: 44px; border: none; background: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.avatar.lg { width: 40px; height: 40px; font-size: 12px; }
.avatar.dark { background: var(--ink); color: #fff; }
.back { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13px; }
.text-btn { min-height: 44px; border: none; background: none; color: var(--accent); font-size: 13px; cursor: pointer; padding: 0 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 24px; border: none; border-radius: var(--radius-pill); background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.sm { height: 32px; padding: 0 14px; font-size: 12px; }
.btn.ghost { background: none; border: 1px solid var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: #86868b; }

/* Game icons: the game's poster, or its colour and symbol until a poster loads */
.game-icon { position: relative; overflow: hidden; border-radius: 25%; display: flex; align-items: center; justify-content: center; flex: none; }
.game-icon svg { width: 50%; height: 50%; }
.game-icon .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Game tiles are movie posters, with the name in small heavy capitals over a dark fade */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 18px 14px; }
.tile { position: relative; display: block; color: #fff; text-align: left; }
.tile:hover { color: #fff; }
.tile .game-icon { width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 14px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.06); transition: transform .18s ease, box-shadow .18s ease; }
.tile .game-icon svg { width: 42%; height: auto; }
.tile:hover .game-icon { transform: translateY(-3px); box-shadow: 0 16px 30px -12px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.06); }
.tile-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 10px; border-radius: 0 0 14px 14px; background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0)); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; line-height: 1.15; pointer-events: none; }
.tile .soon { position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: var(--radius-pill); background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.tile.is-soon .game-icon .art { filter: saturate(.75) brightness(.85); }

/* In-game score capsules: label and number on one line, small enough to leave the match in view */
.cap { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cap b { font-size: 13px; font-weight: 800; letter-spacing: 0; }
.cap .cap-note { font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted); }
.cap .cap-note:empty { display: none; }

/* Layout helpers */
.container { max-width: 1064px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.panel { background: var(--bg); border-radius: var(--radius-lg); padding: 24px; }

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .topnav { display: none; }
  .container { padding: 0 16px; }
  .game-grid { grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
  .tile .game-icon, .tile-name { border-radius: 11px; }
  .tile-name { padding: 20px 7px 7px; font-size: 10px; }
}
