:root {
  --felt: #1f3b2d;
  --felt-2: #2b5140;
  --brass: #c9962b;
  --brass-soft: #e9c46a;
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #f0e9db;
  --ink: #1d1a16;
  --muted: #6b6457;
  --line: #e2d8c5;
  --yes: #2f8f5b;
  --yes-bg: #dff1e6;
  --maybe: #b7791f;
  --maybe-bg: #fbefd5;
  --no: #b6423a;
  --no-bg: #f7dfdc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 20px rgba(40, 30, 10, .06);
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --surface: #1d1b16;
    --surface-2: #26231c;
    --ink: #f1ebdd;
    --muted: #a59d8c;
    --line: #36322a;
    --yes-bg: #183626;
    --maybe-bg: #3a2c12;
    --no-bg: #3d1a17;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;}
}
:root[data-theme="dark"] {
    --bg: #14130f;
    --surface: #1d1b16;
    --surface-2: #26231c;
    --ink: #f1ebdd;
    --muted: #a59d8c;
    --line: #36322a;
    --yes-bg: #183626;
    --maybe-bg: #3a2c12;
    --no-bg: #3d1a17;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
a { color: var(--felt-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a { color: var(--brass-soft); } }
:root[data-theme="dark"] a { color: var(--brass-soft); }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.boot { padding: 4rem 1rem; text-align: center; color: var(--muted); }

/* ---------- Kopfzeile ---------- */
.topbar {
  background: var(--felt);
  background-image: radial-gradient(circle at 20% -40%, rgba(255,255,255,.12), transparent 60%);
  color: #f6f1e7;
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 16px;
}
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px; flex: none; display: block;
  box-shadow: 0 0 0 1.5px rgba(233,196,106,.55);
  font: 800 1rem/1 var(--font-head); letter-spacing: -.02em;
}
.brand-text strong { font: 800 1.15rem/1 var(--font-head); display: block; }
.brand-text span { font-size: .72rem; opacity: .75; white-space: nowrap; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a {
  color: #f6f1e7; text-decoration: none; opacity: .8;
  padding: .45rem .75rem; border-radius: 999px; font-weight: 500; font-size: .92rem;
}
.nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.nav a.active { opacity: 1; background: rgba(233,196,106,.18); color: var(--brass-soft); }
.userchip {
  display: flex; align-items: center; gap: .5rem;
  color: inherit; text-decoration: none; font-size: .9rem; opacity: .9;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--felt-2); border: 2px solid var(--brass);
  display: grid; place-items: center; font-weight: 700; font-size: .78rem; color: #f6f1e7;
}
.tabbar { display: none; }

@media (max-width: 760px) {
  .nav, .userchip .uname { display: none; }
  .userchip { margin-left: auto; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--felt); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,.2);
  }
  .tabbar a {
    flex: 1; text-align: center; text-decoration: none; color: #f6f1e7; opacity: .7;
    font-size: .7rem; padding: .25rem 0; border-radius: 10px;
  }
  .tabbar a .ico { display: block; font-size: 1.2rem; line-height: 1.3; }
  .tabbar a.active { opacity: 1; color: var(--brass-soft); background: rgba(255,255,255,.06); }
  main.page { padding-bottom: 6rem !important; }
}

.demo-banner {
  background: var(--brass-soft); color: #3b2c06; text-align: center;
  font-size: .82rem; padding: .35rem 16px;
}

