/* =========================================================================
   WM 2026 Tippspiel — Styles nach Brand Guide ("Global Matchroom")
   Dark Mode als Standard · Tokens, Fonts & Farbregeln aus dem Brand Guide.
   ========================================================================= */
:root {
  /* Fonts */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-data: "Roboto Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Hintergründe / Flächen */
  --bg-night: #07111F;
  --bg-deep: #0B1728;
  --surface: #111F33;
  --surface-raised: #172A45;

  /* Akzente */
  --primary: #00A878;
  --primary-hover: #00C889;
  --secondary: #2F80ED;
  --gold: #F7C948;
  --coral: #FF5A5F;
  --purple: #8E5CF7;
  --maple: #D62839;
  --mexico: #0B8F5A;
  --usa: #2454A6;
  --live: #FF3B30;

  /* Text & Linien */
  --text: #F5F7FA;
  --muted: #AAB7C7;
  --soft: #D6DEE8;
  --border: #263A59;
  --border-strong: #3C5275;

  /* Radien & Schatten */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 14px 40px rgba(0, 0, 0, .26);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .18);

  /* Qualifikations-Tönungen (dezent auf Dark) */
  --qual: rgba(0, 168, 120, .14);
  --qual3: rgba(247, 201, 72, .12);

  font-family: var(--font-ui);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--text); min-height: 100vh; font-family: var(--font-ui);
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(142, 92, 247, .22), transparent 60%),
    radial-gradient(1000px 560px at -5% 0%, rgba(0, 168, 120, .18), transparent 55%),
    linear-gradient(170deg, var(--bg-night), var(--bg-deep));
  background-attachment: fixed;
}
h1, h2, h3, .brand { font-family: var(--font-display); }
.boot { color: var(--text); padding: 3rem 1rem; text-align: center; }
.boot.err { color: #ffd7cc; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1rem .8rem; color: #fff;
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; font-size: 1.3rem; display: flex; align-items: baseline; gap: .5rem; letter-spacing: -.01em; }
.brand span { color: #fff; }
.brand small { font-weight: 500; font-size: .72rem; color: var(--muted); font-family: var(--font-ui); }
.session-area { display: flex; align-items: center; gap: .5rem; }
.who { color: var(--soft); font-weight: 600; font-size: .9rem; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: .35rem; padding: .5rem .6rem 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab {
  flex: 0 0 auto; border: none; cursor: pointer; font-weight: 600; font-size: .9rem; font-family: var(--font-ui);
  padding: .6rem .95rem; border-radius: 12px 12px 0 0; background: var(--surface); color: var(--muted);
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-raised); color: #fff; box-shadow: inset 0 -3px 0 var(--primary); }

/* ---- View ---- */
.view { background: transparent; min-height: 70vh; padding: 1rem; }
.view h2 { margin: .2rem 0 1rem; font-size: clamp(1.4rem, 4vw, 2rem); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft); padding: 1rem; margin-bottom: 1rem;
}
.card h3 { margin: 0 0 .7rem; padding-left: .6rem; border-left: 4px solid var(--primary); line-height: 1.2; font-size: 1.05rem; }
small { color: var(--muted); font-weight: 500; font-family: var(--font-ui); }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.info { background: rgba(47, 128, 237, .14); border: 1px solid rgba(47, 128, 237, .3); padding: .7rem .9rem; border-radius: var(--radius-md); }
.warn { background: rgba(247, 201, 72, .12); border: 1px solid rgba(247, 201, 72, .35); padding: .7rem .9rem; border-radius: var(--radius-md); }
.empty { color: var(--muted); padding: 1rem; text-align: center; }

/* ---- Buttons ---- */
.btn {
  background: var(--primary); color: #fff; border: none; border-radius: 14px;
  padding: .6rem 1rem; font-weight: 700; cursor: pointer; font-size: .88rem; font-family: var(--font-ui);
  min-height: 44px;
}
.btn:hover { background: var(--primary-hover); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border-strong); min-height: 0; }
.btn--ghost:hover { background: var(--surface-raised); }
.btn--sm { padding: .4rem .7rem; font-size: .8rem; min-height: 0; border-radius: 10px; }
.btn--big { font-size: 1rem; padding: .85rem 1.4rem; }
.btn--urgent { background: var(--coral); }
.btn--ghost.danger { color: var(--coral); box-shadow: inset 0 0 0 1.5px var(--coral); margin-top: .5rem; }

