/* ==========================================================
   Teil 6: Logo & Start, Animationen, Mehrspieler, Ruhemodus,
   Lerngruppe
   ========================================================== */

/* ---------- Logo ---------- */
.logo { display: inline-grid; place-items: center; flex: none; }
.logo-svg { width: 100%; height: 100%; display: block; }
.brand-mark.logo { background: none; padding: 0; width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 16px -8px rgba(30, 25, 20, .5); }
.login-brand .brand-mark.logo { width: 76px; height: 76px; border-radius: 22px; }
.login-brand .lg-p { stroke-dasharray: 140; stroke-dashoffset: 140; animation: lg-draw .9s .1s var(--ease) forwards; }
.login-brand .lg-dot { transform-origin: 53px 44px; transform: scale(0); animation: lg-pop .45s .75s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.login-brand .lg-orbit { stroke-dasharray: 32; stroke-dashoffset: 32; animation: lg-draw .5s .6s var(--ease) forwards; }
.brand:hover .lg-orbit, .brand:active .lg-orbit { animation: lg-orbit 1.1s var(--ease); transform-origin: 50px 50px; }
@keyframes lg-draw { to { stroke-dashoffset: 0; } }
@keyframes lg-pop { to { transform: scale(1); } }
@keyframes lg-orbit { to { transform: rotate(360deg); } }

/* ---------- Startbildschirm ---------- */
.splash { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: var(--bg); transition: opacity .5s var(--ease), visibility .5s; }
.splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-in { display: grid; justify-items: center; gap: 16px; transition: transform .5s var(--ease); }
.splash.out .splash-in { transform: scale(1.06); }
.splash .logo-svg { width: 104px; height: 104px; border-radius: 28px; animation: splash-pop .7s cubic-bezier(.2, 1.2, .3, 1) both; box-shadow: 0 18px 40px -18px rgba(30, 25, 20, .6); }
.splash .lg-p { stroke-dasharray: 140; stroke-dashoffset: 140; animation: lg-draw .8s .2s var(--ease) forwards; }
.splash .lg-dot { transform-origin: 53px 44px; transform: scale(0); animation: lg-pop .45s .8s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.splash .lg-orbit { stroke-dasharray: 32; stroke-dashoffset: 32; animation: lg-draw .5s .65s var(--ease) forwards; }
.splash-name { font: 600 32px/1 var(--font-display); letter-spacing: -.01em; color: var(--text); animation: fade-up .6s .45s var(--ease) both; }
@keyframes splash-pop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } }

/* ---------- Animationen beim Öffnen ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.enter > *, .enter .bento > *, .enter .game-grid > *, .enter .learn-list > *, .enter .mp-list > * { animation: rise .5s var(--ease) both; }
.enter > :nth-child(2), .enter .bento > :nth-child(2), .enter .game-grid > :nth-child(2), .enter .learn-list > :nth-child(2), .enter .mp-list > :nth-child(2) { animation-delay: .04s; }
.enter > :nth-child(3), .enter .bento > :nth-child(3), .enter .game-grid > :nth-child(3), .enter .learn-list > :nth-child(3), .enter .mp-list > :nth-child(3) { animation-delay: .08s; }
.enter > :nth-child(4), .enter .bento > :nth-child(4), .enter .game-grid > :nth-child(4), .enter .learn-list > :nth-child(4), .enter .mp-list > :nth-child(4) { animation-delay: .12s; }
.enter > :nth-child(5), .enter .bento > :nth-child(5), .enter .game-grid > :nth-child(5), .enter .learn-list > :nth-child(5) { animation-delay: .16s; }
.enter > :nth-child(6), .enter .bento > :nth-child(6), .enter .game-grid > :nth-child(6), .enter .learn-list > :nth-child(6) { animation-delay: .2s; }
.enter > :nth-child(7), .enter .bento > :nth-child(7), .enter .game-grid > :nth-child(7) { animation-delay: .24s; }
.enter > :nth-child(8), .enter .bento > :nth-child(8), .enter .game-grid > :nth-child(8) { animation-delay: .28s; }
.enter .game-grid > :nth-child(n+9) { animation-delay: .32s; }
.game-layer:not([hidden]) > * { animation: layer-in .32s var(--ease) both; }
@keyframes layer-in { from { opacity: 0; transform: scale(.975); } }
.nav-item, .tab { transition: background .2s, color .2s, transform .15s; }
.nav-item:active, .tab:active { transform: scale(.96); }
.nav-item .i, .tab .i { transition: transform .25s var(--ease); }
.nav-item.active .i, .tab.active .i { transform: scale(1.08); }
.toast { animation: toast-in .35s cubic-bezier(.2, 1.2, .3, 1) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.95); } }
.quiet.out { animation: fade-out .35s var(--ease) forwards; }
@keyframes fade-out { to { opacity: 0; transform: scale(1.02); } }

/* ---------- Menü mit 8 Einträgen ---------- */
@media (max-width: 900px) {
  .tabbar { grid-template-columns: repeat(8, minmax(0, 1fr)); width: min(760px, calc(100% - 16px)); padding: 5px; }
  .tab { font-size: 10.5px; }
}
.tb-quiet { margin-right: 2px; }

