/* KC Filet – im Stil von iOS: Systemschrift, gruppierte Listen, durchscheinende Leisten.
   Farben: warmes Kupfer und Anthrazit als Akzent (Logo schwarz-weiß), sonst die Systemfarben von Apple.
   Layout: eine schmale Spalte, großer Titel je Bereich, Reiter unten. */
:root {
  --bg: #f2f2f7;                      /* gruppierter Hintergrund */
  --surface: #ffffff;                 /* Karten und Listen */
  --surface-raised: #ffffff;          /* Karten in Sheets */
  --sheet-bg: #f2f2f7;
  --fill: rgba(118, 118, 128, .12);   /* Felder, graue Knöpfe */
  --fill-strong: rgba(120, 120, 128, .2);
  --ink: #000000;
  --muted: rgba(60, 60, 67, .6);
  --faint: rgba(60, 60, 67, .3);
  --line: rgba(60, 60, 67, .22);
  --seg-on: #ffffff;
  --bar: rgba(249, 249, 249, .86);
  --gold: #b05a2a;                    /* Kupfer: Flächen */
  --on-gold: #ffffff;
  --tint: #9a4f22;                    /* Kupfer als Schrift auf Hell */
  --gold-soft: rgba(176, 90, 42, .13);
  --bar-fill: #b05a2a;
  --blue: #007aff;
  --green: #34c759;
  --green-text: #1f8a3a;
  --green-soft: rgba(52, 199, 89, .14);
  --red: #ff3b30;
  --red-text: #d70015;
  --red-soft: rgba(255, 59, 48, .1);
  --hud: rgba(28, 28, 30, .9);
  --card-from: #3a3a3c;
  --card-to: #1c1c1e;
  --card-edge: rgba(255, 255, 255, 0);
  --avatar-from: #a5abb8;
  --avatar-to: #848a97;
  --scrim: rgba(0, 0, 0, .35);
  --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, .12);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 50px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-raised: #2c2c2e; --sheet-bg: #1c1c1e;
    --fill: rgba(118, 118, 128, .24); --fill-strong: rgba(120, 120, 128, .36);
    --ink: #ffffff; --muted: rgba(235, 235, 245, .6); --faint: rgba(235, 235, 245, .3); --line: rgba(84, 84, 88, .6);
    --seg-on: #636366; --bar: rgba(22, 22, 24, .82);
    --gold: #e0905a; --on-gold: #1c1c1e; --tint: #eaa173; --gold-soft: rgba(224, 144, 90, .18); --bar-fill: #c2703c; --blue: #0a84ff;
    --green: #30d158; --green-text: #30d158; --green-soft: rgba(48, 209, 88, .16);
    --red: #ff453a; --red-text: #ff6961; --red-soft: rgba(255, 69, 58, .16);
    --hud: rgba(58, 58, 60, .92); --card-from: #2c2c2e; --card-to: #121214; --card-edge: rgba(255, 255, 255, .08);
    --avatar-from: #6b7079; --avatar-to: #4f535b; --scrim: rgba(0, 0, 0, .55); --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-raised: #2c2c2e; --sheet-bg: #1c1c1e;
  --fill: rgba(118, 118, 128, .24); --fill-strong: rgba(120, 120, 128, .36);
  --ink: #ffffff; --muted: rgba(235, 235, 245, .6); --faint: rgba(235, 235, 245, .3); --line: rgba(84, 84, 88, .6);
  --seg-on: #636366; --bar: rgba(22, 22, 24, .82);
  --gold: #e0905a; --on-gold: #1c1c1e; --tint: #eaa173; --gold-soft: rgba(224, 144, 90, .18); --bar-fill: #c2703c; --blue: #0a84ff;
  --green: #30d158; --green-text: #30d158; --green-soft: rgba(48, 209, 88, .16);
  --red: #ff453a; --red-text: #ff6961; --red-soft: rgba(255, 69, 58, .16);
  --hud: rgba(58, 58, 60, .92); --card-from: #2c2c2e; --card-to: #121214; --card-edge: rgba(255, 255, 255, .08);
  --avatar-from: #6b7079; --avatar-to: #4f535b; --scrim: rgba(0, 0, 0, .55); --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.3; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  transition: background-color .25s;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo { display: block; flex: none; border-radius: 50%; }

/* ---------- Navigationsleiste und großer Titel ---------- */
.navbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: 44px; pointer-events: none; transition: background-color .2s, box-shadow .2s; }
.navbar.scrolled {
  background: var(--bar); box-shadow: 0 .5px 0 var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.navbar-inner {
  max-width: 600px; margin: 0 auto; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  opacity: 0; transition: opacity .2s;
}
.navbar.scrolled .navbar-inner { opacity: 1; }
.nav-title { font-weight: 600; font-size: 17px; }
/* Kopf jeder Seite: Logo und Clubname oben, darunter der große Titel */
.page-head { margin-top: -38px; display: flex; flex-direction: column; gap: 6px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.large-title { font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: .01em; }
.title-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; flex: none;
  background: linear-gradient(180deg, var(--avatar-from), var(--avatar-to)); color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
}
.nav-add {
  height: 32px; border: 0; border-radius: 16px; padding: 0 12px 0 8px;
  background: var(--gold-soft); color: var(--tint); font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
}
.nav-add svg { width: 18px; height: 18px; stroke-width: 2.4; }

/* ---------- Inhalt ---------- */
.wrap {
  max-width: 600px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
}
.section-title { font-size: 20px; font-weight: 700; margin-top: 8px; margin-bottom: -6px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.35; }
.demo-banner { background: var(--gold-soft); border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.35; }

/* ---------- Reiter unten ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--bar); box-shadow: 0 -.5px 0 var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabbar-inner { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
.tab {
  border: 0; background: none; color: var(--muted); position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 500; letter-spacing: .01em;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--tint); }
.tab .dot {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bar);
}
.tab .dot.live { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 6px; left: calc(50% + 9px); background: var(--gold); }

/* ---------- Knöpfe ---------- */
.btn {
  border: 0; border-radius: 12px; min-height: 50px; padding: 0 18px;
  background: var(--fill); color: var(--tint); font-size: 17px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s, transform .15s;
}
.btn-primary { background: var(--gold); color: var(--on-gold); }
.btn-danger { color: var(--red-text); }
.btn-block { width: 100%; }
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }
.link-btn { border: 0; background: none; color: var(--tint); font-size: 17px; padding: 8px 0; text-align: left; }

