/* =========================================================================
   Wild Wings Tippspiel – Design-System  ·  Konzept: „Arena-Anzeigetafel & Eis"
   - Signature: Spiel = Scoreboard-Panel mit roter Mittellinie (Center-Line).
   - Blaue Haarlinien = Blue Lines als Sektionstrenner.
   - Eine mutige Farbe (Eishockey-Rot) diszipliniert eingesetzt.
   - Vereins-Navy/Weiß als Basis. Dunkles Theme = Engagement (Color-Prinzip 9).
   ========================================================================= */
:root {
    /* Eis & Board */
    --ice-deep:   #04182b;   /* Seitenbasis (tiefes Navy) */
    --ice-deep-2: #06233c;
    --board:      #0a2a48;   /* Karten/Scoreboard */
    --board-2:    #0e355a;
    --board-in:   #061f36;   /* eingelassene Score-Fläche */
    --line:       rgba(120,170,220,.16);
    --line-soft:  rgba(120,170,220,.10);

    /* Akzente */
    --blue:       #2b8fd6;   /* Akzent / aktiv (Blue Line) */
    --link:       #74baf0;   /* Text-Links – heller für besseren Kontrast auf Dunkel */
    --blue-cta:   #1673c4;   /* Primär-Button (weißer Text: 4.9:1 AA) */
    --blue-cta-h: #1774c9;   /* Verlauf-Oberkante – abgedunkelt auf 4.8:1 AA (war #1e84dc = 3.9:1) */
    --red:        #e01f2b;   /* Center-Line / live / Gefahr (die EINE mutige Farbe) */
    --red-ink:    #ff8a8f;
    --gold:       #f4c14e;   /* Spitzenreiter / Punkte-Highlight */

    /* Text */
    --ink:        #eef5fc;
    --ink-2:      #b9cde3;   /* sekundär */
    --muted:      #9db4d0;   /* tertiär / Labels (aufgehellt für besseren Kontrast) */

    /* Funktion */
    --success:    #34c77b;
    --success-bg: #0c3a2c;
    --warn:       #f2a63a;
    --danger-bg:  #3a1418;

    --radius:     16px;
    --radius-sm:  10px;
    --shadow:     0 10px 30px rgba(0,0,0,.38);
    --shadow-sm:  0 4px 14px rgba(0,0,0,.30);
    --maxw:       680px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Das hidden-Attribut muss immer gewinnen – sonst „durchbrechen" Klassen mit
   display:… (z. B. .install-card) das Verstecken (Install-Banner sonst überall). */
[hidden] { display: none !important; }
html {
    -webkit-text-size-adjust: 100%;
    /* Native-App-Gefühl: kein Browser-Pull-to-Refresh / Overscroll-Chaining. */
    overscroll-behavior-y: none;
    /* Kein grauer/blauer Tap-Flash beim Antippen (iOS/Android). */
    -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    margin: 0;
    min-height: 100vh;  /* Fallback: aeltere Browser kennen dvh nicht und wuerfen die Zeile sonst weg */
    min-height: 100dvh;
    background: var(--ice-deep);
    background-image:
        radial-gradient(1100px 460px at 50% -8%, #0c3a63 0%, rgba(12,58,99,0) 62%),
        linear-gradient(180deg, #051d33 0%, var(--ice-deep) 40%);
    background-repeat: no-repeat;
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    /* Crisper, „app-like" Textrendering. */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Firefox (und teils WebKit) vererbt die Seitenschrift nicht zuverlässig an
   native Formularfelder. Ohne explizite Familie fallen Inputs/Buttons unter
   Windows auf „MS Shell Dlg 2“ zurück und sehen je Browser sichtbar anders aus. */
button, input, select, textarea { font-family: inherit; }

/* ---- Typografie -------------------------------------------------------- */
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.1; }
h1 {
    font-size: clamp(1.55rem, 6vw, 2rem);
    font-weight: 800; letter-spacing: -.01em;
}
h2 {
    font-size: .82rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .12em; color: var(--ink-2);
}
.eyebrow {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em;
    color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: .82rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 700; }
/* Grundgröße in em: Ohne sie fielen Icons in Kontexten ohne eigene Regel auf ihre
   SVG-Attribute (24px) zurück – z. B. 24px-Stern neben 11px-Text im Bonus-Kartenkopf.
   Kontext-Regeln unten (Buttons, Pills, Tabbar …) überschreiben das gezielt. */
.ic { flex: none; width: 1.1em; height: 1.1em; vertical-align: -.15em; }

/* ---- Layout ----------------------------------------------------------- */
/* Unterer Freiraum in rem statt px: Top-/Tabbar sind rem-basiert und wachsen mit
   der Android-Textskalierung mit (Tabbar 63px → 93px bei 130 % → 108px bei 160 %).
   Mit dem früheren festen 88px-Polster verdeckte die Leiste ab ~130 % den letzten
   Inhalt der Seite. 5.5rem skaliert mit und hält den Abstand konstant. */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 1.1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
.section-title { display: flex; align-items: center; gap: .7rem; margin: 1.6rem 0 .7rem; }
.section-title h2 { margin: 0; flex: none; }
.section-title .rule { flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--blue), rgba(43,143,214,0)); opacity: .45; }
.section-title .section-link { flex: none; }
hr.blueline { border: none; height: 2px; background: linear-gradient(90deg, var(--blue), rgba(43,143,214,0)); opacity: .5; margin: 1.2rem 0; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; } .center { text-align: center; }

/* ---- Topbar ----------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; margin-bottom: .3rem;
    background: rgba(4,24,43,.82); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(150deg, #1e84dc, #0c4f8c);
    color: #fff; box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255,255,255,.12);
}
.brand-mark .crest { width: 26px; height: 26px; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.02; }
.brand-text .bt-1 { font-weight: 800; font-size: 1.02rem; letter-spacing: .01em; }
.brand-text .bt-1 span { color: var(--blue); }
.brand-text small { color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--board-2); border: 1px solid var(--line); font-weight: 800; font-size: .78rem; color: #dbe8f6; }
.iconbtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--muted); }
.iconbtn .ic { width: 20px; height: 20px; }
.iconbtn:hover { color: var(--red-ink); background: rgba(224,31,43,.10); text-decoration: none; }

/* ---- Bottom-Tabbar (Daumenzone) --------------------------------------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-around;
    background: rgba(5,26,45,.94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom));
}
.tabbar a {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    justify-content: center; min-height: 52px; padding: .3rem .1rem;
    color: var(--muted); font-size: .66rem; font-weight: 600; text-decoration: none;
}
.tabbar a .ic { width: 23px; height: 23px; }
.tabbar a:hover { color: var(--ink-2); }
.tabbar a.active { color: #fff; }
.tabbar a.active::before { /* aktiver Reiter oben */
    content: ""; position: absolute; top: -1px; width: 30px; height: 3px; border-radius: 0 0 3px 3px;
    background: var(--blue); box-shadow: 0 0 10px rgba(43,143,214,.7);
}

