/* SkillApp — kräftiges, kompaktes Mobile-Game-Design.
   Bold-Palette (kein Pastell): Blau/Rot-Teams, Gold als Akzent, dunkle
   Konturen. Dominantes Spielfeld, alles ohne Scrollen im Hochformat. */
:root {
  --himmel: #1479d1;
  --himmel-tief: #0f5ca6;
  --dunkelblau: #173a67;
  --dunkelblau-tief: #0e2547;
  --gold: #d99b00;
  --gold-hell: #f5b915;
  --rot: #d93632;
  --rot-tief: #a5211d;
  --gruen: #62a92e;
  --creme: #fff6de;
  --kontur: #0d1f3a;
  /* Team-Welten */
  --team0: #1479d1; --team0-tief: #0d5093;
  --team1: #d93632; --team1-tief: #9c201c;
  --text: #ffffff;
  /* Symbolfarben (Partikel): Ananas, Limette, Hibiskus, Juwel, Goldmaske */
  --tier0: #ff9100; --tier1: #2e9e44; --tier2: #e0312f; --tier3: #8e5cff; --tier4: #f5b915;
  /* Himmelsstimmung (Design-Sets überschreiben diese via wendeSetAn) */
  --set-himmel1: #2f9be0; --set-himmel2: #6fc0ee;
  --set-horizont: #ffd98a; --set-boden: #f0a24b;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; height: 100%; overflow: hidden; }
body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, var(--himmel) 0%, var(--himmel-tief) 100%);
  color: var(--text); height: 100%; overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
svg { display: block; width: 100%; height: 100%; }
.tier svg, .pavatar svg, #ergebnisPortrait svg, .suche-portraits svg,
.hand-mini svg, .info-tier svg, #parade svg { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; display: block; }

.screen { display: none; }
.screen.active { display: flex; animation: rein .2s ease-out; }
@keyframes rein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ================= Wimpelkette (Hub-Screens + Suche) ================= */
.bunting { position: relative; z-index: 2; width: 100%; height: 24px; flex: none; pointer-events: none; }
.bunting svg { width: 100%; height: 100%; overflow: visible; }
@keyframes wimpelwehen { 0%,100% { transform: translateY(0) skewX(0); } 50% { transform: translateY(1.5px) skewX(-1.4deg); } }
.bunting svg > g { transform-origin: top center; animation: wimpelwehen 3.2s ease-in-out infinite; }
.bunting svg > g:nth-child(3n) { animation-delay: -1s; }
@media (prefers-reduced-motion: reduce) { .bunting svg > g { animation: none; } }