/* ---------- Layout ---------- */
main.page { max-width: 1080px; margin: 0 auto; padding-block: 1.5rem 3rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .3rem 0 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.card.link { text-decoration: none; color: inherit; display: block; transition: transform .12s, border-color .12s; }
.card.link:hover { transform: translateY(-2px); border-color: var(--brass); }
.card h3 { margin-bottom: .3rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 2rem 0 .8rem; }
.section-title h2 { margin: 0; }

.hero {
  background: var(--felt); color: #f6f1e7; border-radius: calc(var(--radius) + 4px);
  padding: 1.6rem 1.5rem; position: relative; overflow: hidden; margin-bottom: 1.2rem;
  background-image:
    radial-gradient(circle at 85% 30%, rgba(233,196,106,.25), transparent 40%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px);
}
.hero h1 { color: #fff; margin-bottom: .3rem; }
.hero p { opacity: .85; margin: 0; max-width: 46ch; }
.dice { position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%); display: flex; gap: .5rem; opacity: .9; }
.die {
  width: 46px; height: 46px; background: #fbf7ee; border-radius: 10px;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 7px;
  box-shadow: 0 4px 0 rgba(0,0,0,.25); transform: rotate(var(--r, 0deg));
}
.die i { width: 8px; height: 8px; border-radius: 50%; background: var(--felt); place-self: center; }
@media (max-width: 600px) { .dice { display: none; } }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.green { background: var(--yes-bg); color: var(--yes); }
.badge.amber { background: var(--maybe-bg); color: var(--maybe); }
.badge.red { background: var(--no-bg); color: var(--no); }
.badge.brass { background: var(--brass); color: var(--felt); }

/* ---------- Buttons & Formulare ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: 600 .9rem/1 var(--font-body);
  padding: .65rem 1rem; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { border-color: var(--brass); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--felt); color: #fff; border-color: var(--felt); }
.btn.primary:hover { background: var(--felt-2); }
.btn.gold { background: var(--brass); color: var(--felt); border-color: var(--brass); }
.btn.danger { color: var(--no); }
.btn.danger:hover { border-color: var(--no); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: .4rem .65rem; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=url], input[type=number], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .75rem;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; background: var(--felt);
  background-image: radial-gradient(circle at 30% 10%, rgba(233,196,106,.2), transparent 45%); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { color: var(--ink); margin-bottom: 1.2rem; }
.auth-card .brand-text span { opacity: 1; color: var(--muted); }
.tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 1rem; }
.tabs button { flex: 1; border: 0; background: transparent; padding: .5rem; border-radius: 8px; font: 600 .88rem var(--font-body); color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Abstimmung ---------- */
.vote-list { display: grid; gap: .6rem; }
.vote-item {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.vote-item.final { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(201,150,43,.25); }
.vote-item .when { font-weight: 600; min-width: 0; flex: 1 1 180px; }
.vote-item .when small { display: block; font-weight: 400; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: .5rem .75rem; font: 600 .82rem var(--font-body); color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on.yes { background: var(--yes); color: #fff; }
.seg button.on.maybe { background: var(--maybe); color: #fff; }
.seg button.on.no { background: var(--no); color: #fff; }
.tally { font-size: .8rem; color: var(--muted); }

.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.matrix td.c, .matrix th.c { text-align: center; }
.cell { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 700; }
.cell.yes { background: var(--yes-bg); color: var(--yes); }
.cell.maybe { background: var(--maybe-bg); color: var(--maybe); }
.cell.no { background: var(--no-bg); color: var(--no); }
.cell.none { color: var(--line); }
.matrix th.best { background: var(--brass); color: var(--felt); }
.matrix tr.me td { background: rgba(201,150,43,.07); }

/* ---------- Statistik ---------- */
.honor { position: relative; overflow: hidden; }
.honor .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.honor .who { font: 800 1.35rem/1.2 var(--font-head); margin: .3rem 0 .1rem; }
.honor .val { font-size: .88rem; color: var(--muted); }
.honor .val b { color: var(--ink); font-size: 1.1rem; }
.honor::after {
  content: attr(data-rank); position: absolute; right: .8rem; top: .5rem;
  font: 800 2.6rem/1 var(--font-head); color: var(--brass); opacity: .18;
}
.stat-table th.sortable { cursor: pointer; user-select: none; }
.stat-table th.sorted { color: var(--ink); }
.stat-table td.num, .stat-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.stat-table td.bar { background-image: linear-gradient(90deg, rgba(201,150,43,.22) var(--p), transparent var(--p)); background-repeat: no-repeat; font-weight: 700; }
.stat-table td.rank { color: var(--muted); width: 2.5rem; }
.stat-table tr.top1 td.rank { color: var(--brass); font-weight: 800; }
.pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: .35rem .8rem; border-radius: 999px; font: 600 .82rem var(--font-body); cursor: pointer; }
.pill.on { background: var(--felt); color: #fff; border-color: var(--felt); }

.night-rows { display: grid; gap: .5rem; }
.night-row {
  display: grid; grid-template-columns: minmax(130px, 1.2fr) repeat(4, minmax(0, 1fr)); gap: .6rem; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; background: var(--surface);
}
.night-row.off { opacity: .5; }
.night-row .pname { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.night-row .pname input { width: 20px; height: 20px; accent-color: var(--felt); }
.stepper { display: flex; align-items: center; justify-content: center; gap: .25rem; }
.stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 700; cursor: pointer; }
.stepper output { min-width: 2ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper-label { display: none; }
.night-head { display: grid; grid-template-columns: minmax(130px, 1.2fr) repeat(4, minmax(0, 1fr)); gap: .6rem; padding: 0 .8rem; font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.night-head span:not(:first-child) { text-align: center; }
@media (max-width: 640px) {
  .night-head { display: none; }
  .night-row { grid-template-columns: 1fr 1fr; }
  .night-row .pname { grid-column: 1 / -1; }
  .stepper { justify-content: space-between; background: var(--surface-2); border-radius: 10px; padding: .25rem .4rem; }
  .stepper-label { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; flex: 1; }
  .stepper button { background: var(--surface); }
}

.list { display: grid; gap: .5rem; }
.list-item {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: inherit;
}
a.list-item:hover { border-color: var(--brass); }
.list-item .grow { flex: 1 1 200px; min-width: 0; }
.list-item { flex-wrap: wrap; }
.list-item .title { font-weight: 600; }
.date-tile {
  width: 52px; flex: none; text-align: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface);
}
.date-tile .m { background: var(--felt); color: #fff; font-size: .65rem; font-weight: 700; text-transform: uppercase; padding: 2px 0; }
.date-tile .d { font: 800 1.25rem/1.4 var(--font-head); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

.checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.checks label { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .75rem; cursor: pointer; font-size: .88rem; background: var(--surface); }
.checks input { accent-color: var(--felt); }
.checks label:has(input:checked) { border-color: var(--felt); background: var(--yes-bg); }

#toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%);
  background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 10px;
  font-weight: 500; font-size: .9rem; transition: transform .25s; z-index: 50; max-width: calc(100% - 32px);
}
#toast:not(.show) { opacity: 0; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); }
#toast.err { background: var(--no); color: #fff; }
@media (max-width: 760px) { #toast { bottom: 5.5rem; } }

.auth-logo { display: block; width: 170px; max-width: 60%; margin: -.2rem auto 1.1rem; }
.hero { padding-right: 190px; }
.hero-logo { position: absolute; right: 1.6rem; top: 50%; width: 128px; transform: translateY(-50%) rotate(-5deg); filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
@media (max-width: 600px) { .hero { padding-right: 1.5rem; } .hero-logo { display: none; } }

.event-info .info-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.event-info .info-value { font-weight: 500; }

/* =====================================================================
   Geister-Schocken
   ===================================================================== */
.g-wrap { display: grid; gap: 1rem; }
.g-status { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; font-size: .9rem; color: var(--muted); }
.g-status b { color: var(--ink); }
.g-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.g-player {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: .6rem .7rem; display: grid; gap: .4rem; transition: border-color .2s, box-shadow .2s, opacity .2s;
}
.g-player.active { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(201,150,43,.25); }
.g-player.out { opacity: .5; }
.g-player.ghost .g-ava { background: color-mix(in srgb, var(--felt-2) 70%, transparent); border-style: dashed; }
.g-pname { display: flex; gap: .5rem; align-items: center; min-width: 0; }
.g-pname span:last-child { display: grid; min-width: 0; line-height: 1.2; }
.g-pname b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-pname small { color: var(--muted); font-size: .72rem; }
.g-ava { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--felt-2); color: #fff; border: 2px solid var(--brass); }
.g-deckel { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-height: 14px; }
.g-deckel i { width: 11px; height: 11px; border-radius: 50%; background: var(--brass-soft); border: 1.5px solid var(--brass); }
.g-deckel span { margin-left: .3rem; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-res { font-size: .82rem; color: var(--muted); min-height: 1.2em; }
.g-res b { color: var(--ink); }
.g-halves { position: absolute; top: .45rem; right: .55rem; font-weight: 800; color: var(--no); letter-spacing: .1em; }

.g-table {
  background: var(--felt);
  background-image: radial-gradient(ellipse at 50% 35%, rgba(255,255,255,.10), transparent 65%), repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 2px, transparent 2px 5px);
  border-radius: 22px; padding: 1.2rem 1rem 1.4rem; color: #f6f1e7; text-align: center;
  box-shadow: inset 0 0 0 6px #6b4a2b, inset 0 0 0 8px rgba(0,0,0,.25), var(--shadow);
  display: grid; gap: .9rem; justify-items: center;
}
.g-turn { font-size: .95rem; min-height: 1.4em; }
.muted-l { opacity: .7; }
.g-dice { display: flex; gap: clamp(.9rem, 4vw, 2rem); justify-content: center; padding: 1.4rem 0 .4rem; min-height: 120px; }
.g-hand { display: flex; gap: .6rem; align-items: center; justify-content: center; min-height: 2.2rem; transition: opacity .2s; }
.g-hand.pending { opacity: 0; transition: none; }   /* sofort weg, erst nach der Landung einblenden */
.g-hand-label { font: 800 1.6rem/1 var(--font-head); color: var(--brass-soft); }
.g-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.g-actions .btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.g-actions .btn.gold { background: var(--brass); color: var(--felt); border-color: var(--brass); }
.g-actions .btn.primary { background: #f6f1e7; color: var(--felt); border-color: #f6f1e7; }
.g-actions .btn.big { font-size: 1.05rem; padding: .85rem 2rem; }
.g-hint { width: 100%; margin: .2rem 0 0; font-size: .8rem; opacity: .75; }

/* 3D-Würfel */
.d3 {
  --s: 64px; --tilt: 0deg;
  width: var(--s); height: var(--s); padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 500px; position: relative; transform: rotate(var(--tilt)); transition: transform .25s;
}
.d3:disabled { cursor: default; }
.d3-toss { display: block; width: 100%; height: 100%; transform-style: preserve-3d; }
.d3-toss.tossing { animation: toss linear both; }
.d3 .cube { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.15,.75,.25,1); }
.d3 .face {
  position: absolute; inset: 0; border-radius: 13px; background: #fbf7ee;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 9px; gap: 1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), inset 0 -4px 8px rgba(0,0,0,.10), inset 0 3px 6px rgba(255,255,255,.8);
  backface-visibility: hidden;
}
.d3 .face i { border-radius: 50%; margin: 2px; }
.d3 .face i.on { background: #1f3b2d; box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.d3 .face.f1 i.on { background: #b0322c; margin: 0; }
.d3 .f1 { transform: translateZ(calc(var(--s) / 2)); }
.d3 .f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.d3 .f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f2 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f5 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.d3::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -10px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(4px); z-index: -1; }
.d3.kept { transform: translateY(-14px) rotate(0deg); }
.d3.kept .face { box-shadow: inset 0 0 0 3px var(--brass), inset 0 -4px 8px rgba(0,0,0,.10); }
.d3.idle .cube { opacity: .55; }
.d3:not(:disabled):hover { transform: translateY(-4px) rotate(var(--tilt)); }
.d3.kept:not(:disabled):hover { transform: translateY(-16px); }
.d3:focus-visible { outline: 2px solid var(--brass-soft); outline-offset: 8px; border-radius: 14px; }
.d3-tag { position: absolute; left: 50%; bottom: -1.8rem; transform: translateX(-50%); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-soft); white-space: nowrap; }
@keyframes toss {
  0% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-58px) translateX(-6px); }
  55% { transform: translateY(0) translateX(4px); }
  72% { transform: translateY(-14px) translateX(2px); }
  86% { transform: translateY(0); }
  93% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
@media (max-width: 480px) { .d3 { --s: 54px; } .g-hand-label { font-size: 1.35rem; } }
@media (prefers-reduced-motion: reduce) { .d3-toss.tossing { animation: none; } }

.g-log { display: grid; gap: .25rem; font-size: .85rem; color: var(--muted); }
.g-log .new { color: var(--ink); }
.g-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15, 20, 15, .55); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.g-overlay[hidden] { display: none; }
.g-modal { max-width: 420px; width: 100%; animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.g-verdict { font: 800 1.3rem/1.2 var(--font-head); margin: .8rem 0; }
.g-verdict.lose { color: var(--no); }
.g-verdict.win { color: var(--yes); }

.ghost-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.ghost-pick label { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .75rem; cursor: pointer; background: var(--surface); }
.ghost-pick label:has(input:checked) { border-color: var(--felt); background: var(--yes-bg); }
.ghost-pick input { width: 18px; height: 18px; accent-color: var(--felt); }
.ghost-pick .grow { flex: 1; min-width: 0; }
.rules-list { margin: .4rem 0 0; padding-left: 1.2rem; }
.rules-list li { margin-bottom: .3rem; }

/* Live-Schocken */
.schock-tabs { margin-bottom: 1rem; }
.schock-tabs .pill { text-decoration: none; }
.online-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.online-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; background: var(--yes-bg); color: var(--ink); font-size: .88rem; font-weight: 600; }
.online-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--yes); box-shadow: 0 0 0 3px rgba(47,143,91,.2); }
.online-chip.away { background: var(--surface-2); color: var(--muted); }
.online-chip.away i { background: var(--muted); box-shadow: none; }
.on-dot, .away-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; background: var(--yes); }
.away-dot { background: var(--no); }
.pvp-mine { margin-bottom: 1rem; border-color: var(--brass); }
.pvp-banner { width: 100%; max-width: 560px; background: rgba(0,0,0,.28); border: 1px solid rgba(233,196,106,.45); border-radius: 12px; padding: .6rem .9rem; font-size: .92rem; animation: pop .2s ease-out; }
.pvp-banner[hidden] { display: none; }
.live-banner { display: flex !important; align-items: center; gap: .8rem; margin-bottom: 1rem; border-color: var(--brass) !important; }
.live-banner .grow { flex: 1; min-width: 0; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--no); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(182,66,58,.0); opacity: .6; } 0%,100% { box-shadow: 0 0 0 0 rgba(182,66,58,.45); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Becher für den verdeckten 3. Wurf */
.g-dice { position: relative; }
.g-table { overflow: hidden; position: relative; }
.g-dice .d3 { transition: transform .25s, opacity .2s; }
.g-dice.covered .d3.under-cup { opacity: 0; }
.g-dice.covered .d3.kept { z-index: 3; }
.cup {
  position: absolute; left: 50%; top: 50%; width: clamp(150px, 46vw, 210px); aspect-ratio: 1.35; max-width: 100%;
  transform: translate(-50%, -150%) rotate(-10deg); opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.3, 1.35, .5, 1), opacity .25s;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.45));
}
.cup::before {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(16% 0, 84% 0, 100% 100%, 0 100%);
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 3px, transparent 3px 14px),
    linear-gradient(180deg, #8a5a33 0%, #6b4424 55%, #4f3119 100%);
  border-radius: 10px;
}
.cup span {
  position: absolute; left: 0; right: 0; bottom: 0; height: 16%;
  background: linear-gradient(180deg, #c9962b, #8e6a1c); border-radius: 0 0 8px 8px;
}
.g-dice.covered .cup { opacity: 1; transform: translate(-50%, -50%); }
.cup.shake { animation: cupslam .55s ease-out; }
@keyframes cupslam {
  0% { transform: translate(-50%, -80%) rotate(-6deg); }
  45% { transform: translate(-50%, -48%) rotate(3deg); }
  65% { transform: translate(-50%, -54%) rotate(-2deg); }
  100% { transform: translate(-50%, -50%) rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .cup { transition: opacity .2s; } .cup.shake { animation: none; } }

/* Ehrenhalle */
.record { display: grid; gap: .15rem; align-content: start; }
.record .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; text-wrap: balance; }
.record .rv { font: 800 2.1rem/1.1 var(--font-head); color: var(--felt-2); font-variant-numeric: tabular-nums; margin-top: .2rem; }
.record.good .rv { color: var(--yes); }
.record.bad .rv { color: var(--no); }
.record .who { font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .record .rv { color: var(--brass-soft); } }
:root[data-theme="dark"] .record .rv { color: var(--brass-soft); }
.year-row { display: grid !important; grid-template-columns: 4.5rem 1.4fr 1fr 1fr auto; align-items: center; gap: .8rem; }
.year-row .year { font: 800 1.5rem/1 var(--font-head); color: var(--brass); }
.year-king { display: flex; gap: .55rem; align-items: center; min-width: 0; }
.crown-img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.year-cell { min-width: 0; }
@media (max-width: 720px) { .year-row { grid-template-columns: 3.6rem 1fr 1fr; } .year-row > :nth-child(4), .year-row > :nth-child(5) { grid-column: 2 / -1; } }
.badge-grid { display: grid; gap: .5rem; }
.medal { display: flex; gap: .6rem; align-items: center; padding: .5rem .65rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); line-height: 1.25; }
.medal .mi { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: var(--surface); border: 2px solid currentColor; }
.medal.gold { border-color: rgba(201,150,43,.6); } .medal.gold .mi { color: var(--brass); }
.medal.silver .mi { color: #9aa3a8; } .medal.bronze .mi { color: #b07a4a; }
.live-pill { display: inline-flex; align-items: center; gap: .4rem; }
.live-pill .live-dot { width: 9px; height: 9px; }

/* Live-Strichliste */
.live-dot.inline { display: inline-block; width: 14px; height: 14px; vertical-align: middle; margin-right: .2rem; }
.tally-list { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 400px) { .tally-list { grid-template-columns: 1fr; } }
.tally-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .7rem; box-shadow: var(--shadow); }
.tally-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; padding: 0 .2rem; }
.tally-head b { font-size: 1.05rem; }
.tally-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.tally-tile { position: relative; }
.tally-plus {
  width: 100%; min-height: 86px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink);
  display: grid; justify-items: center; align-content: center; gap: .1rem; padding: .4rem .2rem; cursor: pointer; font: inherit;
  transition: transform .06s, background .15s, border-color .15s; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.tally-plus:active { transform: scale(.95); background: var(--brass-soft); }