/* ---- Karten / Board --------------------------------------------------- */
.card {
    background: linear-gradient(180deg, var(--board) 0%, var(--ice-deep-2) 100%);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem; margin-bottom: .85rem; box-shadow: var(--shadow-sm);
}
.card.tight { padding: .7rem .8rem; }

/* ---- Scoreboard-Spielpanel -------------------------------------------- */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.scoreboard {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .4rem;
    background: var(--board-in); border: 1px solid var(--line-soft); border-radius: 12px;
    padding: .85rem .6rem; position: relative; overflow: hidden;
}
/* Antippbare Paarung → Spiel-Detailseite (alle Tipps ab Anpfiff). */
.scoreboard-link { text-decoration: none; color: inherit; cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease; }
.scoreboard-link::after { content: '\203A'; position: absolute; top: 2px; right: 11px;
    color: var(--muted); font-weight: 800; font-size: 1.1rem; line-height: 1; opacity: .6; }
.scoreboard-link:hover, .scoreboard-link:focus-visible {
    border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); outline: none; text-decoration: none; }
.scoreboard-link:hover::after, .scoreboard-link:focus-visible::after { color: var(--link); opacity: 1; }
.scoreboard .team { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; min-width: 0; }
.crest-badge { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
    background: var(--cbg, #1f6fb2); color: var(--cfg, #fff); font-weight: 800; font-size: .66rem; letter-spacing: .02em;
    border: 1px solid rgba(255,255,255,.16); box-shadow: var(--shadow-sm); flex: none; }
.crest-badge.crest-img { background: transparent; border: none; box-shadow: none; }
.crest-badge.crest-img img { width: 40px; height: 40px; object-fit: contain; }
.crest-badge.crest-sm { width: 26px; height: 26px; border-radius: 7px; font-size: .5rem; }
.crest-badge.crest-sm.crest-img img { width: 26px; height: 26px; }
.team .tname { font-weight: 700; font-size: .95rem; line-height: 1.12; }
.team.is-ww .tname { color: #fff; }
.team .tabbr { font-size: .68rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.ww-tag { display: inline-block; font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    color: var(--gold); }

.center-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 .55rem; min-width: 74px; }
.score { position: relative; font-weight: 800; font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: .02em;
    color: #fff; text-shadow: 0 0 14px rgba(120,190,255,.28); display: flex; align-items: baseline; gap: .12rem; }
.score .sep { color: var(--muted); }
.score.pending { color: var(--muted); font-size: 1.15rem; text-shadow: none; }
.decision { font-size: .6rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
/* Voll ausgeschriebene Entscheidung (Spiel-Detail): eigene, zentrierte Zeile
   unter dem Scoreboard – so quetscht der lange Text die Teamnamen nicht. */
.decision-note { text-align: center; font-size: .64rem; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); margin: .55rem 0 0; }

/* ---- Meta / Pills / Clock --------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .66rem; font-weight: 800;
    padding: .2rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; }
.pill .ic { width: 13px; height: 13px; }
.pill-open   { background: rgba(43,143,214,.24); color: #cfe6ff; }
.pill-live   { background: rgba(224,31,43,.16); color: var(--red-ink); }
.pill-done   { background: rgba(120,160,200,.14); color: var(--ink-2); }
.pill-cancel { background: rgba(120,160,200,.10); color: var(--muted); }
.pill-points { background: rgba(244,193,78,.16); color: var(--gold); }

.clock { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; font-variant-numeric: tabular-nums;
    font-size: .85rem; color: var(--ink-2); }
.clock .ic { width: 15px; height: 15px; color: var(--muted); }
.clock .cd.soon  { color: var(--warn); }
.clock .cd.today { color: var(--red-ink); }
.clock:has(.cd.soon)  .ic { color: var(--warn); }
.clock:has(.cd.today) .ic { color: var(--red-ink); }

/* ---- Tipp-Eingabe (Scoreboard-Style) ---------------------------------- */
.tip-form { margin-top: .75rem; }
.tip-inputs { display: flex; align-items: center; justify-content: center; gap: .45rem; }
.tip-inputs .cell { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.tip-inputs .cell .side { font-size: .64rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
/* Zahl ist der Held, +/− sind dezente Kreis-Buttons drumherum (sekundär). */
.stepper { display: flex; align-items: center; gap: .3rem; }
.stepper .step {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--line); background: transparent; color: var(--muted);
    font-size: 1.2rem; font-weight: 600; line-height: 1; cursor: pointer;
    display: grid; place-items: center; user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: background .12s, border-color .12s, color .12s;
}
.stepper .step:hover { border-color: var(--blue); color: #fff; }
.stepper .step:active { background: var(--blue); border-color: var(--blue); color: #04182b; }
.tip-inputs input[type=number] {
    flex: 0 0 auto; width: 54px; text-align: center; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums;
    color: #fff; background: var(--board-in); border: 1px solid var(--line); border-radius: 12px;
    padding: .35rem .1rem; min-height: 58px; -moz-appearance: textfield;
}
.tip-inputs input::-webkit-outer-spin-button, .tip-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tip-inputs .colon { font-size: 1.3rem; font-weight: 800; color: var(--muted); }

/* ---- PWA-Installieren-Hinweis (dezent unten, über den Footer-Links) ---- */
.install-card {
    display: grid; align-items: center; gap: .5rem .7rem;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "ic txt close" "btn btn btn";
    background: linear-gradient(180deg, var(--board) 0%, var(--ice-deep-2) 100%);
    border: 1px solid var(--blue); border-radius: var(--radius);
    padding: .75rem .8rem; margin: 1.2rem 0 .4rem; box-shadow: var(--shadow-sm);
    animation: installFade .3s ease-out;
}
@keyframes installFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .install-card { animation: none; } }
.install-card .install-ic { grid-area: ic; width: 40px; height: 40px; border-radius: 10px; }
.install-card .install-txt { grid-area: txt; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; gap: 2px; }
.install-card .install-txt b { font-size: .95rem; }
.install-card .install-txt small { color: var(--muted); font-size: .78rem; }
.install-card #pwa-install-btn { grid-area: btn; width: 100%; margin-top: .1rem; }
.install-card .install-x {
    grid-area: close; align-self: start; justify-self: end;
    width: 40px; height: 40px; border-radius: 9px; border: 0; background: transparent;
    color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer;
    display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
}
/* Ab Tablet: alles in einer Zeile (Button rechts, nicht über die volle Breite). */
@media (min-width: 560px) {
    .install-card { grid-template-columns: auto 1fr auto auto; grid-template-areas: "ic txt btn close"; }
    .install-card #pwa-install-btn { width: auto; margin-top: 0; }
    .install-card .install-x { align-self: center; }
}
.install-card .install-x:hover { color: #fff; background: var(--board-in); }
.install-card .install-x:active { transform: scale(.9); }

/* ---- Installations-Anleitung (Popup / Bottom-Sheet) ------------------- */
.pwa-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.pwa-modal-backdrop { position: absolute; inset: 0; background: rgba(2,10,20,.68);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: pwaFade .2s ease; }
.pwa-modal-card {
    position: relative; z-index: 1; width: 100%; max-width: 30rem;
    margin: 0 .5rem calc(.5rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, var(--board) 0%, var(--ice-deep-2) 100%);
    border: 1px solid var(--line); border-radius: 20px;
    padding: 1.05rem 1.05rem calc(1.05rem + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 44px rgba(0,0,0,.5); animation: pwaSheet .3s cubic-bezier(.22,.61,.36,1);
    /* Quer gehaltenes Handy (oder sehr niedriger Viewport): Die Anleitung ist höher
       als der Bildschirm. Ohne Deckel ragte sie unten heraus – der letzte Schritt und
       der „Alles klar"-Button waren unerreichbar (das Popup selbst scrollt nicht).
       Jetzt: nie höher als der Bildschirm, Inhalt scrollt im Popup. */
    max-height: calc(100% - 1rem); overflow-y: auto; overscroll-behavior-y: contain;
}
body.pwa-modal-open { overflow: hidden; }
@keyframes pwaFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pwaSheet { from { transform: translateY(34px); opacity: .3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pwa-modal-backdrop, .pwa-modal-card { animation: none; } }
@media (min-width: 560px) { .pwa-modal { align-items: center; } .pwa-modal-card { margin-bottom: .5rem; border-radius: 18px; } }

.pwa-guide-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .2rem; }
.pwa-guide-head img { border-radius: 11px; flex: none; }
.pwa-guide-htxt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pwa-guide-htxt b { font-size: 1.05rem; }
.pwa-guide-htxt small { color: var(--muted); font-size: .82rem; margin-top: 1px; }
.pwa-modal-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 11px; background: var(--board-in);
    color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
    -webkit-tap-highlight-color: transparent; transition: color .14s, transform .1s; }
.pwa-modal-x:hover { color: #fff; }
.pwa-modal-x:active { transform: scale(.9); }

.pwa-steps { list-style: none; margin: 1rem 0 1.15rem; padding: 0; display: flex; flex-direction: column; gap: .7rem; counter-reset: pwa; }
.pwa-step { display: flex; align-items: center; gap: .8rem; counter-increment: pwa; }
.pwa-step .pwa-ic { position: relative; flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
    background: rgba(43,143,214,.14); border: 1px solid var(--line-soft); color: var(--blue); }
.pwa-step .pwa-ic svg { width: 23px; height: 23px; }
.pwa-step .pwa-ic::after { content: counter(pwa); position: absolute; top: -7px; left: -7px; width: 19px; height: 19px;
    border-radius: 50%; background: var(--gold); color: #0a1a12; font-size: .66rem; font-weight: 800;
    display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pwa-step p { margin: 0; font-size: .95rem; line-height: 1.35; color: var(--ink-2); }
.pwa-step p b { color: #fff; font-weight: 700; }

/* Scroll-Ziel nach dem Tippen: nicht unter der Topbar verstecken + kurz hervorheben.
   Auch hier rem statt px – die Topbar wächst mit der Textskalierung (59px → 75px
   bei 130 % → 91px bei 160 %); mit festen 76px landete die getippte Karte bei
   großer Schrift hinter dem Kopfbereich. */
[id^="game-"] { scroll-margin-top: calc(4.75rem + env(safe-area-inset-top)); }
[id^="game-"]:target { animation: tipSaved 1.7s ease-out; }
@keyframes tipSaved {
    0%   { box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm); }
    70%  { box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm); }
    100% { box-shadow: var(--shadow-sm); }
}
@media (prefers-reduced-motion: reduce) { [id^="game-"]:target { animation: none; } }
/* Scroll-Ziel nach dem Beantworten einer Bonusfrage: zurück zur Frage (nicht nach
   oben), damit man mehrere nacheinander tippen kann – analog zum Tipp-Anker. */
[id^="bonus-"] { scroll-margin-top: calc(5rem + env(safe-area-inset-top)); }
[id^="bonus-"]:target { animation: tipSaved 1.7s ease-out; }
@media (prefers-reduced-motion: reduce) { [id^="bonus-"]:target { animation: none; } }
.tip-actions { margin-top: .7rem; }
.tip-hint { color: var(--muted); font-size: .8rem; text-align: center; margin-top: .5rem; display: flex; align-items: center; justify-content: center; gap: .35rem; }
.tip-hint .ic { width: 14px; height: 14px; }
.my-tip { color: var(--ink-2); font-size: .9rem; }
.my-tip b { color: #fff; font-variant-numeric: tabular-nums; }

/* ---- Punkte-Chip ------------------------------------------------------- */
.pts { display: inline-block; font-weight: 800; font-variant-numeric: tabular-nums; }
.pts-badge { padding: .06rem .45rem; border-radius: 7px; font-size: .8rem; }
.pts-4 { color: #0a1a12; background: var(--gold); }
.pts-3 { color: #bfe6ff; background: rgba(43,143,214,.18); }
.pts-2 { color: #a9ecc7; background: rgba(52,199,123,.16); }
.pts-0 { color: var(--muted); background: rgba(120,160,200,.10); }

/* ---- Buttons ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    border: 1px solid var(--line); background: var(--board-2); color: var(--ink);
    padding: .64rem 1rem; border-radius: 11px; font-size: .95rem; font-weight: 700; cursor: pointer;
    min-height: 46px; text-decoration: none; transition: background .14s, transform .05s, border-color .14s; }
.btn .ic { width: 18px; height: 18px; }
.btn:hover { background: #16436e; text-decoration: none; }
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(180deg, var(--blue-cta-h), var(--blue-cta)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(22,115,196,.35); }
.btn-primary:hover { background: linear-gradient(180deg, #1877cc, #1568b8); } /* weiß ≥ 4.6:1 AA */
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(224,31,43,.4); color: var(--red-ink); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-whatsapp { background: linear-gradient(180deg, #2bd366, #1faa52); border-color: transparent; color: #fff;
    box-shadow: 0 4px 14px rgba(37,211,102,.30); }
.btn-whatsapp:hover { background: linear-gradient(180deg, #29c561, #1b9a4a); }
.btn-whatsapp svg { width: 20px; height: 20px; }
.btn-sm { min-height: 42px; padding: .5rem .8rem; font-size: .84rem; border-radius: 9px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.link-arrow { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; font-size: .85rem; }
.link-arrow .ic { width: 15px; height: 15px; }

/* ---- Formulare -------------------------------------------------------- */
label { display: block; font-size: .74rem; color: var(--muted); margin-bottom: .32rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], select {
    width: 100%; background: var(--board-in); color: var(--ink); border: 1px solid var(--line);
    border-radius: 11px; padding: .62rem .75rem; font-size: 1rem; min-height: 46px; }
.field { margin-bottom: .85rem; }
.row { display: flex; gap: .6rem; } .row > * { flex: 1; }
.check { display: flex; align-items: center; gap: .55rem; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .92rem; font-weight: 500; margin-bottom: 1rem; }
.check input { width: auto; min-height: auto; }
.note { color: var(--muted); font-size: .84rem; }

/* ---- Fokus / A11y ----------------------------------------------------- */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--blue); }

/* ---- Flash ------------------------------------------------------------ */
.flash { display: flex; gap: .55rem; align-items: flex-start; border-radius: 12px; padding: .7rem .85rem; margin-bottom: .8rem; border: 1px solid; font-size: .92rem; word-break: break-word; }
.flash .ic { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.flash-success { background: var(--success-bg); border-color: #1c6b4c; color: #b6f0d0; }
.flash-error   { background: var(--danger-bg);  border-color: #7a2a2f; color: #f6b8bb; }
.flash-info    { background: var(--board-2);     border-color: var(--line); color: var(--ink-2); }

/* ---- Statistik-Tiles (Scoreboard) ------------------------------------- */
/* minmax(0,1fr): Spalten duerfen unter ihre min-content-Breite schrumpfen –
   sonst sprengen lange Labels bei grosser Schrift die Kachelreihe. */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.stat { background: var(--board-in); border: 1px solid var(--line-soft); border-radius: 12px; padding: .85rem .5rem; text-align: center; }
.stat .v { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 14px rgba(120,190,255,.22); }
.stat .v.gold { color: var(--gold); text-shadow: 0 0 14px rgba(244,193,78,.3); }
.stat .l { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-top: 2px; }

/* ---- Rangliste -------------------------------------------------------- */
.rank { width: 100%; border-collapse: collapse; }
.rank th, .rank td { padding: .62rem .5rem; border-bottom: 1px solid var(--line-soft); text-align: left; }
.rank th { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 800; }
.rank td.n, .rank th.n { text-align: right; font-variant-numeric: tabular-nums; }
.rank .pos { width: 2.4rem; text-align: center; font-weight: 800; color: var(--muted); }
.rank .total { font-weight: 800; color: #fff; }
/* Ungebunden statt .rank-scoped: Avatar+Name stehen auch in .table (Tippliste im
   Spiel-Detail, Bonus-Antwortliste) – dort klebte der Avatar sonst direkt am Namen. */
.who { display: flex; align-items: center; gap: .55rem; }
.rank .who .a { width: 28px; height: 28px; border-radius: 50%; background: var(--board-2); border: 1px solid var(--line);
    display: grid; place-items: center; font-size: .7rem; font-weight: 800; flex: none; }
.rank tr.me { background: rgba(43,143,214,.10); }
.rank tr.me td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.rank tr.leader .a { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(244,193,78,.35); }
.rank tr.leader .total { color: var(--gold); }
.rank .pos.medal-1 { color: var(--gold); } .rank .pos.medal-2 { color: #cdd8e6; } .rank .pos.medal-3 { color: #d59b6a; }

/* ---- Tabellen (Admin) ------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .55rem .5rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.inline-form { display: inline; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
details.card > summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .ic { width: 18px; height: 18px; color: var(--blue); }

/* ---- Login-Arena ------------------------------------------------------ */
.arena { position: relative; text-align: center; padding: 2.4rem 0 1.2rem; overflow: hidden; }
.arena .rink { position: absolute; inset: -20% -10% auto -10%; height: 320px; pointer-events: none; opacity: .5; }
.arena .logo { position: relative; width: 84px; height: 84px; margin: 0 auto 1.1rem; border-radius: 22px;
    display: grid; place-items: center; background: linear-gradient(150deg, #1e84dc, #0c4f8c);
    color: #fff; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.14); }
.arena .logo .crest { width: 52px; height: 52px; }
.arena .logo-img { position: relative; display: block; width: min(230px, 66%); height: auto; margin: 0 auto 1.1rem;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
.arena h1 { position: relative; font-size: clamp(1.7rem,7vw,2.2rem); text-transform: uppercase; letter-spacing: .01em; }
.arena h1 span { color: var(--blue); }
.arena p { position: relative; color: var(--ink-2); max-width: 22rem; margin: .4rem auto 0; }

/* ---- Diverses --------------------------------------------------------- */
.tag-you { color: var(--link); font-size: .72rem; font-weight: 800; }
.spacer { height: .4rem; }
.appfooter { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .55rem; margin: 1.8rem 0 .4rem; }
.appfooter a, .appfooter .applink { color: var(--muted); font-size: .8rem; }
.appfooter a:hover, .appfooter .applink:hover { color: var(--ink-2); }
.appfooter > * + *::before { content: "·"; margin-right: .55rem; color: var(--muted); opacity: .6; }
.appfooter .applink { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: .8rem;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

@media (min-width: 560px) {
    .team .tname { font-size: 1.05rem; }
    .score { font-size: 2rem; }
    .center-col { min-width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    .tabbar a.active::before { box-shadow: none; }
}

/* =========================================================================
   Engagement / Gamification (Phase 1)
   ========================================================================= */

/* ---- Nudge: offene Tipps ---------------------------------------------- */
.nudge { display: flex; align-items: center; gap: .7rem; margin: 1rem 0 .2rem; padding: .8rem 1rem;
    border-radius: 14px; border: 1px solid rgba(244,193,78,.42); color: var(--ink);
    background: linear-gradient(180deg, rgba(244,193,78,.15), rgba(244,193,78,.05)); }
.nudge:hover { text-decoration: none; border-color: var(--gold); }
.nudge > .ic { width: 24px; height: 24px; color: var(--gold); flex: none; }
.nudge > .ic:last-child { width: 18px; height: 18px; color: var(--muted); }
.nudge .nudge-text { flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; font-size: .95rem; min-width: 0; }
.nudge .nudge-text small { color: var(--muted); font-size: .78rem; }

/* ---- Saison-Fortschritt ----------------------------------------------- */
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem;
    font-size: .82rem; font-weight: 700; color: var(--ink-2); margin-bottom: .5rem; }
.progress { height: 10px; border-radius: 999px; background: var(--board-in); border: 1px solid var(--line-soft); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--gold)); min-width: 4px; }
.gold-ink { color: var(--gold); }

/* ---- Badges / Serien --------------------------------------------------- */
.badges { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .2rem; }
.badge { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 12px;
    background: var(--board-in); border: 1px solid var(--line-soft); }
.badge .ic { width: 20px; height: 20px; color: var(--gold); flex: none; }
.badge span { display: flex; flex-direction: column; line-height: 1.15; }
.badge b { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.badge small { font-size: .86rem; color: var(--ink); font-weight: 700; }

/* ---- Spieltags-Rückblick ---------------------------------------------- */
.recap-mvp { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.recap-mvp .pill { flex: none; }
.recap-people { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; }
.recap-person { display: inline-flex; align-items: center; gap: .35rem; }
.recap-name { font-size: .95rem; color: var(--ink-2); }

/* ---- Allgemeiner User-Avatar ------------------------------------------ */
.uav { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--board-2); border: 1px solid var(--line); font-weight: 800; font-size: .72rem;
    color: #dbe8f6; flex: none; vertical-align: middle; }
.uav.has-emoji { font-size: .98rem; }
.avatar.has-emoji { font-size: 1.05rem; }
.rank .who .a.has-emoji { font-size: 1rem; }

/* ---- Rang-Trend & Form ------------------------------------------------- */
.who-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.who-name { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.delta { font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--success); }
.delta.down { color: var(--red-ink); }
.form { display: inline-flex; gap: 3px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.form.form-lg .dot { width: 15px; height: 15px; }
.form-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .5rem; font-size: .78rem; color: var(--muted); }
.form-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot.pts-4 { background: var(--gold); }
.dot.pts-3 { background: var(--blue); }
.dot.pts-2 { background: var(--success); }
.dot.pts-0 { background: rgba(120,160,200,.28); }

/* ---- Bester Tipp (Spiel-Detail) --------------------------------------- */
.best-tip { display: inline-flex; vertical-align: middle; }
.best-tip .ic { width: 15px; height: 15px; color: var(--gold); }
.table tr.best td { background: rgba(244,193,78,.08); }
.table tr.best td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

/* ---- Avatar-Picker (Konto) -------------------------------------------- */
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: .5rem;
    max-height: 15rem; overflow-y: auto; padding: .25rem; margin: 0 -.25rem; }
.apick { margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; display: block; }
.apick input { position: absolute; opacity: 0; width: 0; height: 0; }
.apick .apick-face { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto; border-radius: 50%;
    background: var(--board-in); border: 1px solid var(--line); font-size: 1.4rem; font-weight: 800; color: #dbe8f6;
    transition: border-color .12s, box-shadow .12s; }
.apick.sel .apick-face, .apick input:checked + .apick-face { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(244,193,78,.4); }
.apick input:focus-visible + .apick-face { outline: 3px solid var(--blue); outline-offset: 2px; }

/* =========================================================================
   Bonus-/Sonderfragen (Phase 2)
   ========================================================================= */
textarea { width: 100%; background: var(--board-in); color: var(--ink); border: 1px solid var(--line);
    border-radius: 11px; padding: .62rem .75rem; font-size: 1rem; font-family: inherit; min-height: 90px; resize: vertical; }
textarea:focus-visible { outline-offset: 0; border-color: var(--blue); }
.q-title { font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin-bottom: .3rem; line-height: 1.25; }

/* Nudge-Variante für Sonderwetten (blau statt gold) */
.nudge-bonus { border-color: rgba(43,143,214,.42); background: linear-gradient(180deg, rgba(43,143,214,.16), rgba(43,143,214,.05)); }
.nudge-bonus:hover { border-color: var(--blue); }
.nudge-bonus > .ic { color: var(--blue); }
.nudge-bonus > .ic:last-child { color: var(--muted); }

/* Auswahl-Optionen (Radio-Chips) */
.bonus-options { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .7rem; }
.bopt { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 11px; margin: 0;
    border: 1px solid var(--line); background: var(--board-in); cursor: pointer; color: var(--ink);
    font-weight: 600; text-transform: none; letter-spacing: 0;
    font-size: .92rem; /* label-Reset: sonst erbt der Optionstext die .74rem der Formular-Labels (wie .check) */ }
.bopt input { width: auto; min-height: auto; margin: 0; accent-color: var(--blue); }
.bopt.sel { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

/* „Passwort vergessen?" auf der Login-Seite – dezenter Aufklapper unter dem Formular. */
.pw-help { margin-top: .8rem; }
.pw-help > summary {
    cursor: pointer; list-style: none; color: var(--link); font-size: .85rem; font-weight: 600;
    display: inline-flex; align-items: center; min-height: 32px; -webkit-tap-highlight-color: transparent;
}
.pw-help > summary::-webkit-details-marker { display: none; }
.pw-help > summary::after { content: " ›"; transition: transform .15s ease; display: inline-block; }
.pw-help[open] > summary::after { transform: rotate(90deg); }
.pw-help .note { margin: .5rem 0 0; }

/* „Bearbeiten"-Aufklapper in der Admin-Bonusliste */
.bonus-edit-summary { cursor: pointer; color: var(--link); font-weight: 700; font-size: .9rem;
    display: inline-flex; align-items: center; gap: .4rem; list-style: none; }
.bonus-edit-summary::-webkit-details-marker { display: none; }
.bonus-edit-summary .ic { width: 16px; height: 16px; }

/* ---- Vorbereitung getrennt (Nudge + Spielplan-Sektionen) --------------- */
.nudge-pre { border-color: var(--line); background: linear-gradient(180deg, rgba(120,170,220,.08), rgba(120,170,220,.02)); }
.nudge-pre:hover { border-color: var(--blue); }
.nudge-pre > .ic { color: var(--ink-2); }
.nudge-pre > .ic:last-child { color: var(--muted); }
.section-title h2 .ic { width: 14px; height: 14px; margin-right: .35rem; vertical-align: -2px; color: var(--blue); }
.section-title.sub { margin-top: 1.1rem; }
.section-title.sub h2 { color: var(--muted); }

/* =========================================================================
   Premium-Mobile-Politur — natives App-Gefühl (Feel-Layer)
   Ziel: sofortiges Press-Feedback, ruhige Screen-Übergänge, klare Touch-
   Ziele, saubere Safe-Zonen und ausgerichtete Bars auf großen Screens.
   Alles reduced-motion- und Touch-fest, ohne Funktion zu verändern.
   ========================================================================= */

/* Schnelle Touch-Reaktion (kein 300ms-Delay/Doppeltipp-Zoom) + keine
   Long-Press-Kontextmenüs auf UI-Elementen. */
a, button, .btn, .tabbar a, .pill, .stepper .step, .bopt, .apick, .check,
summary, .nudge, .scoreboard-link, .iconbtn, .install-x, .avatar {
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* UI-Chrome nicht markierbar – Inhalte (Namen, Tipps, Zahlen) bleiben es. */
.tabbar, .topbar .brand-text, .btn, .pill, .eyebrow, .stat .l, .badge b,
.section-title h2, .decision, .tip-inputs .side, .form-legend, .crest-badge {
    -webkit-user-select: none; user-select: none;
}

/* Sofortiges Press-Feedback auf tippbaren Flächen (wie eine native App). */
.nudge, .scoreboard-link, .tabbar a, .bopt, .card > summary, .link-arrow, .apick-face {
    transition: transform .12s ease, background-color .14s ease,
                border-color .14s ease, box-shadow .14s ease, color .14s ease;
}
.nudge:active, .scoreboard-link:active { transform: scale(.985); }
.bopt:active { transform: scale(.99); }
.btn:active { transform: scale(.97); }
.tabbar a:active { transform: scale(.93); }
.iconbtn:active { transform: scale(.9); }
.link-arrow:active { opacity: .55; }
.apick:active .apick-face { transform: scale(.94); }

/* Aktiver Tab: sanfter Farbübergang + dezenter Icon-Lift. */
.tabbar a { transition: color .18s ease; }
.tabbar a .ic { transition: transform .18s ease; }
.tabbar a.active .ic { transform: translateY(-1px); }

/* Sticky-Header: Tiefe/Elevation erst beim Scrollen (Klasse via app.js). */
.topbar { transition: box-shadow .22s ease, background-color .22s ease, border-color .22s ease; }
.scrolled .topbar {
    background: rgba(4,24,43,.94);
    border-bottom-color: transparent;
    box-shadow: 0 8px 24px rgba(0,0,0,.44);
}

/* Ruhiger Screen-Eintritt: sanftes Aufsteigen des Inhalts (nur Transform).
   BEWUSST KEINE Cross-Document View Transitions (@view-transition): die haben in
   manchen Chromium-Browsern – u. a. DuckDuckGo/Android-WebView – beim Navigieren
   einen schwarzen Bildschirm verursacht (Snapshot-Swap schlägt fehl). Diese
   schlichte Keyframe-Animation läuft dagegen überall sauber. */
@keyframes screenIn { from { transform: translateY(9px); } to { transform: none; } }
main.wrap { animation: screenIn .24s cubic-bezier(.22,.61,.36,1) both; }
@media (prefers-reduced-motion: reduce) { main.wrap { animation: none; } }

/* Interne Scroll-Container: Chaining NUR auf der Achse bremsen, auf der die Box
   wirklich scrollt.
   ⚠️ BUGFIX (Android): `.scroll-x` hatte `overscroll-behavior: contain` – also auch
   senkrecht. Eine Box mit `overflow-x: auto` ist laut CSS aber auch senkrecht ein
   Scroll-Container (`overflow-y: visible` rechnet zu `auto`). Sobald die Tabelle
   waagerecht überläuft (Rangliste/DEL-Tabelle/Tippliste auf schmalen Handys),
   klinkt Chromium eine senkrechte Wischgeste in diese Box ein und gibt sie wegen
   `contain` NICHT an die Seite weiter – die Box selbst kann senkrecht aber gar
   nicht scrollen. Ergebnis: Wischt der Finger über der Tabelle, bewegt sich
   nichts („manchmal scrollt es nicht"). Daher hier nur die x-Achse einfangen
   (verhindert weiterhin das versehentliche Zurück-Wischen beim Seitwärtsscrollen). */
.scroll-x { overscroll-behavior-x: contain; scrollbar-width: thin; scroll-snap-type: none; }
/* Der Avatar-Picker ist ein echter senkrechter Scroller → dort ist y richtig. */
.avatar-picker { overscroll-behavior-y: contain; }

/* Größere Phones (z. B. 430px): etwas großzügigere Ränder. */
@media (min-width: 430px) {
    .wrap { padding-left: 1.15rem; padding-right: 1.15rem; }
}

/* ---- Schmale Phones: Tipp-Eingabe passt in die Karte -------------------
   BUGFIX: Die Tippzeile (2× [− Zahl +] plus Doppelpunkt) braucht in
   Grundgröße 324px, die Karte bietet bei 360px aber nur 296px und bei 320px
   nur 256px. Die +/−-Kreise ragten dadurch links und rechts AUS der Karte
   heraus – ausgerechnet bei der Kernaktion. Zwei Stufen, damit die Touch-Ziele
   nur so weit schrumpfen wie nötig. */
@media (max-width: 389px) {
    .tip-inputs { gap: .32rem; }
    .stepper { gap: .2rem; }
    .stepper .step { width: 40px; height: 40px; }
    .tip-inputs input[type=number] { width: 48px; }
    .center-col { min-width: 64px; padding: 0 .35rem; }
}
@media (max-width: 339px) {
    .tip-inputs { gap: .2rem; }
    .stepper { gap: .15rem; }
    .stepper .step { width: 36px; height: 36px; font-size: 1.05rem; }
    .tip-inputs input[type=number] { width: 42px; font-size: 1.4rem; }
}
/* Lange Vereinsnamen umbrechen lassen statt im Scoreboard hart abzuschneiden
   (.scoreboard hat overflow: hidden). */
.team .tname { overflow-wrap: anywhere; }

/* Formularfelder in .row dürfen schrumpfen: Flex-Kinder haben min-width:auto,
   und input[type=datetime-local] bringt eine breite Mindestgröße mit – im
   Admin-Spieleformular lief die Zeile dadurch bei 320px aus dem Bild. */
.row > * { min-width: 0; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], select { min-width: 0; }

/* Touch-Ziele: Fußzeilen-Links und Pfeil-Links waren nur 19–20px hoch und
   damit unter dem 24px-Minimum (WCAG 2.5.8) – am Handy eine Fehltipp-Quelle.
   Trefferfläche vergrößern, Optik unverändert. */
/* .link-arrow ist von Haus aus inline-flex (Text + Icon) – hier reicht die Hoehe.
   Die Fusszeilen-Links bleiben bewusst inline-block: als inline-flex koennte ihr
   Text nicht mehr umbrechen (ein blosser Textknoten wird zum anonymen Flex-Item),
   und ein langes Label wie „App installieren" liefe bei grosser Schrift heraus. */
.link-arrow { min-height: 32px; }
.appfooter a, .appfooter .applink {
    /* .45rem statt .4rem: hält die Trefferfläche über 32px (gemessen: .4rem ≈ 30,7px) */
    display: inline-block; padding-block: .45rem; line-height: 1.4;
}
.appfooter { gap: .2rem .55rem; }

/* Android-Textskalierung / 200 % Zoom: Bei großer Schrift auf einem schmalen
   Gerät sprengten lange deutsche Wörter („Scharfschütze", „Pre-Playoff-Platz")
   Überschriften, Award-Karten und die 3er-Kachelreihe aus dem Bild. `anywhere`
   senkt zusätzlich die min-content-Breite – nur dadurch dürfen Grid-/Flex-
   Spalten überhaupt schrumpfen. Bricht nur, wenn es sonst überliefe. */
h1, h2, h3, .q-title, .award-title, .award-desc, .stat .l, .vbadge-txt b,
.badge small, .nudge .nudge-text { overflow-wrap: anywhere; }
p, td, .note, .aw-name { overflow-wrap: break-word; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Grid-/Flex-Kinder haben min-width: auto und schrumpfen sonst nie unter ihre
   min-content-Breite – dadurch liefen Award-Karten und Sektionstitel bei großer
   Schrift aus dem Bild. `flex: none` am h2 verhinderte das Schrumpfen zusätzlich. */
.awards { grid-template-columns: minmax(0, 1fr); }
.award-card, .vbadge, .badge, .stat { min-width: 0; }
.section-title h2 { flex: 0 1 auto; min-width: 0; }
/* Tab-Leiste: `flex: 1` allein reicht nicht – mit min-width: auto schrumpfen die
   Reiter nie unter ihre Beschriftung. Bei großer Schrift schob der fünfte Reiter
   („Admin") deshalb aus dem Bild. Jetzt dürfen die Labels umbrechen. */
.tabbar a { min-width: 0; overflow-wrap: anywhere; text-align: center; }

/* Tablet & Desktop: die App-Spalte bleibt zentriert; Top-/Tabbar richten
   ihren Inhalt an genau dieser Spalte aus (statt an den Bildschirmrändern). */
@media (min-width: 720px) {
    .topbar { padding-inline: max(1rem, calc((100% - var(--maxw)) / 2)); }
    .tabbar { padding-inline: max(.2rem, calc((100% - var(--maxw)) / 2)); }
    .arena { padding-top: 3rem; }
}

/* Safe-Area auch seitlich berücksichtigen (Landscape / Notch). */
@media (orientation: landscape) {
    .wrap {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

@media (prefers-reduced-motion: reduce) {
    main.wrap { animation: none; }
    .nudge:active, .scoreboard-link:active, .bopt:active, .btn:active,
    .tabbar a:active, .iconbtn:active, .apick:active .apick-face { transform: none; }
}

/* =========================================================================
   Gamification — Spieltags-König · Tipp-Zwilling · Kabinen-Wall
   ========================================================================= */

/* Krönchen am Avatar (Spieltags-König, bis zum nächsten Spieltag) */
.uav.has-crown, .avatar.has-crown, .rank .who .a.has-crown { position: relative; overflow: visible; }
.king-crown { position: absolute; top: -8px; right: -6px; font-size: 13px; line-height: 1; transform: rotate(14deg);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)); pointer-events: none; }
.avatar.has-crown .king-crown { top: -9px; right: -7px; font-size: 15px; }

/* Tipp-Zwilling-Chip (gleicher exakter Tipp) */
.twin-tag { display: inline-flex; align-items: center; gap: 1px; font-size: .72rem; font-weight: 800;
    color: var(--link); white-space: nowrap; vertical-align: middle; }

/* Eigene Zeile in der Tippliste dezent hervorheben */
.table tr.me td { background: rgba(43,143,214,.08); }
.table tr.me td:first-child { box-shadow: inset 3px 0 0 var(--blue); }

/* Kabinen-Wall: Reaktions-Leiste unter jedem Tipp */
[id^="tip-"] { scroll-margin-top: calc(5rem + env(safe-area-inset-top)); }

/* Tippt jemand ein Feld weit unten an, scrollt der Browser es automatisch in den
   Blick – bisher genau bis an die feste Tab-Leiste heran bzw. dahinter. Mit
   scroll-margin-bottom bleibt das Feld (und der Absenden-Knopf darunter) frei. */
input, select, textarea, .tip-form, .bopt {
    scroll-margin-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}
[id^="tip-"]:target td { background: rgba(244,193,78,.10); }
.react-hint { margin: -.3rem .2rem .55rem; }
.table tr:has(+ .react-row) td { border-bottom: none; }
.react-row td { border-bottom: 1px solid var(--line-soft); padding: .05rem .5rem .5rem; }
.react-bar { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.react-chip {
    display: inline-flex; align-items: center; justify-content: center; gap: .22rem; font: inherit; font-size: .95rem; line-height: 1;
    min-height: 40px; min-width: 40px; padding: .4rem .6rem; border-radius: 999px; border: 1px solid var(--line); background: var(--board-in);
    color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: transform .1s ease, border-color .12s ease, background-color .12s ease;
}
.react-chip b { font-size: .74rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.react-chip:hover { border-color: var(--blue); }
.react-chip:active { transform: scale(.9); }
.react-chip.active { border-color: var(--blue); background: rgba(43,143,214,.18); }
.react-chip.active b { color: #cfe6ff; }
.react-chip.is-count { cursor: default; }
.react-empty { padding: .15rem 0; }

/* Legende unter der Tippliste */
.tip-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .6rem .2rem 0; }
.tip-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.tip-legend .ic { width: 14px; height: 14px; color: var(--gold); }
.tip-legend b { color: var(--ink-2); font-weight: 700; }

/* =========================================================================
   Hall of Fame · Badge-Vitrine · Ergebnis-Reveal
   ========================================================================= */

/* ---- Hall of Fame (Saison-Awards) ------------------------------------- */
.awards { display: grid; gap: .7rem; margin-top: .5rem; }
@media (min-width: 560px) { .awards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.award-card { display: flex; gap: .8rem; align-items: flex-start;
    background: linear-gradient(180deg, var(--board) 0%, var(--ice-deep-2) 100%);
    border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow-sm); }
.award-card.is-locked { opacity: .68; }
.award-emoji { font-size: 2.1rem; line-height: 1; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.award-body { min-width: 0; flex: 1; }
.award-title { font-size: 1.02rem; margin: 0; }
.award-desc { color: var(--muted); font-size: .8rem; margin: .15rem 0 .55rem; line-height: 1.35; }
.award-winners { display: flex; flex-direction: column; gap: .4rem; }
.award-winner { display: flex; align-items: center; gap: .45rem; }
.award-winner .aw-name { font-weight: 700; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.award-winner .aw-val { margin-left: auto; font-size: .76rem; font-weight: 800; color: var(--gold);
    font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: .4rem; }
.award-winner.me .aw-name { color: var(--link); }
.award-pending { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .82rem; margin: 0; }
.award-pending .ic { width: 14px; height: 14px; }

/* ---- Badge-Vitrine ---------------------------------------------------- */
/* minmax(0,1fr): Spalten dürfen unter die min-content-Breite der Titel schrumpfen,
   sonst „drückt" ein langes Wort (z. B. „Scharfschütze") die Spalten breiter als der Container. */
.vitrine { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
@media (min-width: 560px) { .vitrine { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vbadge { display: flex; align-items: center; gap: .55rem; padding: .6rem .65rem; border-radius: 14px;
    border: 1px solid var(--line-soft); background: var(--board-in); }
.vbadge-ic { font-size: 1.55rem; line-height: 1; flex: none; }
.vbadge-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.vbadge-txt b { font-size: .82rem; overflow-wrap: anywhere; }
.vbadge-txt small { color: var(--muted); font-size: .68rem; margin-top: 1px; }
.vbadge-state { margin-left: auto; flex: none; display: grid; place-items: center; }
.vbadge-state .ic { width: 15px; height: 15px; }
.vbadge.earned { border-color: rgba(244,193,78,.42);
    background: linear-gradient(180deg, rgba(244,193,78,.09), var(--board-in)); }
.vbadge.earned .vbadge-state .ic { color: var(--gold); }
.vbadge.locked .vbadge-ic { filter: grayscale(1); opacity: .38; }
.vbadge.locked .vbadge-txt b { color: var(--muted); }
.vbadge.locked .vbadge-state .ic { color: var(--muted); opacity: .55; }

/* ---- Ergebnis-Reveal (Tipp vs. Ergebnis, Punkte zählen hoch) ---------- */
.reveal { background: linear-gradient(180deg, var(--board) 0%, var(--ice-deep-2) 100%);
    border: 1px solid var(--blue); border-radius: var(--radius); padding: .95rem 1rem 1.05rem;
    margin: 0 0 .9rem; box-shadow: var(--shadow-sm); text-align: center; }
.reveal-duel { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.reveal-col { display: flex; flex-direction: column; gap: .2rem; min-width: 4rem; }
.reveal-lbl { font-size: .6rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.reveal-score { font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; line-height: 1; }
.reveal-score.is-result { color: var(--gold); text-shadow: 0 0 16px rgba(244,193,78,.28); }
.reveal-vs { color: var(--muted); display: grid; place-items: center; }
.reveal-vs .ic { width: 20px; height: 20px; }
.reveal-pts { display: inline-flex; align-items: center; gap: .5rem; margin-top: .8rem; }
.reveal-pts .pts-badge { font-size: 1rem; min-width: 2.3rem; min-height: 2.3rem;
    display: inline-flex; align-items: center; justify-content: center; /* Ziffer mittig statt oben (min-height allein zentriert nicht) */ }
.reveal-pts-lbl { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.reveal-pts-lbl b { color: var(--gold); }

@keyframes revealIn  { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes revealPop { 0% { transform: scale(.55); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
.reveal-play { animation: revealIn .45s cubic-bezier(.22,.61,.36,1) both; }
.reveal-play .reveal-score.is-result { animation: revealPop .5s .12s cubic-bezier(.34,1.56,.64,1) both; }
.reveal-play .reveal-pts .pts-badge { animation: revealPop .55s .5s cubic-bezier(.34,1.56,.64,1) both; }
@media (prefers-reduced-motion: reduce) {
    .reveal-play, .reveal-play .reveal-score.is-result, .reveal-play .reveal-pts .pts-badge { animation: none; }
}

/* ---- Klickbarer Spielername → öffentliches Profil --------------------- */
.plink { color: inherit; text-decoration: none; }
.plink:hover { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.plink:active { opacity: .6; }

/* ---- Öffentliches Spieler-Profil ------------------------------------- */
.player-hero { display: flex; align-items: center; gap: .9rem; }
.player-hero .avatar { width: 60px; height: 60px; font-size: 1.5rem; flex: none; }
.player-hero .avatar.has-crown .king-crown { top: -10px; right: -8px; font-size: 18px; }
.player-hero-txt { min-width: 0; }
.player-hero-txt h1 { margin: 0; font-size: 1.4rem; line-height: 1.15; }
.player-titles { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 0; }
.ptitle { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700;
    padding: .32rem .62rem; border-radius: 999px; border: 1px solid rgba(244,193,78,.42);
    background: rgba(244,193,78,.1); color: var(--gold); white-space: nowrap; }
