/* ==========================================================================
   Design: dunkles, ruhiges Launcher-Layout – Menü als Seitenleiste (Desktop)
   bzw. Leiste unten (Handy), große Kacheln, flache Knöpfe, EINE Akzentfarbe.
   Liegt über style.css und überschreibt dort Farben und Formen.
   ========================================================================== */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../fonts/poppins-regular.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../fonts/poppins-medium.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600 800; font-display: swap; src: url("../fonts/poppins-bold.woff2") format("woff2"); }

/* ---------- Farben: dunkel (Standard) ---------- */
:root:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f2b;
  --bg-2: #141842;
  --surface: #1a1e4a;
  --surface-2: #242a63;
  --ink: #f4f5ff;
  --muted: #a6abdb;
  --line: rgb(255 255 255 / .09);
  --accent: #3ddc84;
  --accent-2: #19b765;
  --accent-ink: #052713;
  --violet: #8b5cf6;
  --pink: #f43f8e;
  --amber: #ffb020;
  --cyan: #22c3ee;
  --danger: #ff5a6e;
  --ok: #3ddc84;
  --radius: 1.15rem;
  --shadow: 0 14px 34px rgb(0 0 0 / .38);
  --press: rgb(0 0 0 / .35);
  --glass: rgb(16 19 54 / .78);
  --link: #6fd6ff;
  --page-bg:
    radial-gradient(60rem 40rem at 85% -10%, rgb(139 92 246 / .30), transparent 60%),
    radial-gradient(50rem 35rem at -10% 110%, rgb(34 195 238 / .18), transparent 60%),
    linear-gradient(180deg, #0d0f2b, #0a0c22);
}

/* ---------- Farben: hell ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eef0fb; --bg-2: #e3e6f8; --surface: #ffffff; --surface-2: #f1f3fd;
    --ink: #171a3d; --muted: #5d6290; --line: rgb(23 26 61 / .10);
    --accent: #1fc46f; --accent-2: #109c55; --accent-ink: #ffffff;
    --danger: #e8364f; --ok: #15a35c;
    --shadow: 0 12px 30px rgb(40 46 120 / .14); --press: rgb(23 26 61 / .22); --glass: rgb(255 255 255 / .82); --link: #6a4be0;
    --page-bg:
      radial-gradient(60rem 40rem at 85% -10%, rgb(139 92 246 / .18), transparent 60%),
      radial-gradient(50rem 35rem at -10% 110%, rgb(34 195 238 / .14), transparent 60%),
      linear-gradient(180deg, #f3f4fe, #e9ecfa);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0fb; --bg-2: #e3e6f8; --surface: #ffffff; --surface-2: #f1f3fd;
  --ink: #171a3d; --muted: #5d6290; --line: rgb(23 26 61 / .10);
  --accent: #1fc46f; --accent-2: #109c55; --accent-ink: #ffffff;
  --danger: #e8364f; --ok: #15a35c;
  --shadow: 0 12px 30px rgb(40 46 120 / .14); --press: rgb(23 26 61 / .22); --glass: rgb(255 255 255 / .82); --link: #6a4be0;
  --page-bg:
    radial-gradient(60rem 40rem at 85% -10%, rgb(139 92 246 / .18), transparent 60%),
    radial-gradient(50rem 35rem at -10% 110%, rgb(34 195 238 / .14), transparent 60%),
    linear-gradient(180deg, #f3f4fe, #e9ecfa);
}

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page-bg) fixed;
  min-height: 100vh;
}
h1, h2, h3, .brand, .tile-body strong { letter-spacing: -.01em; }
h1 { font-weight: 800; }
h2 { font-weight: 700; }
a { color: var(--link); }

/* ---------- Menü: Seitenleiste (Desktop) ---------- */
.topbar {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.05rem; }
.brand img { border-radius: 9px; box-shadow: 0 4px 14px rgb(0 0 0 / .3); }
#nav a { color: var(--muted); font-weight: 600; border-radius: .9rem; display: inline-flex; align-items: center; gap: .55rem; }
#nav a:hover { background: var(--surface-2); color: var(--ink); }
#nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav-ico {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .7rem; color: #fff; flex-shrink: 0;
  background: var(--g, linear-gradient(135deg, #8b5cf6, #6d28d9)); box-shadow: 0 4px 0 var(--press);
}
#nav a:nth-child(1) { --g: linear-gradient(135deg, #3ddc84, #0ea35a); }
#nav a:nth-child(2) { --g: linear-gradient(135deg, #22c3ee, #2563eb); }
#nav a:nth-child(3) { --g: linear-gradient(135deg, #ffb020, #f2620f); }
#nav a:nth-child(4) { --g: linear-gradient(135deg, #f43f8e, #c026d3); }
#nav a:nth-child(5) { --g: linear-gradient(135deg, #8b5cf6, #5b21b6); }
#nav a:nth-child(6) { --g: linear-gradient(135deg, #14d8c4, #0d9488); }

@media (min-width: 900px) {
  body { padding-left: 248px; }
  .topbar {
    position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 1.4rem; padding: 1.2rem .9rem;
    border-bottom: 0; border-right: 1px solid var(--line);
  }
  .brand { padding: 0 .4rem; font-size: 1.12rem; white-space: normal; line-height: 1.15; }
  .brand img { width: 40px; height: 40px; }
  .topbar #nav { flex: 0 0 auto; flex-direction: column; gap: .3rem; overflow: visible; -webkit-mask-image: none; mask-image: none; padding: 0; }
  #nav a { padding: .45rem .55rem; font-size: 1rem; }
  #nav a[aria-current="page"]::after { content: ""; margin-left: auto; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
  .tools { margin-top: auto; flex-wrap: wrap; gap: .5rem; padding: .7rem .3rem 0; border-top: 1px solid var(--line); }
  .site-footer { margin-left: 0; }
  main { max-width: 1180px; padding: 1.4rem 1.6rem; }
}

/* ---------- Menü: Leiste unten (Handy/Tablet) ---------- */
@media (max-width: 899px) {
  body { padding-bottom: 76px; }
  /* backdrop-filter würde die feste Leiste unten an die Kopfzeile binden */
  .topbar { padding: .5rem .8rem; backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 92%, transparent); }
  .topbar #nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom));
    background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); -webkit-mask-image: none; mask-image: none; overflow: visible;
  }
  #nav a { flex-direction: column; gap: .2rem; padding: .25rem .1rem; font-size: .64rem; text-align: center; border-radius: .7rem; white-space: nowrap; }
  #nav a[aria-current="page"] { background: transparent; box-shadow: none; color: var(--ink); }
  #nav a[aria-current="page"] .nav-ico { transform: translateY(-3px); box-shadow: 0 6px 0 var(--press), 0 0 18px rgb(255 255 255 / .12); }
  .nav-ico { width: 2rem; height: 2rem; transition: transform .15s; }
  .tools { margin-left: auto; }
}