.tally-tile.has .tally-plus { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, var(--surface)); }
.tally-plus .tl { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; line-height: 1.1; }
.tally-plus .tv { font: 800 1.7rem/1 var(--font-head); font-variant-numeric: tabular-nums; }
.tally-plus .marks { font-size: .7rem; letter-spacing: 1px; color: var(--brass); min-height: .9em; max-width: 100%; overflow: hidden; }
.tally-minus { position: absolute; top: -7px; right: -7px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 800; cursor: pointer; line-height: 1; box-shadow: var(--shadow); }
.live-actions { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); background: var(--bg); padding: .6rem 0; }
@media (min-width: 761px) { .live-actions { bottom: 0; } }

/* App & Push */
.push-topics { display: grid; gap: .45rem; margin-top: .4rem; }
.push-topics label { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.push-topics input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--felt); }
.app-promo { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.app-promo .grow { flex: 1 1 200px; min-width: 0; }
.tally-log .list-item { flex-wrap: nowrap; padding: .5rem .7rem; }
.tally-log .grow { flex: 1 1 auto; }

/* Umfragen */
.poll-opts { display: grid; gap: .55rem; }
.poll-opt {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: .8rem; text-align: left; width: 100%;
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
}
.poll-opt:disabled { cursor: default; }
.poll-opt:not(:disabled):hover { border-color: var(--brass); }
.poll-opt.mine { border-color: var(--felt-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--felt-2) 30%, transparent); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brass) 16%, transparent); transition: width .4s ease; }
.poll-opt.lead .poll-bar { background: color-mix(in srgb, var(--brass) 28%, transparent); }
.poll-opt > *:not(.poll-bar) { position: relative; }
.poll-check { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; }
.poll-check.sq { border-radius: 6px; }
.poll-opt.mine .poll-check { background: var(--felt-2); border-color: var(--felt-2); }
.poll-text { display: grid; flex: 1; min-width: 0; }
.poll-count { font: 800 1.3rem/1 var(--font-head); text-align: right; display: grid; font-variant-numeric: tabular-nums; }
.poll-count small { font: 600 .7rem var(--font-body); color: var(--muted); }
.extra-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; color: var(--brass); }

