/* Rätselpause – warmes Papier, tiefe Tinte, bunte Spielsteine. */

:root {
  color-scheme: light;
  --page: #f5f1e8;
  --page-dot: rgba(60, 45, 20, .07);
  --card: #fffdf8;
  --card-2: #f7f3ea;
  --card-3: #efe9dc;
  --ink: #17150f;
  --ink-2: #4d4a42;
  --ink-3: #8a8577;
  --line: rgba(40, 32, 10, .10);
  --line-2: rgba(40, 32, 10, .18);
  --fav: #d99a00;
  --shadow: 0 1px 0 rgba(40, 30, 10, .04), 0 10px 30px -18px rgba(60, 40, 10, .35);
  --shadow-lift: 0 1px 0 rgba(40, 30, 10, .04), 0 18px 40px -20px rgba(60, 40, 10, .45);
  --gold: #c99400;
  --gold-soft: #fbf0cc;
  --silver: #8d99a6;
  --bronze: #b4703b;
  --bad: #c2402f;
  --bad-soft: #fbe5df;
  --good-soft: #e3f1e0;
  --warn-soft: #fbf0d3;
  --radius: 18px;

  /* Spielerfarben (dataviz-Palette, feste Reihenfolge, validiert gegen --card) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  /* Schrift auf der jeweiligen Spielerfarbe (Avatare) */
  --s1-on: #fff; --s2-on: #fff; --s3-on: #0b2a1f; --s4-on: #2b1d00;
  --s5-on: #3a0f20; --s6-on: #fff; --s7-on: #fff; --s8-on: #fff;
  /* Heatmap-Stufen (eine Farbe, hell → dunkel) */
  --h0: #ece6d8; --h1: #b7d3f6; --h2: #6da7ec; --h3: #2a78d6; --h4: #184f95;
  --viz-grid: #ebe5d7;
  --viz-base: #cfc7b3;
}

/* Dunkel: data-theme setzt das Skript im <head> (gespeicherte Wahl, sonst wie das System) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #12110e;
  --page-dot: rgba(255, 240, 210, .05);
  --card: #1d1c1a;
  --card-2: #252420;
  --card-3: #2e2c27;
  --ink: #f1eee6;
  --ink-2: #c6c1b4;
  --ink-3: #8f8a7d;
  --line: rgba(255, 245, 225, .09);
  --line-2: rgba(255, 245, 225, .16);
  --fav: #f2b630;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lift: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .9);
  --gold: #e6b94a;
  --gold-soft: #3b321c;
  --bad: #ef8371;
  --bad-soft: #3d2420;
  --good-soft: #1f3324;
  --warn-soft: #3a321d;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --s3-on: #fff; --s4-on: #fff; --s5-on: #fff;
  --h0: #2a2924; --h1: #184f95; --h2: #2a78d6; --h3: #5598e7; --h4: #9ec5f4;
  --viz-grid: #2c2b27;
  --viz-base: #44423b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--page);
  background-image: radial-gradient(var(--page-dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: -.025em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Kopf */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 22px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { display: grid; grid-template-columns: repeat(2, 11px); gap: 2px; transform: rotate(-8deg); }
