/* ============================================================
   34-0-0 Bundesliga — base.css（全站通用：Design System 核心）
   Nachtstadion / Flutlicht / Anzeigetafel. Dark first, mobile first.
   游戏屏样式在 app.css（仅 index / en 镜像加载）。
   ============================================================ */

/* ---------- Fonts (lokal, woff2, latin subset) ---------- */
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-800.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-900.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

/* ---------- Tokens ---------- */
:root {
  --bg-0: #0A0E14;
  --bg-1: #11171F;
  --bg-2: #1A222D;
  --line: #26303D;

  --pitch: #14532D;
  --pitch-line: #1E6B3C;
  --win: #22C55E;

  --brand: #E62E2E;
  --brand-hot: #FF4D4D;

  --gold: #F5C044;
  --gold-glow: rgba(245, 192, 68, .35);

  --press: #FF5A3C;
  --possession: #3B82F6;
  --counter: #34D399;

  --text-1: #F2F5F8;
  --text-2: #9AA7B4;
  --text-3: #8A99A8; /* WCAG AA: ≥4.5:1 auf bg-0/1/2 */

  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --cut: -4deg;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spin-ease: cubic-bezier(.15, .9, .25, 1);
  --pad-x: clamp(16px, 4vw, 48px);
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
img { max-width: 100%; }
a { color: var(--text-1); text-decoration-color: var(--text-3); text-underline-offset: 3px; }
a:hover { color: var(--brand-hot); }
:focus-visible { outline: 2px solid var(--brand-hot); outline-offset: 2px; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 900; }
h2 { font-size: clamp(22px, 4vw, 28px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; cursor: pointer; }
.num, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad-x); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.gold { color: var(--gold); }
.hidden { display: none !important; }

/* ---------- Skip-Link (Tastatur) ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 8px;
  font-weight: 700; text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus-visible { top: 0; outline-color: #fff; }

/* ---------- Header / Nav ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 20, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 20px;
  min-height: 56px;
}
.logo {
  font-family: var(--font-display); font-weight: 900; font-size: 22px;
  letter-spacing: -0.02em; text-decoration: none; color: var(--text-1);
  display: flex; align-items: baseline; gap: 8px;
}
.logo b { color: var(--brand); }
.logo span { font-size: 11px; color: var(--text-3); font-weight: 700; letter-spacing: .08em; }
.main-nav { display: none; gap: 4px; margin-left: auto; }
.main-nav a {
  position: relative; padding: 8px 12px; text-decoration: none;
  font-weight: 600; font-size: 14px; color: var(--text-2);
}
.main-nav a:hover { color: var(--text-1); }
.main-nav a[aria-current] { color: var(--text-1); }
.main-nav a[aria-current]::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 3px;
  background: var(--brand); transform: skewX(var(--cut));
}
.lang-switch {
  margin-left: 8px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
  text-decoration: none; color: var(--text-2); white-space: nowrap;
}
.lang-switch:hover { color: var(--gold); border-color: var(--gold); }
@media (min-width: 769px) {
  .main-nav { display: flex; }
  .tabbar { display: none !important; }
}

/* Bottom Tab-Bar (mobile, UI规范 4.3) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: rgba(17, 23, 31, .97);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px; min-height: 52px; justify-content: center;
  font-size: 10.5px; font-weight: 600; color: var(--text-3); text-decoration: none;
}
.tabbar a i { font-size: 17px; font-style: normal; }
.tabbar a[aria-current] { color: var(--brand-hot); }
body { padding-bottom: 60px; }
@media (min-width: 769px) { body { padding-bottom: 0; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 10px 22px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .02em;
  background: var(--bg-2); color: var(--text-1);
  border: 1px solid var(--line); border-radius: 8px;
  position: relative; overflow: hidden;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  text-decoration: none;
}
.btn::before {
  content: ''; position: absolute; top: 0; left: -30%; width: 24px; height: 100%;
  background: rgba(255, 255, 255, .14); transform: skewX(var(--cut));
  transition: left .25s var(--ease);
}
.btn:hover::before { left: 110%; }
.btn:active { transform: scale(.97); }
.btn-brand {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 0 18px rgba(230, 46, 46, .35);
}
.btn-brand:hover { background: var(--brand-hot); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1a1405; }
.btn-ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled::before { display: none; }
.btn-big { min-height: 56px; padding: 14px 30px; font-size: 18px; width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px; position: relative;
}
.card-hover { transition: border-color .2s var(--ease); }
.card-hover:hover { border-color: var(--text-3); }

/* ---------- Ratings-Leiste (Content + Squad) ---------- */
.rating-bars { display: grid; gap: 10px; margin: 16px 0; }
.rating-bar { display: grid; grid-template-columns: 96px 1fr 52px; align-items: center; gap: 10px; }
.rating-bar .rl { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-2); }
.rating-bar .bar { height: 10px; background: var(--bg-2); border-radius: 4px; overflow: hidden; transform: skewX(var(--cut)); }
.rating-bar .bar i { display: block; height: 100%; background: var(--brand); transition: width .4s var(--ease); }
.rating-bar.poss .bar i { background: var(--possession); }
.rating-bar.def .bar i { background: var(--counter); }
.rating-bar .val { font-family: var(--font-mono); font-weight: 700; font-size: 18px; text-align: right; }

