/* ---------- Design-Tokens ---------- */
:root {
  --bg: #f3f0e8;
  --surface: #fffdf8;
  --ink: #1e1c17;
  --muted: #6d675b;
  --line: #e1dbcb;
  --accent: #2c6b5b;
  --accent-ink: #ffffff;
  --danger: #b0372d;
  --ok: #2c7a4b;

  --sq-light: #e8e2d2; --sq-light-base: #e8e2d2;
  --sq-dark: #6f8f8a; --sq-dark-base: #6f8f8a;
  --hl-last: rgb(250 204 21 / .42);
  --hl-sel: rgb(250 204 21 / .6);   /* gewähltes Feld: kräftigeres Gelb statt Blau */
  --hl-move: rgb(20 40 60 / .28);
  --hl-hint: rgb(34 197 94 / .55);

  --radius: .85rem;
  --shadow: 0 1px 0 var(--line), 0 10px 28px rgb(30 25 10 / .10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #16150f;
    --surface: #1f1e17;
    --ink: #eee9dc;
    --muted: #a39d8d;
    --line: #34322a;
    --accent: #4aa38b;
    --accent-ink: #08130f;
    --danger: #ef7d71;
    --ok: #62c58a;
    --sq-light: #d7d1c1; --sq-light-base: #d7d1c1;
    --sq-dark: #5f7d78; --sq-dark-base: #5f7d78;
    --shadow: 0 1px 0 var(--line), 0 10px 28px rgb(0 0 0 / .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16150f;
  --surface: #1f1e17;
  --ink: #eee9dc;
  --muted: #a39d8d;
  --line: #34322a;
  --accent: #4aa38b;
  --accent-ink: #08130f;
  --danger: #ef7d71;
  --ok: #62c58a;
  --sq-light: #d7d1c1; --sq-light-base: #d7d1c1;
  --sq-dark: #5f7d78; --sq-dark-base: #5f7d78;
  --shadow: 0 1px 0 var(--line), 0 10px 28px rgb(0 0 0 / .45);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* sonst überstimmt z. B. .btns { display: flex } das hidden-Attribut */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--accent); }
h1, h2 { line-height: 1.2; }
.muted { color: var(--muted); }
.noscript { padding: 1rem; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: inherit; text-decoration: none; white-space: nowrap; }
#nav { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
@media (max-width: 900px) { #nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 1.5rem; } }
#nav a {
  padding: .4rem .75rem; border-radius: .55rem;
  color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap;
}
#nav a:hover { background: var(--bg); color: var(--ink); }
#nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

main { max-width: 1100px; margin: 0 auto; padding: 1rem; outline: none; }

/* ---------- Layout ---------- */
.layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) 350px; align-items: start; }
}
.board-col { width: min(100%, calc(100vh - 10.5rem)); min-width: min(100%, 280px); margin-inline: auto; }
.panel { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
}
.card h2 { margin: 0 0 .6rem; font-size: 1rem; }
.card.error { border-color: var(--danger); }