.logo i { width: 11px; height: 11px; border-radius: 3px; display: block; }
.logo i:nth-child(1) { background: #6aaa64; } .logo i:nth-child(2) { background: #e0a100; }
.logo i:nth-child(3) { background: #9b6fd0; } .logo i:nth-child(4) { background: #3b9bd6; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 13px; border-radius: 999px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.nav a:hover { background: var(--card-3); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--page); }
.me { display: flex; align-items: center; gap: 10px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); cursor: pointer; }
.theme-toggle:hover { color: var(--ink); background: var(--card-2); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.theme-toggle .i-sun circle { fill: currentColor; stroke: none; }
:root[data-theme="dark"] .theme-toggle .i-moon, :root:not([data-theme="dark"]) .theme-toggle .i-sun { display: none; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; border-radius: 999px; display: block; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 6px; display: flex;
  flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 650; }
.menu-body a, .menu-body button { padding: 8px 10px; border-radius: 8px; text-align: left; width: 100%; color: var(--ink); font: inherit;
  background: none; border: 0; cursor: pointer; }
.menu-body a:hover, .menu-body button:hover { background: var(--card-2); text-decoration: none; }

main.wrap { padding-top: 28px; padding-bottom: 64px; min-height: 72vh; }
.foot { padding: 24px 16px 40px; color: var(--ink-3); font-size: .88rem; display: flex; gap: 8px 18px; justify-content: center;
  flex-wrap: wrap; text-align: center; }
.foot .made { flex-basis: 100%; }
.foot .made a { color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.foot .heart { display: inline-block; transition: transform .2s; }
.foot .made:hover .heart { transform: scale(1.25); }

/* ------------------------------------------------------------------ Bausteine */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: transform .12s ease, background .12s; }
.btn:hover { text-decoration: none; background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--page); box-shadow: 0 6px 16px -8px rgba(0,0,0,.5); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--page)); }
.btn.round { width: 40px; height: 40px; padding: 0; font-size: 1.1rem; }
.btn.small { padding: 5px 11px; font-size: .85rem; }
.btn.danger { color: var(--bad); }
.btn.disabled { opacity: .35; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-3); cursor: pointer; }
.linkbtn:hover { color: var(--bad); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .muted { font-size: .85rem; }
.section { margin-top: 52px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head p { color: var(--ink-3); font-size: .9rem; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.grid.auto-s { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }

.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.hero .eyebrow { margin-bottom: 6px; display: block; }
.hero-sub { margin-top: 8px; color: var(--ink-2); font-size: 1.02rem; }
.hero-actions { display: flex; align-items: center; gap: 8px; }
.date-pick { position: relative; display: inline-flex; }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; background: var(--good-soft); border: 1px solid var(--line); }
.flash.error { background: var(--bad-soft); }
.flash.warn { background: var(--warn-soft); }

.tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--card-3); border-radius: 999px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-weight: 600; font-size: .88rem; }
.chip:hover { text-decoration: none; border-color: var(--line-2); }
.chip .tile { width: 26px; height: 26px; font-size: .9rem; border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
[hidden] { display: none !important; }

/* Spiele nach Kategorien */
.cat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 24px 36px; }
.cat-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; font-size: .78rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.cat-title span, .cat-heading span, .cat-chip span { font-weight: 600; color: var(--ink-3); }
.cat-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.cat-heading span { font-size: .9rem; }
.cat-section { margin-top: 34px; scroll-margin-top: 84px; }
.cat-nav { display: flex; flex-direction: column; gap: 12px; }
.cat-nav .game-search { margin: 0; }
.cat-chip { padding: 6px 12px; }
.game-search { display: block; width: 100%; max-width: 380px; margin-bottom: 20px; padding: 10px 14px; }
.game-search-empty { margin: -6px 0 16px; }
.de { font-size: .64rem; font-weight: 800; letter-spacing: .05em; padding: 1px 5px; border-radius: 5px;
  background: var(--card-3); color: var(--ink-2); vertical-align: middle; }

