@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit/static/Outfit-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit/static/Outfit-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit/static/Outfit-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit/static/Outfit-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face { font-family:'Bagel Fat One'; src:url('../fonts/Bagel_Fat_One/BagelFatOne-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Bangers'; src:url('../fonts/Bangers/Bangers-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Barriecito'; src:url('../fonts/Barriecito/Barriecito-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Bungee'; src:url('../fonts/Bungee/Bungee-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Ceviche One'; src:url('../fonts/Ceviche_One/CevicheOne-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Knewave'; src:url('../fonts/Knewave/Knewave-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Monoton'; src:url('../fonts/Monoton/Monoton-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Nosifer'; src:url('../fonts/Nosifer/Nosifer-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Oi'; src:url('../fonts/Oi/Oi-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Permanent Marker'; src:url('../fonts/Permanent_Marker/PermanentMarker-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Plaster'; src:url('../fonts/Plaster/Plaster-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Poetsen One'; src:url('../fonts/Poetsen_One/PoetsenOne-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Rock Salt'; src:url('../fonts/Rock_Salt/RockSalt-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Rubik Dirt'; src:url('../fonts/Rubik_Dirt/RubikDirt-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Rubik Wet Paint'; src:url('../fonts/Rubik_Wet_Paint/RubikWetPaint-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Sedgwick Ave Display'; src:url('../fonts/Sedgwick_Ave_Display/SedgwickAveDisplay-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }

:root {
  color-scheme: light;
  --header-height: 64px;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-grad: linear-gradient(135deg, #4f46e5, #2563eb, #0ea5e9);
  --accent: #f97316;
  --accent-grad: linear-gradient(135deg, #f97316, #f43f5e);
  --text: #0f172a;
  --muted: #475569;
  --muted-light: #94a3b8;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 40px 120px rgba(15, 23, 42, 0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --app-bg:
    radial-gradient(1200px 1200px at 0% 0%, rgba(79, 70, 229, 0.14), transparent 60%),
    radial-gradient(1100px 800px at 100% 0%, rgba(14, 165, 233, 0.18), transparent 55%),
    radial-gradient(900px 600px at 50% 100%, rgba(248, 250, 252, 0.9), transparent 65%),
    linear-gradient(180deg, #f8fafc, #eef2ff 45%, #fdf2f8);
}

body {
  margin: 0;
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
}

body.theme-default {
  /* nutzt die Standardvariablen aus :root */
}

body.theme-math {
  --brand: #0ea5e9;
  --brand-dark: #0369a1;
  --brand-grad: linear-gradient(135deg, #0284c7, #0ea5e9, #22d3ee);
  --surface: #f0f9ff;
  --surface-alt: #e0f2fe;
  --border: #bae6fd;
  --app-bg:
    radial-gradient(1200px 900px at 0% 0%, rgba(14, 165, 233, .18), transparent 55%),
    radial-gradient(900px 600px at 80% 0%, rgba(6, 182, 212, .14), transparent 50%),
    linear-gradient(180deg, #ecfeff, #e0f2fe 55%, #f8fafc);
}

body.theme-deutsch {
  --brand: #f97316;
  --brand-dark: #c2410c;
  --brand-grad: linear-gradient(135deg, #fb923c, #f97316, #f43f5e);
  --surface: #fff7ed;
  --surface-alt: #ffe4e6;
  --border: #fed7aa;
  --app-bg:
    radial-gradient(1200px 900px at 0% 0%, rgba(249, 115, 22, .2), transparent 55%),
    radial-gradient(900px 600px at 80% 0%, rgba(244, 63, 94, .12), transparent 50%),
    linear-gradient(180deg, #fff7ed, #ffe4e6 55%, #fff1f2);
}

body.theme-games {
  --brand: #a855f7;
  --brand-dark: #7e22ce;
  --brand-grad: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  --surface: #f5f3ff;
  --surface-alt: #fae8ff;
  --border: #ddd6fe;
  --app-bg:
    radial-gradient(1200px 900px at 0% 0%, rgba(99, 102, 241, .22), transparent 55%),
    radial-gradient(900px 600px at 80% 0%, rgba(236, 72, 153, .14), transparent 50%),
    linear-gradient(180deg, #fdf4ff, #f5f3ff 55%, #eef2ff);
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header + Sidebar */
.site-header {
  position: relative;
  width: 100%;
  z-index: 900;
  min-height: var(--header-height);
  background: linear-gradient(135deg, #eef2ff, #f5f3ff 40%, #fdf2f8);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--brand-grad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.brand-icon img{width:100%;height:100%;object-fit:cover;display:block}
.brand-icon__emoji{display:none;font-size:28px}
.brand-icon.has-emoji{
  background:transparent;
  box-shadow:none;
  padding:0;
}
.brand-icon.has-emoji img{display:none}
.brand-icon.has-emoji .brand-icon__emoji{display:block}

.emoji-preview{
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%) scale(.9);
  opacity:0;
  pointer-events:none;
  font-size:clamp(4rem,20vw,12rem);
  line-height:1;
  background:rgba(255,255,255,0.85);
  border-radius:48px;
  padding:24px 48px;
  box-shadow:0 40px 120px rgba(15,23,42,0.25);
  backdrop-filter:blur(12px);
  transition:opacity .2s ease, transform .2s ease;
  z-index:1500;
}
.emoji-preview.show{opacity:1; transform:translate(-50%,-50%) scale(1);}

.header-title {
  justify-self: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  position: relative;
}

.menu-toggle span::before {
  position: absolute;
  top: -6px;
  left: 0;
}

.menu-toggle span::after {
  position: absolute;
  bottom: -6px;
  left: 0;
}

.sb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 850;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 90vw);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(14,165,233,.35), transparent),
    radial-gradient(120% 140% at 100% 0%, rgba(236,72,153,.35), transparent),
    rgba(255,255,255,.92);
  border-left: 1px solid rgba(255,255,255,.6);
  box-shadow: -30px 0 80px rgba(15, 23, 42, 0.25);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 900;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(18px);
}

.sidebar-head {
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.sidebar-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-list {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: var(--shadow-sm);
  background:
    radial-gradient(140% 160% at 0% 0%, rgba(255,255,255,.9), rgba(255,255,255,.6)),
    rgba(255,255,255,.85);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-link:hover {
  transform: translateX(-3px);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.18);
}
.sidebar-link.is-active{
  border-color: var(--brand);
  box-shadow: 0 18px 40px rgba(37,99,235,0.25);
  transform: translateX(-3px);
}

.sidebar-link .emoji {
  font-size: 1.3rem;
}

.sidebar-link .meta {
  flex: 1;
}

.sidebar-link .meta h3 {
  margin: 0;
  font-size: 1rem;
}

.sidebar-link .meta p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar-open .sb-overlay {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-open .sidebar {
  transform: translateX(0);
}

@media (min-width: 960px) {
  .sidebar {
    width: 420px;
  }
}

/* Utilities */
.page-shell {
  min-height: calc(100vh - 56px);
  padding: clamp(18px, 4vw, 48px) clamp(16px, 4vw, 32px) 90px;
}

.page-surface {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  padding: clamp(18px, 3vw, 32px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.25);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 600;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 3vw, 28px);
}

.card h3 {
  margin: 0 0 8px;
}

.task-panel {
  padding: 0;
  overflow: hidden;
}

.task-panel-head h1 {
  margin: 4px 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
}

.legal-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
}

.legal-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px clamp(16px, 5vw, 32px);
  display: flex;
  justify-content: center;
  gap: 24px;
}

.legal-link {
  font-weight: 600;
  color: var(--brand-dark);
}

@media (max-width: 640px) {
  .site-header .header-inner {
    justify-content: flex-start;
  }
  .menu-toggle {
    right: 12px;
  }
  .legal-footer__inner {
    flex-direction: column;
    align-items: center;
  }
}
.task-panel-head {
  position: relative;
  padding: clamp(16px, 3vw, 24px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(207,227,255,.8);
}
.task-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 640px) {
  .task-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .task-title {
    width: 100%;
  }
}