/* ---------- Spielerleisten ---------- */
.bar { display: flex; align-items: center; gap: .55rem; min-height: 2.3rem; padding: .15rem .1rem; font-size: .95rem; }
.bar .name { font-weight: 600; }
.bar .sub { color: var(--muted); font-size: .85rem; }
.bar .caps { font-size: 1.05rem; letter-spacing: -.18em; color: var(--muted); font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", "DejaVu Sans", sans-serif; }
.bar .adv { font-size: .8rem; color: var(--muted); }
.bar .clock {
  margin-left: auto; padding: .1rem .55rem; border-radius: .45rem;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem;
  background: var(--surface); border: 1px solid var(--line);
}
.bar .clock.running { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bar .clock.low { color: var(--danger); }
.bar .clock.running.low { background: var(--danger); border-color: var(--danger); color: #fff; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; border: 1.5px solid var(--ink); }
.dot.w { background: #fff; }
.dot.b { background: #222; }
.bar.active .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Brett ---------- */
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  container-type: inline-size;
  box-shadow: var(--shadow);
}
.sq { position: relative; display: grid; place-items: center; }
.sq.light { background-color: var(--sq-light); }
.sq.dark { background-color: var(--sq-dark); }
.sq[data-p] { cursor: pointer; }
.sq.last::before, .sq.sel::before, .sq.hint::before { content: ""; position: absolute; inset: 0; }
.sq.last::before { background: var(--hl-last); }
.sq.hint::before { background: var(--hl-hint); }
.sq.sel::before { background: var(--hl-sel); }
.sq.check { background-image: radial-gradient(circle, rgb(220 38 38 / .9) 0, rgb(220 38 38 / .55) 38%, rgb(220 38 38 / 0) 72%); }
.sq.target { cursor: pointer; }
.sq.target::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: var(--hl-move); }
.sq.target.capture::after { width: 90%; height: 90%; background: transparent; border: .8cqw solid var(--hl-move); }

.coord { position: absolute; font-size: max(9px, 1.7cqw); font-weight: 700; line-height: 1; opacity: .8; pointer-events: none; }
.coord.rank { top: 5%; left: 5%; }
.coord.file { bottom: 4%; right: 5%; }
.sq.light .coord { color: var(--sq-dark); }
.sq.dark .coord { color: var(--sq-light); }

.pc, .pp, .ghost {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", "DejaVu Sans", sans-serif;
  line-height: 1;
}
.pc { position: relative; z-index: 1; font-size: 10.4cqw; pointer-events: none; }
.pc.dragging { opacity: .25; }
/* Bildfiguren (SVG-Sets) */
.pc.img { position: absolute; inset: 3%; z-index: 1; display: block; pointer-events: none; }
.pc.img img, .ghost.img img, .pp-fig.img img, .cap img { display: block; width: 100%; height: 100%; }
.ghost.img { text-shadow: none; }
.pp.img { width: 13cqw; height: 13cqw; padding: .4cqw; display: grid; place-items: center; }
.pp-fig.img { display: block; width: 100%; height: 100%; }
.bar .caps.img { display: inline-flex; align-items: center; letter-spacing: 0; }
.bar .caps.img .cap { display: block; width: 1.25rem; height: 1.25rem; margin-right: -.45rem; opacity: .9; }

.pc.w, .pp.w, .ghost.w {
  color: #fff;
  text-shadow: -1px -1px 0 #1a1a1a, 1px -1px 0 #1a1a1a, -1px 1px 0 #1a1a1a, 1px 1px 0 #1a1a1a, 0 2px 3px rgb(0 0 0 / .35);
}
.pc.b, .pp.b, .ghost.b {
  color: #1b1b1b;
  text-shadow: 0 0 1px rgb(255 255 255 / .55), 0 2px 3px rgb(0 0 0 / .3);
}
.ghost { position: fixed; z-index: 50; transform: translate(-50%, -52%); pointer-events: none; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .35)); }

.promo { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgb(0 0 0 / .45); }
.promo-box { display: flex; gap: .4rem; padding: .6rem; background: var(--surface); border-radius: .8rem; box-shadow: 0 10px 30px rgb(0 0 0 / .4); }
.pp { font-size: 11cqw; padding: .1em .15em; background: var(--sq-light); border: 2px solid transparent; border-radius: .5rem; cursor: pointer; }
.pp:hover, .pp:focus-visible { border-color: var(--accent); outline: none; }

/* ---------- Bedienelemente ---------- */
button, select, input, textarea { font: inherit; color: inherit; }
button {
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--bg); }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, black); }
button.danger { color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }

select, input[type="text"], textarea {
  padding: .4rem .6rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface);
}
textarea { width: 100%; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }

.btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.btns.nav button { min-width: 2.6rem; font-weight: 700; }
.field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.field > span { color: var(--muted); font-size: .9rem; }
.check { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.row { display: flex; gap: .5rem; align-items: center; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.status { margin: 0 0 .4rem; font-weight: 600; min-height: 1.5em; }
.status.over { color: var(--accent); }
.status.good { color: var(--ok); }
.status.bad { color: var(--danger); }

/* ---------- Zugliste ---------- */
.moves {
  position: relative;
  display: grid; grid-template-columns: 2.4rem 1fr 1fr;
  max-height: 13rem; overflow-y: auto;
  margin: .5rem 0; font-variant-numeric: tabular-nums;
}
.moves .n { color: var(--muted); padding: .2rem 0; }
.moves button.m { border: 0; background: none; text-align: left; padding: .15rem .45rem; border-radius: .35rem; }
.moves button.m:hover { background: var(--bg); }
.moves button.m[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Analyse ---------- */
.evalhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.evaltext { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.evalbar { height: .85rem; border-radius: 99px; overflow: hidden; background: #26241d; }
.evalbar > i { display: block; height: 100%; width: 50%; background: #f4f1e8; transition: width .35s ease; }
.lines { margin-top: .6rem; display: grid; gap: .3rem; }
.line { display: grid; grid-template-columns: 4rem 1fr auto; gap: .5rem; align-items: baseline; text-align: left; padding: .35rem .5rem; }
.line b { font-variant-numeric: tabular-nums; }
.line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line small { color: var(--muted); }

/* ---------- Puzzles / Eröffnungen / Online ---------- */
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr)); gap: .3rem; margin-top: .6rem; }
.plist button { padding: .3rem 0; }
.plist button[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.plist button.done { border-color: var(--ok); color: var(--ok); }
.plist button.done[aria-current="true"] { color: var(--accent-ink); }

.olist { display: grid; gap: .3rem; max-height: 18rem; overflow-y: auto; }
.olist h3 { margin: .6rem 0 .1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.olist button { text-align: left; display: flex; justify-content: space-between; gap: .5rem; }
.olist button small { color: var(--muted); }
.olist button[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.olist button[aria-current="true"] small { color: inherit; opacity: .85; }
.theory { margin: .4rem 0 0; }
.linkbox { display: flex; gap: .4rem; margin-top: .5rem; }
.linkbox input { flex: 1; min-width: 0; }

/* ---------- Figurenwahl ---------- */
.sets-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin: 1rem 0 .3rem; }
.sets-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.sets-form { margin: 1.4rem 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sets-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.set-card {
  display: flex; flex-direction: column; gap: .45rem; padding: .55rem; text-align: left;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
}
.set-card:hover:not(:disabled) { background: var(--surface); border-color: var(--muted); }
.set-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.set-prev { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: .45rem; overflow: hidden; }
.set-prev span { aspect-ratio: 1; display: grid; place-items: center; }
.set-prev span:nth-child(odd) { background: var(--sq-light); }
.set-prev span:nth-child(even) { background: var(--sq-dark); }
.set-prev img { width: 92%; height: 92%; }
.set-prev .uni { font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", "DejaVu Sans", sans-serif; }
.set-prev .uni.w { color: #fff; text-shadow: -1px -1px 0 #1a1a1a, 1px -1px 0 #1a1a1a, -1px 1px 0 #1a1a1a, 1px 1px 0 #1a1a1a; }
.set-prev .uni.b { color: #1b1b1b; }
.set-name { display: flex; justify-content: space-between; gap: .4rem; font-weight: 600; }
.set-name small { color: var(--accent); font-weight: 700; }

/* ---------- Kopfzeile: Logo, Werkzeuge, Konto ---------- */
.brand { display: inline-flex; align-items: center; gap: .45rem; }
.brand img { display: block; width: 30px; height: 30px; }
.topbar #nav { flex: 1; min-width: 0; }
.tools { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.tools .tool { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .6rem; color: var(--muted); }
.tools .tool:hover { background: var(--bg); color: var(--ink); }
.tools .tool[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem .25rem .3rem;
  border: 1px solid var(--line); border-radius: 99px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.chip.login { padding-left: .6rem; color: var(--accent); }
.chip:hover { border-color: var(--accent); }
.chip[aria-current="page"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
@media (max-width: 560px) { .chip-name { display: none; } .chip { padding: .25rem; } .chip.login { padding: .35rem; } .brand span { display: none; } }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent); font-weight: 800; position: relative;
}
.avatar.small { width: 1.75rem; height: 1.75rem; font-size: .85rem; }
.avatar.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: .7rem; height: .7rem; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }

/* Links, die wie Knöpfe aussehen */
a.button {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem;
  border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500;
}
a.button:hover { background: var(--bg); }
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
a.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
button.small, a.button.small { padding: .3rem .6rem; font-size: .88rem; }
button.icon-only { padding: .3rem .45rem; }
button.wide { width: 100%; padding: .65rem; }
.button.big { padding: .75rem 1.25rem; font-size: 1.05rem; border-radius: .75rem; }
.ic { display: block; flex-shrink: 0; }
.btns.center { justify-content: center; }

/* Brett-Optionen aus den Settings */
.board.no-dots .sq.target::after { display: none; }
.board.no-last .sq.last::before { display: none; }

/* ---------- Startseite ---------- */
.hero {
  position: relative; display: grid; gap: 2rem; align-items: center; grid-template-columns: minmax(0, 1fr);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2.5rem); margin: .5rem 0 1.5rem; overflow: hidden;
  border-radius: 1.4rem; border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, var(--surface), var(--bg));
}
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr .9fr; } }
.hero-hello { margin: 0 0 .5rem; color: var(--muted); font-size: .95rem; }
.hero h1 { margin: 0; font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.02; letter-spacing: -.02em; }
.hero h1 .accent { color: var(--accent); }
.hero-sub { margin: 1rem 0 1.4rem; max-width: 32rem; color: var(--muted); font-size: 1.1rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 1.4rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: .35rem; }
.hero-facts .ic { color: var(--accent); }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-glow { position: absolute; inset: 8%; border-radius: 50%; background: color-mix(in srgb, var(--accent) 35%, transparent); filter: blur(50px); opacity: .55; }
.mini-board {
  position: relative; display: grid; grid-template-columns: repeat(8, 1fr); width: min(100%, 400px); aspect-ratio: 1;
  border-radius: 12px; overflow: hidden; container-type: inline-size; transform: rotate(-3deg);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / .5), 0 0 0 6px color-mix(in srgb, var(--surface) 80%, transparent);
}
.mini-board .sq { position: relative; }
.mini-board .sq.last::before { content: ""; position: absolute; inset: 0; background: var(--hl-last); }
.mini-board .pc { font-size: 10.4cqw; display: grid; place-items: center; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .mini-board { animation: float 7s ease-in-out infinite; }
  @keyframes float { 50% { transform: rotate(-2deg) translateY(-8px); } }
}
.home-label { margin: 1.6rem 0 .7rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.home-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile {
  --tone: var(--accent);
  position: relative; display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1rem 1rem .95rem;
  color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--tone); box-shadow: var(--shadow); }
.tile-icon {
  display: grid; place-items: center; flex-shrink: 0; width: 3rem; height: 3rem; border-radius: .8rem;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent);
}
.tile-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.tile-body strong { font-size: 1.05rem; }
.tile-body .muted { font-size: .9rem; line-height: 1.4; }
.tile-go { position: absolute; top: .9rem; right: .9rem; color: var(--tone); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.tile:hover .tile-go { opacity: 1; transform: none; }
.tile.c1 { --tone: #3f9e86; } .tile.c2 { --tone: #c7802f; } .tile.c3 { --tone: #4a83c9; } .tile.c4 { --tone: #c25a7c; }
.tile.c5 { --tone: #7e6bd0; } .tile.c6 { --tone: #a0763f; } .tile.c7 { --tone: #3c97b0; } .tile.c8 { --tone: #7a8a5a; }

/* Hinweise in der Partie (Revanche, Gegner weg) */
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin: .5rem 0; padding: .6rem .7rem; border-radius: .6rem; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.notice.warn { background: color-mix(in srgb, #d9a321 16%, transparent); }
.notice .btns { margin: 0; }

/* ---------- Partie-Analyse (Review) ---------- */
.sym {
  --k: #888;
  display: inline-grid; place-items: center; flex-shrink: 0; min-width: 1.6rem; height: 1.6rem; padding: 0 .3rem;
  border-radius: .5rem; background: var(--k); color: #fff; font-weight: 800; font-size: .82rem; line-height: 1; letter-spacing: -.02em;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / .18);
}
.sym.sm { min-width: 1.15rem; height: 1.15rem; padding: 0 .2rem; border-radius: .35rem; font-size: .66rem; }
.sym.on-board { position: absolute; top: 3%; right: 3%; z-index: 4; width: 36%; height: 36%; min-width: 0; padding: 0; border-radius: 50%; font-size: 2.1cqw; letter-spacing: -.06em; box-shadow: 0 2px 6px rgb(0 0 0 / .35); border: 2px solid #fff; }
.sym.on-board .ic { width: 64%; height: 64%; }
.sym.k-book { --k: #a88865; } .sym.k-sacrifice { --k: #17a9bd; } .sym.k-only { --k: #6b7fe0; } .sym.k-mate { --k: #c9971b; }
.sym.k-vgood { --k: #2e9e5b; } .sym.k-good { --k: #84ad45; } .sym.k-bad { --k: #e08a2b; } .sym.k-vbad { --k: #d64535; } .sym.k-missed { --k: #b0459e; }

/* ---------- Live-Bewertung (eigene Züge, Bewertungsbalken links vom Brett) ---------- */
.evalrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem; align-items: stretch; }
.evalbar-v { position: relative; width: 1.4rem; border-radius: 6px; overflow: hidden; background: #403d39; box-shadow: 0 0 0 1px rgb(0 0 0 / .22), 0 6px 16px -10px rgb(0 0 0 / .5); }
.evalbar-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: #f4f1e8; transition: height .45s cubic-bezier(.3, .7, .3, 1); }
.evalbar-v.flipped .evalbar-fill { bottom: auto; top: 0; }
.evalbar-num { position: absolute; left: 0; right: 0; top: .35rem; text-align: center; font-size: .6rem; font-weight: 800; letter-spacing: -.03em; color: #f4f1e8; font-variant-numeric: tabular-nums; }
.evalbar-num.at-bottom { top: auto; bottom: .35rem; }
.evalbar-num.on-white { color: #403d39; }
@media (max-width: 600px) {
  .evalrow { gap: .3rem; }
  .evalbar-v { width: .95rem; border-radius: 4px; }
  .evalbar-num { font-size: .5rem; letter-spacing: -.06em; }
}
@media (prefers-reduced-motion: reduce) { .evalbar-fill { transition: none; } }
/* Farben wie bei chess.com */
.sym.live { text-shadow: 0 1px 1px rgb(0 0 0 / .25); }
.sym.l-brilliant { --k: #26c2a3; } .sym.l-great { --k: #5c8bb0; } .sym.l-best { --k: #81b64c; }
.sym.l-excellent { --k: #96bc4b; } .sym.l-good { --k: #95b776; } .sym.l-book { --k: #a88865; }
.sym.l-inaccuracy { --k: #f0b92c; } .sym.l-mistake { --k: #ff9a3c; } .sym.l-blunder { --k: #fa412d; } .sym.l-miss { --k: #ff7769; }

.review-progress h2, .coach h2 { gap: .5rem; }
.progress { height: .6rem; margin: .8rem 0 .5rem; border-radius: 99px; background: var(--bg); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .25s ease; }

.coach { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.coach-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.coach-head strong { font-size: 1.05rem; }
.coach-eval { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.coach-ava { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.coach-text { margin: .6rem 0 .2rem; line-height: 1.55; }

.graph-card { padding: .55rem; }
.eval-graph { cursor: pointer; border-radius: .5rem; overflow: hidden; }
.eval-graph svg { display: block; width: 100%; height: 90px; }
.eval-graph .g-black { fill: #2a2822; }
.eval-graph .g-white { fill: #efeadd; }
.eval-graph .g-mid { stroke: #8a8576; stroke-width: 1; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; }
.eval-graph .g-cur { stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }
.eval-graph circle { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.eval-graph .d-vbad { fill: #d64535; } .eval-graph .d-bad { fill: #e08a2b; } .eval-graph .d-sac { fill: #17a9bd; } .eval-graph .d-only { fill: #6b7fe0; }

.review-summary .sum-top { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .7rem; }
.sum-col { text-align: center; padding: .6rem; border-radius: .7rem; background: var(--bg); }
.sum-name { display: flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 600; overflow-wrap: anywhere; }
.sum-acc { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sum-acc small { font-size: 1rem; color: var(--muted); }
.sum-label { font-size: .8rem; }
.sum-rows { display: grid; gap: .2rem; }
.sum-row { display: grid; grid-template-columns: 2rem 1fr 2rem; align-items: center; padding: .25rem 0; font-size: .92rem; }
.sum-row .n { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-row .what { display: flex; align-items: center; justify-content: center; gap: .45rem; }

.moves.review { max-height: 18rem; }
.moves.review button.m { display: flex; align-items: center; justify-content: space-between; gap: .3rem; }
.moves.review button.m[aria-current="true"] .sym { box-shadow: 0 0 0 2px var(--accent-ink); }

/* ---------- Seiten (Friends, Settings, Account) ---------- */
.page { padding-top: .5rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem; margin: .5rem 0 1rem; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.page-head p { margin: .2rem 0 0; }
.field.inline { margin: 0; gap: .6rem; }
.card h2 { display: flex; align-items: center; gap: .45rem; }
.card.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.empty-state { text-align: center; padding: 2.5rem 1.5rem; max-width: 34rem; margin: 2rem auto; }
.empty-state h1 { margin: .6rem 0 .3rem; }
.empty-icon { display: inline-grid; place-items: center; width: 5rem; height: 5rem; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }

.friends-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .friends-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.friends-grid .col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.add-friend { display: flex; gap: .5rem; }
.add-friend input { flex: 1; min-width: 0; }
.people, .games { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.people li, .games li { display: flex; align-items: center; gap: .7rem; padding: .5rem .35rem; border-radius: .6rem; }
.people li:hover, .games li:hover { background: var(--bg); }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.who small { font-weight: 400; font-size: .8rem; }
.who small.online { color: var(--ok); }
.acts { display: flex; gap: .35rem; flex-shrink: 0; }
.res { flex-shrink: 0; width: 3.4rem; text-align: center; padding: .2rem 0; border-radius: .4rem; font-size: .8rem; font-weight: 700; }
.res.win { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.res.loss { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.res.draw { background: var(--bg); color: var(--muted); }

/* Formulare */
.auth { display: grid; place-items: start center; padding: 1.5rem 0 3rem; }
.auth-card { width: min(100%, 26rem); padding: 1.6rem 1.5rem; }
.auth-card h1 { margin: .7rem 0 .4rem; font-size: 1.5rem; }
.auth-mark { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: .9rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.auth-mark.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.auth-form, .sub-form { display: grid; gap: .85rem; margin-top: 1rem; }
.form-field { display: grid; gap: .3rem; }
.form-field > span { font-weight: 600; font-size: .9rem; }
.form-field input { width: 100%; padding: .6rem .7rem; font-size: 1rem; }
input[type="password"] { padding: .4rem .6rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); }
.form-error { margin: 0; padding: .55rem .7rem; border-radius: .5rem; color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); font-size: .92rem; }
.auth-links { margin: 1rem 0 0; text-align: center; font-size: .92rem; }
.code-box { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 .3rem; padding: .8rem .9rem; border: 2px dashed var(--accent); border-radius: .7rem; }
.code-box code { flex: 1; font-size: clamp(1.05rem, 4.5vw, 1.35rem); font-weight: 700; letter-spacing: .06em; overflow-wrap: anywhere; }
.auth-card .check { margin: .6rem 0 1rem; }
.sub-form { padding-top: 1rem; border-top: 1px solid var(--line); }
.sub-form h3 { margin: 0; font-size: 1rem; }
.sub-form > button { justify-self: start; }
.danger-zone h3 { color: var(--danger); }

/* Settings */
.settings-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .settings-layout { grid-template-columns: 200px minmax(0, 1fr); } }
.settings-toc { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
@media (min-width: 900px) { .settings-toc { position: sticky; top: 4.5rem; flex-direction: column; } }
.settings-toc a { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: .6rem; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.settings-toc a:hover { background: var(--surface); color: var(--ink); }
.settings-toc a[aria-current] { background: var(--surface); color: var(--accent); }
.settings-main { display: grid; gap: 1rem; min-width: 0; }
.settings-sec { scroll-margin-top: 4.5rem; padding: 1.1rem 1.2rem; }
.settings-sec h2 { font-size: 1.15rem; margin-bottom: .2rem; }
.sec-hint { margin: 0 0 .6rem; font-size: .92rem; }
.settings-sec h2.sets-form { display: block; margin: 1.1rem 0 .5rem; font-size: .78rem; }
.settings-gallery .sets-form:first-child { margin-top: .4rem; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); cursor: pointer; }
.setting:first-of-type { border-top: 0; }
div.setting { cursor: default; }
.setting-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.setting-text small { font-size: .85rem; }
.setting .seg { flex-shrink: 0; }
@media (max-width: 560px) { .setting:has(.seg), .setting:has(.range) { flex-wrap: wrap; } }
.switch { position: relative; flex-shrink: 0; width: 2.9rem; height: 1.65rem; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.65rem - 6px); height: calc(1.65rem - 6px); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(1.25rem); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.range { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.range input { width: min(40vw, 12rem); accent-color: var(--accent); }

/* Puzzle-Sterne */
.stars { display: inline-flex; gap: 1px; vertical-align: -2px; }
.stars .on { color: #d9a321; }
.stars .off { color: var(--line); }
.set-name small { display: inline-flex; align-items: center; gap: .2rem; }

/* Einladung (auf jeder Seite) */
.invite-banner {
  position: fixed; left: 50%; top: 4.2rem; z-index: 90; transform: translateX(-50%);
  display: flex; align-items: center; gap: .7rem; width: min(calc(100vw - 2rem), 34rem); padding: .7rem .8rem;
  background: var(--surface); border: 1px solid var(--accent); border-radius: .9rem; box-shadow: 0 18px 40px -12px rgb(0 0 0 / .45);
}
.invite-banner[hidden] { display: none; }
.invite-text { flex: 1; min-width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .invite-banner:not([hidden]) { animation: drop .25s ease; }
  @keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }
}

/* ---------- Shop ---------- */
.chip.coins { gap: .3rem; padding: .25rem .65rem .25rem .45rem; color: #b8860b; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .chip.coins, :root:not([data-theme="light"]) .chip.coins { color: #e0b43a; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .chip.coins { color: #a5780a; } }
.shop-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .shop-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.shop-grid .col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.balance { display: flex; align-items: center; gap: .6rem; }
.coin-big { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; color: #b8860b; background: color-mix(in srgb, #e0b43a 22%, transparent); }
.balance-num { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.balance-card .muted { display: block; margin-top: .5rem; font-size: .9rem; }
.packs { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1rem; }
.pack { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1rem .8rem .8rem; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.pack.best { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.pack-tag { position: absolute; top: -.6rem; left: 50%; transform: translateX(-50%); padding: .1rem .55rem; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; }
.pack-coins { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: 1.5rem; font-weight: 800; color: #b8860b; }
.pack-label { font-size: .82rem; min-height: 1.2em; }
.consent { align-items: flex-start; gap: .5rem; font-size: .9rem; line-height: 1.45; }
.consent input { margin-top: .2rem; flex-shrink: 0; }
.uses { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.uses li { display: flex; gap: .6rem; align-items: flex-start; }
.uses .ic { color: var(--accent); margin-top: .15rem; }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.ledger li { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: baseline; padding: .4rem .2rem; border-bottom: 1px solid var(--line); }
.ledger .plus { color: var(--ok); } .ledger .minus { color: var(--muted); }
.set-card.locked .set-prev { filter: saturate(.65); opacity: .85; }
.set-buy { display: flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; color: #b8860b; min-height: 0; }
.set-buy:empty { display: none; }
.set-card[data-confirm="1"] { border-color: #e0b43a; }
.review-gate { text-align: center; }
.review-gate .btns { justify-content: center; }

/* ---------- Fußzeile und Rechtstexte ---------- */
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; max-width: 1100px; margin: 2.5rem auto 0; padding: 1.2rem 1rem 2rem; border-top: 1px solid var(--line); font-size: .88rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.legal { max-width: 46rem; margin: .5rem auto; padding: 1.6rem clamp(1rem, 4vw, 2.2rem) 2rem; line-height: 1.6; }
.legal h1 { margin: .7rem 0 .2rem; font-size: clamp(1.6rem, 4vw, 2rem); }
.legal h2 { margin: 1.6rem 0 .4rem; font-size: 1.08rem; display: block; }
.legal ul { padding-left: 1.2rem; }
.legal-mark { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .8rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.legal-warn { margin: 1rem 0; }
mark.ph { padding: 0 .25rem; border-radius: .25rem; background: color-mix(in srgb, #d9a321 35%, transparent); color: inherit; }
.small-print { font-size: .82rem; margin-top: .4rem; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 1.2rem; z-index: 100;
  transform: translate(-50%, 140%);
  max-width: min(90vw, 28rem);
  padding: .6rem 1rem;
  background: var(--ink); color: var(--bg);
  border-radius: .6rem;
  opacity: 0; transition: transform .25s ease, opacity .25s ease;
  pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- Schnellsuche (Online) --- */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .75rem 0 .5rem; }
.quick-tc { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .7rem .4rem; min-height: 4.6rem; border-radius: .8rem; }
.quick-tc strong { font-size: 1.15rem; line-height: 1.2; display: inline-flex; align-items: center; min-height: 1.4rem; }
.quick-tc span { font-size: .8rem; color: var(--muted); }
.quick-count { font-size: .72rem; color: var(--accent); font-weight: 600; min-height: 1em; }
.quick-tc.has-wait { border-color: var(--accent); }
.quick-tc:hover { border-color: var(--accent); }
.quick-search { display: flex; align-items: center; gap: .9rem; margin: .75rem 0 .5rem; padding: .9rem; border: 1px dashed var(--accent); border-radius: .8rem; }
.quick-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.quick-text .small { font-size: .8rem; }
.quick-spinner { width: 1.6rem; height: 1.6rem; flex-shrink: 0; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: quick-spin .9s linear infinite; }
@keyframes quick-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .quick-spinner { animation-duration: 3s; } }
.quick-foot { font-size: .85rem; margin: 0; }

/* --- Wertung, Rangliste, Profil, Zuschauen --- */
.narrow-page { max-width: 760px; margin: 0 auto; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.rated { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tag.watching { color: var(--text, inherit); }
.game-info { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.game-info:empty { display: none; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.tag.delta.up { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.tag.delta.down { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
span.delta { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.5rem; text-align: right; }

.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.ranking li { display: grid; grid-template-columns: 2.2rem 1fr auto 4.2rem; align-items: center; gap: .6rem; padding: .45rem .4rem; border-radius: .6rem; }
.ranking li:hover { background: var(--bg); }
.ranking li.mine { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ranking .who { display: flex; flex-direction: row; align-items: center; gap: .55rem; color: inherit; text-decoration: none; min-width: 0; }
.ranking .who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .who:hover strong { text-decoration: underline; }
.ranking .rating { font-weight: 800; font-size: 1.05rem; text-align: right; font-variant-numeric: tabular-nums; }
.ranking .games-n { font-size: .82rem; }
.rank-no { text-align: center; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.medal { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; }
.medal.m1 { color: #b8860b; background: color-mix(in srgb, #e3b341 25%, transparent); }
.medal.m2 { color: #7d8590; background: color-mix(in srgb, #aab3bd 28%, transparent); }
.medal.m3 { color: #a0603a; background: color-mix(in srgb, #cd8a5a 25%, transparent); }
@media (max-width: 480px) { .ranking li { grid-template-columns: 2rem 1fr 3.8rem; } .ranking .games-n { display: none; } }

.big-rating { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.me-rank { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.me-rank .who, .live-now .who { display: flex; flex-direction: column; flex: 1; min-width: 12rem; gap: .15rem; }
.rating-help summary { cursor: pointer; font-weight: 600; }
.rating-help ul { margin: .6rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; }

.profile-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-head .who { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; flex: 1; min-width: 10rem; }
.profile-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); overflow-wrap: anywhere; }
.profile-rating { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.avatar.big { width: 4rem; height: 4rem; font-size: 1.8rem; }
.avatar.big.on::after { width: 1rem; height: 1rem; }
.live-now { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; border-color: var(--danger); }
.live-dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--danger); flex-shrink: 0; box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 50%, transparent); animation: live-pulse 1.8s ease-out infinite; }
@keyframes live-pulse { to { box-shadow: 0 0 0 .5rem transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-list .who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.live-list .who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }

.record-bar { display: flex; height: .7rem; border-radius: 999px; overflow: hidden; background: var(--bg); }
.record-bar .win { background: var(--ok); } .record-bar .draw { background: var(--muted); opacity: .5; } .record-bar .loss { background: var(--danger); }
.record-nums { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .6rem; }
.games li .who a, .people li .who a { color: inherit; text-decoration: none; }
.games li .who a:hover, .people li .who a:hover { text-decoration: underline; }
.muted.small { font-size: .82rem; }
.live-list li > .button { flex-shrink: 0; }
.live-list .who strong { display: block; }
.narrow-page > * + * { margin-top: .8rem; }

/* --- Bretter mit Bild (Holz, Marmor, …): Felder durchsichtig, Bild auf dem Brett --- */
html[data-board-img] .board { background: var(--board-img) center / 100% 100% no-repeat; }
html[data-board-img] .board .sq.light, html[data-board-img] .board .sq.dark { background-color: transparent; }
html[data-board-deep] .board .sq.dark.target::after { background: rgb(255 255 255 / .34); }
html[data-board-deep] .board .sq.dark.target.capture::after { background: transparent; border-color: rgb(255 255 255 / .45); }
html[data-board-deep] .board .sq.dark .coord { color: color-mix(in srgb, var(--sq-light) 85%, transparent); }

/* Auswahl: Bretter und Sound-Pakete */
.theme-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.theme-card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: .45rem; padding: .55rem; text-align: left; border-radius: .8rem; position: relative; }
.theme-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-card.locked .theme-prev { filter: saturate(.75); }
.theme-prev { display: block; width: 100%; aspect-ratio: 1; border-radius: .45rem; overflow: hidden; background: repeating-conic-gradient(var(--pd) 0 25%, var(--pl) 0 50%) 0 0 / 25% 25%; }
.theme-prev.img { background: none; background-size: 100% 100%; }
.theme-name { display: flex; flex-direction: column; gap: .05rem; font-size: .88rem; }
.theme-name strong { font-size: .92rem; }
.theme-name small { color: var(--muted); }
.theme-buy { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--accent); min-height: 1.1em; }
.theme-buy:empty { display: none; }
.sound-card { flex-direction: row; align-items: center; gap: .6rem; }
.sound-card .theme-name { flex: 1; min-width: 0; }
.sound-ico { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex-shrink: 0; border-radius: .6rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sound-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* --- Startseite: Shop-Banner --- */
.shop-banner { display: grid; grid-template-columns: 260px 1fr; gap: 1.6rem; align-items: center; margin: 1.6rem 0 .4rem; padding: 1.4rem 1.6rem; border-radius: 1.4rem; color: #f5f2ea; text-decoration: none; background: radial-gradient(120% 140% at 0% 0%, #2b2414 0%, #141210 55%, #0d0d0d 100%); border: 1px solid color-mix(in srgb, #c9a24a 45%, transparent); box-shadow: 0 10px 30px rgb(0 0 0 / .18); transition: transform .15s ease, box-shadow .15s ease; }
.shop-banner:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgb(0 0 0 / .25); }
.shop-art { position: relative; height: 170px; }
.shop-thumb { position: absolute; width: 112px; height: 112px; border-radius: 12px; box-shadow: 0 8px 18px rgb(0 0 0 / .45); border: 3px solid #2a2118; }
.shop-thumb.t0 { left: 0; top: 30px; transform: rotate(-10deg); }
.shop-thumb.t1 { left: 58px; top: 4px; transform: rotate(-2deg); z-index: 1; }
.shop-thumb.t2 { left: 118px; top: 38px; transform: rotate(7deg); z-index: 2; }
.shop-thumb.t3 { left: 60px; top: 66px; transform: rotate(3deg); z-index: 3; }
.shop-text { display: flex; flex-direction: column; gap: .45rem; }
.shop-kicker { display: inline-flex; align-items: center; gap: .35rem; color: #c9a24a; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; }
.shop-text strong { font-size: clamp(1.5rem, 3.4vw, 2.2rem); line-height: 1.1; }
.shop-text > span:not(.shop-kicker):not(.shop-cta) { color: #d9d4c7; max-width: 34rem; }
.shop-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.shop-cta .button.primary { background: #c9a24a; border-color: #c9a24a; color: #111; }
.shop-coins { display: inline-flex; align-items: center; gap: .35rem; color: #e8d6a6; font-weight: 700; }
@media (max-width: 640px) { .shop-banner { grid-template-columns: 1fr; padding: 1.2rem; } .shop-art { height: 150px; width: 230px; margin: 0 auto; } }

.hub-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1rem; }
.hub-tile { min-height: 11rem; align-items: flex-start; }
.footer-support { font-weight: 700; color: var(--accent) !important; }
.catalog { margin-top: 1rem; }
.catalog-tabs { margin: .6rem 0 1rem; }
.catalog-tabs button { display: inline-flex; align-items: center; gap: .35rem; }
.avatar.has-img { background: var(--bg); padding: 0; }
.avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar.huge { width: 6rem; height: 6rem; font-size: 2.6rem; }
.report-link { font-size: .78rem; color: var(--muted); }

/* --- Duell-Anfrage (Pop-up) --- */
.duel-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgb(0 0 0 / .45); backdrop-filter: blur(3px); animation: duel-fade .18s ease-out; }
.duel-modal { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.6rem 1.4rem 1.1rem; text-align: center; box-shadow: 0 24px 60px rgb(0 0 0 / .35); animation: duel-pop .22s cubic-bezier(.2, .9, .3, 1.3); }
.duel-head { position: relative; display: inline-block; margin-bottom: .4rem; }
.duel-swords { position: absolute; right: -.6rem; bottom: -.3rem; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 3px solid var(--surface); }
.duel-modal h2 { margin: .4rem 0 .2rem; font-size: 1.35rem; }
.duel-from { margin: 0; display: flex; justify-content: center; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: 1.05rem; }
.duel-from a { color: inherit; }
.duel-meta { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; margin: .7rem 0 1.1rem; }
.duel-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.duel-acts .button, .duel-acts button { justify-content: center; }
.duel-count { display: block; margin-top: .7rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes duel-fade { from { opacity: 0; } }
@keyframes duel-pop { from { transform: scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .duel-overlay, .duel-modal { animation: none; } }
.link-room summary { cursor: pointer; font-weight: 600; margin: .6rem 0; }
.profile-head .btns { display: flex; gap: .4rem; flex-wrap: wrap; }

/* --- Support --- */
.support-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem 1.4rem; }
.support-hero h1 { margin: .2rem 0 0; }
.support-hero > p { max-width: 32rem; margin: 0; }
.support-heart { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; color: #c9a24a; background: color-mix(in srgb, #c9a24a 16%, transparent); }
.amounts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: .8rem 0 .4rem; }
.amount { min-width: 4.6rem; font-size: 1.05rem; font-weight: 700; padding: .6rem .9rem; border-radius: .8rem; }
.amount[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.amount.other { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--surface); }
.amount.other input { width: 4.2rem; border: 0; padding: 0; font: inherit; background: transparent; color: inherit; text-align: right; }
.amount.other input:focus { outline: none; }
.amount.other:focus-within { border-color: var(--accent); }
.support-hero .wide { max-width: 22rem; width: 100%; justify-content: center; }
.support-thanks { display: flex; gap: 1rem; align-items: center; border-color: #c9a24a; }
.support-thanks h2 { margin: 0 0 .2rem; }
.shop-cta .button { display: inline-flex; align-items: center; gap: .5rem; }

/* Lektionen: markierte Felder und Pfeile */
.board { position: relative; }
.board .sq.mark::before { content: ""; position: absolute; inset: 0; background: rgb(255 170 0 / .42); box-shadow: inset 0 0 0 3px rgb(255 140 0 / .8); pointer-events: none; }
.board svg.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.board svg.arrows line { stroke: rgb(255 120 0 / .85); stroke-width: .16; stroke-linecap: round; }
.board svg.arrows polygon { fill: rgb(255 120 0 / .85); }
.board.aim-hide-coords .coord { display: none; }
.board.aim-miss { animation: aim-shake .25s; }
@keyframes aim-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