/* Spiel-Stein: Original-Icon auf hellem Grund (auch im Dark Mode, damit schwarze Konturen sichtbar bleiben) */
.tile { --g: #8a8577; display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px;
  font-size: 1.35rem; line-height: 1; overflow: hidden;
  background: color-mix(in srgb, var(--g) 10%, #fffdf8);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 35%, transparent), 0 1px 2px rgba(40, 30, 10, .08); }
.tile img { width: 72%; height: 72%; object-fit: contain; display: block; }
.tile.l { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; }

/* Avatar */
.av { --c: var(--s1); --on: var(--s1-on); display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px;
  border-radius: 50%; background: var(--c); color: var(--on); font-weight: 750; font-size: .78rem; letter-spacing: .02em;
  box-shadow: 0 0 0 2px var(--card); }
.av.s { width: 26px; height: 26px; font-size: .64rem; }
.av.l { width: 56px; height: 56px; font-size: 1.15rem; }
.av.xl { width: 88px; height: 88px; font-size: 1.8rem; box-shadow: 0 0 0 4px var(--card), var(--shadow); }
.av.c1 { --c: var(--s1); --on: var(--s1-on); } .av.c2 { --c: var(--s2); --on: var(--s2-on); }
.av.c3 { --c: var(--s3); --on: var(--s3-on); } .av.c4 { --c: var(--s4); --on: var(--s4-on); }
.av.c5 { --c: var(--s5); --on: var(--s5-on); } .av.c6 { --c: var(--s6); --on: var(--s6-on); }
.av.c7 { --c: var(--s7); --on: var(--s7-on); } .av.c8 { --c: var(--s8); --on: var(--s8-on); }
.who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 650; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat .label { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.stat .value { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value.long { font-size: 1.05rem; white-space: normal; line-height: 1.35; padding-top: 4px; }
.stat .sub { font-size: .82rem; color: var(--ink-2); margin-top: 2px; }

.empty { text-align: center; padding: 56px 20px; background: var(--card); border: 1.5px dashed var(--line-2); border-radius: var(--radius); }
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }
.empty p { color: var(--ink-2); margin-bottom: 16px; }

/* ------------------------------------------------------------------ Podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; padding-top: 14px; }
.podium .place { position: relative; text-align: center; padding: 24px 14px 18px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.podium .place.p1 { padding-top: 32px; padding-bottom: 26px; border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 16%, var(--card)), var(--card) 72%); }
.podium .medal { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; box-shadow: 0 0 0 3px var(--page); }
.p1 .medal { background: var(--gold); } .p2 .medal { background: var(--silver); } .p3 .medal { background: var(--bronze); }
.podium .pname { font-weight: 700; font-size: 1.05rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .ppts { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.podium .p1 .ppts { font-size: 2.6rem; }
.podium .ppts small { font-size: .85rem; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.podium .pmeta { font-size: .85rem; color: var(--ink-2); }
.podium .order-1 { order: 2; } .podium .order-2 { order: 1; } .podium .order-3 { order: 3; }
/* Zwei Personen: volle Breite, Platz 1 links */
.podium.n2 { grid-template-columns: 1.15fr 1fr; }
.podium.n2 .order-1 { order: 1; } .podium.n2 .order-2 { order: 2; }
@media (max-width: 640px) {
  .podium, .podium.n2 { grid-template-columns: 1fr 1fr; }
  .podium .order-1 { order: 1; grid-column: span 2; }
  .podium .order-2 { order: 2; } .podium .order-3 { order: 3; }
  .podium.n2 .order-2 { grid-column: span 2; }
  .podium .ppts { font-size: 1.6rem; } .podium .p1 .ppts { font-size: 2.2rem; }
}

/* Nur eine Person: breiter Führungs-Streifen statt einsamer Podiumskarte */
.leader { display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); box-shadow: var(--shadow);
  background: linear-gradient(100deg, color-mix(in srgb, var(--gold) 16%, var(--card)), var(--card) 60%); }
.leader .l-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.leader .l-name { font-weight: 750; font-size: 1.2rem; }
.leader .l-name a:hover { text-decoration: none; }
.leader .l-meta { font-size: .88rem; color: var(--ink-2); }
.leader .mini-games { margin-top: 2px; }
.leader .l-pts { text-align: right; flex: none; }
.leader .l-pts b { display: block; font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.leader .l-pts span { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
@media (max-width: 640px) {
  .leader { flex-wrap: wrap; padding: 16px; gap: 12px 14px; }
  .leader .l-pts { text-align: left; flex-basis: 100%; }
  .leader .l-pts b { display: inline; font-size: 2rem; margin-right: 4px; }
}

/* Rangliste als Zeilen */
.ranks { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 34px minmax(140px, 1.2fr) minmax(120px, 2fr) auto; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.rank-row .pos { font-weight: 800; color: var(--ink-3); font-size: 1.05rem; text-align: center; font-variant-numeric: tabular-nums; }
.rank-row .pos.top { color: var(--ink); }
.meter { display: flex; align-items: center; gap: 12px; min-width: 0; }
.meter-track { flex: 1; height: 8px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--ink)); }
.meter b { font-size: 1.1rem; font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; }
.rank-meta { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: .84rem; white-space: nowrap; }
.rank-meta span b { color: var(--ink); font-weight: 700; }
.mini-games { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.mini-games .tile { width: 22px; height: 22px; font-size: .72rem; border-radius: 6px; }
.mini-games .tile.win { box-shadow: inset 0 0 0 1.5px var(--gold); }
@media (max-width: 760px) {
  .rank-row { grid-template-columns: 28px minmax(0, 1fr); gap: 8px 10px; }
  .rank-row .meter, .rank-row .rank-meta { grid-column: 2; }
  .rank-row .rank-meta { white-space: normal; flex-wrap: wrap; gap: 2px 12px; }
}

/* ------------------------------------------------------------------ Spielkarten (Tag) */
/* Raster statt CSS-Spalten: füllt zeilenweise, auch bei wenigen Karten gleichmäßig */
.masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.game-card { padding: 0; overflow: visible; position: relative; }
.game-card::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--g); }
.gc-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 10px; }
.gc-head h3 a:hover { text-decoration: none; }
.gc-meta { font-size: .8rem; color: var(--ink-3); }
.gc-head .play { margin-left: auto; font-size: .8rem; color: var(--ink-3); white-space: nowrap; font-weight: 600; }
.results { list-style: none; margin: 0; padding: 2px 8px 10px; }
.results details > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 10px;
  align-items: center; padding: 7px 10px; border-radius: 12px; }
