/* Stickfight – Webseite. Farben laut .claude/docs/branding.md */

/* Schriften selbst gehostet (Google Fonts, SIL Open Font License) – kein Abruf bei Google */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/barlow-700.woff2) format('woff2'); }
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 700 800; font-display: swap; src: url(/fonts/big-shoulders-display.woff2) format('woff2'); }

:root {
  --arena: #080a0f;
  --panel: #0e1119;
  --panel-2: #131722;
  --line: #222838;
  --bone: #f0f0f5;
  --muted: #9aa0b4;
  --red: #eb4646;
  --blue: #4696ff;
  --bolt: #f5d246;
  --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-text: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 6px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--arena);
  color: var(--bone);
  font: 400 17px/1.55 var(--font-text);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--bone); text-decoration-color: var(--bolt); text-underline-offset: 3px; }
a:hover { color: var(--bolt); }
:focus-visible { outline: 2px solid var(--bolt); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.small { font-size: 0.9rem; }

/* ---- Rahmen ------------------------------------------------------------ */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px var(--gutter) 64px; }
.narrow { max-width: 760px; }
section { padding: 48px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

/* ---- Kopfzeile --------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.brand span { font: 800 1.5rem/1 var(--font-display); letter-spacing: 0.06em; }
.site-nav { display: flex; gap: 18px; font-weight: 600; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current='page'] { color: var(--bolt); }
.auth { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.auth .who { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; max-width: 180px; }
.auth .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius);
  border: 2px solid var(--bone); background: transparent; color: var(--bone);
  font: 700 1rem/1.2 var(--font-text); text-decoration: none; cursor: pointer;
  max-width: 100%; text-align: center;
}
.btn:hover { border-color: var(--bolt); color: var(--bolt); }
.btn-small { padding: 6px 12px; font-size: 0.9rem; border-width: 1px; }
.btn-primary { background: var(--bolt); border-color: var(--bolt); color: var(--arena); }
.btn-primary:hover { background: var(--bone); border-color: var(--bone); color: var(--arena); }
.btn-big { padding: 16px 28px; font: 800 1.5rem/1 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* ---- Hero -------------------------------------------------------------- */
.hero { text-align: center; padding-top: 24px; }
.hero .logo { width: min(640px, 100%); margin: 0 auto 8px; }
.hero .pitch { max-width: 640px; margin: 0 auto 28px; font-size: 1.15rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.hero .note { margin-top: 12px; }

/* ---- Live-Zahlen ------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 40px; }
.stat { background: var(--panel); padding: 16px; text-align: left; }
.stat strong { display: block; font: 800 2.6rem/1 var(--font-display); }
.stat span { color: var(--muted); font-size: 0.9rem; }
.stat:nth-child(1) strong { color: var(--bolt); }

/* ---- Features ---------------------------------------------------------- */
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.features li { border-left: 3px solid var(--red); padding-left: 14px; }
.features li:nth-child(even) { border-left-color: var(--blue); }
.features h3 { margin-bottom: 0.3em; }
.features p { color: var(--muted); margin: 0; }

/* ---- Raumliste --------------------------------------------------------- */
.rooms { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.room { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.room .code { font: 800 2.2rem/1 var(--font-display); letter-spacing: 0.12em; color: var(--bolt); }
.room .host { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-width: 0; }
.room .host span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { border-left: 3px solid var(--bolt); padding: 6px 0 6px 12px; color: var(--muted); }
.hint b { color: var(--bone); }
.empty { color: var(--muted); padding: 16px 0; }

/* ---- Tabellen ---------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font: 700 0.85rem/1.2 var(--font-text); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
td.num, th.num { text-align: right; }
td.rank { font: 800 1.3rem/1 var(--font-display); width: 3.5em; }
tr.top td.rank { color: var(--bolt); }
.player { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; font-weight: 600; }
.player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.wld { color: var(--muted); white-space: nowrap; }
.controls th.p1 { color: var(--red); }
.controls th.p2 { color: var(--blue); }
kbd { display: inline-block; min-width: 1.8em; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 4px; background: var(--panel-2); font: 600 0.9rem/1.4 var(--font-text); text-align: center; }

/* ---- Avatare ----------------------------------------------------------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--panel-2); object-fit: cover; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font: 800 1rem/1 var(--font-display); color: var(--arena); background: var(--bone); }
.avatar-big { width: 88px; height: 88px; font-size: 2.4rem; }

/* ---- Profil ------------------------------------------------------------ */
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 32px; }
.profile .info { flex: 1 1 200px; min-width: 0; }
.profile h1 { margin: 0; overflow-wrap: anywhere; }
.profile .rating { font: 800 2.8rem/1 var(--font-display); color: var(--bolt); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: 700; border: 1px solid var(--line); white-space: nowrap; }
.badge.win { border-color: var(--bolt); color: var(--bolt); }
.badge.loss { color: var(--muted); }
.delta-up { color: var(--bolt); }
.delta-down { color: var(--muted); }

/* ---- Link-Seite -------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.device-code { font: 800 clamp(2.4rem, 11vw, 4rem)/1 var(--font-display); letter-spacing: 0.12em; color: var(--bolt); margin: 8px 0 20px; overflow-wrap: anywhere; }
.field { display: flex; gap: 8px; flex-wrap: wrap; }
.field input { flex: 1 1 180px; min-width: 0; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--arena); color: var(--bone); font: 700 1.2rem/1.2 var(--font-text); letter-spacing: 0.1em; text-transform: uppercase; }
.status { margin-top: 16px; min-height: 1.5em; }
.status.ok { color: var(--bolt); }
.status.err { color: var(--red); }

/* ---- Rechtstexte ------------------------------------------------------- */
.legal h2 { font-size: 1.6rem; margin-top: 1.6em; }
.legal ul { padding-left: 1.2em; }
.placeholder { background: var(--bolt); color: var(--arena); padding: 0 4px; border-radius: 3px; font-weight: 700; }

/* ---- Fußzeile ---------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 20px; padding-bottom: 28px; }
.site-footer a { color: var(--muted); }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .site-nav { order: 3; width: 100%; }
  .hide-sm { display: none; }
  th, td { padding: 8px 6px; }
}
