/* Tysons Schachschule – Schwarting Media 2026 */
:root {
  --bg: #24170d; --bg2: #2e1d10; --card: rgba(22,13,6,.58); --card2: rgba(34,20,9,.72); --line: rgba(255,222,180,.15);
  --text: #f7efe3; --muted: #d6c2a8; --gold: #f2b544; --gold2: #ffd98a; --green: #3ecf8e; --red: #ef6461; --blue: #5aa9e6; --violet: #b784d8;
  --light: #f0d9b5; --dark: #b58863; --r: 18px; --sh: 0 10px 30px rgba(0,0,0,.35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
body.theme-wald { --light: #eeeed2; --dark: #769656; }
body.theme-ozean { --light: #dee6ea; --dark: #7d97a8; }
body.theme-bonbon { --light: #fbe3ec; --dark: #d98aa9; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.5 var(--font);
  background: transparent;
  padding-bottom: calc(76px + var(--safe-b));
}
/* Holz-Hintergrund (Foto) für die ganze App, fest hinter dem Inhalt */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    linear-gradient(rgba(20,11,4,.22), rgba(20,11,4,.22)),
    url("bg01.webp") center center / cover no-repeat, #3a2616;
}
a { color: var(--gold2); }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
[hidden] { display: none !important; }

/* ---------- Kopf ---------- */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(34,20,9,.72); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-ico { width: 38px; height: 38px; padding: 4px; border-radius: 12px; background: linear-gradient(135deg, var(--gold), #e58b2b); box-shadow: 0 4px 14px rgba(242,181,68,.35); flex: none; }
.brand-t { display: flex; flex-direction: column; min-width: 0; }
.brand-t b { font-size: 1.05rem; white-space: nowrap; }
.brand-t small { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.top-r { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.1rem; }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; max-width: 170px; }
.me-chip .av { width: 32px; height: 32px; font-size: 1.1rem; }
.me-chip span.n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* ---------- Layout ---------- */
.view { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 22px 16px 30px; }
.view.enter { animation: viewIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.adm-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.sec-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.sec-t h2 { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card2); cursor: pointer; font-weight: 650; text-decoration: none; color: var(--text); transition: transform .12s, background .2s, box-shadow .2s;
  min-height: 46px; user-select: none;
}
.btn:hover { background: rgba(255,255,255,.14); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--gold), #e8912f); color: #231a08; border-color: transparent; box-shadow: 0 6px 18px rgba(242,181,68,.3); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(242,181,68,.45); }
.btn.green { background: linear-gradient(135deg, #46d898, #23a26a); color: #06200f; border-color: transparent; }
.btn.danger { background: rgba(239,100,97,.16); border-color: rgba(239,100,97,.4); color: #ffb3b1; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: .9rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: .85rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=password], input[type=number], select {
  font: inherit; color: var(--text); background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 46px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type=color] { width: 46px; height: 46px; border: 0; padding: 0; background: none; border-radius: 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }

/* ---------- Avatare ---------- */
.av { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; font-size: 1.5rem; flex: none;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%), var(--pc, var(--gold)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 3px 10px rgba(0,0,0,.3); }
.av.xl { width: 96px; height: 96px; font-size: 3.1rem; }
.av.lg { width: 64px; height: 64px; font-size: 2.1rem; }
.av.sm { width: 32px; height: 32px; font-size: 1.05rem; }

/* ---------- Login ---------- */
.login-wrap { min-height: calc(100vh - 170px); display: grid; place-items: center; }
.login { width: min(420px, 100%); text-align: center; padding: 32px 26px; position: relative; overflow: hidden; }
.login .hero-pieces, .who-head .hero-pieces { display: flex; justify-content: center; gap: 4px; margin: -6px 0 14px; }
.login .hero-pieces svg, .who-head .hero-pieces svg { width: 46px; height: 46px; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(0,0,0,.4)); }
.hero-pieces svg:nth-child(2) { animation-delay: .2s } .hero-pieces svg:nth-child(3) { animation-delay: .4s }
.hero-pieces svg:nth-child(4) { animation-delay: .6s } .hero-pieces svg:nth-child(5) { animation-delay: .8s }
@keyframes bob { 50% { transform: translateY(-7px); } }
.login form { margin-top: 18px; text-align: left; }
.login .err { color: #ffb3b1; min-height: 1.4em; font-size: .9rem; margin: 4px 0 8px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: .88rem; padding: 6px; }

/* ---------- Wer spielt ---------- */
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.who-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px 16px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; transition: transform .2s, border-color .2s, background .2s; text-align: center; }
.who-card:hover { transform: translateY(-4px); border-color: var(--pc); background: var(--card2); }
.who-card b { font-size: 1.1rem; }
.who-card .rt { font-size: .85rem; color: var(--muted); }
.who-card .av { transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.who-card:hover .av { transform: scale(1.12) rotate(-6deg); }

/* ---------- Start ---------- */
.hello { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hello .big-rating { margin-left: auto; text-align: right; }
.big-rating .num { font-size: 2.6rem; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-rating .lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; min-height: 150px; border-radius: 22px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: var(--card); overflow: hidden; transition: transform .2s, box-shadow .2s; cursor: pointer; }
.tile::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 140px; height: 140px; border-radius: 50%; background: var(--tc, var(--gold)); opacity: .16; transition: transform .4s; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.tile:hover::after { transform: scale(1.35); }
.tile .ti { font-size: 2rem; }
.tile b { font-size: 1.15rem; }
.tile span { color: var(--muted); font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat { background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.45rem; }
.stat span { font-size: .78rem; color: var(--muted); }
.spark { width: 100%; height: 70px; }

/* ---------- Abzeichen ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 999px; background: rgba(242,181,68,.12); border: 1px solid rgba(242,181,68,.35); font-size: .88rem; }
.badge i { font-style: normal; font-size: 1.25rem; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.25); }
.badge.locked { filter: grayscale(1); opacity: .38; background: var(--card); border-color: var(--line); }

/* ---------- Stufenwahl ---------- */
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.lvl { position: relative; padding: 16px 12px 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: center; transition: transform .15s, border-color .2s, background .2s; }
.lvl:hover { transform: translateY(-3px); }
.lvl.sel { border-color: var(--gold); background: rgba(242,181,68,.12); box-shadow: 0 0 0 4px rgba(242,181,68,.15); }
.lvl .e { font-size: 2.2rem; display: block; }
.lvl b { display: block; font-size: .98rem; }
.lvl small { color: var(--muted); }
.lvl .tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--green); color: #052014; font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.lvl .rec { font-size: .75rem; color: var(--gold2); display: block; margin-top: 2px; }
.seg { display: inline-flex; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card2); box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold2); }
.seg svg { width: 22px; height: 22px; }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mode-card { padding: 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.mode-card.sel { border-color: var(--gold); background: rgba(242,181,68,.1); }
.mode-card b { display: block; margin-bottom: 4px; }
.mode-card span { color: var(--muted); font-size: .88rem; }

/* ---------- Spiel ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.board-col { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.board-col > * { width: min(100%, calc(100vh - 330px), 680px); }
@supports (height: 100dvh) { .board-col > * { width: min(100%, calc(100dvh - 330px), 680px); } }
.pbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); min-height: 58px; transition: box-shadow .3s, border-color .3s; }
.pbar.turn { border-color: rgba(242,181,68,.6); box-shadow: 0 0 0 3px rgba(242,181,68,.12); }
.pbar .nm { font-weight: 700; line-height: 1.15; }
.pbar .nm small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.pbar .caps { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; }
.pbar .caps svg { width: 20px; height: 20px; margin-left: -5px; }
.pbar .caps .adv { margin-left: 6px; font-size: .85rem; color: var(--muted); font-weight: 700; }
.thinking { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: think 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s } .thinking i:nth-child(3) { animation-delay: .3s }
@keyframes think { 50% { transform: translateY(-4px); opacity: .4; } }

.board-wrap { position: relative; display: flex; gap: 8px; }
.evalbar { width: 14px; border-radius: 8px; overflow: hidden; background: #2b2926; position: relative; flex: none; border: 1px solid var(--line); }
.evalbar .w { position: absolute; left: 0; right: 0; bottom: 0; background: #f4efe6; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.evalbar .lbl { position: absolute; left: 50%; transform: translateX(-50%) rotate(-90deg); top: 50%; font-size: 9px; font-weight: 800; color: #888; white-space: nowrap; }
.board { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 0 6px rgba(0,0,0,.25); user-select: none; -webkit-user-select: none; touch-action: none; container-type: inline-size; }
.board .sqs { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.sq { position: relative; background: var(--light); }
.sq.d { background: var(--dark); }
.sq .co { position: absolute; font-size: max(9px, 2.1cqw); font-weight: 800; opacity: .75; pointer-events: none; }
.sq .co.f { right: 4%; bottom: 1%; } .sq .co.r { left: 4%; top: 1%; }
.sq.d .co { color: var(--light); } .sq:not(.d) .co { color: var(--dark); }
.sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(255,214,64,.42); }
.sq.sel::before { content: ""; position: absolute; inset: 0; background: rgba(90,169,230,.5); }
.sq.hl::before { content: ""; position: absolute; inset: 0; background: rgba(62,207,142,.45); }
.sq.check::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,40,40,.95) 0%, rgba(255,40,40,.55) 35%, transparent 72%); }
.sq.dot::after { content: ""; position: absolute; left: 35%; top: 35%; width: 30%; height: 30%; border-radius: 50%; background: rgba(20,30,25,.28); }
.sq.cap::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 max(4px, .9cqw) rgba(20,30,25,.3); }
.sq.hover { box-shadow: inset 0 0 0 max(3px, .6cqw) rgba(255,255,255,.75); }
.sq.star::after { content: "⭐"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 6.5cqw; animation: starPulse 1.4s ease-in-out infinite; }
@keyframes starPulse { 50% { transform: scale(1.15) rotate(8deg); } }
.board .pcs { position: absolute; inset: 0; pointer-events: none; }
.piece { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; transition: transform .2s cubic-bezier(.3,.7,.3,1); will-change: transform; z-index: 2; }
.piece svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 .5cqw .5cqw rgba(0,0,0,.28)); }
.piece.drag { transition: none; z-index: 10; }
.piece.drag svg { transform: scale(1.18); filter: drop-shadow(0 1.6cqw 1.4cqw rgba(0,0,0,.4)); }
.piece.gone { opacity: 0; transform-origin: center; transition: opacity .2s; }
.piece.pop svg { animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: scale(.3); } }
.board .arrows { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.board.shake, .shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.promo { position: absolute; inset: 0; z-index: 20; background: rgba(0,0,0,.55); display: grid; place-items: center; backdrop-filter: blur(2px); }
.promo .box { background: #3a2515; border: 1px solid var(--line); border-radius: 18px; padding: 14px; text-align: center; box-shadow: var(--sh); }
.promo .opts { display: flex; gap: 8px; margin-top: 8px; }
.promo button { width: 70px; height: 70px; border-radius: 14px; border: 1px solid var(--line); background: var(--light); cursor: pointer; padding: 4px; }
.promo button:hover { background: var(--gold2); }

.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.moves { max-height: 300px; overflow: auto; font-variant-numeric: tabular-nums; display: grid; grid-template-columns: 38px 1fr 1fr; gap: 2px 6px; font-size: .95rem; }
.moves .n { color: var(--muted); }
.moves .m { padding: 2px 6px; border-radius: 6px; cursor: default; }
.moves .m.cur { background: rgba(242,181,68,.25); color: var(--gold2); font-weight: 700; }
.moves .m.click { cursor: pointer; } .moves .m.click:hover { background: var(--card2); }
.ctrls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ctrls .btn { padding: 10px 6px; font-size: .88rem; flex-direction: column; gap: 2px; min-height: 58px; }
.ctrls .btn .ic { font-size: 1.2rem; }
.coach { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(90,169,230,.18), rgba(183,132,216,.14)); border: 1px solid rgba(90,169,230,.35); animation: viewIn .3s; }
.coach .face { font-size: 2rem; line-height: 1; }
.coach p { margin: 0 0 8px; }
.status-line { text-align: center; font-weight: 700; min-height: 1.5em; }

/* ---------- Rangliste ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; max-width: 620px; margin: 10px auto 26px; }
.pod { text-align: center; cursor: pointer; }
.pod .av { margin-bottom: 8px; }
.pod .blk { border-radius: 16px 16px 6px 6px; padding: 14px 6px 10px; background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04)); border: 1px solid var(--line); }
.pod.p1 .blk { height: 150px; background: linear-gradient(180deg, rgba(242,181,68,.5), rgba(242,181,68,.08)); border-color: rgba(242,181,68,.5); }
.pod.p2 .blk { height: 115px; background: linear-gradient(180deg, rgba(200,210,220,.4), rgba(200,210,220,.06)); }
.pod.p3 .blk { height: 90px; background: linear-gradient(180deg, rgba(205,127,50,.45), rgba(205,127,50,.06)); }
.pod .medal { font-size: 1.8rem; display: block; }
.pod b { display: block; }
.pod .v { font-size: 1.3rem; font-weight: 800; }
.pod.p1 .av { animation: bob 2.4s ease-in-out infinite; }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.rank-row:hover { background: var(--card2); }
.rank-row .pos { width: 28px; font-weight: 800; color: var(--muted); text-align: center; }
.rank-row .nm { flex: 1; min-width: 0; }
.rank-row .nm b { display: block; }
.rank-row .nm small { color: var(--muted); }
.rank-row .v { font-weight: 800; font-size: 1.2rem; text-align: right; }
.rank-row .v small { display: block; font-size: .75rem; font-weight: 600; }
.up { color: var(--green); } .down { color: var(--red); }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ---------- Listen ---------- */
.glist { display: flex; flex-direction: column; gap: 6px; }
.gitem { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.16); border: 1px solid var(--line); cursor: pointer; }
.gitem:hover { background: var(--card2); }
.gitem .res { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; flex: none; }
.res.w { background: rgba(62,207,142,.2); color: var(--green); } .res.l { background: rgba(239,100,97,.18); color: var(--red); } .res.d { background: rgba(255,255,255,.1); color: var(--muted); }
.gitem .t { flex: 1; min-width: 0; }
.gitem .t small { display: block; color: var(--muted); }
.gitem .dl { font-weight: 800; }

/* ---------- Rätsel ---------- */
.pz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.pz { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; font-weight: 700; cursor: pointer; transition: transform .15s; }
.pz:hover { transform: scale(1.08); }
.pz.ok { background: rgba(62,207,142,.22); border-color: rgba(62,207,142,.5); color: var(--green); }
.pz-task { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.pz-task .dotc { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0,0,0,.4); flex: none; }

/* ---------- Lernen ---------- */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lesson { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, background .2s; }
.lesson:hover { transform: translateY(-3px); background: var(--card2); }
.lesson svg { width: 48px; height: 48px; flex: none; }
.lesson .em { font-size: 2.1rem; width: 48px; text-align: center; flex: none; }
.lesson b { display: block; }
.lesson small { color: var(--muted); }
.lesson.done { border-color: rgba(62,207,142,.45); }
.lesson.done b::after { content: " ✓"; color: var(--green); }
.learn { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.learn .board-col > * { width: min(100%, calc(100vh - 230px), 600px); }
.prose p { margin: 0 0 .8em; }
.prose ul { margin: 0 0 .8em; padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.tip { padding: 12px 14px; border-radius: 14px; background: rgba(242,181,68,.1); border: 1px solid rgba(242,181,68,.3); }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.values div { text-align: center; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.18); }
.values svg { width: 44px; height: 44px; }
.values b { display: block; font-size: 1.3rem; color: var(--gold2); }

/* ---------- Admin ---------- */
.adm-players { display: flex; flex-direction: column; gap: 8px; }
.adm-p { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(0,0,0,.16); border: 1px solid var(--line); }
.adm-p.off { opacity: .5; }
.lvl-ratings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 1.3rem; cursor: pointer; }
.emoji-pick button.on { border-color: var(--gold); background: rgba(242,181,68,.2); }

/* ---------- Modal / Toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5,10,8,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal .dlg { width: min(460px, 100%); max-height: 90vh; overflow: auto; background: linear-gradient(180deg, #3d2716, #26170c); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: dlgIn .35s cubic-bezier(.3,1.4,.5,1); text-align: center; }
@keyframes dlgIn { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.dlg .big { font-size: 3.6rem; line-height: 1; margin-bottom: 8px; }
.dlg .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.dlg .left { text-align: left; }
.delta { display: inline-flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; padding: 10px 16px; border-radius: 14px; background: rgba(0,0,0,.25); margin: 6px 4px; }
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); z-index: 120; background: #22382f; border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; box-shadow: var(--sh); animation: toastIn .3s; max-width: calc(100% - 32px); text-align: center; }
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; width: 100%; height: 100%; }

/* ---------- Tabbar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; gap: 4px; padding: 8px 8px calc(8px + var(--safe-b)); background: rgba(34,20,9,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tabbar a span { font-size: 1.3rem; line-height: 1.2; transition: transform .2s; }
.tabbar a.on { color: var(--gold2); background: rgba(242,181,68,.1); }
.tabbar a.on span { transform: translateY(-2px) scale(1.1); }
.foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 40px; opacity: .7; }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .game, .learn { grid-template-columns: 1fr; }
  .side { position: static; }
  .board-col > *, .learn .board-col > * { width: min(100%, 600px); }
  .moves { max-height: 180px; }
}
@media (max-width: 560px) {
  .view { padding: 14px 10px 24px; }
  .brand-t small { display: none; }
  .card { padding: 14px; }
  .hello .big-rating { margin-left: 0; text-align: left; width: 100%; }
  .tile { min-height: 118px; padding: 16px; }
  .game { gap: 12px; }
  .pbar { min-height: 50px; padding: 6px 10px; }
  .pbar .av { width: 36px; height: 36px; font-size: 1.2rem; }
  .podium { gap: 6px; }
  .pod.p1 .blk { height: 120px; } .pod.p2 .blk { height: 95px; } .pod.p3 .blk { height: 75px; }
  .me-chip span.n { display: none; } .me-chip { padding: 4px; }
  .adm-p { grid-template-columns: 46px 1fr; }
  .adm-p > .row { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Figuren ---------- */
.pc { display: block; }
.pc-w .f { fill: url(#gw); stroke: #1d1b19; stroke-width: 1.4; stroke-linejoin: round; }
.pc-w .d { fill: none; stroke: #1d1b19; stroke-width: 1.2; stroke-linecap: round; }
.pc-w .e { fill: #1d1b19; }
.pc-b .f { fill: url(#gb); stroke: #0b0a09; stroke-width: 1.4; stroke-linejoin: round; }
.pc-b .d { fill: none; stroke: #e7dfcf; stroke-width: 1.1; stroke-linecap: round; opacity: .85; }
.pc-b .e { fill: #e7dfcf; }

/* v2: Spieler-Login */
.who-card .sub, .login .sub { display: block; font-size: .85rem; color: var(--muted); margin-top: -4px; }
.who-head { text-align: center; margin-top: 10px; }
.who-head .hero-pieces { margin: 4px 0 8px; }
.login .av.xl { margin: 0 auto 8px; }

/* v3: Schachpunkte + vorläufige Wertung */
.hello .hello-nums { margin-left: auto; display: flex; gap: 26px; align-items: flex-start; text-align: right; }
.hello .hello-nums .big-rating { margin-left: 0; text-align: right; }
.big-rating.xp .num { background: linear-gradient(135deg, #b9f0ff, #5aa9e6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-rating.prov .num { background: none; color: var(--muted); }
.big-rating.prov .bar { width: 130px; margin: 6px 0 3px auto; }
.delta .xpg { color: #8fd3ff; font-size: 1rem; }
@media (max-width: 560px) {
  .hello .hello-nums { margin-left: 0; width: 100%; justify-content: space-between; text-align: left; }
  .hello .hello-nums .big-rating { text-align: left; }
  .big-rating.prov .bar { margin-left: 0; }
  .hello .hello-nums .big-rating .num { font-size: 2.1rem; }
}


/* v6: Foto-Avatare (z. B. Krokodil) */
.av.av-img { overflow: hidden; padding: 0; background: #000; }
.av.av-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foot small { display: block; opacity: .7; font-size: .72rem; margin-top: 4px; }

/* v7: Hochkant-Bildschirme bekommen das gedrehte Holzbild, damit möglichst viel davon sichtbar ist */
@media (orientation: portrait) {
  body::before { background: linear-gradient(rgba(20,11,4,.22), rgba(20,11,4,.22)), url("bg01-hoch.webp") center center / cover no-repeat, #3a2616; }
}
