:root {
  --bg: #0b0614; --bg2: #140b24; --card: #1b1030; --card2: #241640; --line: #33224f;
  --text: #f3eefe; --muted: #b3a6cf; --pri: #a26bff; --pri2: #ec4899; --ok: #34d399; --bad: #f87171; --warn: #fbbf24; --hint: #38bdf8;
  --lt: #d9ccff; --dk: #7656d6; --anim: .2s;
  color-scheme: dark;
}
html[data-board-theme="holz"] { --lt: #efd8b0; --dk: #b07d4f; }
html[data-board-theme="wiese"] { --lt: #e4ead0; --dk: #6e9a5c; }
html[data-board-theme="ozean"] { --lt: #dce8f0; --dk: #5f8fb0; }
html[data-board-theme="pink"] { --lt: #ffd9ec; --dk: #cf5c9c; }
html[data-board-theme="nacht"] { --lt: #5a5378; --dk: #2c2740; }
html[data-board-theme="eis"] { --lt: #f0f7ff; --dk: #8db6dd; }
html[data-board-theme="sunset"] { --lt: #ffe1c2; --dk: #e07a5f; }
html[data-board-theme="edelholz"] {
  --lt: #e4c596; --dk: #8e5c35;
  --wood-lt: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='f' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='0.11 0.006' numOctaves='4' seed='7'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .37  0 0 0 0 .19  1.7 0 0 0 -.62'/></filter><rect width='240' height='240' fill='%23e4c596'/><rect width='240' height='240' filter='url(%23f)'/></svg>");
  --wood-dk: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='f' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='0.09 0.005' numOctaves='4' seed='19'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .17  0 0 0 0 .07  1.7 0 0 0 -.55'/></filter><rect width='240' height='240' fill='%238e5c35'/><rect width='240' height='240' filter='url(%23f)'/></svg>");
}
html[data-board-theme="edelholz"] .sq.lt { background: var(--wood-lt) 0 0 / 300% 300%, var(--lt); }
html[data-board-theme="edelholz"] .sq.dk { background: var(--wood-dk) 0 0 / 300% 300%, var(--dk); }
html[data-board-theme="edelholz"] .sq:nth-child(3n+1) { background-position: 40% 70%; }
html[data-board-theme="edelholz"] .sq:nth-child(3n+2) { background-position: 85% 15%; }
html[data-board-theme="edelholz"] .sq:nth-child(5n) { background-position: 15% 45%; }
html[data-board-theme="edelholz"] .sq:nth-child(7n) { background-position: 65% 95%; }
html[data-board-theme="edelholz"] .sq.chk::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, #ff3b3bdd 0%, #ff3b3b88 35%, transparent 70%); }
html[data-board-theme="edelholz"] .cb { box-shadow: 0 18px 50px #0009, 0 0 0 3px #3b2414, 0 0 0 4px #ffffff10; }
html[data-board-theme="edelholz"] .co { color: #f6e6c8; opacity: .85; }
html[data-board-theme="edelholz"] .sq.lt .co { color: #7a4f2c; }
html[data-pieces="edelholz"] .pc { -webkit-text-stroke: 0; text-shadow: none; }
html[data-pieces="edelholz"] .pc img { width: 100%; height: 100%; filter: drop-shadow(0 3px 2px #0007); }
.sw.sw-wood::before { background: conic-gradient(#e4c596 0 25%, #8e5c35 0 50%, #e4c596 0 75%, #8e5c35 0) 0 0 / 50% 100%; }
.kit-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.kit { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem .5rem .5rem; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.kit:hover { border-color: #a26bff88; }
.kit.on { border-color: var(--pri); box-shadow: 0 0 0 2px var(--pri) inset; }
.kit-prev { width: 3.2rem; height: 3.2rem; border-radius: 8px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; box-shadow: 0 0 0 2px #3b2414; }
.kit-prev i { display: grid; place-items: center; background: #e4c596; }
.kit-prev i:nth-child(2), .kit-prev i:nth-child(3) { background: #8e5c35; }
.kit-prev img { width: 92%; height: 92%; }
.kit small { display: block; color: var(--muted); font-size: .75rem; }
.bot-custom { cursor: pointer; grid-template-areas: "av nm" "av elo" "rg rg" "tx tx" "rec rec"; }
.bot-custom #bot-elo-in { width: 5.2rem; padding: .25rem .4rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-size: .9rem; font-weight: 700; }
.bot-custom #bot-elo-in:focus { outline: 2px solid var(--pri); outline-offset: 1px; }
.bot-custom #bot-elo-range { grid-area: rg; width: 100%; margin-top: .45rem; accent-color: var(--pri); }
html[data-anim="fast"] { --anim: .1s; }
html[data-anim="off"] { --anim: 0s; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #3b1a6e55, transparent 60%), radial-gradient(900px 500px at 110% 10%, #ec489933, transparent 60%), var(--bg);
  -webkit-tap-highlight-color: transparent;
}
a { color: #d4b8ff; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.6rem; }
.sub { color: var(--muted); margin: 0 0 1rem; }
.fine { color: var(--muted); font-size: .82rem; }
.center { text-align: center; }
small { color: var(--muted); }

/* ---------- Kopf ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: #0b0614cc; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.logo b { color: var(--pri2); } .logo em { font-style: normal; color: var(--pri); }
.logo-pc { font-family: "Noto Sans Symbols 2", "Segoe UI Symbol", serif; font-size: 1.7rem; color: #fff; text-shadow: 0 0 12px var(--pri), 0 0 24px var(--pri2); }
.nav { display: flex; gap: .25rem; margin: 0 auto; }
.nav a { display: flex; align-items: center; gap: .35rem; padding: .5rem .8rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .2s, color .2s; }
.nav a:hover { color: var(--text); background: #ffffff0d; }
.nav a.on { color: #fff; background: linear-gradient(135deg, var(--pri), var(--pri2)); box-shadow: 0 4px 18px #a26bff55; }
.back { color: var(--muted); text-decoration: none; font-size: .85rem; white-space: nowrap; }
main { max-width: 1240px; margin: 0 auto; padding: 1.2rem 1rem 6rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .6rem .95rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; transition: transform .12s, background .2s, border-color .2s; }
.btn:hover { border-color: var(--pri); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.pri { background: linear-gradient(135deg, var(--pri), var(--pri2)); border-color: transparent; box-shadow: 0 6px 20px #a26bff44; }
.btn.big { padding: .85rem 1.4rem; font-size: 1rem; }
.btn.small { padding: .3rem .6rem; font-size: .8rem; }
.btn.wide { width: 100%; }
.btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; }
.chip { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { border-color: var(--pri); background: #a26bff33; box-shadow: 0 0 0 1px var(--pri) inset; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { display: inline-block; padding: .2rem .6rem; border-radius: 999px; background: #a26bff26; color: #dcc8ff; font-size: .8rem; font-weight: 600; }

/* ---------- Layout Spielen ---------- */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; align-items: start; transition: filter .3s; }
.play.blur { filter: blur(3px) brightness(.6); pointer-events: none; }
.play-left { min-width: 0; }
.board-row { display: flex; gap: .5rem; align-items: stretch; }
.board-wrap { flex: 1; max-width: min(82vh, 760px); }
.board-wrap.solo { margin: 0 auto; width: 100%; max-width: min(80vh, 680px); }
.panel { display: flex; flex-direction: column; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1rem; position: sticky; top: 76px; }
.pl { display: flex; align-items: center; gap: .6rem; min-height: 2.4rem; padding: .3rem .2rem; font-weight: 600; max-width: min(82vh, 760px); }
.pl.active .pl-name { color: #fff; text-shadow: 0 0 10px var(--pri); }
.pl.active .pl-name::before { content: ''; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); margin-right: .45rem; box-shadow: 0 0 8px var(--ok); }
.pl-name small { font-weight: 400; }
.pl-cap { display: flex; flex-wrap: wrap; align-items: center; font-size: .95rem; color: var(--muted); }
.pl-cap b { margin-left: .3rem; font-size: .8rem; }
.cp { font-family: "Noto Sans Symbols 2", "Segoe UI Symbol", serif; margin-right: -.25rem; font-size: 1.05rem; }
.cp.w { color: #fff; -webkit-text-stroke: .6px #333; } .cp.b { color: #222; -webkit-text-stroke: .6px #bbb; }
.thinking { display: inline-flex; gap: 3px; margin-left: auto; }
.thinking[hidden], [hidden] { display: none !important; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--pri); animation: think 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-5px); opacity: 1; } }

.evalbar { position: relative; width: 14px; border-radius: 7px; overflow: hidden; background: #1d1726; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: flex-end; }
.evalbar.flip { flex-direction: column-reverse; }
.evalbar-w { background: #f4f0ff; height: 50%; transition: height .5s; }
.evalbar span { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%) rotate(-90deg); transform-origin: center; font-size: 0; }
html[data-evalbar="off"] .evalbar { display: none; }

.coach { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-size: .92rem; min-height: 3.6rem; animation: pop .35s; }
.coach-av { font-size: 1.5rem; line-height: 1; }
.coach.k-best { border-color: #34d39988; background: #34d39914; }
.coach.k-good { border-color: #34d39955; }
.coach.k-inacc { border-color: #fbbf2488; background: #fbbf2412; }
.coach.k-mistake { border-color: #fb923c99; background: #fb923c14; }
.coach.k-blunder { border-color: #f8717199; background: #f8717117; }
.coach.k-hint { border-color: #38bdf899; background: #38bdf814; }
@keyframes pop { from { transform: scale(.97); opacity: .3; } to { transform: none; opacity: 1; } }
.moves { list-style: none; margin: 0; padding: .3rem; max-height: 230px; overflow-y: auto; background: #0f0a1c; border-radius: 12px; border: 1px solid var(--line); font-size: .9rem; counter-reset: none; }
.moves li { display: grid; grid-template-columns: 2.4rem 1fr 1fr; padding: .15rem .3rem; border-radius: 6px; }
.moves li:nth-child(odd) { background: #ffffff06; }
.moves .mn { color: var(--muted); }
.moves .cur { color: #fff; font-weight: 700; text-shadow: 0 0 8px var(--pri); }
.moves .empty { display: block; color: var(--muted); text-align: center; padding: .6rem; }
.mk { font-style: normal; font-weight: 700; margin-left: .15rem; font-size: .8rem; }
.mk.bl { color: var(--bad); } .mk.mi { color: #fb923c; } .mk.in { color: var(--warn); }
.tipbox { background: linear-gradient(135deg, #a26bff1a, #ec48991a); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; font-size: .88rem; }
.tipbox p { margin: .3rem 0 0; color: var(--muted); }

/* ---------- Setup / Modal ---------- */
.setup, .modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 1rem; background: #05020bb3; backdrop-filter: blur(4px); overflow-y: auto; }
.setup[hidden], .modal[hidden] { display: none; }
.setup-card, .modal-card { width: min(920px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 22px; padding: 1.4rem; box-shadow: 0 30px 80px #0009, 0 0 0 1px #a26bff22; animation: pop .35s; margin: auto; }
.modal-card { width: min(440px, 100%); text-align: center; }
.end-emoji { font-size: 3.5rem; animation: bounce 1s; }
@keyframes bounce { 0% { transform: scale(.2) rotate(-20deg); } 60% { transform: scale(1.2) rotate(8deg); } 100% { transform: none; } }
.next { color: var(--pri); font-weight: 600; }
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.bot { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "av nm" "av elo" "tx tx" "rec rec"; column-gap: .6rem; text-align: left; padding: .75rem; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; transition: transform .15s, border-color .2s, box-shadow .2s; }
.bot:hover { transform: translateY(-2px); border-color: #a26bff88; }
.bot.on { border-color: var(--pri); box-shadow: 0 0 0 2px var(--pri) inset, 0 8px 24px #a26bff33; background: #a26bff1a; }
.bot-av { grid-area: av; font-size: 2rem; width: 2.8rem; height: 2.8rem; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #a26bff44, #ec489944); }
.bot-nm { grid-area: nm; font-weight: 700; align-self: end; }
.bot-elo { grid-area: elo; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.bot-tx { grid-area: tx; font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.bot-rec { grid-area: rec; font-size: .75rem; color: var(--pri); margin-top: .25rem; }
.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.setup-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: .6rem 0; }

/* ---------- Brett ---------- */
.cb { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 18px 50px #0008, 0 0 0 1px #ffffff14, 0 0 40px #a26bff22; user-select: none; -webkit-user-select: none; touch-action: none; --sq: 60px; }
.cb-sqs { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.sq { position: relative; }
.sq.lt { background: var(--lt); } .sq.dk { background: var(--dk); }
.sq.last::before, .sq.sel::before, .sq.hint::before, .sq.good::before, .sq.bad::before, .sq.over::before { content: ''; position: absolute; inset: 0; }
.sq.last::before { background: #ffe06655; }
.sq.sel::before { background: #a26bff77; }
.sq.hint::before { background: #38bdf877; animation: pulse 1.2s infinite; }
.sq.good::before { background: #34d39988; }
.sq.bad::before { background: #f8717199; }
.sq.over::before { box-shadow: inset 0 0 0 4px #ffffffaa; }
.sq.chk { background-image: radial-gradient(circle, #ff3b3bdd 0%, #ff3b3b88 35%, transparent 70%); }
.sq.dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%); border-radius: 50%; background: #1a0b3a55; z-index: 2; pointer-events: none; }
.sq.cap::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: calc(var(--sq) * .08) solid #1a0b3a55; z-index: 2; pointer-events: none; }
.sq.star::after { content: '⭐'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--sq) * .5); z-index: 3; animation: twinkle 1.6s infinite; pointer-events: none; }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes twinkle { 50% { transform: scale(.85) rotate(12deg); } }
.co { position: absolute; font-size: calc(var(--sq) * .2); font-weight: 700; line-height: 1; pointer-events: none; opacity: .9; }
.co.rk { left: 4%; top: 5%; } .co.fl { right: 5%; bottom: 4%; }
.sq.lt .co { color: var(--dk); } .sq.dk .co { color: var(--lt); }
html[data-coords="off"] .co { display: none; }
.cb-pcs { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.pc { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; display: grid; place-items: center; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", "DejaVu Sans", serif; font-size: calc(var(--sq) * .8); line-height: 1; transition: transform var(--anim) cubic-bezier(.3, .7, .3, 1); will-change: transform; }
.pc.drag { z-index: 10; transition: none; filter: drop-shadow(0 10px 10px #0007); }
.pc.gone { opacity: 0; transform-origin: center; transition: opacity .25s; }
/* Figurensätze */
.pc.w { color: #fff; -webkit-text-stroke: calc(var(--sq) * .018) #2b2140; paint-order: stroke fill; text-shadow: 0 2px 3px #0005; }
.pc.b { color: #231a33; -webkit-text-stroke: calc(var(--sq) * .012) #d8cfe9; text-shadow: 0 2px 3px #0005; }
html[data-pieces="neon"] .pc.w { color: #e9fcff; -webkit-text-stroke: calc(var(--sq) * .012) #0aa4c6; text-shadow: 0 0 8px #22d3ee, 0 0 16px #22d3ee88; }
html[data-pieces="neon"] .pc.b { color: #2b0b26; -webkit-text-stroke: calc(var(--sq) * .014) #ff4fb2; text-shadow: 0 0 8px #ec4899, 0 0 16px #ec489988; }
html[data-pieces="glow"] .pc.w { color: #fff; -webkit-text-stroke: calc(var(--sq) * .014) #7c3aed; text-shadow: 0 0 10px #a26bffcc; }
html[data-pieces="glow"] .pc.b { color: #1a0d33; -webkit-text-stroke: calc(var(--sq) * .014) #c4a5ff; text-shadow: 0 0 10px #7c3aed; }
html[data-pieces="gold"] .pc.w { color: #ffd76a; -webkit-text-stroke: calc(var(--sq) * .014) #7a5300; text-shadow: 0 2px 4px #0006; }
html[data-pieces="gold"] .pc.b { color: #cfd6df; -webkit-text-stroke: calc(var(--sq) * .014) #3b4350; text-shadow: 0 2px 4px #0006; }
html[data-pieces="letters"] .pc { font-family: Poppins, sans-serif; font-weight: 800; font-size: calc(var(--sq) * .5); }
html[data-pieces="letters"] .pc::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; z-index: -1; }
html[data-pieces="letters"] .pc.w { color: #2b2140; -webkit-text-stroke: 0; text-shadow: none; }
html[data-pieces="letters"] .pc.w::before { background: #fff; box-shadow: 0 2px 4px #0006, inset 0 -3px 0 #0002; }
html[data-pieces="letters"] .pc.b { color: #fff; -webkit-text-stroke: 0; text-shadow: none; }
html[data-pieces="letters"] .pc.b::before { background: #2a2140; box-shadow: 0 2px 4px #0006, inset 0 -3px 0 #fff2; }
.cb-arrows { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.ar { stroke-width: .17; stroke-linecap: round; opacity: .85; }
.ar-hint { stroke: #38bdf8; } .ah-hint { fill: #38bdf8; }
.ar-bad { stroke: #f87171; } .ah-bad { fill: #f87171; }
.ar-good { stroke: #34d399; } .ah-good { fill: #34d399; }
.ar-best { stroke: #4ade80; opacity: .75; } .ah-best { fill: #4ade80; }
.ar { fill: none; stroke-linejoin: round; }
.ar-ug { stroke: #22c55e; } .ah-ug { fill: #22c55e; }
.ar-ur { stroke: #ef4444; } .ah-ur { fill: #ef4444; }
.ar-ub { stroke: #3b82f6; } .ah-ub { fill: #3b82f6; }
.ar-uy { stroke: #f59e0b; } .ah-uy { fill: #f59e0b; }
.ci { fill: none; stroke-width: .07; opacity: .85; }
.ci-ug { stroke: #22c55e; } .ci-ur { stroke: #ef4444; } .ci-ub { stroke: #3b82f6; } .ci-uy { stroke: #f59e0b; }
.cb-promo { position: absolute; z-index: 20; width: 12.5%; display: flex; flex-direction: column; background: #f5f0ffee; box-shadow: 0 8px 30px #000a; border-radius: 6px; }
.cb-promo[style*="bottom: 0"] { flex-direction: column-reverse; }
.pc-opt { position: relative; height: var(--sq); border: 0; background: transparent; cursor: pointer; padding: 0; }
.pc-opt:hover { background: #a26bff44; }
.pc-opt .pc { width: 100%; height: 100%; transform: none !important; }
.pc-x { border: 0; background: #ddd; cursor: pointer; padding: .2rem; font-weight: 700; color: #333; }

/* ---------- Taktik ---------- */
.pz-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .6rem; text-align: center; }
.stat small { display: block; font-size: .7rem; }
.stat b { font-size: 1.2rem; }
.stat.big { grid-column: 1 / -1; }
.stat.big b { font-size: 2rem; background: linear-gradient(135deg, #fff, #d4b8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .up { color: var(--ok); font-size: .9rem; } .stat .down { color: var(--bad); font-size: .9rem; }
.pz-recent { display: flex; gap: .25rem; flex-wrap: wrap; min-height: 1.4rem; }
.pz-recent span { width: 1.4rem; height: 1.4rem; border-radius: 6px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.pz-recent .ok { background: #34d39933; color: var(--ok); } .pz-recent .no { background: #f8717133; color: var(--bad); }
.pz-msg, .ls-msg { padding: .8rem; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-size: .95rem; animation: pop .3s; }
.k-good { border-color: #34d39988 !important; background: #34d39914 !important; }
.k-bad { border-color: #f8717188 !important; background: #f8717114 !important; }
.k-hint { border-color: #38bdf888 !important; }
.k-turn { border-color: #a26bff88 !important; }
.pz-meta { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); }
.pz-gen { display: flex; gap: .5rem; align-items: center; font-size: .85rem; color: var(--muted); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #a26bff44; border-top-color: var(--pri); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
select { font: inherit; padding: .55rem; border-radius: 10px; background: var(--card2); color: var(--text); border: 1px solid var(--line); }

/* ---------- Lernen ---------- */
.learn { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.learn > *, .ls-grid > *, .play > * { min-width: 0; }
.ls-side { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1rem; position: sticky; top: 76px; }
.progress { height: 8px; border-radius: 4px; background: #ffffff12; overflow: hidden; margin-bottom: .3rem; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--pri), var(--pri2)); transition: width .5s; }
.ls-list { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .25rem; max-height: 60vh; overflow-y: auto; }
.ls-list button { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.ls-list button span { width: 1.6rem; text-align: center; font-family: "Noto Sans Symbols 2", "Segoe UI Emoji", sans-serif; }
.ls-list button:hover { background: #ffffff0a; }
.ls-list button.on { background: #a26bff26; border-color: #a26bff66; }
.ls-list button i { margin-left: auto; color: var(--ok); font-style: normal; }
.ls-main { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.2rem; scroll-margin-top: 80px; }
.ls-main h2 { font-size: 1.5rem; }
.ls-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.2rem; align-items: start; }
.ls-text { line-height: 1.6; color: #e6defa; }
.ls-text code { background: #ffffff14; padding: .05rem .35rem; border-radius: 5px; }
.ls-text li { margin: .25rem 0; }
.ls-boardbox { display: grid; gap: .6rem; }
.ls-task { display: flex; justify-content: space-between; align-items: center; }
.ls-nav { display: flex; justify-content: space-between; margin-top: 1rem; }
.ls-cta { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Turniere ---------- */
.tour-hero { text-align: center; padding: 2.5rem 1rem 1.5rem; }
.tour-hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); background: linear-gradient(135deg, #fff, #d4b8ff, #f9a8d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tour-hero p { color: var(--muted); max-width: 640px; margin: .5rem auto 1rem; }
.badge { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: #ec489933; color: #fbcfe8; font-weight: 700; font-size: .8rem; margin-bottom: .8rem; animation: pulse 2s infinite; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; margin: 1rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: #a26bff88; }
.card-ic { font-size: 2rem; }
.card p { color: var(--muted); margin: 0; font-size: .92rem; }

/* ---------- Anpassen ---------- */
.cs h1 { font-size: 1.4rem; }
.opt h3 { font-size: .95rem; color: var(--muted); margin-bottom: .45rem; }
.opt .row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .3rem 0; font-size: .9rem; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.sw { position: relative; padding: 2.3rem .2rem .35rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; font-size: .78rem; cursor: pointer; }
.sw::before { content: ''; position: absolute; left: .4rem; right: .4rem; top: .4rem; height: 1.6rem; border-radius: 6px; background: conic-gradient(var(--a) 0 25%, var(--b) 0 50%, var(--a) 0 75%, var(--b) 0) 0 0 / 50% 100%; }
.sw.on { border-color: var(--pri); box-shadow: 0 0 0 2px var(--pri) inset; }

/* ---------- Analyse ---------- */
.mk { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 .2rem; border-radius: 999px; background: var(--mc, #888); color: #10061f; font-style: normal; font-weight: 800; font-size: .68rem; margin-left: .25rem; vertical-align: middle; }
.mk.big { min-width: 2rem; height: 2rem; font-size: 1rem; margin: 0 .5rem 0 0; flex: none; }
.mv-badge { position: absolute; z-index: 7; width: calc(var(--sq) * .4); height: calc(var(--sq) * .4); border-radius: 50%; display: grid; place-items: center; background: var(--mc); color: #10061f; font-weight: 800; font-size: calc(var(--sq) * .2); box-shadow: 0 2px 6px #0008, 0 0 0 2px #fff; pointer-events: none; }
.mv-badge.pop { animation: bounce .4s; }
.an-nav { display: flex; gap: .4rem; justify-content: center; margin-top: .5rem; max-width: min(82vh, 760px); }
.an-nav .btn { flex: 1; font-size: 1.1rem; }
.an-evaltxt { margin-left: auto; font-weight: 700; color: var(--muted); }
.an-progress { position: relative; height: 26px; border-radius: 8px; background: #ffffff10; overflow: hidden; }
.an-progress div { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--pri), var(--pri2)); transition: width .3s; }
.an-progress span { position: relative; display: block; text-align: center; font-size: .8rem; line-height: 26px; font-weight: 600; }
.an-acc { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; text-align: center; align-items: center; }
.an-acc > div { display: grid; }
.an-acc b { font-size: 1.8rem; }
.an-acc .vs { font-weight: 700; font-size: 1.1rem; }
.an-tab { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .4rem; }
.an-tab td { padding: .18rem .3rem; border-bottom: 1px solid #ffffff0d; }
.an-tab td:first-child, .an-tab td:last-child { text-align: center; width: 2.4rem; font-weight: 700; }
.an-tab .mk { margin: 0 .3rem 0 0; }
.an-graph { width: 100%; height: 90px; border-radius: 10px; cursor: pointer; display: block; }
.g-bg { fill: #231a33; } .g-area { fill: #f4f0ff; } .g-mid { stroke: #a26bff; stroke-width: 1; opacity: .5; } .g-cur { stroke: var(--pri2); stroke-width: 2; }
.an-explain { display: flex; align-items: flex-start; padding: .8rem; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-size: .92rem; min-height: 3.6rem; }
.an-explain .best { color: #4ade80; }
.an-moves li { grid-template-columns: 2.4rem 1fr 1fr; }
.am { background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: .1rem .3rem; border-radius: 6px; cursor: pointer; }
.am:hover { background: #ffffff12; }
.am.cur { background: #a26bff44; font-weight: 700; }
.hist-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.hist { width: 100%; text-align: left; padding: .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; cursor: pointer; display: grid; gap: .2rem; }
.hist:hover { border-color: var(--pri); }
.hist span { color: var(--muted); font-size: .8rem; }

/* ---------- Konto & Online ---------- */
.acct { display: flex; align-items: center; gap: .45rem; padding: .35rem .7rem .35rem .35rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.acct:hover { border-color: var(--pri); }
.acct small { color: var(--pri); font-weight: 700; }
.av { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; font-weight: 800; flex: none; }
.av.big { width: 3rem; height: 3rem; font-size: 1.3rem; }
.login-btns { display: grid; gap: .5rem; margin: .8rem 0; }
.lg-dc { background: #5865f2; border-color: #5865f2; }
.lg-gg { background: #fff; color: #1f1f1f; border-color: #fff; }
.login-mock { background: #fbbf2414; border: 1px dashed #fbbf2488; border-radius: 12px; padding: .6rem; margin-bottom: .6rem; }
.modal input[type=text], .field input { width: 100%; font: inherit; padding: .65rem .8rem; border-radius: 10px; background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.modal input:focus, .field input:focus { outline: 2px solid var(--pri); border-color: transparent; }
.err { color: var(--bad); min-height: 1.2em; font-size: .85rem; }
.center-chips { justify-content: center; margin-bottom: .8rem; }
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
.lobby > * { min-width: 0; }
.lobby h2 { font-size: 1.1rem; margin-top: 1.4rem; }
.online-n { font-size: .8rem; font-weight: 600; color: var(--ok); margin-left: .4rem; display: inline-flex; align-items: center; gap: .3rem; }
.online-n i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.tcs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.tc { display: grid; gap: .15rem; padding: 1.1rem .5rem; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; transition: transform .15s, border-color .2s; }
.tc b { font-size: 1.5rem; }
.tc span { color: var(--muted); font-size: .85rem; }
.tc:hover { transform: translateY(-2px); border-color: var(--pri); }
.tc.seeking { border-color: var(--pri2); box-shadow: 0 0 0 2px var(--pri2) inset, 0 0 24px #ec489955; animation: pulse 1.4s infinite; }
.seekinfo { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; color: var(--muted); }
.chl-list, .plr-list { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .35rem; }
.chl, .rg, .plr { display: flex; align-items: center; gap: .5rem; justify-content: space-between; padding: .55rem .7rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: .9rem; }
.chl span:last-child { display: flex; gap: .3rem; }
.res { font-weight: 700; font-size: .8rem; padding: .15rem .5rem; border-radius: 999px; }
.res-w { background: #34d39926; color: var(--ok); } .res-l { background: #f8717126; color: var(--bad); } .res-d { background: #ffffff14; color: var(--muted); }
.rg > span:nth-child(2) { flex: 1; }
.up { color: var(--ok); } .down { color: var(--bad); }
.plr { justify-content: flex-start; }
.plr .rt { margin-left: auto; color: var(--muted); font-weight: 600; }
.odot { width: .55rem; height: .55rem; border-radius: 50%; background: #6b6280; flex: none; }
.odot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.lnk { background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; }
.lnk:hover b { color: var(--pri); }
.me-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "av nm rt" "av wdl wdl"; column-gap: .6rem; align-items: center; padding: .8rem; border-radius: 14px; background: linear-gradient(135deg, #a26bff22, #ec489922); border: 1px solid var(--line); }
.me-card .av { grid-area: av; }
.me-card > div { grid-area: nm; display: grid; }
.me-card .rt { grid-area: rt; font-size: 1.6rem; }
.me-card .wdl { grid-area: wdl; }
.clk-row { justify-content: space-between; }
.clock { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; padding: .2rem .7rem; border-radius: 10px; background: var(--card); border: 1px solid var(--line); min-width: 6.5rem; text-align: right; }
.bclock { margin-left: .5rem; font-size: 1.2rem; min-width: 5.5rem; }
#pl-bot .bclock { margin-left: auto; }
.clock.run { background: #f4f0ff; color: #1a0d33; box-shadow: 0 0 18px #a26bff66; }
.clock.low.run { background: var(--bad); color: #fff; animation: pulse .8s infinite; }
.pf-head { display: flex; gap: .8rem; align-items: center; text-align: left; margin-bottom: .8rem; }
.pf-head h2 { margin: 0; }
.pf-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; margin-bottom: .8rem; }
.pf-stats div { display: grid; background: var(--card2); border-radius: 10px; padding: .4rem .2rem; }
.pf-stats b { font-size: 1.2rem; }
.modal-card .hist-list { text-align: left; margin-bottom: .6rem; }
@media (max-width: 980px) { .lobby { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .acct { position: absolute; right: .6rem; top: .55rem; }
  .acct b { max-width: 6rem; overflow: hidden; text-overflow: ellipsis; }
  .tcs { grid-template-columns: repeat(2, 1fr); }
  .clock { font-size: 1.25rem; min-width: 5.5rem; }
  .nav a { padding: .35rem .2rem; font-size: .62rem; }
}

/* ---------- Figurensets & Turnierliste ---------- */
.pc img { width: 90%; height: 90%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 2px #0006); }
html[data-pieces="set"] .pc { -webkit-text-stroke: 0; text-shadow: none; }
.cp img, .pc-opt img { width: 1.1rem; height: 1.1rem; vertical-align: middle; }
.pc-opt .pc img { width: 90%; height: 90%; }
.cs-sets { margin-top: .4rem; }
.set-chip { display: inline-flex; align-items: center; gap: .35rem; }
.set-chip img { width: 1.3rem; height: 1.3rem; object-fit: contain; }
.login-mail { display: grid; gap: .5rem; text-align: left; margin-bottom: .6rem; }
.login-mail form { display: grid; gap: .5rem; }
.login-mail input { width: 100%; font: inherit; padding: .65rem .8rem; border-radius: 10px; background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.tour-list { display: grid; gap: .8rem; margin: 0 auto 2rem; max-width: 860px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.1rem; }
.tcard-h { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.tcard-h h3 { margin: 0; font-size: 1.2rem; }
.tst { font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.tst-pl { background: #a26bff26; color: #dcc8ff; } .tst-ru { background: #f8717126; color: #fca5a5; animation: pulse 2s infinite; } .tst-fi { background: #34d39926; color: var(--ok); } .tst-ca { background: #ffffff14; color: var(--muted); }
.tmeta { color: var(--muted); font-size: .88rem; margin: .5rem 0; }
.tdesc { margin: .3rem 0 .6rem; white-space: pre-line; }
.tact { display: flex; flex-wrap: wrap; gap: .5rem; }
.tmore { margin-top: .8rem; }
.ttab { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ttab th, .ttab td { padding: .35rem .4rem; border-bottom: 1px solid #ffffff10; text-align: left; }
.ttab tr.me td { background: #a26bff22; }
.ttab tr.wd td { opacity: .5; text-decoration: line-through; }
.tmore h4 { margin: .9rem 0 .3rem; color: var(--muted); }
.tpairs { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.tpairs li { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; padding: .3rem .6rem; background: var(--card2); border-radius: 8px; font-size: .88rem; }
.tpairs li span:last-child { text-align: right; }

.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); background: var(--card2); border: 1px solid var(--pri); padding: .7rem 1.1rem; border-radius: 14px; z-index: 60; transition: transform .35s; box-shadow: 0 10px 30px #0008; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Mobil ---------- */
html, body { overflow-x: hidden; }
.toast:empty { visibility: hidden; }
@media (max-width: 1100px) { .back { display: none; } }
@media (max-width: 980px) {
  .play { grid-template-columns: 1fr; }
  .board-wrap, .pl { margin-left: auto; margin-right: auto; }
  .panel, .ls-side { position: static; }
  .learn { grid-template-columns: 1fr; }
  .ls-list { max-height: none; display: flex; overflow-x: auto; gap: .35rem; padding-bottom: .4rem; scroll-snap-type: x proximity; }
  .ls-list li { flex: none; scroll-snap-align: start; }
  .ls-list button { white-space: nowrap; background: var(--card2); border-color: var(--line); }
  .ls-side h1 { font-size: 1.3rem; }
  .ls-grid { grid-template-columns: 1fr; }
  .ls-boardbox { order: -1; }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: .4rem; padding: .5rem .6rem; }
  .back { display: none; }
  .nav { order: 3; width: 100%; justify-content: space-between; margin: 0; }
  .nav a { flex-direction: column; gap: 0; padding: .35rem .4rem; font-size: .7rem; flex: 1; border-radius: 12px; }
  .nav a span { font-size: 1.1rem; }
  main { padding: .8rem .5rem 5rem; }
  .board-wrap, .pl { max-width: none; }
  .evalbar { width: 9px; }
  .setup-card { padding: 1rem; }
  .bot-grid { grid-template-columns: repeat(2, 1fr); }
  .bot { grid-template-areas: "av nm" "av elo" "tx tx"; padding: .6rem; }
  .bot-custom { grid-template-areas: "av nm" "av elo" "rg rg"; }
  .bot-tx { display: none; }
  .ls-main { padding: .9rem; }
  .swatches { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { :root { --anim: 0s; } * { animation: none !important; } }

.soon { font-size: .65rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: #fbbf2426; color: #fde68a; vertical-align: middle; }

/* ---------- Footer (Impressum / Datenschutz) ---------- */
.foot { border-top: 1px solid var(--line); background: #0b0614cc; margin-top: 2rem; }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 1.4rem 1rem 5.5rem; display: grid; gap: .6rem; justify-items: center; text-align: center; }
.foot-logo { color: var(--text); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; }
.foot-logo .logo-pc { font-size: 1.3rem; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.1rem; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.foot-links a:hover { color: var(--text); text-decoration: underline; }
main { padding-bottom: 1rem; }

/* Replay */
#p-replay .pl, .rp-ctl { max-width: min(80vh, 680px); margin-left: auto; margin-right: auto; }
.rp-ctl { display: grid; gap: .5rem; margin-top: .4rem; }
.rp-ctl .an-nav { margin-top: 0; width: 100%; }
#rp-seek { width: 100%; accent-color: var(--pri); cursor: pointer; margin: 0; height: 1.6rem; }
.rp-speed { justify-content: center; }
.rp-speed .chip:disabled { opacity: .45; cursor: not-allowed; }
#rp-list { display: grid; gap: .6rem; }
#rp-list h3 { margin: .5rem 0 0; }
#rp-online, #rp-local { max-height: 42vh; overflow: auto; }
#rp-body { display: grid; gap: .7rem; }
.rp-row { display: flex; gap: .4rem; align-items: center; }
.rp-row .hist { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rp-info { display: grid; gap: .15rem; overflow-wrap: anywhere; }
.rp-info b { font-size: 1.1rem; }
.rp-info small { color: var(--muted); }
.rp-now { padding: .7rem .8rem; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); min-height: 4.2rem; }
#p-replay .pl .clock { margin-left: auto; }
@media (max-width: 720px) { #p-replay .pl, .rp-ctl { max-width: none; } .rp-ctl .an-nav .btn { padding: .6rem .3rem; } }
@media (max-width: 720px) { .nav { gap: .1rem; } .nav a { padding: .35rem 0; font-size: .6rem; min-width: 0; flex: 1 1 auto; align-items: center; } }
@media (min-width: 981px) { #p-replay .board-wrap.solo, #p-replay .pl, .rp-ctl { max-width: min(60vh, 680px); } }
@media (min-width: 721px) and (max-width: 1240px) { .top { flex-wrap: wrap; } .top .acct { margin-left: auto; } .nav { order: 3; width: 100%; justify-content: center; } .panel { top: 124px; } }
@media (min-width: 721px) and (max-width: 900px) { .nav { gap: 0; } .nav a { padding: .45rem .55rem; font-size: .84rem; } }
@media (max-width: 980px) { #p-replay:has(#rp-list:not([hidden])) .play-left { display: none; } }
