:root {
  --bg1: #0b1530; --bg2: #13254f; --card: rgba(255,255,255,0.07); --card2: rgba(255,255,255,0.11);
  --line: rgba(255,255,255,0.12); --text: #f4f6ff; --muted: #a9b6d6;
  --gold: #ffd23f; --gold2: #e2a421; --red: #e63946; --green: #2a9d55; --blue: #4da3ff;
  --r: 18px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --head: 'Fredoka', 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #120f2e; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, #2a4a8f 0%, transparent 60%), linear-gradient(180deg, var(--bg1), var(--bg2) 70%, #1c1030);
  background-attachment: fixed; overscroll-behavior: none; -webkit-user-select: none; user-select: none;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
#snowfall, #confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#confetti { z-index: 60; display: none; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 12px; }
.logo-svg { width: 54px; height: 54px; filter: drop-shadow(0 4px 14px rgba(255,210,63,0.35)); flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 0.95; font-family: var(--head); }
.logo-text .l1 { font-size: 15px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.logo-text .l2 { font-size: 30px; font-weight: 700; letter-spacing: 1px; background: linear-gradient(90deg, #fff 0%, #ffe08a 60%, #ffb347 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-text .l3 { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #ff8fa3; margin-top: 3px; font-weight: 600; }
.logo.big { flex-direction: column; text-align: center; gap: 14px; }
.logo.big .logo-svg { width: 120px; height: 120px; animation: float 4s ease-in-out infinite; }
.logo.big .logo-text { align-items: center; }
.logo.big .l1 { font-size: 20px; letter-spacing: 8px; }
.logo.big .l2 { font-size: 58px; }
.logo.big .l3 { font-size: 12px; letter-spacing: 3px; }
.logo.small .logo-svg { width: 40px; height: 40px; }
.logo.small .l1 { font-size: 10px; letter-spacing: 3px; }
.logo.small .l2 { font-size: 21px; }
.logo.small .l3 { display: none; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

.credit { text-align: center; margin: 28px 0 10px; }
.credit-badge { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(255,210,63,0.4); background: linear-gradient(135deg, rgba(255,210,63,0.12), rgba(230,57,70,0.12)); }
.cb-a { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cb-b { font-family: var(--head); font-size: 22px; font-weight: 700; color: var(--gold); text-shadow: 0 0 18px rgba(255,210,63,0.5); }
.credit-line { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* ---------- Willkommen ---------- */
.screen { position: relative; z-index: 1; }
#welcome { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 30px 20px calc(30px + var(--safe-b)); }
.welcome-inner { width: 100%; max-width: 420px; text-align: center; }
.tagline { font-size: 18px; line-height: 1.45; color: #dfe6ff; margin: 18px 0 22px; }
.tagline b { color: var(--gold); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.login { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.login label { font-family: var(--head); font-size: 18px; font-weight: 600; }
.login input { width: 100%; padding: 15px 16px; font-size: 18px; border-radius: 14px; border: 2px solid var(--line); background: rgba(0,0,0,0.25); color: #fff; outline: none; font-family: inherit; }
.login input:focus { border-color: var(--gold); }
.hint { font-size: 13px; color: var(--muted); margin: 2px 0 0; line-height: 1.4; }
.err { color: #ff8b8b; font-size: 14px; margin: 0; min-height: 1em; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 14px; font-weight: 800; font-size: 17px; transition: transform .1s; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(180deg, #ff5a67, #d42638); box-shadow: 0 6px 0 #8f1424, 0 10px 24px rgba(230,57,70,0.4); color: #fff; }
.btn.primary:active { box-shadow: 0 2px 0 #8f1424; transform: translateY(4px); }
.btn.primary.small { padding: 10px 14px; font-size: 15px; box-shadow: 0 4px 0 #8f1424; }
.btn.big { width: 100%; font-size: 20px; padding: 17px; margin-top: 14px; }
.btn.ghost { background: var(--card2); border: 1px solid var(--line); }
.btn.joker { width: 100%; margin-top: 12px; background: linear-gradient(180deg, #ffe08a, #e2a421); color: #3b2500; box-shadow: 0 5px 0 #9c6b0c; }
.btn:disabled { opacity: .5; }
.btn-small { padding: 9px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-size: 20px; }
.icon-btn.off { opacity: .6; }

/* ---------- App-Layout ---------- */
#app { padding-bottom: calc(84px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 16px 10px; background: linear-gradient(180deg, rgba(11,21,48,0.95), rgba(11,21,48,0.75)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font-weight: 700; font-size: 14px; max-width: 160px; }
.me-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip b { background: var(--gold); color: #3b2500; border-radius: 999px; padding: 4px 10px; font-family: var(--head); }
.banner { margin: 10px 16px 0; padding: 10px 14px; border-radius: 12px; background: rgba(77,163,255,0.15); border: 1px solid rgba(77,163,255,0.4); font-size: 13px; line-height: 1.4; position: relative; z-index: 1; }
main { position: relative; z-index: 1; padding: 14px 16px; max-width: 640px; margin: 0 auto; }
.h2 { font-family: var(--head); font-size: 28px; margin: 6px 0 4px; }
.board-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; padding: 8px 10px calc(8px + var(--safe-b)); background: rgba(11,21,48,0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; border-radius: 12px; }
.tab span { font-size: 22px; filter: grayscale(0.6); }
.tab.active { color: #fff; background: var(--card2); }
.tab.active span { filter: none; }

/* ---------- Heute-Karte ---------- */
.today-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); margin-bottom: 16px; background: linear-gradient(135deg, rgba(230,57,70,0.28), rgba(42,157,85,0.22)); border: 1px solid rgba(255,255,255,0.18); }
.tc-icon { font-size: 38px; flex: none; }
.tc-title { font-family: var(--head); font-size: 20px; font-weight: 700; }
.tc-sub { font-size: 14px; color: #dfe6ff; line-height: 1.35; margin-top: 2px; }
.today-card > div:nth-child(2) { flex: 1; }
.x2 { display: inline-block; background: var(--gold); color: #3b2500; font-size: 12px; font-weight: 800; border-radius: 8px; padding: 2px 7px; vertical-align: middle; font-family: 'Nunito', sans-serif; }

/* ---------- Türchen ---------- */
.doors { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 82px; grid-auto-flow: dense; gap: 9px; }
.door { position: relative; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-direction: column; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.12), 0 6px 14px rgba(0,0,0,0.3); transition: transform .12s; }
.door:active { transform: scale(0.95); }
.door.wide { grid-column: span 2; }
.door.big { grid-column: span 2; grid-row: span 2; }
.door::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 8px, transparent 8px 16px); }
.door::after { content: ''; position: absolute; inset: 5px; border: 1.5px dashed rgba(255,255,255,0.22); border-radius: 10px; pointer-events: none; }
.door.c0 { background: linear-gradient(145deg, #c62839, #8d1626); }
.door.c1 { background: linear-gradient(145deg, #1f8a4c, #13592f); }
.door.c2 { background: linear-gradient(145deg, #2a4fa8, #1a3070); }
.door.c3 { background: linear-gradient(145deg, #b5552a, #7a3418); }
.door.c4 { background: linear-gradient(145deg, #7a3fb0, #4c2373); }
.door.big { background: radial-gradient(circle at 50% 30%, #ffdf6b, #e2a421 55%, #a86a08); }
.door.big .d-num { color: #3b2500; font-size: 56px; text-shadow: 0 2px 0 rgba(255,255,255,0.4); }
.d-num { font-family: var(--head); font-size: 30px; font-weight: 700; position: relative; z-index: 1; text-shadow: 0 2px 6px rgba(0,0,0,0.4); line-height: 1; }
.d-ico { position: relative; z-index: 1; font-size: 18px; margin-top: 4px; }
.d-ico.small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.d-score { position: relative; z-index: 1; margin-top: 4px; font-weight: 800; font-size: 14px; color: var(--gold); background: rgba(0,0,0,0.3); border-radius: 999px; padding: 2px 9px; }
.d-x2 { position: absolute; top: 6px; right: 7px; z-index: 2; background: var(--gold); color: #3b2500; font-size: 10px; font-weight: 900; border-radius: 6px; padding: 1px 5px; }
.door.big .d-x2 { background: #c62839; color: #fff; font-size: 12px; }
.d-today { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 9px; font-weight: 900; letter-spacing: 1.5px; background: #fff; color: #c62839; padding: 1px 6px; border-radius: 6px; }
.door.locked { filter: saturate(0.55) brightness(0.75); }
.door.closed:not(.played) { filter: grayscale(0.85) brightness(0.6); }
.door.today { animation: glow 1.8s ease-in-out infinite; z-index: 1; }
@keyframes glow { 0%,100% { box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(255,210,63,0.5); } 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 34px rgba(255,210,63,0.9); } }

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(5,10,25,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; }
.sheet.show { opacity: 1; }
.sheet-inner { position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: linear-gradient(180deg, #172a5c, #0f1d42); border-radius: 26px 26px 0 0; padding: 22px 18px calc(24px + var(--safe-b)); border: 1px solid var(--line); transform: translateY(40px); transition: transform .3s cubic-bezier(.2,.9,.3,1.2); box-shadow: 0 -20px 50px rgba(0,0,0,0.4); }
.sheet.show .sheet-inner { transform: translateY(0); }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: var(--card2); font-size: 16px; z-index: 2; }
.door-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.dh-num { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(145deg, #c62839, #8d1626); display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 32px; font-weight: 700; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2); flex: none; }
.dh-date { font-family: var(--head); font-size: 22px; font-weight: 700; }
.dh-until { font-size: 13px; color: var(--muted); margin-top: 2px; }
.quote { border-radius: 16px; padding: 16px 16px 18px; margin-bottom: 14px; position: relative; }
.quote.mot { background: linear-gradient(135deg, rgba(77,163,255,0.22), rgba(122,63,176,0.22)); border: 1px solid rgba(77,163,255,0.35); }
.quote.xmas { background: linear-gradient(135deg, rgba(255,210,63,0.18), rgba(230,57,70,0.2)); border: 1px solid rgba(255,210,63,0.35); }
.q-kind { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.q-text { font-family: var(--head); font-size: 20px; line-height: 1.35; font-weight: 500; }
.game-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.gc-top { display: flex; gap: 12px; align-items: center; }
.gc-icon { font-size: 40px; width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; flex: none; }
.gc-type { font-size: 12px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }
.gc-title { font-family: var(--head); font-size: 22px; font-weight: 700; line-height: 1.15; }
.gc-desc { font-size: 15px; line-height: 1.5; color: #dfe6ff; margin: 12px 0; }
.gc-stats { display: flex; gap: 10px; }
.gc-stats > div { flex: 1; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 10px 12px; }
.gc-stats span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.gc-stats b { font-family: var(--head); font-size: 22px; }
.gc-stats small { display: block; font-size: 12px; color: var(--muted); }
.dots { display: flex; gap: 6px; padding-top: 4px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(54,209,124,0.6); }
.dots i.used { background: rgba(255,255,255,0.18); box-shadow: none; }
.tries { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; }
.closed-note { margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(0,0,0,0.25); text-align: center; font-size: 15px; }
.th-wrap { margin-top: 14px; }
.th-wrap summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 14px; }
.th-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.th { background: rgba(0,0,0,0.25); border-radius: 10px; padding: 6px 2px; text-align: center; }
.th b { display: block; font-family: var(--head); font-size: 16px; color: var(--gold); }
.th span { font-size: 11px; color: var(--muted); }
.th.got { background: rgba(42,157,85,0.35); }
.locked-door { text-align: center; padding: 20px 6px 10px; }
.ld-num { font-family: var(--head); font-size: 80px; font-weight: 700; line-height: 1; color: rgba(255,255,255,0.2); }
.ld-lock { font-size: 50px; margin: -20px 0 6px; }
.locked-door h3 { font-family: var(--head); font-size: 24px; margin: 8px 0; }
.locked-door p { color: #dfe6ff; font-size: 16px; }

/* ---------- Ergebnis ---------- */
#result .sheet-inner { text-align: center; padding-top: 30px; }
.res-head { font-family: var(--head); font-size: 32px; font-weight: 700; }
.res-raw { color: var(--muted); font-size: 17px; margin-top: 6px; }
.res-raw b { color: #fff; font-size: 26px; font-family: var(--head); }
.res-stars { display: flex; justify-content: center; gap: 3px; margin: 18px 0 8px; }
.res-stars i { font-style: normal; font-size: 28px; color: rgba(255,255,255,0.15); }
.res-stars i.on { color: var(--gold); text-shadow: 0 0 12px rgba(255,210,63,0.7); animation: pop .4s backwards; animation-delay: var(--d); }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.4); } to { transform: scale(1); } }
.res-pts { font-size: 18px; }
.res-pts b { font-family: var(--head); font-size: 48px; color: var(--gold); }
.res-best { margin-top: 10px; font-weight: 800; color: #9fe8a8; }
.res-next { margin-top: 8px; font-size: 14px; color: #dfe6ff; }
.res-left { margin-top: 6px; font-size: 13px; color: var(--muted); }
.res-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ---------- Rangliste ---------- */
.brow { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; overflow: hidden; }
.brow.me { border-color: rgba(255,210,63,0.6); background: rgba(255,210,63,0.08); }
.brow.top1 { background: linear-gradient(135deg, rgba(255,210,63,0.22), rgba(255,255,255,0.05)); }
.br-main { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.br-rank { font-size: 26px; width: 36px; text-align: center; font-family: var(--head); font-weight: 700; }
.br-name { flex: 1; font-weight: 800; font-size: 17px; min-width: 0; }
.br-name small { color: var(--muted); font-weight: 700; }
.br-meta { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.br-total { font-family: var(--head); font-size: 28px; font-weight: 700; color: var(--gold); text-align: right; line-height: 1; }
.br-total small { display: block; font-size: 11px; color: var(--muted); font-family: 'Nunito', sans-serif; }
.br-grid { display: none; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 0 12px 12px; }
.brow.open .br-grid { display: grid; }
.bd { background: rgba(0,0,0,0.25); border-radius: 8px; text-align: center; padding: 3px 0; position: relative; }
.bd span { display: block; font-size: 9px; color: var(--muted); }
.bd b { font-size: 14px; font-family: var(--head); }
.bd.p0 b { color: #ff8b8b; } .bd.p1 b, .bd.p2 b, .bd.p3 b { color: #ffc28b; } .bd.p4 b, .bd.p5 b, .bd.p6 b { color: #fff; }
.bd.p7 b, .bd.p8 b, .bd.p9 b { color: #9fe8a8; } .bd.p10 { background: rgba(255,210,63,0.3); } .bd.p10 b { color: var(--gold); }
.bd.crown::after { content: '👑'; position: absolute; top: -7px; right: -3px; font-size: 10px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- Regeln ---------- */
.rules { display: flex; flex-direction: column; gap: 14px; }
.rule { display: flex; gap: 12px; font-size: 15px; line-height: 1.45; color: #dfe6ff; }
.rule > span { font-size: 24px; flex: none; }
.rule b { color: #fff; }
.settings { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.toggle { width: 52px; height: 30px; border-radius: 999px; background: rgba(255,255,255,0.2); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(22px); }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px); background: #fff; color: #13254f; padding: 12px 18px; border-radius: 14px; font-weight: 800; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); opacity: 0; pointer-events: none; transition: all .3s; z-index: 70; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Spielfläche ---------- */
#stage { position: fixed; inset: 0; z-index: 50; display: none; background: #0b1530; touch-action: none; }
#stage.active { display: block; }
body.playing { overflow: hidden; }
.g-wrap { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.g-canvas { position: absolute; inset: 0; display: block; touch-action: none; }
.g-dom { position: absolute; inset: 0; display: none; padding: calc(70px + var(--safe-t)) 16px calc(20px + var(--safe-b)); overflow-y: auto; }
.g-dom.on { display: flex; align-items: center; justify-content: center; }
.g-hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 12px 10px; pointer-events: none; z-index: 3; }
.g-score, .g-time { background: rgba(0,0,0,0.4); border-radius: 999px; padding: 6px 14px; font-weight: 800; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.g-score-label { font-size: 12px; color: var(--muted); margin-right: 6px; }
.g-score-val { font-family: var(--head); font-size: 20px; }
.g-time { font-family: var(--head); font-size: 20px; min-width: 60px; text-align: center; }
.g-time:empty { visibility: hidden; }
.g-time.hurry { background: rgba(230,57,70,0.8); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.g-quit { pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.4); font-size: 16px; }
.g-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; z-index: 4; background: rgba(5,10,25,0.35); }
.g-overlay.show { display: flex; }
.g-count { font-family: var(--head); font-size: 110px; font-weight: 700; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,0.5); animation: countIn .6s; }
.g-count.go { color: var(--gold); font-size: 80px; }
.g-done { font-family: var(--head); font-size: 48px; font-weight: 700; color: var(--gold); text-shadow: 0 4px 20px rgba(0,0,0,0.6); animation: countIn .5s; }
@keyframes countIn { from { transform: scale(2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Memory */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; width: 100%; max-width: 380px; }
.mem-card { aspect-ratio: 3/3.6; perspective: 600px; padding: 0; }
.mc-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mem-card.open .mc-in { transform: rotateY(180deg); }
.mc-front, .mc-back { position: absolute; inset: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: 30px; }
.mc-front { background: linear-gradient(145deg, #c62839, #8d1626); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18); font-size: 22px; }
.mc-back { background: #fff8ec; transform: rotateY(180deg); box-shadow: inset 0 0 0 3px #e2a421; }
.mem-card.found .mc-back { background: #d9f7e2; box-shadow: inset 0 0 0 3px var(--green); }

/* Kopfrechnen & Quiz */
.mq, .qz { width: 100%; max-width: 420px; text-align: center; }
.mq-n, .qz-n { color: var(--muted); font-weight: 800; font-size: 14px; }
.mq-q { font-family: var(--head); font-size: 50px; font-weight: 700; margin: 16px 0 26px; text-shadow: 0 4px 18px rgba(0,0,0,0.4); }
.mq-a, .qz-a { display: flex; flex-direction: column; gap: 12px; }
.btn-ans { padding: 18px; border-radius: 16px; background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.18); font-family: var(--head); font-size: 28px; font-weight: 700; transition: transform .08s; }
.btn-ans:active { transform: scale(0.97); }
.btn-ans.wide { font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800; padding: 15px; }
.btn-ans.ok { background: var(--green); border-color: #6fe3a0; }
.btn-ans.no { background: var(--red); border-color: #ff9aa3; }
.qz-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.15); margin: 10px 0 16px; overflow: hidden; }
.qz-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); }
.qz-q { font-family: var(--head); font-size: 22px; font-weight: 600; line-height: 1.3; margin-bottom: 20px; min-height: 3em; }

/* Wortsalat */
.ws { width: 100%; max-width: 440px; text-align: center; }
.ws-hint { color: var(--muted); font-weight: 800; font-size: 14px; margin-bottom: 16px; }
.ws-ans { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; min-height: 52px; margin-bottom: 22px; }
.ws-slot { width: 32px; height: 44px; border-bottom: 3px solid rgba(255,255,255,0.4); font-family: var(--head); font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ws-slot.filled { border-color: var(--gold); }
.ws-ans.ok .ws-slot { color: #6fe3a0; border-color: #6fe3a0; }
.ws-ans.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.ws-letters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.ws-letter { width: 50px; height: 54px; border-radius: 12px; background: linear-gradient(180deg, #fff8ec, #f0dfc2); color: #6b2a10; font-family: var(--head); font-size: 26px; font-weight: 700; box-shadow: 0 4px 0 #b88d55; }
.ws-letter:disabled { opacity: .2; box-shadow: none; transform: translateY(4px); }
.ws-row { display: flex; gap: 10px; justify-content: center; }

/* Zahlen */
.zn { width: 100%; max-width: 400px; }
.zn-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; transition: transform .25s, opacity .25s; }
.zn-grid.whirl { transform: rotate(8deg) scale(0.85); opacity: 0.2; }
.zn-cell { aspect-ratio: 1; border-radius: 14px; background: rgba(255,255,255,0.14); border: 2px solid rgba(255,255,255,0.25); font-family: var(--head); font-size: 28px; font-weight: 700; }
.zn-cell.done { background: rgba(42,157,85,0.35); border-color: transparent; color: rgba(255,255,255,0.35); }
.zn-cell.wrong { background: var(--red); }

@media (min-width: 700px) { .doors { grid-auto-rows: 100px; } }
@media (max-width: 360px) { .doors { grid-auto-rows: 72px; gap: 7px; } .d-num { font-size: 26px; } .logo.big .l2 { font-size: 48px; } }

/* ---------- v2: Start-Auswahl ---------- */
.choose { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.choice { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; border-radius: 16px; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.14); transition: transform .1s, border-color .2s; }
.choice:active { transform: scale(0.98); }
.choice:first-child { background: linear-gradient(135deg, rgba(230,57,70,0.35), rgba(255,210,63,0.18)); border-color: rgba(255,210,63,0.45); }
.ch-ico { font-size: 34px; }
.choice b { display: block; font-family: var(--head); font-size: 20px; }
.choice small { display: block; color: #dfe6ff; font-size: 14px; margin-top: 2px; }
.back-link { align-self: flex-start; color: var(--muted); font-weight: 700; font-size: 14px; padding: 2px 0; }
.name-list { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip { padding: 12px 16px; border-radius: 999px; background: rgba(255,255,255,0.12); border: 1px solid var(--line); font-weight: 800; font-size: 16px; }
.name-chip:active { background: var(--gold); color: #3b2500; }
.old-form { display: flex; gap: 8px; margin-top: 6px; }
.old-form input { flex: 1; padding: 12px 14px; font-size: 16px; border-radius: 12px; border: 2px solid var(--line); background: rgba(0,0,0,0.25); color: #fff; outline: none; font-family: inherit; min-width: 0; }

/* ---------- v2: Weltkugel ---------- */
.globe-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1.05; max-height: 70vh; margin: 0 auto; border-radius: 24px; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(40,80,160,0.35), rgba(5,10,30,0.2) 70%); border: 1px solid var(--line); }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.globe-ctrl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 8px; }
.globe-ctrl .icon-btn { background: rgba(11,21,48,0.75); font-weight: 800; }
.globe-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; color: rgba(255,255,255,0.75); pointer-events: none; padding: 0 10px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 12px 0 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.lg-today { background: #ffd23f; } .lg-open { background: #e63946; } .lg-played { background: #2a9d55; } .lg-locked { background: #5b6b8c; }
.found { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.fb-title { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.fb-title b { color: var(--gold); }
.fb-flags { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; font-size: 18px; text-align: center; }
.fb-flags span { opacity: .35; } .fb-flags span.on { opacity: 1; }
.dh-country { font-size: 15px; color: #dfe6ff; margin-top: 2px; font-weight: 700; }
.ctry-fact { font-size: 14px; line-height: 1.45; color: #dfe6ff; background: rgba(77,163,255,0.12); border: 1px solid rgba(77,163,255,0.3); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.btn.gold { width: 100%; margin-top: 12px; background: linear-gradient(180deg, #ffe08a, #e2a421); color: #3b2500; box-shadow: 0 5px 0 #9c6b0c, 0 10px 24px rgba(226,164,33,0.35); }
.btn.gold.big { font-size: 19px; padding: 16px; }
.btn.small-txt { font-size: 14px; padding: 11px; }
.res-keep { margin-top: 10px; color: #dfe6ff; font-size: 14px; }
.br-gap { padding: 0 14px 10px 62px; font-size: 13px; color: #9fe8a8; font-weight: 700; }

/* ---------- v2: Dialog ---------- */
.dialog { position: fixed; inset: 0; z-index: 90; background: rgba(3,6,18,0.7); display: flex; align-items: center; justify-content: center; padding: 24px; }
.dlg-box { width: 100%; max-width: 360px; background: linear-gradient(180deg, #1b3170, #13254f); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: countIn .25s; }
.dlg-title { font-family: var(--head); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.dlg-text { color: #dfe6ff; font-size: 15px; line-height: 1.45; margin-bottom: 18px; }
.dlg-btns { display: flex; gap: 10px; }
.dlg-btns .btn { flex: 1; padding: 13px 10px; font-size: 16px; }

/* ---------- v2: Einführung ---------- */
.intro { text-align: center; padding: 10px 4px 4px; }
.in-ico { font-size: 70px; animation: float 4s ease-in-out infinite; }
.intro h3 { font-family: var(--head); font-size: 26px; margin: 8px 0; }
.intro p { color: #dfe6ff; font-size: 16px; line-height: 1.5; margin: 0 0 16px; }
.in-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 4px; }
.in-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.25); }
.in-dots i.on { background: var(--gold); width: 22px; border-radius: 9px; }

/* ---------- v2: Tageswertung ---------- */
.rv-loading { text-align: center; font-family: var(--head); font-size: 24px; padding: 50px 0; animation: pulse .6s infinite alternate; }
.rv-head { text-align: center; margin-bottom: 14px; }
.rv-kicker { color: var(--muted); font-weight: 800; font-size: 13px; }
.rv-head h3 { font-family: var(--head); font-size: 30px; margin: 4px 0 0; }
.rv-list { position: relative; }
.rv-row { position: absolute; left: 0; right: 0; top: 0; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); transition: transform 1.3s cubic-bezier(.3,1.25,.4,1); }
.rv-row.small { height: 40px; }
.rv-row.me { background: linear-gradient(135deg, rgba(255,210,63,0.3), rgba(230,57,70,0.25)); border-color: rgba(255,210,63,0.8); z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.rv-row.np { opacity: .55; }
.rv-rank { width: 30px; text-align: center; font-family: var(--head); font-size: 20px; font-weight: 700; flex: none; }
.rv-name { flex: 1; min-width: 0; font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-name small { color: var(--muted); }
.rv-tags { font-size: 11px; color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.rv-pts { text-align: right; flex: none; }
.rv-pts b { font-family: var(--head); font-size: 24px; color: var(--gold); display: block; line-height: 1; }
.rv-row.small .rv-pts b { font-size: 19px; }
.rv-pts small { font-size: 11px; color: var(--muted); }
.rv-msg { margin: 14px 0 6px; text-align: center; font-weight: 800; font-size: 16px; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: all .5s; }
.rv-msg.show { opacity: 1; transform: none; }
.rv-sub { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; }
.rv-sub h4 { font-family: var(--head); font-size: 18px; margin: 0; }
.rv-gain { background: var(--green); color: #fff; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .rv-row { transition: none; } }

/* ---------- v3: Hall of Fame ---------- */
.tab { font-size: 11px; }
.fame-hunters { background: linear-gradient(135deg, rgba(255,210,63,0.2), rgba(230,57,70,0.15)); border: 1px solid rgba(255,210,63,0.4); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; }
.fh-title { font-family: var(--head); font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.fh-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fh-chip { background: rgba(0,0,0,0.25); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 14px; }
.fh-chip b { color: var(--gold); margin-left: 4px; }
.fh-chip.me { outline: 2px solid var(--gold); }
.fame-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.fame-card.locked { opacity: .55; }
.fc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.fc-ico { font-size: 28px; width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; flex: none; }
.fc-t { min-width: 0; }
.fc-title { font-family: var(--head); font-weight: 700; font-size: 17px; line-height: 1.15; }
.fc-sub { font-size: 12px; color: var(--muted); font-weight: 700; }
.fc-note { font-size: 14px; color: #dfe6ff; padding: 4px 0 2px; }
.fc-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.fc-row.champ { background: rgba(255,210,63,0.14); padding: 9px 8px; }
.fc-row.me .fc-n { color: var(--gold); }
.fc-m { font-size: 20px; flex: none; }
.fc-n { flex: 1; min-width: 0; font-weight: 800; }
.fc-n small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.fc-v { text-align: right; flex: none; font-size: 13px; color: var(--muted); }
.fc-v b { font-family: var(--head); font-size: 19px; color: #fff; }
.fc-v small { display: block; font-size: 11px; color: var(--gold); font-weight: 800; }
.fc-row.champ .fc-v b { color: var(--gold); font-size: 22px; }
.rec-line { margin-top: 12px; font-size: 14px; text-align: center; color: #dfe6ff; }

/* ---------- v4: Saisons & Top 10 ---------- */
.seg { display: flex; gap: 6px; background: rgba(0,0,0,0.25); padding: 4px; border-radius: 14px; margin-bottom: 14px; overflow-x: auto; }
.seg-b { flex: 1; padding: 10px 12px; border-radius: 10px; font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg-b.on { background: var(--card2); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.champ-banner { text-align: center; padding: 12px; border-radius: 14px; margin-bottom: 12px; background: linear-gradient(135deg, rgba(255,210,63,0.3), rgba(230,57,70,0.2)); border: 1px solid rgba(255,210,63,0.5); font-size: 16px; }
.champ-banner b { color: var(--gold); font-family: var(--head); font-size: 20px; }
.fame-card .fc-row.more { display: none; }
.fame-card.expanded .fc-row.more { display: flex; }
.fc-toggle { width: 100%; margin-top: 6px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,0.06); font-weight: 800; font-size: 13px; color: var(--muted); }
.fc-note.small { font-size: 12px; color: var(--muted); margin-top: 6px; }