/* ---------- Stil-Punkt (Content + Scout) ---------- */
.style-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.style-dot.press { background: var(--press); }
.style-dot.possession { background: var(--possession); }
.style-dot.counter { background: var(--counter); }

/* ---------- Tabelle (Hall of Fame + Content) ---------- */
.ltable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ltable th { font-size: 11px; text-transform: uppercase; color: var(--text-3); text-align: right; padding: 6px 6px; font-weight: 600; }
.ltable th:nth-child(2), .ltable td:nth-child(2) { text-align: left; }
.ltable td { padding: 0 6px; height: 44px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ltable td:first-child { color: var(--text-3); font-family: var(--font-mono); font-size: 12px; border-left: 4px solid transparent; }
.ltable tr.me td { background: rgba(230, 46, 46, .08); font-weight: 700; }
.ltable tr.me td:first-child { border-left: 4px solid var(--brand); }
.ltable .tname { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ltable .up { color: var(--win); font-size: 10px; }
.ltable .down { color: var(--brand); font-size: 10px; }

/* ---------- Badge-Galerie (Erfolge-Seite) ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-align: center; }
.badge-card .ic { font-size: 26px; }
.badge-card b { display: block; margin: 6px 0 2px; font-size: 14px; }
.badge-card span { font-size: 12px; color: var(--text-2); }
.badge-card.locked { opacity: .42; filter: grayscale(.8); }

/* ---------- SEO-Content & FAQ ---------- */
.seo-content { border-top: 1px solid var(--line); margin-top: 30px; padding: 34px 0; color: var(--text-2); }
.seo-content h2 { color: var(--text-1); margin-top: 1.6em; }
.seo-content h3 { color: var(--text-1); margin-top: 1.4em; }
.seo-content a { color: var(--text-1); }
.seo-content .team-cards { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 14px 0; }
@media (min-width: 640px) { .seo-content .team-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .seo-content .team-cards { grid-template-columns: repeat(3, 1fr); } }
.team-card { display: block; text-decoration: none; }
.team-card .tc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.team-card b { font-family: var(--font-display); font-size: 17px; text-transform: uppercase; }
.team-card .yr { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.team-card p { font-size: 13px; color: var(--text-2); margin: 6px 0 0; }
.faq details { border: 1px solid var(--line); border-radius: 8px; background: var(--bg-1); margin-bottom: 8px; }
.faq summary { padding: 14px 16px; cursor: pointer; font-weight: 600; color: var(--text-1); min-height: 44px; }
.faq details div { padding: 0 16px 14px; font-size: 14.5px; }
.stat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.stat-pill { display: inline-flex; align-items: center; min-height: 44px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 16px; font-size: 13px; }
.stat-pill b { font-family: var(--font-mono); color: var(--gold); }

/* ---------- Content-Seiten ---------- */
.page-head { padding: 30px 0 10px; }
.page-head .crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.page-head .crumbs a { color: var(--text-2); text-decoration: none; }
.prose { max-width: 760px; color: var(--text-2); }
.prose h2, .prose h3 { color: var(--text-1); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0; }
/* 360px: 宽表格内部横滚，不撑破页面（UI规范 §7 检查单） */
@media (max-width: 640px) {
  .prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--bg-1); font-family: var(--font-display); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.cta-band {
  margin: 28px 0; padding: 22px; text-align: center;
  background: linear-gradient(135deg, rgba(230, 46, 46, .16), rgba(245, 192, 68, .08));
  border: 1px solid var(--brand); border-radius: 10px;
}
.hub-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 18px 0; }
@media (min-width: 640px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .hub-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 40px; background: var(--bg-1); }
.site-foot .cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 769px) { .site-foot .cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-foot .foot-head {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: 12px; color: var(--text-3); letter-spacing: .08em; margin: 0 0 .5em;
}
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: 13.5px; }
.site-foot a { color: var(--text-2); text-decoration: none; }
.site-foot a:hover { color: var(--text-1); }
.site-foot .disclaimer { font-size: 12px; color: var(--text-3); max-width: 380px; }

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; }
}
