/* ───────────── Beat Vault · Neopunk ───────────── */
:root {
  --bg: #0b0614;
  --bg-2: #140a24;
  --panel: rgba(28, 12, 52, 0.72);
  --panel-solid: #1a0c30;
  --line: rgba(190, 120, 255, 0.28);
  --text: #f3e9ff;
  --muted: #b39ad6;
  --pink: #ff2bd6;
  --purple: #a259ff;
  --cyan: #38f3ff;
  --gold: #ffd23f;
  --green: #4dffb0;
  --accent: var(--pink);
  --glow: 0 0 6px var(--accent), 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent);
  --cut: 14px;
  --font-head: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Rajdhani', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at 50% -10%, #3a0f5e 0%, var(--bg-2) 40%, var(--bg) 75%);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: .06em; margin: 0; }

/* Hintergrund: Synthwave-Sonne + Gitterboden */
.bg-sun {
  position: fixed; left: 50%; top: 52vh; width: 70vmin; height: 70vmin;
  transform: translate(-50%, -50%); border-radius: 50%; z-index: -3;
  background: linear-gradient(180deg, #ff4fd8 0%, #b13cff 55%, transparent 56%, transparent 60%, #8a2cff 61%, transparent 66%, transparent 70%, #6a20ff 71%, transparent 76%);
  opacity: .22; filter: blur(1px);
}
.bg-grid {
  position: fixed; inset: auto 0 0 0; height: 48vh; z-index: -2;
  background-image:
    linear-gradient(rgba(255, 43, 214, .45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(162, 89, 255, .45) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(380px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  animation: gridMove 4s linear infinite;
}
@keyframes gridMove { to { background-position: 0 60px, 0 0; } }

#app { max-width: 1180px; margin: 0 auto; padding: 18px 16px 120px; }

/* Panels mit abgeschrägten Ecken */
.panel {
  position: relative; background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.neon { color: var(--accent); text-shadow: var(--glow); }
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: var(--cyan); transform: translate(-2px, 0); clip-path: inset(0 0 60% 0); opacity: .7; animation: glitch 3.5s infinite steps(1); }
.glitch::after  { color: var(--pink); transform: translate(2px, 0); clip-path: inset(55% 0 0 0); opacity: .7; animation: glitch 2.8s infinite steps(1) reverse; }
@keyframes glitch {
  0%, 92%, 100% { transform: translate(0, 0); opacity: 0; }
  93% { transform: translate(-3px, 1px); opacity: .8; }
  95% { transform: translate(3px, -1px); opacity: .8; }
  97% { transform: translate(-1px, 0); opacity: .6; }
}

.btn {
  --c: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.3em; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
  font-family: var(--font-head); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: color-mix(in srgb, var(--c) 28%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 60%, transparent); }
.btn:active { transform: scale(.97); }
.btn.solid { background: var(--c); color: #12051f; }
.btn.ghost { --c: var(--muted); }
.btn.small { padding: .45em .9em; font-size: .68rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.2rem;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px;
}
.icon-btn:hover { border-color: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent); }

/* ───────────── Login ───────────── */
.login { min-height: calc(100vh - 140px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; text-align: center; }
.logo { font-size: clamp(2.6rem, 9vw, 5.6rem); font-weight: 900; line-height: 1; --accent: var(--pink); }
.logo small { display: block; font-family: var(--font-body); font-size: clamp(1rem, 2.6vw, 1.35rem); letter-spacing: .4em; color: var(--muted); text-shadow: none; margin-top: 14px; font-weight: 600; }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 26px; width: 100%; justify-content: center; }
.player-card {
  --accent: var(--c); padding: 28px 18px 24px; border: none; display: flex; flex-direction: column; align-items: center; gap: 14px;
  transition: transform .2s;
}
.player-card::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--accent); clip-path: inherit; opacity: .55; pointer-events: none; }
.player-card:hover, .player-card:focus-visible { transform: translateY(-6px); outline: none; }
.player-card:hover::after, .player-card:focus-visible::after { opacity: 1; box-shadow: inset 0 0 30px var(--accent); }
.player-card .p-label { font-family: var(--font-head); font-size: .7rem; letter-spacing: .3em; color: var(--muted); }
.player-card .p-name { font-family: var(--font-head); font-size: 1.7rem; font-weight: 900; color: var(--accent); text-shadow: var(--glow); }
.player-card .p-start { font-family: var(--font-head); font-size: .7rem; letter-spacing: .25em; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.avatar { width: 92px; height: 92px; position: relative; display: grid; place-items: center; }
.avatar svg { position: absolute; inset: 0; filter: drop-shadow(0 0 8px var(--accent)); }
.avatar span { position: relative; font-family: var(--font-head); font-weight: 900; font-size: 2.3rem; color: #fff; text-shadow: 0 0 10px var(--accent); }
.avatar.sm { width: 46px; height: 46px; }
.avatar.sm span { font-size: .95rem; }
.avatar span.zwei { font-size: 1.8rem; letter-spacing: -.02em; }
.avatar.sm span.zwei { font-size: .85rem; }

.parent-link { background: none; border: none; color: var(--muted); font-size: .95rem; letter-spacing: .1em; opacity: .75; }
.parent-link:hover { color: var(--text); opacity: 1; }

/* ───────────── Top-Bar ───────────── */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 16px; }
.topbar .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .who b { font-family: var(--font-head); font-size: 1.15rem; color: var(--accent); text-shadow: var(--glow); }
.topbar .who small { display: block; color: var(--muted); font-size: .85rem; letter-spacing: .1em; }
.topbar .spacer { flex: 1; }
.coins { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border: 1px solid rgba(255,210,63,.45); border-radius: 30px; background: rgba(255,210,63,.08); font-family: var(--font-head); font-weight: 700; color: var(--gold); text-shadow: 0 0 8px rgba(255,210,63,.6); }
.coins.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.18); } }
.coin-ico { width: 26px; height: 26px; flex: none; }