/* ---- Team-Chip (Flagge + Name) ---- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .55rem;
  border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600;
  background: var(--surface-raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--border);
}
.chip .flag { font-size: 1.05rem; line-height: 1; }
.flag-img {
  width: 1.3rem; height: .92rem; object-fit: cover; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); vertical-align: middle; flex: 0 0 auto;
}
.card h3 .flag-img { width: 1.5rem; height: 1.05rem; margin-right: .15rem; }
.chip--open { background: transparent; color: var(--muted); box-shadow: none; font-style: italic; font-weight: 500; }
.bm-row.win .chip { box-shadow: inset 0 0 0 1.5px var(--primary); }

/* Nur-Flagge-Chip: Name beim Hover (Tooltip) bzw. auf Touch-Geräten sichtbar */
.chip--flag { padding: .2rem .35rem; cursor: default; }
.chip--flag .flag-img { width: 1.6rem; height: 1.15rem; }
.chip--flag .flag-img + b { display: none; }
@media (hover: none) { .chip--flag .flag-img + b { display: inline; } .chip--flag { padding: .22rem .55rem; } }

/* ---- Gruppen ---- */
.grid-groups { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 720px) { .grid-groups { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .grid-groups { grid-template-columns: 1fr 1fr 1fr; } }
.group-card h3 { border-left-color: var(--gc, var(--primary)); }
table.standings { width: 100%; border-collapse: collapse; font-size: .85rem; }
.standings th { text-align: center; color: var(--muted); font-weight: 600; padding: .3rem .2rem; }
.standings td { text-align: center; padding: .38rem .2rem; border-top: 1px solid var(--border); font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.standings td.tcell { text-align: left; font-family: var(--font-ui); }
.standings tr.qual { background: var(--qual); }
.standings tr.qual3 { background: var(--qual3); }
.standings tr.out { opacity: .5; }
.standings tr.me { outline: 2px solid var(--gold); }
.tie { color: var(--coral); cursor: help; }
.gmatches { margin-top: .7rem; display: grid; gap: .3rem; }
.gmatch { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .4rem; font-size: .82rem; }
.gm-home { text-align: right; }
.gm-score { font-weight: 700; min-width: 2.4rem; text-align: center; font-family: var(--font-data); }

/* ---- Spielplan ---- */
.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters select, .filters input {
  padding: .55rem; border: 1px solid var(--border-strong); border-radius: 10px; font-size: .9rem;
  background: var(--surface); color: var(--text); font-family: var(--font-ui);
}
.dayhead { margin: 1rem 0 .4rem; color: var(--gold); font-family: var(--font-display); }
.schedule .srow {
  display: grid; grid-template-columns: 3.4rem 1fr 3rem 1fr; align-items: center;
  gap: .4rem; padding: .55rem .65rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: .35rem; font-size: .85rem;
}
.srow .stime { font-weight: 700; color: var(--muted); font-size: .76rem; font-family: var(--font-data); }
.srow .steam.r { text-align: right; }
.srow .sscore { text-align: center; font-weight: 700; font-family: var(--font-data); }
.srow .smeta { grid-column: 1 / -1; color: var(--muted); font-size: .74rem; }
.srow.locked { opacity: .8; }
@media (min-width: 720px) {
  .schedule .srow { grid-template-columns: 4.4rem 1fr 4rem 1fr 12rem; }
  .srow .smeta { grid-column: auto; text-align: right; }
}

/* ---- K.-o.-Baum (Finalrunde: Lila-Header, Gold für Sieger/Finale) ---- */
.bracket { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.bcol { flex: 0 0 230px; }
.bcol h3 { font-size: .92rem; color: var(--purple); border-left-color: var(--purple); position: sticky; top: 0; }
.bmatch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); padding: .55rem; margin-bottom: .8rem; position: relative; }
.bm-id { position: absolute; top: -.6rem; left: .5rem; font-size: .65rem; color: var(--muted); background: var(--bg-deep); padding: 0 .35rem; border-radius: 5px; font-family: var(--font-data); }
.bm-row { display: flex; justify-content: space-between; align-items: center; gap: .3rem; padding: .28rem 0; font-size: .84rem; }
.bm-row span { font-weight: 700; font-family: var(--font-data); }
.bm-row.win { background: var(--qual); border-radius: 6px; }
.bm-et { font-size: .7rem; color: var(--gold); margin-top: .2rem; }
/* Finale & Spiel um Platz 3 in Gold akzentuieren */
.bcol:last-child .bmatch { border-color: rgba(247, 201, 72, .45); }

/* ---- Tippen ---- */
.champ { background: linear-gradient(120deg, var(--surface), rgba(247, 201, 72, .08)); border-color: rgba(247, 201, 72, .3); }
.champ select { padding: .55rem; border-radius: 10px; border: 1px solid var(--border-strong); margin-right: .5rem; background: var(--surface-raised); color: var(--text); }
.tiplist { display: grid; gap: .4rem; }
.tiprow {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .4rem;
  background: var(--surface); border: 1px solid var(--border); padding: .55rem .7rem; border-radius: var(--radius-md); font-size: .85rem;
}
.tr-meta { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; font-family: var(--font-data); }
.tr-home.r { text-align: right; }
.tr-in { display: flex; align-items: center; justify-content: center; gap: .25rem; }
.tr-status { grid-column: 1 / -1; font-size: .76rem; color: var(--muted); text-align: center; }
.goal {
  width: 2.8rem; padding: .4rem; text-align: center; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 1rem; background: var(--surface-raised); color: var(--text); font-family: var(--font-data); min-height: 44px;
}
.tiprow.locked { opacity: .85; }
/* Phasen-Farben (Tippen-Liste): Gruppe = ruhiges Grün, K.O. = warm & kräftiger werdend. */
.ph-gr    { --ph: #1FAA7A; }
.ph-r32   { --ph: #E0A11E; }
.ph-r16   { --ph: #E0801E; }
.ph-qf    { --ph: #E0601E; }
.ph-sf    { --ph: #D93E3E; }
.ph-final { --ph: #C9A227; }
.tiprow[class*="ph-"] { border-left: 4px solid var(--ph, transparent); }
.phase-chip {
  display: inline-block; background: var(--ph, #555); color: #fff; font-weight: 700;
  font-size: .7rem; padding: 2px 8px; border-radius: 6px; letter-spacing: .02em;
  font-family: var(--font-data); margin-right: .45rem; vertical-align: middle;
}
.phase-divider {
  display: flex; align-items: center; gap: 10px; margin: 1.4rem 0 .3rem;
  font-weight: 700; font-size: .82rem; color: var(--ph, var(--muted));
  text-transform: uppercase; letter-spacing: .05em;
}
.phase-divider:first-child { margin-top: .2rem; }
.phase-divider::before { content: ''; width: 6px; height: 20px; border-radius: 3px; background: var(--ph); flex: 0 0 auto; }
.phase-divider::after  { content: ''; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--ph), transparent); }
.saved-s { color: var(--primary-hover); font-size: .72rem; font-weight: 600; }
.saved-s.flash { animation: pop .9s ease; }
.err-s { color: var(--coral); font-size: .72rem; }
.tr-status.inline { display: inline; margin-left: .4rem; }
@keyframes pop { 0% { opacity: 0; transform: scale(.8); } 35% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
.pts { font-weight: 800; padding: 0 .4rem; border-radius: 6px; font-family: var(--font-data); }
.pts3 { background: var(--qual); color: var(--primary-hover); }
.pts1 { background: rgba(247, 201, 72, .16); color: var(--gold); }
.pts0 { color: var(--muted); }
.pts.ptsw { background: linear-gradient(90deg, var(--gold), #ffb01f); color: #2a1c00; }

/* ---- Rangliste ---- */
.standings.rank th, .standings.rank td { font-size: .8rem; padding: .38rem .25rem; }
.standings.rank th[title] { cursor: help; }
.standings.rank tr.me { background: rgba(247, 201, 72, .12); }
.legend-phases { line-height: 1.7; }
.legend-phases b { color: var(--soft); }

/* ---- Statistik ---- */
.chartbox { position: relative; height: 260px; width: 100%; }
.chartbox canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ---- Admin ---- */
.admrow { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .4rem 0; border-top: 1px solid var(--border); font-size: .85rem; }
.admrow span { flex: 1 1 12rem; }
details summary { cursor: pointer; padding: .4rem 0; font-weight: 600; color: var(--soft); }
.et { padding: .35rem; border: 1px solid var(--border-strong); border-radius: 8px; font-size: .8rem; background: var(--surface-raised); color: var(--text); }
.ko-extra { display: inline-flex; align-items: center; gap: .25rem; flex-wrap: wrap; font-size: .72rem; color: var(--muted); margin-left: .25rem; }
.ko-extra .goal { width: 2.2rem; padding: .25rem; min-height: 0; }
.ko-extra .et { font-size: .72rem; padding: .25rem; }
.ok { color: var(--primary-hover); font-weight: 700; }

/* ---- Hero (Startseite) ---- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); margin-bottom: 1.4rem;
  background: radial-gradient(130% 130% at 100% 0%, #16244a, #07101d); border: 1px solid var(--border);
  color: #fff; min-height: 440px; display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 32%; }
.hero-glow {
  position: absolute; inset: -45% -10% auto -10%; height: 130%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(142, 92, 247, .5), transparent),
              radial-gradient(closest-side, rgba(0, 168, 120, .4), transparent 70%);
  background-position: 30% 0, 75% 10%; background-repeat: no-repeat; filter: blur(40px); opacity: .7;
}
/* Verlauf über dem Bild: oben/rechts hell (Ball sichtbar), unten dunkel (Text lesbar) */
.hero-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, .28) 0%, rgba(7, 17, 31, 0) 26%, rgba(7, 17, 31, .55) 66%, rgba(7, 17, 31, .94) 100%),
    linear-gradient(90deg, rgba(7, 17, 31, .55) 0%, rgba(7, 17, 31, 0) 58%);
}
.hero-inner { position: relative; max-width: 640px; padding: 1.6rem 1.5rem .4rem; }
.hero-kicker {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: #c7d3e6;
  margin: 0 0 .9rem; font-weight: 500; display: flex; align-items: center; gap: .6rem;
}
.hero-kicker .dot { opacity: .5; }
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.0; margin: 0 0 .9rem;
  letter-spacing: -.025em; font-weight: 700;
}
.hero h1 .thin { font-weight: 300; color: #e7eefb; }
.hero-sub { color: #cdd9ec; font-size: 1.02rem; font-weight: 300; line-height: 1.55; margin: 0 0 1.3rem; max-width: 33rem; }
.hero-count {
  display: inline-block; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  padding: .35rem .9rem; border-radius: 999px; font-size: .82rem; margin: 0 0 1.4rem;
  font-family: var(--font-data); color: #eaf0fa; font-weight: 500;
}
.hero-count b { color: var(--gold); font-weight: 700; }
.hero-cta { margin-bottom: 1.8rem; }
.hero-cta .btn--big { background: var(--primary); color: #fff; box-shadow: 0 10px 28px rgba(0, 168, 120, .4); }
.hero-cta .btn--big:hover { background: var(--primary-hover); }
.hero-stats {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255, 255, 255, .12); background: rgba(7, 14, 26, .55); backdrop-filter: blur(2px);
}
.hero-stats > div { padding: .85rem .4rem; text-align: center; border-left: 1px solid rgba(255, 255, 255, .08); }
.hero-stats > div:first-child { border-left: none; }
.hero-stats b { display: block; font-size: 1.35rem; color: #fff; font-family: var(--font-data); font-weight: 500; }
.hero-stats span { font-size: .68rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* ---- Hilfe / Schritte ---- */
.help h3 { margin-top: 1.1rem; }
.help h3:first-child { margin-top: 0; }
.help .lead { color: var(--soft); margin: 0 0 .6rem; font-size: 1rem; }
.adminbox { background: linear-gradient(120deg, var(--surface), rgba(247, 201, 72, .06)); border-color: rgba(247, 201, 72, .3); }
.adminbox h3 { border-left-color: var(--gold); }
.steps { margin: 0 0 .5rem; padding-left: 1.3rem; }
.steps li { margin: .55rem 0; line-height: 1.55; color: var(--soft); font-weight: 300; }
.steps li::marker { color: var(--primary); font-weight: 600; }
.step-led { font-weight: 600; color: #fff; }
.steps a, .help a, .legal a { color: var(--primary-hover); font-weight: 600; }
.pointslist { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .4rem; }
.pointslist li { display: flex; align-items: center; gap: .6rem; }
.quicknav { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 1rem; }
.qbtn {
  border: 1px solid var(--border); cursor: pointer; background: var(--surface); color: var(--text); font-weight: 700; font-size: .9rem;
  padding: .8rem 1.1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); transition: transform .15s, background .15s;
}
.qbtn:hover { transform: translateY(-2px); background: var(--surface-raised); }

/* ---- Spielorte-Kacheln ---- */
.venuegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.venuetile {
  cursor: pointer; text-align: left; border: 1px solid var(--border); border-left: 5px solid var(--c, var(--primary));
  background: var(--surface-raised); border-radius: var(--radius-md); padding: .7rem .8rem; box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: .15rem; transition: transform .12s, background .12s; color: var(--text);
}
.venuetile:hover { transform: translateY(-2px); }
.venuetile.sel { outline: 2px solid var(--c, var(--primary)); }
.vt-name { font-weight: 700; font-size: .92rem; }
.vt-count { font-size: .76rem; color: var(--muted); font-family: var(--font-data); }

/* ---- Legal ---- */
.legal h3 { font-size: 1rem; }
.legal p, .legal li { line-height: 1.55; color: var(--soft); }
.legal ul { padding-left: 1.2rem; }

/* ---- Werbebanner (rotierend, Bild oder Text) ---- */
.adbanner { position: relative; margin: .5rem auto 0; max-width: min(1000px, calc(100% - 1.2rem)); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); background: var(--bg-deep); }
.adbanner .ad-link {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .85rem; text-decoration: none; color: #2a1500;
  min-height: 46px; background: linear-gradient(90deg, var(--coral), var(--gold)); transition: opacity .2s ease;
}
.adbanner .ad-link.fade { opacity: 0; }
.adbanner .ad-link.has-img { padding: 0; background: none; display: block; }
.adbanner .ad-link.has-img img { display: block; width: 100%; height: auto; }
.adbanner .ad-text { flex: 1; min-width: 0; font-size: .85rem; }
.adbanner .ad-text b { color: #1c0e00; }
.adbanner .ad-cta { font-weight: 800; white-space: nowrap; font-size: .85rem; }
.adbanner .ad-close {
  position: absolute; top: 7px; right: 7px; z-index: 2; border: none; background: rgba(0, 0, 0, .35);
  color: #fff; cursor: pointer; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: .8rem; line-height: 1;
}
.adbanner .ad-close:hover { background: rgba(0, 0, 0, .55); }

/* ---- Footer ---- */
.sitefoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.footlinks { display: flex; gap: 1rem; }
.footlinks a { color: var(--muted); font-size: .8rem; text-decoration: none; }
.footlinks a:hover { color: #fff; text-decoration: underline; }
.storebadge { color: var(--muted); font-size: .72rem; }
.madewith { flex: 1 1 100%; order: -1; color: #c7d3e6; font-size: .82rem; text-decoration: none; padding-bottom: .4rem; }
.madewith u { color: var(--primary-hover); text-decoration: none; font-weight: 600; }
.madewith:hover u { text-decoration: underline; }

/* „Hinter den Kulissen"-Block (Startseite) */
.behind {
  background:
    radial-gradient(130% 170% at 100% 0%, rgba(142, 92, 247, .34), transparent 62%),
    linear-gradient(120deg, rgba(0, 168, 120, .26), rgba(47, 128, 237, .16));
  border: 1.5px solid rgba(0, 211, 167, .6);
  box-shadow: 0 0 26px rgba(0, 168, 120, .18), var(--shadow-card);
}
.behind h3 { border-left-color: var(--gold); }
.behind p { color: #eef3fb; font-weight: 400; line-height: 1.6; margin: 0 0 .9rem; }
.behind .btn--ghost { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }

/* ---- Modal / Gate ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 8, 18, .7); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; backdrop-filter: blur(3px); }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 1.3rem; width: min(440px, 100%); box-shadow: var(--shadow-card); }
.modal h3 { margin: 0 0 .4rem; }
.modal label { display: block; margin: .7rem 0 .2rem; font-size: .85rem; font-weight: 600; color: var(--soft); }
.modal input:not([type=checkbox]) { width: 100%; padding: .6rem; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 1rem; background: var(--surface-raised); color: var(--text); }
.modal label.adm { font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.modal label.adm.hide, .modal label.reg-only.hide { display: none; }
.modal label.consent { font-weight: 500; display: flex; align-items: flex-start; gap: .5rem; font-size: .8rem; line-height: 1.35; }
.modal label.consent input { width: auto; margin-top: .15rem; }
.modal-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.modal-err { color: var(--coral); font-size: .82rem; min-height: 1rem; margin: .5rem 0 0; }
.errlink { color: var(--primary-hover); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---- Beitritts-Dialog: Zwei-Schritt (Auswahl -> Formular) ---- */
.modal { max-height: 90vh; overflow-y: auto; }
.jm-sub { color: var(--muted); font-size: .9rem; margin: 0 0 .9rem; }
.choosegrid { display: grid; gap: .6rem; margin-bottom: .4rem; }
.choosecard {
  text-align: left; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface-raised);
  color: var(--text); border-radius: var(--radius-md); padding: .9rem 1rem; display: grid; gap: .15rem; transition: .12s;
}
.choosecard:hover { border-color: var(--primary); transform: translateY(-1px); }
.choosecard.cc-primary { box-shadow: inset 0 0 0 1px var(--primary); }
.choosecard.cc-primary .cc-ic { color: var(--primary-hover); }
.choosecard.cc-login { box-shadow: inset 0 0 0 1.5px var(--gold); background: linear-gradient(120deg, var(--surface-raised), rgba(247, 201, 72, .08)); }
.choosecard.cc-login:hover { border-color: var(--gold); }
.choosecard.cc-login .cc-ic { color: var(--gold); }
.pickbtn { width: 100%; margin-bottom: .4rem; text-align: left; }
.cc-ic { font-size: 1.2rem; }
.cc-t { font-weight: 700; font-size: 1rem; }
.cc-d { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.jm-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.jm-head h3 { margin: 0; }
.jm-back { border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer; width: 2rem; height: 2rem; border-radius: 8px; font-size: 1rem; flex: 0 0 auto; }
.jm-back:hover { border-color: var(--primary); }
.jm-sec { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .7rem .85rem; margin: .6rem 0; }
.jm-sec--soft { background: rgba(0, 168, 120, .06); border-color: rgba(0, 168, 120, .25); }
.jm-sec-t { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }
.jm-sec label { margin-top: .5rem; }
.jm-sec label:first-of-type { margin-top: .3rem; }
.jm-hint { font-size: .76rem; color: var(--muted); margin: .45rem 0 0; line-height: 1.4; }
.jm-spam { font-size: .8rem; color: var(--soft); background: rgba(47, 128, 237, .12); border: 1px solid rgba(47, 128, 237, .3); border-radius: 10px; padding: .55rem .75rem; margin: .6rem 0 0; line-height: 1.45; }

.modeswitch { display: flex; gap: .5rem; margin-bottom: .5rem; }
.ms-btn { flex: 1; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); padding: .6rem; border-radius: 10px; cursor: pointer; font-weight: 700; font-family: var(--font-ui); transition: .12s; }
.ms-btn:hover { color: var(--text); border-color: var(--primary); }
.ms-btn.is-on { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 14px rgba(0, 168, 120, .3); }
.modehint { color: var(--muted); font-size: .8rem; line-height: 1.4; margin: 0 0 .6rem; }
.modal .join-fields .hide { display: none; }
.modal-sep { border: none; border-top: 1px solid var(--border); margin: .9rem 0; }

/* ---- Meine Gruppe: Code & Einladungslink ---- */
.joincode { font-family: var(--font-data); font-size: 1.4rem; font-weight: 700; letter-spacing: .06em; color: var(--gold); background: var(--surface-raised); border: 1px dashed var(--border-strong); border-radius: 10px; padding: .55rem .8rem; text-align: center; margin: .3rem 0 .6rem; }
.invite { width: 100%; font-size: .78rem; font-family: var(--font-data); padding: .5rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-raised); color: var(--text); }
.invite { width: 100%; }
.invite-emails { width: 100%; padding: .55rem; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-raised); color: var(--text); font-family: var(--font-ui); font-size: .9rem; resize: vertical; }
.invite-actions { display: flex; gap: .5rem; margin: .5rem 0; flex-wrap: wrap; }
.who small { color: var(--muted); font-weight: 500; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(2rem);
  background: var(--surface-raised); border: 1px solid var(--border-strong); color: #fff; padding: .7rem 1.1rem;
  border-radius: var(--radius-md); box-shadow: var(--shadow-card); opacity: 0; pointer-events: none;
  transition: .25s; font-size: .9rem; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--coral); border-color: var(--coral); }

/* ---- Fokus-Sichtbarkeit (Accessibility) ---- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* =============================================================================
   NUR MOBIL (≤ 680px). Greift NIE auf dem Desktop – die Desktop-Ansicht bleibt
   unverändert. Ziel: Titelseite (Hero) über dem Ball-Bild klar lesbar machen.
   ============================================================================= */
@media (max-width: 680px) {
  /* Hero etwas kompakter für mehr Übersicht */
  .hero { min-height: 392px; }
  .hero-inner { padding: 1.3rem 1.2rem .3rem; }

  /* Kräftigerer Schleier: Text bekommt Kontrast, Ball bleibt dezent sichtbar */
  .hero-scrim {
    background:
      linear-gradient(180deg,
        rgba(7, 17, 31, .60) 0%,
        rgba(7, 17, 31, .42) 20%,
        rgba(7, 17, 31, .58) 44%,
        rgba(7, 17, 31, .84) 72%,
        rgba(7, 17, 31, .98) 100%);
  }

  /* Textschatten = gestochen lesbar über jeder Stelle des Balls */
  .hero h1 { text-shadow: 0 2px 14px rgba(7, 17, 31, .85), 0 1px 3px rgba(7, 17, 31, .9); }
  .hero-sub { color: #e8eefa; text-shadow: 0 1px 10px rgba(7, 17, 31, .9); }
  .hero-kicker { color: #dde7f6; text-shadow: 0 1px 6px rgba(7, 17, 31, .8); }
}