/* Geburtstage */
.bday-banner { display: flex !important; align-items: center; gap: .8rem; margin-bottom: 1rem; border-color: var(--brass) !important; background: color-mix(in srgb, var(--brass) 10%, var(--surface)); }
.bday-cake { font-size: 2rem; }
.bday-banner .grow { flex: 1; }
.bday-today { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 10%, var(--surface)); }
.bday-input { width: auto !important; padding: .35rem .5rem !important; font-size: .82rem !important; }

/* Bier-Fakt */
.beer-card { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; background: linear-gradient(135deg, color-mix(in srgb, var(--brass-soft) 22%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }
.beer-card .grow { flex: 1; min-width: 0; }
.beer-ico { font-size: 2.2rem; line-height: 1; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.15)); }
.beer-card .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brass); font-weight: 700; }
.beer-text { font: 600 1.08rem/1.45 var(--font-head); margin: .35rem 0 .7rem; max-width: 65ch; text-wrap: pretty; }

/* Kasse */
.kasse-kpis { margin-bottom: 1rem; }
.kpi .label, .rate-box .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kv { font: 800 1.7rem/1.15 var(--font-head); font-variant-numeric: tabular-nums; margin: .2rem 0; }
.kv.big { font-size: 2.2rem; }
.neg { color: var(--no); } .pos { color: var(--yes); }
.hint-card { margin-bottom: 1rem; border-color: var(--brass); background: color-mix(in srgb, var(--brass) 8%, var(--surface)); }
.book-card { margin-bottom: 1rem; }
.kasse-table td a { color: inherit; text-decoration: none; }
.kasse-table td a:hover b { text-decoration: underline; }
.kasse-table tr.me td { background: rgba(201,150,43,.08); }
.kline { flex-wrap: wrap; }
.kline .kdate { width: 5.6rem; flex: none; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.kline .grow { flex: 1 1 180px; }
.kline .kamt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.kline.voided .title, .kline.voided .kamt { text-decoration: line-through; opacity: .55; }
.void-form { width: 100%; margin-top: .4rem; }
.rate-box { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; background: var(--surface-2); }
.rate-box details { margin-top: .3rem; } .rate-box details > div { margin-top: .4rem; }
.fee-row { flex-wrap: wrap; gap: .5rem; }
.fee-row .grow { flex: 1 1 140px; }
.fee-row input[type=month] { width: auto; padding: .35rem .5rem; font-size: .85rem; }
.fee-row .fee-reason { flex: 1 1 160px; width: auto; padding: .35rem .5rem; font-size: .85rem; }
/* Mobile: "Mehr"-Menü */
.tab-more { flex: 1; border: 0; background: none; color: #f6f1e7; opacity: .7; font: inherit; font-size: .7rem; padding: .25rem 0; border-radius: 10px; position: relative; cursor: pointer; }
.tab-more .ico { display: block; font-size: 1.2rem; line-height: 1.3; }
.tab-more.active { opacity: 1; color: var(--brass-soft); background: rgba(255,255,255,.06); }
.more-dot { position: absolute; top: 4px; right: 22%; width: 8px; height: 8px; border-radius: 50%; background: var(--brass-soft); }
.more-sheet { display: none; }
@media (max-width: 760px) {
  .more-sheet:not([hidden]) { display: grid; position: fixed; right: 8px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); z-index: 31; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: .4rem; min-width: 200px; }
  .more-sheet a { display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
  .more-sheet a.active, .more-sheet a:hover { background: var(--surface-2); }
}

@media (max-width: 600px) {
  .kasse-kpis { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .kasse-kpis .kpi { padding: .7rem .8rem; }
  .kasse-kpis .kv { font-size: 1.3rem; }
  .kline { display: grid !important; grid-template-columns: 1fr auto; gap: .15rem .6rem; }
  .kline .kdate { width: auto; grid-column: 1; }
  .kline .grow { grid-column: 1; grid-row: 2; }
  .kline .kamt { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .kline > .btn, .kline .void-form { grid-column: 1 / -1; justify-self: start; }
}

/* Diagramme – Farben: validierte Kategorie-Palette, hell/dunkel getrennt gestuft */
.viz-root {
  --viz-mode: light;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --viz-grid: #ece5d6; --viz-base: #cfc6b2; --viz-axis: #857d6d;
  display: grid; gap: 1rem;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .viz-root { --viz-mode: dark; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --viz-grid: #2e2b23; --viz-base: #453f33; --viz-axis: #958c79; }
}
:root[data-theme="dark"] .viz-root { --viz-mode: dark; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --viz-grid: #2e2b23; --viz-base: #453f33; --viz-axis: #958c79; }
.viz-filters { display: grid; gap: .7rem; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 5; }
.viz-filter-row { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; }
.viz-flabel { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 5.5rem; }
.viz-flabel small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.viz-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.viz-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: .3rem .7rem; border-radius: 999px; font: 600 .82rem var(--font-body); cursor: pointer; }
.viz-chip.on { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.viz-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.viz-sw.off { border: 1.5px solid var(--line); }
.viz-card { overflow: hidden; }
.viz-head { margin-bottom: .4rem; } .viz-head h2 { margin-bottom: .15rem; } .viz-head p { margin: 0; max-width: 65ch; }
.viz-plot { width: 100%; min-height: 200px; }
.viz-svg { display: block; overflow: visible; font-family: var(--font-body); }
.viz-grid line { stroke: var(--viz-grid); stroke-width: 1; }
.viz-axis text { fill: var(--viz-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-ref line { stroke: var(--viz-axis); stroke-width: 1.5; stroke-dasharray: 5 4; }
.viz-ref text { fill: var(--viz-axis); font-size: 11px; }
.viz-endlabels text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-endlabels .viz-lname { fill: var(--ink); font-weight: 600; }
.viz-cross { stroke: var(--viz-axis); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-hit { cursor: crosshair; touch-action: pan-y; }
.viz-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: .55rem .7rem; font-size: .82rem; min-width: 170px; max-width: 260px; }
.viz-tip[hidden] { display: none; }
.viz-tip-h { font-weight: 700; margin-bottom: .3rem; }
.viz-tip-r { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .45rem; align-items: center; font-variant-numeric: tabular-nums; }
.viz-tip-r small { grid-column: 2 / -1; color: var(--muted); margin-top: -.15rem; }
.viz-tip-r:not(:has(.viz-sw)) { grid-template-columns: 1fr auto; }
.viz-heat-wrap { overflow-x: auto; }
.viz-heat { border-collapse: separate; border-spacing: 2px; width: auto; }
.viz-heat th { background: none; font-size: .78rem; color: var(--muted); text-transform: none; letter-spacing: 0; padding: .3rem .5rem; white-space: nowrap; border: 0; }
.viz-heat tbody th { text-align: left; padding-right: 1rem; color: var(--ink); font-weight: 600; position: sticky; left: 0; background: var(--surface); }
.viz-heat tr.me th { color: var(--brass); }
.viz-heat td { text-align: center; padding: .45rem .3rem; border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; border: 0; width: 5.2rem; min-width: 4.2rem; cursor: default; }
.viz-heat td small { display: block; font-weight: 500; font-size: .66rem; opacity: .8; }
.viz-heat td.viz-empty { background: var(--surface-2); color: var(--muted); font-weight: 400; }
.viz-legend-seq { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .7rem; }
.viz-ramp { width: 140px; height: 10px; border-radius: 5px; }

@media (max-width: 760px) { .viz-filters { position: static; } }

/* Jahresrückblick – Übersicht */
.rb-hero { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap; }
.rb-logo { width: 110px; height: 110px; flex: none; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
.rb-hero h1 { font-size: clamp(2.6rem, 9vw, 4rem); margin: 0 0 .4rem; }
.rb-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); }
.rb-lock { text-align: center; padding: 2rem 1.2rem; } .rb-lock p { max-width: 50ch; margin: 0 auto; }
.rb-big { font-size: 3rem; margin-bottom: .4rem; }
.rb-card p { max-width: 55ch; }
.rb-banner { display: flex !important; align-items: center; gap: .8rem; margin-bottom: 1rem; border-color: var(--brass) !important; background: linear-gradient(135deg, color-mix(in srgb, var(--felt-2) 14%, var(--surface)), var(--surface)); }
.rb-banner .grow { flex: 1; } .rb-tree { font-size: 2rem; }
.year-row > .btn { justify-self: end; }
@media (max-width: 720px) { .year-row > .btn { grid-column: 2 / -1; justify-self: start; } }

/* Jahresrückblick – Story (bewusst immer im eigenen, dunklen Look) */
body.story-open { overflow: hidden; }
.story {
  position: fixed; inset: 0; z-index: 100; color: #fbf7ee; overflow: hidden;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: #14271d; transition: background .5s; font-family: var(--font-body);
}
.story[data-theme="felt"] { background: radial-gradient(ellipse at 50% 20%, #33604b, #14271d 70%); }
.story[data-theme="brass"] { background: radial-gradient(ellipse at 50% 20%, #f0cf78, #b9861f 75%); color: #1f1a0f; }
.story[data-theme="dark"] { background: radial-gradient(ellipse at 50% 20%, #2c2a24, #0f0e0b 70%); }
.story[data-theme="red"] { background: radial-gradient(ellipse at 50% 20%, #c4443c, #5e1713 75%); }
.story[data-theme="king"] { background: radial-gradient(ellipse at 50% 35%, #6b5420, #1b2d22 60%, #0e1912); }
.st-bars { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; right: 12px; display: flex; gap: 4px; z-index: 3; }
.st-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.28); overflow: hidden; }
.story[data-theme="brass"] .st-bars span { background: rgba(0,0,0,.18); }
.st-bars span i { display: block; height: 100%; width: 0; background: currentColor; }
.st-bars span.done i { width: 100%; }
.st-bars span.now i { width: 100%; animation: stbar .5s ease-out; }
@keyframes stbar { from { width: 0; } }
.st-top { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 20px); right: 10px; left: 12px; display: flex; align-items: center; gap: .4rem; z-index: 4; }
.st-count { font-size: .78rem; opacity: .7; flex: 1; font-variant-numeric: tabular-nums; }
.st-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.18); color: inherit; font-size: 1.05rem; cursor: pointer; }
.st-stage { position: absolute; inset: 70px 0 0; display: grid; place-items: center; padding: 0 max(24px, env(safe-area-inset-left, 0px)) 40px; }
.st-slide { max-width: 640px; width: 100%; text-align: center; animation: stin .45s cubic-bezier(.2,.8,.2,1); position: relative; z-index: 2; }
@keyframes stin { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.st-nav { position: absolute; top: 60px; bottom: 0; width: 34%; border: 0; background: transparent; cursor: pointer; z-index: 1; }
.st-nav.prev { left: 0; width: 26%; } .st-nav.next { right: 0; width: 74%; }
.st-nav[hidden] { display: none; }
.st-kicker { font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin-bottom: .5rem; }
.st-mega { font: 800 clamp(5rem, 26vw, 9.5rem)/0.95 var(--font-head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-wrap: balance; }
.st-king { font-size: clamp(3rem, 14vw, 6.5rem); color: #f0cf78; text-shadow: 0 4px 30px rgba(233,196,106,.45); }
.st-unit { font-size: 1.05rem; font-weight: 600; opacity: .85; margin-top: .4rem; }
.st-big { font: 800 clamp(1.8rem, 7.5vw, 3rem)/1.12 var(--font-head); margin: .2rem 0 .5rem; text-wrap: balance; }
.st-sub { font-size: 1.05rem; line-height: 1.5; opacity: .88; max-width: 34ch; margin: .8rem auto 0; text-wrap: pretty; }
.st-hint { margin-top: 2rem; font-size: .85rem; opacity: .6; }
.st-emoji { font-size: clamp(4rem, 18vw, 6rem); line-height: 1.1; margin: .2rem 0; }
.st-box { margin: 1.4rem auto 0; padding: .9rem 1.1rem; border-radius: 14px; background: rgba(0,0,0,.2); max-width: 32ch; font-size: .98rem; line-height: 1.45; }
.story[data-theme="brass"] .st-box { background: rgba(255,255,255,.35); }
.st-sep { width: 60px; height: 2px; background: currentColor; opacity: .3; margin: 1.6rem auto; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1.4rem 1rem; margin-top: 1rem; }
.st-grid.four { grid-template-columns: repeat(2, 1fr); }
.st-num { font: 800 clamp(2.6rem, 12vw, 4.2rem)/1 var(--font-head); font-variant-numeric: tabular-nums; }
.st-logo { width: min(46vw, 230px); margin: 0 auto 1.2rem; display: block; filter: drop-shadow(0 10px 30px rgba(0,0,0,.4)); }
.st-logo.small { width: 130px; }
.st-crown { width: 120px; height: 120px; border-radius: 26px; display: block; margin: 0 auto 1rem; box-shadow: 0 0 0 3px #e9c46a, 0 10px 40px rgba(233,196,106,.5); animation: crown 1s cubic-bezier(.2,1.4,.4,1); }
@keyframes crown { from { transform: translateY(-120px) rotate(-12deg); opacity: 0; } }
.st-drum { font-size: 4rem; margin-top: 1.2rem; animation: drum .35s ease-in-out infinite alternate; }
@keyframes drum { to { transform: rotate(-10deg) scale(1.08); } }
.st-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; position: relative; z-index: 3; }
.st-ghost { color: inherit; border-color: rgba(255,255,255,.35); }
.st-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.story.present .st-slide { max-width: 1100px; }
.story.present .st-mega { font-size: clamp(6rem, 18vw, 14rem); }
.story.present .st-big { font-size: clamp(2.4rem, 6vw, 4.6rem); }
.story.present .st-sub { font-size: clamp(1.1rem, 2.2vw, 1.6rem); max-width: 40ch; }
.story.present .st-num { font-size: clamp(3rem, 8vw, 6rem); }
.story.present .st-unit { font-size: clamp(1rem, 2vw, 1.4rem); }
.story.present .st-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .story.present .st-grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .st-slide, .st-crown, .st-drum, .st-bars span.now i { animation: none; } }
.st-stage { pointer-events: none; }
.st-actions, .st-actions * { pointer-events: auto; }
.story .st-king.long { font-size: clamp(2.4rem, 10vw, 4.2rem); }
.story.present .st-king.long { font-size: clamp(3rem, 8vw, 7rem); }

/* Live-Schocken: Rundenergebnis */
.round-sum { width: 100%; max-width: 440px; margin: 0 auto .4rem; display: grid; gap: .35rem; text-align: left; }
.rs-row { display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; gap: 0 .6rem; align-items: baseline; padding: .45rem .7rem; border-radius: 10px; background: rgba(0,0,0,.18); }
.rs-row span { font-weight: 600; }
.rs-row b { font: 800 1.1rem var(--font-head); color: var(--brass-soft); }
.rs-row small { opacity: .65; font-size: .72rem; }
.rs-row em { grid-column: 1 / -1; font-style: normal; font-size: .72rem; opacity: .75; }
.rs-row em:empty { display: none; }
.rs-row.lose { background: rgba(176,50,44,.45); }
.rs-row.win { background: rgba(233,196,106,.18); }
.rs-text { margin: .5rem 0 .2rem; text-align: center; font-size: .95rem; }

/* ---------- Bier aufmachen & Zuprosten ---------- */
.prost-card { margin-bottom: 1rem; border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }
.prost-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.prost-head .grow { flex: 1 1 220px; min-width: 0; }
.prost-card .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brass); font-weight: 700; }
.prost-btn { flex: 0 0 auto; }
.prost-btn:disabled { opacity: .55; }
@media (max-width: 480px) { .prost-btn { width: 100%; } }
.prost-items { display: grid; gap: .5rem; margin-top: .9rem; }
.prost-item { display: flex; gap: .7rem; align-items: center; padding: .6rem .75rem; border-radius: 12px; background: var(--surface-2); }
.prost-item.own { background: color-mix(in srgb, var(--brass-soft) 22%, var(--surface)); }
.prost-item .grow { flex: 1; min-width: 0; }
.prost-glass { font-size: 1.5rem; line-height: 1; flex: none; }
.prost-board { margin: .8rem 0 0; }
.prost-card.plopp .prost-btn { animation: plopp .6s ease; }
@keyframes plopp { 0% { transform: scale(1); } 30% { transform: scale(1.12) rotate(-4deg); } 60% { transform: scale(.96) rotate(3deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .prost-card.plopp .prost-btn { animation: none; } }

/* Login einem Spieler zuordnen */
.link-form { margin-top: .6rem; padding: .7rem .8rem; border-radius: 12px; background: var(--surface-2); }
.link-form .row { margin-top: .4rem; gap: .5rem; flex-wrap: wrap; }
.link-form select { flex: 1 1 240px; min-width: 0; }