/* ---------- Spiele: Umschalter Mehrspieler / Solo ---------- */
.games-switch { display: flex; justify-content: center; margin: -4px 0 20px; }
.games-switch .seg { padding: 4px; border-radius: 16px; }
.games-switch .seg button { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.games-switch .seg small { font: 600 11px/1 var(--font); padding: 3px 7px; border-radius: 99px; background: var(--surface-2); color: var(--text-3); }

/* ---------- Mehrspieler: Übersicht ---------- */
.mp-list { display: grid; gap: 8px; margin-bottom: 20px; }
.mp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, border-color .2s; }
.mp-row:active { transform: scale(.99); }
.mp-row.hot { border-color: color-mix(in srgb, var(--amber) 55%, var(--border)); }
.mp-row b { display: block; font: 600 16px/1.2 var(--font-display); }
.mp-row small { color: var(--text-3); font-size: 12.5px; }
.mp-row-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; font-size: 24px; background: color-mix(in srgb, var(--c1) 20%, var(--inset)); }
.mp-row .btn { flex: none; }
.mp-people { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.mp-person { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--card); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.mp-person.on { border-color: var(--accent); box-shadow: var(--focus); }
.mp-on { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.mp-on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.mp-on.on { color: var(--green); }
.mp-on.on::before { background: var(--green); }

/* ---------- Mehrspieler: Spielbildschirm ---------- */
.mpv { position: relative; display: flex; flex-direction: column; height: 100%; }
.mpv-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; padding: 12px calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); }
.mpv-col { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.mpv-wrap { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.mpv-board { --ar: 1; width: min(100cqw, 100cqh * var(--ar)); aspect-ratio: var(--ar); position: relative; container-type: inline-size; }
.mpv-in { position: relative; width: 100%; height: 100%; transition: opacity .3s; }
.mpv-in.waiting { opacity: .45; pointer-events: none; }
.mpv-pl { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 14px; border-radius: 14px; background: #24211d; border: 1px solid rgba(255, 255, 255, .08); transition: border-color .25s, box-shadow .25s; }
.mpv-pl.turn { border-color: rgba(227, 184, 92, .7); box-shadow: 0 0 0 3px rgba(227, 184, 92, .16); }
.mpv-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.mpv-who { flex: 1; min-width: 0; display: grid; }
.mpv-who b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpv-who b small { color: var(--text-3); font-weight: 500; }
.mpv-who > small { color: var(--text-3); font-size: 12px; }
.mpv-clock { font: 600 22px/1 var(--font-mono); font-variant-numeric: tabular-nums; padding: 8px 12px; min-width: 96px; text-align: right; border-radius: 11px; background: #171512; color: var(--text-2); transition: background .2s, color .2s; }
.mpv-clock.run { background: #f1ece2; color: #1c1a17; }
.mpv-clock.low { color: #e4684f; }
.mpv-clock.run.low { background: #e4684f; color: #fff; animation: pulse 1s infinite; }
.mpv-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding: 14px; border-radius: 18px; background: #1d1b18; border: 1px solid rgba(255, 255, 255, .06); }
.mpv-status { font-size: 15px; color: var(--text-2); min-height: 22px; }
.mpv-status b { display: block; color: var(--text); font: 600 20px/1.25 var(--font-display); }
.mpv-status small { display: block; color: var(--text-3); margin-top: 3px; }
.mpv-hint { color: #f0c75e; font-size: 14px; min-height: 0; }
.mpv-hint:empty { display: none; }
.mpv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mpv-actions:empty { display: none; }
.mpv-offer { width: 100%; padding: 10px 12px; border-radius: 12px; background: rgba(227, 184, 92, .12); color: #f0c75e; font-weight: 600; }
.mpv-panel:empty { display: none; }
.mpv-curtain { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: #141210; padding: 20px; animation: fade-in .25s; }
.mpv-curtain[hidden] { display: none; }
.mpv-curtain-box { display: grid; justify-items: center; gap: 12px; text-align: center; }
.mpv-curtain-box .glyph { font-size: 56px; }
.mpv-curtain-box b { font: 600 26px/1.2 var(--font-display); }
.mpv-curtain-box p { color: var(--text-2); }
@media (max-width: 900px), (orientation: portrait) {
  .mpv-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .mpv-side { max-height: 30vh; padding: 10px 12px; gap: 8px; }
  .mpv-status b { font-size: 17px; }
}
@media (max-width: 900px) and (orientation: portrait) { .mpv-main { grid-template-rows: minmax(0, 1fr) auto; } }

/* ---------- Bretter: Grundlagen ---------- */
.bg-grid { display: grid; gap: 3px; padding: 3px; border-radius: 14px; background: #2a2622; }
.bg-grid .cell, .q-cell, .pq .cell { position: relative; border: 0; padding: 0; margin: 0; min-width: 0; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .06); color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.st { display: block; width: 80%; aspect-ratio: 1; border-radius: 50%; background: var(--c1); box-shadow: inset 0 -.12em 0 rgba(0, 0, 0, .25), inset 0 .1em 0 rgba(255, 255, 255, .25), 0 .1em .25em rgba(0, 0, 0, .45); font-size: 3cqw; transition: background .3s; }
.st.s1 { background: var(--c2); }
.last > .st, .mp-pt.last .st { animation: st-pop .35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes st-pop { from { transform: scale(.4); opacity: .3; } }
.bg-grid:not(.goban) .cell.last::before, .mp-pt.last::before { content: ""; position: absolute; inset: 6%; border-radius: inherit; box-shadow: 0 0 0 2px rgba(240, 199, 94, .75); pointer-events: none; }
.cell.tgt::after { content: ""; position: absolute; width: 26%; aspect-ratio: 1; border-radius: 50%; background: rgba(240, 199, 94, .55); pointer-events: none; }
.cell.tgt:has(.st)::after { width: auto; inset: 4%; background: none; border: 3px solid rgba(240, 199, 94, .7); border-radius: 50%; }
.cell.sel { background: rgba(240, 199, 94, .35) !important; }
.cell.can { box-shadow: inset 0 0 0 2px rgba(240, 199, 94, .3); }
.cell.kill, .mp-pt.kill { box-shadow: inset 0 0 0 3px rgba(228, 104, 79, .8); }

/* ---------- Schach ---------- */
.mp-chess { display: grid; grid-template-columns: repeat(8, 1fr); border-radius: 10px; overflow: hidden; box-shadow: 0 14px 40px -18px #000; }
.mp-chess .sq { position: relative; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; aspect-ratio: 1; -webkit-tap-highlight-color: transparent; }
.mp-chess .lt { background: #ecdcc2; }
.mp-chess .dk { background: #ad8462; }
.mp-chess .sq.last { box-shadow: inset 0 0 0 100cqw rgba(227, 184, 92, .38); }
.mp-chess .sq.sel { box-shadow: inset 0 0 0 100cqw rgba(110, 160, 120, .55); }
.mp-chess .sq.check { background: radial-gradient(circle, #e4684f 0%, rgba(228, 104, 79, .55) 45%, transparent 75%), #ad8462; }
.mp-chess .sq.tgt::after { content: ""; width: 30%; aspect-ratio: 1; border-radius: 50%; background: rgba(40, 32, 24, .32); }
.mp-chess .sq.cap::after { content: ""; position: absolute; inset: 5%; border-radius: 50%; border: .9cqw solid rgba(40, 32, 24, .35); }
.mp-chess .co { position: absolute; font: 700 1.9cqw/1 var(--font); color: rgba(60, 45, 30, .65); pointer-events: none; }
.mp-chess .dk .co { color: rgba(250, 240, 225, .8); }
.mp-chess .co.r { top: 4%; left: 5%; }
.mp-chess .co.f { bottom: 4%; right: 6%; }
/* Ziehen & Pfeile */
.mp-chess { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.mp-chess .sq.hover { box-shadow: inset 0 0 0 .55cqw rgba(255, 255, 255, .85); }
.mp-chess .sq.lift .pc { opacity: .25; }
.ch-ghost { position: fixed; z-index: 450; pointer-events: none; translate: -50% -58%; scale: 1.18; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); line-height: 1; }
.ch-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.ch-arrow polyline { fill: none; stroke: rgba(232, 128, 40, .82); stroke-width: .19; stroke-linecap: round; stroke-linejoin: round; }
.ch-arrow polygon { fill: rgba(232, 128, 40, .82); }
.ch-num circle { fill: #fff8ec; stroke: rgba(196, 98, 18, .95); stroke-width: .045; }
.ch-num text { font: 800 .24px/1 var(--font); fill: #7a3a08; text-anchor: middle; }
.ch-mark { fill: none; stroke: rgba(214, 64, 52, .8); stroke-width: .08; }
.ch-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pc { font-size: 9.6cqw; line-height: 1; font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", "Noto Sans Symbols 2", sans-serif; pointer-events: none; user-select: none; }
.pc.w { color: #fbf7ef; -webkit-text-stroke: .28cqw #3a322a; paint-order: stroke fill; text-shadow: 0 .4cqw .6cqw rgba(0, 0, 0, .35); }
.pc.b { color: #2a2420; -webkit-text-stroke: .14cqw #0d0b09; text-shadow: 0 .4cqw .6cqw rgba(0, 0, 0, .35); }
.pc.moved { animation: st-pop .3s var(--ease); }
.ch-promo { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 2%; background: rgba(20, 18, 16, .7); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade-in .2s; }
.ch-promo button { width: 17%; aspect-ratio: 1; border-radius: 16%; border: 0; background: #ecdcc2; display: grid; place-items: center; cursor: pointer; pointer-events: auto; font-size: 11cqw; }
.ch-promo .ch-x { width: 9%; background: #3a352f; color: var(--text); }
.ch-caps { display: grid; gap: 4px; }
.ch-caps > div { min-height: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 1px; }
.ch-caps .pc { font-size: 20px; }
.ch-caps small { margin-left: 6px; color: var(--text-3); font-weight: 600; }
.ch-moves { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font: 500 14px/1.5 var(--font-mono); max-height: 46vh; overflow: auto; }
.ch-moves li { display: grid; grid-template-columns: 34px 1fr 1fr; padding: 1px 6px; border-radius: 6px; }
.ch-moves li:nth-child(odd) { background: rgba(255, 255, 255, .04); }
.ch-moves span { color: var(--text-3); }
.ch-moves b { font-weight: 600; }
.ch-moves li:last-child b:last-child:not(:empty), .ch-moves li:last-child b:nth-child(2):only-of-type { color: #f0c75e; }

/* ---------- Vier gewinnt ---------- */
.mp-c4.bg-grid { background: #3f5f86; gap: 4%; gap: 2.2cqw; padding: 2.2cqw; border-radius: 16px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), 0 14px 40px -18px #000; }
.mp-c4 .cell { border-radius: 50%; background: #1b2a3c; box-shadow: inset 0 4px 8px rgba(0, 0, 0, .45); }
.mp-c4 .st { width: 92%; }
.mp-c4.bg-grid .cell.last::before { inset: -4%; border-radius: 50%; }
.st.drop { animation: c4-drop .45s cubic-bezier(.45, 0, .8, .4) both, c4-bounce .25s .45s ease-out; }
@keyframes c4-drop { from { transform: translateY(calc(var(--dr) * -115%)); } }
@keyframes c4-bounce { 40% { transform: translateY(-9%); } }

/* ---------- Ultimate Tic-Tac-Toe ---------- */
.uttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4cqw; padding: 2cqw; border-radius: 16px; background: #24211d; }
.ub { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1cqw; padding: 1.2cqw; border-radius: 12px; background: rgba(255, 255, 255, .04); transition: box-shadow .25s, background .25s; }
.ub.open { background: rgba(240, 199, 94, .1); box-shadow: inset 0 0 0 2px rgba(240, 199, 94, .55); }
.ub .cell { position: relative; border: 0; aspect-ratio: 1; border-radius: 6px; background: rgba(255, 255, 255, .07); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ub.done .cell { opacity: .3; }
.ub-win { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; animation: st-pop .4s; }
.ub-win .xo { font-size: 22cqw; }
.xo { font: 700 6cqw/1 var(--font); }
.xo.x { color: var(--c1); }
.xo.o { color: var(--c2); }

/* ---------- Gomoku ---------- */
.goban.bg-grid { gap: 0; padding: 1.5%; background: #d8b06a; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 14px 40px -18px #000; }
.goban .cell { border-radius: 0; background: none; }
.goban .cell::before, .goban .cell::after { content: ""; position: absolute; background: rgba(60, 40, 15, .75); pointer-events: none; }
.goban .cell::before { left: 0; right: 0; top: 50%; height: 1px; }
.goban .cell::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.goban .cell.eL::before { left: 50%; }
.goban .cell.eR::before { right: 50%; }
.goban .cell.eT::after { top: 50%; }
.goban .cell.eB::after { bottom: 50%; }
.goban .st { width: 92%; position: relative; z-index: 1; }
.goban .cell.last .st::after { content: ""; position: absolute; inset: 34%; border-radius: 50%; border: 2px solid #e4684f; }

/* ---------- Käsekästchen ---------- */
.dots { --dd: 2.6cqw; display: grid; padding: 3cqw; border-radius: 16px; background: #f1e8d6; }
.dots .dot { width: 100%; aspect-ratio: 1; border-radius: 50%; background: #3a3530; place-self: center; }
.dots .ln { position: relative; border: 0; padding: 0; border-radius: 99px; background: rgba(58, 53, 48, .08); cursor: pointer; transition: background .2s; }
.dots .ln::before { content: ""; position: absolute; }
.dots .ln.h::before { left: 0; right: 0; top: -1.6cqw; bottom: -1.6cqw; }
.dots .ln.v::before { top: 0; bottom: 0; left: -1.6cqw; right: -1.6cqw; }
.dots .ln.h { margin: 0 .3cqw; }
.dots .ln.v { margin: .3cqw 0; }
.dots .ln.on { cursor: default; }
.dots .ln.on.s0 { background: var(--c1); }
.dots .ln.on.s1 { background: var(--c2); }
.dots .ln.last { animation: st-pop .3s; }
.dots .bx { border-radius: 6px; margin: 1cqw; transition: background .3s; }
.dots .bx.s0 { background: color-mix(in srgb, var(--c1) 45%, transparent); animation: st-pop .35s; }
.dots .bx.s1 { background: color-mix(in srgb, var(--c2) 45%, transparent); animation: st-pop .35s; }

/* ---------- Hex ---------- */
.hexb { position: relative; }
.hexb .hx { position: absolute; border: 0; padding: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: #4a443c; transform: scale(.93); cursor: pointer; transition: background .25s; }
.hexb .hx.s0 { background: var(--c1); }
.hexb .hx.s1 { background: var(--c2); }
.hexb .hx.last { animation: st-pop .35s; filter: brightness(1.15); }
.hx-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hx-edges line { stroke-width: .16; stroke-linecap: round; }
.hx-edges .e0 { stroke: var(--c1); }
.hx-edges .e1 { stroke: var(--c2); }

/* ---------- Dame, Durchbruch, Amazonen ---------- */
.checker.bg-grid { gap: 0; padding: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 14px 40px -18px #000; }
.checker .cell { border-radius: 0; }
.checker .cell.lt { background: #ecdcc2; }
.checker .cell.dk { background: #ad8462; }
.checker.bg-grid .cell.last::before { inset: 0; border-radius: 0; box-shadow: inset 0 0 0 100cqw rgba(227, 184, 92, .3); }
.checker .cell.tgt::after { background: rgba(40, 32, 24, .35); }
.checker .cell.shot::after { content: ""; position: absolute; width: 26%; aspect-ratio: 1; border-radius: 50%; background: rgba(192, 86, 63, .6); }
.st.king { display: grid; place-items: center; }
.st.king::after { content: "♛"; font-size: 5.2cqw; line-height: 1; color: rgba(0, 0, 0, .55); }
.st.s1.king::after { color: rgba(255, 255, 255, .8); }
.st.pawn { width: 62%; }
.st.queen { width: 84%; display: grid; place-items: center; font-size: 5cqw; line-height: 1; color: rgba(0, 0, 0, .55); }
.st.s1.queen { color: rgba(255, 255, 255, .85); }
.arrow { width: 56%; aspect-ratio: 1; border-radius: 22%; background: repeating-linear-gradient(45deg, #5a4031 0 4px, #3e2b20 4px 8px); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .3); animation: st-pop .3s; }

/* ---------- Mühle ---------- */
.mill { border-radius: 18px; background: linear-gradient(135deg, #dcb979, #c39a5c); box-shadow: 0 14px 40px -18px #000; }
.mill svg { position: absolute; inset: 7%; width: 86%; height: 86%; overflow: visible; }
.mill line { stroke: #4a3520; stroke-width: .07; stroke-linecap: round; }
.mill .mp-pt { position: absolute; transform: translate(-50%, -50%); width: 11%; aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%; background: none; display: grid; place-items: center; cursor: pointer; }
.mill .mp-pt::after { content: ""; position: absolute; width: 26%; aspect-ratio: 1; border-radius: 50%; background: #4a3520; z-index: -1; }
.mill .mp-pt .st { width: 92%; }
.mill .mp-pt.tgt::after { width: 46%; background: rgba(74, 53, 32, .45); box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.mill .mp-pt.sel .st { box-shadow: 0 0 0 4px #f0c75e, 0 4px 10px rgba(0, 0, 0, .4); }
.mill .mp-pt.kill .st { animation: pulse 1s infinite; }

/* ---------- Fuchs und Gänse ---------- */
.foxb.bg-grid { background: #6f9067; gap: 4px; padding: 6px; }
.foxb .cell.off { visibility: hidden; }
.foxb .cell.pt { border-radius: 50%; background: rgba(255, 255, 255, .22); }
.foxb .fg { font-size: 8.5cqw; line-height: 1; }
.foxb .cell.last .fg { animation: st-pop .3s; }

/* ---------- Isola ---------- */
.isola.bg-grid { background: #26506e; gap: 5px; padding: 6px; }
.isola .cell.tile { background: #d9c39a; border-radius: 10px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15); transition: transform .35s var(--ease), opacity .35s; }
.isola .cell.gone { background: transparent; box-shadow: none; transform: scale(.5); opacity: 0; pointer-events: none; }
.isola .cell.kill { box-shadow: inset 0 0 0 3px rgba(228, 104, 79, .6), inset 0 -4px 0 rgba(0, 0, 0, .15); }
.st.big { width: 72%; }

/* ---------- Pentago ---------- */
.pentago { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; }
.pq { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.6cqw; padding: 3cqw; border-radius: 16%; background: linear-gradient(135deg, #b85a46, #94402f); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .15), 0 10px 24px -14px #000; }
.pq .cell { border-radius: 50%; background: rgba(0, 0, 0, .3); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .4); }
.pq.spin-cw { animation: pq-cw .55s var(--ease); }
.pq.spin-ccw { animation: pq-ccw .55s var(--ease); }
@keyframes pq-cw { from { transform: rotate(-90deg); } }
@keyframes pq-ccw { from { transform: rotate(90deg); } }
.pr { position: absolute; z-index: 2; width: 13cqw; height: 13cqw; border-radius: 50%; border: 0; background: #f0c75e; color: #2d2a26; font: 700 7cqw/1 var(--font); box-shadow: 0 4px 12px rgba(0, 0, 0, .45); cursor: pointer; animation: st-pop .3s; }
.pr.l { left: -2cqw; top: -2cqw; }
.pr.r { right: -2cqw; top: -2cqw; }

/* ---------- Schiffe versenken ---------- */
.ships { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; align-items: start; }
.bs-side { display: grid; gap: 1cqw; }
.bs-side > b { font: 600 1.8cqw/1.2 var(--font); color: var(--text-2); }
.bs-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 3px; border-radius: 10px; background: #1b3346; }
.bs { position: relative; border: 0; padding: 0; aspect-ratio: 1; border-radius: 3px; background: #2e5672; display: grid; place-items: center; }
button.bs { cursor: pointer; }
.bs.tgt:active { background: #3e6c8c; }
.bs.ship { background: #9aa3ab; }
.bs.miss::after { content: ""; width: 26%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.bs.hit { background: #d7835f; }
.bs.hit::after { content: "✕"; font: 700 2.1cqw/1 var(--font); color: #fff; }
.bs.sunk { background: #8e3b2b; }
.bs.last { box-shadow: 0 0 0 2px #f0c75e; z-index: 1; animation: st-pop .3s; }
.bs-setup { align-self: center; justify-items: center; text-align: center; gap: 2cqw; }
.bs-setup p { color: var(--text-2); font-size: 2.2cqw; }
.bs-wait { grid-column: 1 / -1; display: grid; place-items: center; min-height: 30cqw; color: var(--text-2); font-size: 2.6cqw; }

/* ---------- Memory ---------- */
.memo.bg-grid { background: transparent; gap: 1.6cqw; padding: 0; }
.memo .cell.card { perspective: 600px; background: none; border-radius: 12%; }
.memo .face, .memo .back { position: absolute; inset: 0; border-radius: 12%; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .4s var(--ease); }
.memo .back { background: repeating-linear-gradient(45deg, #5d7898 0 6px, #536d8b 6px 12px); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .15); }
.memo .face { background: #f4efe6; font-size: 7cqw; transform: rotateY(180deg); }
.memo .card.up .back { transform: rotateY(-180deg); }
.memo .card.up .face { transform: rotateY(0); }
.memo .card.done .face { box-shadow: inset 0 0 0 4px var(--c1); opacity: .8; }
.memo .card.done.s1 .face { box-shadow: inset 0 0 0 4px var(--c2); }
.memo .card.miss .face { box-shadow: inset 0 0 0 4px #e4684f; }

/* ---------- Echtzeit-Spiele ---------- */
.rtv { position: relative; display: flex; flex-direction: column; height: 100%; background: #0d0e11; color: #f1ece2; }
.rt-top { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 10px; padding: calc(8px + var(--sat)) calc(64px + var(--sar)) 8px calc(10px + var(--sal)); }
.rt-pl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rt-pl.p1 { justify-content: flex-end; }
.rt-pl b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--c1); box-shadow: 0 0 12px var(--c1); }
.p1 .rt-dot { background: var(--c2); box-shadow: 0 0 12px var(--c2); }
.rt-sc { font: 800 30px/1 var(--font-display); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; padding: 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.rt-sc.pop { animation: st-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.rt-mid { display: grid; justify-items: center; text-align: center; font-weight: 600; font-size: 14px; color: #cfc6b8; }
.rt-mid small { color: #8f877a; font-size: 12px; min-height: 15px; }
.rt-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.rt-stage canvas { position: absolute; inset: 0; display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rt-card { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 20px; background: rgba(10, 11, 14, .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade-in .3s; }
.rt-card[hidden] { display: none; }
.rt-card-in { width: min(460px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center; padding: 28px 24px; border-radius: 24px; background: #1d1b18; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 30px 80px -30px #000; animation: rise .45s var(--ease) both; }
.rt-card-in > b { font: 600 26px/1.2 var(--font-display); }
.rt-card-in p { color: #b5ac9e; }
.rt-card-in .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rt-trophy { font-size: 64px; animation: st-pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.rt-final { font: 800 54px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.rt-rotate { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: none; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: rgba(255, 255, 255, .1); color: #e8e1d6; font-size: 14px; white-space: nowrap; pointer-events: none; }
.rt-stage.portrait .rt-rotate { display: inline-flex; }
.rt-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; margin: 0; }
@media (max-width: 700px) { .rt-pl b { display: none; } .rt-sc { font-size: 24px; } }

/* ---------- Spielende-Animation (Duoplayer) ---------- */
.mp-fx { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; cursor: pointer; animation: mpfx-bg .35s ease both; -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.mp-fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mp-fx.win { background: radial-gradient(circle at 50% 45%, rgba(90,66,20,.82), rgba(16,14,12,.9) 62%); }
.mp-fx.lose { background: radial-gradient(circle at 50% 45%, rgba(60,64,78,.55), rgba(8,8,12,.86) 70%); }
.mp-fx.draw { background: radial-gradient(circle at 50% 45%, rgba(50,70,96,.85), rgba(16,14,12,.9) 65%); }
.mp-fx.out { animation: mpfx-out .35s ease both; }
.mp-fx-rays { position: absolute; width: 140vmax; height: 140vmax; left: 50%; top: 45%; translate: -50% -50%; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(rgba(240,199,94,.16) 0 10deg, transparent 10deg 24deg); border-radius: 50%;
  mask: radial-gradient(circle, #000 0 18%, transparent 58%); -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 58%); }
.mp-fx.win .mp-fx-rays { animation: mpfx-rays 8s linear infinite, mpfx-fade .6s .15s ease both; }
.mp-fx-card { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; color: #f6efe2; padding: 24px 32px; }
.mp-fx-card b { font: 600 clamp(44px, 9vw, 84px)/1 var(--font-display); letter-spacing: -.02em; text-shadow: 0 6px 30px rgba(0,0,0,.45); animation: mpfx-title .7s .15s cubic-bezier(.2,1.4,.4,1) both; }
.mp-fx-card small { font-size: clamp(15px, 2.4vw, 19px); color: rgba(246,239,226,.8); animation: mpfx-fade .5s .45s ease both; }
.mp-fx-tap { margin-top: 18px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(246,239,226,.45); animation: mpfx-fade .5s 1.2s ease both; }
.mp-fx-glyph { font-size: clamp(76px, 15vw, 132px); line-height: 1; filter: drop-shadow(0 10px 30px rgba(0,0,0,.4)); }
.mp-fx.win .mp-fx-glyph { animation: mpfx-trophy .9s cubic-bezier(.2,1.5,.4,1) both, mpfx-bob 2.2s 1s ease-in-out infinite; }
.mp-fx.win .mp-fx-card b { background: linear-gradient(90deg, #f0c75e, #fff3c4, #f0c75e); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: mpfx-title .7s .15s cubic-bezier(.2,1.4,.4,1) both, mpfx-shine 2.4s 1s linear infinite; }
.mp-fx.lose .mp-fx-glyph { animation: mpfx-drop .8s cubic-bezier(.3,1.6,.5,1) both, mpfx-shake .5s .8s ease both; }
.mp-fx.lose .mp-fx-card b { color: #c9ccd6; }
.mp-fx.draw .mp-fx-glyph { animation: mpfx-trophy .8s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes mpfx-bg { from { opacity: 0; } }
@keyframes mpfx-out { to { opacity: 0; transform: scale(1.04); } }
@keyframes mpfx-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
@keyframes mpfx-rays { to { rotate: 360deg; } }
@keyframes mpfx-title { from { opacity: 0; transform: scale(.4) translateY(20px); } }
@keyframes mpfx-trophy { 0% { opacity: 0; transform: scale(.2) rotate(-25deg); } 60% { transform: scale(1.18) rotate(8deg); } 100% { opacity: 1; transform: none; } }
@keyframes mpfx-bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
@keyframes mpfx-shine { to { background-position: -200% 0; } }
@keyframes mpfx-drop { from { opacity: 0; transform: translateY(-60vh); } }
@keyframes mpfx-shake { 20%, 60% { transform: translateX(-12px) rotate(-6deg); } 40%, 80% { transform: translateX(12px) rotate(6deg); } }
/* Neuer Rekord (Singleplayer): blau-violett mit Gold */
.mp-fx.record { background: radial-gradient(circle at 50% 45%, rgba(58,52,128,.85), rgba(12,12,22,.92) 64%); }
.mp-fx.record .mp-fx-rays { background: repeating-conic-gradient(rgba(150,170,255,.16) 0 9deg, transparent 9deg 22deg); animation: mpfx-rays 10s linear infinite reverse, mpfx-fade .6s .15s ease both; }
.mp-fx.record .mp-fx-glyph { animation: mpfx-star 1s cubic-bezier(.2,1.5,.4,1) both, mpfx-bob 2.2s 1.1s ease-in-out infinite; filter: drop-shadow(0 0 28px rgba(240,199,94,.55)); }
.mp-fx.record .mp-fx-card b { background: linear-gradient(90deg, #f0c75e, #fff6d8, #b9c6ff, #f0c75e); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: mpfx-title .7s .15s cubic-bezier(.2,1.4,.4,1) both, mpfx-shine 2.4s 1s linear infinite; }
.mp-fx-chip { margin-top: 8px; padding: 6px 16px; border-radius: 99px; font: 700 clamp(17px, 2.8vw, 22px)/1.2 var(--font-display); font-style: normal; color: #2a2108; background: linear-gradient(180deg, #ffe08a, #e9b949); box-shadow: 0 6px 24px rgba(240,199,94,.45); animation: mpfx-chip .6s .75s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes mpfx-star { 0% { opacity: 0; transform: scale(.1) rotate(-180deg); } 65% { transform: scale(1.25) rotate(15deg); } 100% { opacity: 1; transform: none; } }
@keyframes mpfx-chip { from { opacity: 0; transform: scale(.3); } }
@media (prefers-reduced-motion: reduce) { .mp-fx *, .mp-fx { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }

/* ---------- Ruhemodus ---------- */
.quiet {
  position: fixed; inset: 0; z-index: 8900; display: grid; place-items: center; overflow: hidden;
  padding: calc(24px + var(--sat)) calc(20px + var(--sar)) calc(24px + var(--sab)) calc(20px + var(--sal));
  background: radial-gradient(1200px 700px at 20% 0%, #2a2520, transparent 60%), radial-gradient(900px 600px at 100% 100%, #231f1b, transparent 60%), #151310;
  color: #f1ece2; touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  animation: quiet-in .5s var(--ease) both;
}
@keyframes quiet-in { from { opacity: 0; transform: scale(1.02); } }
.quiet::before { content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; left: 50%; top: 40%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(227, 184, 92, .09), transparent 65%); animation: quiet-breathe 8s ease-in-out infinite; pointer-events: none; }
@keyframes quiet-breathe { 50% { transform: translate(-50%, -50%) scale(1.15); opacity: .6; } }
.quiet-inner { position: relative; width: min(900px, 100%); display: grid; gap: clamp(18px, 3.5vh, 34px); }
.quiet-top { display: flex; align-items: center; justify-content: space-between; }
.quiet-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: #d9cfbf; font-weight: 600; font-size: 14px; }
.quiet-clock { font: 600 22px/1 var(--font-mono); color: #b9b0a2; font-variant-numeric: tabular-nums; }
.quiet-main { display: grid; gap: 14px; animation: rise .6s .1s var(--ease) both; }
.quiet-label { font: 600 clamp(22px, 3vw, 30px)/1.2 var(--font-display); }
.quiet-label small { display: block; font: 500 16px/1.4 var(--font); color: #a69d8f; margin-top: 4px; }
.quiet-left { font: 600 clamp(72px, 15vw, 160px)/.95 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; }
.quiet-bar { height: 16px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.quiet-bar > div { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #e3b85c, #d7835f); transition: width .25s linear; box-shadow: 0 0 18px rgba(227, 184, 92, .45); }
.quiet-meta { display: flex; justify-content: space-between; color: #a69d8f; font-size: 15px; }
.quiet-meta b { color: #f1ece2; font-size: 18px; }
.quiet-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.quiet-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); animation: rise .5s calc(.25s + var(--i) * .08s) var(--ease) both; }
.quiet-card .i { flex: none; color: #e3b85c; margin-top: 2px; }
.quiet-card small { display: block; color: #a69d8f; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.quiet-card b { font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.quiet-hold { justify-self: center; position: relative; width: 88px; height: 88px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .07); color: #f1ece2; display: grid; place-items: center; cursor: pointer; touch-action: none; transition: transform .2s, background .2s; }
.quiet-hold .i { width: 30px; height: 30px; }
.quiet-hold svg:not(.i) { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.quiet-hold circle { fill: none; stroke-width: 4; }
.quiet-hold .trk { stroke: rgba(255, 255, 255, .12); }
.quiet-hold .val { stroke: #e3b85c; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--k, 0) * 100); }
.quiet-hold.holding { transform: scale(.93); background: rgba(227, 184, 92, .16); }
.quiet-hint { text-align: center; color: #8f877a; font-size: 13.5px; margin-top: -12px; }
.quiet-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
body.quiet-on .panic-btn { z-index: 9001; }
@media (max-height: 700px) { .quiet-cards .quiet-card:nth-child(n+4) { display: none; } }

/* ---------- Lerngruppe ---------- */
.learn-hero { display: flex; align-items: center; gap: 20px; justify-content: space-between; padding: 26px 28px; border-radius: var(--r-xl); margin-bottom: 18px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.learn-hero h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 10px; }
.learn-hero p { color: var(--text-2); margin-top: 6px; max-width: 560px; }
@media (max-width: 700px) { .learn-hero { flex-direction: column; align-items: flex-start; padding: 22px; } }
.learn-list { display: grid; gap: 14px; }
.learn-topic { padding: 18px 20px; border-left: 4px solid transparent; }
.learn-topic.hot { border-left-color: var(--red); }
.learn-topic.warm { border-left-color: var(--amber); }
.learn-topic.past { opacity: .75; }
.learn-head { display: flex; align-items: flex-start; gap: 14px; }
.learn-head h3 { font: 600 20px/1.25 var(--font-display); }
.learn-date { width: 56px; height: 60px; flex: none; border-radius: 14px; background: var(--inset); border: 1px solid var(--border); display: grid; place-items: center; align-content: center; text-align: center; color: var(--text-2); }
.learn-date b { display: block; font: 600 24px/1 var(--font-display); color: var(--text); }
.learn-date small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.learn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.learn-tools { display: flex; gap: 2px; }
.learn-text { position: relative; margin-top: 12px; padding: 12px 40px 10px 14px; border-radius: 14px; background: var(--inset); border: 1px solid var(--border); }
.learn-text-body { line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.learn-text small { display: block; margin-top: 6px; font-size: 12px; }
.link { border: 0; background: none; padding: 0; color: var(--text-2); text-decoration: underline; font: inherit; cursor: pointer; }
.learn-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.learn-img { position: relative; }
.learn-img button[data-view] { display: block; width: 100%; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--inset); cursor: zoom-in; }
.learn-img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s var(--ease); }
.learn-img button[data-view]:active img { transform: scale(1.04); }
.learn-files { display: grid; gap: 6px; margin-top: 12px; }
.learn-file { position: relative; }
.learn-file a { display: flex; align-items: center; gap: 12px; padding: 10px 44px 10px 10px; border-radius: 13px; border: 1px solid var(--border); background: var(--card); color: var(--text); text-decoration: none; }
.learn-file b { display: block; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.learn-file small { color: var(--text-3); font-size: 12px; }
.lf-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font: 700 11px/1 var(--font); color: var(--text-2); letter-spacing: .04em; }
.lf-ico.pdf { background: color-mix(in srgb, var(--red) 14%, var(--card)); color: var(--red); }
.learn-x { position: absolute; top: 6px; right: 6px; z-index: 2; width: 32px; height: 32px; border-radius: 10px; border: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--text-3); cursor: pointer; }
.learn-file .learn-x { top: 50%; transform: translateY(-50%); }
.learn-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.learn-empty { margin-top: 12px; font-size: 14px; }
.learn-past-btn { display: inline-flex; align-items: center; gap: 6px; margin: 22px 0 12px; border: 0; background: none; color: var(--text-2); font: 600 14px var(--font); cursor: pointer; padding: 6px 0; }
.learn-ta { min-height: 220px; resize: vertical; line-height: 1.5; }
.learn-when .field { min-width: 0; }
@media (prefers-reduced-motion: reduce) { .enter *, .quiet-card, .splash * { animation-delay: 0s !important; } }

/* Lerngruppe: wer hat was hochgeladen */
.avatar.xs { width: 20px; height: 20px; border-radius: 7px; font-size: 9px; }
.learn-by { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; color: var(--text-2); font-weight: 500; }
.learn-sec { margin: 14px 0 -4px; }
.learn-img { margin: 0; }
.learn-img figcaption { margin-top: 4px; font-size: 12px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Vier Reiter (Singleplayer, Duoplayer, 3–4 Spieler, Rangliste) passen auch auf schmale Bildschirme nebeneinander */
/* Platz hängt vom Inhaltsbereich ab (mit Seitenleiste schmaler als das Fenster) */
.games-switch { container-type: inline-size; }
@container (max-width: 720px) {
  .games-switch .seg { flex-wrap: nowrap; width: 100%; }
  .games-switch .seg button { flex: 1 1 auto; min-width: 0; padding: 0 6px; gap: 5px; font-size: 13px; justify-content: center; white-space: nowrap; }
  .games-switch .seg small { display: none; }
}
@media (max-width: 480px) { .games-switch .seg button { font-size: 11.5px; padding: 0 3px; height: 42px; } .games-switch .seg button svg { display: none; } }

/* Echtzeit-Spiele für 3–4 Spieler */
.rt-top-n { grid-template-columns: auto 1fr auto auto; }
.rt-pls { display: flex; gap: 8px; min-width: 0; overflow: hidden; }
.rt-pls .rt-pl { gap: 6px; padding: 3px 4px 3px 8px; border-radius: 14px; background: rgba(255, 255, 255, .04); min-width: 0; }
.rt-pls .rt-dot, .rt-who .rt-dot { background: var(--pc); box-shadow: 0 0 10px var(--pc); }
.rt-pls .rt-pl b { font-size: 13.5px; max-width: 110px; }
.rt-pls .rt-sc { font-size: 22px; min-width: 28px; padding: 4px 8px; }
.rt-who { list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: 6px; text-align: left; }
.rt-who li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.rt-who li small { margin-left: auto; opacity: .7; }
.rt-who li.ok small { color: #7cc46a; opacity: 1; }
.rt-who .rt-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mp-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .rt-pls .rt-pl b { display: none; } .rt-pls .rt-sc { font-size: 18px; } }

/* Admin-Bereich freischalten (Helfer wie Jonas) */
.admin-unlock { max-width: 420px; margin: 24px auto; padding: 28px 24px; display: grid; gap: 12px; text-align: center; justify-items: center; }
.admin-unlock h2 { margin: 0; }
.admin-unlock p { margin: 0; font-size: 14px; }
.admin-unlock .input { width: 100%; text-align: center; }
.admin-unlock .btn { width: 100%; justify-content: center; }
.admin-unlock-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.admin-unlock-ico svg { width: 26px; height: 26px; }
.admin-unlock-err { min-height: 18px; color: var(--danger, #c0392b); font-size: 13px; font-weight: 600; }

/* Brettspiele zu viert: alle anderen oben nebeneinander */
.mpv-player.multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.mpv-player.multi .mpv-pl { padding: 6px 8px 6px 10px; min-width: 0; }
.mpv-player.multi .mpv-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Server-Anzeige oben rechts und Hinweis bei Ausfall */
.tb-server { position: relative; }
.tb-server .srv-dot, .srv-big .srv-dot { position: absolute; right: 7px; bottom: 7px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface, #fff); background: #4caf6a; }
.tb-server.reconnecting .srv-dot, .srv-info.reconnecting .srv-dot { background: #e9b949; animation: srvBlink 1s ease-in-out infinite; }
.tb-server.offline .srv-dot, .srv-info.offline .srv-dot { background: #e4684f; }
.tb-server.offline { color: #e4684f; }
@keyframes srvBlink { 50% { opacity: .35; } }
.srv-banner { position: fixed; z-index: 900; left: 50%; translate: -50% 0; bottom: calc(24px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 16px; background: #3a1d17; color: #ffe9e3; border: 1px solid rgba(228, 104, 79, .6); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: fade-up .25s var(--ease); }
.srv-banner[hidden] { display: none; }
.srv-banner > svg { flex: none; width: 22px; height: 22px; color: #ff9a82; }
.srv-banner .grow { min-width: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; }
.srv-banner b { display: block; font-size: 14.5px; }
.srv-banner span { display: block; font-size: 12.5px; opacity: .85; line-height: 1.35; }
.srv-banner .btn { flex: none; }
@media (max-width: 900px) { .srv-banner { bottom: calc(92px + env(safe-area-inset-bottom)); } }
.srv-info { display: grid; justify-items: center; text-align: center; gap: 8px; }
.srv-info p { margin: 0; color: var(--text-2); }
.srv-big { position: relative; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); }
.srv-big svg { width: 30px; height: 30px; }
.srv-big .srv-dot { right: 10px; bottom: 10px; width: 14px; height: 14px; }

/* Sperr-Bildschirm (Wartung / Verbindung vom Administrator unterbrochen) */
.gate { position: fixed; inset: 0; z-index: 990; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade-in .25s; }
.gate[hidden] { display: none; }
.gate-card { width: min(440px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px 24px; border-radius: 24px; background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.gate-card h2 { margin: 4px 0 0; font-size: 22px; }
.gate-card p { margin: 0; color: var(--text-2); line-height: 1.5; }
.gate-card .gate-why { padding: 8px 12px; border-radius: 12px; background: var(--inset); }
.gate-card .row { gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.gate-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--inset); color: var(--text-2); }
.gate-ico svg { width: 30px; height: 30px; }
.gate-ico.cut { background: rgba(212, 112, 91, .15); color: var(--red); }
body.gated .tabbar { display: none; }

/* Hinweis-Banner für alle (vom Administrator) */
.class-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 10px 12px 16px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--card); line-height: 1.45; animation: fade-up .25s var(--ease); }
.class-banner > svg { flex: none; width: 20px; height: 20px; }
.class-banner.info > svg { color: var(--cyan); }
.class-banner.warn { background: color-mix(in srgb, var(--amber) 16%, var(--card)); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.class-banner.warn > svg { color: var(--amber); }
.class-banner.good { background: color-mix(in srgb, var(--green) 16%, var(--card)); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.class-banner.good > svg { color: var(--green); }
.class-banner .grow { white-space: pre-wrap; }

/* Chat: angepinnte Nachricht */
.chat-head.has-pin { flex-wrap: wrap; padding-bottom: 10px; }
.chat-pin { flex: 1 0 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--inset); color: var(--text-2); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.chat-pin .grow { display: grid; min-width: 0; }
.chat-pin b { font-size: 12px; color: var(--text); }
.chat-pin span span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Farbe der Klasse (vom Administrator) */
:root[data-accent="blue"] { --accent: #2f5f9e; --grad: #2f5f9e; --on-accent: #fff; }
:root[data-accent="green"] { --accent: #3d7a4f; --grad: #3d7a4f; --on-accent: #fff; }
:root[data-accent="teal"] { --accent: #26727a; --grad: #26727a; --on-accent: #fff; }
:root[data-accent="violet"] { --accent: #6a4c9c; --grad: #6a4c9c; --on-accent: #fff; }
:root[data-accent="red"] { --accent: #b04436; --grad: #b04436; --on-accent: #fff; }
:root[data-accent="orange"] { --accent: #b8661f; --grad: #b8661f; --on-accent: #fff; }
:root[data-accent="pink"] { --accent: #b04a7a; --grad: #b04a7a; --on-accent: #fff; }
:root[data-theme="dark"][data-accent="blue"] { --accent: #8db4e8; --grad: #8db4e8; --on-accent: #14202f; }
:root[data-theme="dark"][data-accent="green"] { --accent: #93cfa2; --grad: #93cfa2; --on-accent: #14261a; }
:root[data-theme="dark"][data-accent="teal"] { --accent: #85cbd2; --grad: #85cbd2; --on-accent: #10282b; }
:root[data-theme="dark"][data-accent="violet"] { --accent: #bca5e6; --grad: #bca5e6; --on-accent: #241a36; }
:root[data-theme="dark"][data-accent="red"] { --accent: #ee9a8c; --grad: #ee9a8c; --on-accent: #33140f; }
:root[data-theme="dark"][data-accent="orange"] { --accent: #f0b47a; --grad: #f0b47a; --on-accent: #33200c; }
:root[data-theme="dark"][data-accent="pink"] { --accent: #eca1c3; --grad: #eca1c3; --on-accent: #331526; }
.accent-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-pick button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.accent-pick button.on { box-shadow: 0 0 0 2px var(--text); }
.accent-pick i { width: 18px; height: 18px; border-radius: 50%; }

/* Admin: neue Bereiche */
.adm-who { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.adm-who .txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.adm-who .row { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.adm-log { display: grid; gap: 2px; }
.adm-log div { display: grid; grid-template-columns: 130px 110px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.adm-log time { color: var(--text-3); }
@media (max-width: 640px) { .adm-log div { grid-template-columns: 1fr; gap: 0; } }
.adm-time { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.adm-time .input { width: auto; }
.adm-words { width: 100%; min-height: 90px; }
.adm-rec { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.adm-rec .grow { min-width: 0; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.sub { padding-top: 0; border-top: 0; }
.row.wrap-end { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.set-row[hidden] { display: none; }
.class-banner { margin-right: 52px; }

/* ---------- Barrikade ---------- */
.bk-board { width: 100%; height: 100%; display: block; border-radius: 14px; background: var(--inset); touch-action: manipulation; }
.bk-cell { fill: var(--card); }
.bk-cell.goal { fill: color-mix(in srgb, var(--text) 18%, var(--card)); }
.bk-crown { font-size: 6px; text-anchor: middle; fill: var(--text); pointer-events: none; }
.bk-wall { transition: opacity .2s; }
.bk-wall.last { filter: drop-shadow(0 0 .8px rgba(0, 0, 0, .55)); }
.bk-wall.pre { opacity: .55; }
.bk-wall.pre.bad { fill: #888 !important; opacity: .35; }
.bk-hot { opacity: .35; cursor: pointer; animation: bkPulse 1.2s ease-in-out infinite; }
@keyframes bkPulse { 50% { opacity: .6; } }
.bk-trace { fill: rgba(0, 0, 0, .15); }
.bk-shadow { fill: rgba(0, 0, 0, .18); }
.bk-pawn.turn circle:last-child { stroke: #fff; stroke-width: .7; }
.bk-board.walling { cursor: crosshair; }
.bk-panel { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bk-panel .btn[disabled] { opacity: .5; }
.adm-sub { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 14px 0 6px; }
.adm-sub:first-child { margin-top: 0; }
.adm-room { display: flex; align-items: center; gap: 12px; }
.adm-room > span:last-child { display: grid; }

/* ---------- Karteikarten ---------- */
.learn-decks { display: grid; gap: 8px; }
.learn-deck { position: relative; display: grid; gap: 2px; }
.ld-main { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 44px 12px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--inset); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .15s var(--ease), border-color .15s; }
.ld-main:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.ld-main .grow { display: grid; min-width: 0; }
.ld-main .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-main small { color: var(--text-3); font-size: 12.5px; }
.ld-stack { position: relative; width: 42px; height: 34px; flex: none; }
.ld-stack > * { position: absolute; inset: 0; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--card); }
.ld-stack > span:nth-child(1) { transform: rotate(-8deg) translate(-3px, 2px); }
.ld-stack > span:nth-child(2) { transform: rotate(5deg) translate(3px, 1px); }
.ld-stack b { display: grid; place-items: center; font-size: 14px; background: var(--accent); color: var(--on-accent); border: 0; }
.ld-edit { justify-self: start; margin-left: 12px; font-size: 12.5px; }
.learn-deck .learn-x { top: 10px; }
.cards-rows { display: grid; gap: 10px; margin: 10px 0; max-height: 52vh; overflow: auto; padding-right: 4px; }
.cards-row { display: grid; grid-template-columns: 26px 1fr 1fr 36px; gap: 8px; align-items: start; }
.cards-row textarea { min-height: 54px; resize: vertical; }
.cards-n { font-weight: 700; color: var(--text-3); padding-top: 12px; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .cards-row { grid-template-columns: 22px 1fr 32px; } .cards-row [data-a] { grid-column: 2; grid-row: 2; } .cards-row [data-rm] { grid-row: 1; grid-column: 3; } }
.study { display: grid; gap: 16px; }
.study-top { display: grid; gap: 6px; }
.study-bar { height: 6px; border-radius: 3px; background: var(--inset); overflow: hidden; }
.study-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.study-card { position: relative; display: block; width: 100%; min-height: 230px; border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; perspective: 1200px; -webkit-tap-highlight-color: transparent; }
.study-face { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 24px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--card); box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .45s var(--ease); font-size: clamp(17px, 2.6vw, 22px); line-height: 1.45; text-align: center; overflow: auto; }
.study-face small { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.study-face.back { transform: rotateY(180deg); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.study-card.flip .front { transform: rotateY(-180deg); }
.study-card.flip .back { transform: rotateY(0); }
.study-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.study-actions .btn { min-width: 150px; justify-content: center; }
.study-done { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 18px 0; }
.study-big { font-size: 54px; }
.wrap-center { flex-wrap: wrap; justify-content: center; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .study-face { transition: none; } }

/* ---------- Level-Schild, Level-Aufstieg ---------- */
.lvl { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 1.5; letter-spacing: .02em; vertical-align: 1px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lvl-bar { height: 8px; border-radius: 4px; background: var(--inset); overflow: hidden; }
.lvl-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #f0c75e)); }
.prof-lvl { display: grid; gap: 4px; margin: 10px 0 4px; }
.prof-lvl small { font-size: 12px; }
.lvl-up { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; background: rgba(0, 0, 0, .35); animation: fade-up .2s var(--ease); cursor: pointer; }
.lvl-up-card { display: grid; justify-items: center; gap: 4px; padding: 28px 40px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-lg); animation: lvlPop .5s cubic-bezier(.2, 1.6, .4, 1); }
.lvl-up-card span { font-size: 56px; animation: lvlSpin 1.2s ease-in-out; }
.lvl-up-card b { font-family: var(--font-display); font-size: 30px; }
@keyframes lvlPop { from { transform: scale(.4); opacity: 0; } }
@keyframes lvlSpin { 50% { transform: rotate(20deg) scale(1.25); } }

/* ---------- Pausieren ---------- */
.adm-pause { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--inset); }
.adm-pause.on { border-color: color-mix(in srgb, #e9a92b 60%, var(--border)); background: color-mix(in srgb, #e9a92b 12%, var(--card)); }
.adm-pause-ico { font-size: 28px; }
.adm-pause .txt { display: grid; gap: 2px; min-width: 200px; }
.adm-pause .txt span { color: var(--text-2); font-size: 13.5px; }
.seg-like { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-like label { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--inset); cursor: pointer; }
.pause-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 40vh; overflow: auto; }
.pause-p { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.pause-p:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ==========================================================
   Events: Disco-Design (nur während eines Events, nicht abschaltbar)
   ========================================================== */
.nav-count { margin-left: auto; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #ff4fa3, #b46bff); color: #fff; animation: evPulse 1.6s ease-in-out infinite; }
.nav-count:empty { display: none; }
.tab .nav-count { position: absolute; top: 2px; right: calc(50% - 30px); padding: 0 5px; font-size: 9.5px; }
.nav-item[data-go="event"], .tab[data-go="event"] { color: #ff4fa3; font-weight: 700; }
@keyframes evPulse { 50% { filter: brightness(1.25); transform: scale(1.06); } }

html.disco body { background: radial-gradient(1200px 700px at 15% -10%, rgba(255, 79, 163, .28), transparent 60%),
  radial-gradient(1000px 700px at 110% 10%, rgba(79, 209, 255, .22), transparent 60%),
  radial-gradient(900px 600px at 50% 120%, rgba(180, 107, 255, .3), transparent 60%), #120f1c; background-attachment: fixed; }
html.disco[data-theme] { --bg: #120f1c; --accent: #ff4fa3; --on-accent: #fff; }
html.disco #sidebar { background: rgba(20, 14, 34, .82); backdrop-filter: blur(10px); }
html.disco .card, html.disco .arcade-hero { box-shadow: 0 0 0 1px rgba(255, 79, 163, .18), 0 10px 30px rgba(0, 0, 0, .35); }
html.disco .btn.primary { background: linear-gradient(90deg, #ff4fa3, #b46bff); border-color: transparent; color: #fff; }
html.disco [data-theme-toggle] { opacity: .35; }
.disco-fx { position: fixed; inset: 0; z-index: 900; pointer-events: none; overflow: hidden; }
.disco-fx .beam { position: absolute; top: -20vh; width: 34vmax; height: 140vh; transform-origin: 50% 0; mix-blend-mode: screen; opacity: .16; filter: blur(14px);
  background: linear-gradient(180deg, var(--bc), transparent 85%); clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); }
.disco-fx .b1 { --bc: #ff4fa3; left: 5%; animation: beam 7s ease-in-out infinite alternate; }
.disco-fx .b2 { --bc: #4fd1ff; left: 30%; animation: beam 9s ease-in-out -3s infinite alternate-reverse; }
.disco-fx .b3 { --bc: #7cff6b; left: 55%; animation: beam 8s ease-in-out -1s infinite alternate; }
.disco-fx .b4 { --bc: #ffd34f; left: 78%; animation: beam 10s ease-in-out -5s infinite alternate-reverse; }
@keyframes beam { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
.disco-ball { position: absolute; top: -6px; right: 86px; font-size: 44px; transform-origin: 50% -40px; animation: ballSwing 3.4s ease-in-out infinite alternate; filter: drop-shadow(0 0 14px rgba(255, 255, 255, .45)); }
@keyframes ballSwing { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.disco-fx .confetti { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 899px) { .disco-ball { display: none; } .disco-fx .beam { opacity: .1; } }
@media (prefers-reduced-motion: reduce) { .disco-fx .beam, .disco-ball, .nav-count { animation: none; } }

/* ---------- Event-Seite ---------- */
.ev-page { display: grid; gap: 18px; }
.ev-hero { border-radius: 22px; padding: 20px 22px; color: #fff; background: linear-gradient(120deg, #ff4fa3, #b46bff 45%, #4fd1ff); background-size: 200% 200%; animation: evGrad 8s ease infinite; box-shadow: 0 12px 40px rgba(180, 107, 255, .35); }
@keyframes evGrad { 50% { background-position: 100% 50%; } }
.ev-hero-in { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ev-hero h2 { margin: 6px 0 2px; font-family: var(--font-display); font-size: clamp(22px, 3.4vw, 32px); }
.ev-hero p { margin: 0; opacity: .92; }
.ev-hero .chip { background: rgba(255, 255, 255, .22); color: #fff; border: 0; }
.ev-hero .faint { color: rgba(255, 255, 255, .85); }
.ev-emoji { font-size: 52px; animation: ballSwing 2.4s ease-in-out infinite alternate; }
.ev-hero-btns { display: flex; gap: 8px; align-items: center; }
.ev-hero .btn { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .35); color: #fff; }
.ev-hero .btn.primary, .ev-join { background: #fff !important; color: #b0337a !important; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.ev-join { animation: evPulse 1.4s ease-in-out infinite; }
.ev-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 999px) { .ev-grid { grid-template-columns: 1fr; } }
.ev-stage { min-height: 380px; display: grid; }
.ev-stage.playing { padding: 14px; }
.ev-center { display: grid; justify-items: center; align-content: center; gap: 10px; text-align: center; padding: 18px 8px; }
.ev-center h2 { margin: 0; font-family: var(--font-display); }
.ev-center p { margin: 0; max-width: 520px; }
.ev-big { font-size: 64px; line-height: 1; }
.ev-pop { animation: lvlPop .6s cubic-bezier(.2, 1.6, .4, 1); }
.ev-bounce { animation: ballSwing 1s ease-in-out infinite alternate; }
.ev-go { font-size: 18px; }
.ev-go b { font-size: 26px; color: var(--accent); }
.ev-mode { font-weight: 700; }
.ev-games { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.ev-teams { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ev-team { display: grid; gap: 2px; min-width: 130px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--tc); background: color-mix(in srgb, var(--tc) 14%, var(--card)); }
.ev-team b { color: var(--tc); }
.ev-team.mine { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 40%, transparent); }
.ev-res { display: grid; gap: 6px; width: min(520px, 100%); }
.ev-res-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--inset); border-left: 5px solid var(--tc, var(--border-strong)); text-align: left; }
.ev-res-row.mine { outline: 2px solid var(--accent); }
.ev-res-row .grow { display: grid; min-width: 0; }
.ev-res-row small { color: var(--text-3); }
.ev-place { font-size: 22px; width: 32px; text-align: center; }
.ev-score { font-variant-numeric: tabular-nums; }
.ev-gain { color: #2f9e6e; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.ev-board .lb-list li.away { opacity: .55; }
.ev-h { margin: 0 0 10px; font-size: 16px; }

/* ---------- Party-Minispiele ---------- */
.pg-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 4px 12px; }
.pg-top > :first-child { margin-right: auto; }
.pg-score b { font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums; }
.pg-time { padding: 4px 12px; border-radius: 99px; background: var(--inset); font-weight: 700; font-size: 18px; }
.pg-area { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 16px; min-height: 320px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pg-area button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; font: inherit; color: inherit; cursor: pointer; }
.shake { animation: pgShake .3s; }
@keyframes pgShake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pop { animation: pgPop .25s var(--ease); }
@keyframes pgPop { from { transform: scale(.85); opacity: .4; } }
.pg-big-btn { justify-self: center; width: min(280px, 70vw); aspect-ratio: 1; border-radius: 50%; border: 0; font-size: 40px !important; font-weight: 800; color: #fff !important;
  background: radial-gradient(circle at 35% 30%, #ff8ac4, #ff4fa3 55%, #b0337a); box-shadow: 0 12px 0 #7a1f53, 0 20px 40px rgba(0, 0, 0, .35); }
.pg-big-btn.hit { animation: pgPress .12s; }
@keyframes pgPress { 50% { transform: translateY(8px) scale(.97); box-shadow: 0 4px 0 #7a1f53; } }
.pg-react { min-height: 260px; border: 0; border-radius: 22px; display: grid; place-content: center; gap: 6px; color: #fff !important; font-size: 30px !important; transition: background .1s; }
.pg-react small { font-size: 14px; opacity: .85; }
.pg-react.wait { background: #c0392b; } .pg-react.go { background: #27ae60; } .pg-react.early { background: #8e44ad; } .pg-react.hit, .pg-react.done { background: #2c3e50; }
.pg-times { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pg-times span { padding: 4px 10px; border-radius: 99px; background: var(--inset); font-variant-numeric: tabular-nums; }
.pg-times .bad { color: #e4684f; }
.pg-word, .pg-task { text-align: center; font-size: clamp(40px, 8vw, 64px); font-weight: 800; letter-spacing: .02em; }
.pg-opts { display: grid; gap: 10px; }
.pg-opts.four { grid-template-columns: repeat(2, 1fr); }
.pg-opts.two { grid-template-columns: repeat(2, 1fr); }
.pg-opts button { min-height: 64px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--card); font-size: 22px !important; font-weight: 700; box-shadow: 0 4px 0 var(--border-strong); }
.pg-opts button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--border-strong); }
.pg-opts button.ok { background: #27ae60; color: #fff !important; } .pg-opts button.bad { background: #c0392b; color: #fff !important; }
.pg-vs button { min-height: 160px; font-size: clamp(28px, 6vw, 44px) !important; }
.pg-odd { display: grid; gap: 6px; width: min(460px, 100%); justify-self: center; }
.pg-odd button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-size: clamp(20px, 4.4vw, 34px) !important; padding: 0; }
.pg-simon-msg { text-align: center; font-size: 20px; font-weight: 700; }
.pg-simon { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: min(340px, 80vw); justify-self: center; }
.pg-simon button { aspect-ratio: 1; border-radius: 22px; border: 0; background: var(--pc); opacity: .45; transition: opacity .1s, transform .1s; }
.pg-simon button.on { opacity: 1; transform: scale(1.05); box-shadow: 0 0 30px var(--pc); }
.pg-balloon { display: grid; justify-items: center; gap: 4px; min-height: 230px; align-content: end; }
.pg-bal { line-height: 1; transition: font-size .15s cubic-bezier(.2, 1.6, .4, 1); }
.pg-bal-v { font-size: 26px; }
.pg-aim { position: relative; height: 380px; border-radius: 18px; background: repeating-radial-gradient(circle at 50% 50%, var(--inset) 0 30px, var(--card) 30px 60px); overflow: hidden; }
.pg-aim.miss { box-shadow: inset 0 0 0 4px #c0392b; }
.pg-target { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 0; border-radius: 50%; background: none; font-size: 50px !important; line-height: 1; padding: 0; animation: pgPop .2s var(--ease); }
.pg-target.hit { transform: scale(1.5); opacity: 0; transition: .15s; }
.pg-dots { position: relative; height: 260px; border-radius: 18px; background: var(--inset); display: grid; place-items: center; }
.pg-dots span { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.pg-dots-msg { font-size: 22px; }
.login-tag { font-weight: 600; color: var(--accent) !important; margin-bottom: 2px !important; }
.home-ev { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 16px; padding: 14px 18px; border: 0; border-radius: 18px; color: #fff; font: inherit; text-align: left; cursor: pointer;
  background: linear-gradient(120deg, #ff4fa3, #b46bff 50%, #4fd1ff); background-size: 200% 200%; animation: evGrad 8s ease infinite; box-shadow: 0 10px 30px rgba(180, 107, 255, .35); }
.home-ev > span:first-child { font-size: 34px; }
.home-ev .grow { display: grid; }
.home-ev small { opacity: .9; }
.home-ev > b { font-size: 20px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .ev-hero { padding: 16px; }
  .ev-hero-in { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
  .ev-emoji { font-size: 38px; }
  .ev-hero-btns { grid-column: 1 / -1; }
  .ev-hero-btns .btn:not(.icon) { flex: 1; justify-content: center; }
  .ev-stage { min-height: 300px; }
  .pg-opts button { min-height: 56px; }
  .pg-aim { height: 330px; }
}

/* ---------- Event: Abzeichen, Abstimmung, Jubel, Termin ---------- */
.lvl.lvl-badge { background: linear-gradient(90deg, #f6c445, #f08a3c); color: #3a2400; }
.prof-badge { margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, #f6c445 18%, var(--card)); font-size: 13.5px; }
.ev-main { display: grid; gap: 10px; align-content: start; min-width: 0; }
.ev-vote { display: grid; gap: 8px; width: min(100%, 420px); margin: 14px auto 0; text-align: left; }
.ev-vote > b { text-align: center; }
.ev-vote > small { text-align: center; }
.ev-vote-opts { display: grid; gap: 6px; }
.ev-vote-btn { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; isolation: isolate; text-align: left; }
.ev-vote-btn::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: color-mix(in srgb, var(--accent) 16%, transparent); z-index: -1; transition: width .3s var(--ease); }
.ev-vote-btn.on { border-color: var(--accent); }
.ev-vote-btn:disabled { cursor: default; }
.ev-vote-btn:not(:disabled):hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.ev-vote-ico { font-size: 22px; }
.ev-cheer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm, none); }
.ev-cheer[hidden] { display: none; }
.ev-cheer-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--inset); font-size: 23px; cursor: pointer; transition: transform .12s; touch-action: manipulation; }
.ev-cheer-btn:active { transform: scale(.85); }
.ev-cheer-btn:disabled { opacity: .5; }
.ev-floats { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.ev-float { position: absolute; bottom: 70px; display: grid; justify-items: center; animation: evFloat 2.6s ease-out forwards; }
.ev-float span { font-size: 36px; line-height: 1; }
.ev-float small { margin-top: 2px; padding: 0 6px; border-radius: 6px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 11px; white-space: nowrap; }
@keyframes evFloat { 0% { transform: translate(0, 20px) scale(.5); opacity: 0; } 12% { transform: translate(0, 0) scale(1.15); opacity: 1; } 100% { transform: translate(var(--dx, 0), -55vh) scale(1); opacity: 0; } }
.ev-when { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-when .input { width: auto; }
.home-ev.soon { background: var(--card); color: var(--text); animation: none; box-shadow: none; border: 1px solid var(--line); }

/* ---------- Event-Spiele (26 Spielarten) ---------- */
.pg-field { position: relative; height: min(400px, 58vh); border-radius: 18px; background: var(--inset); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.pg-field.miss { animation: pgMiss .4s; }
@keyframes pgMiss { 0%, 50% { box-shadow: inset 0 0 0 4px #c0392b; } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.pg-obj { position: absolute; transform: translate(-50%, -50%); font-size: 34px; line-height: 1; pointer-events: none; will-change: left, top; }
.pg-hit, .pg-tapme { pointer-events: auto; cursor: pointer; padding: 6px; }
.pg-tapme { transition: left .12s, top .12s, font-size .12s; }
.pg-hit.gone { transform: translate(-50%, -50%) scale(1.6); opacity: 0; transition: .15s; }
.pg-hit.fade { animation: pgFade var(--life, 1s) linear forwards; }
.pg-hit.drift { animation: pgDrift var(--life, 1s) linear forwards; }
@keyframes pgFade { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: .9; } 100% { opacity: 0; } }
@keyframes pgDrift { from { translate: 0 0; } to { translate: var(--dx, 0) var(--dy, 0); } }
.pg-aimfield { background: repeating-radial-gradient(circle at 50% 50%, var(--inset) 0 30px, var(--card) 30px 60px); }
.pg-sky { background: linear-gradient(180deg, color-mix(in srgb, #4fd1ff 22%, var(--inset)), var(--inset)); }
.pg-water { background: linear-gradient(180deg, color-mix(in srgb, #4f78d6 12%, var(--inset)), color-mix(in srgb, #4f78d6 30%, var(--inset))); }
.pg-player { font-size: 42px; transition: left .05s linear; }
.pg-player.hit { animation: pgPop .2s; }
.blink { animation: pgBlink .2s 5; }
@keyframes pgBlink { 50% { opacity: .2; } }
.pg-lives { font-size: 18px; letter-spacing: 2px; }
.pg-big-btn.red { background: #c0392b !important; }
.pg-alt button { min-height: 180px; font-size: 54px !important; }
.pg-alt button.hit { animation: pgPop .12s; }
/* Reaktion */
.pg-react.tease { background: #a8432f; }
.pg-react.fake { background: #e67e22; }
.pg-react-e { font-size: 80px; line-height: 1; }
/* Raster */
.pg-swatch { display: block; width: 100%; aspect-ratio: 1; border: 0 !important; border-radius: 12px; }
.pg-tf { display: inline-block; }
.pg-cgrid { display: grid; gap: 8px; width: min(420px, 100%); justify-self: center; }
.pg-cgrid button { aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--border); background: var(--card); padding: 0; }
.pg-shape { font-size: clamp(30px, 8vw, 54px) !important; line-height: 1; background: var(--card); }
.pg-goal { text-align: center; font-size: 20px; font-weight: 700; min-height: 30px; }
.pg-goal .pg-sw { display: inline-block; width: 64px; height: 64px; border-radius: 16px; vertical-align: middle; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--border-strong); }
.pg-goal .pg-shape { background: none; font-size: 60px !important; }
.pg-goal-e { font-size: 40px; vertical-align: middle; }
/* Memory */
.pg-mem { display: grid; gap: 8px; width: min(440px, 100%); justify-self: center; }
.pg-card { aspect-ratio: 1; border-radius: 12px; border: 0; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000)); padding: 0; font-size: clamp(24px, 6vw, 38px) !important; transition: transform .2s, background .2s; }
.pg-card span { visibility: hidden; }
.pg-card.up { background: var(--card); box-shadow: inset 0 0 0 2px var(--border-strong); transform: rotateY(180deg) scaleX(-1); }
.pg-card.up span { visibility: visible; }
.pg-card.done { opacity: .45; }
/* Maulwurf */
.pg-holes { display: grid; gap: 10px; width: min(420px, 100%); justify-self: center; }
.pg-hole { position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, #3b2a1a 0 45%, #6b4a2b 46% 60%, transparent 61%), color-mix(in srgb, #2f9e6e 35%, var(--inset)); overflow: hidden; padding: 0; }
.pg-hole span { position: absolute; left: 50%; bottom: 18%; font-size: clamp(30px, 8vw, 46px); line-height: 1; transform: translate(-50%, 180%); transition: transform .12s; pointer-events: none; }
.pg-hole.up span { transform: translate(-50%, 0); }
.pg-hole.bonk { animation: pgPop .2s; }
.pg-hole.boom { animation: pgMiss .4s; }
/* Gleich/anders */
.pg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pg-pair > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; min-height: 120px; padding: 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); font-size: clamp(24px, 6vw, 40px); }
.pg-dot { display: inline-block; width: 26px; height: 26px; border-radius: 50%; }
/* Muster / Was ist neu */
.pg-sgrid { display: grid; gap: 6px; width: min(400px, 100%); justify-self: center; }
.pg-sgrid button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: var(--card); padding: 0; font-size: clamp(18px, 5vw, 30px) !important; transition: background .15s; }
.pg-sgrid button.on { background: #e3b52b; }
.pg-sgrid button.ok { background: #27ae60; }
.pg-sgrid button.bad { background: #c0392b; }
.pg-chg.blank button { visibility: hidden; }
.pg-chg button .pg-swatch { border-radius: 8px; }
/* Zeitgefühl */
.pg-watch { text-align: center; font-size: clamp(48px, 12vw, 76px); font-weight: 800; font-variant-numeric: tabular-nums; }
.pg-watch-btn, .pg-bar-btn, .pg-beat-btn { width: min(200px, 50vw) !important; font-size: 30px !important; }
/* Grüne Zone */
.pg-bar { position: relative; height: 54px; border-radius: 27px; background: var(--inset); overflow: hidden; }
.pg-zone { position: absolute; top: 0; bottom: 0; background: #27ae60; opacity: .8; }
.pg-needle { position: absolute; top: 4px; bottom: 4px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--text); }
/* Turm */
.pg-tower { background: linear-gradient(180deg, color-mix(in srgb, #9b6bd6 15%, var(--inset)), var(--inset)); }
.pg-block { position: absolute; height: 8%; border-radius: 4px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); transition: bottom .2s; }
.pg-block.fall { transition: bottom .5s ease-in, transform .5s; bottom: -20% !important; transform: rotate(20deg); }
/* Sortieren */
.pg-item { text-align: center; font-size: clamp(70px, 18vw, 110px); line-height: 1.1; }
.pg-sort button { display: grid; justify-items: center; gap: 2px; min-height: 110px; font-size: 40px !important; }
.pg-sort small { font-size: 16px; }
/* Flattervogel */
.pg-pipe { position: absolute; width: 10%; background: linear-gradient(90deg, #2f9e6e, #47c48a, #2f9e6e); border-radius: 6px; }
/* Im Takt */
.pg-rhythm { position: relative; height: 230px; }
.pg-ring, .pg-circle { position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; border-radius: 50%; transform: translate(-50%, -50%); }
.pg-ring { border: 6px solid var(--accent); }
.pg-circle { border: 4px solid #e3b52b; pointer-events: none; }
.pg-circle.hit { border-color: #27ae60; }
.pg-rmsg { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 22px; }
/* Klavier */
.pg-piano { background: var(--card); }
.pg-piano.dark { background: #1c1f2a; }
.pg-lane { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.pg-tile { position: absolute; height: 22%; display: grid; place-items: center; font-size: 30px; background: #1f2430; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--card); cursor: pointer; }
.pg-piano.dark .pg-tile { background: #6b5bd6; }
.pg-tile.hit { background: color-mix(in srgb, #1f2430 25%, transparent); }
/* Pfeile */
.pg-arrow { text-align: center; font-size: clamp(56px, 14vw, 90px); font-weight: 800; line-height: 1.1; min-height: 100px; }
.pg-arr { display: inline-block; margin: 0 2px; }
.pg-arr.dim { opacity: .55; }
.pg-dpad { display: grid; grid-template-areas: ". u ." "l . r" ". d ."; grid-template-columns: repeat(3, 76px); grid-template-rows: repeat(3, 76px); gap: 6px; justify-content: center; }
.pg-dpad button { border-radius: 16px; border: 1px solid var(--border-strong); background: var(--card); font-size: 34px !important; box-shadow: 0 4px 0 var(--border-strong); }
/* Nur bei …! */
.pg-gng { justify-self: center; width: min(260px, 70vw); aspect-ratio: 1; border-radius: 28px; border: 0; background: var(--card); box-shadow: 0 6px 0 var(--border-strong); font-size: 110px !important; line-height: 1; }
.pg-gng.ok { background: #27ae60; } .pg-gng.bad { background: #c0392b; }
/* Hütchenspiel */
.pg-cups { position: relative; height: 170px; }
.pg-cup { position: absolute; bottom: 0; height: 150px; border: 0; background: none; padding: 0; transition-property: left; transition-timing-function: ease-in-out; }
.pg-cup-c { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: clamp(54px, 14vw, 80px); line-height: 1; transition: transform .25s; }
.pg-cup-b { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 30px; visibility: hidden; }
.pg-cup.has.lift .pg-cup-b { visibility: visible; }
.pg-cup.lift .pg-cup-c { transform: translate(-50%, -60px); }
/* Event: Dauer, Zusammenfassung */
.ev-dur { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ev-dur .input { width: 72px; }
.ev-sum { margin: 4px 0 10px; padding: 10px 14px; border-radius: 12px; background: var(--inset); font-size: 14px; }
.ev-sum.bad { color: #c0392b; }

/* ---------- Event-Spiele mit Zeichenfläche und Knobel-Spiele (games-*.js) ---------- */
.pg-cv { position: relative; height: min(420px, 58vh); border-radius: 18px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #111; }
.pg-cv.short { height: min(360px, 48vh); }
.pg-cv canvas { display: block; touch-action: none; }
.pg-pad { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
.pg-pad button { min-width: 0; padding: 0; min-height: 54px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--card); font-size: 24px !important; font-weight: 800; box-shadow: 0 4px 0 var(--border-strong); }
.pg-pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--border-strong); }
/* Vier gewinnt */
.pg-c4 { display: grid; width: 100%; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 8px; margin: 8px auto 0; max-width: 430px; background: #1f4fbf; border-radius: 16px; touch-action: manipulation; }
.pg-c4-cell { aspect-ratio: 1; border-radius: 50%; background: var(--bg); box-shadow: inset 0 3px 5px rgba(0,0,0,.35); transition: background .15s; }
.pg-c4-cell.p1 { background: #e74c3c; animation: pgDrop .25s ease-in; } .pg-c4-cell.p2 { background: #f1c40f; animation: pgDrop .25s ease-in; }
.pg-c4-cell.win { box-shadow: 0 0 0 4px #fff, 0 0 14px #fff; }
@keyframes pgDrop { from { transform: translateY(-120px); opacity: .3; } }
/* Lichter aus */
.pg-lights { display: grid; width: 100%; grid-template-columns: repeat(var(--n), 1fr); gap: 7px; max-width: 360px; margin: 8px auto 10px; }
.pg-lamp { aspect-ratio: 1; border-radius: 14px; border: 0; background: #2d3436; box-shadow: inset 0 -4px 0 rgba(0,0,0,.3); transition: background .12s, box-shadow .12s; }
.pg-lamp.on { background: #ffd93b; box-shadow: 0 0 16px #ffd93b, inset 0 -4px 0 rgba(0,0,0,.15); }
/* Rohr-Leitung */
.pg-pipes { display: grid; width: 100%; gap: 3px; max-width: 400px; margin: 8px auto 0; align-items: center; }
.pg-pipe-end { text-align: center; font-size: 22px; }
.pg-pipe { position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; background: #3b3f4a; overflow: hidden; }
.pg-pipe span { position: absolute; inset: 0; display: block; transition: transform .13s; }
.pg-pipe svg { width: 100%; height: 100%; display: block; }
.pg-pipe line { stroke: #b2bec3; stroke-width: 24; stroke-linecap: butt; } .pg-pipe circle { fill: #b2bec3; }
.pg-pipe.wet line { stroke: #3ea6ff; } .pg-pipe.wet circle { fill: #3ea6ff; }
/* Farbflut */
.pg-flood { display: grid; width: 100%; grid-template-columns: repeat(var(--n), 1fr); max-width: 340px; margin: 8px auto 10px; border-radius: 10px; overflow: hidden; }
.pg-flood > div { aspect-ratio: 1; transition: background .2s; }
.pg-flood-btns { grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 360px; margin: 0 auto; }
.pg-flood-btns button { min-height: 52px; border: 3px solid rgba(255,255,255,.6); }
/* Schatten- und Zoom-Rätsel */
.pg-shadow, .pg-zoom { display: grid; gap: 14px; justify-items: center; }
.pg-sh-big { font-size: 130px; line-height: 1.1; height: 150px; display: grid; place-items: center; }
.pg-sh-big span { filter: brightness(0); transition: filter .3s; }
.pg-sh-big.reveal span { filter: none; }
.pg-zoom-win { width: min(220px, 60vw); aspect-ratio: 1; border-radius: 22px; overflow: hidden; display: grid; place-items: center; background: var(--inset); border: 3px solid var(--border-strong); }
.pg-zoom-win span { font-size: min(150px, 40vw); line-height: 1; display: block; }
.pg-shadow .pg-opts, .pg-zoom .pg-opts { width: 100%; max-width: 420px; }
.pg-shadow .pg-opts button, .pg-zoom .pg-opts button { font-size: 40px !important; min-height: 76px; }
/* Heiß oder kalt */
.pg-hc { display: grid; width: 100%; grid-template-columns: repeat(var(--n), 1fr); gap: 5px; max-width: 380px; margin: 8px auto 0; }
.pg-hc button { aspect-ratio: 1; border-radius: 10px; border: 0; background: var(--inset); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); font-size: 22px !important; padding: 0; }
.pg-hc .h4 { background: #ff6b6b; } .pg-hc .h3 { background: #ffa36c; } .pg-hc .h2 { background: #ffe066; } .pg-hc .h1 { background: #a5d8ff; } .pg-hc .h0 { background: #4dabf7; }
.pg-hc .gem { background: #b197fc; animation: pgPop .3s; }
/* ===== Paket 2: Knobel-Spiele ===== */
/* Schiffe versenken */
.pg-bs { display: grid; width: 100%; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; max-width: 400px; margin: 8px auto 0; padding: 6px; background: #1565c0; border-radius: 12px; }
.pg-bs button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; background: #64b5f6; font-size: 18px !important; line-height: 1; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.pg-bs .miss { background: #90caf9; } .pg-bs .miss.auto { color: #1565c0; background: #bbdefb; }
.pg-bs .hit { background: #ff8a65; } .pg-bs .sunk { background: #546e7a; } .pg-bs .show { background: #b0bec5; opacity: .7; }
/* Farben sortieren */
.pg-tubes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px auto; max-width: 440px; }
.pg-tube { width: 48px; height: 164px; padding: 4px; border: 3px solid var(--border-strong); border-top: 0; border-radius: 0 0 22px 22px; background: var(--inset); display: flex; flex-direction: column-reverse; gap: 2px; transition: transform .12s; }
.pg-tube i { display: block; height: 36px; border-radius: 4px; flex: none; }
.pg-tube i:first-child { border-radius: 4px 4px 16px 16px; }
.pg-tube.sel { transform: translateY(-12px); border-color: #3498db; }
/* Schiebepuzzle */
.pg-slide-top { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pg-slide-mini { width: 54px; height: 54px; border-radius: 8px; background-size: cover; border: 2px solid var(--border-strong); }
.pg-slide { position: relative; width: min(320px, 82vw); aspect-ratio: 1; margin: 10px auto 0; background: #2d3436; border-radius: 12px; overflow: hidden; }
.pg-tile { position: absolute; width: 33.333%; height: 33.333%; padding: 0; border: 2px solid #2d3436; border-radius: 8px; background-size: 300% 300%; transition: left .12s, top .12s; }
/* Farbcode knacken */
.pg-cb-rows { display: grid; gap: 4px; justify-items: center; min-height: 40px; max-height: 240px; overflow: auto; }
.pg-cb-row { display: flex; align-items: center; gap: 6px; }
.pg-cb-row i, .pg-cb-cur i { display: inline-block; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.pg-cb-fb { font-size: 12px; min-width: 60px; letter-spacing: -2px; }
.pg-cb-cur { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.pg-cb-cur button { width: 46px; height: 46px; border-radius: 50%; border: 2px dashed var(--border-strong); background: var(--inset); padding: 0; display: grid; place-items: center; }
.pg-cb-cur button i { width: 36px; height: 36px; }
.pg-cb-pal { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pg-cb-pal button { width: 48px; height: 48px; border-radius: 50%; border: 3px solid rgba(255,255,255,.7); box-shadow: 0 3px 0 rgba(0,0,0,.25); padding: 0; }
.pg-cb-pal .go { background: #27ae60; color: #fff !important; font-size: 22px !important; font-weight: 700; }
/* Reversi */
.pg-rv { display: grid; width: 100%; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; max-width: 380px; margin: 8px auto 0; padding: 6px; background: #1b5e20; border-radius: 12px; }
.pg-rv button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; background: #2e7d32; position: relative; }
.pg-rv button::after { content: ''; position: absolute; inset: 12%; border-radius: 50%; transition: background .2s; }
.pg-rv .p1::after { background: #111; box-shadow: inset 0 -3px 0 #444; } .pg-rv .p2::after { background: #f5f5f5; box-shadow: inset 0 -3px 0 #bbb; }
.pg-rv .can::after { inset: 38%; background: rgba(255,255,255,.3); }
/* Fehlerbild + Muster nachbauen */
.pg-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 640px; margin: 8px auto 0; }
.pg-diff-g, .pg-copy { display: grid; width: 100%; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); container-type: inline-size; gap: 2px; padding: 4px; border-radius: 10px; background: var(--inset); }
.pg-diff-g button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; background: var(--card); font-size: 12cqw !important; line-height: 1; min-width: 0; overflow: hidden; }
.pg-diff-g button.found { background: #a5d6a7; box-shadow: 0 0 0 3px #2e7d32 inset; }
.pg-copy button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; background: var(--card); }
.pg-copy.model { pointer-events: none; outline: 3px solid var(--border-strong); }
/* Türme versetzen */
.pg-hanoi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 520px; margin: 10px auto 0; }
.pg-peg { position: relative; height: 150px; padding: 0; border: 0; border-radius: 12px; background: var(--inset); border-bottom: 6px solid #8d6e63; }
.pg-peg.sel { background: #d6eaff; }
.pg-peg .rod { position: absolute; left: 50%; bottom: 0; width: 8px; height: 132px; transform: translateX(-50%); background: #8d6e63; border-radius: 4px; }
.pg-peg .disk { position: absolute; left: 50%; height: 16px; transform: translateX(-50%); border-radius: 8px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); transition: bottom .12s; }
.pg-peg .disk.up { bottom: 132px !important; }
/* Doppelt gesehen */
.pg-spot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 560px; margin: 8px auto 0; }
.pg-spot-card { position: relative; aspect-ratio: 1; border-radius: 50%; background: var(--card); border: 3px solid var(--border-strong); font-size: clamp(22px, 7vw, 42px); }
.pg-spot-card button { position: absolute; padding: 0; border: 0; background: none; line-height: 1; font-size: inherit !important; }
.pg-spot-card button.ok { filter: drop-shadow(0 0 6px #27ae60); }

/* ===== Farbknöpfe: Schulmodus (blau) und Mitarbeit (grün) ===== */
.color-btn { --c: #1e3a8a; display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--card); background: var(--c); color: #fff; font: 800 16px/1 var(--font); padding: 0 0 1px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), 0 6px 16px -6px color-mix(in srgb, var(--c) 80%, #000); }
.color-btn.big { width: 52px; height: 52px; font-size: 24px; }
.fab-school, .fab-work { position: fixed; z-index: 9000; top: 28px; width: 44px; height: 44px; font-size: 21px; transition: transform .15s var(--ease), box-shadow .2s; cursor: pointer; touch-action: manipulation; }
.fab-school[hidden], .fab-work[hidden] { display: none; }
.fab-school:active, .fab-work:active { transform: scale(.92); }
.fab-school.on { box-shadow: 0 0 0 3px #7aa7ff, 0 0 18px 2px #4f7fe8; }
.color-btn.locked, .panic-btn.locked { filter: grayscale(.65); opacity: .7; }
body.panic-editing .color-btn:not([hidden]) { cursor: grab; touch-action: none; outline: 3px dashed var(--c); outline-offset: 6px; }
body.has-fabs .topbar { padding-right: calc(var(--fab-space) + 8px); }
.btn-off-note { display: grid; justify-items: center; gap: 6px; text-align: center; }
.btn-off-note p { margin: 0; }

/* Einstellungen: Knöpfe & Schulmodus */
.school-box { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 14px; border-radius: 16px; background: var(--inset); flex-wrap: wrap; }
.school-box.on { background: color-mix(in srgb, #1e3a8a 14%, var(--card)); box-shadow: inset 0 0 0 1px #4f7fe8; }
.school-box .txt { min-width: 200px; display: grid; gap: 2px; }
.school-box .txt span { color: var(--text-2, inherit); opacity: .8; font-size: 13.5px; }
.btn-cfg { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 4px; margin-bottom: 12px; }
.btn-cfg-head { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; }
.btn-cfg-head .txt { display: grid; gap: 2px; } .btn-cfg-head .txt span { font-size: 13px; opacity: .75; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card); background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatches button.on { box-shadow: 0 0 0 3px var(--text); }
.btnoff-row .row { display: flex; align-items: center; gap: 12px; width: 100%; }
.btnoff-row .txt { display: grid; gap: 2px; }
.work-times, .work-subs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.work-times .chip button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; cursor: pointer; display: inline-grid; }
.work-times .input { width: auto; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-strong); font-size: 13.5px; }
.chip-check input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Mitarbeits-Fenster */
.work { display: grid; gap: 14px; }
.work-now { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--inset); }
.work-now span { font-size: 13px; opacity: .75; }
.work-big { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.work-big button { display: grid; justify-items: center; gap: 4px; padding: 18px 8px; border-radius: 18px; border: 0; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; touch-action: manipulation; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.work-big button b { font-size: 16px; }
.work-big button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.work-hand { background: #2e9d57; } .work-turn { background: #1f8a8a; }
.work-big button.pop { animation: pgPop .3s; }
.work-goal .row { display: flex; gap: 8px; align-items: baseline; }
.work-bar { height: 10px; border-radius: 6px; background: var(--inset); overflow: hidden; margin-top: 6px; }
.work-bar i { display: block; height: 100%; background: #2e9d57; border-radius: 6px; transition: width .3s; }
.work-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.work-stats > div { display: grid; gap: 2px; padding: 10px; border-radius: 12px; background: var(--inset); min-width: 0; }
.work-stats small, .work-week small { font-size: 12px; opacity: .7; }
.work-stats b { font-size: 17px; } .work-stats span { font-size: 12px; opacity: .75; }
.work-week { display: grid; gap: 5px; }
.work-week div { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 8px; font-size: 13.5px; }
.work-week div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-week div i { height: 8px; border-radius: 4px; background: #2e9d57; }
.work-week div b { text-align: right; }
@media (max-width: 520px) { .work-stats { grid-template-columns: 1fr 1fr; } .work-big { grid-template-columns: 1fr 1fr; } }

/* Event: Test-Hinweis, Text-Jubel, Event-Chat */
.chip.ev-test { background: #fff3c4; color: #6b5200; }
.ev-cheer-btn.txt { width: auto; padding: 0 12px; border-radius: 99px; font: 900 14px/1 var(--font); letter-spacing: .02em; color: #fff; border: 0; }
.ev-cheer-btn.win { background: #27ae60; } .ev-cheer-btn.loss { background: #c0392b; }
.ev-float.txt span { font: 900 24px/1 var(--font); padding: 6px 12px; border-radius: 12px; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.ev-float.win span { background: #27ae60; } .ev-float.loss span { background: #c0392b; }
.ev-chat { margin-top: 14px; display: grid; gap: 10px; }
.ev-chat[hidden] { display: none; }
.ev-chat-list { display: grid; align-content: start; gap: 6px; max-height: 260px; min-height: 80px; overflow-y: auto; padding: 4px 2px; }
.ev-msg { display: grid; gap: 1px; justify-self: start; max-width: 85%; padding: 7px 11px; border-radius: 14px 14px 14px 4px; background: var(--inset); overflow-wrap: anywhere; }
.ev-msg b { font-size: 12px; opacity: .75; }
.ev-msg.me { justify-self: end; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--accent, #3d7a4f) 22%, var(--card)); }
.ev-msg.adm { box-shadow: inset 0 0 0 1.5px #e0a400; }
.ev-chat-form { display: flex; gap: 8px; }
.err-text { color: #c0392b; min-height: 1em; margin: 0; }
.btn-cfg .set-row { gap: 12px; }
.btn-cfg .set-row > .txt { flex: none; }

/* =====================================================================
   Paket 3: Aufgaben, Noten, Pinnwand, Geburtstage, Suche, Training …
   ===================================================================== */
.badge.soft { background: var(--amber); }
.tb-search { order: -1; }

/* ---------- Hausaufgaben ---------- */
.hw-head { display: grid; gap: 14px; margin-bottom: 14px; }
.hw-stats { display: flex; gap: 10px; }
.hw-stats > div { flex: 1; min-width: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); display: grid; }
.hw-stats b { font: 600 28px/1 var(--font-display); }
.hw-stats small { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.hw-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.hw-remind { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.select.sm { padding: 6px 30px 6px 10px; font-size: 13px; min-height: 34px; width: auto; }
.hw-hint { margin: 0; }
.hw-filter { justify-content: space-between; gap: 10px; margin: 6px 0 4px; }
.hw-filter .filters { margin: 0; }
.hw-list { display: grid; gap: 8px; }
.hw-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: opacity .3s, transform .3s; }
.hw-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: hsl(var(--h) 45% 55%); }
.hw-check { width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--border-strong); background: var(--card); display: grid; place-items: center; color: transparent; cursor: pointer; transition: .2s var(--ease); margin-left: 4px; }
.hw-check:hover { border-color: var(--green); color: color-mix(in srgb, var(--green) 50%, transparent); }
.hw-item.done .hw-check, .hw-item.ticking .hw-check { background: var(--green); border-color: var(--green); color: #fff; }
.hw-item.ticking .hw-check { animation: hw-pop .38s var(--ease); }
.hw-item.ticking { opacity: .55; transform: translateX(6px); }
@keyframes hw-pop { 40% { transform: scale(1.25); } }
.hw-main { display: grid; gap: 2px; text-align: left; background: none; border: 0; padding: 2px 0; color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.hw-main b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.hw-subj { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: hsl(var(--h) 35% 45%); }
.hw-note { color: var(--text-2); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hw-item.done .hw-main b { text-decoration: line-through; color: var(--text-3); }
.hw-due { display: grid; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.hw-due small { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.hw-due.soon { color: var(--amber-text); }
.hw-due.late { color: var(--red); }
.hw-item.late { border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }

/* ---------- Noten ---------- */
.gr-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 16px; }
.gr-head p { margin: 0; }
.gr-total { display: grid; justify-items: center; padding: 10px 18px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--gc) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--gc) 30%, var(--border)); }
.gr-total small { font-size: 12px; color: var(--text-2); }
.gr-total b { font: 600 38px/1.1 var(--font-display); color: var(--gc); }
.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gr-card { padding: 16px; display: grid; gap: 12px; align-content: start; border-top: 4px solid var(--gc); }
.gr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.gr-name { font-size: 16px; }
.gr-mean { font: 600 26px/1 var(--font-display); color: var(--gc); }
.gr-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gr-chip { display: inline-flex; align-items: baseline; gap: 3px; padding: 4px 9px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--gc) 35%, var(--border)); background: color-mix(in srgb, var(--gc) 10%, var(--card)); color: var(--text); font: 600 14px/1.2 var(--font); cursor: pointer; }
.gr-chip small { font-size: 10px; color: var(--text-3); font-weight: 600; }
.gr-chip.k-ka { border-width: 2px; }
.gr-chip:hover { text-decoration: line-through; }
.gr-add { width: 30px; height: 30px; border-radius: 9px; border: 1.5px dashed var(--border-strong); background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.gr-add:hover { border-color: var(--text-2); color: var(--text); }
.gr-foot { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 12.5px; color: var(--text-2); }
.gr-foot label { display: inline-flex; align-items: center; gap: 6px; }
.gr-need { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface); }
.gr-need.bad { background: color-mix(in srgb, var(--red) 10%, var(--card)); color: var(--red); }
.gr-need.good { background: color-mix(in srgb, var(--green) 12%, var(--card)); }
.gr-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.gr-p { padding: 10px 0; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--gc) 40%, var(--border)); background: color-mix(in srgb, var(--gc) 12%, var(--card)); font: 700 15px/1 var(--font); color: var(--text); cursor: pointer; }
.gr-p:hover { background: color-mix(in srgb, var(--gc) 28%, var(--card)); }
@media (max-width: 640px) { .gr-head { grid-template-columns: 1fr; } .gr-pick { grid-template-columns: repeat(4, 1fr); } .hw-due small { display: none; } }

/* ---------- Pinnwand (Kork mit Papierzetteln) ---------- */
.pinboard { margin-bottom: 18px; border-radius: var(--r-xl); padding: 14px 16px 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.12) 0 1px, transparent 2px) 0 0 / 17px 19px,
    radial-gradient(circle at 70% 60%, rgba(80,45,15,.18) 0 1px, transparent 2px) 0 0 / 23px 21px,
    radial-gradient(circle at 40% 80%, rgba(80,45,15,.12) 0 1.5px, transparent 2.5px) 0 0 / 31px 29px,
    linear-gradient(135deg, #c99a68, #b98654 55%, #c4925f);
  box-shadow: inset 0 0 0 7px #8a5d35, inset 0 0 0 9px #74491f, inset 0 6px 22px rgba(60,30,5,.35), var(--shadow); }
.pinboard-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; color: #fff8ec; text-shadow: 0 1px 2px rgba(60,30,5,.5); }
.pinboard-head .card-label { color: inherit; }
.pinboard-head small { opacity: .8; font-size: 12.5px; }
.pinboard-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; padding: 8px 6px 4px; }
.pinboard-wall.one { grid-template-columns: minmax(0, 300px); justify-content: center; padding: 20px; border-radius: var(--r-lg); background: linear-gradient(135deg, #c99a68, #b98654); }
.pin-note { --paper: #fff3a8; --ink: #3d3420; --line: rgba(120,95,20,.16);
  position: relative; padding: 26px 16px 14px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 30%), repeating-linear-gradient(180deg, transparent 0 25px, var(--line) 25px 26px), var(--paper);
  border-radius: 3px 3px 14px 3px / 3px 3px 26px 3px;
  box-shadow: 0 1px 1px rgba(0,0,0,.12), 0 12px 18px -10px rgba(50,25,5,.55), inset 0 -10px 18px -14px rgba(0,0,0,.25);
  transform: rotate(var(--tilt)); transition: transform .35s var(--ease), box-shadow .35s var(--ease); animation: pin-in .55s var(--ease) both; }
.pin-note:hover { transform: rotate(0deg) translateY(-3px) scale(1.02); box-shadow: 0 2px 2px rgba(0,0,0,.12), 0 20px 26px -12px rgba(50,25,5,.6); z-index: 2; }
@keyframes pin-in { from { opacity: 0; transform: rotate(calc(var(--tilt) * 3)) translateY(-14px) scale(.96); } }
.pin-note.c-pink { --paper: #ffd3df; --ink: #4a2530; --line: rgba(150,40,70,.12); }
.pin-note.c-blue { --paper: #cfe6ff; --ink: #1f3550; --line: rgba(30,80,150,.12); }
.pin-note.c-green { --paper: #d3f2c8; --ink: #24401d; --line: rgba(40,110,30,.12); }
.pin-note.c-violet { --paper: #e5d7ff; --ink: #34275a; --line: rgba(80,50,160,.12); }
.pin-note.c-orange { --paper: #ffdcb8; --ink: #4a2e14; --line: rgba(170,90,20,.13); }
.pin-head { position: absolute; top: -7px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9b8f, #d83a2c 55%, #8f1d14); box-shadow: 0 3px 4px rgba(0,0,0,.35), inset 0 -2px 3px rgba(0,0,0,.25); }
.pin-head::after { content: ""; position: absolute; left: 6px; top: 4px; width: 6px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.65); }
.c-blue .pin-head { background: radial-gradient(circle at 35% 30%, #9fc8ff, #2f6fd1 55%, #183e7d); }
.c-green .pin-head { background: radial-gradient(circle at 35% 30%, #b7f0a0, #3e9b2c 55%, #1f5615); }
.c-violet .pin-head, .c-pink .pin-head { background: radial-gradient(circle at 35% 30%, #ffe08a, #e0a417 55%, #8a6106); }
.pin-emoji { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.pin-note h3 { margin: 0; font: 600 18px/1.25 var(--font-display); overflow-wrap: anywhere; }
.pin-note p { margin: 0; font-size: 14px; line-height: 26px; overflow-wrap: anywhere; }
.pin-note p a { color: inherit; }
.pin-note footer { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pin-until { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,.07); }
.pin-ok { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; border: 1.5px solid currentColor; background: rgba(255,255,255,.45); color: var(--ink); font: 600 13px/1 var(--font); cursor: pointer; }
.pin-note.ok .pin-ok { background: #2e9d57; border-color: #2e9d57; color: #fff; }
.pin-note.ok::after { content: "Erledigt ✓"; position: absolute; right: 12px; top: 14px; transform: rotate(8deg); font: 700 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: #2e9d57; border: 2px solid #2e9d57; padding: 4px 7px; border-radius: 6px; opacity: .85; }
:root[data-theme="dark"] .pin-note { filter: brightness(.9) saturate(.9); }
:root[data-theme="dark"] .pinboard { filter: brightness(.82); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .pin-note { filter: brightness(.9) saturate(.9); } :root[data-theme="auto"] .pinboard { filter: brightness(.82); } }
@media (max-width: 640px) { .pinboard-wall { grid-template-columns: 1fr 1fr; gap: 18px 12px; } .pin-note { min-height: 120px; padding: 22px 12px 12px; } .pin-note h3 { font-size: 16px; } }
@media (max-width: 420px) { .pinboard-wall { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pin-note { animation: none; } }

/* Admin: Pinnwand-Editor */
.adm-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 14px; }
.adm-bnote { display: grid; gap: 10px; padding: 18px 12px 10px; border-radius: var(--r-md); background: linear-gradient(135deg, #c99a68, #b98654); }
.adm-bnote.gone { opacity: .55; }
.adm-bnote .pin-note { animation: none; }
.adm-btools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.adm-btools .btn { background: var(--card); }
.pin-edit { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
.pe-preview { display: grid; gap: 8px; align-content: start; }
.pe-emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-emojis button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); font-size: 20px; cursor: pointer; }
.pe-emojis button.on { border: 2px solid var(--accent); background: var(--surface-2); }
.pe-colors { display: flex; gap: 8px; }
.pe-c { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.pe-c.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.pe-c.c-yellow { background: #fff3a8; } .pe-c.c-pink { background: #ffd3df; } .pe-c.c-blue { background: #cfe6ff; } .pe-c.c-green { background: #d3f2c8; } .pe-c.c-violet { background: #e5d7ff; } .pe-c.c-orange { background: #ffdcb8; }
.pe-check .row { gap: 10px; align-items: center; min-height: 44px; }
@media (max-width: 720px) { .pin-edit { grid-template-columns: 1fr; } }

/* ---------- Geburtstage ---------- */
.bday-ask { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 20px; background: rgba(20, 16, 12, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: mpfx-bg .3s ease both; }
.bday-ask.out { animation: mpfx-out .3s ease both; }
.bday-card { width: min(440px, 100%); background: var(--card); border-radius: var(--r-xl); padding: 28px 24px 22px; box-shadow: var(--shadow-lg); text-align: center; display: grid; gap: 12px; animation: mpfx-title .5s cubic-bezier(.2,1.3,.4,1) both; }
.bday-cake { font-size: 64px; line-height: 1; animation: mpfx-bob 2.4s ease-in-out infinite; }
.bday-card h2 { margin: 0; font: 600 23px/1.25 var(--font-display); }
.bday-card p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.bday-sel { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; text-align: left; }
.bday-sel label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.bday-act { display: flex; gap: 10px; justify-content: center; }
.bday-act .btn.lg { flex: 1; justify-content: center; }
.bday-strip { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--r-lg);
  background: linear-gradient(110deg, color-mix(in srgb, #f0c75e 22%, var(--card)), color-mix(in srgb, #d98f9c 18%, var(--card))); border: 1px solid color-mix(in srgb, #f0c75e 35%, var(--border)); }
.bday-strip .grow { display: grid; gap: 2px; }
.bday-strip small { color: var(--text-2); }
.bday-ico { font-size: 34px; animation: mpfx-bob 2.4s ease-in-out infinite; }

/* ---------- App-Hinweis ---------- */
.app-hint { display: flex; gap: 16px; padding: 16px; margin-bottom: 16px; border-radius: var(--r-lg); background: var(--card); border: 1px dashed var(--border-strong); }
.app-hint .grow { display: grid; gap: 6px; }
.app-hint small { color: var(--text-2); }
.ah-phone { flex: none; width: 46px; height: 76px; border-radius: 12px; border: 3px solid var(--text); display: grid; place-items: center; position: relative; }
.ah-phone span { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 15px/1 var(--font-display); animation: mpfx-bob 2.2s ease-in-out infinite; }
.ah-steps { margin: 2px 0 6px; padding-left: 20px; display: grid; gap: 3px; font-size: 14px; }
.ah-ico { font-size: 13px; }

/* ---------- Suche ---------- */
.search-box { position: relative; }
.search-ico { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--text-3); display: flex; }
.search-in { padding-left: 44px; font-size: 16px; min-height: 48px; }
.search-res { margin-top: 12px; max-height: min(60vh, 520px); overflow: auto; display: grid; gap: 2px; }
.search-tip { margin: 6px 2px; }
.search-tip kbd { font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface); }
.search-g { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 10px 4px 4px; }
.search-hit { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.search-hit:hover, .search-hit.on { background: var(--surface-2); }
.search-hit .grow { display: grid; min-width: 0; }
.search-hit b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit small { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-ico { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-size: 18px; }

/* ---------- Karteikarten-Training ---------- */
.learn-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 18px; }
.learn-extra:empty { display: none; }
.srs-card { display: grid; gap: 14px; align-content: start; }
.srs-top { display: flex; gap: 16px; align-items: center; }
.srs-top .grow { display: grid; gap: 4px; justify-items: start; }
.srs-due { font-size: 17px; }
.srs-go { margin-top: 6px; }
.srs-fire { flex: none; width: 88px; height: 88px; border-radius: 24px; display: grid; place-items: center; align-content: center; background: var(--surface-2); filter: grayscale(1); opacity: .7; }
.srs-fire.on { filter: none; opacity: 1; background: linear-gradient(160deg, color-mix(in srgb, #ff9a3c 26%, var(--card)), color-mix(in srgb, #e4684f 22%, var(--card))); }
.srs-fire span { font-size: 26px; line-height: 1; }
.srs-fire.on.today span { animation: srs-flame 1.6s ease-in-out infinite; }
.srs-fire b { font: 600 26px/1 var(--font-display); }
.srs-fire small { font-size: 10.5px; color: var(--text-2); }
@keyframes srs-flame { 50% { transform: scale(1.15) rotate(-6deg); } }
.srs-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.srs-box { display: grid; justify-items: center; padding: 8px 2px; border-radius: 10px; background: color-mix(in srgb, var(--green) calc(var(--k, 0) * 1%), var(--surface)); }
.srs-box b { font-size: 17px; } .srs-box small { font-size: 10.5px; color: var(--text-2); }
.srs-box.b1 { --k: 6; } .srs-box.b2 { --k: 12; } .srs-box.b3 { --k: 18; } .srs-box.b4 { --k: 26; } .srs-box.b5 { --k: 34; }
.srs-streak-done { display: inline-block; margin-top: 6px; font-weight: 600; color: var(--amber-text); }
.srs-card p { margin: 0; }

/* ---------- Lerntreffen ---------- */
.meet-list { display: grid; gap: 10px; }
.meet { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-md); background: var(--surface); }
.meet.yes { background: color-mix(in srgb, var(--green) 12%, var(--card)); }
.meet .grow { display: grid; gap: 2px; min-width: 0; }
.meet small { color: var(--text-2); font-size: 12.5px; }
.meet-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet-act { display: flex; gap: 4px; align-items: center; }

/* ---------- Übersicht: nächste Arbeit + Training ---------- */
@media (min-width: 900px) {
  .bento > .b-exam { grid-column: span 12; } .bento > .b-exam.half { grid-column: span 7; }
  .bento > .b-srs { grid-column: span 5; } .bento > .b-srs.full { grid-column: span 12; }
}
.b-exam { border-top: 4px solid hsl(var(--h) 45% 55%); display: grid; gap: 14px; align-content: start; }
.exam-top { display: flex; gap: 16px; align-items: center; }
.exam-top .grow { min-width: 0; }
.exam-days { flex: none; width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center; align-content: center; background: color-mix(in srgb, hsl(var(--h) 50% 55%) 16%, var(--card)); }
.exam-days b { font: 600 34px/1 var(--font-display); }
.exam-days small { font-size: 12px; color: var(--text-2); }
.exam-plan { display: grid; gap: 6px; }
.ep-step { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface); }
.ep-step.now { background: color-mix(in srgb, hsl(var(--h) 50% 55%) 14%, var(--card)); box-shadow: inset 3px 0 0 hsl(var(--h) 45% 50%); }
.ep-step .grow { display: grid; min-width: 0; }
.ep-step b { font-size: 13.5px; } .ep-step small { color: var(--text-2); font-size: 12.5px; }
.ep-ico { font-size: 20px; }
.exam-link { justify-self: start; }

/* ---------- Admin: Planung + Wochenbericht ---------- */
.plan-form { display: grid; gap: 10px; }
.plan-form .row { align-items: flex-end; gap: 10px; }
.plan-form .field { min-width: 140px; }
.plan-quick { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 6px; }
.plan-item { align-items: center; }
.plan-when { display: grid; text-align: center; min-width: 86px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.plan-when small { font-size: 12px; color: var(--text-2); }
.rep-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.rep-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); }
.rep-tile svg { color: var(--text-3); }
.rep-tile b { font: 600 24px/1.1 var(--font-display); }
.rep-tile small { color: var(--text-2); font-size: 12.5px; }
.rep-games { display: grid; gap: 6px; }
.rep-game { display: grid; grid-template-columns: 28px minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.rep-game .emoji { font-size: 20px; }
.rg-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rg-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.rg-n { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.rep-table-wrap { overflow-x: auto; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rep-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.rep-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rep-table tr.off td { color: var(--text-3); }
.rep-who { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.rep-days { display: inline-flex; gap: 3px; }
.rep-days i { width: 9px; height: 9px; border-radius: 3px; background: var(--surface-3); }
.rep-days i.on { background: var(--green); }
@media (max-width: 640px) { .rep-game { grid-template-columns: 26px 1fr auto; } .rep-game .rg-bar { display: none; } }

/* Pinnwand als eigene Seite */
.pinboard.big { min-height: 420px; padding: 16px 20px 26px; }
.pinboard.big .pinboard-wall { gap: 30px 22px; padding-top: 14px; }
.pinboard.private { background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.12) 0 1px, transparent 2px) 0 0 / 17px 19px,
    radial-gradient(circle at 70% 60%, rgba(30,40,60,.18) 0 1px, transparent 2px) 0 0 / 23px 21px,
    linear-gradient(135deg, #8fa3a8, #7d939a 55%, #889ca2);
  box-shadow: inset 0 0 0 7px #5d6d72, inset 0 0 0 9px #4a585c, inset 0 6px 22px rgba(10,20,30,.35), var(--shadow); }
.pin-new { background: rgba(255,255,255,.9); color: #3d2a14; border-color: transparent; }
.pinboard-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 60px 20px; color: #fff8ec; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.pinboard-empty span { font-size: 46px; }
.pinboard-empty small { opacity: .9; max-width: 360px; }
.pin-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.pin-note:hover .pin-tools, .pin-note:focus-within .pin-tools { opacity: 1; }
@media (hover: none) { .pin-tools { opacity: .75; } }
.pin-tools button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.55); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.pin-tools button:hover { background: rgba(255,255,255,.9); }
.pin-by { font-size: 11.5px; opacity: .7; margin-left: auto; }
.pin-foot { margin-top: 10px; }
.pin-teaser { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-lg); text-decoration: none; color: #3d2a14;
  background: linear-gradient(135deg, #e9c99e, #d9b17f); box-shadow: inset 0 0 0 3px #b98654, var(--shadow); }
.pin-teaser .grow { display: grid; min-width: 0; }
.pin-teaser small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.pt-ico { font-size: 26px; }
:root[data-theme="dark"] .pin-teaser { filter: brightness(.85); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .pin-teaser { filter: brightness(.85); } }

/* =====================================================================
   Menü mit Bereichen (Übersicht · Schule · Spiele · Chats),
   Suchleiste, Mitarbeits-Protokoll, Schulmodus-Seite
   ===================================================================== */
.nav-scroll { display: grid; gap: 2px; align-content: start; overflow-y: auto; min-height: 0; margin: 0 -6px; padding: 0 6px 6px; }
.sidebar .brand { padding-bottom: 18px; }
.nav-group { display: grid; gap: 2px; }
.nav-grp { font-weight: 600; color: var(--text); }
.nav-grp .nav-caret { margin-left: auto; width: 16px; height: 16px; color: var(--text-3); transition: transform .2s var(--ease); transform: rotate(90deg); }
.nav-group.closed .nav-caret { transform: rotate(0deg); }
.nav-grp .badge { margin-left: auto; } .nav-grp .badge + .nav-caret { margin-left: 6px; }
.nav-subs { display: grid; gap: 1px; margin-left: 21px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-group.closed .nav-subs { display: none; }
.nav-item.nav-sub { min-height: 38px; padding: 7px 10px; font-size: 14px; gap: 10px; }
.nav-item.nav-sub .i { width: 18px; height: 18px; }
.nav-item .badge { margin-left: auto; }
.nav-key { margin-left: auto; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: #fff; font-size: 10.5px; font-weight: 800; }
.nav-item .badge + .nav-key { margin-left: 6px; }

/* Unterleiste (nur schmal, wenn die Seitenleiste fehlt) */
.subnav { display: none; }
@media (max-width: 900px) {
  .subnav:not([hidden]) { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -8px -20px 16px; padding: 2px 20px 6px; -webkit-overflow-scrolling: touch; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav-item { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); color: var(--text-2); font: 600 13px/1 var(--font); white-space: nowrap; }
  .subnav-item.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .subnav-item .badge { min-width: 18px; height: 18px; font-size: 10px; }
}

/* Suchleiste in der Kopfzeile */
.tb-search { order: -1; display: inline-flex; align-items: center; gap: 10px; height: 44px; min-width: 220px; padding: 0 10px 0 14px; border-radius: 14px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text-3); font: 500 14.5px/1 var(--font); cursor: text; box-shadow: var(--shadow); transition: border-color .15s, color .15s; }
.tb-search:hover { color: var(--text-2); border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.tb-search span { flex: 1; text-align: left; }
.tb-search kbd { font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--inset); color: var(--text-3); }
@media (max-width: 1100px) { .tb-search { min-width: 0; } .tb-search kbd { display: none; } }
@media (max-width: 640px) { .tb-search { width: 44px; padding: 0; justify-content: center; } .tb-search span { display: none; } }

/* Suchfenster */
.search-in { padding-right: 44px; }
.search-in::-webkit-search-cancel-button { display: none; }
.search-clear { position: absolute; right: 8px; top: 50%; translate: 0 -50%; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
.search-clear[hidden] { display: none; }
.search-scopes { margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.search-scopes .seg button { height: 32px; padding: 0 12px; font-size: 13px; }
.search-scopes .seg small { font-weight: 700; color: var(--text-3); }
.search-g small { font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.search-hit mark { background: color-mix(in srgb, var(--amber) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-none { display: grid; justify-items: center; gap: 6px; padding: 34px 10px; text-align: center; color: var(--text-2); }
.search-none .i { width: 28px; height: 28px; color: var(--text-3); }
.sq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.sq-tile { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: 500 14px/1.2 var(--font); text-align: left; cursor: pointer; }
.sq-tile:hover { background: var(--surface-2); }
.sq-tile .i { color: var(--text-3); flex: none; }
.sq-recent { display: flex; flex-wrap: wrap; gap: 6px; }
.sq-recent .chip-btn { height: 32px; padding: 0 12px; }
.search-foot { display: flex; gap: 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.search-foot kbd { font: 600 11px/1 var(--font); padding: 3px 6px; margin-right: 3px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface); }
@media (pointer: coarse) { .hide-touch { display: none !important; } }

/* Mitarbeit: Jetzt-Karte */
.work-live { display: grid; gap: 14px; margin-bottom: 16px; }
.wl-head { display: flex; align-items: center; gap: 12px; }
.wl-head .grow { display: grid; gap: 2px; min-width: 0; }
.wl-head small { color: var(--text-2); font-size: 13px; }
.wl-btns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.wl-btns button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; border-radius: 18px; border: 0; color: #fff; font-size: 30px; cursor: pointer; touch-action: manipulation; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.wl-btns button b { font-size: 16px; }
.wl-btns button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.wl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wl-foot .btn:first-of-type { margin-left: auto; }
.work-bar-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 14px; }
.work-bar-row .seg { max-width: 100%; overflow-x: auto; }
@media (max-width: 560px) { .wl-foot .btn:first-of-type { margin-left: 0; } .work-bar-row .seg { width: 100%; } .work-bar-row .seg button { flex: 1; justify-content: center; padding: 0 8px; font-size: 12.5px; } .wl-btns { grid-template-columns: 1fr 1fr; } .wl-btns button { flex-direction: column; gap: 2px; font-size: 26px; } }

/* Protokoll */
.proto-subjects { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.proto-subjects .chip-btn small { font-weight: 700; opacity: .65; }
.proto-all { margin-left: auto; }
@media (max-width: 560px) { .proto-all { margin-left: 0; width: 100%; } }
.proto-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: start; }
.proto-card { display: grid; gap: 12px; }
.proto-head { display: flex; align-items: flex-start; gap: 12px; }
.proto-head h3 { font-size: 19px; }
.proto-head small { color: var(--text-3); font-size: 12.5px; }
.proto-grade { display: grid; justify-items: center; flex: none; min-width: 64px; padding: 6px 10px; border-radius: 14px; background: var(--inset); border: 1px solid var(--border); }
.proto-grade small { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.proto-grade b { font: 600 26px/1.1 var(--font-display); }
.proto-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.proto-nums div { display: grid; gap: 2px; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); }
.proto-nums b { font: 600 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.proto-nums small { color: var(--text-2); font-size: 12px; }
.proto-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.proto-days { display: grid; gap: 6px; max-height: 420px; overflow: auto; padding-right: 2px; }
.pd { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.pd-date { display: grid; gap: 2px; } .pd-date small { color: var(--text-3); font-size: 11.5px; }
.pd-list { display: flex; flex-wrap: wrap; gap: 5px; align-content: start; }
.pd-e { position: relative; display: inline-grid; gap: 1px; padding: 5px 26px 5px 9px; border-radius: 10px; font-size: 13px; font-variant-numeric: tabular-nums; border: 1px solid var(--border); background: var(--card); }
.pd-e small { font-size: 10.5px; color: var(--text-3); }
.pd-e.hand { border-color: color-mix(in srgb, #2e9d57 40%, var(--card)); }
.pd-e.turn { border-color: color-mix(in srgb, #1f8a8a 45%, var(--card)); background: color-mix(in srgb, #1f8a8a 7%, var(--card)); }
.pd-del { position: absolute; right: 3px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; color: var(--text-3); display: grid; place-items: center; opacity: .7; }
.pd-del:hover { background: var(--surface-2); opacity: 1; }
.pd-del .i { width: 13px; height: 13px; }
.proto-hint { margin-top: 14px; max-width: 900px; }
.proto-export .btn { justify-content: flex-start; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }

/* Protokoll-Statistik */
.proto-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.proto-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg-h, .pt-h { background: #2e9d57; } .lg-t, .pt-t { background: #1f8a8a; }
.proto-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.proto-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.proto-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.proto-table .r { text-align: right; }
.proto-table td:nth-child(2) { min-width: 140px; width: 45%; }
.pt-bars { display: grid; gap: 2px; margin-bottom: 2px; }
.pt-bars span { display: block; height: 7px; border-radius: 0 4px 4px 0; min-width: 2px; }
.proto-table small { color: var(--text-3); font-size: 11.5px; }
:root[data-theme="dark"] .pt-h, :root[data-theme="dark"] .lg-h { background: #4fbf7a; }
:root[data-theme="dark"] .pt-t, :root[data-theme="dark"] .lg-t { background: #3fb3b3; }

/* Schulmodus-Seite */
.school-card { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.school-card .color-btn.big { width: 64px; height: 64px; font-size: 28px; }
.school-card .color-btn:not(.on) { filter: grayscale(.5); opacity: .75; }
.school-card .grow { display: grid; gap: 10px; justify-items: start; }
.school-card h2 { font-size: 24px; }
.school-card.on { border-color: color-mix(in srgb, #1e3a8a 40%, var(--card)); background: color-mix(in srgb, #1e3a8a 6%, var(--card)); }
.school-list { display: grid; gap: 8px; margin: 2px 0 12px; padding: 0; list-style: none; }
.school-list li { display: flex; align-items: center; gap: 10px; }

/* Zwei-Spalten-Raster für Statistik-Karten (große Karten mit span-2 über die volle Breite) */
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid.two > .span-2 { grid-column: 1 / -1; }
@media (max-width: 820px) { .grid.two { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 901px) { .games-switch .seg button { padding: 0 16px; } }
@media (min-width: 901px) and (max-width: 1250px) { .games-switch .seg button { padding: 0 11px; font-size: 14px; } }
/* Schmal: Rangliste und Statistik stehen schon in der Unterleiste */
@media (max-width: 900px) { .games-switch [data-v="rank"], .games-switch [data-v="stats"] { display: none; } }
@media (max-width: 640px) {
  .topbar-actions { display: grid; grid-template-columns: repeat(2, 44px); flex-shrink: 0; }
  .topbar-actions > :not(.btn):not(.tb-search) { grid-column: 1 / -1; justify-self: end; white-space: nowrap; order: -2; }
}

/* =====================================================================
   Lernmodus (Karteikarten): bunte Karten, Umdrehen, Wischen, Vorlesen
   ===================================================================== */
.ld-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ld-by { display: inline-flex; align-items: center; gap: 5px; }
.ld-by b { font-weight: 600; color: var(--text-2); }
.ld-by .avatar.xs { width: 18px; height: 18px; font-size: 8.5px; border-radius: 6px; }

.sx { position: relative; display: grid; gap: 14px; }
.sx-top { display: grid; gap: 10px; justify-items: center; }
.sx-top .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.sx-top .seg button { height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.sx-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; }
.sx-counts span { padding: 4px 10px; border-radius: 99px; background: var(--inset); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.sx-counts .sx-ok { color: var(--green); } .sx-counts .sx-no { color: var(--amber-text); }
.sx-combo { background: linear-gradient(90deg, #f4b942, #f0844c) !important; color: #fff; border: 0 !important; animation: sxPop .35s var(--ease); }
.sx-bar { width: 100%; height: 8px; border-radius: 4px; background: var(--inset); overflow: hidden; }
.sx-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4fbf7a, #3aa8a0); transition: width .35s var(--ease); }

.sx-stage { position: relative; height: clamp(250px, 42vh, 340px); margin: 6px 4px 4px; }
.sx-ghost { position: absolute; inset: 0; border-radius: 26px; background: hsl(var(--h) 60% 75%); opacity: .35; }
.sx-ghost.g1 { transform: translateY(8px) scale(.97) rotate(1.5deg); }
.sx-ghost.g2 { transform: translateY(16px) scale(.94) rotate(-2deg); opacity: .2; }
.sx-card { --yes: 0; --no: 0; position: absolute; inset: 0; perspective: 1400px; cursor: pointer; touch-action: pan-y; transition: transform .25s var(--ease), opacity .25s; outline: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.sx-card:focus-visible .sx-face { box-shadow: 0 0 0 3px var(--accent); }
.sx-face { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 30px 26px; border-radius: 26px; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); overflow: auto; }
.sx-face.front { color: #fff; background: radial-gradient(120% 90% at 15% 0%, hsl(var(--h) 90% 70%) 0%, transparent 60%), linear-gradient(140deg, hsl(var(--h) 72% 55%), hsl(calc(var(--h) + 45) 70% 48%));
  box-shadow: 0 18px 40px -16px hsl(var(--h) 70% 35% / .65), inset 0 1px 0 rgba(255,255,255,.35); }
.sx-face.back { transform: rotateY(180deg); background: var(--card); color: var(--text); border: 2px solid hsl(var(--h) 60% 60% / .55);
  box-shadow: 0 18px 40px -18px hsl(var(--h) 50% 30% / .45); }
.sx-card.flip .front { transform: rotateY(-180deg); }
.sx-card.flip .back { transform: rotateY(0); }
.sx-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.2); }
.sx-face.back .sx-tag { background: hsl(var(--h) 60% 55% / .14); color: hsl(var(--h) 45% 38%); }
:root[data-theme="dark"] .sx-face.back .sx-tag { color: hsl(var(--h) 60% 72%); }
.sx-word { font: 600 clamp(26px, 5vw, 40px)/1.2 var(--font-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.sx-word.long { font-size: clamp(18px, 3vw, 24px); font-family: var(--font); line-height: 1.4; }
.sx-ipa { font-size: 16px; opacity: .85; font-family: "Lucida Sans Unicode", "DejaVu Sans", var(--font); }
.sx-say { width: 50px; height: 50px; border-radius: 50%; border: 0; font-size: 22px; background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); cursor: pointer; transition: transform .15s; }
.sx-say:active { transform: scale(.9); }
.sx-face.back .sx-say { background: hsl(var(--h) 60% 55% / .14); box-shadow: none; }
.sx-hint { position: absolute; bottom: 14px; left: 0; right: 0; font-size: 12px; opacity: .7; }
.sx-face.back .sx-hint { color: var(--text-3); opacity: 1; }
.sx-stamp { position: absolute; top: 22px; padding: 6px 14px; border-radius: 10px; font: 800 18px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; border: 3px solid; pointer-events: none; z-index: 2; }
.sx-stamp.yes { right: 22px; color: #2e9d57; border-color: #2e9d57; background: rgba(255,255,255,.85); opacity: var(--yes); transform: rotate(8deg); }
.sx-stamp.no { left: 22px; color: #d9822b; border-color: #d9822b; background: rgba(255,255,255,.85); opacity: var(--no); transform: rotate(-8deg); }
.sx-card.fly-yes { transform: translateX(120%) rotate(18deg) !important; opacity: 0; }
.sx-card.fly-no { transform: translateX(-120%) rotate(-18deg) !important; opacity: 0; }

.sx-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; max-width: 460px; width: 100%; justify-self: center; }
.sx-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border-radius: 18px; border: 0; font-size: 20px; cursor: pointer; color: #fff; touch-action: manipulation; box-shadow: 0 4px 0 rgba(0,0,0,.18); transition: transform .1s; }
.sx-btn b { font-size: 16px; }
.sx-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.sx-btn.yes { background: #2e9d57; } .sx-btn.no { background: #d9822b; } .sx-btn.flip { background: var(--accent); color: var(--on-accent); }
.sx-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: 12.5px; color: var(--text-3); padding: 0 4px; }
.sx-by { display: inline-flex; align-items: center; gap: 6px; } .sx-by b { color: var(--text-2); font-weight: 600; }

.sx-done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 4px 0 2px; animation: sxPop .4s var(--ease); }
.sx-ring { position: relative; width: 132px; height: 132px; }
.sx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sx-ring circle { fill: none; stroke-width: 11; }
.sx-ring .bg { stroke: var(--inset); }
.sx-ring .fg { stroke: #4fbf7a; stroke-linecap: round; animation: sxRing 1s var(--ease) both; }
.sx-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 32px/1 var(--font-display); }
.sx-stars { display: flex; gap: 6px; font-size: 34px; }
.sx-stars span { filter: grayscale(1); opacity: .25; transform: scale(.7); }
.sx-stars span.on { filter: none; opacity: 1; animation: sxStar .5s var(--d) cubic-bezier(.3, 1.6, .5, 1) both; }
.sx-done h3 { font-size: 22px; }
.sx-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sx-stats div { display: grid; gap: 2px; min-width: 96px; padding: 10px 12px; border-radius: 14px; background: var(--inset); border: 1px solid var(--border); }
.sx-stats b { font: 600 20px/1.1 var(--font-display); } .sx-stats small { font-size: 11.5px; color: var(--text-3); }
.sx-hard { width: 100%; max-width: 520px; display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--card); max-height: 220px; overflow: auto; }
.sx-hard > small { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.sx-hard div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 14px; }
.sx-hard span { color: var(--text-2); text-align: right; }
.sx-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }

.sx-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.sx-confetti i { position: absolute; top: 35%; width: 9px; height: 14px; border-radius: 2px; animation: sxConf 1.5s cubic-bezier(.2, .7, .4, 1) both; }
@keyframes sxConf { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 30% { transform: translate(calc(var(--x) * .6), -140px) rotate(calc(var(--r) * .4)); } 100% { transform: translate(var(--x), 260px) rotate(var(--r)); opacity: 0; } }
@keyframes sxPop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sxStar { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1); } }
@keyframes sxRing { from { stroke-dashoffset: 330; } }
@media (max-width: 560px) { .sx-stage { height: clamp(230px, 46vh, 320px); } .sx-face { padding: 26px 18px; } .sx-btn { min-height: 52px; } }
@media (prefers-reduced-motion: reduce) { .sx-face, .sx-card { transition: none; } .sx-done, .sx-combo, .sx-stars span.on, .sx-ring .fg { animation: none; } }
.sx-stage { margin-bottom: 18px; }
.sx-q { position: absolute; top: 16px; left: 20px; right: 20px; font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-face.back { background: linear-gradient(180deg, hsl(var(--h) 70% 60% / .10), transparent 45%), var(--card); }
.sx-top .seg { flex-wrap: nowrap; }
@media (max-width: 560px) { .sx-top .seg button { padding: 0 8px; font-size: 12px; gap: 4px; } }

/* Schulmodus-Einstellungen */
.school-card .row.wrap { flex-wrap: wrap; gap: 8px; }
.school-lock { align-items: center; margin-bottom: 16px; }
.school-set.is-locked .card { opacity: .6; }
.school-set .card { display: grid; gap: 10px; align-content: start; }
.school-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.school-area { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 10px 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text-2); font: 500 14px/1.2 var(--font); text-align: left; cursor: pointer; }
.school-area span { flex: 1; }
.school-area i { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.school-area.on { color: var(--text); border-color: color-mix(in srgb, #1e3a8a 45%, var(--card)); background: color-mix(in srgb, #1e3a8a 7%, var(--card)); }
.school-area.on i { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
:root[data-theme="dark"] .school-area.on i { background: #5b7fd6; border-color: #5b7fd6; }
.school-area:disabled, .school-days button:disabled { cursor: not-allowed; }
.school-when { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sw-opt { position: relative; display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); cursor: pointer; }
.sw-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sw-opt b { font-size: 14px; } .sw-opt small { font-size: 12px; color: var(--text-3); }
.sw-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sw-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { .school-when { grid-template-columns: 1fr; } }
.school-set .set-row { min-height: 54px; padding: 8px 0; }
.time-in { width: 112px; }
.school-days { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.school-days button { width: 38px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text-2); font: 600 12.5px/1 var(--font); }
.school-days button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Mitarbeit ↔ Ruhemodus */
.wl-quiet { min-height: 0; padding: 10px 0 2px; }
.wl-quiet .txt b { display: inline-flex; align-items: center; gap: 6px; }
.quiet-work { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; animation: rise .6s .15s var(--ease) both; }
.quiet-work button { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border-radius: 20px; border: 0; color: #fff; font-size: 26px; cursor: pointer; touch-action: manipulation; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.quiet-work button span { font: 600 16px/1 var(--font); }
.quiet-work button b { font: 600 15px/1 var(--font); padding: 5px 9px; border-radius: 99px; background: rgba(255,255,255,.2); font-variant-numeric: tabular-nums; }
.quiet-work button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.quiet-work .qw-hand { background: #2e9d57; } .quiet-work .qw-turn { background: #1f8a8a; }
.quiet-work button.pop { animation: pgPop .3s; }
@media (max-width: 520px) { .quiet-work button { flex-direction: column; gap: 4px; font-size: 24px; min-height: 76px; } }

/* Ruhemodus: nur der Notfall-Knopf bleibt sichtbar, Einblenden nur beim Öffnen, alles passt auf den Bildschirm */
body.quiet-on .fab-school, body.quiet-on .fab-work { display: none !important; }
.quiet.shown .quiet-main, .quiet.shown .quiet-card, .quiet.shown .quiet-work { animation: none; }
.quiet { place-items: safe center; overflow-y: auto; scrollbar-width: none; }
.quiet::-webkit-scrollbar { display: none; }
.quiet:has(.quiet-work) .quiet-inner { gap: clamp(12px, 2.4vh, 28px); }
.quiet:has(.quiet-work) .quiet-left { font-size: clamp(60px, min(15vw, 15vh), 160px); }
@media (max-height: 900px) { .quiet:has(.quiet-work) .quiet-card:nth-child(n+3) { display: none; } }
@media (max-height: 720px) { .quiet:has(.quiet-work) .quiet-card:nth-child(n+2) { display: none; } }

/* Chat-Kanäle */
.room-icon.upd { background: color-mix(in srgb, #c98a1b 18%, var(--card)); color: #b27512; }
.room-icon.fix { background: color-mix(in srgb, #2f8f5b 18%, var(--card)); color: #2f8f5b; }
.room-prof-img.ph.upd { color: #b27512; } .room-prof-img.ph.fix { color: #2f8f5b; }

/* Melden */
.rp { display: grid; gap: 16px; max-width: 760px; }
.rp-card { display: grid; gap: 16px; }
.rp-intro { display: flex; gap: 14px; align-items: flex-start; }
.rp-intro p { margin: 4px 0 0; font-size: 14px; }
.rp-env { font-size: 34px; line-height: 1; }
.rp-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rp-kind { position: relative; display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rp-kind input { position: absolute; opacity: 0; pointer-events: none; }
.rp-kind b { font-size: 14.5px; } .rp-kind small { font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.rp-kind.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rp-kind:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp-emo { font-size: 24px; line-height: 1.1; } .rp-emo.sm { font-size: 20px; }
@media (max-width: 560px) { .rp-kinds { grid-template-columns: 1fr; } .rp-kind { grid-template-columns: auto 1fr; column-gap: 10px; } .rp-kind .rp-emo { grid-row: span 2; align-self: center; } }
.rp-card textarea { resize: vertical; min-height: 110px; }
.rp-send { align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-send .i { vertical-align: -2px; }
.rp-mine { display: grid; gap: 4px; }
.rp-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.rp-row .grow { display: grid; gap: 2px; min-width: 0; }
.rp-row .grow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-letters { display: grid; gap: 12px; }
.rp-letter { display: grid; gap: 10px; border-left: 4px solid var(--border-strong); }
.rp-letter.k-bug { border-left-color: #2f8f5b; } .rp-letter.k-user { border-left-color: #c0473a; } .rp-letter.k-other { border-left-color: #5b7fd6; }
.rp-letter.new { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow, none); }
.rp-letter.done { opacity: .68; }
.rp-letter header { display: flex; gap: 12px; align-items: center; }
.rp-letter header .grow { display: grid; gap: 2px; min-width: 0; }
.rp-about { color: #c0473a; }
.rp-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.rp-act { gap: 8px; }
.rp-send > span { display: inline-flex; align-items: center; gap: 6px; }
.rp .games-switch { justify-content: flex-start; }

/* ---------- Arena: neue Minispiele (Spielfenster, Gegnerbild, Trainingsseite) ---------- */
.ar-layer {
  position: fixed; inset: 0; z-index: 8800; display: grid; gap: 10px;
  grid-template: "head head" auto "main side" minmax(0, 1fr) / minmax(0, 1fr) auto;
  padding: calc(10px + var(--sat)) calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal));
  background: radial-gradient(900px 600px at 20% 0%, #2a2346, transparent 60%), #0e0c18; color: #f3f0ff;
  touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; animation: fadeIn .2s ease both;
}
body.ar-on { overflow: hidden; }
body.ar-on .fab-school, body.ar-on .fab-work { display: none !important; }
.ar-head { grid-area: head; display: flex; align-items: center; gap: 12px; min-height: 44px; padding-right: 140px; }
.ar-who { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; min-width: 0; }
.ar-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-info { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ar-res { font-weight: 700; font-size: 15px; }
.ar-x { position: absolute; top: calc(10px + var(--sat)); right: calc(84px + var(--sar)); width: 44px; height: 44px; border-radius: 14px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ar-main { grid-area: main; min-height: 0; min-width: 0; display: grid; }
.ar-stage { width: 100%; height: 100%; display: grid; place-items: center; min-height: 0; }
.ar-cv { display: block; border-radius: 22px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.08); touch-action: none; cursor: pointer; }
.ar-side { grid-area: side; width: clamp(150px, 24vw, 300px); display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ar-side .ar-who { font-size: 13.5px; opacity: .9; }
.ar-mir { flex: 1; min-height: 0; }
.ar-mirror { width: 100%; height: 100%; display: grid; align-content: start; justify-items: center; }
.ar-mirror canvas { display: block; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.ar-ghost { font-size: 22px; }
body.quiet-on .ar-layer { display: none; }
/* Handy hochkant: Gegnerbild klein oben rechts */
@media (max-width: 640px) and (orientation: portrait) {
  .ar-layer { grid-template: "head" auto "main" minmax(0, 1fr) / minmax(0, 1fr); }
  .ar-head { padding-right: 96px; min-height: 120px; align-items: flex-start; flex-wrap: wrap; padding-top: 52px; }
  .ar-x { right: auto; left: calc(12px + var(--sal)); }
  .ar-head .ar-who.me { position: absolute; top: calc(18px + var(--sat)); left: calc(66px + var(--sal)); }
  .ar-side { position: absolute; top: calc(78px + var(--sat)); right: calc(12px + var(--sar)); width: 84px; gap: 2px; }
  .ar-side .ar-who { font-size: 11px; } .ar-side .ar-who .avatar { display: none; }
}

.ar-page { display: grid; gap: 16px; }
.ar-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ar-hero p { margin: 4px 0 0; font-size: 14px; max-width: 640px; }
.ar-ghost-sw { gap: 10px; align-items: center; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ar-card { position: relative; overflow: hidden; display: grid; gap: 6px; justify-items: start; text-align: left; padding: 18px; cursor: pointer; border: 1px solid var(--border); transition: transform .15s var(--ease), box-shadow .2s; font: inherit; color: inherit; }
.ar-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--c); }
.ar-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--c) 80%, #000); }
.ar-card:active { transform: scale(.98); }
.ar-ic { font-size: 40px; line-height: 1; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.ar-card b { font-size: 17px; }
.ar-card small { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.ar-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }

/* ---------- Turnier-Event: Hinweis im Spielfenster, Zuschauen, Turnierbaum ---------- */
.ar-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.ar-ban-in { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 24px; border-radius: 24px;
  background: rgba(14,12,24,.9); box-shadow: 0 24px 60px -20px #000, 0 0 0 1px rgba(255,255,255,.12); animation: popIn .35s var(--ease) both; }
.ar-ban-in.won { box-shadow: 0 24px 60px -20px #000, 0 0 0 2px #51cf66; }
.ar-ban-in.lost { box-shadow: 0 24px 60px -20px #000, 0 0 0 2px #ff6b6b; }
.ar-ban-ic { font-size: 46px; line-height: 1; }
.ar-banner b { font-size: 22px; }
.ar-banner small { opacity: .75; font-size: 13.5px; }
.ar-ban-sc { font-size: 28px; font-weight: 800; color: #ffe066; font-variant-numeric: tabular-nums; }
.ar-ban-sc i, .cup-score i { font-style: normal; opacity: .6; margin: 0 4px; }
.cup-score { display: inline-flex; align-items: baseline; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 2px 14px; border-radius: 12px; background: rgba(255,255,255,.1); }
.ar-watch { grid-template: "head" auto "main" minmax(0, 1fr) / minmax(0, 1fr); }
.ar-duo { grid-area: main; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
.ar-duo-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.ar-duo .ar-mirror { justify-items: center; }
@media (max-width: 640px) and (orientation: portrait) {
  .ar-watch .ar-head { min-height: 0; padding-top: 52px; }
  .ar-duo { gap: 8px; }
  .ar-duo .ar-who { font-size: 12px; } .ar-duo .ar-who .avatar { display: none; }
}

.cup-stage { display: grid; gap: 14px; }
.cup-rules { list-style: none; margin: 4px auto; padding: 0; display: grid; gap: 8px; text-align: left; max-width: 520px; }
.cup-rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.cup-status { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--surface-2, rgba(127,127,127,.08)); }
.cup-status p { margin: 2px 0 0; font-size: 13.5px; }
.cup-st-ic { font-size: 34px; line-height: 1; }
.cup-tree { display: grid; grid-template-columns: repeat(var(--rounds), minmax(170px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.cup-col { display: flex; flex-direction: column; min-width: 0; }
.cup-col h4 { margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.cup-col-in { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.cup-m { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface, transparent); }
.cup-m.mine { border-color: var(--accent); }
.cup-m.live { box-shadow: 0 0 0 2px color-mix(in srgb, #e64980 45%, transparent); }
.cup-m.tbd { opacity: .5; border-style: dashed; }
.cup-p { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13.5px; min-width: 0; }
.cup-p + .cup-p { border-top: 1px solid var(--border); }
.cup-p .num { margin-left: auto; min-width: 18px; text-align: right; }
.cup-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cup-p.w { font-weight: 700; background: color-mix(in srgb, #2f9e44 12%, transparent); }
.cup-p.l, .cup-p.bye { opacity: .55; }
.cup-p.l .cup-nm { text-decoration: line-through; }
.cup-p.me .cup-nm::after { content: " (du)"; opacity: .6; font-weight: 400; }
.cup-m-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 8px; border-top: 1px solid var(--border); }
.cup-live { color: #e64980; font-size: 12px; font-weight: 700; }
.cup-hint { margin: 0; }
.cup-m-note { padding: 4px 10px 6px; font-size: 11.5px; opacity: .65; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .cup-tree { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .cup-col-in { justify-content: flex-start; }
  .cup-col + .cup-col { margin-top: 4px; }
}

/* ---------- Lerngruppe: Lernen gerade (Lern-Status, Gruppen-Chat) ---------- */
.ln-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: ln-pulse 2s infinite; flex: none; }
@keyframes ln-pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ln-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--inset); font-size: 14px; }
.ln-row.on { background: color-mix(in srgb, var(--green) 12%, var(--inset)); }
.ln-row .grow { min-width: 140px; }
.ln-faces { display: inline-flex; }
.ln-face { margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); }
.ln-face:first-child { margin-left: 0; }
.ln-more { margin-left: 4px; font-size: 12px; font-weight: 700; color: var(--text-2); align-self: center; }
.ln-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; border-left: 4px solid var(--green); }
.ln-banner .grow { display: grid; min-width: 180px; }
.ln-banner small { color: var(--text-2); }
.ln-center { text-align: center; }
.tb-learn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 13px; border: 1px solid color-mix(in srgb, var(--green) 45%, var(--border)); background: color-mix(in srgb, var(--green) 14%, var(--card)); color: var(--text); font: 600 13.5px var(--font); cursor: pointer; }
.tb-learn i { font-style: normal; }
@media (max-width: 600px) { .tb-learn span { display: none; } }

.lnow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); gap: 16px; align-items: start; }
.lnow-main { display: grid; gap: 14px; min-width: 0; }
.lnow-chat { position: sticky; top: 12px; min-width: 0; }
.lnow-chat .chat { min-height: 420px; }
.lnow-tabs { display: none; }
.lnow-head { padding: 16px 18px; display: grid; gap: 12px; }
.lnow-top { display: flex; align-items: center; gap: 10px; }
.lnow-top h2 { font: 600 21px/1.25 var(--font-display); }
.lnow-top .grow { min-width: 0; }
.lnow-people { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.ln-person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--inset); cursor: pointer; font-size: 13px; }
.ln-person.me { background: color-mix(in srgb, var(--green) 14%, var(--inset)); }
.ln-person i { font-style: normal; }
.ln-person small { color: var(--text-3); font-size: 11.5px; }
.lnow-hint { margin: 0; }
.lnow-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.lnow-acts .dnd-on { background: color-mix(in srgb, var(--violet) 18%, var(--card)); border-color: color-mix(in srgb, var(--violet) 45%, var(--border)); }
.learn-topic.solo { animation: none; }
.lnow-join { max-width: 560px; margin: 10px auto; padding: 26px 24px; display: grid; gap: 10px; text-align: center; }
.lnow-join h2 { font: 600 24px/1.2 var(--font-display); }
.lnow-join p { margin: 0; }
.lnow-join .ln-row { text-align: left; margin-top: 0; }
.lnow-join-ico { font-size: 44px; line-height: 1; }
.ln-warn { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--amber-text); font-size: 14px; }
.ln-check { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 12px; border-radius: var(--r-md); background: var(--inset); cursor: pointer; }
.ln-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.ln-check span { display: grid; }
.ln-check small { color: var(--text-2); }
.lnow-join-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.chat.solo { grid-template-columns: minmax(0, 1fr); }
.chat.solo .chat-side, .chat.solo .chat-back { display: none !important; }
.chat.solo .chat-main { display: flex !important; }
.room-icon.learn { background: var(--green); color: #fff; }
.presence.learn { background: var(--green) !important; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px color-mix(in srgb, var(--green) 40%, transparent); }
.r-learn { color: var(--text-2); }
.prof-learn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--green) 12%, var(--inset)); margin: 0 0 12px; }
@media (max-width: 999px) {
  .lnow { grid-template-columns: minmax(0, 1fr); }
  .lnow-tabs { display: flex; width: 100%; }
  .lnow-tabs button { flex: 1; justify-content: center; }
  .lnow-tabs .badge { margin-left: 2px; }
  .lnow[data-tab="mat"] .lnow-chat, .lnow[data-tab="chat"] .lnow-mat, .lnow[data-tab="chat"] .lnow-head { display: none; }
  .lnow-chat { position: static; }
}

/* ---------- Sprachnachrichten ---------- */
.voice-bar { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--card); border-top: 1px solid var(--border); }
.voice-bar[hidden] { display: none; }
.voice-bar .btn.icon { height: 48px; width: 48px; border-radius: 15px; }
.voice-rec { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.voice-rec i { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: vc-blink 1s infinite; }
.voice-rec b { font-variant-numeric: tabular-nums; }
@keyframes vc-blink { 50% { opacity: .25; } }
.bubble.voice { display: flex; align-items: center; gap: 10px; min-width: 210px; flex-wrap: wrap; }
.bubble.voice .reply-q { flex: 1 0 100%; }
.bubble.voice .tm { margin-top: 0; }
.vc-play { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); cursor: pointer; flex: none; }
.vc-play.load { opacity: .5; }
.vc-play svg { width: 18px; height: 18px; }
.msg-row.mine .vc-play { background: var(--on-accent); color: var(--accent); }
.vc-track { flex: 1; display: grid; gap: 4px; min-width: 110px; }
.vc-bar { height: 5px; border-radius: 3px; background: color-mix(in srgb, currentColor 20%, transparent); overflow: hidden; }
.vc-bar i { display: block; height: 100%; width: 0; background: currentColor; border-radius: 3px; transition: width .25s linear; }
.vc-t { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
/* Wie bei WhatsApp: leeres Feld → Mikrofon, sonst Senden */
.composer.voice-on:has([data-input]:placeholder-shown) > button.primary { display: none; }
.composer:has([data-input]:not(:placeholder-shown)) [data-mic] { display: none; }

/* Lernen = Vollbild: kein Menü, keine Kopfzeile, bis man „Aufhören“ drückt */
body.learn-focus .app { grid-template-columns: minmax(0, 1fr); }
body.learn-focus #sidebar, body.learn-focus #tabbar, body.learn-focus #subnav, body.learn-focus #topbar { display: none !important; }
body.learn-focus .content { padding: 16px clamp(12px, 2.5vw, 28px) calc(16px + env(safe-area-inset-bottom)); }
body.learn-focus .page { max-width: 1500px; }
body.learn-focus:has(#panicBtn:not([hidden])) .page { padding-right: 64px; }
body.learn-focus .lnow-top [data-go="learn"] { display: none; }
@media (max-width: 999px) {
  body.learn-focus:has(#panicBtn:not([hidden])) .page { padding-right: 0; }
  body.learn-focus:has(#panicBtn:not([hidden])) .lnow-top { padding-right: 52px; }
  body.learn-focus:has(#panicBtn:not([hidden])) .lnow[data-tab="chat"] .lnow-tabs { width: calc(100% - 58px); }
}

/* ---------- Plyon-Gruppen: Wechsler, Assistent, Einladen ---------- */
.brand-txt { min-width: 0; display: grid; }
.grp-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin-top: 3px; padding: 3px 8px 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--inset); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; justify-self: start; }
.grp-chip:hover { border-color: var(--border-strong); color: var(--text); }
.grp-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.grp-badge { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--grad-soft, var(--inset));
  border: 1px solid var(--border); font: 700 13px/1 var(--font); letter-spacing: .02em; color: var(--text); }
.grp-badge.lg { width: 52px; height: 52px; border-radius: 16px; font-size: 16px; }
.grp-list { display: grid; gap: 8px; }
.grp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); color: var(--text); text-align: left; }
.grp-row:hover { border-color: var(--border-strong); }
.grp-row.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.grp-row b { display: block; }
.grp-row small { color: var(--text-3); }
.grp-cur { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--green); font-weight: 600; white-space: nowrap; }
.grp-adm { color: var(--violet); font-weight: 600; }
.grp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.grp-actions .btn { flex: 1 1 180px; justify-content: center; }
.grp-invite { width: 100%; justify-content: center; margin-top: 10px; }
.grp-code { font: 700 38px/1 var(--font-mono); letter-spacing: .18em; text-align: center; padding: 18px 10px; margin: 12px 0; border-radius: var(--r-lg);
  background: var(--inset); border: 1px dashed var(--border-strong); user-select: all; }
.grp-code.sm { font-size: 26px; padding: 12px 18px; margin: 0; }
.grp-codebox { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.grp-link { display: flex; gap: 8px; }
.grp-link .input { flex: 1; min-width: 0; font-size: 13px; }
.grp-form { display: grid; gap: 12px; }
.code-in { font: 600 22px/1.2 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; text-align: center; }
.code-in::placeholder { letter-spacing: .04em; font-size: 16px; font-family: var(--font); text-transform: none; }
.grp-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.grp-head .txt { display: grid; }
.grp-head .txt span { color: var(--text-3); font-size: 13px; }
.grp-edit { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr auto; gap: 10px; align-items: end; }
@media (max-width: 720px) { .grp-edit { grid-template-columns: 1fr; } }
.tag.soft { opacity: .7; }

/* Assistent */
.wz { display: grid; gap: 16px; }
.wz-steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; counter-reset: s; }
.wz-steps li { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.wz-steps li span { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--inset); border: 1px solid var(--border); font-size: 11.5px; }
.wz-steps li.on { color: var(--text); }
.wz-steps li.on span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.wz-steps li.done span { background: var(--green); color: #fff; border-color: var(--green); }
.wz-body { display: grid; gap: 14px; }
.wz-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 620px) { .wz-kinds { grid-template-columns: 1fr; } }
.wz-kind { display: grid; justify-items: start; gap: 6px; padding: 16px; text-align: left; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); color: var(--text); }
.wz-kind:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.wz-kind.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wz-kind small { color: var(--text-3); line-height: 1.35; }
.wz-emo { font-size: 30px; line-height: 1; }
.wz-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 560px) { .wz-seg { grid-template-columns: 1fr; } }
.wz-seg button { display: grid; gap: 2px; padding: 10px 12px; text-align: left; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); color: var(--text); }
.wz-seg button small { color: var(--text-3); }
.wz-seg button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* Assistent: Zeiten – Felder dürfen nie übereinander rutschen (minmax(0, 1fr) + min-width: 0) */
.wz-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wz-row .field, .wz-row .input { min-width: 0; width: 100%; }
@media (max-width: 700px) { .wz-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wz-blocks { display: grid; gap: 0; }
/* ein Block pro Zeile, dazwischen die Pause – auf dem iPad sind das normale Textfelder (keine Uhr-Felder, die überlaufen) */
.wz-b { display: grid; grid-template-columns: minmax(70px, 110px) minmax(0, 96px) auto minmax(0, 96px) minmax(0, 1fr); align-items: center; gap: 8px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.wz-b > em { font-style: normal; color: var(--text-3); font-size: 13.5px; }
.wz-b > small { color: var(--text-3); font-size: 12.5px; text-align: right; }
.wz-b .input, .wz-p .input { min-width: 0; width: 100%; text-align: center; padding-left: 6px; padding-right: 6px; font-variant-numeric: tabular-nums; }
.wz-p { display: flex; align-items: center; gap: 8px; margin: 0 0 0 26px; padding: 6px 0 6px 16px; border-left: 2px dashed var(--border-strong); color: var(--text-2); font-size: 13.5px; }
.wz-p .input { width: 64px; height: 36px; }
.wz-blocks > .row { margin-top: 10px; }
@media (max-width: 520px) {
  .wz-b { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .wz-b > b { grid-column: 1 / 3; }
  .wz-b > small { grid-column: 3; grid-row: 1; }
}

/* Anmeldung: bekannte Konten, Wechsel zu „Neu bei Plyon“ */
.who-k { position: relative; display: grid; }
.who-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  border: 0 !important; background: transparent !important; min-height: 0 !important; padding: 0 !important; color: var(--text-3) !important; opacity: .6; }
.who-x:hover { opacity: 1; }
.login-alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13.5px; }
.login-card.wrong .input { animation: shake .35s; }
.login-card .field small { font-weight: 400; }

/* Über Plyon */
.about { display: grid; gap: 14px; }
.about-head { display: flex; align-items: center; gap: 12px; }
.about-head > div { display: grid; }
.about-head b { font: 600 20px/1.1 var(--font-display); }
.about-head span { color: var(--text-3); font-size: 13px; }
.about-news { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.about-news li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.about-news li time { color: var(--text-3); font-size: 12.5px; }
.about-news li p { grid-column: 1 / -1; margin: 2px 0 0; white-space: pre-wrap; line-height: 1.45; }
.an-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--inset); }
.an-tag.upd { color: var(--violet); }
.an-tag.fix { color: var(--green); }
.about-post, .about-bug { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.about-bug { border-style: solid; }
.about-post .btn, .about-bug .btn { justify-self: end; }

/* Konto- und Gruppenzeile: auf dem Handy rutscht der Knopf unter den Text */
@media (max-width: 560px) {
  .set-row.wrap-btn { flex-wrap: wrap; }
  .set-row.wrap-btn .txt { flex: 1 1 calc(100% - 80px); }
  .set-row.wrap-btn > .btn { flex: 1 1 100%; justify-content: center; }
}

/* Operator-Übersicht */
.op-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.op-tile { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); color: var(--text); text-decoration: none; }
.op-tile b { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; }
.op-tile span { font-weight: 600; }
.op-tile small { color: var(--text-3); }
a.op-tile:hover { border-color: var(--border-strong); }
.op-tabs { margin-bottom: 12px; }
.op-tabs small { color: var(--text-3); font-weight: 500; }
.op-search { width: 100%; margin-bottom: 10px; }
.op-list { display: grid; gap: 8px; margin-bottom: 16px; }
.op-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.op-row[hidden] { display: none; }
.op-row .grow { flex: 1; min-width: 0; display: grid; gap: 1px; }
.op-row small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.op-acts { display: flex; gap: 6px; flex: none; }
.op-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; vertical-align: 1px; background: var(--inset); color: var(--text-2); }
.op-tag.op { background: color-mix(in srgb, var(--violet) 15%, var(--card)); color: var(--violet); }
.op-tag.warn { background: color-mix(in srgb, var(--orange, #d98a2b) 15%, var(--card)); color: var(--orange, #b8741f); }
.op-tag.off { background: color-mix(in srgb, var(--red) 12%, var(--card)); color: var(--red); }
@media (max-width: 560px) { .op-row { flex-wrap: wrap; } .op-acts { width: 100%; justify-content: flex-end; } }
.login-card .btn.ghost { justify-self: center; }
button.link { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; cursor: pointer; font: inherit; }
@media (max-width: 560px) {
  .op-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .op-tile { padding: 10px 12px; }
  .op-tile b { font-size: 22px; }
  .op-tile small { font-size: 11.5px; }
}

/* Zugangsdaten nach dem Anlegen eines Kontos */
.cred { display: grid; gap: 8px; margin: 12px 0; padding: 14px 16px; border-radius: var(--r-lg); background: var(--inset); border: 1px dashed var(--border-strong); }
.cred div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cred span { color: var(--text-3); }
.cred b { word-break: break-all; }
.cred .mono { font-family: var(--font-mono); letter-spacing: .04em; }

/* Kopfzeile auf dem iPad (und schmalen Laptops): Titel oben, darunter eine ordentliche Reihe
   mit Suche, Wochen-Hinweis und Knöpfen – statt drei Ebenen durcheinander neben den X/Z-Knöpfen */
@media (min-width: 641px) and (max-width: 1399px) {
  .topbar, body.has-fabs .topbar, body.has-panic .topbar { flex-wrap: wrap; align-items: flex-end; padding-right: 0; row-gap: 14px; }
  .topbar .tb-title { flex: 1 1 auto; min-width: 0; padding-right: calc(var(--fab-space, 60px) + 8px); }
  .topbar-actions { flex: 1 1 100%; margin-left: 0; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
  .topbar-actions .tb-search { flex: 1 1 auto; max-width: 440px; min-width: 0; margin-right: auto; }
  .topbar-actions > .chip { white-space: nowrap; }
}

/* ---------- Gruppe gründen: Assistent mit allen Einstellungen ---------- */
.wz-steps { flex-wrap: wrap; row-gap: 8px; }
.wz-steps li { flex: 1 1 auto; min-width: 0; }
.wz-steps li em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .wz-steps li:not(.on) em { display: none; } .wz-steps li { flex: 0 0 auto; } .wz-steps li.on { flex: 1 1 auto; } }
.wz-lead { font-size: 17px; font-weight: 650; margin: 0; }
.wz-body > p.faint { margin: -6px 0 0; }
.wz-later { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--inset); color: var(--text-2); font-size: 13.5px; }
.wz-later .i { flex: none; color: var(--accent); }
.wz-opt { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.wz-opt .txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.wz-opt .txt small { color: var(--text-3); line-height: 1.35; }
.wz-opt .seg { flex: none; }
@media (max-width: 520px) { .wz-opt:has(.seg) { flex-direction: column; align-items: stretch; } }
.wz-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 620px) { .wz-two { grid-template-columns: minmax(0, 1fr); } }
.wz-two .field small { font-weight: 400; line-height: 1.35; }
.wz-hol { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; background: var(--card); font-size: 13.5px; }
.wz-hol summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.wz-hol ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.wz-hol li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wz-hol li span { color: var(--text-3); }
.wz-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--inset); }
.wz-sub { font-size: 14px; }
.wz-sec { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.wz-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-tabs .seg { max-width: 100%; }
.wz-tabs [data-seg="day"] { flex: 1 1 auto; }
.wz-tabs [data-seg="day"] button { flex: 1; }
.d-short { display: none; }
@media (max-width: 760px) { .d-long { display: none; } .d-short { display: inline; } }
.wz-sched { display: grid; gap: 8px; }
.wz-sr { display: grid; grid-template-columns: 96px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.wz-sl { display: grid; line-height: 1.2; }
.wz-sl small { color: var(--text-3); font-size: 12px; }
@media (max-width: 620px) {
  .wz-sr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .wz-sr:last-child { border-bottom: 0; }
  .wz-sl { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  .wz-sr [data-cf$=",0"] { grid-column: 1 / -1; }
}
.wz-mem { display: grid; gap: 8px; }
.wz-m { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.wz-m.bad .input[data-mn] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.wz-adm { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
@media (max-width: 560px) { .wz-m { grid-template-columns: minmax(0, 1fr) auto auto; } .wz-m [data-mn] { grid-column: 1 / -1; } }
.wz-sum { display: grid; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.wz-sum-r { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.wz-sum-r:last-child { border-bottom: 0; }
.wz-sum-r > span { color: var(--text-3); font-size: 13.5px; }
.wz-sum-r > b { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) { .wz-sum-r { grid-template-columns: minmax(0, 1fr) auto; } .wz-sum-r > b { grid-column: 1; grid-row: 2; } .wz-sum-r .btn { grid-row: 1 / 3; grid-column: 2; } }
.wz-cred { max-height: 320px; overflow: auto; }
/* Offenes Fenster: X- und Z-Knopf nicht darüberlegen (der Notfall-Knopf bleibt) */
body:has(#modalLayer .modal-back) :is(.fab-school, .fab-work) { visibility: hidden; }
/* Level ohne Spiele: Schalter grau und nicht bedienbar */
.wz-opt.off { opacity: .55; }
.wz-opt.off .switch { pointer-events: none; }
.wz-opt > .color-btn { flex: none; }

/* =====================================================================
   Handy (bis 640 px): aufgeräumte Kopfzeile, Menüleiste fest unten,
   Notfall-Knopf unten rechts über der Menüleiste (buttons.js → panic-low)
   ===================================================================== */
@media (max-width: 640px) {
  .content { padding: 16px 16px calc(var(--tabbar-h) + 28px + var(--sab)); }
  /* Titel über die ganze Breite, darunter eine Reihe mit Umschalter und Knöpfen */
  .topbar, body.has-fabs .topbar, body.has-panic .topbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; padding-right: 0; min-height: 0; margin-bottom: 16px; }
  body.has-panic:not(.panic-low) .topbar .tb-title { padding-right: calc(var(--panic-space) - 12px); }
  .topbar h1 { font-size: 28px; }
  .topbar .sub { font-size: 13.5px; margin-top: 4px; }
  .topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 8px; margin-left: 0; min-width: 0; }
  .topbar-actions > :not(.btn):not(.tb-search) { grid-column: auto; justify-self: auto; order: -2; }
  .topbar-actions > .seg { flex: 1 1 100%; display: flex; }
  .topbar-actions > .seg button { flex: 1; justify-content: center; height: 36px; padding: 0 10px; }
  .topbar-actions .btn { height: 40px; min-height: 40px; }
  .topbar-actions .btn.icon, .topbar-actions .tb-search { width: 40px; padding: 0; justify-content: center; }
  /* Menüleiste: fest am unteren Rand, nicht durchsichtig – Karten verschwinden sauber dahinter */
  .tabbar {
    left: 0; right: 0; bottom: 0; transform: none; width: 100%;
    padding: 6px 8px calc(6px + var(--sab)); border-radius: 0; border-width: 1px 0 0;
    background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, .35);
  }
  .tab { min-height: 52px; padding: 7px 0 6px; }
  body.panic-low .panic-btn { right: 16px; }
  body.panic-low .content { padding-bottom: calc(var(--tabbar-h) + 72px + var(--sab)); }
  /* Offener Dialog: Knopf bleibt nutzbar, tritt aber zurück */
  body.panic-low:has(.modal-back) .panic-btn { opacity: .55; transform: scale(.8); }
  body.panic-low:has(.modal-back) .panic-btn:active { opacity: 1; }
}
/* Meldungen: Empfänger wählen, Antworten */
.rp-to { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
@media (max-width: 560px) { .rp-to { grid-template-columns: 1fr; } }
.rp-tonote { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; }
.rp-own { display: grid; gap: 8px; padding-bottom: 12px; }
.rp-own .rp-row { padding-bottom: 0; }
.rp-quote { padding-left: 32px; font-size: 14px; color: var(--text-2, inherit); }
.rp-thread { display: grid; gap: 8px; }
.rp-reply { display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--card)); border: 1px solid var(--border); margin-right: 32px; }
.rp-reply.me { margin: 0 0 0 32px; background: var(--card); }
.rp-reply.staff:not(.me) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.rp-answer { display: flex; gap: 8px; align-items: flex-end; }
.rp-answer textarea { flex: 1; min-height: 44px; resize: vertical; }
@media (max-width: 560px) { .rp-answer { flex-direction: column; align-items: stretch; } .rp-reply, .rp-reply.me { margin: 0; } }