/* ---------- Karten ---------- */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, white 4%), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}
.card h2 { display: flex; align-items: center; gap: .45rem; font-size: 1.05rem; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .2rem 0 .3rem; }

/* ---------- Knöpfe: kräftig, mit "Druck"-Kante ---------- */
button, a.button {
  border: 0; border-radius: .85rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink);
  box-shadow: 0 4px 0 var(--press);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease, background .15s;
}
button:hover:not(:disabled), a.button:hover { background: color-mix(in srgb, var(--surface-2) 85%, white 15%); filter: none; }
button:active:not(:disabled), a.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--press); }
button.primary, a.button.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, white 10%), var(--accent-2));
  color: var(--accent-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent-2) 55%, black);
  text-shadow: 0 1px 0 rgb(255 255 255 / .25);
}
button.primary:hover:not(:disabled), a.button.primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, white 20%), var(--accent)); }
button.danger { background: linear-gradient(180deg, #ff7a8a, #e3364f); color: #fff; box-shadow: 0 4px 0 #9d1f33; }
button:disabled { opacity: .4; box-shadow: 0 2px 0 var(--press); }
.button.big, button.big { padding: .85rem 1.4rem; font-size: 1.08rem; border-radius: 1rem; }
button.small, a.button.small { border-radius: .7rem; box-shadow: 0 3px 0 var(--press); }
select, input[type="text"], input[type="number"], input[type="password"], textarea, .form-field input {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: .75rem; color: var(--ink);
}
.seg { border: 0; border-radius: .9rem; background: var(--bg-2); padding: .25rem; gap: .2rem; box-shadow: inset 0 2px 6px rgb(0 0 0 / .25); }
.seg button { box-shadow: none; border-radius: .7rem; background: transparent; }
.seg button + button { border-left: 0; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: linear-gradient(180deg, color-mix(in srgb, var(--violet) 85%, white 15%), #6d28d9); color: #fff; box-shadow: 0 3px 0 #3b1690; }
.chip { border: 0; background: var(--surface-2); box-shadow: 0 3px 0 var(--press); }
.chip.coins { background: linear-gradient(180deg, #ffd25a, #f2a20f); color: #4a2a00; box-shadow: 0 3px 0 #a5620a; }
.chip.coins .ic { color: #6b3d00; }
.tools .tool { border-radius: .8rem; background: var(--surface-2); color: var(--ink); box-shadow: 0 3px 0 var(--press); }
.tools .tool[aria-current="page"] { background: linear-gradient(180deg, #a78bfa, #6d28d9); color: #fff; }

/* ---------- Spiel-Knöpfe (Aufgeben, Remis, …) ---------- */
.game-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: .5rem; margin-top: .7rem; }
.act { flex-direction: column; gap: .3rem; padding: .6rem .3rem .5rem; border-radius: 1rem; font-size: .78rem; line-height: 1.1; min-height: 4.4rem; }
.act-ico { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .75rem; color: #fff; background: var(--ag); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .2); }
.act-resign { --ag: linear-gradient(135deg, #ff7a8a, #d61f45); }
.act-draw { --ag: linear-gradient(135deg, #ffd25a, #f08c00); }
.act-takeback { --ag: linear-gradient(135deg, #60a5fa, #2563eb); }
.act-hint { --ag: linear-gradient(135deg, #fde047, #eab308); }
.act-flip { --ag: linear-gradient(135deg, #a78bfa, #6d28d9); }
.act-new { --ag: linear-gradient(135deg, #3ddc84, #0ea35a); }
.act-review { --ag: linear-gradient(135deg, #22d3ee, #0891b2); }
.act-resign:hover:not(:disabled) { background: color-mix(in srgb, #ff5a6e 18%, var(--surface-2)); }
.act-draw:hover:not(:disabled) { background: color-mix(in srgb, #ffb020 18%, var(--surface-2)); }
.act:disabled .act-ico { filter: grayscale(.7); }

/* ---------- Spielerleisten und Uhr ---------- */
.bar .clock { background: var(--bg-2); border: 0; border-radius: .7rem; padding: .2rem .7rem; box-shadow: inset 0 2px 5px rgb(0 0 0 / .3); }
.bar .clock.running, .bar.active .clock { background: linear-gradient(180deg, #3ddc84, #19b765); color: #052713; box-shadow: 0 0 16px rgb(61 220 132 / .45); }
.board-col .board { border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 6px color-mix(in srgb, var(--surface) 70%, transparent), 0 24px 50px -18px rgb(0 0 0 / .6); }

/* ---------- Startseite ---------- */
.hero {
  border: 0;
  background:
    radial-gradient(90% 120% at 100% 0%, rgb(244 63 142 / .35), transparent 55%),
    radial-gradient(80% 120% at 0% 100%, rgb(34 195 238 / .25), transparent 55%),
    linear-gradient(135deg, #3b1d8f, #241462 55%, #16114a);
  color: #fff; box-shadow: var(--shadow);
}
.hero .muted, .hero-hello, .hero-sub, .hero-facts { color: rgb(255 255 255 / .78); }
.hero h1 .accent { background: linear-gradient(90deg, #3ddc84, #22c3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-facts .ic { color: #ffd25a; }
.hero .button:not(.primary) { background: rgb(255 255 255 / .14); color: #fff; box-shadow: 0 4px 0 rgb(0 0 0 / .3); }
.hero-glow { background: #f43f8e; opacity: .35; }
.home-label { color: var(--ink); font-size: 1.05rem; text-transform: none; letter-spacing: 0; font-weight: 800; }

/* Große bunte Kacheln */
.home-grid, .hub-grid { gap: 1rem; }
.tile {
  border: 0; color: #fff; min-height: 9.5rem; padding: 1.1rem; border-radius: 1.3rem; overflow: hidden;
  background: var(--tg, linear-gradient(135deg, #8b5cf6, #5b21b6));
  box-shadow: 0 6px 0 var(--tp, #3b1690), var(--shadow);
  flex-direction: column; gap: .7rem;
}
.tile::after { content: ""; position: absolute; right: -2.5rem; bottom: -2.5rem; width: 9rem; height: 9rem; border-radius: 50%; background: rgb(255 255 255 / .12); pointer-events: none; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 10px 0 var(--tp, #3b1690), 0 18px 40px rgb(0 0 0 / .35); }
.tile:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--tp, #3b1690); }
.tile .tile-icon { width: 3.2rem; height: 3.2rem; border-radius: 1rem; background: rgb(255 255 255 / .2); color: #fff; box-shadow: inset 0 -3px 0 rgb(0 0 0 / .15); }
.tile .tile-body strong { font-size: 1.2rem; font-weight: 800; }
.tile .tile-body .muted { color: rgb(255 255 255 / .85); }
.tile .tile-go { color: #fff; opacity: .9; transform: none; background: rgb(255 255 255 / .2); border-radius: 50%; width: 2rem; height: 2rem; display: grid; place-items: center; }
.tile .tile-badge { display: inline-block; margin-top: .3rem; padding: .1rem .55rem; border-radius: 99px; background: rgb(0 0 0 / .22); color: #fff; font-size: .75rem; font-weight: 700; width: fit-content; }
.tile.c1 { --tg: linear-gradient(135deg, #3ddc84, #0b9b53); --tp: #06663a; }
.tile.c2 { --tg: linear-gradient(135deg, #ffb020, #f05a0f); --tp: #a1360a; }
.tile.c3 { --tg: linear-gradient(135deg, #22c3ee, #2563eb); --tp: #173f9e; }
.tile.c4 { --tg: linear-gradient(135deg, #f43f8e, #be185d); --tp: #7d0f3d; }
.tile.c5 { --tg: linear-gradient(135deg, #a78bfa, #6d28d9); --tp: #44178f; }
.tile.c6 { --tg: linear-gradient(135deg, #14d8c4, #0d7f86); --tp: #0a5458; }
.tile.c7 { --tg: linear-gradient(135deg, #fb7185, #e11d48); --tp: #8f1230; }
.tile.c8 { --tg: linear-gradient(135deg, #facc15, #d97706); --tp: #8a4b05; }
.hub-tile { min-height: 11rem; }
.hub-back { margin-top: 1.2rem; }
.ic.flip { transform: scaleX(-1); }

/* ---------- Online: Casual / Competitive ---------- */
.mode-choice { display: flex; flex-direction: column; gap: 1rem; }
.mode-title { margin: .2rem 0 0; font-size: 1.4rem; }
.mode-card {
  position: relative; display: flex; gap: 1rem; align-items: center; padding: 1.3rem 1.2rem; border-radius: 1.3rem; color: #fff; text-decoration: none; overflow: hidden;
  background: var(--mg); box-shadow: 0 6px 0 var(--mp), var(--shadow); transition: transform .12s, box-shadow .12s;
}
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--mp), 0 18px 40px rgb(0 0 0 / .35); }
.mode-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--mp); }
.mode-card.casual { --mg: linear-gradient(135deg, #22c3ee, #2563eb); --mp: #173f9e; }
.mode-card.competitive { --mg: linear-gradient(135deg, #ffb020, #e5481b); --mp: #9a2c0c; }
.mode-icon { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 1.1rem; background: rgb(255 255 255 / .2); flex-shrink: 0; }
.mode-icon.small { width: 2.6rem; height: 2.6rem; border-radius: .8rem; }
.mode-body { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
.mode-body strong { font-size: 1.35rem; font-weight: 800; }
.mode-body span { color: rgb(255 255 255 / .88); font-size: .92rem; }
.mode-lock { display: inline-flex; align-items: center; gap: .3rem; margin-top: .3rem; padding: .1rem .5rem; border-radius: 99px; background: rgb(0 0 0 / .22); width: fit-content; font-weight: 600; }
.mode-go { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: rgb(255 255 255 / .22); }
.mode-head { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 1.1rem; color: #fff; background: var(--mg); box-shadow: 0 4px 0 var(--mp); }
.mode-head.casual { --mg: linear-gradient(135deg, #22c3ee, #2563eb); --mp: #173f9e; }
.mode-head.competitive { --mg: linear-gradient(135deg, #ffb020, #e5481b); --mp: #9a2c0c; }
.mode-head .mode-body strong { font-size: 1.1rem; }
.mode-head .mode-body small { color: rgb(255 255 255 / .85); }
.mode-head .button { background: rgb(255 255 255 / .2); color: #fff; box-shadow: 0 3px 0 rgb(0 0 0 / .25); }

/* ---------- Bedenkzeit-Auswahl ---------- */
.tc-picker { display: flex; flex-direction: column; gap: .55rem; }
.tc-picker.dim { opacity: .45; pointer-events: none; }
.tc-chips, .waiting-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .45rem; }
.tc-chip { flex-direction: column; gap: 0; padding: .45rem .3rem; border-radius: .8rem; line-height: 1.15; }
.tc-chip strong { font-size: .95rem; }
.tc-chip small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.tc-chip[aria-pressed="true"] { background: linear-gradient(180deg, #a78bfa, #6d28d9); color: #fff; box-shadow: 0 3px 0 #3b1690; }
.tc-chip[aria-pressed="true"] small { color: rgb(255 255 255 / .85); }
.tc-chip.waiting { background: linear-gradient(180deg, #3ddc84, #19b765); color: #052713; box-shadow: 0 3px 0 #0c6e3c; }
.tc-chip.waiting small { color: #0b4d2b; }
.tc-custom summary { cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; color: var(--muted); }
.tc-custom-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }
.tc-custom-row label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--muted); }
.tc-custom-row input { width: 6rem; padding: .4rem .5rem; }
.tc-pair { display: flex; gap: .3rem; }
.tc-pair select { padding: .4rem; }
.tc-error { color: var(--danger); font-size: .8rem; min-height: 1em; display: block; }
.tc-summary { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.quick-form { display: flex; flex-direction: column; gap: .7rem; }
.waiting-list:empty { display: none; }
.waiting-head { display: flex; align-items: center; gap: .45rem; margin: 0 0 .4rem; font-weight: 700; font-size: .88rem; }
.friends-tc { max-width: 34rem; }

/* ---------- Lektionen und Training ---------- */
.lesson-crumb { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-decoration: none; }
.lesson-title { font-size: 1.5rem; margin: .2rem 0 .4rem; }
.lesson-text { font-size: 1rem; line-height: 1.55; }
.lesson-dots { display: flex; gap: .35rem; margin: .2rem 0 .6rem; }
.lesson-dots span { width: 1.6rem; height: .4rem; border-radius: 99px; background: var(--surface-2); }
.lesson-dots span.done { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.lesson-dots span.on { background: linear-gradient(90deg, #a78bfa, #22c3ee); }
.lesson-task { display: flex; gap: .6rem; align-items: flex-start; flex-wrap: wrap; padding: .75rem .85rem; border-radius: .95rem; background: var(--bg-2); border: 1px solid var(--line); }
.lesson-task > span { flex: 1; min-width: 12rem; }
.lesson-task.good { background: color-mix(in srgb, var(--accent) 16%, var(--bg-2)); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.lesson-task.good .ic { color: var(--accent); }
.lesson-task.bad { background: color-mix(in srgb, var(--danger) 14%, var(--bg-2)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.lesson-task.bad .ic { color: var(--danger); }
.lesson-nav { justify-content: space-between; }
.quick-spinner.small { width: 1.1rem; height: 1.1rem; border-width: 2px; }
.drill-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.drill-pick { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: .75rem; font-weight: 800; }
.drill-pick.on { background: linear-gradient(180deg, #a78bfa, #6d28d9); color: #fff; box-shadow: 0 3px 0 #3b1690; }
.drill-pick.done:not(.on) { background: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); color: var(--ink); }
.drill-counter { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 99px; background: var(--bg-2); font-weight: 700; font-size: .9rem; width: fit-content; margin-bottom: .5rem; }
.aim-board { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1rem; border-radius: 1.1rem; margin: .6rem 0; background: linear-gradient(135deg, #3b1d8f, #16114a); color: #fff; }
.aim-target { font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 800; line-height: 1; text-align: center; letter-spacing: .02em; }
.aim-target.pop { animation: aim-pop .25s ease-out; }
@keyframes aim-pop { from { transform: scale(1.35); color: #3ddc84; } }
.aim-row { display: flex; gap: 1.4rem; }
.aim-stat, .aim-time { display: inline-flex; align-items: center; gap: .35rem; font-size: 1.05rem; }
.aim-board .muted { color: rgb(255 255 255 / .75); }

/* ---------- Analyse: Partie auswählen ---------- */
.wide-seg { display: flex; }
.wide-seg button { flex: 1; }
.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.match-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: .9rem; background: var(--bg-2); flex-wrap: wrap; }
.match-list .who { display: flex; flex-direction: column; flex: 1; min-width: 10rem; }
.match-list .acts { display: flex; gap: .35rem; }
.match-pick h3 { margin: 1rem 0 .5rem; font-size: .95rem; }

/* ---------- Kleinere Anpassungen ---------- */
.tag { border: 0; background: var(--bg-2); }
.shop-banner { border-radius: 1.4rem; box-shadow: 0 6px 0 #5a3d08, var(--shadow); }
.duel-modal { border-radius: 1.4rem; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.site-footer a { color: var(--muted); }
#toast { border-radius: 1rem; }
.card .field input[type="text"], .card .field select { width: 100%; max-width: 100%; }


/* ==========================================================================
   Ruhiger: weniger Farbe, flache Knöpfe (überschreibt das oben)
   ========================================================================== */
:root:root, :root[data-theme="dark"] {
  --bg: #121318; --bg-2: #1a1c23; --surface: #1d1f27; --surface-2: #272a34;
  --muted: #9aa0b1; --line: rgb(255 255 255 / .08); --link: #7cd4a3;
  --glass: rgb(18 19 24 / .9);
  --page-bg: linear-gradient(180deg, #14151b, #101116);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light; --bg: #f4f5f7; --bg-2: #eceef2; --surface: #ffffff; --surface-2: #f0f1f4; --ink: #17181d; --muted: #5f6472;
    --line: rgb(23 24 29 / .10); --page-bg: #f4f5f7; --link: #12935a; --glass: rgb(255 255 255 / .92);
    --accent: #1fc46f; --accent-2: #109c55; --accent-ink: #ffffff; --danger: #e8364f; --press: rgb(23 24 29 / .2);
  }
}
:root[data-theme="light"] {
  color-scheme: light; --bg: #f4f5f7; --bg-2: #eceef2; --surface: #ffffff; --surface-2: #f0f1f4; --ink: #17181d; --muted: #5f6472;
  --line: rgb(23 24 29 / .10); --page-bg: #f4f5f7; --link: #12935a; --glass: rgb(255 255 255 / .92);
  --accent: #1fc46f; --accent-2: #109c55; --accent-ink: #ffffff; --danger: #e8364f; --press: rgb(23 24 29 / .2);
}

/* Menü: Symbole einfarbig, nur der aktive Eintrag in Akzentfarbe */
.nav-ico, #nav a:nth-child(n) .nav-ico { background: transparent; color: inherit; box-shadow: none; width: 1.9rem; height: 1.9rem; }
#nav a[aria-current="page"] .nav-ico { color: var(--accent); }
@media (max-width: 899px) { #nav a[aria-current="page"] .nav-ico { transform: none; box-shadow: none; } }
#nav a[aria-current="page"]::after { box-shadow: none; }

/* Karten: schlicht */
.card { background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .18); }

/* Knöpfe: flach, keine Kante */
button, a.button, button.small, a.button.small, .chip, .tools .tool { box-shadow: none; }
button:active:not(:disabled), a.button:active { transform: scale(.98); box-shadow: none; }
button, a.button { border: 1px solid var(--line); }
button.primary, a.button.primary { background: var(--accent); border-color: transparent; box-shadow: none; text-shadow: none; }
button.primary:hover:not(:disabled), a.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, white 12%); }
button.danger { background: var(--danger); box-shadow: none; }
button:disabled { box-shadow: none; }
.seg { box-shadow: none; }
.seg button { border: 0; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"],
.tc-chip[aria-pressed="true"], .drill-pick.on, .tools .tool[aria-current="page"] {
  background: var(--accent); color: var(--accent-ink); box-shadow: none;
}
.tc-chip[aria-pressed="true"] small { color: inherit; opacity: .8; }
.tc-chip.waiting { background: color-mix(in srgb, var(--accent) 20%, var(--surface-2)); color: var(--ink); box-shadow: none; border-color: var(--accent); }
.tc-chip.waiting small { color: var(--muted); }
.chip.coins { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.chip.coins .ic { color: #e3b341; }

/* Spiel-Knöpfe: Symbol farbig, Fläche neutral */
.act-ico { background: transparent !important; box-shadow: none; width: 1.8rem; height: 1.8rem; }
.act-resign .act-ico { color: var(--danger); }
.act-draw .act-ico { color: #e3b341; }
.act-takeback .act-ico, .act-flip .act-ico, .act-review .act-ico { color: var(--muted); }
.act-hint .act-ico { color: #e3b341; }
.act-new .act-ico { color: var(--accent); }
.act { min-height: 3.9rem; }

/* Startseite & Kacheln: neutrale Fläche, farbiges Symbol */
.hero { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.hero .muted, .hero-hello, .hero-sub, .hero-facts { color: var(--muted); }
.hero h1 .accent { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent); }
.hero .button:not(.primary) { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.hero-glow { display: none; }
.tile, .tile.c1, .tile.c2, .tile.c3, .tile.c4, .tile.c5, .tile.c6, .tile.c7, .tile.c8 {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none;
}
.tile::after { display: none; }
.tile:hover { transform: translateY(-2px); box-shadow: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.tile:active { transform: none; box-shadow: none; }
.tile .tile-icon { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); box-shadow: none; }
.tile .tile-body .muted { color: var(--muted); }
.tile .tile-go { background: var(--surface-2); color: var(--muted); }
.tile .tile-badge { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* Casual / Competitive: neutral, nur das Symbol in Farbe */
.mode-card, .mode-card.casual, .mode-card.competitive, .mode-head, .mode-head.casual, .mode-head.competitive {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.mode-card:active { transform: none; box-shadow: none; }
.mode-icon { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.mode-card.competitive .mode-icon, .mode-head.competitive .mode-icon { background: rgb(227 179 65 / .14); color: #e3b341; }
.mode-body span, .mode-head .mode-body small { color: var(--muted); }
.mode-lock { background: var(--surface-2); }
.mode-go { background: var(--surface-2); color: var(--muted); }
.mode-head .button { background: var(--surface-2); color: var(--ink); box-shadow: none; }

/* Übungen */
.aim-board { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); }
.aim-board .muted { color: var(--muted); }
.lesson-dots span.on { background: var(--accent); }
.bar .clock.running, .bar.active .clock { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.board-col .board { box-shadow: 0 10px 30px -14px rgb(0 0 0 / .55); }
.shop-banner { box-shadow: none; }
.duel-modal { background: var(--surface); }
.duel-swords { background: var(--accent); }

/* Häkchen / Kreuz auf dem Feld (Puzzles, Lektionen, Training) */
.move-mark { position: absolute; top: 4%; right: 4%; z-index: 5; display: grid; place-items: center; width: 34%; height: 34%; border-radius: 50%; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .35); animation: mark-pop .22s ease-out; pointer-events: none; }
.move-mark .ic { width: 62%; height: 62%; stroke-width: 3; }
.move-mark.good { background: #22b45e; }
.move-mark.bad { background: #e5404f; }
@keyframes mark-pop { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .move-mark { animation: none; } }

/* Melden & Admin */
.report-link { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .5rem; font-size: .8rem; font-weight: 500; color: var(--muted); background: transparent; border: 0; }
.report-link:hover:not(:disabled) { color: var(--danger); background: transparent; }
.report-modal { width: min(460px, 100%); text-align: left; }
.report-modal h2 { display: flex; align-items: center; gap: .5rem; justify-content: flex-start; }
.report-modal h2 .ic { color: var(--danger); }
.report-opts { display: flex; flex-direction: column; gap: .3rem; margin: .4rem 0 .7rem; }
.report-opt { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .55rem; border-radius: .7rem; cursor: pointer; border: 1px solid var(--line); }
.report-opt:has(input:checked) { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.report-opt span { display: flex; flex-direction: column; }
.report-opt input { margin-top: .25rem; accent-color: var(--danger); }
.report-modal textarea { width: 100%; box-sizing: border-box; padding: .55rem; font: inherit; resize: vertical; }
.report-list { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.report-card.done { opacity: .75; }
.report-head { display: flex; gap: .8rem; align-items: center; }
.report-head .who { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: .15rem; }
.report-details { margin: .3rem 0 .6rem; padding: .55rem .75rem; border-left: 3px solid var(--danger); background: var(--bg-2); border-radius: 0 .6rem .6rem 0; white-space: pre-wrap; }
.admin .seg { margin-top: .5rem; }
.notice-modal { width: min(480px, 100%); text-align: left; }
.notice-modal h2 { display: flex; align-items: center; gap: .5rem; justify-content: flex-start; }
.notice-item { padding: .6rem .7rem; border-radius: .7rem; background: var(--bg-2); margin-bottom: .5rem; }
.notice-item p { margin: .2rem 0 0; }

/* Pop-up am Partieende */
.gameover { position: relative; text-align: center; padding-top: 1.8rem; }
.gameover h2 { font-size: 1.7rem; margin: .5rem 0 .2rem; justify-content: center; }
.gameover-ico { display: inline-grid; place-items: center; width: 4.2rem; height: 4.2rem; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.gameover.win .gameover-ico { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.gameover.loss .gameover-ico { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.gameover.draw .gameover-ico { background: rgb(227 179 65 / .16); color: #e3b341; }
.gameover-sub { margin: 0 0 .8rem; color: var(--muted); }
.gameover-rating { margin: 0 0 1rem; font-weight: 700; }
.gameover-rating.up { color: var(--accent); }
.gameover-rating.down { color: var(--danger); }
.gameover-acts { display: flex; flex-direction: column; gap: .45rem; }
.gameover-acts button { justify-content: center; }
.gameover-x { position: absolute; top: .6rem; right: .6rem; width: 2.2rem; height: 2.2rem; padding: 0; border: 0; background: transparent; color: var(--muted); }
.board .sq.premove::before { content: ""; position: absolute; inset: 0; background: rgb(80 140 255 / .38); pointer-events: none; }
.big-rating.unranked { font-size: 1.3rem; color: var(--muted); }

/* Vollbild (F11): Brett und Seitenbereich etwas weiter nach unten */
html.is-fullscreen main { padding-top: clamp(1.5rem, 5vh, 3.5rem); }
@media (display-mode: fullscreen) { main { padding-top: clamp(1.5rem, 5vh, 3.5rem); } }

/* ---------- Spielseiten: großes Brett in der Mitte ----------
   Auf Seiten mit Brett wird die Seitenleiste zur schmalen Icon-Leiste, damit das Brett
   so groß wie möglich und mittig steht. */
@media (min-width: 900px) {
  html.board-page body { padding-left: 76px; }
  html.board-page .topbar { width: 76px; padding: 1rem .55rem; gap: 1rem; align-items: center; }
  html.board-page .brand span,
  html.board-page #nav .nav-label,
  html.board-page .chip-name,
  html.board-page .chip.coins span { display: none; }
  html.board-page .brand { padding: 0; }
  html.board-page .brand img { width: 38px; height: 38px; }
  html.board-page #nav a { justify-content: center; padding: .4rem; }
  html.board-page #nav a[aria-current="page"]::after { display: none; }
  html.board-page #nav a[aria-current="page"] .nav-ico { outline: 2px solid var(--accent); outline-offset: 2px; }
  html.board-page .tools { flex-direction: column; align-items: center; padding: .7rem 0 0; }
  html.board-page .chip { padding: .3rem; justify-content: center; }
  html.board-page main { max-width: 1560px; padding: 1rem 1.5rem; }
  html.board-page { --board-max: calc(100vh - 6.6rem); }
  html.is-fullscreen.board-page { --board-max: calc(100vh - 6.6rem - clamp(1.5rem, 5vh, 3.5rem)); }
  html.board-page .layout { grid-template-columns: minmax(0, var(--board-max)) 330px; gap: 2rem; align-items: start; justify-content: center; }
  html.board-page .board-col { width: 100%; position: sticky; top: 1rem; }
}
@media (min-width: 1500px) {
  html.board-page .layout { grid-template-columns: minmax(0, var(--board-max)) 360px; }
}

/* ---------- Zugnavigation ---------- */
.navbar { display: flex; flex-direction: column; gap: .35rem; }
.btns.nav { display: grid; grid-template-columns: .8fr 1fr 1fr .8fr; gap: .4rem; }
.btns.nav .navbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-width: 0; padding: .5rem .3rem .4rem; font-weight: 600;
}
.btns.nav .navbtn svg { width: 22px; height: 22px; }
.btns.nav .navbtn:not(.edge) { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btns.nav .navbtn:not(.edge) svg { color: var(--accent); }
.btns.nav .navbtn:disabled { opacity: .38; cursor: default; }
.navbtn-label { font-size: .72rem; letter-spacing: .02em; color: var(--muted); }
.navcount { font-size: .78rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* Gambits */
.gambit-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .2rem 0 .4rem; }
.gambit-meta[hidden] { display: none; }
.gambit-meta .risk { flex-basis: 100%; margin: .2rem 0 0; }
.tag.good { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.olist button.rec span { font-weight: 700; }
.olist button.rec:not([aria-current="true"]) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.olist button small { white-space: nowrap; flex-shrink: 0; }

/* ---------- Suche (Learning, Eröffnungs-/Gambitliste) ---------- */
.search { display: flex; flex-direction: column; gap: .6rem; margin: 0 0 1.2rem; }
.search-bar {
  display: flex; align-items: center; gap: .6rem; padding: 0 .9rem; min-height: 3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; color: var(--muted);
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-bar.small { min-height: 2.5rem; border-radius: .7rem; padding: 0 .7rem; margin-bottom: .3rem; }
.search-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink, inherit); font: inherit; font-size: 1rem; padding: .55rem 0; outline: none; box-shadow: none; }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-results { display: flex; flex-direction: column; gap: .4rem; }
.search-results[hidden], .hub-grid[hidden] { display: none; }
.search-count { margin: 0 0 .2rem; font-size: .88rem; }
.search-hit {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: .8rem;
  background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none;
}
.search-hit:hover, .search-hit:focus-visible { border-color: var(--accent); }
.search-ico { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; flex: none; border-radius: .6rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.search-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.olist h3[hidden], .olist button[hidden] { display: none; }

/* ---------- Kein blauer Tipp-Rahmen auf dem Handy ---------- */
html { -webkit-tap-highlight-color: transparent; }
.board, .board * { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.board:focus, .board .sq:focus { outline: none; }
.board:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-bar .search-input:focus-visible { outline: none; }
.search-bar .search-input { -webkit-appearance: none; appearance: none; }

/* ---------- Bestätigungscode (6 Ziffern) ---------- */
.code-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 3.2rem)); gap: .5rem; justify-content: center; margin: .4rem 0 .2rem; }
.code-inputs .code-digit {
  width: 100%; aspect-ratio: 4 / 5; padding: 0; text-align: center; font-size: 1.6rem; font-weight: 700;
  font-variant-numeric: tabular-nums; border: 1.5px solid var(--line); border-radius: .7rem; background: var(--surface); color: inherit;
}
.code-inputs .code-digit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.code-inputs .code-digit:disabled { opacity: .5; }
.linklike { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; box-shadow: none; }
.linklike:disabled { color: var(--muted); cursor: default; text-decoration: none; }