/* ───────────── HUD ───────────── */
.hud { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.hud .panel { padding: 16px 18px; }
.hud h3 { font-size: .72rem; letter-spacing: .25em; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.radar-time { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; }
.radar-time small { font-size: .9rem; color: var(--muted); }
.bar { height: 14px; margin-top: 10px; background: rgba(255,255,255,.06); border: 1px solid var(--line); position: relative; overflow: hidden; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--purple), var(--pink)); box-shadow: 0 0 14px var(--pink); transition: width .9s linear; }
.bar i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(0,0,0,.25) 10px 12px); }
.radar-note { margin-top: 8px; color: var(--muted); font-size: .95rem; min-height: 1.4em; }
.radar-note.idle { color: var(--gold); }
.radar-note.done { color: var(--green); }

.vault-wrap { display: flex; align-items: center; gap: 14px; }
.vault-svg { width: 92px; height: 92px; flex: none; }
.vault-svg .seg { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 9; transition: stroke .4s, filter .4s; }
.vault-svg .seg.on { stroke: var(--gold); filter: drop-shadow(0 0 5px var(--gold)); }
.vault-svg .seg.pop { animation: segPop .8s ease-out; }
@keyframes segPop { 0% { stroke: #fff; stroke-width: 14; } 100% { stroke-width: 9; } }
.vault-info b { font-family: var(--font-head); font-size: 1.5rem; }
.vault-info p { margin: 2px 0 8px; color: var(--muted); font-size: .95rem; }
.streak { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; }
.week { display: flex; gap: 6px; margin-top: 10px; }
.week span { flex: 1; text-align: center; font-size: .7rem; color: var(--muted); }
.week span i { display: block; height: 22px; margin-bottom: 3px; border: 1px solid var(--line); background: rgba(255,255,255,.04); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.week span.on i { background: linear-gradient(180deg, var(--pink), var(--purple)); box-shadow: 0 0 10px var(--pink); border-color: transparent; }
.week span.today { color: var(--text); font-weight: 700; }
.hud-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 26px var(--gold); } }

/* ───────────── Instrument + Tabs ───────────── */
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.switch button {
  --accent: var(--purple);
  padding: 16px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--font-head); font-weight: 700; letter-spacing: .14em; font-size: 1rem; text-transform: uppercase;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: all .2s;
}
.switch button .ico { font-size: 1.7rem; filter: grayscale(.6); transition: filter .2s; }
.switch button[aria-pressed="true"] { --accent: var(--pink); border-color: var(--accent); color: #fff; background: linear-gradient(135deg, rgba(255,43,214,.25), rgba(162,89,255,.25)); box-shadow: inset 0 0 30px rgba(255,43,214,.25); text-shadow: var(--glow); }
.switch button[aria-pressed="true"] .ico { filter: none; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: none; padding: 12px 16px; font-family: var(--font-head); font-size: .78rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); text-shadow: var(--glow); }
.tabs .count { display: inline-block; min-width: 1.6em; padding: 0 .4em; margin-left: .4em; border-radius: 10px; background: rgba(255,255,255,.08); font-size: .7rem; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search { flex: 1; padding: 12px 16px; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: var(--text); font: inherit; outline: none; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.search:focus { border-color: var(--accent); }

/* ───────────── Karten ───────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { --cut: 10px; padding: 16px; display: flex; gap: 14px; align-items: flex-start; text-align: left; border: none; width: 100%; transition: transform .15s; }
.card::after { content: ''; position: absolute; inset: 0; border: 1px solid var(--line); clip-path: inherit; pointer-events: none; transition: border-color .15s; }
button.card:hover { transform: translateY(-3px); }
button.card:hover::after { border-color: var(--accent); box-shadow: inset 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.card .doc { width: 44px; height: 54px; flex: none; display: grid; place-items: center; font-family: var(--font-head); font-size: .6rem; font-weight: 700; color: #12051f; background: linear-gradient(160deg, var(--pink), var(--purple)); clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%); }
.card .doc.img { background: linear-gradient(160deg, var(--cyan), var(--purple)); }
.card .meta { min-width: 0; flex: 1; }
.card .t { font-weight: 700; font-size: 1.08rem; line-height: 1.2; word-break: break-word; }
.card .s { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .72rem; padding: 2px 8px; border: 1px solid var(--line); color: var(--muted); letter-spacing: .05em; }
.tag.new { border-color: var(--green); color: var(--green); text-shadow: 0 0 6px var(--green); font-weight: 700; }

.audio-card { flex-direction: column; align-items: stretch; }
.audio-card .head { display: flex; gap: 12px; align-items: center; }
.audio-card .disc { width: 44px; height: 44px; border-radius: 50%; flex: none; background: radial-gradient(circle, var(--bg) 18%, var(--pink) 19%, var(--purple) 60%, #2a1048 61%); box-shadow: 0 0 12px var(--pink); }
.audio-card.playing .disc { animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.audio-card audio { width: 100%; height: 38px; filter: invert(1) hue-rotate(180deg) saturate(1.5); opacity: .9; }
.speeds { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted); }
.speeds button { background: none; border: 1px solid var(--line); padding: 3px 9px; font-family: var(--font-head); font-size: .68rem; color: var(--muted); }
.speeds button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }

.video-card { flex-direction: column; padding: 0; gap: 0; }
.video-card .thumb { width: 100%; aspect-ratio: 16/9; background: #000 center/cover; position: relative; }
.video-card .thumb::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; color: #fff; text-shadow: 0 0 16px var(--pink); background: linear-gradient(transparent 40%, rgba(11,6,20,.8)); }
.video-card .meta { padding: 12px 14px 14px; }

.section-title { font-size: .8rem; letter-spacing: .25em; color: var(--muted); margin: 22px 0 12px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; font-family: var(--font-head); color: var(--text); font-size: 1rem; margin-bottom: 6px; letter-spacing: .1em; }

/* ───────────── Schatz-Button (schwebend) ───────────── */
.chest-fab { position: fixed; right: 20px; bottom: 22px; z-index: 55; width: 96px; height: 96px; border: none; background: none; padding: 0; animation: float 2s ease-in-out infinite, fabWackeln 2.4s ease-in-out infinite; filter: drop-shadow(0 0 18px var(--gold)); }
.chest-fab::after { content: 'ÖFFNEN!'; position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); font-family: var(--font-head); font-size: .62rem; letter-spacing: .15em; color: var(--gold); white-space: nowrap; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-3deg); } }