.results details > summary::-webkit-details-marker { display: none; }
.results details > summary:hover, .results details[open] > summary { background: var(--card-2); }
.results .place-n { font-size: .8rem; font-weight: 750; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.results .res { font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.results .fail .res { color: var(--bad); }
.results .pts { font-size: .76rem; color: var(--ink-3); min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.results .win > summary { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.results .win .place-n { font-size: .95rem; }
.results .grid-wrap { padding: 6px 10px 10px 42px; }
.emoji-grid { margin: 0; font-family: inherit; font-size: .82rem; line-height: 1.25; white-space: pre; display: inline-block;
  background: var(--card-2); border-radius: 10px; padding: 10px 12px; max-width: 100%; overflow-x: auto; }

.unplayed { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
  border: 1.5px dashed var(--line-2); }
.unplayed .label { color: var(--ink-3); font-weight: 650; font-size: .9rem; }
.unplayed .cat-groups { gap: 16px 32px; }
.unplayed .chip { background: transparent; }

/* Tagesreihe Spieler */
.day-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.day-player { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
.day-player .dp-main { flex: 1; min-width: 0; }
.day-player .dp-pts { font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.day-player .dp-pos { font-weight: 800; color: var(--ink-3); width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Spiele-Übersicht */
.game-tile { display: flex; flex-direction: column; gap: 14px; position: relative; }
.game-tile::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--g); }
.gt-head { display: flex; align-items: center; gap: 12px; }
.gt-head .fav-form { margin-left: auto; align-self: flex-start; }

/* Admin: Ergebnisse verwalten */
.admin-jump { margin-bottom: 22px; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 16px 18px; }
.admin-filters label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 650; color: var(--ink-2); }
.admin-filters label.grow { flex: 1 1 200px; }
.admin-filters input, .admin-filters select { margin: 0; padding: 7px 10px; }
.admin-filter-actions { display: flex; gap: 8px; }
.admin-results td { white-space: nowrap; }
.ar-game { display: inline-flex; align-items: center; gap: 8px; }
.ar-game .tile { width: 24px; height: 24px; }
.ar-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ar-actions form { margin: 0; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.admin-edit { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; }
.admin-edit label { display: flex; flex-direction: column; gap: 6px; font-weight: 650; }
.admin-edit textarea { font-family: inherit; min-height: 180px; }
.admin-edit .hint { font-weight: 400; font-size: .85rem; }
.admin-delete { margin-top: 14px; }
.rename { position: relative; }
.rename summary { list-style: none; cursor: pointer; }
.rename summary::-webkit-details-marker { display: none; }
.rename form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: flex; gap: 6px; padding: 8px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); }
.rename input { margin: 0; width: 180px; padding: 6px 10px; }
.admin-log { list-style: none; margin: 0; padding: 0; }
.admin-log li { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; display: flex; gap: 10px; flex-wrap: wrap; }
.admin-log li:last-child { border-bottom: 0; }

/* Spiel vorschlagen */
.suggest-form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.suggest-form h2 { margin-bottom: 4px; }
.suggest-form .flash { margin: 0; }
.suggest-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.suggest-fields input { margin: 0; }
@media (max-width: 720px) { .suggest-fields { grid-template-columns: 1fr; } .suggest-fields .btn { justify-self: start; } }
.hero-sub a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.suggestion { display: flex; flex-direction: column; gap: 10px; }
.suggestion-link { font-weight: 650; word-break: break-all; }
.suggestion-note { font-size: .9rem; }

/* Stern für Lieblingsspiele */
.fav-form { display: inline-flex; margin: 0; }
.fav-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 34px; height: 34px; padding: 0;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-3); font: inherit;
  font-size: 1.05rem; line-height: 1; cursor: pointer; }
.fav-btn:hover { border-color: var(--line-2); color: var(--ink); }
.fav-btn.on { color: var(--fav); border-color: color-mix(in srgb, var(--fav) 50%, var(--line)); background: color-mix(in srgb, var(--fav) 10%, var(--card)); }
.fav-btn.labeled { width: auto; height: auto; padding: 9px 16px; font-size: .92rem; font-weight: 600; }
.fav-btn.labeled .fav-label { color: var(--ink); }
.gt-head h3 a:hover { text-decoration: none; }
.gt-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gt-kpis div { background: var(--card-2); border-radius: 10px; padding: 8px 10px; }
.gt-kpis b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.gt-kpis span { font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.gt-foot { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; font-weight: 650; }
.gt-foot a:last-child { color: var(--ink-3); }
.sparkbars { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.sparkbars i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: var(--g); }
.sparkbars i.zero { background: var(--card-3); }
.spark-cap { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-3); margin-top: 4px; }

/* Horizontale Balken */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: .9rem; }
.hbar .hb-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.hbar .hb-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hb-track { height: 14px; display: flex; align-items: center; }
.hbar .hb-fill { height: 14px; border-radius: 0 4px 4px 0; background: var(--g, var(--s1)); min-width: 3px; }
.hbar .hb-val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; }
.hbar .tile { width: 26px; height: 26px; font-size: .85rem; border-radius: 8px; }