/* ---------- Segment-Umschalter ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; border-radius: 7px; min-height: 32px; padding: 0 8px; font-size: 13px; font-weight: 500; color: var(--ink); transition: background-color .2s; }
.seg button[aria-pressed="true"] { background: var(--seg-on); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }

/* ---------- Gruppierte Listen ---------- */
.ledger { background: var(--surface); border-radius: 12px; overflow: hidden; }
.ledger-head { font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 16px 4px; }
.row, .member-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 11px 16px; border: 0; background: none; text-align: left; color: inherit;
}
.ledger > .row:not(:last-child)::before, .ledger > .member-row:not(:last-child)::before, .ledger > .settle-row:not(:last-child)::before {
  content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: 1px; background: var(--line); transform: scaleY(.5); transform-origin: bottom;
}
.ledger > .member-row:not(:last-child)::before { left: 64px; }
button.row, button.member-row { padding-right: 34px; cursor: pointer; }
button.row::after, button.member-row::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 13px; margin-top: -6.5px; background: var(--faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1.5 1.5 6.5 6.5 1.5 11.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1.5 1.5 6.5 6.5 1.5 11.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
button.row:active, button.member-row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 17px; overflow-wrap: anywhere; }
.row-sub { font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.row-sub.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.leader { display: none; }
.row-amount { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.row-amount.open { color: var(--red-text); font-weight: 500; }
.row-amount.plus { color: var(--green-text); }
.row-amount.minus { color: var(--ink); }
.row.paid .row-title, .row.paid .row-amount { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.member-row .initials {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--avatar-from), var(--avatar-to)); color: #fff; font-size: 14px; font-weight: 600;
}
.member-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; text-decoration: none; }
.tag-green { background: var(--green-soft); color: var(--green-text); }
.tag-red { background: var(--red-soft); color: var(--red-text); }
.tag-plain { background: var(--fill); color: var(--muted); }
.tag-gold { background: var(--gold-soft); color: var(--tint); }

