/* UHCevi Gossau – «Porzellan im Flutlicht» */

@font-face {
  font-family: 'Saira'; font-style: normal; font-weight: 600 900; font-stretch: 50% 125%; font-display: swap;
  src: url(fonts/saira.woff2) format('woff2');
}
@font-face {
  font-family: 'Saira'; font-style: italic; font-weight: 600 900; font-stretch: 50% 125%; font-display: swap;
  src: url(fonts/saira-italic.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter.woff2) format('woff2');
}

:root {
  --bg: #eef0f3;
  --text: #0b0c0f;
  --ink: #0b0c0f;
  --soft: #3d4049;
  --muted: #5f636c;
  --line: rgba(11, 12, 15, .09);
  --ice: #9fe7ff;
  --ice-ink: #03222c;
  --ice-deep: #0b6a85;
  --ice-soft: rgba(159, 231, 255, .12);
  --ice-rim: rgba(159, 231, 255, .45);
  --error: #a1121b;
  --warn: #7a4b00;

  --stage-bg: #0a0b0e;
  --stage-fill: linear-gradient(180deg, #14151b, #0a0b0e 60%);
  --stage-text: #f4f5f7;
  --stage-soft: #c8cad1;
  --stage-muted: #9195a0;
  --stage-line: rgba(255, 255, 255, .1);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 32px);
  --gap: 14px;
  --display: 'Saira', 'Arial Narrow', sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --porcelain: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(250,251,252,.9) 55%, rgba(241,243,246,.88) 100%);
  --porcelain-shadow: 0 0 0 1px rgba(16,20,30,.06), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(16,20,30,.04),
    0 1px 2px rgba(16,20,30,.06), 0 6px 14px -6px rgba(16,20,30,.10), 0 26px 54px -24px rgba(22,28,40,.2);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
::selection { background: var(--ice); color: var(--ice-ink); }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 60% at 50% 0, #f7f8fa, transparent 70%), var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible { outline: 2px solid var(--ice-deep); outline-offset: 3px; border-radius: 8px; }
.stage :focus-visible, .foot :focus-visible { outline-color: var(--ice); }

#app { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.content { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(60px, 8vw, 110px); }
.content > * + * { margin-top: var(--gap); }
.content > .sec-head { margin-top: clamp(40px, 6vw, 72px); }
.content > .sec-head:first-child { margin-top: 0; }