/* Spezialisten / Rekorde / Fakten */
.spec { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
.spec .sp-main { flex: 1; min-width: 0; }
.spec .sp-game { font-size: .78rem; color: var(--ink-3); font-weight: 650; }
.spec .sp-name { font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.spec .sp-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec .sp-val { text-align: right; }
.spec .sp-val b { display: block; font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spec .sp-val span { font-size: .74rem; color: var(--ink-3); white-space: nowrap; }
.fact { display: flex; flex-direction: column; gap: 10px; }
.fact .f-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fact .f-icon { font-size: 1.6rem; }
.fact .f-value { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.fact .f-unit { color: var(--ink-3); font-size: .85rem; }

/* Admin: nicht erkannte Texte */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .72rem;
  font-weight: 750; vertical-align: 3px; letter-spacing: 0; }
.menu summary { position: relative; }
.dot-badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--page); }
.failure { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.failure.fixed { border-color: color-mix(in srgb, var(--s3) 45%, var(--line)); }
.failure-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .84rem; }
.failure-error { font-size: .86rem; color: var(--bad); font-weight: 600; }
.failure-text { white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; width: 100%; }
.failure-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .84rem; }
.failure-foot .actions { display: flex; gap: 6px; }
.failure-foot form { margin: 0; }
.status { color: var(--ink-3); font-weight: 600; }
.status.ok { color: color-mix(in srgb, var(--s6) 80%, var(--ink)); }
.status.part { color: var(--gold); }

/* Wochenkrone */
.crown-banner { display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin-bottom: 20px; border-radius: var(--radius);
  background: linear-gradient(100deg, color-mix(in srgb, var(--gold) 22%, var(--card)), var(--card) 65%);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); box-shadow: var(--shadow); }
.crown-banner:hover { text-decoration: none; box-shadow: var(--shadow-lift); }
.crown-icon { font-size: 2rem; filter: drop-shadow(0 3px 6px rgba(201, 148, 0, .35)); }
.crown-text { display: flex; flex-direction: column; min-width: 0; }
.crown-text b { font-size: 1.15rem; }
.crown-text .muted { font-size: .85rem; }
.crown-avatars { margin-left: auto; display: flex; }
.crown-avatars .av + .av { margin-left: -12px; }

/* Dein Tag */
.myday { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 20px; }
.myday-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.myday-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.myday-track { flex: 1; min-width: 80px; max-width: 220px; height: 6px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.myday-track span { display: block; height: 100%; border-radius: 999px; background: var(--ink); }
.myday-note { font-size: .85rem; color: var(--ink-2); }
.myday-rank { margin-left: auto; font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.myday-rank b { color: var(--ink); }
.myday-rank a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.myday-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line); }
.myday-badges .label { font-weight: 700; color: var(--ink-2); font-size: .88rem; margin-right: 2px; }
.day-hero { margin-bottom: 22px; }
.day-player.is-me { border-color: var(--line-2); box-shadow: inset 0 0 0 1.5px var(--ink), var(--shadow); }
@media (max-width: 640px) { .myday-rank { margin-left: 0; flex-basis: 100%; } }
.myday-items { display: flex; flex-wrap: wrap; gap: 8px; }
.myday-favs { margin-bottom: 20px; }
.myday-favs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.myday-favs-head .cat-title { margin: 0; }
.myday-hint { margin-bottom: 20px; font-size: .9rem; }
.myday-edit { border: 0; background: none; padding: 0; font: inherit; font-size: .85rem; font-weight: 650; color: var(--ink-2);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.myday-edit:hover { color: var(--ink); }
.myday-more { border-top: 1px solid var(--line); padding-top: 14px; }
.myday-more summary { cursor: pointer; font-weight: 650; color: var(--ink-2); font-size: .9rem; list-style: none; width: fit-content; }
.myday-more summary::-webkit-details-marker { display: none; }
.myday-more summary::before { content: "▸"; display: inline-block; width: 1.1em; }
.myday-more[open] summary::before { content: "▾"; }
.myday-more summary span { color: var(--ink-3); font-weight: 600; margin-left: 4px; }
.myday-more[open] summary { margin-bottom: 18px; }
.myday-edit-hint { display: none; margin-top: 14px; font-size: .85rem; }
.myday.editing .myday-edit-hint { display: block; }
.myday.editing .myday-item { position: relative; cursor: pointer; }
.myday.editing .myday-item::after { content: "☆"; position: absolute; top: -8px; right: -6px; font-size: .72rem; line-height: 1;
  padding: 2px 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); color: var(--ink-3); }