/* ───────────── Modal ───────────── */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(6, 2, 14, .82); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { --cut: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; background: var(--panel-solid); animation: pop .25s cubic-bezier(.2, 1.4, .4, 1); }
.modal::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--accent); clip-path: inherit; pointer-events: none; opacity: .7; }
.modal.wide { width: min(1000px, 100%); padding: 16px; }
@keyframes pop { from { transform: scale(.88); opacity: 0; } }
.modal h2 { font-size: 1.15rem; margin-bottom: 14px; color: var(--accent); text-shadow: var(--glow); }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .close { position: absolute; top: 10px; right: 12px; z-index: 2; }
.viewer { width: 100%; height: min(78vh, 1100px); border: 0; background: #fff; display: block; }
.viewer-img { width: 100%; max-height: 78vh; object-fit: contain; background: #fff; display: block; }
.yt { width: 100%; aspect-ratio: 16/9; border: 0; display: block; background: #000; }

/* PIN-Pad */
.pin { text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 22px; }
.pin-dots i { width: 18px; height: 18px; border: 2px solid var(--accent); transform: rotate(45deg); transition: background .15s; }
.pin-dots i.on { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center; }
.pin-pad button { height: 64px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.pin-pad button:active { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* Schatzkiste */
.chest-stage { text-align: center; position: relative; padding-top: 6px; }
.chest-stage .big-chest { width: 220px; height: 200px; margin: 0 auto; display: block; cursor: pointer; filter: drop-shadow(0 0 24px rgba(255,210,63,.55)); }
.chest-stage .big-chest.wobble { animation: wobble .9s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-2deg); } }
.lid { transform-origin: 30px 86px; transform-box: view-box; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }

.chest-glow { opacity: 0; transition: opacity .3s; }
.open .chest-glow { opacity: 1; }
.loot { font-family: var(--font-head); font-size: 2.6rem; font-weight: 900; color: var(--gold); text-shadow: 0 0 18px var(--gold); min-height: 1.3em; }
.loot-sub { color: var(--muted); min-height: 1.5em; }
.particle { position: absolute; left: 50%; top: 45%; width: 20px; height: 20px; pointer-events: none; animation: burst 1.2s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes burst { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* Gutscheine */
.voucher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.voucher-option { --cut: 10px; padding: 16px 10px; border: none; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: rgba(255,255,255,.04); }
.voucher-option::after { content: ''; position: absolute; inset: 0; border: 1px solid var(--line); clip-path: inherit; pointer-events: none; }
.voucher-option:hover::after { border-color: var(--gold); box-shadow: inset 0 0 18px rgba(255,210,63,.35); }
.voucher-option .e { font-size: 2.2rem; }
.voucher-option b { font-family: var(--font-head); font-size: .78rem; letter-spacing: .06em; }
.voucher-option small { color: var(--muted); font-size: .85rem; line-height: 1.2; }
.voucher-option .price { color: var(--gold); font-family: var(--font-head); font-size: .8rem; }

.ticket { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px; background: linear-gradient(90deg, rgba(255,210,63,.12), rgba(255,43,214,.08)); border: 1px dashed rgba(255,210,63,.6); }
.ticket.used { opacity: .45; border-color: var(--line); background: none; }
.ticket .e { font-size: 2rem; }
.ticket .info { flex: 1; min-width: 0; }
.ticket .info b { font-family: var(--font-head); font-size: .85rem; display: block; }
.ticket .info small { color: var(--muted); }

/* Eltern */
.parent-kid { padding: 18px; margin-bottom: 16px; }
.parent-kid h3 { color: var(--accent); margin-bottom: 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; color: var(--muted); }
.stats b { color: var(--text); font-family: var(--font-head); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 80; padding: 12px 22px; background: var(--panel-solid); border: 1px solid var(--accent); box-shadow: var(--glow); font-weight: 700; max-width: calc(100% - 32px); text-align: center; opacity: 0; visibility: hidden; transition: transform .3s, opacity .3s, visibility .3s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ───────────── Responsive ───────────── */
@media (max-width: 900px) {
  .hud { grid-template-columns: 1fr 1fr; }
  .hud .radar { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .players { grid-template-columns: 1fr 1fr; gap: 12px; }
  .player-card { padding: 20px 8px; }
  .player-card .p-name { font-size: 1.25rem; }
  .hud { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .topbar .who small { display: none; }
  .switch button { font-size: .8rem; padding: 12px; }
  .grid { grid-template-columns: 1fr; }
  .pin-pad { grid-template-columns: repeat(3, 68px); }
  .chest-fab { width: 80px; height: 80px; right: 14px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───────────── Aktuell (Aufgaben) ───────────── */
.switch button { position: relative; }
.switch .badge { position: absolute; top: 8px; right: 10px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: #12051f; font-size: .75rem; box-shadow: 0 0 12px var(--gold); text-shadow: none; }
.tasks { display: grid; gap: 16px; }
.task { --cut: 14px; padding: 18px; }
.task::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--gold); clip-path: inherit; pointer-events: none; opacity: .55; }
.task.done::after { border-color: var(--green); opacity: .8; }
.task-head { display: flex; gap: 14px; align-items: flex-start; }
.task-ico { font-size: 1.9rem; line-height: 1; }
.task-meta { flex: 1; min-width: 0; }
.task-meta .t { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; word-break: break-word; }
.task-meta .s { margin-top: 6px; }
.task-note { margin-top: 8px; font-size: 1.3rem; font-weight: 700; color: var(--gold); text-shadow: 0 0 10px rgba(255,210,63,.45); line-height: 1.25; }
.task-body { margin-top: 14px; }
.task-body .yt { max-width: 760px; }
.task-video { display: block; width: 100%; max-width: 760px; aspect-ratio: 16/9; border: none; background: #000 center/cover; position: relative; }
.task-video::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: #fff; text-shadow: 0 0 20px var(--pink); background: rgba(11,6,20,.35); }
.task-audio { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.check { flex: none; padding: 10px 14px; border: 2px solid var(--line); background: rgba(255,255,255,.04); font-family: var(--font-head); font-size: .7rem; letter-spacing: .08em; color: var(--muted); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.check[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: rgba(77,255,176,.12); text-shadow: 0 0 8px var(--green); }

/* Upload-Maske */
.upload { padding: 18px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.seg-row { display: flex; flex-wrap: wrap; gap: 12px; }
.seg { display: flex; border: 1px solid var(--line); }
.seg button { padding: 10px 16px; background: none; border: none; font-family: var(--font-head); font-size: .75rem; letter-spacing: .1em; color: var(--muted); }
.seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed rgba(255,210,63,.5); background: rgba(255,210,63,.05); text-align: center; cursor: pointer; transition: all .15s; }
.drop b { font-family: var(--font-head); letter-spacing: .08em; font-size: .9rem; }
.drop span { color: var(--muted); font-size: .9rem; }
.drop.over, .drop:hover { background: rgba(255,210,63,.14); border-color: var(--gold); box-shadow: inset 0 0 24px rgba(255,210,63,.25); }
.file-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 8px 0; padding: 6px 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.file-pill small { color: var(--muted); }
.file-pill button { background: none; border: none; color: var(--muted); }
.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.up-grid select { appearance: none; -webkit-appearance: none; }
.up-grid select option { background: var(--panel-solid); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 10px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: .85rem; border-radius: 20px; }
.chip:hover { border-color: var(--gold); color: var(--text); }
.aufgabe-zeile { align-items: flex-start; flex-wrap: wrap; }
.aufgabe-knoepfe { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.aufgabe-zeile .info { display: flex; flex-direction: column; gap: 6px; }
.notiz-edit { padding: 8px 12px; font-size: .95rem; }
@media (max-width: 560px) {
  .up-grid { grid-template-columns: 1fr; }
  .task-head { flex-wrap: wrap; }
  .check { width: 100%; }
  .task-note { font-size: 1.15rem; }
}
.up-grid > * { min-width: 0; width: 100%; }

/* Shop-Verwaltung */
.shop-liste { display: grid; gap: 10px; }
.shop-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.4fr) 170px; gap: 10px 12px; align-items: end;
  padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.shop-row > * { min-width: 0; }
.feld { display: flex; flex-direction: column; gap: 4px; }
.feld > span:first-child { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.feld .search { padding: 10px 12px; width: 100%; }
.s-emoji .search { text-align: center; font-size: 1.3rem; padding: 6px; }
.preis-wrap { display: flex; align-items: center; gap: 8px; }
.preis-wrap .search { text-align: right; font-family: var(--font-head); font-weight: 700; color: var(--gold); min-width: 0; }
.preis-wrap b { color: var(--gold); font-size: .9rem; }
.s-knoepfe { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 820px) {
  .shop-row { grid-template-columns: 64px minmax(0, 1fr); }
  .shop-row .s-text, .shop-row .s-preis { grid-column: 1 / -1; }
  .shop-row .s-preis .preis-wrap { max-width: 220px; }
}

/* Einklappbare Bereiche */
details.klapp > summary { list-style: none; cursor: pointer; margin: 0; display: flex; align-items: center; gap: 10px; user-select: none; }
details.klapp > summary::-webkit-details-marker { display: none; }
details.klapp > summary::after { content: '▸ aufklappen'; margin-left: auto; font-family: var(--font-body); font-size: .85rem; letter-spacing: .05em; color: var(--muted); }
details.klapp[open] > summary::after { content: '▾ zuklappen'; }
details.klapp > summary:hover { color: var(--text); }
details.klapp { display: block; }
.klapp-inhalt { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

/* ───────────── Ultra-Diamant 🌈 ───────────── */
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes rainbowShift { to { background-position: 200% 0; } }
.rainbow-text {
  background: linear-gradient(90deg, #ff3b6b, #ffb43b, #fff23b, #3bff9a, #3bb4ff, #b43bff, #ff3b6b);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important;
  text-shadow: none !important; filter: drop-shadow(0 0 10px rgba(255,255,255,.55)); animation: rainbowShift 1.2s linear infinite;
}
.ultra-titel { font-family: var(--font-head); font-size: 1.35rem; letter-spacing: .1em; display: inline-block; animation: rainbowShift 1.2s linear infinite, ultraPuls .6s ease-in-out infinite alternate; }
@keyframes ultraPuls { to { transform: scale(1.08); } }
.loot.rainbow-text { font-size: 3.2rem; }
.loot.rainbow-text .coin-ico { filter: none; }
.ultra-modal::after { border-width: 3px; border-color: #ff3b6b; opacity: 1; animation: hue 1.2s linear infinite; }
.ultra-modal { box-shadow: 0 0 60px rgba(255,255,255,.25); }
.ultra-gem { position: absolute; left: 50%; top: 92px; width: 110px; height: 110px; margin-left: -55px; z-index: 3; pointer-events: none;
  animation: gemRise 1.6s cubic-bezier(.2, 1.4, .4, 1) forwards, gemFloat 2s 1.6s ease-in-out infinite; }
.ultra-gem svg { width: 100%; height: 100%; animation: hue 1.5s linear infinite; filter: drop-shadow(0 0 18px #fff) drop-shadow(0 0 40px #ff3bd6); }
@keyframes gemRise { 0% { transform: translateY(90px) scale(0) rotate(-180deg); opacity: 0; } 60% { transform: translateY(-40px) scale(1.3) rotate(15deg); opacity: 1; } 100% { transform: translateY(-20px) scale(1) rotate(0); opacity: 1; } }
@keyframes gemFloat { 0%, 100% { transform: translateY(-20px); } 50% { transform: translateY(-32px); } }
.ultra-rays { position: absolute; left: 50%; top: 110px; width: 420px; height: 420px; margin: -150px 0 0 -210px; z-index: 0; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,59,107,.35) 0 8deg, transparent 8deg 20deg, rgba(59,180,255,.35) 20deg 28deg, transparent 28deg 40deg, rgba(255,242,59,.35) 40deg 48deg, transparent 48deg 60deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 70%);
  animation: spin 6s linear infinite, fade .6s; }
.chest-stage > *:not(.ultra-rays) { position: relative; z-index: 1; }
.chest-stage > .particle { position: absolute; z-index: 4; }
.chest-stage > .ultra-gem { position: absolute; }
.particle.rainbow { width: 28px; height: 28px; }
.particle.rainbow svg { animation: hue 1s linear infinite; filter: drop-shadow(0 0 6px #fff); }
.ultra-flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,59,214,.5) 40%, transparent 75%); animation: flash 1.3s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.rainbow-btn { --c: #ff3b6b; animation: hue 2s linear infinite; }

/* Geschenke */
.gift-fab { filter: drop-shadow(0 0 18px var(--cyan)); animation-delay: -1s; }
.gift-fab::after { content: 'GESCHENK!'; color: var(--cyan); }
.gift-fab.oben { bottom: 140px; }
.gift-fab .badge { position: absolute; top: 0; right: 0; min-width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: var(--pink); color: #fff; font-family: var(--font-head); font-size: .8rem; }
.geschenk-nachricht { margin: -4px 0 6px; font-size: 1.25rem; font-weight: 700; color: var(--cyan); text-shadow: 0 0 10px rgba(56,243,255,.5); }
.geschenk-form { display: grid; grid-template-columns: 110px 140px minmax(0, 1fr) auto; gap: 10px; margin: 12px 0 8px; align-items: end; }
.geschenk-form > * { min-width: 0; }
.g-n .search { text-align: right; font-family: var(--font-head); font-weight: 700; color: var(--gold); }
@media (max-width: 720px) {
  .geschenk-form { grid-template-columns: 1fr 1fr; }
  .geschenk-form .g-text, .geschenk-form .btn { grid-column: 1 / -1; }
  .gift-fab.oben { bottom: 118px; }
}


.ultra-zeile { display: inline-flex; align-items: center; gap: 8px; font-size: 1.35rem; }
.chest-stage > h2 { z-index: 5; }

/* Deckel wegschleudern + zersplittern */
.chest-stage > .deckel-flug { position: absolute; z-index: 6; pointer-events: none; overflow: visible; filter: drop-shadow(0 0 10px rgba(255,255,255,.4)); }
.chest-stage > .scherbe { position: absolute; z-index: 6; pointer-events: none; box-shadow: 0 0 6px rgba(255,255,255,.6); }
.chest-stage > .aufprall { position: absolute; z-index: 6; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,.7) 20%, rgba(255,43,214,.4) 45%, transparent 70%); animation: aufprall .45s ease-out forwards; }
@keyframes aufprall { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.modal.wackeln { animation: wackeln .35s; }
@keyframes wackeln { 20% { transform: translate(-6px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(2px, 0); } }

/* Münzen, die am Boden liegen bleiben */
.chest-stage > .muenz-boden { position: relative; height: 38px; margin: -26px auto 6px; width: min(460px, 100%); z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,210,63,.18), transparent 70%); border-bottom: 1px solid rgba(255,210,63,.25); }
.boden-muenze { position: absolute; top: 0; width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(255,210,63,.7)); }
.boden-muenze svg { width: 100%; height: 100%; display: block; }

/* Elternansicht */
.ansicht-banner { --accent: var(--cyan); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 12px; border: 2px solid var(--cyan); color: var(--text); }
.karte-wrap { position: relative; display: flex; flex-direction: column; }
.karte-wrap > .card { flex: 1; }
.karte-wrap .zu-aktuell { position: absolute; right: 10px; bottom: 10px; z-index: 2; }
.audio-card .zu-aktuell { align-self: flex-end; }
.zu-aktuell.drin { padding: 4px 10px; font-size: .8rem; color: var(--green); border: 1px solid var(--green); background: rgba(11,6,20,.8); }
.karte-wrap.mit-knopf .card { padding-bottom: 50px; }
.bib-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.karte-wrap .bib-knoepfe { position: absolute; right: 10px; bottom: 10px; z-index: 2; }
.audio-card .bib-knoepfe { margin-top: 4px; }
.task-aktionen { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.video-card + .bib-knoepfe { bottom: 10px; }
.karte-wrap.mit-knopf .video-card { padding-bottom: 46px; }

/* Lesbarkeit: deckendere Karten bei den Inhalten */
#tabs, #content { position: relative; z-index: 51; }
#content .panel, #content .card { background: rgba(24, 11, 44, .96); backdrop-filter: none; }
#content .task-video::after { background: rgba(11, 6, 20, .12); }
#content .video-card .thumb::after { background: linear-gradient(transparent 60%, rgba(11, 6, 20, .55)); }
.korrektur { display: inline-flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; margin-right: 8px; }
.korrektur .feld { width: 140px; }
.korrektur .search { padding: 8px 10px; text-align: right; font-family: var(--font-head); color: var(--gold); }
#toast { display: flex; align-items: center; gap: 12px; justify-content: center; }
.toast-btn { --c: var(--gold); flex: none; }

/* Kiste unten rechts wackelt ab und zu wie im Spiel */
@keyframes fabWackeln { 0%, 70%, 100% { rotate: 0deg; } 74% { rotate: -12deg; } 78% { rotate: 12deg; } 82% { rotate: -9deg; } 86% { rotate: 7deg; } 90% { rotate: -3deg; } }
.chest-fab:hover { scale: 1.08; }