/* ================= Hub-Seiten (Home · Spiele · Rangliste · Profil) ================= */
.screen.hub {
  flex-direction: column; max-width: 560px; margin: 0 auto; width: 100%; height: 100dvh; overflow-y: auto;
  padding: calc(8px + env(safe-area-inset-top)) 18px calc(86px + env(safe-area-inset-bottom)); gap: 11px;
}
.hub .bunting { margin: 0 -18px; width: calc(100% + 36px); flex: none; }
/* ---------- Anden-Kulisse hinter den Hub-Seiten ---------- */
.kulisse { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #2f8fe0 0%, #1b6fc0 38%, #14508f 72%, #0f3a6b 100%); }
.kulisse svg { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; min-height: 46%; }
.screen.hub, .tableiste { position: relative; z-index: 1; }

/* ---------- Kopfleiste ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; flex: none; min-height: 40px; }
.tb-marke { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: block;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); padding: 4px; }
/* „X Spieler online" in der Kopfleiste. Steht zwischen Marke und Zahnrad und
   wird per hidden-Attribut geschaltet — sichtbar erst, wenn eine echte Zahl
   vorliegt (kein display in dieser Regel, sonst gewänne sie gegen [hidden]). */
.online-zahl { font-size: .78rem; font-weight: 700; color: #cfe4f7;
  background: rgba(255,255,255,.12); border-radius: 999px; padding: 5px 11px;
  white-space: nowrap; }
.online-zeile { margin: -4px 0 10px; font-size: .9rem; font-weight: 600; color: #cfe4f7; text-align: center; }
.tb-knopf { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #dceaf8; cursor: pointer; padding: 9px;
  transition: background .15s, transform .08s; }
.tb-knopf:active { transform: scale(.92); }

/* ---------- Marke ---------- */
.marke { text-align: center; }
.logo { font-size: clamp(2.4rem, 11vw, 3.4rem); font-weight: 900; letter-spacing: -.5px; color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,.35); line-height: 1.02; }
.logo .mini { color: var(--gold-hell); }
.claim { color: #cfe4f7; margin: 6px 0 0; font-size: .92rem; font-weight: 600; line-height: 1.35; }
#parade { display: flex; justify-content: center; gap: 8px; height: clamp(46px, 13vw, 62px); flex: none; }
/* ACHTUNG: Padding hier NICHT in Prozent angeben! Prozent-Padding rechnet gegen
   die BREITE des Elternelements (#parade, volle Zeilenbreite) — 6% ergaben 31px
   je Seite und liessen die Kachel-Innenflaeche auf 0 kollabieren: die Symbole
   waren unsichtbar. Gleiches gilt fuer .hand-mini weiter unten. */
#parade .p-tier { width: clamp(46px, 13vw, 62px); background: #f4f8fd; border: none; border-radius: 30%; padding: clamp(4px, 1.1vw, 7px); box-shadow: 0 6px 14px rgba(4,18,40,.28); }

@keyframes huepf { 0%,100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-8px) rotate(-4deg); } 65% { transform: translateY(1px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { #parade .p-tier, #ergebnisPortrait, .suche-portraits .sp { animation: none; } }

.feld label { display: block; font-size: .8rem; color: #cfe4f7; margin-bottom: 5px; font-weight: 700; }
.feld input { width: 100%; font: inherit; font-weight: 700; font-size: 1rem; color: var(--dunkelblau); background: var(--creme); border: 2px solid var(--kontur); border-radius: 14px; padding: 12px 16px; min-height: 48px; box-shadow: inset 0 2px 3px rgba(255,255,255,.5); }
.feld input:focus { outline: 3px solid var(--gold-hell); }

/* ================= Karten-System (ein Look für alle Info-Blöcke) =================
   Halbtransparente, weich abgesetzte Flächen statt umrandeter Kästen. Genau EIN
   Eckenradius, EIN weicher Schatten, farbcodiertes Label je Kategorie — das
   ersetzt die frühere „Kastensuppe" mit je eigenem Rahmen. */
.karte {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: linear-gradient(160deg, rgba(28,72,132,.82), rgba(14,44,88,.86));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px; padding: 13px 15px; color: #fff; min-height: 84px;
  box-shadow: 0 8px 22px rgba(4,18,40,.32);
}
.karte-klick { cursor: pointer; transition: transform .08s ease, filter .15s; }
.karte-klick:active { transform: scale(.985); filter: brightness(1.08); }
.karte-icon { width: 50px; height: 50px; flex: none; padding: 7px; border-radius: 15px;
  background: rgba(255,255,255,.10); display: flex; align-items: center; justify-content: center; }
.karte-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.karte-label { font-size: .64rem; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.karte-wert { font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1.08; }
.karte-wert small { font-size: .8rem; font-weight: 700; color: #a9c6e4; margin-left: 4px; }
.karte-sub { font-size: .76rem; color: #a9c6e4; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.karte-rechts { margin-left: auto; text-align: right; flex: none; padding-left: 12px; }
.karte-rechts .kr-klein { font-size: .68rem; color: #a9c6e4; display: block; }
.karte-rechts .kr-gross { font-size: 1.15rem; font-weight: 800; color: #fff; }
.label-liga { color: #ffb04a; } .label-ziel { color: #6fd97f; } .label-modus { color: #b39ff0; }
.karte-pfeil { margin-left: auto; flex: none; display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  padding: 7px 11px; font-size: .76rem; font-weight: 800; color: #dbe9fa; white-space: nowrap; }

/* Fortschrittsring der Tagesaufgabe */
.ring { position: relative; width: 58px; height: 58px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: .74rem; font-weight: 800; color: #fff; white-space: nowrap; }
.ring .ring-text .rt-ziel { color: #86a6c8; font-weight: 700; }

h2.abschnitt { margin: 4px 0 -4px; font-size: .85rem; color: var(--gold-hell); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; }

.spiel-card { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.25); border-radius: 15px; padding: 11px 14px; cursor: pointer; text-align: left; min-height: 56px; transition: border-color .15s, background .15s; }
.spiel-card.gewaehlt { border-color: var(--gold-hell); background: rgba(217,155,0,.22); }
.spiel-card .spiel-icon { font-size: 1.7rem; flex: none; }
.spiel-card .spiel-text { display: flex; flex-direction: column; min-width: 0; }
.spiel-card .spiel-text b { font-size: .98rem; color: #fff; }
.spiel-card .spiel-text span { font-size: .76rem; color: #cfe4f7; }
.spiel-card .spiel-haken { margin-left: auto; color: var(--gold-hell); font-weight: 900; font-size: 1.1rem; }

/* ================= Hauptaktionen (Duell / Training) ================= */
.cta {
  flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0;
  border: none; border-radius: 20px; padding: 14px 13px; min-height: 78px;
  cursor: pointer; color: #fff; text-align: left;
  box-shadow: 0 10px 24px rgba(4,18,40,.36);
  transition: transform .09s ease, box-shadow .09s ease;
}
.cta:active { transform: translateY(3px) scale(.99); box-shadow: 0 4px 12px rgba(4,18,40,.34); }
.cta-duell { background: linear-gradient(150deg, #4aa8f7 0%, #1f77d6 55%, #145da8 100%); }
.cta-training { background: linear-gradient(150deg, #a97cf5 0%, #7c4de0 55%, #5b32b8 100%); }
.cta-icon { width: 40px; height: 40px; flex: none; }
.cta-text { display: flex; flex-direction: column; min-width: 0; }
.cta-titel { font-size: 1.02rem; font-weight: 900; letter-spacing: .4px; }
.cta-sub { font-size: .7rem; color: rgba(255,255,255,.82); font-weight: 600; }
#setListe { display: flex; gap: 8px; }
.set-knopf { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.22); border-radius: 12px; padding: 8px 4px; min-height: 44px; cursor: pointer; font-size: .74rem; color: #cfe4f7; font-weight: 700; }
.set-knopf .set-farbe { width: 34px; height: 34px; border-radius: 10px; border: 2px solid rgba(255,255,255,.6); }
.set-knopf.gewaehlt { border-color: var(--gold-hell); color: #fff; background: rgba(217,155,0,.18); }
.set-knopf.gesperrt { opacity: .5; filter: grayscale(.6); }

.knopfreihe { display: flex; gap: 10px; }
button.gross { flex: 1; font-weight: 800; font-size: 1.02rem; border: 2px solid var(--kontur); border-radius: 15px; padding: 14px 10px; min-height: 56px; cursor: pointer; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); box-shadow: 0 5px 0 rgba(0,0,0,.28); transition: transform .06s, box-shadow .06s; }
button.gross:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }
.btn-tuerkis { background: linear-gradient(180deg, #2a95e6, var(--team0) 60%, var(--team0-tief)); }
.btn-koralle { background: linear-gradient(180deg, var(--gold-hell), var(--gold) 60%, #b07d00); color: #3a2600; text-shadow: none; }
.btn-grau { background: rgba(255,255,255,.16); box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.einstellungen { display: flex; gap: 8px; }
.einstellungen button { flex: 1; min-height: 44px; background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.22); border-radius: 12px; font-size: .88rem; font-weight: 700; cursor: pointer; color: #fff; }
.einstellungen button.aus { opacity: .5; }
footer.site { text-align: center; color: rgba(255,255,255,.5); font-size: .74rem; margin-top: auto; }

/* ================= Suche ================= */
#screenSuche { flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; padding: 24px; gap: 14px; text-align: center; }
#screenSuche .bunting { position: absolute; top: 0; left: 0; }
.suche-portraits { display: flex; align-items: center; gap: 16px; }
.suche-portraits .sp { width: 84px; height: 84px; animation: huepf 1.6s ease-in-out infinite; }
.suche-portraits .sp:last-child { animation-delay: .3s; }
.suche-portraits .vs { font-weight: 900; font-size: 1.4rem; color: var(--gold-hell); text-shadow: 0 2px 0 rgba(0,0,0,.3); }
#screenSuche h2 { color: #fff; }
#botFallback p { color: #cfe4f7; font-size: .92rem; margin: 14px 0 8px; }
#screenSuche .btn-grau { min-width: 200px; }

/* ================= SPIEL ================= */
#screenSpiel {
  position: relative;
  flex-direction: column; height: 100dvh; max-width: 640px; margin: 0 auto;
  padding: calc(6px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
  overflow: hidden; gap: 6px;
  /* Dschungel-Himmel: Blau oben, warmes Abendlicht am Horizont —
     die Farben stellen die freischaltbaren Design-Sets um */
  background: linear-gradient(180deg, var(--set-himmel1) 0%, var(--set-himmel2) 40%, var(--set-horizont) 76%, var(--set-boden) 100%);
}
/* Inhalt liegt über dem Blattwerk. MUSS eine eigene Regel bleiben: ein Komma am
   Zeilenende zog diese Selektoren schon einmal in den .dschungel-Block — HUD,
   Statuszeile und Hand-Leiste wurden dadurch absolut übereinander gestapelt und
   waren wegen pointer-events:none nicht mehr bedienbar. */
#screenSpiel > .hud, #screenSpiel > #zugHinweis, #screenSpiel > .hand-leiste {
  position: relative; z-index: 1;
}
/* Dschungel-Blattwerk an den Rändern */
.dschungel {
  position: absolute; z-index: 0; pointer-events: none; opacity: .92;
  width: clamp(64px, 18vw, 104px); height: calc(clamp(64px, 18vw, 104px) * 1.33);
}
.dschungel.links { left: -8px; top: 86px; }
.dschungel.rechts { right: -8px; bottom: 178px; transform: scaleX(-1); }

/* --- Spielerkarten --- */
.hud { display: flex; align-items: stretch; gap: 8px; flex: none; }
.platte { position: relative; flex: 1; display: flex; align-items: center; gap: 8px; border-radius: 15px; padding: 7px 10px; min-width: 0; border: 3px solid transparent; box-shadow: 0 4px 0 rgba(0,0,0,.28); transition: transform .18s, box-shadow .18s, border-color .18s; }
.platte.team0 { background: linear-gradient(165deg, #2a95e6, var(--team0) 62%, var(--team0-tief)); }
.platte.team1 { background: linear-gradient(165deg, #e8514d, var(--team1) 62%, var(--team1-tief)); }
.platte.rechts { flex-direction: row-reverse; text-align: right; }
.platte:not(.dran) { filter: saturate(.9) brightness(.94); }
.platte.dran { border-color: var(--gold-hell); box-shadow: 0 0 0 1px var(--gold), 0 4px 0 rgba(0,0,0,.28), 0 0 16px rgba(245,185,21,.45); transform: translateY(-1px); }
.platte.schnappt { animation: schnapp .5s ease-out; }
@keyframes schnapp { 0%,100% { transform: scale(1); } 30% { transform: scale(1.05); box-shadow: 0 0 0 3px var(--gold-hell), 0 0 22px var(--gold-hell); } }
.platte .pavatar { width: clamp(40px, 12vw, 52px); height: clamp(40px, 12vw, 52px); flex: none; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.25); border: 2.5px solid #fff; }
.platte.dran .pavatar { animation: wippen 1.4s ease-in-out infinite; }
@keyframes wippen { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-6deg); } 70% { transform: rotate(5deg); } }
.platte .pinfo { min-width: 0; display: flex; flex-direction: column; }
.platte .pname { font-weight: 800; font-size: clamp(.72rem, 3vw, .9rem); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platte .ppunkte { display: inline-block; font-family: Consolas, "Courier New", monospace; font-weight: 800; font-size: clamp(1.4rem, 7vw, 2.1rem); color: #fff; letter-spacing: 1px; line-height: 1; text-shadow: 0 2px 3px rgba(0,0,0,.4); }
.platte .ppunkte.bump { animation: punktebump .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes punktebump { 0% { transform: scale(1); } 35% { transform: scale(1.28); text-shadow: 0 0 16px var(--gold-hell); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .platte .ppunkte.bump, .platte.dran .pavatar { animation: none; } }

/* --- Statuszeile --- */
#zugHinweis { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 1.5em; font-size: clamp(.9rem, 3.8vw, 1.1rem); font-weight: 800; }
#zugHinweis .zh-text { text-shadow: 0 1px 2px rgba(0,0,0,.3); }
#zugHinweis.team0 .zh-text { color: #bfe0ff; } #zugHinweis.team1 .zh-text { color: #ffc9c7; }
#zugHinweis:not(.team0):not(.team1) .zh-text { color: #fff; }
.zh-sek { font-family: Consolas, "Courier New", monospace; font-weight: 800; font-size: .85rem; color: #fff; background: rgba(13,31,58,.55); border-radius: 8px; padding: 1px 7px; min-width: 2.4ch; text-align: center; }
.zh-sek.knapp { color: #fff; background: var(--rot); animation: sekpuls .5s ease-in-out infinite; }
@keyframes sekpuls { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* --- Aktueller Stein + Vorschau --- */
.hand-leiste { flex: none; display: flex; align-items: center; justify-content: center; gap: 16px; }
.hand-aktuell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hand-label { font-size: .64rem; font-weight: 900; letter-spacing: 1.5px; color: var(--gold-hell); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.hand-danach .hand-label { color: #cfe4f7; }
.hand-stein { position: relative; width: clamp(66px, 19vw, 92px); height: clamp(66px, 19vw, 92px); cursor: grab; touch-action: none; }
.hand-stein .kachel { position: absolute; inset: 0; border-radius: 22%; background: var(--creme); border: 4px solid var(--gold); box-shadow: 0 0 0 2px var(--kontur), 0 4px 10px rgba(0,0,0,.4); }
.hand-stein.dran .kachel { animation: steinpuls 1.5s ease-in-out infinite; }
@keyframes steinpuls { 0%,100% { box-shadow: 0 0 0 2px var(--kontur), 0 4px 10px rgba(0,0,0,.4); } 50% { box-shadow: 0 0 0 2px var(--kontur), 0 0 16px 3px var(--gold-hell), 0 4px 10px rgba(0,0,0,.4); } }
@media (prefers-reduced-motion: reduce) { .hand-stein.dran .kachel { animation: none; } }
.hand-stein .tier { position: absolute; inset: 8%; }
.hand-stein.gegriffen { opacity: .25; }
.hand-danach { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hand-danach .hand-label { color: #fff; }
.hand-queue { display: flex; align-items: center; gap: 7px; }
.hand-queue .hand-mini {
  /* Padding bewusst in px, nicht in % — siehe Hinweis bei #parade .p-tier */
  width: clamp(52px, 15vw, 70px); height: clamp(52px, 15vw, 70px); padding: clamp(4px, 1vw, 6px);
  background: var(--creme); border: 3px solid var(--kontur); border-radius: 22%;
  box-shadow: 0 3px 6px rgba(0,0,0,.32);
}
.hand-queue .q1 { opacity: 1; } .hand-queue .q2 { opacity: .95; } .hand-queue .q3 { opacity: .9; }

/* --- Spielfeld: dominant, ein Gold-Rahmen --- */
.brett-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 2px; position: relative; }
#brettBereich { position: relative; display: grid; grid-template-columns: var(--lane) repeat(5, var(--zelle)) var(--lane); grid-template-rows: var(--lane) repeat(5, var(--zelle)); gap: var(--bgap); }
#brett {
  grid-column: 2 / 7; grid-row: 2 / 7; display: grid;
  grid-template-columns: repeat(5, var(--zelle)); grid-template-rows: repeat(5, var(--zelle)); gap: var(--bgap);
  background: #5b3f1d; border-radius: 12px;
  box-shadow: 0 0 0 5px var(--gold), 0 0 0 8px #3a2408, 0 12px 26px rgba(0,0,0,.45);
}
.zelle { background: #6d4d24; border-radius: 18%; box-shadow: inset 0 2px 5px rgba(0,0,0,.35), inset 0 -1px 1px rgba(255,255,255,.12); }

#steine, #ghost, #fxLayer { position: absolute; inset: 0; pointer-events: none; }
#fxLayer { z-index: 6; overflow: visible; }

/* Lanes = Tempelsteine: oben der Sturz, seitlich Säulenblöcke — die Pfeile
   liegen direkt auf den Steinen (eigene Tempel-Gestaltung, keine Kopie) */
.lane {
  position: relative;
  border: 2px solid #6e4a00;
  background: linear-gradient(180deg, #f2cf6b, #d3a12e);
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; opacity: 1; transition: background .2s, transform .1s; touch-action: none;
  box-shadow: inset 0 2px 2px rgba(255,255,255,.5), inset 0 -3px 4px rgba(110,74,0,.35);
}
/* Unsichtbare Trefferzonen-Erweiterung: quer zur Schmalseite +2 px (füllt die
   Fugen fast ganz), nach AUSSEN großzügig — so kommen auch schmale Lanes auf
   ≥44 px wirksame Tipp-Fläche, ohne dass sich Nachbarn überlappen. */
.lane::before { content: ""; position: absolute; inset: -2px; }
.lane[data-art="oben"]::before { top: -10px; }
.lane[data-art="links"]::before { left: -10px; }
.lane[data-art="rechts"]::before { right: -10px; }
.lane[data-art="links"], .lane[data-art="rechts"] {
  background:
    repeating-linear-gradient(180deg, transparent 0 11px, rgba(110,74,0,.2) 11px 13px),
    linear-gradient(90deg, #f2cf6b, #d3a12e);
}
.lane .lane-pfeil {
  font-size: clamp(1.05rem, 4.4vw, 1.45rem); font-weight: 900; color: #fff;
  text-shadow: 0 2px 2px rgba(90,50,0,.7); opacity: .4; transition: opacity .2s;
}
.lane.aktiv .lane-pfeil { opacity: 1; animation: pfeilpuls 1.3s ease-in-out infinite; }
@keyframes pfeilpuls { 0%,100% { transform: scale(1); } 50% { transform: scale(1.22); } }
@media (prefers-reduced-motion: reduce) { .lane.aktiv .lane-pfeil { animation: none; } }
.lane.aktiv:active { transform: scale(.9); }
.lane.ziel { background: linear-gradient(180deg, #ffe9a8, #f5b915); }
.lane.ziel .lane-pfeil { opacity: 1; }
.lane.tutorial-ziel { animation: tutorialpuls .9s ease-in-out infinite; }
.lane.tutorial-ziel .lane-pfeil { opacity: 1; }
@keyframes tutorialpuls { 0%,100% { box-shadow: 0 0 0 2px rgba(245,185,21,.9); } 50% { box-shadow: 0 0 16px 5px rgba(245,185,21,.7); } }
.lane:not(.aktiv) { cursor: default; pointer-events: none; }

/* --- Spielsteine: Creme-Kacheln, große Symbole --- */
.stein, #ghost, .drag-avatar { position: absolute; left: 0; top: 0; will-change: transform; }
.stein .kachel, .drag-avatar .kachel { position: absolute; inset: 0; border-radius: 20%; background: var(--creme); border: 2px solid var(--kontur); box-shadow: inset 0 -2px 3px rgba(150,110,40,.18); }
.stein .tier, #ghost .tier, .drag-avatar .tier { position: absolute; inset: 5%; }
#ghost { display: none; opacity: .7; z-index: 5; border-radius: 20%; background: rgba(255,246,222,.35); box-shadow: inset 0 0 0 3px var(--gold-hell); }
#ghost.gut { box-shadow: inset 0 0 0 3px var(--gruen), 0 0 12px var(--gruen); }
.ghost-punkte { position: absolute; top: -14px; right: -8px; background: var(--gruen); color: #fff; font-size: .72rem; font-weight: 900; border-radius: 10px; padding: 2px 7px; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.drag-avatar { position: fixed; z-index: 60; pointer-events: none; filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); }

/* --- Effekte --- */
.partikel { position: absolute; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; }
.welle { position: absolute; width: 46px; height: 46px; border: 3px solid rgba(255,255,255,.9); border-radius: 50%; pointer-events: none; }
.combo-text { position: absolute; left: 50%; top: 40%; transform: translate(-50%,-50%); font-weight: 900; white-space: nowrap; pointer-events: none; text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 20px rgba(245,185,21,.8); }
.combo-text.stufe1 { font-size: 1.6rem; color: var(--gold-hell); } .combo-text.stufe2 { font-size: 2rem; color: #ff8c1a; } .combo-text.stufe3 { font-size: 2.4rem; color: var(--rot); }
.punkte-chip { position: absolute; transform: translate(-50%,-50%); display: flex; align-items: center; gap: 4px; background: linear-gradient(180deg, var(--gold-hell), var(--gold)); color: #3a2600; font-weight: 900; font-size: clamp(.9rem, 3.6vw, 1.1rem); border-radius: 12px; padding: 3px 10px 3px 6px; box-shadow: 0 3px 8px rgba(0,0,0,.45); border: 2px solid var(--kontur); pointer-events: none; }
.punkte-chip .chip-tier { width: 22px; height: 22px; flex: none; }

/* --- Tempel-Plaza: die Erdmännchen-Banden (Team-Prinzip) ---
   Goldsteinerner Vorplatz unterm Brett; links die blaue, rechts die rote
   Bande, in der Mitte das Podest mit dem Wechsel-Zähler. */
.buehne {
  flex: none; position: relative; z-index: 1;
  height: clamp(88px, 13.5dvh, 118px);
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 6px 7px;
  border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(110,74,0,.14) 0 36px, transparent 36px 38px),
    linear-gradient(180deg, #e8bd6b, #cf9a3e);
  border: 2.5px solid #6e4a00;
  box-shadow: inset 0 3px 4px rgba(255,255,255,.45), inset 0 -4px 6px rgba(110,74,0,.3);
}
.schwarm { position: relative; display: flex; align-items: flex-end; height: 100%; z-index: 2; }
.figur {
  position: relative;
  width: calc(clamp(34px, 9.5vw, 48px) * var(--fg, 1));
  margin: 0 -4px;
  animation: figurwippt 2.4s ease-in-out infinite;
}
.figur svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 2px rgba(80,50,10,.25)); }
@keyframes figurwippt { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
/* Die rechte Bande schaut nach links. Gespiegelt wird NUR die Grafik, nie das
   animierte .figur: hing die Spiegelung an den Keyframes, verschwand sie am Ende
   jeder Animation — und die gegengespiegelte Sprechblase stand dann verkehrt. */
.schwarm.rechts .figur svg { transform: scaleX(-1); }
.figur.hops { animation: figurhops .55s ease-out; }
@keyframes figurhops { 0%,100% { transform: translateY(0); } 35% { transform: translateY(-26%) rotate(-4deg); } 70% { transform: translateY(0); } 85% { transform: translateY(-9%); } }
/* Muss NACH .figur.hops stehen: gleiche Spezifität, sonst hüpfen die Figuren
   trotz abgeschalteter Bewegung weiter. */
@media (prefers-reduced-motion: reduce) { .figur, .figur.hops { animation: none; } }
/* Sprechblase über einem Erdmännchen */
.figur-blase {
  position: absolute; bottom: 96%; left: 50%; transform: translateX(-50%);
  background: #fffdf5; color: #2c2418; font-size: clamp(.6rem, 2.5vw, .76rem); font-weight: 800; line-height: 1.15;
  padding: 3px 8px; border-radius: 10px; white-space: nowrap; box-shadow: 0 3px 8px rgba(0,0,0,.3);
  pointer-events: none; z-index: 9; animation: blaseauf .18s ease-out;
}
.figur-blase::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #fffdf5; }
@keyframes blaseauf { from { transform: translateX(-50%) scale(.5); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
/* Podest in der Mitte: Punkte bis zum nächsten Überläufer */
.podest {
  position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); z-index: 4;
  background: linear-gradient(180deg, #f2cf6b, #d3a12e);
  border: 2.5px solid #6e4a00; border-radius: 10px; padding: 3px 7px;
  box-shadow: 0 3px 0 #8a5f24, 0 5px 10px rgba(90,50,0,.35);
}
.podest-schild {
  font-family: Consolas, "Courier New", monospace; font-weight: 800;
  font-size: clamp(.95rem, 4vw, 1.2rem); color: var(--gold-hell); white-space: nowrap;
  background: var(--dunkelblau); border: 2px solid #6e4a00; border-radius: 8px; padding: 1px 12px; display: inline-block;
}
.podest .pfeil0 { color: #6fc2ff; } .podest .pfeil1 { color: #ff8a86; }
/* Überläufer, der sichtbar die Seite wechselt */
#wanderfigur {
  position: absolute; bottom: 10px; left: 0; width: clamp(34px, 9.5vw, 48px);
  opacity: 0; pointer-events: none; z-index: 6;
  filter: drop-shadow(0 3px 5px rgba(80,50,10,.4));
}
#wanderfigur svg { display: block; width: 100%; height: auto; }
#wanderfigur.nach-links { animation: laufLinks .9s ease-in-out forwards; }
#wanderfigur.nach-rechts { animation: laufRechts .9s ease-in-out forwards; }
@keyframes laufLinks {
  0% { left: 68%; opacity: 0; } 12% { opacity: 1; }
  30% { transform: translateY(-14%); } 45% { transform: translateY(0); }
  60% { transform: translateY(-14%); } 75% { transform: translateY(0); } 88% { opacity: 1; }
  100% { left: 12%; opacity: 0; }
}
@keyframes laufRechts {
  0% { left: 12%; opacity: 0; transform: scaleX(-1); } 12% { opacity: 1; }
  30% { transform: scaleX(-1) translateY(-14%); } 45% { transform: scaleX(-1) translateY(0); }
  60% { transform: scaleX(-1) translateY(-14%); } 75% { transform: scaleX(-1) translateY(0); } 88% { opacity: 1; }
  100% { left: 68%; opacity: 0; transform: scaleX(-1); }
}
@media (prefers-reduced-motion: reduce) { #wanderfigur { animation-duration: .3s !important; } }

/* --- Untere Bedienleiste: Aufgeben · Uhr · Punkte · Regeln --- */
.fussleiste { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.foot-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; min-width: 46px; padding: 4px 10px; background: rgba(13,31,58,.5); border: 2px solid rgba(255,255,255,.25); border-radius: 12px; color: #fff; font-size: .66rem; font-weight: 800; cursor: pointer; }
.foot-btn .fb-icon { font-size: 1.05rem; line-height: 1; }
.match-uhr { flex: none; display: flex; align-items: center; justify-content: center; font-family: Consolas, "Courier New", monospace; font-weight: 800; font-size: clamp(1.3rem, 6vw, 1.7rem); color: var(--gold-hell); background: var(--dunkelblau); border: 3px solid var(--gold); border-radius: 13px; padding: 5px 16px; min-width: 92px; text-align: center; box-shadow: 0 4px 0 rgba(0,0,0,.3); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.match-uhr.knapp { color: #fff; background: var(--rot); border-color: var(--gold-hell); animation: uhrpuls 1s ease-in-out infinite; }
@keyframes uhrpuls { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ================= Overlays ================= */
.overlay { display: none; position: fixed; inset: 0; background: rgba(13,31,58,.72); backdrop-filter: blur(3px); z-index: 50; align-items: center; justify-content: center; padding: 24px; }
.overlay.visible { display: flex; }
.overlay .box { position: relative; overflow: hidden auto; background: linear-gradient(170deg, #1f4f8c, var(--dunkelblau) 75%, var(--dunkelblau-tief)); border: 3px solid var(--gold); border-radius: 22px; max-width: 380px; width: 100%; max-height: calc(100dvh - 40px); padding: 22px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: boxrein .26s cubic-bezier(.34,1.56,.64,1); }
@keyframes boxrein { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#ergebnisPortrait { width: 92px; height: 92px; margin: 0 auto; animation: huepf 1.8s ease-in-out infinite; }
.overlay h2 { margin: 8px 0 4px; font-size: 1.5rem; color: var(--gold-hell); }
.overlay p { margin: 0 0 10px; color: #cfe4f7; line-height: 1.45; font-size: .95rem; }
#eloZeile { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; color: #fff; }
#eloZeile b { font-family: Consolas, "Courier New", monospace; color: var(--gold-hell); }
.elo-plus { color: #7ee06a; font-weight: 900; } .elo-minus { color: #ff8f6b; font-weight: 900; }
#konfetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#konfetti i { position: absolute; top: -20px; border-radius: 2px; display: block; }
#ergebnisStats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
#ergebnisStats > div { background: rgba(0,0,0,.25); border: 1.5px solid rgba(255,255,255,.15); border-radius: 10px; padding: 7px; font-size: .8rem; color: #cfe4f7; }
#ergebnisStats b { display: block; color: var(--gold-hell); font-size: 1rem; }
#ergebnisExtra { min-height: 1.4em; font-weight: 800; color: #7ee06a; margin-bottom: 10px; font-size: .92rem; }
.overlay .knopfreihe { flex-direction: column; }

/* Info-/Punkte-Modal */
#infoModal .box { text-align: left; }
#infoModal h2 { text-align: center; }
.info-kopf { display: grid; grid-template-columns: 1fr 2.6em 2.6em 2.6em; gap: 6px; align-items: center; padding: 2px 0 6px; font-size: .72rem; font-weight: 800; color: var(--gold-hell); text-align: center; }
.info-kopf span:first-child { text-align: left; }
.info-zeile { display: grid; grid-template-columns: 1fr 2.6em 2.6em 2.6em; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: .9rem; }
.info-zeile .info-haupt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.info-zeile .info-tier { width: 34px; height: 34px; flex: none; padding: 3px; background: var(--creme); border: 1.5px solid var(--kontur); border-radius: 22%; }
.info-zeile .info-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-zeile .info-name small { color: #9fc3e6; font-weight: 700; }
.info-zeile b { text-align: center; color: #fff; font-family: Consolas, "Courier New", monospace; }
.info-regeln { color: #cfe4f7; font-size: .84rem; line-height: 1.55; margin-top: 12px; }
.info-regeln b { color: var(--gold-hell); }
#infoClose { width: 100%; min-height: 48px; margin-top: 14px; border: 2px solid var(--kontur); border-radius: 13px; background: linear-gradient(180deg, var(--gold-hell), var(--gold)); color: #3a2600; font-weight: 800; cursor: pointer; }

/* Tutorial + Toast */
#tutorialBubble { display: none; position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 55; max-width: min(86vw, 360px); background: var(--creme); color: var(--dunkelblau); border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 3px var(--gold); font-weight: 700; font-size: .92rem; line-height: 1.4; }
#tutorialBubble.visible { display: block; animation: boxrein .25s cubic-bezier(.34,1.56,.64,1); }
#tutorialBubble p { margin: 0 0 8px; }
#btnTutorialSkip { border: none; background: none; color: #6b86a8; font-size: .78rem; font-weight: 700; cursor: pointer; padding: 4px 0; min-height: 32px; }
.toast { position: fixed; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--dunkelblau); color: #fff; padding: 10px 18px; border-radius: 20px; font-weight: 700; font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 70; max-width: 88vw; text-align: center; border: 2px solid var(--gold); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.toast.visible { opacity: 1; }

/* Kleine Höhen: alles etwas kompakter */
@media (max-height: 700px) {
  .hand-label { font-size: .6rem; }
  .platte .ppunkte { font-size: clamp(1.25rem, 6vw, 1.7rem); }
  .buehne { height: clamp(74px, 12dvh, 96px); }
  .figur { width: calc(clamp(30px, 8.5vw, 42px) * var(--fg, 1)); }
  .hand-queue .hand-mini { width: clamp(46px, 13vw, 60px); height: clamp(46px, 13vw, 60px); }
}
/* Querformat: fürs Spiel ungeeignet (Brett-Mindesthöhe passt nicht) —
   freundlicher Vollbild-Hinweis statt kaputtem Layout */
.quer-hinweis {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: linear-gradient(180deg, var(--himmel), var(--himmel-tief));
  color: #fff; font-size: 1.15rem; font-weight: 800; text-align: center;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.quer-hinweis span { font-size: 2.6rem; }
@media (orientation: landscape) and (max-height: 480px) {
  .quer-hinweis { display: flex; }
  /* Ausnahme: Das Minispiel-Duell ist FUER das Querformat gebaut. Ohne diese
     Zeile legt sich der Hinweis darueber, sobald sich das Geraet dreht — und
     die Runde laesst sich nicht mehr starten. */
  body.mini-quer .quer-hinweis,
  body.mini-hoch .quer-hinweis { display: none; }
}

/* ================= Tab-Leiste (Hub-Navigation) ================= */
.tableiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; justify-content: center;
  background: linear-gradient(180deg, rgba(12,38,74,.92), rgba(8,28,58,.98));
  border-top: 1px solid rgba(255,255,255,.10);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -10px 30px rgba(4,18,40,.42);
  backdrop-filter: blur(12px);
}
.tableiste.sichtbar { display: flex; }
.tab-inner { width: 100%; max-width: 560px; display: flex; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 58px; padding: 7px 2px 6px; background: none; border: none; cursor: pointer;
  color: #9fc0e0; font-weight: 800; font-size: .66rem; letter-spacing: .3px; position: relative;
  transition: color .15s;
}
.tab .tab-icon { width: 26px; height: 26px; display: block; color: #7d9bbd; transition: transform .16s ease, color .16s; }
.tab .tab-icon svg { width: 100%; height: 100%; }
.tab.aktiv { color: var(--gold-hell); }
.tab.aktiv .tab-icon { color: var(--gold-hell); transform: translateY(-2px) scale(1.06); }
/* Aktiver Reiter bekommt eine eigene Fläche statt nur eines Strichs */
.tab.aktiv::after { content: ""; position: absolute; inset: 4px 8px 4px; border-radius: 14px;
  background: rgba(245,185,21,.13); z-index: -1; }
.tab.aktiv::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 30px; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold-hell); }
.tab:active .tab-icon { transform: scale(.9); }
@media (prefers-reduced-motion: reduce) { .tab .tab-icon { transition: none; } }

/* ================= Gemeinsame Hub-Elemente ================= */
.seiten-titel { text-align: center; font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 900; color: var(--creme); text-shadow: 0 2px 0 rgba(0,0,0,.28); margin: 2px 0 -6px; }
.seiten-sub { text-align: center; color: #cfe4f7; font-size: .86rem; font-weight: 600; margin: 0 0 2px; }
.flach-btn { min-height: 48px; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.22); border-radius: 13px; color: #fff; font-weight: 800; font-size: .92rem; cursor: pointer; margin-top: 2px; transition: transform .06s; }
.flach-btn:active { transform: translateY(2px); }

/* Start: Elo-Banner ist jetzt ein Knopf (→ Profil), Modus-Sprung zur Spiele-Seite */
#eloBanner { width: 100%; cursor: pointer; text-align: left; transition: transform .06s; }
#eloBanner:active { transform: translateY(1px); }

/* ================= Spiele-Katalog ================= */
#spieleListe { display: flex; flex-direction: column; gap: 12px; }
.game-block { background: rgba(13,31,58,.4); border: 2px solid rgba(255,255,255,.18); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.game-kopf { display: flex; align-items: center; gap: 12px; }
.game-avatar { width: 60px; height: 60px; flex: none; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.14); border: 2px solid var(--gold); padding: 4px; }
.game-kopf .gk-text { display: flex; flex-direction: column; min-width: 0; }
.game-kopf .gk-text b { font-size: 1.1rem; color: #fff; }
.game-kopf .gk-text span { font-size: .78rem; color: #cfe4f7; }
.game-kopf .gk-badge { margin-left: auto; font-size: .64rem; font-weight: 900; color: #3a2600; background: var(--gold-hell); border-radius: 20px; padding: 3px 10px; text-transform: uppercase; letter-spacing: .5px; align-self: flex-start; }
.game-modi { display: flex; flex-direction: column; gap: 8px; }
.game-modi-titel { font-size: .66rem; font-weight: 800; letter-spacing: 1px; color: var(--gold-hell); text-transform: uppercase; }
.game-play { min-height: 52px; border-radius: 14px; border: 2px solid var(--kontur); background: linear-gradient(180deg, #2a95e6, var(--team0) 60%, var(--team0-tief)); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.28); text-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .06s, box-shadow .06s; }
/* Eingeklappte Auswahl: eine Zeile statt einer Liste. Ausgeklappt fuellten
   zwei Spiele mit Modi und Stufen die halbe Startseite. */
.game-auswahl { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px;
  padding: 8px 12px; border-radius: 12px; border: 0; cursor: pointer; text-align: left;
  background: rgba(255,255,255,.10); color: #fff; font: inherit; }
.game-auswahl:active { background: rgba(255,255,255,.18); }
.game-auswahl .ga-label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  opacity: .65; flex: none; }
.game-auswahl .ga-wert { flex: 1; min-width: 0; font-weight: 800; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.game-auswahl .ga-pfeil { flex: none; opacity: .6; font-size: 1.2rem; line-height: 1;
  transition: transform .15s; }
.game-auswahl.offen .ga-pfeil { transform: rotate(90deg); }

/* Zwei Einstiege nebeneinander (Duell / Training) — seit Startseite und
   Katalog eine Seite sind, haengen beide am Spiel selbst. */
.game-play-reihe { display: flex; gap: 8px; }
.game-play-reihe .game-play { flex: 1; min-width: 0; }
.game-play.still { background: linear-gradient(180deg, #4a6f96, #37587c 60%, #2a4462); }
.game-play:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }

/* ================= Profil ================= */
.profil-kopf { display: flex; align-items: center; gap: 14px; background: rgba(13,31,58,.5); border: 2px solid var(--gold); border-radius: 18px; padding: 12px 16px; }
.profil-avatar { width: 76px; height: 76px; flex: none; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.22); border: 3px solid #fff; padding: 3px; }
.prof-ident { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.prof-name { font-size: 1.2rem; font-weight: 900; color: #fff; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil-liga { display: flex; flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.profil-liga .pl-icon { font-size: 1.15rem; line-height: 1; }
.profil-liga .pl-name { font-size: .85rem; color: #cfe4f7; font-weight: 700; }
.profil-liga .pl-elo { font-family: Consolas, "Courier New", monospace; font-size: 1.15rem; font-weight: 800; color: var(--gold-hell); line-height: 1; }

/* Profil-Startansicht: Highlights + Menüliste */
.prof-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px; }
.prof-highlights > div { text-align: center; background: rgba(13,31,58,.4); border: 1.5px solid rgba(255,255,255,.2); border-radius: 12px; padding: 11px 4px; }
.prof-highlights b { display: block; font-size: 1.35rem; color: var(--gold-hell); font-family: Consolas, "Courier New", monospace; line-height: 1.1; }
.prof-highlights span { font-size: .7rem; color: #cfe4f7; }
.prof-menu { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.prof-menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 14px; background: rgba(13,31,58,.45); border: 1.5px solid rgba(255,255,255,.16); border-radius: 14px; color: #fff; font-weight: 800; font-size: .98rem; cursor: pointer; transition: transform .06s, background .12s; }
.prof-menu-row:active { transform: translateY(2px); background: rgba(13,31,58,.6); }
.prof-menu-row .pm-icon { font-size: 1.3rem; line-height: 1; }
.prof-menu-row .pm-label { flex: 1; text-align: left; }
.prof-menu-row .pm-extra { color: var(--gold-hell); font-weight: 700; font-size: .82rem; }
.prof-menu-row .pm-pfeil { color: #9fc0e0; font-size: 1.5rem; font-weight: 700; line-height: 1; }

/* Profil-Untermenü (Detailansicht) */
.prof-zurueck { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--gold-hell); font-weight: 800; font-size: 1rem; cursor: pointer; padding: 4px 2px; }
.prof-zurueck .pz-pfeil { font-size: 1.5rem; line-height: 1; }
.prof-zurueck:active { opacity: .7; }
.prof-detail-titel { font-size: 1.25rem; font-weight: 900; color: var(--creme); margin: 2px 0 8px; text-shadow: 0 2px 0 rgba(0,0,0,.28); }
.prof-hinweis { color: #cfe4f7; font-size: .82rem; line-height: 1.4; margin: 0 0 10px; }
.prof-sektion { display: flex; flex-direction: column; gap: 10px; }
/* Rechtliches: Links zu den oeffentlichen Pflichtseiten */
.rechts-links { display: flex; flex-direction: column; gap: 8px; }
.rechts-links a { display: block; min-height: 44px; line-height: 44px; padding: 0 14px;
  background: rgba(13,31,58,.45); border: 1.5px solid rgba(255,255,255,.16);
  border-radius: 12px; color: #cfe4f7; font-weight: 700; font-size: .9rem; text-decoration: none; }
.rechts-links a:active { background: rgba(13,31,58,.6); }

/* Melden/Blockieren: Knopf in der Ranglistenzeile + Aktionsfenster */
.rl-mehr { flex: none; width: 34px; min-height: 34px; margin-left: 4px; background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.2); border-radius: 9px; color: #cfe4f7;
  font-size: 1.1rem; font-weight: 800; line-height: 1; cursor: pointer; }
.rl-mehr:active { background: rgba(255,255,255,.2); }
.rl-zeile.gesperrt .rl-name { opacity: .55; font-style: italic; }
.spieler-aktionen { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.spieler-aktionen button { min-height: 46px; background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.22); border-radius: 12px; color: #fff;
  font-weight: 700; font-size: .92rem; cursor: pointer; }
.spieler-aktionen button.gefahr { border-color: rgba(217,54,50,.65); background: rgba(217,54,50,.22); }
.ergebnis-melden { width: 100%; font-size: .85rem; margin-top: 8px; }
/* MUSS bleiben: die display:flex-Regel oben schlägt sonst das UA-[hidden]
   {display:none}, dann zeigt das Untermenü ALLE Sektionen gleichzeitig. */
.prof-sektion[hidden] { display: none; }
#profilStats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#profilStats > div { text-align: center; background: rgba(13,31,58,.4); border: 1.5px solid rgba(255,255,255,.2); border-radius: 12px; padding: 10px 4px; }
#profilStats b { display: block; font-size: 1.2rem; color: var(--gold-hell); font-family: Consolas, "Courier New", monospace; }
#profilStats span { font-size: .68rem; color: #cfe4f7; }
#erfolgeListe { display: flex; flex-wrap: wrap; gap: 8px; }
.erfolg-chip { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.2); border-radius: 20px; padding: 6px 12px 6px 9px; font-size: .8rem; font-weight: 700; color: #fff; }
.erfolg-chip .ec-icon { font-size: 1.05rem; }
.erfolg-chip.offen { opacity: .45; filter: grayscale(.7); }
.erfolg-chip small { color: #9fc0e0; font-weight: 700; }

/* ================= Rangliste ================= */
.rl-meine { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(217,155,0,.3), rgba(13,31,58,.5)); border: 2px solid var(--gold); border-radius: 16px; padding: 12px 16px; }
.rl-meine .rlm-rang { font-family: Consolas, "Courier New", monospace; font-size: 1.9rem; font-weight: 900; color: var(--gold-hell); min-width: 2.6ch; text-align: center; }
.rl-meine .rlm-text { display: flex; flex-direction: column; min-width: 0; }
.rl-meine .rlm-text b { font-size: 1rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-meine .rlm-text span { font-size: .76rem; color: #cfe4f7; }
.rl-meine .rlm-elo { margin-left: auto; text-align: right; font-family: Consolas, "Courier New", monospace; font-weight: 800; color: var(--gold-hell); font-size: 1.3rem; }
#ranglisteListe { display: flex; flex-direction: column; gap: 6px; }
.rl-zeile { display: flex; align-items: center; gap: 10px; background: rgba(13,31,58,.4); border: 1.5px solid rgba(255,255,255,.14); border-radius: 12px; padding: 8px 12px; }
.rl-zeile.ich { border-color: var(--gold-hell); background: rgba(217,155,0,.18); }
.rl-rang { font-family: Consolas, "Courier New", monospace; font-weight: 800; font-size: 1rem; color: #cfe4f7; min-width: 2.6ch; text-align: center; }
.rl-zeile.top1 .rl-rang { color: #ffd700; } .rl-zeile.top2 .rl-rang { color: #cfd8e3; } .rl-zeile.top3 .rl-rang { color: #e59866; }
.rl-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.5); }
.rl-name { flex: 1; min-width: 0; font-weight: 800; font-size: .9rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-name .rl-liga { font-size: .92rem; margin-right: 3px; }
.rl-elo { font-family: Consolas, "Courier New", monospace; font-weight: 800; color: var(--gold-hell); font-size: 1rem; flex: none; }
.rl-hinweis { text-align: center; color: #9fc0e0; font-size: .78rem; margin: 4px 0 0; min-height: 1em; }
.rl-laden { text-align: center; color: #cfe4f7; padding: 22px; font-weight: 700; }


.elo-training { color: #cfe4f7; font-weight: 700; font-size: .92rem; }

.karte .ziel-text { font-size: .95rem; font-weight: 700; color: #fff; line-height: 1.28; }

.elo-warten { color: #a9c6e4; font-weight: 700; font-size: .92rem; }

/* ================= Anmeldung (Gate) & Konto-Bereich im Profil ================= */
#screenLogin { flex-direction: column; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 24px; gap: 22px; text-align: center; position: relative; z-index: 1; }
#screenLogin .bunting { position: absolute; top: 0; left: 0; }
.login-box { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.btn-login { background: linear-gradient(180deg, #2a95e6, var(--team0) 60%, var(--team0-tief)); }
.login-hinweis { color: rgba(255,255,255,.65); font-size: .8rem; line-height: 1.4; margin: 4px 0 0; min-height: 2.4em; }
.konto-status { color: #cfe4f7; font-size: .84rem; line-height: 1.45; margin: 0; }
.konto-status b { color: #fff; }
.konto-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.konto-aktionen button { flex: 1 1 45%; min-height: 44px; background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.22); border-radius: 12px; font-size: .88rem;
  font-weight: 700; cursor: pointer; color: #fff; }
.konto-aktionen button.gefahr { border-color: rgba(217,54,50,.65); background: rgba(217,54,50,.22); }

/* Statuszeile im Suchbildschirm: Modus, Konto-Kennung, Fehlertext beim
   Suchstart. Bewusst unaufdringlich — sie ist Diagnose, keine Ansage. */
.suche-diagnose { margin: -6px 0 10px; min-height: 1em; font-size: .78rem;
  font-weight: 600; color: rgba(255,255,255,.72); text-align: center;
  max-width: 88vw; margin-left: auto; margin-right: auto; word-break: break-word; }

/* Der Suchbildschirm blieb bis auf die Portraits LEER: #kulisse ist
   position:fixed mit z-index:0 und deckt den ganzen Bildschirm. Nach der
   CSS-Malreihenfolge zeichnet ein positioniertes Element mit z-index:0 ueber
   nicht-positioniertem Inline-Inhalt — Ueberschrift, Hinweis und Knopf
   verschwanden also hinter dem Himmel. Weil die Kulisse pointer-events:none
   traegt, meldete jede Messung trotzdem "sichtbar" (auch elementFromPoint).
   #screenSuche ist ein Flex-Container, und Flex-Items duerfen z-index ohne
   position tragen — deshalb genuegt diese eine Zeile. */
#screenSuche > * { z-index: 1; }

/* ============ MINISPIEL-DUELL ============
   Eigener Bildschirm neben dem Schiebe-Duell (assets/minispiele.js).
   Bewusst ohne Bezug auf .brett-* oder .hud, damit an der Darstellung des
   Hauptspiels nichts hängt. */
/* Waagrecht KEIN Innenabstand: Die Bühne soll die volle Bildbreite bekommen —
   jeder Pixel Breite ist zusätzliche Sicht nach vorn. Den Abstand tragen
   stattdessen Kopf- und Fußzeile. */
#screenMini {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 0
           calc(env(safe-area-inset-bottom, 0px) + 12px);
  height: 100%;
  touch-action: none;               /* der ganze Bildschirm ist der Knopf */
}
#screenMini.active { display: flex; }
/* DIESELBE FALLE WIE BEIM SUCHBILDSCHIRM (siehe #screenSuche weiter oben):
   `.kulisse` ist position:fixed mit z-index:0 und deckt den ganzen Schirm.
   Nach der CSS-Malreihenfolge zeichnet ein positioniertes Element mit
   z-index:0 ueber nicht-positioniertem Inline-Inhalt — Zurueck-Knopf,
   Punktestand, Rundenpunkte und die Werteleiste lagen also HINTER dem Himmel.
   Sichtbar blieb nur, was zufaellig eine eigene Malebene hatte: die Buehne
   (position:relative) und alles mit opacity < 1. Auf dem Geraet am 05.08.2026
   aufgefallen; jede Messung meldete trotzdem „sichtbar", weil die Kulisse
   pointer-events:none traegt. */
#screenMini > * { z-index: 1; }

.mini-kopf {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 12px;
}
.mini-zurueck {
  width: 38px; height: 38px; border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 1.5rem; line-height: 1; cursor: pointer; flex: none;
}
.mini-zurueck:active { background: rgba(255, 255, 255, .26); }
.mini-stand {
  display: flex; align-items: baseline; gap: 4px;
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.5rem;
}
.mini-stand span { opacity: .55; font-weight: 600; }
.mini-runden { display: flex; gap: 5px; flex: 1; }
.mini-runden span {
  width: 22px; height: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, .22);
}
.mini-runden span.ich { background: var(--gruen); }
.mini-runden span.er { background: var(--rot); }
.mini-runden span.remis { background: rgba(255, 255, 255, .5); }
.mini-runden span.jetzt { box-shadow: 0 0 0 2px var(--gold-hell); }
.mini-rundenr { font-size: .82rem; opacity: .75; }

.mini-buehne { position: relative; flex: 1; min-height: 180px; }
#miniLeinwand {
  width: 100%; height: 100%; display: block;
  border-radius: 0;
  background: var(--dunkelblau-tief);
  touch-action: none;
}

/* Startzähler über der Bühne. Die Bühne bleibt sichtbar — genau darum
   geht es: Man soll die ersten Hürden lesen können, bevor es losgeht. */
.mini-countdown {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  pointer-events: none;
  font-size: clamp(3rem, 18vw, 7rem); font-weight: 900; line-height: 1;
  color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,.65), 0 0 3px rgba(0,0,0,.9);
  letter-spacing: .02em;
}
.mini-countdown:empty { display: none; }
.mini-countdown span { animation: mini-zaehler .55s ease-out both; }
@keyframes mini-zaehler {
  from { transform: scale(1.7); opacity: 0; }
  40%  { opacity: 1; }
  to   { transform: scale(1); opacity: .92; }
}
@media (prefers-reduced-motion: reduce) {
  .mini-countdown span { animation: none; }
}

/* overflow-y: auto ist kein Schmuck: Am Duellende stehen ZWEI Knöpfe auf der
   Tafel, und die Tafel ist so hoch wie die Bühne — auf einem flachen
   Querformat-Bildschirm würde der untere Knopf sonst abgeschnitten und man
   käme wieder nicht heraus. */
.mini-tafel {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 18px; text-align: center;
  background: rgba(14, 37, 71, .88);
  overflow-y: auto;
}
.mini-tafel.sichtbar { display: flex; }
.mini-tafel h2 { margin: 0; font-size: 1.45rem; }
.mini-tafel p {
  margin: 0; max-width: 30ch; white-space: pre-line;
  color: rgba(255, 255, 255, .82); font-size: .95rem; line-height: 1.45;
}
/* flex: none hebt das `flex: 1` von button.gross auf — in der senkrechten
   Tafel wuerde der Knopf sonst die ganze freie Hoehe fuellen und als
   riesiger Block dastehen. */
.mini-tafel button { margin-top: 8px; flex: none; }

.mini-werte {
  display: flex; gap: 18px; justify-content: center; padding: 0 12px;
  font-size: .9rem; color: rgba(255, 255, 255, .78);
  font-variant-numeric: tabular-nums;
}
.mini-werte b { color: #fff; font-weight: 700; }

/* Bühne: im Hochformat bewusst ein breites Band statt volle Höhe.
   Der Maßstab richtet sich nach der Sicht NACH VORN (siehe sichtMassstab in
   games/rahmen.js) — restliche Bildhöhe brächte also keine Spielinformation,
   sondern nur leere Fläche. */
@media (orientation: portrait) {
  #screenMini { justify-content: center; }
  /* Ausnahme Turmbau: Der wird IM Hochformat gespielt, und dort ist die Höhe
     das Spielfeld — ein flaches Band wäre genau das Gegenteil von dem, was
     man sehen will. */
  body.mini-hoch .mini-buehne { max-height: none; }
  body.mini-hoch #screenMini { justify-content: stretch; }
  /* Seitenverhaeltnis der Spielwelt (rund 1,85:1) — so fuellt sie die
     Leinwand genau aus, ohne Balken und ohne verschenkte Sicht. */
  .mini-buehne { max-height: 54vw; }
}

/* Querformat: Kopf- und Fußzeile klein halten, damit die Bühne fast das ganze
   Bild bekommt — dort ist die Sicht nach vorn am größten. */
@media (orientation: landscape) and (max-height: 560px) {
  #screenMini { gap: 6px; padding-top: calc(env(safe-area-inset-top, 0px) + 6px); }
  .mini-kopf { gap: 8px; }
  .mini-zurueck { width: 32px; height: 32px; font-size: 1.25rem; }
  .mini-stand { font-size: 1.15rem; }
  .mini-runden span { width: 18px; height: 5px; }
  .mini-rundenr, .mini-werte { font-size: .78rem; }
  .mini-tafel { gap: 4px; padding: 10px; }
  .mini-tafel h2 { font-size: 1.2rem; }
  .mini-tafel p { font-size: .88rem; }
  /* Zwei Knöpfe müssen zusammen mit Titel und Text auf die flache Tafel
     passen (siehe overflow-Hinweis oben) */
  .mini-tafel button { min-height: 42px; padding: 8px 14px; margin-top: 4px; }
}