.myday.editing .myday-item.fav::after { content: "★"; color: var(--fav); border-color: var(--fav); }
.myday.editing .myday-item.fav { border-color: color-mix(in srgb, var(--fav) 55%, var(--line)); }
.myday-groups { gap: 36px 32px; }
.myday-groups .cat-title { margin-bottom: 10px; }
.myday-item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; font-size: .82rem;
  font-weight: 650; border: 1px solid var(--line); white-space: nowrap; }
.myday-item:hover { text-decoration: none; border-color: var(--line-2); }
.myday-item .tile { width: 24px; height: 24px; border-radius: 999px; }
.myday-item.done { background: var(--card-2); }
.myday-item.open { color: var(--ink-3); border-style: dashed; }
.myday-item.open .tile { filter: grayscale(1); opacity: .55; }
.myday-item.open:hover .tile { filter: none; opacity: 1; }
@media (max-width: 640px) { .myday-item.open { padding: 3px; } .myday-item.open span:not(.tile) { display: none; } }

/* Neue Abzeichen, schwer/leicht */
.new-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.new-badges .label { font-weight: 700; color: var(--ink-2); font-size: .9rem; margin-right: 4px; }
.badge-chip { gap: 8px; background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.badge-chip b { font-weight: 700; }
.mood { margin: 0 18px 6px; padding: 6px 10px; border-radius: 10px; font-size: .82rem; font-weight: 650; display: flex;
  justify-content: space-between; gap: 8px; }
.mood span { font-weight: 500; color: var(--ink-3); }
.mood.hard { background: var(--bad-soft); }
.mood.easy { background: var(--good-soft); }

/* Abzeichen im Profil */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.badge-tile { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--card-2);
  border: 1px solid var(--line); min-width: 0; }
.badge-tile.earned { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, var(--card)), var(--card));
  border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.badge-tile .b-icon { font-size: 1.8rem; line-height: 1; width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.badge-tile.locked .b-icon { filter: grayscale(1); opacity: .5; font-size: 1.2rem; }
.badge-tile .b-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .82rem; color: var(--ink-2); }
.badge-tile .b-main b { color: var(--ink); font-size: .95rem; }
.badge-tile.locked .b-main b { color: var(--ink-2); }
.badge-tile .b-date { font-size: .74rem; color: var(--ink-3); font-weight: 600; }
.b-progress { height: 5px; border-radius: 999px; background: var(--card-3); overflow: hidden; margin-top: 4px; }
.b-progress i { display: block; height: 100%; background: var(--ink-3); border-radius: 999px; }

/* Fehlerseite */
.error-page { text-align: center; padding: 40px 16px; max-width: 560px; margin: 0 auto; }
.error-page h1 { margin-top: 18px; }
.error-grid { text-align: left; font-size: 1rem; }
.big-icon { font-size: 3.5rem; }

/* Kleinkram */
kbd { font: inherit; font-size: .7rem; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--page) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--page) 35%, transparent); opacity: .8; }
@media (max-width: 640px) { kbd { display: none; } }
.foot .quote { font-style: italic; }
.flash.party { background: linear-gradient(100deg, var(--gold-soft), var(--good-soft)); font-weight: 650; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }
.rain { position: fixed; top: -60px; width: 44px; height: 44px; object-fit: contain; pointer-events: none; z-index: 100;
  background: #fffdf8; border-radius: 12px; padding: 6px; box-shadow: var(--shadow); animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(calc(100vh + 120px)) rotate(var(--spin)); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 101; background: var(--ink); color: var(--page);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lift); max-width: calc(100vw - 32px);
  text-align: center; transition: opacity .5s, transform .5s; animation: pop .25s ease-out; }