/* ---------- Termine ---------- */
.event {
  display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start;
  background: var(--surface); border-radius: 16px; padding: 14px 16px; cursor: pointer;
}
.event-date { display: flex; flex-direction: column; align-items: center; line-height: 1; padding-top: 2px; }
.event-date .wd { font-size: 13px; font-weight: 600; color: var(--red); }
.event-date .d { font-size: 34px; font-weight: 300; font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -.02em; }
.event-date .m { font-size: 13px; color: var(--muted); margin-top: 3px; }
.event-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.event-body h2 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.event-body h2 .tag { vertical-align: 1px; margin-left: 4px; }
.event-meta, .event-count { font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.event-count b { color: var(--green-text); font-weight: 600; }
.event.past { opacity: .6; }
.rsvp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.rsvp button {
  border: 0; border-radius: 10px; min-height: 40px; background: var(--fill); color: var(--ink);
  font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .2s, color .2s;
}
.rsvp svg { width: 18px; height: 18px; stroke-width: 2.4; }
.rsvp .yes.on { background: var(--green); color: #fff; }
.rsvp .no.on { background: var(--red); color: #fff; }
.rsvp .on svg { animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.rsvp button:disabled { opacity: .4; cursor: not-allowed; }
@keyframes pop { from { transform: scale(.3); } to { transform: scale(1); } }
.deadline { font-size: 13px; color: var(--muted); margin-top: 6px; }
.deadline.closed { color: var(--red-text); }
.att-group { display: flex; flex-direction: column; gap: 8px; }
.att-group h3 { font-size: 13px; font-weight: 600; color: var(--muted); }
.names { display: flex; flex-wrap: wrap; gap: 6px; }
.name-chip { padding: 6px 12px; border-radius: 16px; font-size: 15px; background: var(--fill); }
.name-chip.yes { background: var(--green-soft); color: var(--green-text); }
.name-chip.no { background: var(--red-soft); color: var(--red-text); text-decoration: line-through; }
.att-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; position: relative; }
.att-row:not(:last-child)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); transform: scaleY(.5); }
.att-row .seg { flex: none; width: 200px; }
.att-row .seg button.yes[aria-pressed="true"] { background: var(--green); color: #fff; }
.att-row .seg button.no[aria-pressed="true"] { background: var(--red); color: #fff; }

/* ---------- Strafen ---------- */
.own { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.own-label { font-size: 15px; color: var(--muted); }
.own-amount { font-family: var(--font-round); font-weight: 700; font-size: 34px; font-variant-numeric: tabular-nums; color: var(--red-text); white-space: nowrap; letter-spacing: -.01em; }
.own-amount.zero { color: var(--green-text); }

/* ---------- Karten im Wallet-Stil: Kasse und laufender Abend ---------- */
.board, .live {
  position: relative; overflow: hidden; color: #fff; border-radius: 20px; padding: 20px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(200, 115, 63, .38), rgba(200, 115, 63, 0) 55%),
    linear-gradient(150deg, var(--card-from), var(--card-to));
  box-shadow: inset 0 0 0 .5px var(--card-edge), 0 12px 30px rgba(0, 0, 0, .16);
  display: flex; flex-direction: column; gap: 4px;
}
.board-label { font-size: 15px; color: rgba(255, 255, 255, .7); }
.board-value { font-family: var(--font-round); font-weight: 700; font-size: clamp(44px, 13vw, 60px); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.board-value.neg { color: #ff6961; }
.board-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: .5px solid rgba(255, 255, 255, .18); }
.board-stats div, .live-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.board-stats span, .live-stats span { font-size: 12px; color: rgba(255, 255, 255, .6); }
.board-stats b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #eaa173; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #eaa173; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(234, 161, 115, .6); } 70% { box-shadow: 0 0 0 9px rgba(234, 161, 115, 0); } 100% { box-shadow: 0 0 0 0 rgba(234, 161, 115, 0); } }
.live-title { font-size: 24px; font-weight: 700; line-height: 1.15; }
.live-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: .5px solid rgba(255, 255, 255, .18); }
.live-stats b { font-family: var(--font-round); font-size: 28px; font-weight: 700; color: #eaa173; font-variant-numeric: tabular-nums; }

/* ---------- Kegelabend ---------- */
.start { background: var(--surface); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.start-title { font-size: 22px; font-weight: 700; line-height: 1.2; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  border: 0; background: var(--surface); border-radius: 14px; padding: 14px; min-height: 78px; color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; text-align: left; transition: transform .12s;
}
.tile-name { font-size: 16px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.tile-price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-others .tile-price { color: var(--tint); }
.tile-free { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.tile:active, .pick-btn:active, .chip:active { transform: scale(.97); }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pick-item { position: relative; display: flex; }
.pick-btn {
  flex: 1; min-width: 0; border: 0; background: var(--surface); color: var(--ink); border-radius: 14px;
  min-height: 56px; padding: 8px 14px; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; transition: transform .12s, box-shadow .2s;
}
.pick-btn span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn.has { box-shadow: inset 0 0 0 2px var(--gold); }
.pick-count { background: var(--gold); color: var(--on-gold); border-radius: 99px; padding: 2px 9px; font-size: 15px; font-variant-numeric: tabular-nums; flex: none; }
.pick-minus {
  position: absolute; top: -7px; left: -7px; z-index: 1; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--red); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--sheet-bg);
}
.pick-minus::after { content: ""; position: absolute; inset: -8px; }
.pick-minus svg { width: 16px; height: 16px; stroke-width: 3; }

/* ---------- Übersicht als Tabelle ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 12px; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; }
.grid th, .grid td { padding: 6px 10px; white-space: nowrap; text-align: right; border-bottom: .5px solid var(--line); }
.grid thead th { font-size: 13px; color: var(--muted); font-weight: 600; padding-top: 12px; }
.grid th.sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 600; padding-left: 16px; box-shadow: .5px 0 0 var(--line); }
.grid thead th.sticky { color: var(--muted); }
.grid tfoot th, .grid tfoot td { border-bottom: 0; font-weight: 600; color: var(--muted); padding-bottom: 12px; }
.grid tr.me th.sticky { color: var(--tint); }
.grid .sum-open { color: var(--red-text); font-weight: 600; }
.grid .sum-zero { color: var(--muted); }
.grid .cell-empty { color: var(--faint); text-align: center; }
.tick { border: 0; background: none; min-height: 40px; padding: 4px 2px; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--red-text); }
.tick-box { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; flex: none; transition: background-color .2s, border-color .2s; }
.tick.paid { color: var(--muted); }
.tick.paid .tick-box { background: var(--green); border-color: var(--green); color: #fff; }
.tick-box svg { width: 13px; height: 13px; stroke-width: 3; }
.tick:disabled { cursor: default; }
.tick:disabled .tick-box { border-style: dashed; }

/* ---------- Mitglieder ---------- */
.pending { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: inset 0 0 0 1.5px var(--gold); }
.pending .section-title { font-size: 17px; margin: 0; }
.pending-item { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: .5px solid var(--line); }
.pending-item .btn-row > .btn { flex: 1 1 120px; min-height: 44px; }
.pending-item select { width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: var(--fill); min-height: 44px; font-size: 17px; }

/* ---------- Leere Zustände, Hinweise ---------- */
.empty { background: var(--surface); border-radius: 16px; padding: 26px 20px; display: flex; flex-direction: column; gap: 6px; text-align: center; align-items: center; }
.empty strong { font-size: 17px; font-weight: 600; }
.empty p { color: var(--muted); font-size: 15px; max-width: 34ch; }
.install { background: var(--surface); border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.install p { font-size: 15px; flex: 1; min-width: 0; }
.install .x { border: 0; background: var(--fill); color: var(--muted); width: 28px; height: 28px; border-radius: 50%; font-size: 17px; line-height: 1; flex: none; }
.install .btn { min-height: 34px; border-radius: 17px; padding: 0 14px; font-size: 15px; }

/* ---------- Formulare ---------- */
form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); padding-left: 4px; }
.field input, .field select, .field textarea {
  width: 100%; border: 0; border-radius: 10px; padding: 11px 14px; min-height: 44px; font-size: 17px;
  background: var(--surface); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px; padding-right: 36px; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--gold-soft), inset 0 0 0 1px var(--gold); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { background: var(--red-soft); color: var(--red-text); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.success { background: var(--green-soft); color: var(--green-text); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
/* Häkchen als iOS-Schalter */
.check { display: flex; align-items: center; gap: 12px; font-size: 17px; min-height: 44px; }
.check input {
  order: 2; margin: 0 0 0 auto; flex: none; width: 51px; height: 31px; border-radius: 16px; position: relative;
  -webkit-appearance: none; appearance: none; background: var(--fill-strong); cursor: pointer; transition: background-color .2s;
}
.check input::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .25s cubic-bezier(.3, .7, .4, 1);
}
.check input:checked { background: var(--green); }
.check input:checked::before { transform: translateX(20px); }
.check input:disabled { opacity: .5; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--fill); color: var(--ink); border-radius: 18px; padding: 8px 14px; font-size: 15px; font-weight: 500; min-height: 36px; transition: background-color .15s, transform .12s; }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); font-weight: 600; }
.chip small { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 4px; font-size: 13px; }
.quick { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-left: 4px; }
.quick button { border: 0; background: none; color: var(--tint); padding: 4px 0; font-size: 15px; font-weight: 600; }
.payers { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.payers b { font-variant-numeric: tabular-nums; }
.stepper { display: inline-grid; grid-template-columns: 46px 48px 46px; align-items: center; background: var(--surface); border-radius: 10px; overflow: hidden; width: max-content; }
.stepper button { border: 0; background: var(--fill); height: 44px; font-size: 22px; font-weight: 400; color: var(--ink); }
.stepper output { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.calc .big { font-family: var(--font-round); font-weight: 700; font-size: 34px; font-variant-numeric: tabular-nums; }
.settle-row { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 16px; }
.settle-row .checks { grid-column: 1 / -1; display: flex; flex-direction: column; }
.settle-row .check { font-size: 15px; min-height: 40px; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; animation: fade .25s ease-out; }
.sheet {
  --surface: var(--surface-raised);
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; margin: 0 auto; max-width: 600px;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--sheet-bg); border-radius: 14px 14px 0 0; box-shadow: var(--sheet-shadow);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 6px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
  animation: up .4s cubic-bezier(.32, .72, 0, 1);
}
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--faint); margin: 0 auto; flex: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h2 { font-size: 22px; font-weight: 700; line-height: 1.2; }
.sheet-head .hint { font-size: 15px; margin-bottom: 2px; }
.sheet-close { border: 0; background: var(--fill); width: 30px; height: 30px; border-radius: 50%; font-size: 17px; line-height: 1; flex: none; color: var(--muted); font-weight: 600; }
.sheet .detail { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 15px; }
.sheet .detail p.desc { color: var(--ink); white-space: pre-line; margin-top: 6px; font-size: 17px; }
.confirm { background: var(--red-soft); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.confirm p { color: var(--red-text); font-size: 15px; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  background: var(--hud); color: #fff; padding: 12px 18px; border-radius: 22px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 15px; font-weight: 600; max-width: calc(100vw - 32px); width: max-content;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .2); animation: toast .3s cubic-bezier(.3, 1.3, .5, 1);
}
.toast-undo { border: 0; background: none; color: #eaa173; font-weight: 700; font-size: 15px; padding: 2px 0; white-space: nowrap; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }

/* ---------- Anmeldung, Warteseite ---------- */
.gate {
  min-height: 100dvh; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; align-items: center;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 56px 32px;
}
.gate-inner { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.gate-inner > div:first-of-type { text-align: center; }
.gate-logo { width: 120px; height: 120px; margin: 0 auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.gate h1 { font-size: 34px; font-weight: 700; line-height: 1.15; }
.gate .lead { color: var(--muted); font-size: 17px; line-height: 1.4; }
.gate-card { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.gate-card .field input { background: var(--fill); }
.gate .chalk-link { text-align: center; }
.setup { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.4; }
.setup code { background: var(--fill); border-radius: 6px; padding: 1px 6px; font-size: 14px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--fill-strong); border-top-color: var(--muted); border-radius: 50%; animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  .board-stats { grid-template-columns: 1fr 1fr; }
  .att-row .seg { width: 168px; }
  .large-title { font-size: 30px; }
  .brand-name { font-size: 17px; }
  .nav-add span { display: none; }
  .nav-add { padding: 0 8px; }
}
.pending-item .field select { background-color: var(--fill); }

/* Logo auf den Karten */
.card-logo { position: absolute; top: 16px; right: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.board .board-label, .live .live-head { padding-right: 84px; }
.live .live-title { padding-right: 84px; }
.start-logo { margin: 0 auto 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.start { text-align: center; align-items: stretch; }

/* ---------- Zurück zu „Mehr“ ---------- */
.back { align-self: flex-start; border: 0; background: none; color: var(--tint); font-size: 17px; padding: 2px 0; margin: 0 0 -4px -6px; display: inline-flex; align-items: center; gap: 0; }
.back svg { width: 24px; height: 24px; stroke-width: 2.4; }

/* ---------- Mehr (wie die iOS-Einstellungen) ---------- */
.more-row { gap: 14px; }
.ledger > .more-row:not(:last-child)::before { left: 60px; }
.more-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.more-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.ic-gold { background: #c8733f; }
.ic-green { background: #34c759; }
.ic-gray { background: #8e8e93; }
.ic-blue { background: var(--blue); }
.more-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--red); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; }

/* ---------- Statistik ---------- */
.year-chips, .metric-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.year-chips::-webkit-scrollbar, .metric-chips::-webkit-scrollbar { display: none; }
.year-chips .chip, .metric-chips .chip { flex: none; }
.kings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.king {
  border: 0; text-align: left; color: var(--ink); background: var(--surface); border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 104px;
}
.king-label { font-size: 13px; font-weight: 600; color: var(--tint); }
.king-name { font-size: 17px; font-weight: 700; line-height: 1.2; margin-top: auto; overflow-wrap: anywhere; }
.king-value { font-family: var(--font-round); font-size: 22px; font-weight: 700; }
.figures {
  border: 0; width: 100%; text-align: left; color: var(--ink); background: var(--surface); border-radius: 16px; padding: 14px 16px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.figures span { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.figures b { font-family: var(--font-round); font-size: 24px; font-weight: 700; color: var(--ink); }
.rank-row { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; border: 0; background: none; color: inherit; text-align: left; padding: 11px 16px; cursor: pointer; }
.rank-row:active { background: var(--fill); }
.ledger > .rank-row:not(:last-child)::before { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: 1px; background: var(--line); transform: scaleY(.5); transform-origin: bottom; }
.rank-pos { width: 22px; flex: none; font-size: 15px; font-weight: 600; color: var(--muted); padding-top: 1px; }
.rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rank-value { font-size: 17px; font-weight: 600; white-space: nowrap; }
.rank-bar { height: 8px; border-radius: 0 4px 4px 0; background: var(--fill); overflow: hidden; }
.rank-bar > span { display: block; height: 100%; background: var(--bar-fill); border-radius: 0 4px 4px 0; }
.rank .row-sub { font-size: 13px; margin-top: -2px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid > div { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-grid span { font-size: 13px; color: var(--muted); }
.stat-grid b { font-family: var(--font-round); font-size: 24px; font-weight: 700; }
.stat-grid small { font-size: 13px; color: var(--muted); }

/* ---------- Kegelspiele ---------- */
.search { display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 10px; padding: 0 10px; min-height: 40px; color: var(--muted); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; font-size: 17px; color: var(--ink); padding: 8px 0; outline: none; -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search:focus-within { box-shadow: 0 0 0 3px var(--gold-soft); }
.game-summary { font-size: 17px; line-height: 1.4; }
.game-card { background: var(--surface); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.game-card h3 { font-size: 13px; font-weight: 600; color: var(--muted); }
.rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 1.4; }
.rules li::marker { color: var(--tint); }
.game-win { box-shadow: inset 3px 0 0 var(--gold); }
.game-win p { font-size: 16px; font-weight: 600; line-height: 1.4; }

/* ---------- Pudel-Staffel im Auswahlfenster ---------- */
.pick-name { display: flex; flex-direction: column; min-width: 0; }
.pick-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-name small { font-size: 13px; font-weight: 600; color: var(--tint); white-space: nowrap; }
.pick-btn.tier-up { box-shadow: inset 0 0 0 2px var(--bar-fill); }

@media (max-width: 380px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .tab { font-size: 9.5px; }
}

/* ---------- Offline und Synchronisierung ---------- */
.sync-badge {
  height: 32px; border: 0; border-radius: 16px; padding: 0 11px 0 8px; flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--fill); color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sync-badge svg { width: 17px; height: 17px; stroke-width: 2.2; }
.sync-badge.busy { background: var(--gold-soft); color: var(--tint); }
.sync-badge.busy svg { animation: sync-spin 1.4s linear infinite; }
.sync-badge.bad { background: var(--red-soft); color: var(--red-text); }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-badge.busy svg { animation: none; } }
.navbar-inner { position: relative; }
.nav-sync { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 6px; pointer-events: auto; }
.nav-sync:empty, .navbar:not(.scrolled) .nav-sync { visibility: hidden; }
.nav-sync .sync-badge { height: 30px; padding: 0 9px 0 7px; }
.navbar-inner { padding-left: 64px; padding-right: 64px; }
.nav-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline-note {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  border: 0; border-radius: 12px; padding: 12px 14px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; line-height: 1.35;
}
.offline-note svg { width: 22px; height: 22px; flex: none; color: var(--muted); margin-top: 1px; }
.offline-note b { font-weight: 600; }
.sync-list .row { cursor: default; }
.sync-error { color: var(--red-text); font-size: 15px; line-height: 1.35; }
.row-sub.sync-error { font-size: 13px; }

/* ---------- Gäste, Zusammenfassung, Bezahlen ---------- */
.chip-add { display: inline-flex; align-items: center; gap: 4px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong, var(--line)); color: var(--tint); }
.chip-add svg { width: 15px; height: 15px; stroke-width: 2.4; }
.guest-mark, .pick-name small { font-size: 11px; font-weight: 500; color: var(--muted); }
.selectable { -webkit-user-select: text; user-select: text; }
.summary-text {
  margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.icon-btn { width: 44px; height: 44px; margin: -6px -8px -6px 0; border: 0; border-radius: 22px; background: transparent; color: var(--tint); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { background: var(--fill); }
.pay-bank .row-title { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr { width: min(220px, 62vw); height: auto; border-radius: 12px; }
.qr-box .hint { text-align: center; }
.pw-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); }
.pw-box b { font-family: var(--font-round); font-size: 24px; font-weight: 700; letter-spacing: .01em; overflow-wrap: anywhere; }
.pw-box .icon-btn { margin: 0; }
a.btn { text-decoration: none; }

/* ---------- Abstimmungen ---------- */
.poll { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.poll h3 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; }
.poll > .hint { margin: 0 0 4px; }
.poll-opt {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 48px; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--fill); color: var(--ink);
  font: inherit; font-size: 17px; text-align: left;
}
.poll-opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--bar-fill); }
.poll-opt:disabled { cursor: default; color: var(--ink); opacity: 1; }
.poll-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar-fill); opacity: .22; border-radius: 0 4px 4px 0; transition: width .25s; }
.poll-label { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.poll-label svg { width: 18px; height: 18px; flex: none; stroke-width: 2.6; color: var(--tint); }
.poll-label span { overflow-wrap: anywhere; }
.poll-count { position: relative; font-weight: 600; font-variant-numeric: tabular-nums; }
.poll-names { margin: -4px 4px 4px; font-size: 13px; color: var(--muted); }
.poll-todo { margin: 2px 0 0; font-size: 15px; font-weight: 600; color: var(--tint); }
.poll-admin { display: flex; justify-content: space-between; gap: 12px; border-top: .5px solid var(--line); margin-top: 6px; padding-top: 4px; }
.poll.closed .poll-fill { background: var(--muted); opacity: .2; }
.link-btn.danger { color: var(--red-text); }

/* ---------- Protokoll ---------- */
.log .row { cursor: default; align-items: flex-start; }
.log .row-title { white-space: normal; overflow-wrap: anywhere; font-weight: 400; font-size: 16px; }

/* ---------- Verlauf über die Jahre ---------- */
.card-plain { background: var(--surface); border-radius: 16px; padding: 14px 16px 12px; }
.trend-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.trend-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 132px; padding-top: 22px; border-bottom: 1px solid var(--line-strong, var(--line)); border-top: 1px dashed var(--line); }
.trend-col { flex: 1 1 0; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.trend-bar { width: min(24px, 62%); background: var(--bar-fill); border-radius: 4px 4px 0 0; opacity: .55; transition: opacity .15s; }
.trend-col.on .trend-bar, .trend-col:hover .trend-bar { opacity: 1; }
.trend-val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; visibility: hidden; white-space: nowrap; }
.trend-col.on .trend-val, .trend-val.peak { visibility: visible; }
.trend-val.peak { color: var(--muted); }
.trend-col.on .trend-val { color: var(--ink); }
.trend-x { display: flex; gap: 2px; margin-top: 5px; }
.trend-x span { flex: 1 1 0; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-x span.on { color: var(--ink); font-weight: 600; }
.trend-note { margin: 8px 0 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.att-group .trend-plot { height: 104px; }

/* ---------- Kegelabend löschen ---------- */
.danger-link { display: block; margin: 4px auto 0; text-align: center; font-size: 16px; }
.warn-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--red-soft); color: var(--ink); font-size: 15px; line-height: 1.4; }
.warn-box svg { width: 22px; height: 22px; flex: none; color: var(--red-text); margin-top: 1px; }
.warn-box p { margin: 0; }
.warn-box b { font-weight: 600; }

/* ---------- Querformat und Tablet ---------- */
@media (min-width: 700px) {
  .wrap, .navbar-inner, .tabbar-inner { max-width: 760px; }
  .sheet { max-width: 640px; }
  .large-title { font-size: 40px; }
}
@media (min-width: 1000px) {
  .wrap, .navbar-inner, .tabbar-inner { max-width: 940px; }
  .stat-grid, .kings { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
/* Tablet quer und große Bildschirme: die ganze Breite nutzen, nur ein schmaler Rand */
@media (min-width: 1100px) {
  .wrap, .navbar-inner { max-width: 1400px; }
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
}
/* Handy quer: wenig Höhe, daher kompakte Leisten */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --tabbar-h: 44px; }
  .tab { flex-direction: row; gap: 6px; font-size: 13px; }
  .tab svg { width: 22px; height: 22px; }
  .page-head { gap: 2px; }
  .brand-row { min-height: 46px; }
  .large-title { font-size: 28px; }
  .sheet { max-width: 680px; max-height: calc(100dvh - 8px); }
}

/* ---------- Eingabemodus: Strafen eintragen im Vollbild ---------- */
.btn-entry { min-height: 56px; font-size: 18px; }
.btn-entry svg { width: 20px; height: 20px; }
body.entry-open { overflow: hidden; }
body.entry-open .tabbar, body.entry-open .navbar { visibility: hidden; }
#entry-root, #kp-root {
  position: fixed; inset: 0; z-index: 30; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  animation: fade .2s ease-out;
}
.en-head {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px; min-height: 64px;
  background: var(--bar); box-shadow: 0 .5px 0 var(--line); flex: none;
}
.en-close {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--fill); color: var(--ink);
  display: grid; place-items: center; flex: none;
}
.en-close svg { width: 22px; height: 22px; }
.en-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.en-title b { font-size: 20px; font-weight: 700; line-height: 1.2; }
.en-title > span { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.en-undo {
  border: 0; border-radius: 14px; background: var(--gold-soft); color: var(--ink); padding: 8px 14px; text-align: left;
  display: flex; flex-direction: column; max-width: min(46vw, 420px); min-height: 48px; justify-content: center;
}
.en-undo-label { font-size: 15px; font-weight: 700; color: var(--tint); }
.en-undo-msg { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.en-body { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 44%) minmax(0, 1fr); }
.en-pane { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
.en-types { border-bottom: .5px solid var(--line); }
.en-step { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; margin: 0 0 12px; }
.en-step span {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--on-gold);
  display: grid; place-items: center; font-size: 15px; flex: none;
}
.en-step em { font-style: normal; font-weight: 600; color: var(--tint); font-size: 16px; margin-left: auto; }
.en-hint { font-size: 14px; color: var(--muted); line-height: 1.4; margin: -4px 0 14px; }
.en-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.en-tile {
  border: 0; background: var(--surface); color: var(--ink); border-radius: 16px; padding: 14px; min-height: 86px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; text-align: left;
  transition: transform .12s, box-shadow .15s, background-color .15s;
}
.en-tile-name { font-size: 17px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.en-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.en-tile-price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.en-tile.others .en-tile-price { color: var(--tint); }
.en-tile-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.en-tile.on { background: var(--gold-soft); box-shadow: inset 0 0 0 2.5px var(--gold); }
.en-tile.on .en-tile-price, .en-tile.on .en-tile-count { color: var(--ink); }
.en-tile.free { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.en-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.en-person-wrap { position: relative; display: flex; }
.en-person {
  flex: 1; min-width: 0; position: relative; border: 0; background: var(--surface); color: var(--ink); border-radius: 18px;
  min-height: 88px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; text-align: left;
  transition: transform .12s, box-shadow .2s;
}
.en-person.has { box-shadow: inset 0 0 0 2.5px var(--gold); }
.en-person-name { font-size: 21px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 44px; }
.en-person-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.en-person-count {
  position: absolute; top: 12px; right: 12px; background: var(--gold); color: var(--on-gold); border-radius: 99px;
  padding: 3px 10px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.en-minus {
  position: absolute; bottom: -8px; right: -8px; z-index: 1; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--red); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg);
}
.en-minus svg { width: 18px; height: 18px; stroke-width: 3; }
.en-more { display: block; margin: 18px auto 0; border: 0; background: none; color: var(--tint); font-size: 16px; font-weight: 600; padding: 8px 12px; }
.en-rest { margin-top: 12px; opacity: .8; }
.en-amount { margin-bottom: 14px; max-width: 280px; }
.en-tile:active, .en-person:active, .en-minus:active, .en-close:active, .en-undo:active { transform: scale(.97); }
body.entry-open .toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
/* Quer und Tablet: Strafen links, Kegler rechts */
@media (min-width: 820px) and (orientation: landscape), (min-width: 1000px) {
  .en-body { grid-template-rows: none; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .en-types { border-bottom: 0; border-right: .5px solid var(--line); }
  .en-pane { padding: 20px 22px calc(24px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 1100px) {
  .en-tiles { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
  .en-tile { min-height: 96px; }
  .en-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .en-person { min-height: 96px; }
}
/* Handy quer: wenig Höhe */
@media (orientation: landscape) and (max-height: 500px) {
  .en-head { min-height: 52px; padding: 6px 12px; }
  .en-tile { min-height: 70px; }
  .en-person { min-height: 70px; }
}
.en-title b, .en-title > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.en-title > span { display: block; }
.en-title .live-dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
@media (max-width: 600px) {
  .en-head { gap: 10px; padding: 8px 12px; }
  .en-title b { font-size: 18px; }
  .en-title > span { font-size: 13px; }
  .en-undo { padding: 6px 10px; max-width: 42vw; }
  .en-pane { padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .en-step { font-size: 17px; margin-bottom: 10px; }
  .en-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .en-tile { min-height: 68px; padding: 11px 12px; border-radius: 14px; }
  .en-tile-name { font-size: 15px; }
  .en-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .en-person { min-height: 74px; padding: 12px 14px; }
  .en-person-name { font-size: 19px; }
}

/* Kegelabend beenden: Hinweis auf andere Geräte */
.settle-sync { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; }
.settle-sync svg { flex: none; width: 18px; height: 18px; margin-top: 2px; opacity: .7; }
.settle-sync b { font-weight: 600; }

/* Austragen: Bestätigung mit Namen */
.confirm .confirm-tip { color: var(--ink); font-size: 14px; }
.confirm .field input { background: var(--sheet-bg); }
.confirm .field span { color: var(--ink); font-size: 14px; }
.pending-item .match-hint { margin: -2px 0 0; color: var(--ink); background: var(--gold-soft); border-radius: 10px; padding: 8px 10px; font-size: 14px; }

/* ---------- Teamgenerator ---------- */
.tg-setup { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tg-setup .hint { margin: 0 0 12px; }
.tg-stale { color: var(--red-text); }
.tg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tg-team { background: var(--fill); border-radius: 16px; padding: 14px; }
.tg-team header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.tg-team header small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 13px; }
.tg-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); font-size: 14px; font-weight: 700; flex: none; }
.tg-team ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.tg-grid.fresh .tg-team { animation: tg-in .35s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes tg-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .tg-grid.fresh .tg-team { animation: none; } }

/* ---------- Kegelrolf: Zufallsrad ---------- */
.kr-stage { position: relative; width: min(100%, 340px); margin: 4px auto 0; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .28)); }
.kr-wheel { display: block; width: 100%; height: auto; border-radius: 50%; will-change: transform; }
.kr-pointer { position: absolute; top: -6px; left: 50%; z-index: 1; width: 0; height: 0; transform: translateX(-50%);
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--red); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.kr-result { text-align: center; font-size: 20px; min-height: 30px; margin: 4px 0; }
.kr-result b { color: var(--gold); font-size: 26px; font-weight: 800; }
.kr-result.pop { animation: kr-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes kr-pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- Fehl-Regel: Antrittsgeld ---------- */
.antritt-note { margin: 8px 0 0; padding: 9px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; line-height: 1.35; color: var(--ink); }
.antritt-note b { font-weight: 700; }
.antritt-note.warn { background: var(--gold-soft); }
.antritt-note.high { background: var(--red-soft); }
.antritt-note.high b { color: var(--red-text); }
.antritt-group h4 { margin: 12px 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.antritt-group .name-chip small { opacity: .65; font-weight: 500; }
.name-chip.gold { background: var(--gold); color: var(--on-gold); font-weight: 700; }
.kr-wait { text-align: center; }

/* ---------- KC Filet: Königspartie (Vollbild) ---------- */
.kp-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px 24px; overscroll-behavior: contain; }
.kp-rule { margin: 0 0 12px; }
.kp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border-radius: 18px; padding: 6px 6px 8px; box-shadow: 0 1px 0 var(--line); }
.kp { border-collapse: separate; border-spacing: 4px 4px; width: 100%; min-width: 340px; }
.kp th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 2px 0; font-variant-numeric: tabular-nums; }
.kp thead th.on { color: var(--tint); }
.kp th.kp-name { text-align: left; font-size: 15px; font-weight: 650; color: var(--ink); padding-left: 6px; white-space: nowrap; max-width: 104px; overflow: hidden; text-overflow: ellipsis; }
.kp thead th.kp-name { font-size: 12px; color: var(--muted); }
.kp th.kp-name small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.kp tr.on th.kp-name { color: var(--tint); }
.kp td { padding: 0; text-align: center; }
.kp-cell {
  width: 100%; min-width: 30px; height: 40px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink);
  font: 700 18px/40px var(--font-round); font-variant-numeric: tabular-nums; display: block; padding: 0;
  transition: transform .1s, box-shadow .15s, background-color .15s;
}
.kp-cell.filled { background: var(--gold-soft); }
.kp-cell.on { box-shadow: inset 0 0 0 2.5px var(--gold); background: var(--surface); }
.kp-cell:active { transform: scale(.94); }
.kp td.kp-sum { font: 700 17px var(--font-round); min-width: 34px; color: var(--ink); }
.kp td.kp-pts { font: 800 17px var(--font-round); min-width: 30px; color: var(--tint); }
.kp-body .ledger.rank { margin-top: 4px; }
.kp-body .btn-block { margin-top: 14px; }
.kp-pad {
  flex: none; background: var(--bar); box-shadow: 0 -.5px 0 var(--line); padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.kp-pad-inner { max-width: 440px; margin: 0 auto; }
.kp-pad-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.kp-who { display: flex; flex-direction: column; min-width: 0; }
.kp-who b { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-who span { font-size: 13px; color: var(--muted); }
.kp-display {
  margin-left: auto; min-width: 92px; height: 48px; padding: 0 16px; border-radius: 14px; background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center end;
  font: 800 28px var(--font-round); font-variant-numeric: tabular-nums; color: var(--muted);
}
.kp-display.typed { color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--gold); }
.kp-pad-head .link-btn { padding: 4px 6px; }
.kp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kp-key.kp-back { background: transparent; box-shadow: none; font-size: 22px; color: var(--muted); }
.kp-key.kp-ok { background: var(--gold); color: var(--on-gold); box-shadow: none; display: grid; place-items: center; }
.kp-key.kp-ok svg { width: 26px; height: 26px; stroke-width: 2.6; }
.kp-key {
  height: 52px; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line);
  font: 700 24px var(--font-round); font-variant-numeric: tabular-nums; transition: transform .1s, background-color .1s;
}
.kp-key:active { transform: scale(.94); background: var(--gold); color: var(--on-gold); }
.kp-pad-foot { display: flex; justify-content: space-between; margin-top: 4px; }
.kp-pad-foot .link-btn { padding: 6px 4px; font-size: 15px; }
@media (min-width: 820px) {
  .kp-body { padding: 20px 24px 28px; max-width: 980px; margin: 0 auto; width: 100%; }
  .kp-pad { padding-left: max(24px, calc(50% - 466px)); padding-right: max(24px, calc(50% - 466px)); }
}

/* ---------- KC Filet: Weltrangliste ---------- */
.wr-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 20px 20px 18px; color: #fff; margin: 4px 0 16px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(200, 115, 63, .55), rgba(200, 115, 63, 0) 60%),
    linear-gradient(160deg, #3a3a3c, #161618);
  display: flex; flex-direction: column; gap: 2px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.wr-hero svg { position: absolute; right: 16px; top: 16px; width: 44px; height: 44px; color: #eaa173; opacity: .95; }
.wr-hero-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #eaa173; }
.wr-hero-name { font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 4px; padding-right: 56px; }
.wr-hero-pts { font: 700 20px var(--font-round); color: #fff; opacity: .92; }
.wr-hero-sub { font-size: 13px; color: rgba(235, 235, 245, .65); margin-top: 6px; }
.rank-row.me .row-title { color: var(--tint); }