/* Typografie */
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.d {
  font-family: var(--display); font-style: italic; font-weight: 800; font-stretch: 62%;
  line-height: .86; letter-spacing: -.005em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.c {
  font-family: var(--display); font-style: normal; font-weight: 700; font-stretch: 72%;
  letter-spacing: .05em; text-transform: uppercase;
}
.eyebrow, .meta-label {
  font: 600 12px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { color: var(--ice-deep); }
.stage .eyebrow { color: var(--ice); }
.stage .meta-label { color: var(--stage-muted); }

.chrome {
  background: linear-gradient(176deg, #4a4e58 0%, #0b0c0f 44%, #24272e 70%, #6a6e78 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stage .chrome { background-image: linear-gradient(178deg, #fff 18%, #dfe1e6 52%, #9ea1aa 96%); }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.stage .outline { -webkit-text-stroke-color: var(--stage-text); }
.lit { color: #fff; text-shadow: 0 0 42px rgba(255,255,255,.35); }

h2.d { font-size: clamp(40px, 5.6vw, 72px); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; }
.error { color: var(--error); font-weight: 600; font-size: 14px; }
.warn { color: var(--warn); font-weight: 600; }
a { color: var(--ice-deep); }

/* Sektionskopf */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sec-head > div { display: flex; flex-direction: column; gap: 10px; }
.sec-head .count { font: 600 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; }
.sec-link {
  font: 600 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--text);
  text-decoration: none; padding: 6px 0; border-bottom: 1.5px solid currentColor; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer;
}
.sec-link .arr { display: inline-block; transition: transform .25s var(--ease); }
.sec-link:hover .arr { transform: translateX(3px); }

/* Flutlicht-Bühne */
.stage {
  position: relative; isolation: isolate; overflow: hidden;
  color: var(--stage-text);
  background:
    radial-gradient(60% 70% at 50% -10%, rgba(255,255,255,.26), transparent 70%),
    radial-gradient(40% 60% at 8% -10%, rgba(214,226,255,.16), transparent 70%),
    radial-gradient(40% 60% at 92% -10%, rgba(220,232,255,.16), transparent 70%),
    var(--stage-fill);
  background-color: var(--stage-bg);
}
.stage::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--grain); opacity: .1; mix-blend-mode: overlay;
}
.stage .muted, .stage .hint { color: var(--stage-muted); }
.ghost-digit {
  position: absolute; z-index: -1; right: 2%; bottom: -.1em; pointer-events: none; user-select: none;
  font: italic 900 clamp(260px, 46vw, 640px)/.8 var(--display); font-stretch: 56%;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.16);
  -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 92%); mask-image: linear-gradient(180deg, #000 20%, transparent 92%);
}

/* Seitenkopf */
.pagehead {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vw), 0 100%);
  padding: calc(env(safe-area-inset-top) + 104px) 0 calc(4vw + 40px);
}
.pagehead .wrap { display: flex; flex-direction: column; gap: 18px; }
.pagehead h1 { font-size: clamp(64px, 11vw, 150px); display: flex; flex-direction: column; gap: .04em; }
.pagehead h1 span { padding-right: .06em; }
.pagehead .head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.pagehead h1 .outline, .login h1 .outline { font-size: .74em; }