.toast.out { opacity: 0; transform: translate(-50%, 10px); }
.logo.spin { animation: logo-spin .9s cubic-bezier(.5, -0.4, .3, 1.4); }
@keyframes logo-spin { from { transform: rotate(-8deg); } to { transform: rotate(352deg); } }

/* Spiele ohne Teilen-Knopf */
.manual-entry { display: flex; flex-direction: column; gap: 10px; }
.manual-entry .pg-head { gap: 10px; }
.manual-entry .soft { font-size: .88rem; }
.manual-entry .emoji-grid { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82rem;
  white-space: pre-wrap; overflow-wrap: anywhere; width: 100%; }

/* Stufen (Pips) */
.level-kpis { display: grid; grid-template-columns: 1fr 1.3fr .7fr; gap: 8px; margin-bottom: 12px; }
.level-kpis div { background: var(--card-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.level-kpis .label { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 650; }
.level-kpis b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.level-kpis .sub { display: block; font-size: .74rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }
.level-players li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; }
.level-players b { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Profil */
.profile { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; flex-wrap: wrap; }
.profile h1 { margin-bottom: 4px; }
.pg-card { display: flex; flex-direction: column; gap: 12px; position: relative; }
.pg-card::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--g); }
.pg-head { display: flex; align-items: center; gap: 12px; }
.pg-head h3 a:hover { text-decoration: none; }
.pg-big { margin-left: auto; text-align: right; }
.pg-big b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pg-big span { font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.pg-facts { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-3); }
.pg-facts b { color: var(--ink); }
.spark { width: 100%; height: 38px; display: block; overflow: visible; }
.spark .l { fill: none; stroke: var(--g, var(--s1)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .a { fill: var(--g, var(--s1)); opacity: .12; }
.spark circle { fill: var(--g, var(--s1)); stroke: var(--card); stroke-width: 2; }

.heatmap-wrap { overflow-x: auto; }
.heatmap { display: inline-flex; gap: 4px; padding: 20px 2px 4px 28px; position: relative; }
.hm-col { display: flex; flex-direction: column; gap: 4px; position: relative; }
.hm-month { position: absolute; top: -19px; left: 0; font-size: .72rem; color: var(--ink-3); white-space: nowrap; }
.hm-days { position: absolute; left: 0; top: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .66rem; color: var(--ink-3); }
.hm-days span { height: 14px; line-height: 14px; }
.hm { width: 14px; height: 14px; border-radius: 4px; background: var(--h0); display: block; }
.hm:hover { outline: 2px solid var(--ink); outline-offset: 1px; text-decoration: none; }
.hm.l1 { background: var(--h1); } .hm.l2 { background: var(--h2); } .hm.l3 { background: var(--h3); } .hm.l4 { background: var(--h4); }
.hm.future { visibility: hidden; }
.hm-legend { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--ink-3); justify-content: flex-end; margin-top: 10px; }
.hm-legend .hm { width: 11px; height: 11px; border-radius: 3px; }
.hm-legend .hm:hover { outline: 0; }

.duel { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 9px 0; }
.duel + .duel { border-top: 1px solid var(--line); }
.duel-bar { display: flex; gap: 2px; height: 12px; }
.duel-bar i { display: block; height: 100%; }
.duel-bar i:first-child { border-radius: 4px 0 0 4px; } .duel-bar i:last-child { border-radius: 0 4px 4px 0; }
.duel-bar i:only-child { border-radius: 4px; }
.duel-bar .w { background: var(--s1); } .duel-bar .d { background: var(--viz-base); } .duel-bar .l { background: var(--s2); }
.duel .score { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .88rem; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); }
.legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.timeline { display: flex; flex-direction: column; }
.tl-day { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 0; }
.tl-day + .tl-day { border-top: 1px solid var(--line); }
.tl-date { font-weight: 700; padding-top: 4px; }
.tl-date span { display: block; font-size: .76rem; color: var(--ink-3); font-weight: 600; }
.tl-items { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-item { position: relative; }
.tl-item > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 3px;
  border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: .86rem; font-weight: 700; white-space: nowrap; }
.tl-item > summary::-webkit-details-marker { display: none; }
.tl-item > summary .tile { width: 26px; height: 26px; font-size: .82rem; border-radius: 999px; }
.tl-item.win > summary { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: var(--gold-soft); }
.tl-item.fail > summary { color: var(--bad); }
.tl-pop { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lift); padding: 10px; min-width: 200px; }
.tl-pop .tl-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: .8rem; color: var(--ink-3); gap: 12px; }
.tl-pts { font-weight: 800; padding-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .tl-day { grid-template-columns: 1fr auto; } .tl-items { grid-column: 1 / -1; grid-row: 2; }
  .tl-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; z-index: 40; }
}

