/* Optik angelehnt an craftattack.hiorcraft.tv: Pixel-Ränder, harte Schatten, kräftige Minecraft-Farben */

:root {
  --ink: #16120f;
  --paper: #fff6e0;
  --white: #ffffff;
  --muted: #5d544b;
  --grass: #6fdc5a;
  --diamond: #4be3d6;
  --gold: #ffd23f;
  --redstone: #ff6452;
  --amethyst: #c88ae6;
  --pink: #f0b6e4;
  --lava: #ff9a2e;
  --sky: #8ccdff;
  --ender: #2d1c36;
  --on-tone: #16120f;
  --line: #16120f;
  --px: 4px;
  --outline: 0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line), calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line);
  --drop: var(--px) calc(var(--px) * 2) 0 0 var(--line), calc(var(--px) * 2) var(--px) 0 0 var(--line), calc(var(--px) * 2) calc(var(--px) * 2) 0 0 var(--line);
  --font-display: "Monocraft", "Silkscreen", ui-monospace, "Courier New", monospace;
  --font-body: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #f2e9d8; --paper: #1b1714; --white: #27221e; --muted: #b3a998; color-scheme: dark; }
}
:root[data-theme="dark"] { --ink: #f2e9d8; --paper: #1b1714; --white: #27221e; --muted: #b3a998; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
img.head, img.body { image-rendering: pixelated; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.ico { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em; }

/* Kopfzeile */
.top { background: var(--ender); color: #fff6e0; position: sticky; top: 0; z-index: 10; }
.top-row { padding-top: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); }
.brand-mark { display: block; width: 40px; height: 40px; image-rendering: pixelated; box-shadow: 0 3px 0 #4f1a6d; }
.brand-name { font-size: 18px; letter-spacing: 0.02em; }
.badge { background: var(--gold); color: #16120f; font-size: 11px; padding: 1px 6px; text-transform: uppercase; box-shadow: 0 0 0 2px #16120f; }
/* Version der Season in Herbstfarbe, passend zu den Pappeln aus 26.3 */
.badge.ver { background: #e2672b; color: #fff6e0; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 10px; padding-bottom: 10px; align-items: center; }
.nav a { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; text-decoration: none; padding: 6px 8px; }
.nav a:hover { background: rgba(255, 255, 255, 0.12); }
.nav a.on { background: #fff6e0; color: #16120f; }
.theme { margin-left: auto; background: transparent; color: #fff6e0; border: 2px solid #fff6e0; width: 34px; height: 30px; cursor: pointer; font-size: 16px; }

/* Hero */
.hero { background: var(--tone); color: #16120f; padding: clamp(36px, 7vw, 80px) 0; }
.eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 14px; margin: 0 0 8px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(24px, 7vw, 72px); line-height: 1; margin: 0 0 18px; text-transform: uppercase; overflow-wrap: anywhere; }
.lead { max-width: 640px; font-size: 18px; margin: 0 0 12px; }
.status { font-family: var(--font-display); font-size: 14px; margin: 14px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status.err { color: #8a1206; margin-top: 4px; }
.sq { width: 12px; height: 12px; background: #9b938a; box-shadow: 0 0 0 2px #16120f; display: inline-block; }
.sq.on { background: var(--grass); }
.sq.off { background: var(--redstone); }

/* Kacheln */
.band { background: #16120f; padding: 32px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px; }
.tile { background: var(--tone); color: #16120f; padding: 14px; box-shadow: var(--outline); }
.tile span { display: block; font-family: var(--font-display); text-transform: uppercase; font-size: 13px; }
.tile b { display: block; font-family: var(--font-display); font-size: clamp(20px, 3vw, 28px); line-height: 1.2; margin-top: 6px; }

/* Karten */
.card { background: var(--white); box-shadow: var(--outline), var(--drop); margin: var(--px) calc(var(--px) * 3) calc(var(--px) * 3) var(--px); }
.sec { font-family: var(--font-display); text-transform: uppercase; font-size: 20px; margin: 40px 0 16px; display: flex; align-items: baseline; gap: 12px; }
.more { font-size: 13px; }
.empty { color: var(--muted); font-style: italic; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 36px; padding-bottom: 60px; }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); gap: 0; } }

.plink { font-weight: 700; text-decoration: none; }
.plink:hover { text-decoration: underline; }


.head { width: var(--s); height: var(--s); flex: none; box-shadow: 0 0 0 2px var(--line); background: #9b938a; }
.head-empty { display: inline-block; }
.dot { display: inline-block; width: 10px; height: 10px; background: var(--grass); box-shadow: 0 0 0 2px var(--line); margin-left: 8px; vertical-align: 1px; }

/* Ereignis-Liste */
.erows { list-style: none; margin: 0 0 40px; padding: 8px 0; }
.erow { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 2px dashed color-mix(in srgb, var(--ink) 15%, transparent); }
.erow:last-child { border-bottom: 0; }
.erow-time { font-family: var(--font-display); font-size: 13px; width: 44px; flex: none; }
.erow-txt { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.chip-ico { width: 24px; height: 24px; flex: none; display: inline-grid; place-items: center; background: var(--tone); color: #16120f; box-shadow: 0 0 0 2px var(--line); font-size: 14px; }

/* Filter */
.filters { padding-top: 28px; display: grid; gap: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; text-decoration: none; padding: 6px 10px; background: var(--tone, var(--white)); color: var(--on-tone); box-shadow: var(--outline); margin: 4px; cursor: pointer; border: 0; }
.pill:not([style]) { background: var(--white); color: var(--ink); }
.pill.on { background: var(--ink); color: var(--paper); }
.pill small { font-size: 11px; opacity: 0.75; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flabel { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; width: 90px; }
select { font: inherit; padding: 6px 10px; background: var(--white); color: var(--ink); border: 0; box-shadow: var(--outline); margin: 4px; max-width: 100%; }
.hits { font-family: var(--font-display); font-size: 13px; color: var(--muted); margin: 0; }

/* Chronik */
.chron { padding-bottom: 30px; }
.dayhead { font-family: var(--font-display); text-transform: uppercase; font-size: 18px; margin: 30px 0 10px; }
.minute { display: flex; gap: 14px; padding: 8px 0; border-bottom: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent); }
.minute-t { font-family: var(--font-display); font-size: 14px; width: 46px; flex: none; padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--white); text-decoration: none; box-shadow: var(--outline); border-left: 6px solid var(--tone); margin: 4px; max-width: 100%; }
.chip:hover { transform: translate(-1px, -1px); box-shadow: var(--outline), 3px 3px 0 0 var(--line); }
.chip b { font-family: var(--font-display); font-size: 14px; white-space: nowrap; }
.chip-txt { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: 12px; padding-bottom: 60px; }

/* Bestenliste */
.board { background: var(--tone); color: #16120f; padding: 18px; margin-top: 24px; margin-bottom: 60px; max-width: 760px; }
.board-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.board-ico { width: 44px; height: 44px; display: grid; place-items: center; background: #16120f; color: var(--tone); font-size: 24px; flex: none; }
.board-head h2 { font-family: var(--font-display); margin: 0; font-size: 22px; }
.board-head p { margin: 0; font-size: 14px; }
.board-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.board-list li { display: grid; grid-template-columns: 34px 28px minmax(0, 1fr) auto auto 42px; gap: 10px; align-items: center; padding: 4px 0; }
.rank { background: #16120f; color: var(--tone); font-family: var(--font-display); text-align: center; padding: 3px 0; font-size: 14px; }
.bname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bname .plink { color: #16120f; }
.bname .dot { box-shadow: 0 0 0 2px #16120f; }
.bdelta { font-size: 12px; font-family: var(--font-display); opacity: 0.7; text-align: right; }
.bval { font-family: var(--font-display); font-size: 16px; text-align: right; white-space: nowrap; }
.chg { font-family: var(--font-display); font-size: 12px; text-align: right; }
.chg.up { color: #0b6b0b; }
.chg.down { color: #a01a0a; }
.chg.new { text-transform: uppercase; font-size: 10px; }
/* Handy: Name bekommt die ganze Zeile, Wert und Änderung stehen darunter */
@media (max-width: 560px) {
  .board-list li { grid-template-columns: 30px 28px minmax(0, 1fr) auto; row-gap: 1px; }
  .board-list li > .rank, .board-list li > .head { grid-row: 1 / span 2; }
  .board-list .bname { grid-column: 3 / 5; grid-row: 1; }
  .board-list .bval { grid-column: 3; grid-row: 2; text-align: left; font-size: 15px; }
  .board-list .chg { grid-column: 4; grid-row: 2; }
  .bdelta { display: none; }
}

/* Spieler */
/* Spieler: 3 pro Reihe, eine unvollständige letzte Reihe steht mittig (5 Spieler = 3 + 2, 6 = 3 + 3) */
.pgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; padding-top: 32px; padding-bottom: 60px; }
.pgrid > .pcard { grid-column: span 2; }
.pgrid > .pcard:nth-child(3n + 1):nth-last-child(2) { grid-column: 2 / span 2; }
.pgrid > .pcard:nth-child(3n + 1):last-child { grid-column: 3 / span 2; }
.pgrid > .empty { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pgrid > .pcard:nth-child(3n + 1):nth-last-child(2), .pgrid > .pcard:nth-child(3n + 1):last-child { grid-column: span 2; }
  .pgrid > .pcard:nth-child(2n + 1):last-child { grid-column: 2 / span 2; }
}
@media (max-width: 560px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .pgrid > .pcard:nth-child(n):nth-last-child(n) { grid-column: auto; }
}
.pcard { display: flex; gap: 14px; padding: 14px; text-decoration: none; align-items: flex-start; }
.pcard h3 { margin: 0; font-family: var(--font-display); font-size: 17px; overflow-wrap: anywhere; }
.pcard p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

.phero { display: flex; gap: clamp(20px, 5vw, 50px); align-items: center; flex-wrap: wrap; }
.phero .body { width: 120px; height: auto; filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.25)); }
.phero h1 { font-size: clamp(24px, 6.5vw, 64px); }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; padding-top: 32px; }
.stat { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 12px 14px; text-decoration: none; border-top: 8px solid var(--tone); }
.stat-ico { grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; background: var(--tone); color: #16120f; font-size: 20px; box-shadow: 0 0 0 2px var(--line); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat b { font-family: var(--font-display); font-size: 20px; }
.stat small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tables { display: grid; gap: 6px; padding-top: 30px; }
/* Spielerseite: Tabellen unter der Aktivität, 2 und 3 nebeneinander */
.ptables { display: grid; gap: 18px; align-items: start; margin-top: 26px; }
.ptables-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ptables-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .ptables-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .ptables-2, .ptables-3 { grid-template-columns: minmax(0, 1fr); } }
.pevents { padding-bottom: 60px; }
.ttable { padding: 12px 16px; }
.ttable h3 { font-family: var(--font-display); font-size: 15px; margin: 0 0 8px; text-transform: uppercase; }
.ttable ol { margin: 0; padding-left: 22px; display: grid; gap: 2px; font-size: 14px; }
.ttable li span { display: inline-block; min-width: 70%; }
.ttable li b { font-family: var(--font-display); font-size: 13px; float: right; }

.foot { font-size: 13px; color: var(--muted); padding-top: 20px; padding-bottom: 30px; border-top: 2px dashed color-mix(in srgb, var(--ink) 20%, transparent); }
.chip-name { font-weight: 700; }
@media (max-width: 600px) {
  .top { position: static; }
  .nav a { font-size: 12px; padding: 6px 6px; }
}

/* ---------- Diagrammfarben (geprüft auf Farbschwäche, hell und dunkel getrennt) ---------- */
:root { --s1: #2f7fd1; --s2: #d9770f; --s3: #0f9e94; --s4: #d6402f; --s5: #8e44ad; --s6: #3c9a2b; --grid: rgba(22, 18, 15, 0.1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --s1: #4d8fd6; --s2: #c97624; --s3: #22a89d; --s4: #e05a48; --s5: #a56fcf; --s6: #4fab3c; --grid: rgba(242, 233, 216, 0.12); }
}
:root[data-theme="dark"] { --s1: #4d8fd6; --s2: #c97624; --s3: #22a89d; --s4: #e05a48; --s5: #a56fcf; --s6: #4fab3c; --grid: rgba(242, 233, 216, 0.12); }

.card-title { font-family: var(--font-display); font-size: 18px; margin: 0; }
.card-sub { font-size: 13px; color: var(--muted); margin: 2px 0 14px; }
button.pill { font-family: var(--font-display); }
.pill[disabled] { opacity: 0.4; cursor: not-allowed; }
.tag { font-family: var(--font-display); font-size: 13px; background: var(--tone); color: #16120f; padding: 3px 8px; box-shadow: 0 0 0 2px var(--line); white-space: nowrap; }

/* Zeitstrahl */
.tl-head { padding-top: 10px; }
.tl-sum { margin: 0 0 12px; color: var(--muted); }
.tl-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
input[type="date"] { font: inherit; font-family: var(--font-display); font-size: 13px; padding: 6px 8px; background: var(--white); color: var(--ink); border: 0; box-shadow: var(--outline); margin: 4px; }
.raffer, .gantt { padding: 16px 18px 18px; margin-bottom: 26px; }
.raffer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.raffer-time { font-family: var(--font-display); font-size: 26px; min-width: 90px; }
.raffer-ctrl { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.raffer-ctrl .pill { background: var(--gold); color: #16120f; }
.raffer-range { display: block; accent-color: var(--ink); margin: 6px 0 0; min-width: 2%; }
.axis-wrap { position: relative; height: 18px; }
.axis { position: absolute; inset: 0; }
.axis span { position: absolute; transform: translateX(-50%); font-family: var(--font-display); font-size: 11px; color: var(--muted); }
.axis span:first-child { transform: none; }
.axis span:last-child:not(:first-child) { transform: translateX(-100%); }
/* Zeitraffer von oben auf der Kartenseite */
.tl2d .raffer-bar .seg { margin: 0; }
.tl2d .seg .pill[data-step] { min-width: 34px; }
.tl2d-stage { position: relative; aspect-ratio: 16 / 10; max-height: 78vh; width: 100%; background: #23201c; box-shadow: var(--outline); overflow: hidden; }
.tl2d-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.tl2d-stage canvas:active { cursor: grabbing; }
.tl2d-pos { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 12px; text-shadow: 0 1px 2px #000; pointer-events: none; }
.tl2d .raffer-range { width: 100%; margin-top: 12px; }

/* 3D-Zeitraffer auf der Kartenseite */
.tl3d .raffer-bar .seg { margin: 0; }
.tl3d-stage { display: block; position: relative; aspect-ratio: 16 / 9; background: #7dabff; box-shadow: var(--outline); overflow: hidden; }
.tl3d-stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tl3d .raffer-range { width: 100%; margin-top: 12px; }
.raffer-heads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.rhead { display: grid; justify-items: center; gap: 2px; text-decoration: none; width: 64px; opacity: 0.3; filter: grayscale(1); transition: opacity 0.15s, filter 0.15s; }
.rhead small { font-size: 11px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rhead.on { opacity: 1; filter: none; }
.rhead.on .head { box-shadow: 0 0 0 3px var(--grass), 0 0 0 5px var(--line); }

.grow { display: grid; grid-template-columns: 150px minmax(0, 1fr) 110px; gap: 12px; align-items: center; padding: 5px 0; }
.gaxis { padding-bottom: 0; }
.gname { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 14px; min-width: 0; }
.gname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtrack { position: relative; height: 18px; margin-top: 6px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.gline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.gseg { position: absolute; top: 2px; bottom: 2px; background: var(--grass); box-shadow: 0 0 0 1px var(--line); min-width: 2px; }
.gseg:hover { filter: brightness(1.1); outline: 2px solid var(--ink); }
.gseg.open { background: repeating-linear-gradient(135deg, var(--grass) 0 6px, color-mix(in srgb, var(--grass) 70%, #fff) 6px 9px); }
.gdeath { position: absolute; top: -9px; transform: translateX(-50%); width: 13px; height: 13px; z-index: 1; display: grid; place-items: center; background: var(--redstone); color: #16120f; font-size: 10px; box-shadow: 0 0 0 2px var(--line); }
.gplay { position: absolute; top: -5px; bottom: -5px; width: 3px; transform: translateX(-1px); background: var(--gold); box-shadow: 0 0 0 1px var(--line); z-index: 2; pointer-events: none; }
.gnow { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.gsum { font-family: var(--font-display); font-size: 13px; text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .grow { grid-template-columns: 90px minmax(0, 1fr); }
  .grow .gsum { display: none; }
  .gname .head { display: none; }
}

/* Statistik */
.ztiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.ztiles .tile { box-shadow: var(--outline), var(--drop); margin: 4px 12px 12px 4px; }
.ztiles .tile b { margin: 0 0 4px; }
.gb { padding: 16px 18px; }
.gb-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: start; padding: 4px 0; }
.gb-row .flabel { padding-top: 10px; width: auto; }
.gb-row .pills { gap: 6px; }
.gb-hint { margin: 0 0 6px 118px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .gb-row { grid-template-columns: minmax(0, 1fr); }
  .gb-hint { margin-left: 0; }
}
.chart-card { padding: 16px 18px; margin-top: 16px; }
.chart { min-height: 120px; }
.chart.loading { opacity: 0.5; }
.chart-block { margin-top: 14px; }
.chart-block h4 { font-family: var(--font-display); font-size: 14px; margin: 0 0 6px; text-transform: uppercase; }
.plot { position: relative; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot .grid { stroke: var(--grid); stroke-width: 1; }
.plot .base { stroke: var(--ink); stroke-width: 1; opacity: 0.5; }
.plot .tick { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .guide { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.plot .dot { stroke: var(--white); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--white); color: var(--ink); box-shadow: var(--outline), var(--drop); padding: 8px 10px; font-size: 13px; display: grid; gap: 3px; min-width: 160px; z-index: 2; }
.tip[hidden] { display: none; }
.tip b { font-family: var(--font-display); font-size: 12px; }
.tip span { display: flex; align-items: center; gap: 6px; }
.tip em { font-style: normal; font-weight: 700; margin-left: auto; padding-left: 12px; }
.tip i, .lg i { width: 10px; height: 10px; display: inline-block; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13px; }
.legend:empty { display: none; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-table { margin-top: 14px; font-size: 13px; }
.chart-table summary { cursor: pointer; font-family: var(--font-display); font-size: 12px; text-transform: uppercase; }
.tbl-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th { font-family: var(--font-display); font-size: 11px; text-transform: uppercase; text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: var(--white); }
.tbl td { padding: 6px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card.tbl-wrap { padding: 4px 6px; }
/* Tag für Tag (Statistik): letzte 14 Tage, passt ohne Scrollen in die Spalte */
.card.days-tbl { padding: 4px 6px; }
.days-tbl .tbl th, .days-tbl .tbl td { padding-left: 8px; padding-right: 8px; }
.days-tbl .tbl th:not(:first-child), .days-tbl .tbl td:not(:first-child) { text-align: right; }
.hours { padding: 14px 18px; }
.hbars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 140px; align-items: end; }
.hbar { height: 100%; display: flex; align-items: flex-end; }
.hbar i { display: block; width: 100%; background: var(--s1); border-radius: 3px 3px 0 0; min-height: 1px; }
.hbar:hover i { filter: brightness(1.15); }
.rank-list { list-style: none; padding: 8px 14px; margin: 0 12px 12px 4px; counter-reset: r; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 2px dashed var(--grid); counter-increment: r; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li::before { content: counter(r); font-family: var(--font-display); font-size: 12px; width: 18px; color: var(--muted); }
.rank-list li.empty::before { content: none; }
.rank-list li > span { flex: 1; min-width: 0; display: grid; }
.rank-list small { color: var(--muted); font-size: 12px; }
.rank-list b { font-family: var(--font-display); font-size: 13px; white-space: nowrap; }

/* Karte */
.map-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 14px; }
.map-title { font-family: var(--font-display); font-size: clamp(28px, 5vw, 48px); line-height: 1; margin: 0; text-transform: uppercase; }
.map-head .eyebrow { margin-bottom: 4px; }
.map-info { margin: 0; font-size: 13px; color: var(--muted); text-align: right; }
.map-info .err { color: var(--redstone); }
.empty-map { min-height: 420px; display: grid; place-items: center; padding: 24px; text-align: center; }
@media (max-width: 860px) {
  .map-info { text-align: left; }
}

/* ---------- Überarbeitung nach Vorbild des Originals ---------- */
:root { --ink-tile: #16120f; }

/* Kopfzeile: eine Leiste, fette Schrift, Schatten */
.top { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28); }
.top-row { display: flex; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand-name { font-weight: 700; }
.nav { padding: 0; margin-left: auto; gap: 2px; }
.nav a { font-weight: 700; font-size: 12px; padding: 7px 8px; letter-spacing: 0.02em; }
.nav a.on { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.theme { margin-left: 8px; }
@media (max-width: 900px) {
  .nav { margin-left: 0; width: 100%; }
}

/* Bestenlisten-Karten auf der Übersicht */
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.sec-row .sec { margin: 0; }
.sec-row .pill { background: var(--white); color: var(--ink); }
.bcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.bcard { display: block; background: var(--tone); color: #16120f; text-decoration: none; padding: 16px 18px 18px; box-shadow: var(--outline), var(--drop); margin: 4px 12px 12px 4px; }
.bcard.dark { background: #2d1c36; color: #fff6e0; }
.bcard-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bcard-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: #16120f; color: var(--tone); font-size: 22px; }
.bcard.dark .bcard-ico { background: #fff6e0; color: #2d1c36; }
.bcard h3 { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 0; }
.bcard-head p { margin: 0; font-size: 13px; font-weight: 600; opacity: 0.75; }
.bcard ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bcard li { display: grid; grid-template-columns: 28px 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bcard .rank { background: #16120f; color: var(--tone); font-family: var(--font-display); font-weight: 700; font-size: 13px; text-align: center; padding: 4px 0; }
.bcard.dark .rank { background: #16120f; color: #fff6e0; }
.bcard .bname { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard li b { font-family: var(--font-display); font-weight: 700; font-size: 14px; white-space: nowrap; }
.bcard .empty { color: inherit; opacity: 0.7; }
.bcard:hover { transform: translate(-1px, -1px); }

/* Ereignisse: Kategorien als Kacheln */
.ktiles { display: flex; flex-wrap: wrap; gap: 12px; }
.ktile { display: grid; min-width: 112px; padding: 10px 14px 9px; background: var(--tone); color: #16120f; text-decoration: none; box-shadow: var(--outline); margin: 4px; }
.ktile b { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.ktile span { font-family: var(--font-display); font-weight: 700; font-size: 11px; text-transform: uppercase; }
.ktile[style*="ink-tile"] { color: #fff6e0; }
.ktile.on { box-shadow: var(--outline), var(--drop); transform: translate(-2px, -2px); }
.ktiles:has(.ktile.on) .ktile:not(.on) { opacity: 0.8; }
.pill { font-weight: 700; }
.pill.go { background: var(--ink); color: var(--paper); }
select { font-weight: 600; }

/* Segmentierte Schalterleisten (Zeitraum, Raster, Anzeige) */
.seg { display: inline-flex; flex-wrap: wrap; box-shadow: var(--outline); background: var(--white); margin: 4px; }
.seg .pill { box-shadow: none; margin: 0; border-right: 2px solid var(--line); }
.seg .pill:last-child { border-right: 0; }
.seg .pill.on { background: var(--ink); color: var(--paper); }

/* Kennzahl- und Spieler-Knöpfe mit Symbol und Haken */
.gb-groups { display: grid; gap: 6px; }
.gb-group { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; align-items: start; }
.gb-sub { font-family: var(--font-display); font-size: 10px; text-transform: uppercase; color: var(--muted); padding-top: 12px; }
.gb-groups .gb-hint { margin: 2px 0 0 68px; }
.mbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.mbtn { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 700; font-size: 12px; text-transform: uppercase; padding: 5px 9px 5px 5px; background: var(--white); color: var(--ink); border: 0; box-shadow: var(--outline); margin: 4px; cursor: pointer; }
.mbtn-ico { width: 22px; height: 22px; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--line); font-size: 12px; }
.mbtn .tick { display: none; }
.mbtn.on { background: var(--grass); color: #16120f; }
.mbtn.on .tick { display: inline; }
.mbtn .head { box-shadow: 0 0 0 2px var(--line); }
.mbtn:not([data-k=""]) { padding-left: 5px; }
@media (max-width: 640px) {
  .gb-group { grid-template-columns: minmax(0, 1fr); }
  .gb-groups .gb-hint { margin-left: 0; }
}

/* Hover-Karte und Spielerkarten */
.hovercard { position: absolute; z-index: 50; width: 260px; background: var(--white); color: var(--ink); padding: 12px 14px; box-shadow: var(--outline), var(--drop); pointer-events: none; }
.hovercard[hidden] { display: none; }
.hc-ev { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px dashed var(--grid); font-size: 13px; font-weight: 600; }
.hc-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 2px solid var(--line); }
.hc-head b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.hc-badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-display); font-weight: 700; font-size: 10px; text-transform: uppercase; padding: 2px 6px; background: color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: 0 0 0 2px var(--line); }
.hc-badge i { width: 8px; height: 8px; background: #9b938a; box-shadow: 0 0 0 1px var(--line); }
.hc-badge.on { background: var(--grass); color: #16120f; }
.hc-badge.on i { background: #fff; }
.hovercard dl, .pcard dl { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin: 0; font-size: 14px; }
.hovercard dt, .pcard dt { color: var(--muted); font-weight: 600; }
.hovercard dd, .pcard dd { margin: 0; text-align: right; font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.pcard { display: block; padding: 14px 16px; }
.pcard .hc-head { margin-bottom: 10px; }

/* Kacheln: festes Raster, gleich breit, Zahl groß oben */
.band { padding: 36px 0 40px; }
.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 26px; }
.tiles .tile, .ztiles .tile { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 92px; padding: 14px 16px; box-shadow: var(--outline), var(--drop); margin: 4px 12px 12px 4px; }
.tiles .tile b, .ztiles .tile b { margin: 0; font-weight: 700; font-size: clamp(20px, 2.6vw, 30px); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles .tile span, .ztiles .tile span { font-weight: 700; font-size: 12px; }
@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
}

/* Karte breit statt hochkant, Spielerleiste in der Karte, Kinomodus */
.map-side { display: grid; justify-items: end; gap: 8px; }
.mapwrap { display: block; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) 40px; }
.mapbox { position: relative; box-shadow: var(--outline), var(--drop); margin: 4px 12px 12px 4px; background: #000; }
.mapframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: calc(100vh - 170px); min-height: 360px; border: 0; }
.whobar { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 230px); margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.whobar li { pointer-events: auto; }
.whobar button { display: flex; align-items: center; gap: 7px; padding: 4px 9px 4px 4px; background: rgba(22, 18, 15, 0.72); color: #fff6e0; border: 0; font: inherit; cursor: pointer; backdrop-filter: blur(2px); }
.whobar button:hover:not([disabled]) { background: rgba(22, 18, 15, 0.92); }
.whobar button[disabled] { cursor: default; opacity: 0.75; }
.whobar .head { box-shadow: 0 0 0 1px #000; }
.whobar span { display: grid; line-height: 1.15; text-align: left; }
.whobar b { font-size: 13px; }
.whobar small { font-size: 11px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.whobar .empty { background: rgba(22, 18, 15, 0.6); color: #fff6e0; padding: 5px 10px; font-size: 12px; font-style: normal; }
body.kino .mapwrap { max-width: none; padding: 0 12px 24px; }
body.kino .mapbox { margin: 0; }
body.kino .mapframe { aspect-ratio: auto; height: calc(100vh - var(--top-h, 100px)); max-height: none; min-height: 300px; }
body.kino .map-head { display: none; }
body.kino .mapwrap { padding: 0; }
body.kino .mapbox { box-shadow: none; }
body.kino .foot { display: none; }
.kino-btn { position: absolute; right: 58px; bottom: 10px; padding: 6px 10px; background: rgba(22, 18, 15, 0.72); color: #fff6e0; border: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; text-transform: uppercase; cursor: pointer; }
.kino-btn:hover { background: rgba(22, 18, 15, 0.92); }
@media (max-width: 700px) {
  .mapframe { aspect-ratio: 4 / 5; }
  .map-side { justify-items: start; }
  .whobar small { display: none; }
}
.mapwrap { scroll-margin-top: var(--top-h, 100px); }

/* ---------- Hover-Effekte und weiche Übergänge ---------- */
:root {
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --t: 140ms;
  --lift: translate(-2px, -2px);
  --drop-hover: calc(var(--px) * 1.5) calc(var(--px) * 2.5) 0 0 var(--line), calc(var(--px) * 2.5) calc(var(--px) * 1.5) 0 0 var(--line), calc(var(--px) * 2.5) calc(var(--px) * 2.5) 0 0 var(--line);
}
html { scroll-behavior: smooth; }

/* Alles, was sich bewegt oder die Farbe wechselt, gleitet */
a, button, .pill, .mbtn, .chip, .card, .tile, .ktile, .bcard, .pcard, .stat, .head, .nav a, .theme,
.board-list li, .bcard li, .erow, .rank-list li, .tbl tr, .hbar i, .gseg, .whobar button, .kino-btn, select, input[type="date"] {
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t) var(--ease),
    color var(--t) var(--ease), opacity var(--t) var(--ease), filter var(--t) var(--ease);
}

/* Karten: leicht anheben, Schatten wächst mit */
.bcard:hover, .pcard:hover, a.stat:hover {
  transform: var(--lift);
  box-shadow: var(--outline), var(--drop-hover);
}
.bcard:active, .pcard:active, a.stat:active { transform: translate(1px, 1px); box-shadow: var(--outline), var(--drop); }

/* Knöpfe und Filter */
.pill:hover, .mbtn:hover, .ktile:hover, select:hover, input[type="date"]:hover {
  transform: var(--lift);
  box-shadow: var(--outline), 3px 3px 0 0 var(--line);
}
.pill:active, .mbtn:active, .ktile:active { transform: translate(1px, 1px); box-shadow: var(--outline); }
.ktile.on:hover { transform: translate(-3px, -3px); box-shadow: var(--outline), var(--drop-hover); }
.seg .pill:hover { transform: none; box-shadow: none; background: color-mix(in srgb, var(--ink) 10%, var(--white)); }
.seg .pill.on:hover { background: var(--ink); }
.pill[disabled]:hover, .mbtn[disabled]:hover { transform: none; box-shadow: var(--outline); }

/* Ereignis-Chips */
.chip:hover { transform: var(--lift); box-shadow: var(--outline), 3px 3px 0 0 var(--line); }
.chip:active { transform: translate(1px, 1px); box-shadow: var(--outline); }

/* Menü oben */
.nav a:not(.on):hover { background: rgba(255, 246, 224, 0.14); transform: translateY(-1px); }
.theme:hover { background: rgba(255, 246, 224, 0.14); transform: rotate(-12deg); }
.brand:hover .brand-mark { transform: translateY(-2px); box-shadow: 0 5px 0 #4f1a6d; }
.brand-mark { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }

/* Listenzeilen: dezent hinterlegen */
.erow:hover, .rank-list li:hover, .tbl tbody tr:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.board-list li, .bcard li { margin: 0 -6px; padding-left: 6px; padding-right: 6px; }
.board-list li:hover, .bcard li:hover { background: rgba(22, 18, 15, 0.1); }
.bcard.dark li:hover { background: rgba(255, 246, 224, 0.1); }

/* Köpfe in Listen wachsen ein bisschen */
.board-list li:hover .head, .bcard li:hover .head, .rank-list li:hover .head, .erow:hover .head { transform: scale(1.12); }

/* Links */
.plink:hover, .more:hover, .tbl a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Diagramme und Zeitstrahl */
.hbar:hover i { filter: brightness(1.15); transform: scaleY(1.02); transform-origin: bottom; }
.gseg:hover { filter: brightness(1.12); }

/* Kacheln oben: beim Überfahren minimal anheben */
.tiles .tile:hover, .ztiles .tile:hover { transform: var(--lift); box-shadow: var(--outline), var(--drop-hover); }

/* Karte */
.whobar button:hover:not([disabled]) { transform: translateY(-2px); }
.kino-btn:hover { transform: translateY(-2px); }

/* Tastatur: deutlich sichtbarer Fokus */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.nav a:focus-visible, .theme:focus-visible { outline-color: var(--gold); }

/* Inhalt beim Laden sanft einblenden */
@keyframes einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main > section { animation: einblenden 260ms var(--ease) both; }
main > section:nth-of-type(2) { animation-delay: 40ms; }
main > section:nth-of-type(3) { animation-delay: 80ms; }
main > section:nth-of-type(n + 4) { animation-delay: 120ms; }

/* Wer weniger Bewegung möchte, bekommt keine */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bcard:hover, .pcard:hover, a.stat:hover, .pill:hover, .mbtn:hover, .ktile:hover, .chip:hover,
  .tiles .tile:hover, .ztiles .tile:hover, .whobar button:hover, .kino-btn:hover, .nav a:hover, .theme:hover { transform: none; }
}
main.still > section { animation: none; }

/* ---------- Fortschritte ---------- */
.adv-rank { list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: 4px; background: var(--white); box-shadow: var(--outline), var(--drop); margin: 4px 12px 12px 4px; }
.adv-rank li { display: grid; grid-template-columns: 30px 32px minmax(90px, 180px) minmax(0, 1fr) 110px; gap: 12px; align-items: center; padding: 5px 6px; margin: 0 -6px; }
.adv-rank li:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.adv-rank .rank { background: var(--ink); color: var(--paper); font-family: var(--font-display); font-weight: 700; font-size: 13px; text-align: center; padding: 4px 0; }
.adv-rank .plink { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-bar { height: 12px; background: color-mix(in srgb, var(--ink) 10%, transparent); box-shadow: 0 0 0 2px var(--line); overflow: hidden; }
.adv-bar i { display: block; height: 100%; background: var(--amethyst); transition: width 400ms var(--ease); }
.adv-rank b { font-family: var(--font-display); font-weight: 700; font-size: 15px; text-align: right; white-space: nowrap; }
.adv-rank small { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) {
  .adv-rank li { grid-template-columns: 26px 28px minmax(0, 1fr) auto; }
  .adv-bar { display: none; }
}

.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding: 16px 0 50px; }
.adv { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--white); box-shadow: var(--outline), var(--drop); margin: 4px 12px 12px 4px; border-left: 6px solid var(--tone);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t) var(--ease); }
.adv:hover { transform: var(--lift); box-shadow: var(--outline), var(--drop-hover); }
.adv.none { opacity: 0.62; }
.adv.none:hover { opacity: 1; }
.adv-top { display: flex; gap: 10px; align-items: flex-start; }
.adv-top b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.2; }
.adv-top p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.adv-frame { flex: none; width: 26px; height: 26px; background: var(--tone); box-shadow: 0 0 0 2px var(--line); margin-top: 1px; }
.adv-frame.goal { border-radius: 50%; }
.adv-frame.challenge { clip-path: polygon(50% 0, 63% 25%, 100% 25%, 72% 50%, 100% 75%, 63% 75%, 50% 100%, 37% 75%, 0 75%, 28% 50%, 0 25%, 37% 25%); box-shadow: none; }
.adv-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-top: auto; }
.adv-meta { color: var(--muted); }
.adv-count { font-family: var(--font-display); font-weight: 700; }
.adv-heads { display: flex; flex-wrap: wrap; gap: 5px; }
.adv-heads a:hover .head { transform: scale(1.15); }

/* Spielerseite */
.adv-latest { margin: -6px 0 14px; font-size: 14px; color: var(--muted); }
.adv-latest b { color: var(--ink); }
.adv-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; padding-bottom: 10px; }
.adv-cat { padding: 12px 14px; }
.adv-cat h3 { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin: 0 0 10px; display: flex; justify-content: space-between; }
.adv-cat h3 small { color: var(--muted); font-size: 12px; }
.adv-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.adv-dot { font-size: 11px; font-weight: 600; padding: 3px 7px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--muted); cursor: default;
  transition: transform var(--t) var(--ease), background-color var(--t) var(--ease); }
.adv-dot.on { background: var(--tone); color: #16120f; box-shadow: 0 0 0 1px var(--line); }
.adv-dot.challenge.on { font-weight: 800; }
.adv-dot:hover { transform: translateY(-2px); }

/* ---------- Fortschrittsbaum ---------- */
.tree-who { gap: 6px; margin: 4px 0 6px; }
.tree-who .mbtn { text-decoration: none; }
.tree-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.tree-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.tree-legend i { width: 14px; height: 14px; display: inline-block; box-shadow: 0 0 0 2px var(--line); }
.tree-legend .lg-done { background: var(--grass); }
.tree-legend .lg-next { background: var(--white); outline: 2px dashed var(--gold); outline-offset: 1px; box-shadow: none; }
.tree-legend .lg-open { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.tree-frames .adv-frame { width: 14px; height: 14px; margin: 0 2px 0 8px; }
.tree-frames .adv-frame.task { --tone: var(--sky); }
.tree-frames .adv-frame.goal { --tone: var(--gold); }
.tree-frames .adv-frame.challenge { --tone: var(--amethyst); }
.tree-scroll { overflow: auto; margin-bottom: 50px; max-height: 78vh; background: color-mix(in srgb, var(--ink) 4%, var(--white)); }
.tree { position: relative; }
.tree-lines { position: absolute; inset: 0; pointer-events: none; }
.tree-lines path { fill: none; stroke: color-mix(in srgb, var(--ink) 22%, transparent); stroke-width: 2; }
.tree-lines path.next { stroke: var(--gold); stroke-dasharray: 5 4; stroke-width: 2; }
.tree-lines path.done { stroke: var(--ink); stroke-width: 3; }
.tnode { position: absolute; width: 168px; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--white);
  box-shadow: var(--outline); cursor: default; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t) var(--ease); }
.tnode .adv-frame { width: 22px; height: 22px; margin: 0; }
.tnode-txt { display: grid; min-width: 0; line-height: 1.15; }
.tnode b { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnode small { font-size: 10px; color: var(--muted); }
.tnode.done { background: var(--tone); color: #16120f; }
.tnode.done small { color: #16120f; opacity: 0.75; }
.tnode.next { outline: 3px dashed var(--gold); outline-offset: 2px; }
.tnode.next small { color: var(--ink); font-weight: 700; }
.tnode.open { opacity: 0.55; }
.tnode:hover { transform: var(--lift); box-shadow: var(--outline), 3px 3px 0 0 var(--line); opacity: 1; z-index: 2; }

/* Mond-Knopf sitzt rechts in der Logo-Zeile, auch wenn das Menü umbricht */
.top-row .theme, .top-row .herbst-btn { order: 2; margin-left: 0; flex: none; }
.top-row .nav { order: 1; }
.top-row { gap: 12px; }
@media (max-width: 900px) {
  .top-row .brand { margin-right: auto; }
  .top-row .theme, .top-row .herbst-btn { order: 1; margin-left: 0; }
  .top-row .nav { order: 2; }
}

/* Archiv aller Tage unter dem Zeitstrahl */
.arch { max-height: none; margin-bottom: 50px; }
.arch .tbl th { position: static; }
.arch .arch-month th { background: color-mix(in srgb, var(--ink) 6%, var(--white)); font-size: 12px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
.arch-row { position: relative; cursor: pointer; }
.arch-link { font-family: var(--font-display); font-weight: 700; font-size: 13px; text-decoration: none; }
.arch-link::after { content: ""; position: absolute; inset: 0; }
.arch-row:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.arch-row.on { background: color-mix(in srgb, var(--gold) 35%, transparent); }
.arch-row.on .arch-link::before { content: "▶ "; }
.arch-heads { display: inline-flex; align-items: center; gap: 3px; }
.arch-heads small { font-size: 11px; color: var(--muted); margin-left: 4px; }
.arch td small { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  .arch .tbl th:nth-child(6), .arch .tbl td:nth-child(6), .arch .tbl th:nth-child(4), .arch .tbl td:nth-child(4) { display: none; }
}

/* ---------- Minecraft-Symbole ---------- */
.mcicon { image-rendering: pixelated; object-fit: cover; object-position: top; flex: none; vertical-align: middle; }
.adv-ico { position: relative; flex: none; width: 30px; height: 30px; display: grid; place-items: center; }
.adv-ico .adv-frame { position: absolute; inset: 0; width: auto; height: auto; margin: 0; }
.adv-ico .mcicon { position: relative; z-index: 1; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.35)); }
.tnode .adv-ico { width: 26px; height: 26px; }
.adv-dot .mcicon { margin: -2px 4px -2px -2px; }
.adv-dot:not(.on) .mcicon { filter: grayscale(1); opacity: 0.6; }
.ttable li { display: flex; align-items: center; gap: 8px; }
.ttable li span { flex: 1; min-width: 0; }
.ttable li b { float: none; }
.ttable ol { list-style: none; padding-left: 0; }

/* Online-Punkt pulsiert, solange jemand spielt */
@keyframes online-puls {
  0% { box-shadow: 0 0 0 2px #16120f, 0 0 0 2px rgba(111, 220, 90, 0.75); }
  70% { box-shadow: 0 0 0 2px #16120f, 0 0 0 11px rgba(111, 220, 90, 0); }
  100% { box-shadow: 0 0 0 2px #16120f, 0 0 0 11px rgba(111, 220, 90, 0); }
}
.sq.pulse { animation: online-puls 1.8s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .sq.pulse { animation: none; } }

/* ---------- Aktivitäts-Kalender ---------- */
:root { --cal0: color-mix(in srgb, var(--ink) 8%, transparent); --cal1: #c6ecbd; --cal2: #8fd97e; --cal3: #4fb53b; --cal4: #2b7a1f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cal0: rgba(242, 233, 216, 0.08); --cal1: #23461d; --cal2: #2f7224; --cal3: #47a536; --cal4: #7fdc66; }
}
:root[data-theme="dark"] { --cal0: rgba(242, 233, 216, 0.08); --cal1: #23461d; --cal2: #2f7224; --cal3: #47a536; --cal4: #7fdc66; }
.cal { padding: 14px 16px; }
.cal-sum { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.cal-sum b { color: var(--ink); font-family: var(--font-display); }
.cal-sum small { display: block; font-size: 12px; margin-top: 2px; }
.cal-cell.future { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent); }
.cal-cell.before { background: transparent; }
.cal-scroll { overflow-x: auto; padding-bottom: 4px; }
/* Ein Raster über die ganze Breite: Spalte mit Wochentagen, dann eine Spalte pro Woche; die Kästchen bleiben quadratisch */
.cal-grid { display: grid; grid-template-columns: auto repeat(var(--weeks), minmax(14px, 1fr)); grid-template-rows: auto repeat(7, auto);
  grid-auto-flow: column; gap: clamp(3px, 0.5vw, 6px); width: 100%; min-width: 360px; }
.cal-days, .cal-col { display: contents; }
.cal-days span { font-size: 11px; color: var(--muted); align-self: center; padding-right: 4px; }
.cal-month { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: visible; padding-bottom: 2px; }
.cal-grid .cal-cell { width: 100%; height: auto; aspect-ratio: 1; }
.cal-cell { display: block; width: var(--cell, 11px); height: var(--cell, 11px); background: var(--cal0); border-radius: 3px; }
.cal-cell.l1 { background: var(--cal1); }
.cal-cell.l2 { background: var(--cal2); }
.cal-cell.l3 { background: var(--cal3); }
.cal-cell.l4 { background: var(--cal4); }
a.cal-cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.cal-legend i { --cell: 11px; margin: 0 1px; }

/* Gerade online, oben rechts im Kopfbereich der Übersicht */
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 32px; align-items: start; }
.hero-online { background: rgba(255, 255, 255, 0.55); color: #16120f; padding: 14px 16px; box-shadow: 0 0 0 4px #16120f, 6px 6px 0 4px rgba(22, 18, 15, 0.9); margin: 4px 14px 14px 4px; }
.hero-online h2 { font-family: var(--font-display); font-weight: 700; font-size: 15px; text-transform: uppercase; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.hero-online h2 span { background: var(--grass); padding: 1px 7px; box-shadow: 0 0 0 2px #16120f; font-size: 13px; }
.hero-online ul { list-style: none; margin: 0 -6px; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-x: hidden; overflow-y: auto; }
.hero-online a { display: flex; align-items: center; gap: 10px; padding: 4px 6px; text-decoration: none; color: inherit; }
.hero-online a:hover { background: rgba(22, 18, 15, 0.1); }
.hero-online a:hover .head { transform: scale(1.1); }
.hero-online span { display: grid; line-height: 1.2; }
.hero-online b { font-size: 15px; }
.hero-online small { font-size: 12px; opacity: 0.75; }
.hero-online p { margin: 0; font-size: 14px; opacity: 0.8; }
.latest { padding-bottom: 50px; }
@media (max-width: 860px) {
  .hero-split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* Rekordtage im Kalender */
.cal-cell.rec { position: relative; box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--line); z-index: 1; }
.cal-rec { position: absolute; inset: 12%; display: grid; place-items: center; color: #16120f; }
.cal-rec.n2, .cal-rec.n3, .cal-rec.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6%; }
.cal-rec .ico { width: 100%; height: 100%; filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.8)); }
.cal-rec.n1 .ico { width: 70%; height: 70%; }
.cal-rec b { display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: clamp(8px, 1.1vw, 12px); line-height: 1; }
.cal-cell.l0 .cal-rec, .cal-cell.l1 .cal-rec { color: var(--ink); }
.cal-legend .cal-cell.rec { box-shadow: 0 0 0 2px var(--gold); margin-left: 8px; }
.cal-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cal-facts-note { margin: 14px 0 8px; padding-top: 12px; border-top: 2px dashed var(--grid); font-size: 12px; color: var(--muted); }
.cal-legend + .cal-facts { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--grid); }
.cal-fact { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 0; text-decoration: none; color: inherit; background: color-mix(in srgb, var(--ink) 4%, transparent);
  transition: transform var(--t) var(--ease), background-color var(--t) var(--ease); }
.cal-fact:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--gold) 25%, transparent); }
.cal-fact-ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; background: var(--gold); color: #16120f; font-size: 16px; box-shadow: 0 0 0 2px var(--line); }
.cal-fact span:last-child { display: grid; line-height: 1.2; min-width: 0; }
.cal-fact small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-fact b { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.25; white-space: nowrap; }
.cal-fact em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Platz 1 bis 3: dunkles Feld mit Rand und Zahl in Gold, Silber oder Bronze */
.rank.m1 { --metal: #ffd23f; }
.rank.m2 { --metal: #d5dbe2; }
.rank.m3 { --metal: #e0904f; }
:root .rank:is(.m1, .m2, .m3) { background: #16120f; color: var(--metal); box-shadow: inset 0 0 0 2px var(--metal), 0 0 0 2px #16120f; }

/* ---------- Handy: Leiste unten statt Menü oben ---------- */
.tabbar { display: none; }
@media (max-width: 700px) {
  .top .nav { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--ender); color: #fff6e0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -3px 0 rgba(0, 0, 0, 0.35);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: inherit; text-decoration: none;
    background: none; border: 0; font: inherit; cursor: pointer; min-width: 0;
  }
  .tab .ico { font-size: 22px; }
  .tab span { font-family: var(--font-display); font-size: 9px; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab.on { background: #fff6e0; color: #16120f; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
  .more-sheet {
    position: absolute; right: 8px; bottom: calc(100% + 8px); display: grid; gap: 2px; min-width: 200px;
    background: var(--ender); padding: 8px; box-shadow: 0 0 0 3px #16120f, 0 6px 0 rgba(0, 0, 0, 0.35);
  }
  .more-sheet[hidden] { display: none; }
  .more-sheet a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: inherit; text-decoration: none; font-family: var(--font-display); font-size: 14px; text-transform: uppercase; }
  .more-sheet a .ico { font-size: 18px; }
  .more-sheet a.on { background: #fff6e0; color: #16120f; }
}

/* Aktivitäts-Kalender: auf dem Handy senkrecht, eine Zeile pro Woche, kein seitliches Scrollen */
.cal-days .opt { visibility: hidden; }
@media (max-width: 560px) {
  .cal-scroll { overflow: visible; }
  .cal-grid { grid-template-columns: 34px repeat(7, minmax(0, 36px)); grid-template-rows: none; grid-auto-flow: row; min-width: 0; gap: 5px; justify-content: center; }
  .cal-days .opt { visibility: visible; }
  .cal-days span { text-align: center; padding: 0 0 2px; }
  .cal-month { align-self: center; font-size: 11px; }
}

/* ---------- Herbst-Design (Knopf mit dem Blatt oben rechts) ---------- */
.herbst-btn { background: none; border: 0; padding: 4px; cursor: pointer; line-height: 0; opacity: 0.75; }
.herbst-btn img { image-rendering: pixelated; display: block; }
.herbst-btn:hover { opacity: 1; }
:root[data-herbst] .herbst-btn { opacity: 1; outline: 2px solid #f2c14e; outline-offset: 1px; }

:root[data-herbst] {
  --paper: #f8ead2;
  --white: #fffaf0;
  --muted: #6b5340;
  --grass: #b9c44e;
  --diamond: #e3a54a;
  --gold: #f4c64e;
  --redstone: #dd5a3b;
  --amethyst: #c07a5a;
  --pink: #eeb08a;
  --lava: #ea7a2c;
  --sky: #d8b46e;
  --ender: #4a2216;
}
@media (prefers-color-scheme: dark) {
  :root[data-herbst]:not([data-theme="light"]) { --paper: #1f1510; --white: #2c1e16; --muted: #c2a68c; }
}
:root[data-herbst][data-theme="dark"] { --paper: #1f1510; --white: #2c1e16; --muted: #c2a68c; }
/* oben eine Kante aus Herbstlaub-Farben */
:root[data-herbst] .top { box-shadow: 0 4px 0 #c9542b, 0 8px 0 rgba(0, 0, 0, 0.25); }

/* fallende Blätter, klicken geht durch sie hindurch */
.laub { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.laub img { position: absolute; top: -40px; image-rendering: pixelated; opacity: 0.85; animation-name: laub-fall, laub-wiegen; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite; animation-direction: normal, alternate; }
@keyframes laub-fall { to { top: 105vh; } }
@keyframes laub-wiegen { from { transform: translateX(-24px) rotate(-25deg); } to { transform: translateX(24px) rotate(25deg); } }
@media (prefers-reduced-motion: reduce) { .laub { display: none; } }

/* ---------- Bestenlisten: Auswahl statt vieler Knöpfe, Verlauf und Überholmanöver ---------- */
.bl-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; }
.bl-row { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 560px; min-width: 0; }
.bl-step { font-size: 20px; line-height: 1; padding: 6px 12px; }
.bl-select { position: relative; display: flex; align-items: center; gap: 10px; background: var(--tone); color: #16120f; padding: 6px 12px; box-shadow: var(--outline); flex: 1; min-width: 0; }
.bl-ico { width: 28px; height: 28px; flex: none; display: grid; place-items: center; background: #16120f; color: var(--tone); font-size: 16px; }
.bl-select select { flex: 1; min-width: 0; appearance: none; background: transparent; border: 0; color: inherit; font-family: var(--font-display); font-size: 15px; font-weight: 700; padding: 4px 22px 4px 0; cursor: pointer; }
.bl-select::after { content: "▾"; position: absolute; right: 12px; pointer-events: none; font-size: 14px; }
.bl-select select option, .bl-select select optgroup { color: #16120f; background: #fff6e0; }
.bl-zeit { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.bl-zeit select { font: inherit; text-transform: none; background: var(--white); color: var(--ink); border: 0; box-shadow: var(--outline); padding: 5px 8px; }
.race { max-width: 860px; padding-bottom: 50px; }
.race .sec-row .seg { margin: 0; }
.race-card { padding: 14px 16px; }
.race-svg { display: block; width: 100%; height: auto; overflow: visible; }
.race-grid { stroke: var(--grid); stroke-width: 1; }
.race-lbl { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.race-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; font-weight: 600; }
.race-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.race-legend i { width: 16px; height: 5px; display: inline-block; flex: none; }
.race-legend .head { --s: 18px; }
.race .erow-txt b { font-weight: 700; }
@media (max-width: 560px) { .race-lbl { font-size: 15px; } }
.race .erow-time { white-space: nowrap; width: auto; min-width: 96px; line-height: 1.25; }
.bl-select select, .bl-zeit select { box-shadow: none; margin: 0; }
.bl-zeit select { box-shadow: var(--outline); }
@media (max-width: 560px) { .race .erow-time { min-width: 52px; white-space: normal; } }