/* Kopfzeile: schwebende Glas-Pille */
.topbar {
  position: fixed; z-index: 10; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 12px);
  width: calc(100% - 2 * var(--gutter)); max-width: calc(1280px - 2 * var(--gutter)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 20px; border-radius: 999px;
  background: rgba(250,251,252,.72); border: 1px solid rgba(255,255,255,.7);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 18px 44px -18px rgba(16,20,30,.3), inset 0 1px 0 rgba(255,255,255,.9);
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.topbar.on-dark {
  background: rgba(16,17,22,.62); border-color: rgba(255,255,255,.09); color: var(--stage-text);
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand .d { font-size: 26px; }
.brand .c { font-size: 14px; color: var(--muted); }
.topbar.on-dark .brand .c { color: var(--stage-muted); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  font: 600 14px/1 var(--sans); color: inherit; text-decoration: none;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.nav a:hover { background: rgba(11,12,15,.06); }
.topbar.on-dark .nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: var(--ink); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.topbar.on-dark .nav a.active { background: #fff; color: var(--ink); }
.nav svg { width: 20px; height: 20px; }
.topbar .nav svg { display: none; }

.tabbar { display: none; }

@media (max-width: 860px) {
  .topbar .nav { display: none; }
  .tabbar {
    position: fixed; z-index: 10; left: 50%; transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom) + 12px);
    display: flex; padding: 6px; border-radius: 999px; width: min(calc(100% - 2 * var(--gutter)), 420px);
    background: rgba(250,251,252,.72); border: 1px solid rgba(255,255,255,.7);
    -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 18px 44px -18px rgba(16,20,30,.3), inset 0 1px 0 rgba(255,255,255,.9);
  }
  .tabbar a { flex: 1; flex-direction: column; gap: 3px; padding: 8px 0 7px; font-size: 11px; letter-spacing: .02em; justify-content: center; }
  .content { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
}

/* Sync-Status */
.sync {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 12px; border-radius: 999px; color: var(--muted);
}
.topbar.on-dark .sync { color: var(--stage-muted); }
.sync::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.sync-idle::before { background: var(--ice-deep); opacity: 1; }
.topbar.on-dark .sync-idle::before { background: var(--ice); box-shadow: 0 0 8px var(--ice); }
.sync-offline, .sync-pending { background: #fff; color: var(--warn) !important; box-shadow: 0 0 0 1px rgba(122,75,0,.2); }
.sync-error, .sync-auth { background: #fff; color: var(--error) !important; box-shadow: 0 0 0 1px rgba(161,18,27,.2); }

/* Buttons */
.btn {
  appearance: none; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: 700 15px/1.2 var(--sans); color: var(--text);
  background: rgba(255,255,255,.7); border: 1px solid rgba(16,20,30,.1);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16,20,30,.06);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; transform: none; cursor: default; }
.btn .arr { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn.primary { background: var(--ice); color: var(--ice-ink); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.btn.primary:hover { box-shadow: 0 0 0 5px rgba(159,231,255,.18), 0 0 40px rgba(159,231,255,.35), inset 0 1px 0 rgba(255,255,255,.6); }
.btn.ink { background: var(--ink); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 14px -6px rgba(16,20,30,.3); }
.stage .btn:not(.primary):not(.ink) { background: rgba(255,255,255,.06); color: var(--stage-text); border-color: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.stage .btn.ink { background: #fff; color: var(--ink); }
.btn.danger { color: var(--error); }
.btn.dashed { border-style: dashed; color: var(--muted); background: transparent; box-shadow: none; }
.btn.big { padding: 18px 26px; font-size: 16px; }
.btn.full { width: 100%; }
.link {
  background: none; border: 0; padding: 4px; cursor: pointer; color: inherit;
  font: 600 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px;
}
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; cursor: pointer;
  border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid rgba(16,20,30,.1); color: var(--text);
  transition: transform .25s var(--ease);
}
.icon-btn:hover { transform: translateY(-2px); }
.stage .icon-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: var(--stage-text); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }
.actions.sticky {
  position: sticky; bottom: calc(env(safe-area-inset-bottom) + 92px); z-index: 4;
  padding: 16px 0 0; background: linear-gradient(transparent, var(--bg) 40%);
}
@media (min-width: 861px) { .actions.sticky { bottom: 16px; } }

/* Segment-Schalter */
.seg {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: rgba(11,12,15,.06); box-shadow: inset 0 1px 2px rgba(16,20,30,.08);
}
.seg.full { display: flex; }
.seg button {
  flex: 1; min-width: 44px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: none; color: var(--muted); font: 600 14px/1 var(--sans);
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,20,30,.1), 0 4px 10px -4px rgba(16,20,30,.18), inset 0 1px 0 #fff; }
.seg.small { padding: 3px; }
.seg.small button { min-width: 32px; min-height: 32px; padding: 0 6px; font: 700 15px/1 var(--display); font-stretch: 72%; }
.stage .seg { background: rgba(255,255,255,.06); box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.stage .seg button { color: var(--stage-muted); }
.stage .seg button.on { background: #fff; color: var(--ink); }

/* Chips (aktiv = Eisblau) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 9px 16px; border-radius: 999px; cursor: pointer; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06); color: var(--stage-soft); font: 600 14px/1 var(--sans);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chip.on { background: var(--ice); color: var(--ice-ink); border-color: transparent; box-shadow: 0 0 24px rgba(159,231,255,.25); }

/* Porzellan-Karte */
.card {
  position: relative; border-radius: 22px; padding: 22px;
  background: var(--porcelain); border: 1px solid rgba(255,255,255,.95); box-shadow: var(--porcelain-shadow);
}
.fx { transform-style: preserve-3d; transition: transform .7s var(--ease), box-shadow .35s var(--ease); }
.fx::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.7), transparent 70%);
  transition: opacity .3s var(--ease);
}
.fx:hover::before { opacity: 1; }
.stage .fx::before { background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.1), transparent 70%); }

.glass {
  border-radius: 22px; padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}

/* Formulare */
.form { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 8px; font: 600 11px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
input, select {
  font: 400 16px/1.3 var(--sans); color: var(--text); background: #fff; min-height: 48px; padding: 12px 14px;
  border: 1px solid rgba(16,20,30,.14); border-radius: 14px; box-shadow: inset 0 1px 2px rgba(16,20,30,.06);
  letter-spacing: normal; text-transform: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(11,12,15,.1), inset 0 1px 2px rgba(16,20,30,.06); }
select { appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0c0f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.stage select { background-color: rgba(255,255,255,.06); color: var(--stage-text); border-color: rgba(255,255,255,.14); box-shadow: none; border-radius: 999px; min-height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f5f7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.stage select:focus { border-color: var(--ice); box-shadow: 0 0 0 4px rgba(159,231,255,.15); }
.stage select option { color: var(--text); }
label.check { flex-direction: row; align-items: center; gap: 12px; font: 400 16px/1.3 var(--sans); letter-spacing: normal; text-transform: none; color: var(--text); cursor: pointer; }
label.check input { width: 20px; height: 20px; min-height: 0; padding: 0; flex-shrink: 0; accent-color: var(--ink); box-shadow: none; }
.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 140px; }
.row .seg { min-height: 48px; align-items: stretch; }

/* Listen (Haarlinien in Porzellan) */
.list { list-style: none; margin: 0; padding: 4px 0; overflow: hidden; }
.list:empty { display: none; }
.list li + li { border-top: 1px solid var(--line); }
.list.card { padding: 4px 0; }
.player-row, .event-row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 20px;
  color: var(--text); background: none; border: 0; font: inherit; text-align: left; text-decoration: none;
}
.event-row { cursor: pointer; transition: background .2s var(--ease); }
button.event-row:hover, button.player-row:not(:disabled):hover { background: rgba(11,12,15,.03); }
div.event-row { cursor: default; }
.player-row { cursor: pointer; }
.player-row:disabled { cursor: default; }
.player-row .name { flex: 1; font-weight: 600; }
.player-row .pos { font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.num { font: italic 800 24px/1 var(--display); font-stretch: 62%; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; color: var(--muted); }

/* Spielkarten (Bento) */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: var(--gap); list-style: none; padding: 0; margin: 0; }
.match-card {
  display: flex; flex-direction: column; gap: 18px; padding: 20px 22px; color: var(--text); text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 0 100%);
}
.match-card .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.match-card .date { font-size: 30px; }
.match-card .bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.match-card .opp { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.match-card .opp .c { font-size: 20px; line-height: 1.1; overflow-wrap: anywhere; }
.match-card.home {
  background: linear-gradient(180deg, rgba(159,231,255,.16), rgba(159,231,255,.04)), var(--porcelain);
  border-color: var(--ice-rim);
  box-shadow: 0 0 0 1px var(--ice-rim), inset 0 1px 0 rgba(159,231,255,.6), 0 1px 2px rgba(16,20,30,.06), 0 26px 54px -24px rgba(11,106,133,.32);
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  background: rgba(11,12,15,.06); color: var(--muted);
}
.badge.home { background: var(--ice); color: var(--ice-ink); box-shadow: 0 0 18px rgba(159,231,255,.55); }

/* Resultat-Box */
.result {
  display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 8px 12px 6px; border-radius: 10px;
  font: italic 800 24px/1 var(--display); font-stretch: 75%; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.result.win { background: var(--ink); color: #fff; }
.result.draw { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.result.loss { background: rgba(127,130,140,.12); color: var(--muted); }
.result.open { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }

/* Team-Etikett */
.team-tag {
  display: inline-block; padding: 5px 14px 4px; max-width: 100%;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  font: 700 13px/1.2 var(--display); font-stretch: 75%; letter-spacing: .05em; text-transform: uppercase;
  background: var(--ink); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stage .team-tag { background: #fff; color: var(--ink); }

/* Live-Badge */
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: var(--ink); color: #fff; font: 600 11px/1 var(--sans); letter-spacing: .14em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.live-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 10px var(--ice); animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .35; box-shadow: 0 0 2px var(--ice); } }

/* Spieltag-Bühne (Anzeigetafel) */
.matchstage {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6vw), 0 100%);
  padding: calc(env(safe-area-inset-top) + 100px) 0 calc(6vw + 40px);
}
.matchstage.compact { padding-top: calc(env(safe-area-inset-top) + 88px); padding-bottom: calc(6vw + 20px); }
.matchstage.compact .wrap { gap: 16px; }
.matchstage .wrap { display: flex; flex-direction: column; gap: 22px; }
.matchstage .meta-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scoreline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(12px, 3vw, 40px); }
.scoreline .side { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.scoreline .side.them { align-items: flex-end; text-align: right; }
.scoreline .side .c { font-size: clamp(16px, 2.4vw, 24px); color: var(--stage-soft); overflow-wrap: anywhere; line-height: 1.15; }
.scoreline .score { font-size: clamp(88px, 16vw, 200px); display: flex; align-items: center; gap: .08em; }
.scoreline .score .sep { font-size: .5em; color: var(--stage-muted); }
.matchstage.compact .scoreline .score { font-size: clamp(72px, 13vw, 150px); }

/* Live-Erfassung */
.live-controls { display: flex; flex-direction: column; gap: 12px; }
.live-controls .ctl { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.event-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.event-buttons .goal { grid-column: 1 / -1; padding: 26px; font-size: 20px; }
.event-buttons .btn { padding: 20px; font-size: 17px; }

.events .ev-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.events .ev-main strong { font-weight: 600; }
.events small { color: var(--muted); font-size: 13px; }
.ev-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  font: italic 800 22px/1 var(--display); font-stretch: 75%;
}
.ev-icon.goal { background: var(--ink); color: #fff; }
.ev-icon.against { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.ev-icon.penalty { background: rgba(127,130,140,.12); color: var(--muted); }

/* Spieler-Raster */
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.player-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 76px; padding: 10px 6px; border-radius: 18px; cursor: pointer; color: var(--text); font: inherit;
  background: var(--porcelain); border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 0 0 1px rgba(16,20,30,.06), inset 0 1px 0 #fff, 0 1px 2px rgba(16,20,30,.06), 0 6px 14px -6px rgba(16,20,30,.10);
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.player-btn:active { transform: scale(.97); }
.player-btn .num { font-size: 30px; color: var(--text); text-align: center; min-width: 0; }
.player-btn .name { font-size: 13px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; color: var(--soft); }
.player-btn.selected { background: var(--ice); border-color: transparent; box-shadow: 0 0 0 1px var(--ice-rim), 0 0 24px rgba(159,231,255,.45), inset 0 1px 0 rgba(255,255,255,.6); }
.player-btn.selected .num, .player-btn.selected .name { color: var(--ice-ink); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.step-q { font-size: 30px; }
.step-q small { display: block; margin-top: 8px; font: 400 14px/1.4 var(--sans); text-transform: none; color: var(--muted); }
.group-label { margin-top: 8px; }
.meta { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Bottom Sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10,11,14,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fade .25s var(--ease);
}
.sheet {
  width: 100%; max-width: 760px; max-height: 92vh; display: flex; flex-direction: column;
  background: radial-gradient(120% 40% at 50% 0, #f7f8fa, transparent 70%), var(--bg);
  border-radius: 30px 30px 0 0; box-shadow: inset 0 1px 0 #fff, 0 -20px 60px -20px rgba(0,0,0,.4);
  animation: up .35s var(--ease);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 16px 8px 24px; }
.sheet-head h2 { font-size: 40px; }
.sheet-body { overflow-y: auto; padding: 8px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.sheet-foot {
  display: flex; gap: 10px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(250,251,252,.8);
}
.sheet-foot .btn { flex: 1; }

/* Kennzahlen: Haarlinien-Bento auf der Bühne */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 10px;
  background: var(--stage-line); border-radius: 22px; overflow: hidden; border: 1px solid var(--stage-line);
}
.kpis > div { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; background: #0d0e12; }
.kpis strong { font-size: clamp(64px, 7vw, 104px); font-weight: 800; }
.kpis .wide { grid-column: span 2; }
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* Tabelle */
.table-wrap { overflow-x: auto; padding: 6px 0; }
table.stats { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stats th, .stats td { padding: 12px 10px; text-align: right; white-space: nowrap; }
.stats th:first-child, .stats td:first-child { padding-left: 20px; }
.stats th:last-child, .stats td:last-child { padding-right: 20px; }
.stats th {
  font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  cursor: pointer; user-select: none; border-bottom: 1px solid var(--line);
}
.stats th.sorted { color: var(--ice-deep); }
.stats .left { text-align: left; }
.stats tbody tr + tr td { border-top: 1px solid var(--line); }
.stats td.rank { font: italic 800 22px/1 var(--display); font-stretch: 62%; color: var(--muted); }
.stats td.name { font-weight: 600; }
.stats td.pts { font: italic 800 24px/1 var(--display); font-stretch: 62%; }
.stats td.neg { color: var(--muted); }

/* Setup */
.setup-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 10px 20px; }
.setup-list label.check { min-width: 0; flex: 1; }
.setup-list label.check .pname { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.setup-list .seg { flex-shrink: 0; }
.setup-list li.out { opacity: .5; }
.setup-list .num { font-size: 22px; min-width: 1.6ch; }
.setup-list .pos { font: 600 11px/1 var(--sans); letter-spacing: .12em; color: var(--muted); }

/* Footer: dunkles Band */
.foot {
  clip-path: polygon(0 4vw, 100% 0, 100% 100%, 0 100%);
  padding: calc(4vw + 36px) 0 calc(40px + env(safe-area-inset-bottom));
}
.foot .wrap { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.foot .club { font-size: 15px; color: var(--stage-soft); }
.foot .who { display: flex; align-items: center; gap: 14px; color: var(--stage-muted); font-size: 14px; }
@media (max-width: 860px) { .foot { padding-bottom: calc(110px + env(safe-area-inset-bottom)); } }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; padding: 48px 0; }
.login .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.login h1 { font-size: clamp(60px, 10.5vw, 168px); display: flex; flex-direction: column; gap: .04em; }
.login .intro { display: flex; flex-direction: column; gap: 20px; }
.login .glass { display: flex; flex-direction: column; gap: 16px; padding: 26px; }
.login .glass label { color: var(--stage-muted); }
.login .glass input { background: rgba(255,255,255,.96); }
.login .glass input:focus { border-color: var(--ice); box-shadow: 0 0 0 4px rgba(159,231,255,.2); }
.login .error { color: #fff; background: rgba(161,18,27,.85); padding: 10px 14px; border-radius: 14px; }
.stagebox {
  clip-path: polygon(0 0, calc(100% - 64px) 0, 100% 64px, 100% 100%, 64px 100%, 0 calc(100% - 64px));
  border-radius: 30px;
}
@media (max-width: 860px) {
  .login .wrap { grid-template-columns: 1fr; }
}

/* Einblenden beim Scrollen */
.rv { opacity: 0; transform: translateY(36px) scale(.985); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }

@media (max-width: 600px) {
  .match-card .date { font-size: 28px; }
  .card { padding: 18px; }
  .list.card, .table-wrap.card { padding-left: 0; padding-right: 0; }
  .player-row, .event-row { padding: 14px 18px; }
  .sheet-head { padding-left: 18px; }
  .sheet-body { padding-left: 18px; padding-right: 18px; }
  .sheet-foot { padding-left: 18px; padding-right: 18px; }
  .stagebox { clip-path: polygon(0 0, calc(100% - 36px) 0, 100% 36px, 100% 100%, 36px 100%, 0 calc(100% - 36px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
}

/* Schatten für Karten mit abgeschnittener Ecke (clip-path schneidet box-shadow ab) */
.match-grid > li { filter: drop-shadow(0 1px 1px rgba(16,20,30,.08)) drop-shadow(0 18px 22px rgba(22,28,40,.12)); }
.match-grid > li:has(.home) { filter: drop-shadow(0 0 1px rgba(159,231,255,.9)) drop-shadow(0 18px 24px rgba(11,106,133,.2)); }

@media (max-width: 600px) {
  .stats th, .stats td { padding: 12px 6px; }
  .stats th:first-child, .stats td:first-child { padding-left: 16px; }
  .stats th:last-child, .stats td:last-child { padding-right: 16px; }
}

/* Mobile: alles eine Stufe kompakter */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .pagehead { padding: calc(env(safe-area-inset-top) + 84px) 0 calc(4vw + 28px); }
  .pagehead .wrap { gap: 14px; }
  .pagehead h1 { font-size: 46px; }
  .login h1 { font-size: 52px; }
  h2.d { font-size: 32px; }
  .sheet-head h2 { font-size: 28px; }
  .step-q { font-size: 22px; }
  .content { padding-top: 24px; }
  .content > .sec-head { margin-top: 36px; }
  .sec-head > div { gap: 6px; }
  .eyebrow, .meta-label { font-size: 11px; letter-spacing: .12em; }
  .ghost-digit { font-size: 220px; }

  .topbar { padding: 6px 6px 6px 16px; }
  .brand .d { font-size: 21px; }
  .brand .c { font-size: 12px; }
  .sync { padding: 8px 10px; font-size: 10px; }

  .btn { padding: 12px 18px; font-size: 14px; }
  .btn.big { padding: 14px 20px; font-size: 15px; }
  .icon-btn { width: 40px; height: 40px; }
  .seg button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .chip { padding: 8px 14px; font-size: 13px; }

  .matchstage { padding: calc(env(safe-area-inset-top) + 80px) 0 calc(6vw + 28px); }
  .matchstage.compact { padding-top: calc(env(safe-area-inset-top) + 76px); padding-bottom: calc(6vw + 16px); }
  .matchstage .wrap, .matchstage.compact .wrap { gap: 14px; }
  .scoreline .score, .matchstage.compact .scoreline .score { font-size: 60px; }
  .scoreline .side .c { font-size: 15px; }
  .team-tag { font-size: 12px; padding: 4px 12px 3px; }

  .event-buttons { gap: 10px; }
  .event-buttons .goal { padding: 20px; font-size: 17px; }
  .event-buttons .btn { padding: 16px; font-size: 15px; }

  .match-card { gap: 12px; padding: 16px 18px; }
  .match-card .date { font-size: 24px; }
  .match-card .opp .c { font-size: 17px; }
  .result { min-width: 54px; font-size: 20px; padding: 7px 10px 5px; }
  .badge { padding: 5px 9px; font-size: 10px; }

  .kpis > div { padding: 14px 16px; gap: 6px; }
  .kpis strong { font-size: 44px; }

  .num { font-size: 20px; }
  .player-row, .event-row { padding: 12px 16px; gap: 12px; }
  .ev-icon { width: 34px; height: 34px; font-size: 18px; }
  .events small { font-size: 12px; }
  .player-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .player-btn { min-height: 64px; border-radius: 16px; }
  .player-btn .num { font-size: 24px; }
  .player-btn .name { font-size: 12px; }
  .stats td.rank { font-size: 18px; }
  .stats td.pts { font-size: 20px; }
  .stats th, .stats td { padding: 10px 6px; font-size: 14px; }
  .stats th { font-size: 10px; }
  .setup-list li { padding: 8px 10px 8px 16px; }
  .setup-list .num { font-size: 18px; }
  .seg.small button { min-width: 30px; min-height: 30px; font-size: 14px; }

  .tabbar a { padding: 6px 0 5px; font-size: 10px; }
  .tabbar svg { width: 18px; height: 18px; }
  .foot { padding-top: calc(4vw + 24px); }
  .foot .club, .foot .who { font-size: 13px; }
}