/* Spieler-Übersicht */
.player-card { display: flex; flex-direction: column; gap: 14px; }
.pc-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pc-head h3 a:hover { text-decoration: none; }
.pc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; background: var(--card-2); border-radius: 12px; padding: 10px 4px; }
.pc-kpis b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.pc-kpis span { font-size: .7rem; color: var(--ink-3); font-weight: 600; }

/* Tabellen (nur noch, wo sie Sinn ergeben) */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th.sorted-asc::after { content: " ↑"; } .table th.sorted-desc::after { content: " ↓"; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.strong { font-weight: 750; }
.table tbody tr:hover td { background: var(--card-2); }

/* ------------------------------------------------------------------ Charts (app.js) */
.viz { position: relative; width: 100%; }
.viz-svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-val { fill: var(--ink-2); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.viz-end { fill: var(--ink); font-size: 12px; font-weight: 650; }
.viz-end-sub { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viz-area { opacity: .1; }
.viz-dot { stroke: var(--card); stroke-width: 2; }
.viz-cross { stroke: var(--ink-3); stroke-width: 1; }
.viz-bar { transition: opacity .1s; }
.viz-bar.hover { opacity: .7; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: .84rem; color: var(--ink-2); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.viz-tip { position: absolute; z-index: 50; pointer-events: none; display: none; background: var(--card); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 9px 12px; font-size: .84rem; min-width: 140px; }
.viz-tip-title { color: var(--ink-3); font-size: .78rem; font-weight: 600; margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.viz-tip-row i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; flex: none; }
.viz-tip-row b { font-variant-numeric: tabular-nums; }
.viz-tip-row span { color: var(--ink-2); }
.viz-table { margin-top: 8px; font-size: .8rem; }
.viz-table summary { cursor: pointer; color: var(--ink-3); width: max-content; }
.viz-table .scroll { max-height: 260px; overflow: auto; margin-top: 8px; }
.viz-table th, .viz-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.viz-table th:first-child, .viz-table td:first-child { text-align: left; }

/* ------------------------------------------------------------------ Formulare */
input, textarea, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
input[type=date] { width: auto; }
label { display: block; font-weight: 600; font-size: .92rem; }
label input { margin-top: 6px; font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.auth { max-width: 420px; margin: 24px auto; }
.auth h1 { font-size: 2rem; margin-bottom: 6px; }
.auth .intro { color: var(--ink-2); margin-bottom: 22px; }
.auth .alt { margin-top: 18px; color: var(--ink-3); font-size: .92rem; text-align: center; }
.auth .alt a { color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

.paste textarea { min-height: 220px; resize: vertical; font-size: 1rem; padding: 18px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); border: 1.5px solid var(--line-2); }
.form-row { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-top: 14px; }
.form-row .grow { flex: 1; }
.form-row label { font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.form-row label input[type=date] { margin: 0; padding: 7px 10px; }
.preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; margin-top: 20px; }
.preview-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; animation: pop .18s ease-out; min-width: 0; }
.preview-item.error { background: var(--bad-soft); }
.preview-item .p-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.preview-item .p-head .tile { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 10px; }
.preview-item .p-head .muted { margin-left: auto; font-weight: 600; font-size: .85rem; }
.preview-item .p-score { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.preview-item .p-score span { font-size: .9rem; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
.preview-item .p-meta { font-size: .84rem; color: var(--ink-2); }
.preview-item .p-warn { font-size: .84rem; padding: 6px 10px; border-radius: 10px; background: var(--warn-soft); }
.preview-item .p-merge { font-size: .84rem; padding: 6px 10px; border-radius: 10px; background: var(--good-soft); }
@keyframes pop { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }

.rules { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; }
.rules li p { color: var(--ink-2); font-size: .9rem; margin-top: 2px; }
.prose { max-width: 720px; color: var(--ink-2); }
.prose p + p { margin-top: 10px; }

@media (max-width: 640px) {
  .top-inner { flex-wrap: wrap; gap: 6px 12px; padding-top: 10px; padding-bottom: 8px; min-height: 0; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 12px; }
  .me { margin-left: auto; }
  .me .lbl { display: none; }
  main.wrap { padding-top: 20px; }
  .card { padding: 16px; }
  .hbar { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) auto; gap: 8px; }
  .duel { grid-template-columns: minmax(0, 1fr) auto; }
  .duel .duel-bar { grid-column: 1 / -1; grid-row: 2; }
}
