/* Schach-Rätsel – dunkel & verspielt. Design-Tokens oben, später für weitere Lern-Seiten wiederverwendbar.
   Keine externen Schriften (Datenschutz): System-Schriften, auf Apple-Geräten gerundet. */
:root {
    --bg: #13111c;
    --bg-glow: #221a3d;
    --surface: #1d1a2b;
    --surface-2: #27233a;
    --line: #353050;
    --text: #f4f2ff;
    --muted: #aaa4c8;
    --primary: #8b6cff;
    --primary-2: #6a4dff;
    --accent: #ffc04d;
    --success: #3ddc97;
    --danger: #ff6b81;
    --sq-light: #f0d9b5;   /* klassische Brettfarben */
    --sq-dark: #b58863;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --sidebar: 248px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: radial-gradient(1200px 600px at 80% -10%, var(--bg-glow), transparent 60%), var(--bg);
    background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Grundgerüst ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 22px 14px; background: rgba(20, 18, 31, .75); border-right: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.logo:hover { text-decoration: none; }
.logo-mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 18px rgba(139, 108, 255, .45);
}
.logo small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.nav-label { margin: 14px 10px 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
    color: var(--text); font-weight: 600; font-size: .95rem;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--primary); }
.nav .ico { width: 26px; text-align: center; font-size: 1.1rem; }
.nav .soon { margin-left: auto; font-size: .68rem; color: var(--muted); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 32px; }
.topbar .logo { display: none; }
.reg-short { display: none; }
.hello { color: var(--muted); font-weight: 600; }
.hello b { color: var(--text); }
.content { flex: 1; width: 100%; max-width: 1100px; padding: 8px 32px 48px; }
.footer { padding: 20px 32px 28px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.footer a { color: var(--muted); text-decoration: underline; }
.promo-banner { background: var(--accent); text-align: center; padding: 8px 16px; font-weight: 700; }
.promo-banner a { color: #221a00; }

/* ---------- Bausteine ---------- */
.btn, button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border: 0; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 750; color: #fff; text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 6px 0 #4a33b8, 0 10px 20px rgba(106, 77, 255, .35);
    transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover, button:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active, button:active { transform: translateY(4px); box-shadow: 0 2px 0 #4a33b8; }
.btn-ghost, .topbar button {
    background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line);
}
.btn-ghost:active, .topbar button:active { box-shadow: inset 0 0 0 2px var(--primary); }
.btn-accent { background: var(--accent); color: #2a1d00; box-shadow: 0 6px 0 #c98a14, 0 10px 20px rgba(255, 192, 77, .25); }
.btn-accent:active { box-shadow: 0 2px 0 #c98a14; }
.btn-sm, .topbar .btn, .topbar button { padding: 8px 16px; font-size: .92rem; }
.inline { display: inline; margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge-green { background: rgba(61, 220, 151, .15); color: var(--success); }
.badge-yellow { background: rgba(255, 192, 77, .15); color: var(--accent); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; margin: -6px 0 16px; }

/* Meldungen */
[role="alert"], [role="status"] { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 600; }
[role="alert"] { background: rgba(255, 107, 129, .12); color: #ffb3c0; border: 1px solid rgba(255, 107, 129, .35); }
[role="status"] { background: rgba(61, 220, 151, .12); color: #a9f5d2; border: 1px solid rgba(61, 220, 151, .35); }

/* ---------- Formulare ---------- */
.auth { max-width: 460px; margin: 24px auto; }
.auth h1 { font-size: 1.9rem; }
.auth .lead { color: var(--muted); }
form label { display: block; margin-bottom: 16px; font-weight: 700; font-size: .92rem; }
input[type="email"], input[type="password"], input[type="text"], input:not([type]) {
    display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
    font: inherit; font-weight: 500; color: var(--text);
    background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius-sm);
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(139, 108, 255, .2); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
label.check input { width: 20px; height: 20px; accent-color: var(--primary); }
form button { width: 100%; margin-top: 6px; }
.auth-links { margin-top: 18px; text-align: center; font-size: .92rem; }

/* ---------- Startseite ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; padding: 28px 0 40px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero h1 .hl { background: linear-gradient(90deg, var(--accent), #ff8a5c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.12rem; color: var(--muted); max-width: 34em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.mini-board {
    display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; width: 100%; max-width: 360px; justify-self: center;
    border-radius: var(--radius); overflow: hidden; border: 6px solid var(--surface-2); box-shadow: var(--shadow);
    transform: rotate(-3deg);
}
.mini-board span { display: grid; place-items: center; background: var(--sq-light); font-size: clamp(1.1rem, 3.4vw, 2.2rem); line-height: 1; }
.mini-board span.d { background: var(--sq-dark); }
.mini-board .w { color: #fff; text-shadow: 0 0 1px #000, 0 0 1px #000, 0 0 2px #000, 0 2px 3px rgba(0,0,0,.4); }
.mini-board .b { color: #111; }
.mini-board .cookie { font-size: clamp(.9rem, 2.4vw, 1.5rem); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat { padding: 18px 20px; }
.stat .k { color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 2rem; font-weight: 800; }
.stat .v.fire { color: var(--accent); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile {
    display: flex; flex-direction: column; gap: 6px; padding: 20px; color: var(--text);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: transform .12s ease, border-color .12s ease;
}
.tile:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--primary); }
.tile .ico { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px; font-size: 1.6rem; background: var(--surface-2); }
.tile h3 { font-size: 1.05rem; margin: 0; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.tile .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.features .card { padding: 20px; }
.features h3 { font-size: 1rem; }
.features p { color: var(--muted); font-size: .92rem; margin: 0; }

/* Trainings-Unterseite */
.module-head { display: flex; gap: 18px; align-items: center; margin: 12px 0 24px; }
.module-head .ico { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; font-size: 2.4rem; background: var(--surface-2); }

/* Fehlerseite */
.error-page { text-align: center; padding: 60px 0; }
.error-page .big { font-size: 4rem; }

/* Bot-Falle unsichtbar */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar .logo, .nav-label { display: none; }
    .nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
    .nav a { flex: 0 0 auto; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; }
    .nav .soon { display: none; }
    .topbar { justify-content: space-between; padding: 14px 16px; order: -1; }
    .topbar .logo { display: flex; padding: 0; }
    .app { display: flex; flex-direction: column; }
    .app > .main { display: contents; }
    .topbar { order: 0; } .sidebar { order: 1; } .content { order: 2; } .footer { order: 3; }
    .content { padding: 16px 16px 40px; }
    .footer { padding: 18px 16px; }
    .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 8px; }
    .mini-board { max-width: 300px; }
    .stats, .features { grid-template-columns: 1fr; }
    .hello { display: none; }
    .topbar .logo small { display: none; }
    .topbar .reg-long { display: none; }
    .topbar .reg-short { display: inline; }
    .topbar { gap: 8px; }
    .topbar nav { display: flex; gap: 6px; flex-shrink: 0; }
    .topbar .btn, .topbar button { padding: 7px 12px; font-size: .85rem; }
    .topbar .logo { font-size: .95rem; gap: 8px; min-width: 0; line-height: 1.2; }
    .topbar .logo-mark { width: 34px; height: 34px; font-size: 1.3rem; flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .mini-board { transform: none; } }
