/* =========================================================================
   The German School - theme system
   Five selectable looks: kids | space | serious | funny | entertaining.
   Every theme sets the same tokens; Tailwind's `brand-*` / `accent-*`
   colours read them (see base.html), so the whole site re-skins at once.
   ========================================================================= */
:root,
[data-theme="kids"] {
  --brand-50: 245 243 255; --brand-100: 237 233 254; --brand-200: 221 214 254;
  --brand-300: 196 181 253; --brand-400: 167 139 250; --brand-500: 139 92 246;
  --brand-600: 124 58 237;  --brand-700: 109 40 217;  --brand-800: 91 33 182;
  --brand-900: 76 29 149;
  --accent-400: 251 191 36; --accent-500: 245 158 11; --accent-600: 217 119 6;
  --pop: 236 72 153;                 /* third colour for blobs / highlights */
  --bg: #fdfaff; --bg2: #fff7ed; --surface: #ffffff; --surface2: #f8f5ff;
  --text: #1e1b4b; --muted: #6b6390; --line: #ece7fb;
  --radius: 1.5rem; --radius-sm: 1rem;
  --font-display: "Fredoka", "Baloo 2", "Noto Sans Devanagari", system-ui, sans-serif;
  --font-body: "Nunito", "Noto Sans Devanagari", system-ui, sans-serif;
  --shadow: 0 6px 0 rgb(var(--brand-200)), 0 12px 30px -12px rgb(var(--brand-500) / .35);
  --hover-transform: translateY(-6px) rotate(-1deg) scale(1.02);
  --btn-shadow: 0 5px 0 rgb(var(--brand-800));
}

[data-theme="space"] {
  --brand-50: 15 23 42;   --brand-100: 23 37 84;  --brand-200: 30 58 138;
  --brand-300: 103 232 249; --brand-400: 34 211 238; --brand-500: 6 182 212;
  --brand-600: 8 145 178;  --brand-700: 103 232 249; --brand-800: 165 243 252;
  --brand-900: 207 250 254;
  --accent-400: 232 121 249; --accent-500: 217 70 239; --accent-600: 192 38 211;
  --pop: 129 140 248;
  --bg: #070b1d; --bg2: #0b1130; --surface: #111836; --surface2: #18214a;
  --text: #e6ecff; --muted: #94a3c8; --line: #263063;
  --radius: 1.1rem; --radius-sm: .8rem;
  --font-display: "Space Grotesk", "Noto Sans Devanagari", system-ui, sans-serif;
  --font-body: "Space Grotesk", "Noto Sans Devanagari", system-ui, sans-serif;
  --shadow: 0 0 0 1px #263063, 0 10px 40px -10px rgb(34 211 238 / .35);
  --hover-transform: translateY(-4px) scale(1.02);
  --btn-shadow: 0 0 22px rgb(34 211 238 / .55);
  color-scheme: dark;
}

[data-theme="serious"] {
  --brand-50: 239 246 255; --brand-100: 219 234 254; --brand-200: 191 219 254;
  --brand-300: 147 197 253; --brand-400: 96 165 250; --brand-500: 37 99 235;
  --brand-600: 29 78 216;  --brand-700: 30 64 175;  --brand-800: 30 58 138;
  --brand-900: 23 37 84;
  --accent-400: 45 212 191; --accent-500: 20 184 166; --accent-600: 13 148 136;
  --pop: 100 116 139;
  --bg: #f8fafc; --bg2: #f1f5f9; --surface: #ffffff; --surface2: #f8fafc;
  --text: #0f172a; --muted: #475569; --line: #e2e8f0;
  --radius: .6rem; --radius-sm: .45rem;
  --font-display: "Inter", "Noto Sans Devanagari", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans Devanagari", system-ui, sans-serif;
  --shadow: 0 1px 2px rgb(15 23 42 / .06), 0 1px 1px rgb(15 23 42 / .04);
  --hover-transform: translateY(-2px);
  --btn-shadow: none;
}

[data-theme="funny"] {
  --brand-50: 240 253 244; --brand-100: 220 252 231; --brand-200: 187 247 208;
  --brand-300: 134 239 172; --brand-400: 74 222 128; --brand-500: 34 197 94;
  --brand-600: 22 163 74;  --brand-700: 21 128 61;  --brand-800: 22 101 52;
  --brand-900: 20 83 45;
  --accent-400: 251 146 60; --accent-500: 249 115 22; --accent-600: 234 88 12;
  --pop: 250 204 21;
  --bg: #fffbea; --bg2: #fef3c7; --surface: #ffffff; --surface2: #fefce8;
  --text: #1c1917; --muted: #57534e; --line: #1c1917;
  --radius: 1.25rem; --radius-sm: .9rem;
  --font-display: "Baloo 2", "Fredoka", "Noto Sans Devanagari", system-ui, sans-serif;
  --font-body: "Baloo 2", "Nunito", "Noto Sans Devanagari", system-ui, sans-serif;
  --shadow: 4px 4px 0 #1c1917;
  --hover-transform: rotate(-2deg) scale(1.03);
  --btn-shadow: 3px 3px 0 #1c1917;
}

[data-theme="entertaining"] {
  --brand-50: 253 242 248; --brand-100: 252 231 243; --brand-200: 251 207 232;
  --brand-300: 249 168 212; --brand-400: 244 114 182; --brand-500: 236 72 153;
  --brand-600: 219 39 119; --brand-700: 190 24 93;  --brand-800: 157 23 77;
  --brand-900: 131 24 67;
  --accent-400: 167 139 250; --accent-500: 139 92 246; --accent-600: 124 58 237;
  --pop: 56 189 248;
  --bg: #fff5fb; --bg2: #f5f3ff; --surface: #ffffff; --surface2: #fdf4ff;
  --text: #2e1065; --muted: #6b5b8a; --line: #f5d0fe;
  --radius: 1.4rem; --radius-sm: 1rem;
  --font-display: "Poppins", "Noto Sans Devanagari", system-ui, sans-serif;
  --font-body: "Poppins", "Noto Sans Devanagari", system-ui, sans-serif;
  --shadow: 0 14px 40px -14px rgb(219 39 119 / .45);
  --hover-transform: translateY(-6px) scale(1.03);
  --btn-shadow: 0 10px 25px -8px rgb(219 39 119 / .7);
}

/* ---------- base ---------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body);
  transition: background-color .4s ease, color .4s ease;
}
h1, h2, h3, .font-display { font-family: var(--font-display); letter-spacing: -.01em; }
[x-cloak] { display: none !important; }

/* ---------- design-system components ------------------------------------- */
.card {
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, border-color .3s;
}
.card-hover:hover { transform: var(--hover-transform); border-color: rgb(var(--brand-400)); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.25rem; font-weight: 700;
  border-radius: 999px; transition: transform .2s ease, box-shadow .2s ease, background .2s;
  cursor: pointer; user-select: none; white-space: nowrap;
}
[data-theme="serious"] .btn { border-radius: var(--radius-sm); }
.btn:active { transform: translateY(3px); }
.btn-primary { background: rgb(var(--brand-600)); color: #fff; box-shadow: var(--btn-shadow); }
[data-theme="space"] .btn-primary { color: #04131c; background: rgb(var(--brand-400)); }
.btn-primary:hover { background: rgb(var(--brand-700)); transform: translateY(-2px); }
[data-theme="space"] .btn-primary:hover { background: rgb(var(--brand-300)); }
.btn-accent { background: rgb(var(--accent-400)); color: #1c1917; box-shadow: 0 5px 0 rgb(var(--accent-600)); }
.btn-accent:hover { transform: translateY(-2px); }
.btn-ghost { background: var(--surface); color: var(--text); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: rgb(var(--brand-400)); color: rgb(var(--brand-700)); }
[data-theme="funny"] .btn-ghost, [data-theme="funny"] .card { border-color: #1c1917; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .75rem;
  border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: rgb(var(--brand-100)); color: rgb(var(--brand-700));
}
[data-theme="space"] .chip { background: rgb(34 211 238 / .12); color: rgb(var(--brand-300)); }
.input, .portal input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),
.portal select, .portal textarea {
  width: 100%; background: var(--surface); color: var(--text);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: .6rem .85rem; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .portal input:focus, .portal select:focus, .portal textarea:focus {
  outline: none; border-color: rgb(var(--brand-500));
  box-shadow: 0 0 0 4px rgb(var(--brand-500) / .18);
}
.muted { color: var(--muted); }
.surface { background: var(--surface); }
.surface2 { background: var(--surface2); }
.premium-badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem;
  border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .03em;
  color: #422006; background: linear-gradient(135deg, #fde68a, #f59e0b, #fde68a);
  background-size: 200% 200%; animation: shimmer 3s ease infinite;
}
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* der / die / das colours stay fixed in every theme (never colour alone - labels too) */
.art-der { --art: 37 99 235; } .art-die { --art: 220 38 38; } .art-das { --art: 22 163 74; }

/* ---------- re-skin common Tailwind utilities for non-default themes ------- */
[data-theme] .bg-white { background-color: var(--surface); }
[data-theme] .bg-slate-50 { background-color: var(--surface2); }
[data-theme] .border-slate-100, [data-theme] .border-slate-200,
[data-theme] .border-slate-300, [data-theme] .divide-slate-100 > * + * { border-color: var(--line); }
[data-theme="space"] .text-slate-900, [data-theme="space"] .text-slate-800,
[data-theme="space"] .text-slate-700 { color: var(--text); }
[data-theme="space"] .text-slate-600, [data-theme="space"] .text-slate-500,
[data-theme="space"] .text-slate-400 { color: var(--muted); }
[data-theme="space"] .bg-slate-100 { background-color: var(--surface2); }
[data-theme="space"] .hover\:bg-slate-100:hover, [data-theme="space"] .hover\:bg-slate-50:hover { background-color: var(--surface2); }
[data-theme="space"] .bg-brand-50, [data-theme="space"] .bg-brand-100 { background-color: rgb(34 211 238 / .1); }
[data-theme="space"] .text-brand-700, [data-theme="space"] .text-brand-600 { color: rgb(var(--brand-300)); }
/* space: brand-700..900 are *light* cyan there, so solid/gradient banners with
   white text need deep stops to stay readable (white on #0e7490 ~5.4:1) */
[data-theme="space"] .bg-brand-600, [data-theme="space"] .bg-brand-500 { background-color: rgb(14 116 144); color: #fff; }
[data-theme="space"] .from-brand-400, [data-theme="space"] .from-brand-500, [data-theme="space"] .from-brand-600 {
  --tw-gradient-from: rgb(14 116 144) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(14 116 144 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
[data-theme="space"] .to-brand-700, [data-theme="space"] .to-brand-800 {
  --tw-gradient-to: rgb(49 46 129) var(--tw-gradient-to-position); }
[data-theme="space"] .bg-emerald-50, [data-theme="space"] .bg-amber-50,
[data-theme="space"] .bg-rose-50, [data-theme="space"] .bg-sky-50 { background-color: rgb(255 255 255 / .06); }

/* ---------- decorative animated backgrounds (fixed layer behind content) --- */
.theme-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.theme-bg > * { position: absolute; }
/* kids: drifting soft blobs */
[data-theme="kids"] .theme-bg { background:
  radial-gradient(circle at 10% 10%, rgb(var(--brand-200) / .55), transparent 35%),
  radial-gradient(circle at 90% 20%, rgb(var(--pop) / .18), transparent 30%),
  radial-gradient(circle at 70% 90%, rgb(var(--accent-400) / .25), transparent 35%), var(--bg); }
[data-theme="kids"] .theme-bg .blob { border-radius: 50%; filter: blur(2px); opacity: .5; animation: floaty 14s ease-in-out infinite; }
/* space: twinkling stars + shooting star */
[data-theme="space"] .theme-bg { background: radial-gradient(ellipse at top, #16205a 0%, #070b1d 60%); }
[data-theme="space"] .theme-bg .star { width: 2px; height: 2px; background: #fff; border-radius: 50%; animation: twinkle 3s ease-in-out infinite; }
[data-theme="space"] .theme-bg .shoot { width: 140px; height: 2px; top: 12%; left: -10%;
  background: linear-gradient(90deg, transparent, #67e8f9); animation: shoot 7s linear infinite; }
/* funny: dotted paper */
[data-theme="funny"] .theme-bg { background-color: var(--bg);
  background-image: radial-gradient(#1c1917 1px, transparent 1.4px); background-size: 22px 22px; opacity: 1; }
[data-theme="funny"] .theme-bg::after { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: .88; }
/* entertaining: slow animated gradient */
[data-theme="entertaining"] .theme-bg { background: linear-gradient(120deg, #fff5fb, #f5f3ff, #ecfeff, #fff1f2);
  background-size: 300% 300%; animation: gradientShift 18s ease infinite; }
[data-theme="serious"] .theme-bg { background: var(--bg); }
[data-theme]:not([data-theme="kids"]) .theme-bg .blob,
[data-theme]:not([data-theme="space"]) .theme-bg .star,
[data-theme]:not([data-theme="space"]) .theme-bg .shoot { display: none; }

@keyframes floaty { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-40px) scale(1.1); } }
@keyframes twinkle { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes shoot { 0% { transform: translate(0,0) rotate(15deg); opacity: 0; } 5% { opacity: 1; }
  20% { transform: translate(120vw, 30vh) rotate(15deg); opacity: 0; } 100% { opacity: 0; } }
@keyframes gradientShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes bounceIn { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@keyframes float-y { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.anim-float { animation: float-y 4s ease-in-out infinite; }
.anim-wiggle:hover { animation: wiggle .5s ease-in-out; }
.anim-bounce-in { animation: bounceIn .6s cubic-bezier(.34,1.56,.64,1) both; }
.anim-shake { animation: shake .45s ease; }
[data-theme="funny"] .card-hover:hover { animation: wiggle .5s ease-in-out; }
/* entertaining: light-sweep shine on hover. Painted as a background layer (not an
   overflow:hidden pseudo-element) so badges poking out of the card stay visible. */
[data-theme="entertaining"] .card-hover { position: relative;
  background-image: linear-gradient(105deg, transparent 38%, rgb(var(--brand-200) / .55) 50%, transparent 62%);
  background-size: 250% 100%; background-position: 160% 0; background-repeat: no-repeat;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, border-color .3s, background-position .8s ease; }
[data-theme="entertaining"] .card-hover:hover { background-position: -60% 0; }
[data-theme="space"] .card-hover:hover { box-shadow: 0 0 0 1px rgb(34 211 238 / .6), 0 0 40px -6px rgb(34 211 238 / .6); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* theme picker swatches */
.swatch { width: 2.25rem; height: 2.25rem; border-radius: 999px; border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--line); transition: transform .2s; }
.swatch:hover { transform: scale(1.15) rotate(-8deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
[data-theme="serious"] .anim-float { animation: none; }

/* readable status colours on the dark space theme */
[data-theme="space"] .text-emerald-700, [data-theme="space"] .text-emerald-600 { color: #6ee7b7; }
[data-theme="space"] .text-rose-700, [data-theme="space"] .text-rose-600 { color: #fda4af; }
[data-theme="space"] .text-amber-800, [data-theme="space"] .text-amber-600 { color: #fcd34d; }
[data-theme="space"] .border-emerald-200, [data-theme="space"] .border-rose-200,
[data-theme="space"] .border-amber-300 { border-color: rgb(255 255 255 / .15); }

/* ---------- interactive moving text (static/js/hovertext.js) ---------- */
.jl { display: inline-block; transition: color .3s; }
.jl:nth-child(3n+1):hover { color: rgb(var(--brand-600)); }
.jl:nth-child(3n+2):hover { color: rgb(var(--pop)); }
.jl:nth-child(3n):hover { color: rgb(var(--accent-500)); }
.jl-hit { animation: jelly .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes jelly {
  0% { transform: none; } 25% { transform: scale(1.35, .7) translateY(4px); }
  45% { transform: scale(.8, 1.3) translateY(-14px) rotate(-6deg); } 65% { transform: scale(1.12, .9) translateY(0); }
  100% { transform: none; }
}
.mg { display: inline-block; transition: transform .25s cubic-bezier(.2,.9,.3,1.3), color .25s; will-change: transform; }
[data-scramble] { font-variant-ligatures: none; white-space: nowrap; }
.scramble-pill { display: inline-flex; padding: .1em .45em; border-radius: .4em; background: rgb(var(--brand-600)); color: #fff;
  box-shadow: var(--btn-shadow); cursor: default; }
[data-tilt] { transition: transform .25s ease; transform-style: preserve-3d; }
[data-tilt]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgb(255 255 255 / .35), transparent 55%); }
[data-tilt]:hover::after { opacity: 1; }

/* marquee bands: scroll forever, pause on hover, each phrase flips DE -> EN -> HI */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 1rem; width: max-content; animation: marquee var(--mq-speed, 45s) linear infinite; }
.marquee[data-dir="right"] .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - .5rem)); } }
.mq-item { position: relative; height: 3.25rem; padding: 0 1.4rem; border-radius: 999px; overflow: hidden; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; background: var(--surface); border: 2px solid var(--line);
  box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.3,1.6,.5,1), background .3s, color .3s; cursor: pointer; }
.mq-item:hover, .mq-item:focus-visible { transform: scale(1.12) rotate(-2deg); background: rgb(var(--brand-600)); color: #fff; z-index: 2; }
.mq-stack { display: flex; flex-direction: column; transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.mq-stack > span { height: 3.25rem; line-height: 3.05rem; text-align: center; }
.mq-item:hover .mq-stack, .mq-item:focus-visible .mq-stack { animation: mq-flip 2.4s ease-in-out infinite; }
@keyframes mq-flip { 0%, 22% { transform: translateY(-3.25rem); } 33%, 55% { transform: translateY(-6.5rem); } 66%, 88% { transform: translateY(0); } 100% { transform: translateY(-3.25rem); } }
.mq-flag { font-size: .7rem; opacity: .75; margin-right: .35rem; vertical-align: middle; }

/* video cards */
.yt-card { position: relative; }
.yt-thumb { position: relative; aspect-ratio: 16/9; border-radius: calc(var(--radius) * .75); overflow: hidden; background: #000; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, opacity .3s; }
.yt-card:hover .yt-thumb img { transform: scale(1.08); opacity: .85; }
.yt-play { position: absolute; inset: 0; margin: auto; height: 4rem; width: 4rem; border-radius: 999px; background: #ff0033; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgb(0 0 0 / .35); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.yt-card:hover .yt-play { transform: scale(1.18); }
.yt-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee-track [aria-hidden="true"] { display: none; }
  .mq-item:hover .mq-stack { animation: none; transform: translateY(-3.25rem); }
}

/* ---- rich text editor ---- */
.portal textarea { resize: vertical; }
.ta-long, .portal textarea.ta-long { min-height: 12rem; resize: vertical; line-height: 1.55; }
.rt { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.rt:focus-within { border-color: rgb(var(--brand-400)); box-shadow: 0 0 0 4px rgb(var(--brand-500) / .15); }
.rt.rt-invalid { border-color: #e11d48; }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .4rem;
  border-bottom: 2px solid var(--line); background: var(--surface2); position: relative; }
.rt-btn { min-height: 34px; min-width: 34px; padding: .2rem .55rem; border-radius: .5rem; font-size: .85rem; font-weight: 700;
  color: var(--text); background: transparent; border: 1px solid transparent; cursor: pointer; line-height: 1; }
.rt-btn:hover:not(:disabled) { background: rgb(var(--brand-500) / .12); color: rgb(var(--brand-700)); }
.rt-btn[aria-pressed="true"] { background: rgb(var(--brand-500) / .18); border-color: rgb(var(--brand-400)); color: rgb(var(--brand-700)); }
[data-theme="space"] .rt-btn[aria-pressed="true"], [data-theme="space"] .rt-btn:hover:not(:disabled) { color: rgb(var(--brand-300)); }
.rt-btn:disabled, .rt-font:disabled { opacity: .4; cursor: default; }
.rt-btn:focus-visible, .rt-font:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 1px; }
.rt-sep { width: 1px; align-self: stretch; margin: .2rem .15rem; background: var(--line); }
.rt .rt-font, .portal .rt .rt-font { width: auto; min-height: 34px; padding: .15rem 1.6rem .15rem .5rem; font-size: .82rem; font-weight: 700;
  border: 1px solid var(--line); border-radius: .5rem; background-color: var(--surface); color: var(--text); }
.rt-pop { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .45rem; border-bottom: 2px solid var(--line); background: var(--surface); }
.rt-pop[hidden] { display: none; }
.rt .rt-pop input, .portal .rt .rt-pop input { flex: 1 1 12rem; width: auto; min-height: 36px; padding: .3rem .6rem; }
.rt-pop .rt-ok { background: rgb(var(--brand-600)); color: #fff; }
.rt-err { width: 100%; font-size: .75rem; color: #e11d48; font-weight: 600; }
.rt-area { min-height: 16rem; max-height: 70vh; overflow: auto; resize: vertical; padding: .85rem 1rem; outline: none;
  line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.rt-area[hidden] { display: none; }
.rt-area:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rt textarea.rt-source, .portal .rt textarea.rt-source { border: 0; border-radius: 0; min-height: 16rem; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .85rem; box-shadow: none; }
/* shared typography for editor area + rendered rich text */
.rt-area > * + *, .rich-body > * + * { margin-top: .7em; }
.rt-area h3, .rich-body h3 { font-family: var(--font-display); font-size: 1.3em; font-weight: 700; line-height: 1.25; }
.rt-area h4, .rich-body h4 { font-family: var(--font-display); font-size: 1.1em; font-weight: 700; }
.rt-area ul, .rich-body ul { list-style: disc; padding-left: 1.4em; }
.rt-area ol, .rich-body ol { list-style: decimal; padding-left: 1.6em; }
.rt-area li + li, .rich-body li + li { margin-top: .25em; }
.rt-area a, .rich-body a { color: rgb(var(--brand-600)); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
[data-theme="space"] .rt-area a, [data-theme="space"] .rich-body a { color: rgb(var(--brand-300)); }
.rt-area blockquote, .rich-body blockquote { border-left: 4px solid rgb(var(--brand-300)); padding-left: .9em; color: var(--muted); }
.rich-body { overflow-wrap: anywhere; }
/* homework status chips + German letter keys (used with the editor) */
.hw-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px;
  font-size: .74rem; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.hw-neutral { background: rgb(100 116 139 / .14); color: var(--muted); }
.hw-info { background: rgb(59 130 246 / .14); color: #2563eb; }
.hw-soon { background: rgb(245 158 11 / .16); color: #b45309; }
.hw-late { background: rgb(225 29 72 / .13); color: #e11d48; }
.hw-ok { background: rgb(16 185 129 / .15); color: #047857; }
.hw-resub { background: rgb(168 85 247 / .15); color: #7e22ce; }
[data-theme="space"] .hw-info { color: #93c5fd; } [data-theme="space"] .hw-soon { color: #fcd34d; }
[data-theme="space"] .hw-late { color: #fda4af; } [data-theme="space"] .hw-ok { color: #6ee7b7; }
[data-theme="space"] .hw-resub { color: #d8b4fe; }
.hw-key { min-width: 40px; min-height: 40px; padding: 0 .55rem; border-radius: .6rem; font-weight: 800; font-size: 1.05rem;
  background: var(--surface); color: var(--text); border: 2px solid var(--line); cursor: pointer; }
.hw-key:hover { border-color: rgb(var(--brand-400)); color: rgb(var(--brand-700)); }
.hw-key:focus-visible { outline: 2px solid rgb(var(--brand-500)); outline-offset: 1px; }
.hw-tab { padding: .5rem .9rem; border-radius: 999px; font-weight: 800; font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem;
  border: 2px solid var(--line); background: var(--surface); }
.hw-tab[aria-selected="true"] { background: rgb(var(--brand-600)); border-color: rgb(var(--brand-600)); color: #fff; }
[data-theme="space"] .hw-tab[aria-selected="true"] { color: #04131c; background: rgb(var(--brand-400)); }
.hw-count { min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; font-size: .72rem; background: rgb(0 0 0 / .08); text-align: center; }
.hw-answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.6; }

/* ---- games (v5) ---- */
/* player mode bar (games page header) */
.g-mode { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.g-mode > .min-w-0 { flex: 1 1 15rem; }
.g-mode-guest { border-style: dashed; border-color: rgb(var(--accent-500)); background: color-mix(in srgb, rgb(var(--accent-400)) 12%, var(--surface)); }
.g-avatar { width: 2.6rem; height: 2.6rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: rgb(var(--brand-600)); color: #fff; font-weight: 800; font-family: var(--font-display); font-size: 1.15rem; }
[data-theme="space"] .g-avatar { color: #04131c; background: rgb(var(--brand-400)); }
.g-avatar-guest { background: rgb(var(--accent-500)); color: #1c1917; }
.g-guest-tag { display: inline-flex; align-items: center; padding: .05rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; background: rgb(var(--accent-400) / .25); color: var(--text); border: 1px solid rgb(var(--accent-500) / .6);
  white-space: nowrap; vertical-align: middle; }
.g-login-nudge { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .8rem; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 700; border: 2px dashed rgb(var(--brand-400)); color: rgb(var(--brand-700)); }
[data-theme="space"] .g-login-nudge { color: rgb(var(--brand-300)); }
.g-login-nudge:hover { background: rgb(var(--brand-500) / .08); }
/* text never overflows cards/tiles on small screens */
.g-wrap { overflow-wrap: anywhere; hyphens: auto; }
#games-root .g-tile { overflow-wrap: anywhere; hyphens: auto; position: relative; }
#games-root .g-card { overflow: hidden; }
#games-root .g-tile:focus-visible, #games-root .g-card:focus-visible, #games-root .basket:focus-visible, #games-root .mem:focus-visible,
#games-root .balloon:focus-visible, #games-root .hole:focus-visible, #games-root .exp-btn:focus-visible, .g-tabs button:focus-visible {
  outline: 3px solid rgb(var(--brand-500)); outline-offset: 3px; }
/* number-key hints on answer tiles (only where there is a keyboard) */
.g-key { position: absolute; top: .3rem; left: .4rem; font-size: .65rem; font-weight: 800; line-height: 1; padding: .15rem .3rem;
  border-radius: .35rem; background: rgb(var(--brand-500) / .12); color: var(--muted); display: none; }
.basket .g-key { background: rgb(255 255 255 / .25); color: #fff; }
@media (hover: hover) and (pointer: fine) { .g-key { display: inline-block; } }
.basket { position: relative; }
/* stage header */
.g-stagebar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
@media (max-width: 480px) {
  .g-stagebar { grid-template-columns: auto 1fr; }
  .g-stagebar > h2 { grid-column: 1 / -1; grid-row: 2; }
  .g-stagebar #btn-back span { display: none; }
  .g-mute-sm span, #btn-pause span { display: none; }
}
.g-letter { width: clamp(2.4rem, 11vw, 3.25rem); min-width: 0; }
.g-snowtile { width: clamp(1.6rem, 6.8vw, 2.5rem); min-width: 0; min-height: 2.8rem; font-size: clamp(1.1rem, 4.5vw, 1.5rem); }
#games-root .key { min-width: 2.35rem; }
@media (max-width: 400px) { #games-root .key { min-width: 2.1rem; min-height: 2.6rem; font-size: 1rem; } }
.g-pause { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgb(2 6 23 / .45);
  border-radius: var(--radius); z-index: 6; backdrop-filter: blur(3px); }
.g-pause.hidden { display: none; }
@media (max-width: 480px) { #games-root .sky { height: 360px; } #games-root .balloon, #games-root .balloon .b-body { width: 84px; } }
.g-win { max-height: calc(100vh - 1.5rem); overflow-y: auto; }
.g-filter-label { min-width: 7.5rem; }
/* tabs (leaderboard periods etc.) */
.g-tabs { display: inline-flex; padding: .2rem; gap: .2rem; border-radius: 999px; background: var(--surface2); border: 2px solid var(--line); }
.g-tabs button { padding: .35rem .85rem; border-radius: 999px; font-weight: 800; font-size: .85rem; color: var(--muted); min-height: 36px; }
.g-tabs button.on { background: rgb(var(--brand-600)); color: #fff; }
[data-theme="space"] .g-tabs button.on { color: #04131c; background: rgb(var(--brand-400)); }
.g-board-me { outline: 2px solid rgb(var(--brand-500)); }
/* results dashboard + staff report */
.g-stat { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.g-stat .g-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.1; overflow-wrap: anywhere; }
.g-stat .g-lbl { font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.g-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.g-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800;
  padding: .5rem .6rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.g-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.g-table tr:last-child td { border-bottom: 0; }
.g-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g-acc { display: inline-flex; align-items: center; gap: .4rem; }
.g-acc-bar { display: inline-block; width: 3.5rem; height: .45rem; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.g-acc-bar > span { display: block; height: 100%; border-radius: 999px; background: rgb(var(--brand-500)); }
.g-chart { width: 100%; height: auto; display: block; }
.g-chart .gl { stroke: var(--line); stroke-width: 1; }
.g-chart .lbl { fill: var(--muted); font-size: 11px; font-weight: 700; font-family: var(--font-body); }
.g-chart .line { fill: none; stroke: rgb(var(--brand-500)); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.g-chart .area { fill: rgb(var(--brand-500) / .12); }
.g-chart .dot { fill: var(--surface); stroke: rgb(var(--brand-600)); stroke-width: 2.5; }
.g-word { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; font-weight: 700;
  background: var(--surface2); border: 2px solid var(--line); }
.g-word small { font-size: .7rem; color: var(--muted); font-weight: 800; }
/* VS / contest call-to-action on the games page */
.g-vs { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; border: 2px solid rgb(var(--brand-400));
  background: linear-gradient(120deg, rgb(var(--brand-500) / .14), rgb(var(--pop) / .12)); }
.g-vs > .min-w-0 { flex: 1 1 16rem; }
.g-vs-icon { width: 3.25rem; height: 3.25rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: rgb(var(--brand-600)); color: #fff; }
[data-theme="space"] .g-vs-icon { color: #04131c; background: rgb(var(--brand-400)); }
/* typing trainer (Tipp-Trainer) */
.tt-modes { flex-wrap: wrap; border-radius: var(--radius-sm); max-width: 100%; }
.tt-modes button { flex: 1 1 auto; }
.tt-modes button:disabled { opacity: .45; cursor: not-allowed; }
.tt-switch { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: .85rem; cursor: pointer; }
.tt-switch input { width: 1.15rem; height: 1.15rem; accent-color: rgb(var(--brand-600)); }
.tt-switch small { font-weight: 700; color: var(--muted); }
.tt-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.1rem, 4.5vw, 1.6rem); line-height: 1.15; }
.tt-lbl { font-size: .68rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tt-target { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(1.35rem, 6vw, 2.2rem); line-height: 1.5;
  text-align: center; padding: .9rem .75rem; border-radius: var(--radius-sm); background: var(--surface2); border: 2px solid var(--line);
  overflow-wrap: anywhere; min-height: 4.5rem; }
.tt-target[data-len="long"] { font-size: clamp(1.05rem, 4.2vw, 1.5rem); text-align: left; }
.tt-target span { border-radius: .2em; padding: 0 .02em; }
.tt-todo { color: var(--muted); }
.tt-ok { color: #16a34a; }
[data-theme="space"] .tt-ok { color: #4ade80; }
.tt-bad { color: #fff; background: #dc2626; }
.tt-trick { text-decoration: underline wavy rgb(var(--accent-500)); text-underline-offset: .2em; }
.tt-cur { box-shadow: inset 0 -.18em 0 rgb(var(--brand-500)); color: var(--text); }
.tt-pend { background: rgb(var(--accent-400) / .35); }
.tt-input { font-size: 1.25rem !important; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.tt-umlauts { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.tt-umlauts { flex-wrap: nowrap; }
#games-root .tt-uml { flex: 1 1 0; min-width: 0; max-width: 3.4rem; min-height: 2.9rem; padding: 0; font-size: 1.3rem; font-family: var(--font-display); }
.tt-keychip { display: inline-flex; align-items: center; gap: .2rem; margin: .1rem .2rem; font-weight: 700; }
.tt kbd, .tt-help kbd { display: inline-block; min-width: 1.4em; padding: .02em .35em; border-radius: .35em; border: 1px solid var(--line);
  border-bottom-width: 3px; background: var(--surface); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; text-align: center; }
.tt-help summary { list-style: none; }
.tt-help summary::-webkit-details-marker { display: none; }
.tt-help-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.tt-help-grid > div { padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface2); overflow-wrap: anywhere; }

/* ---- layout safety (v5) ---- */
/* Never let a decorative element make the page scroll sideways on phones.
   `clip` (not `hidden`) keeps position: sticky headers working. */
html, body { overflow-x: clip; max-width: 100%; }
/* Long German compound words and URLs must wrap inside cards instead of overflowing. */
.card, .chip, td, th, li, h1, h2, h3, h4, p { overflow-wrap: break-word; }
h1, h2, h3 { hyphens: auto; }

/* ---- contests / VS (v5) ---- */
body.ct-live #dmk-chat { display: none !important; }
.ct-wrap { overflow-x: clip; }
.ct-icon { width: 48px; height: 48px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: rgb(var(--brand-500) / .12); color: rgb(var(--brand-600)); }
[data-theme="space"] .ct-icon { color: rgb(var(--brand-300)); }
.ct-code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; font-size: 1.35rem; text-align: center; min-width: 0; }
.ct-code-input::placeholder { letter-spacing: .3em; opacity: .35; }
.ct-alert { display: flex; gap: .6rem; align-items: center; border-color: #f43f5e !important; color: #be123c; font-weight: 700; }
[data-theme="space"] .ct-alert { color: #fda4af; }
.ct-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: .35rem; }
.ct-ava-pick { font-size: 1.5rem; height: 44px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface); transition: transform .15s; }
.ct-ava-pick.is-on { border-color: rgb(var(--brand-500)); background: rgb(var(--brand-500) / .15); transform: scale(1.08); }
/* setup */
.vs-game { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .8rem .5rem; text-align: center;
  font-weight: 800; font-size: .85rem; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); transition: transform .2s, border-color .2s, background .2s; min-width: 0; }
.vs-game:hover { transform: translateY(-2px); border-color: rgb(var(--brand-400)); }
.vs-game.is-on { border-color: rgb(var(--brand-500)); background: rgb(var(--brand-500) / .12); color: rgb(var(--brand-700)); }
[data-theme="space"] .vs-game.is-on { color: rgb(var(--brand-300)); }
.vs-player-row { display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem; border: 2px solid var(--line);
  border-left-width: 6px; border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.vs-player-row .input { min-width: 0; flex: 1; }
.vs-ava { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.vs-dot { width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0; border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--line); }
.vs-key { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 .35rem; flex-shrink: 0;
  border-radius: .45rem; font-weight: 800; font-family: ui-monospace, monospace; background: var(--surface2);
  border: 2px solid var(--line); border-bottom-width: 4px; color: var(--text); }
.vs-key.big { min-width: 44px; height: 44px; font-size: 1.3rem; }
.vs-mini-board { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.ct-stage { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
/* questions + answer buttons (Kahoot-like colours, fixed so every theme reads well) */
.ct-prompt { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.15;
  margin: .4rem 0; overflow-wrap: anywhere; }
.ct-prompt-xl { font-size: clamp(2rem, 6vw, 4.2rem); }
.ct-bar { height: 12px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); overflow: hidden; }
.ct-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
  background-size: 300% 100%; transition: width .2s linear; }
.ct-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ct-opts.is-3 { grid-template-columns: repeat(3, 1fr); }
.ct-opt { display: flex; align-items: center; gap: .6rem; min-height: 76px; padding: .8rem 1rem; border-radius: var(--radius-sm);
  color: #fff; font-weight: 800; font-size: clamp(1rem, 3.5vw, 1.45rem); text-align: left; line-height: 1.2; overflow-wrap: anywhere;
  box-shadow: inset 0 -5px 0 rgb(0 0 0 / .18); transition: transform .12s, filter .15s; min-width: 0; }
button.ct-opt:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); }
button.ct-opt:active:not(:disabled) { transform: translateY(2px); }
button.ct-opt:disabled { opacity: .55; cursor: default; }
.ct-c0 { background: #e11d48; } .ct-c1 { background: #2563eb; } .ct-c2 { background: #d97706; } .ct-c3 { background: #16a34a; }
.ct-shape { width: 22px; height: 22px; flex-shrink: 0; background: rgb(255 255 255 / .9); }
.ct-c0 .ct-shape { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ct-c1 .ct-shape { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.ct-c2 .ct-shape { border-radius: 999px; }
.ct-c3 .ct-shape { border-radius: 3px; }
.ct-opts.is-3 .ct-opt { justify-content: center; text-align: center; font-size: clamp(1.2rem, 5vw, 2rem); }
.ct-result.is-right { border-color: #22c55e !important; background: rgb(34 197 94 / .12); }
.ct-result.is-wrong { border-color: #f43f5e !important; background: rgb(244 63 94 / .08); }
/* podium */
.ct-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: .6rem; max-width: 520px; margin-inline: auto; }
.ct-podium-xl { max-width: 760px; }
.ct-step { display: flex; flex-direction: column; align-items: center; gap: .2rem; min-width: 0; }
.ct-step.s1 { order: 2; } .ct-step.s2 { order: 1; } .ct-step.s3 { order: 3; }
.ct-step-block { width: 100%; display: flex; align-items: flex-start; justify-content: center; padding-top: .4rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem;
  background: rgb(var(--brand-500)); }
.ct-step.s1 .ct-step-block { height: 130px; background: linear-gradient(#fbbf24, #d97706); }
.ct-step.s2 .ct-step-block { height: 95px; background: linear-gradient(#cbd5e1, #64748b); }
.ct-step.s3 .ct-step-block { height: 70px; background: linear-gradient(#fdba74, #c2410c); }
.ct-podium-xl .ct-step.s1 .ct-step-block { height: 180px; }
.ct-podium-xl .ct-step.s2 .ct-step-block { height: 130px; }
.ct-podium-xl .ct-step.s3 .ct-step-block { height: 95px; }
.ct-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .5rem; }
.ct-table td { padding: .55rem .5rem; text-align: center; border-top: 1px solid var(--line); }
.ct-table tr.ct-me td { background: rgb(var(--brand-500) / .1); }
.ct-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
/* buzzer split screen */
.vs-buzz { position: relative; display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; min-height: 70vh; }
.vs-buzz.n3, .vs-buzz.n4 { grid-template-rows: 1fr 1fr; }
.vs-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  border-radius: var(--radius); border: 3px solid var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--surface));
  color: var(--text); touch-action: manipulation; user-select: none; min-height: 140px; min-width: 0; transition: transform .1s; }
.vs-panel:active { transform: scale(.98); }
.vs-panel.is-right { background: rgb(34 197 94 / .35); }
.vs-panel.is-wrong { background: rgb(244 63 94 / .3); animation: ct-shake .35s; }
.vs-panel-ava { font-size: 2.6rem; line-height: 1; }
.vs-panel-name { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .5rem; }
.vs-panel-score { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; }
.vs-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: min(92%, 440px);
  text-align: center; padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 3px solid var(--line);
  box-shadow: 0 20px 50px -15px rgb(0 0 0 / .35); pointer-events: none; }
.vs-card.is-right { border-color: #22c55e; } .vs-card.is-wrong { border-color: #f43f5e; }
@media (max-width: 640px) {
  .vs-buzz.n2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .vs-buzz.n2 .vs-panel.p0 { rotate: 180deg; }    /* face the player across the table */
  .vs-panel .vs-key { display: none; }
  .ct-opts.is-3 { grid-template-columns: 1fr; }
}
@keyframes ct-shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
/* live: player + host */
.ct-player { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.ct-topbar, .ct-host-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent); border-bottom: 2px solid var(--line); backdrop-filter: blur(8px); min-width: 0; }
.ct-player-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem;
  width: 100%; max-width: 640px; margin: 0 auto; }
.ct-net { margin: .5rem auto; padding: .35rem .8rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 700;
  font-size: .85rem; text-align: center; width: fit-content; }
.ct-ready { font-family: var(--font-display); font-weight: 800; font-size: 6rem; line-height: 1; color: rgb(var(--brand-600)); margin: .5rem 0; }
[data-theme="space"] .ct-ready { color: rgb(var(--brand-300)); }
.ct-host { min-height: 100vh; }
.ct-host-main { max-width: 1200px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.ct-code-chip { font-family: ui-monospace, monospace; letter-spacing: .15em; font-size: .9rem; }
.ct-join-box { text-align: center; padding: 1.5rem 1rem; }
.ct-join-url { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.2rem, 4vw, 2.4rem); overflow-wrap: anywhere; }
.ct-code { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: .18em; font-size: clamp(3rem, 14vw, 8rem); line-height: 1;
  color: rgb(var(--brand-600)); }
[data-theme="space"] .ct-code { color: rgb(var(--brand-300)); }
.ct-lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.ct-lobby-p { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 2px solid var(--line); min-width: 0; animation: ct-pop .35s cubic-bezier(.34,1.56,.64,1); }
.ct-kick { margin-left: auto; color: var(--muted); opacity: .5; flex-shrink: 0; }
.ct-kick:hover { color: #e11d48; opacity: 1; }
@keyframes ct-pop { from { transform: scale(.6); opacity: 0; } }
.ct-countdown { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 3.5rem); min-width: 2.5ch; text-align: right; }
.ct-dist { display: flex; justify-content: center; align-items: flex-end; gap: .8rem; }
.ct-dist-col { display: flex; flex-direction: column; align-items: center; gap: .3rem; width: min(22%, 140px); background: none !important; }
.ct-dist-bar { display: block; width: 100%; border-radius: .5rem .5rem 0 0; opacity: .55; }
.ct-dist-col.is-right .ct-dist-bar { opacity: 1; box-shadow: 0 0 0 3px #22c55e; }
.ct-dist-col.ct-c0 .ct-dist-bar { background: #e11d48; } .ct-dist-col.ct-c1 .ct-dist-bar { background: #2563eb; }
.ct-dist-col.ct-c2 .ct-dist-bar { background: #d97706; } .ct-dist-col.ct-c3 .ct-dist-bar { background: #16a34a; }
.ct-board { display: flex; flex-direction: column; gap: .4rem; }
.ct-board li { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 2px solid var(--line); min-width: 0; }
.ct-rank { width: 2rem; height: 2rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  font-weight: 800; background: rgb(var(--brand-500) / .15); }
.ct-rank-big { font-size: 1.8rem; min-width: 3rem; text-align: center; font-weight: 800; }
.ct-status-lobby { background: #e0f2fe; color: #075985; } .ct-status-running, .ct-status-review { background: #dcfce7; color: #166534; }
.ct-status-finished { background: var(--surface2); color: var(--muted); }

/* ---- free vs paid (v6) ---- */
.fp-locked { position: relative; }
.fp-locked > *:not(.fp-lock) { opacity: .62; filter: saturate(.55); }
.fp-locked:hover > *:not(.fp-lock), .fp-locked:focus-visible > *:not(.fp-lock) { opacity: .85; filter: none; }
.fp-lock { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; border-radius: 999px;
  font-size: .7rem; font-weight: 800; line-height: 1.4; white-space: nowrap; z-index: 2;
  background: linear-gradient(135deg, #fde68a, #f59e0b); color: #451a03; box-shadow: 0 2px 6px rgb(0 0 0 / .15); }
.fp-lock.\!static { position: static; }
.fp-lock-sm { padding: .2rem; }
.fp-free { display: inline-flex; align-items: center; padding: .1rem .5rem; border-radius: 999px; font-size: .7rem;
  font-weight: 800; line-height: 1.4; white-space: nowrap; background: rgb(16 185 129 / .16); color: #047857;
  border: 1px solid rgb(16 185 129 / .35); }
[data-theme="space"] .fp-free { color: #6ee7b7; }
.fp-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .7rem 1rem;
  border-radius: var(--radius-sm); background: var(--surface); border: 2px dashed rgb(var(--brand-400)); }
.fp-banner-icon { width: 2.25rem; height: 2.25rem; border-radius: .8rem; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; color: #fff; background: linear-gradient(135deg, rgb(var(--brand-500)), rgb(var(--pop))); }
.fp-banner-text { flex: 1 1 14rem; min-width: 0; font-size: .95rem; }
.fp-banner-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.fp-modal { position: fixed; inset: 0; z-index: 90; align-items: center; justify-content: center; padding: 1rem;
  background: rgb(0 0 0 / .5); }
.fp-modal-card, .fp-panel { position: relative; width: 100%; max-width: 30rem; padding: 1.75rem 1.25rem 1.5rem; text-align: center; }
.fp-panel { max-width: none; }
.fp-panel-icon { width: 4rem; height: 4rem; border-radius: 1.4rem; display: inline-flex; align-items: center; justify-content: center;
  color: #451a03; background: linear-gradient(135deg, #fde68a, #f59e0b); }
.fp-close { position: absolute; top: .6rem; right: .6rem; padding: .35rem; border-radius: 999px; color: var(--muted); }
.fp-close:hover { background: var(--surface2); color: var(--text); }
.fp-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.25rem; }
@media (max-width: 480px) { .fp-actions .btn { width: 100%; justify-content: center; } }

/* ---- funlearn (v6) ---- */
.fl-page { overflow-x: clip; }
.fl-scroll-x { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: .15rem 1rem; }
.fl-scroll-x::-webkit-scrollbar { display: none; }
/* hero */
.fl-hero { position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 85% 10%, rgb(var(--brand-600) / .55), transparent 60%),
              radial-gradient(90% 80% at 0% 100%, rgb(var(--pop) / .45), transparent 60%),
              linear-gradient(160deg, #140d2b, #0b0a1a 70%); }
.fl-hero-glow { position: absolute; inset: auto -10% -40% auto; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--accent-400) / .25), transparent 65%); pointer-events: none; }
.fl-hero-kicker { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 999px;
  font-weight: 800; font-size: .85rem; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .2); }
.fl-slide { display: grid; gap: 1.5rem; align-items: center; margin-top: 1rem; min-height: 16rem; }
@media (min-width: 768px) { .fl-slide { grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; min-height: 19rem; } }
.fl-slide-text { min-width: 0; }
.fl-slide-title { font-family: var(--font-display); font-weight: 800; line-height: 1.05; margin-top: .9rem;
  font-size: clamp(2rem, 5vw, 3.6rem); overflow-wrap: anywhere; text-shadow: 0 4px 30px rgb(0 0 0 / .4); }
.fl-slide-sub { color: rgb(255 255 255 / .75); font-weight: 700; margin-top: .35rem; }
.fl-slide-why { color: rgb(255 255 255 / .88); font-size: 1.1rem; margin-top: .8rem; max-width: 36rem; }
.fl-slide-art { justify-self: center; width: min(78vw, 15rem); border-radius: 1rem; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .12); transform: rotate(2deg); }
.fl-slide-art.fl-shape-wide { width: min(86vw, 26rem); }
.fl-slide-art.fl-shape-square { width: min(70vw, 16rem); }
.fl-slide-art .fl-gen-title { font-size: 1.6rem; }
.fl-slide-art .fl-gen-emoji { font-size: 4.5rem; }
.fl-slide { animation: flFade .5s ease both; }
@keyframes flFade { from { opacity: .2; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fl-pill { display: inline-flex; align-items: center; padding: .2rem .7rem; border-radius: 999px; font-size: .78rem;
  font-weight: 800; color: #fff; background: var(--c, rgb(var(--brand-600))); }
/* WCAG AA: white pill text needs a dark enough fill. Colours that are too light (amber, sky,
   YouTube red...) are capped at OKLCH lightness .55 - same hue, a shade deeper. Browsers without
   relative colours keep the plain colour from the line above. */
.fl-pill { background: oklch(from var(--c, rgb(var(--brand-600))) min(l, .52) c h); }
.fl-pill-glass { background: rgb(255 255 255 / .14); border: 1px solid rgb(255 255 255 / .25); }
.fl-pill-free { background: #10b981; color: #022c22; }
.fl-pill-paid { background: rgb(255 255 255 / .9); color: #1e1b4b; }
.fl-round { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
  border-radius: 999px; color: #fff; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .25); transition: background .2s; }
.fl-round:hover { background: rgb(255 255 255 / .25); }
.fl-round-light { width: 2.1rem; height: 2.1rem; color: var(--text); background: var(--surface); border: 2px solid var(--line); }
.fl-round-light:hover { background: var(--surface2); border-color: rgb(var(--brand-400)); }
.fl-dot { width: .6rem; height: .6rem; border-radius: 999px; background: rgb(255 255 255 / .35); transition: width .3s, background .3s; }
.fl-dot.is-on { width: 1.6rem; background: #fff; }
/* buttons */
.fl-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .85rem; border-radius: 999px;
  font-weight: 800; font-size: .8rem; line-height: 1.1; white-space: nowrap; transition: transform .15s, filter .15s; }
.fl-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.fl-btn-lg { padding: .7rem 1.25rem; font-size: 1rem; }
.fl-btn-free { background: #10b981; color: #022c22; }
.fl-btn-official, .fl-btn-about { background: #fff; color: #1e1b4b; }
.fl-btn-watch { background: rgb(255 255 255 / .16); color: #fff; border: 1px solid rgb(255 255 255 / .35); }
/* filter bar */
.fl-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.fl-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-radius: 999px; font-weight: 800;
  font-size: .9rem; white-space: nowrap; background: var(--surface); color: var(--text); border: 2px solid var(--line); }
.fl-tab:hover { border-color: rgb(var(--brand-400)); }
.fl-tab.is-on { background: rgb(var(--brand-600)); border-color: rgb(var(--brand-600)); color: #fff; }
.fl-tab-n { font-size: .72rem; opacity: .7; }
.fl-type { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px; font-weight: 700;
  font-size: .82rem; white-space: nowrap; background: var(--surface2); color: var(--text); border: 1px solid var(--line); }
.fl-type:hover { border-color: var(--c, rgb(var(--brand-400))); }
.fl-type.is-on { background: var(--c, rgb(var(--brand-600))); border-color: transparent; color: #fff; }
/* shelves */
.fl-shelf { margin-top: 2.25rem; }
.fl-shelf-title { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; min-width: 0; }
.fl-shelf-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; flex-shrink: 0;
  border-radius: .8rem; font-size: 1.1rem; background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.fl-shelf-n { font-family: var(--font-body); font-size: .8rem; font-weight: 700; color: var(--muted); }
.fl-row { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 1rem;
  margin: .6rem -1rem 0; padding: .4rem 1rem 1rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.fl-row.is-grid { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; }
.fl-card { flex: 0 0 auto; width: 9.5rem; scroll-snap-align: start; min-width: 0; }
.fl-card.fl-shape-wide { width: 16rem; }
.fl-card.fl-shape-square { width: 10.5rem; }
@media (min-width: 768px) { .fl-card { width: 11rem; } .fl-card.fl-shape-wide { width: 19rem; } .fl-card.fl-shape-square { width: 12rem; } }
.fl-cover { position: relative; display: block; overflow: hidden; border-radius: var(--radius-sm); cursor: pointer;
  aspect-ratio: 2 / 3; background: var(--surface2); box-shadow: 0 10px 24px -14px rgb(0 0 0 / .55);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s; outline-offset: 3px; }
.fl-shape-wide .fl-cover, .fl-shape-wide.fl-slide-art { aspect-ratio: 16 / 9; }
.fl-shape-square .fl-cover, .fl-shape-square.fl-slide-art { aspect-ratio: 1; }
.fl-shape-poster.fl-slide-art { aspect-ratio: 2 / 3; }
.fl-card:hover .fl-cover, .fl-card.is-open .fl-cover, .fl-cover:focus-visible { transform: translateY(-4px) scale(1.03);
  box-shadow: 0 18px 30px -14px rgb(0 0 0 / .6); }
.fl-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fl-badge { position: absolute; top: .45rem; padding: .12rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 800;
  line-height: 1.4; z-index: 2; box-shadow: 0 2px 6px rgb(0 0 0 / .25); }
.fl-badge-level { left: .45rem; background: rgb(15 10 30 / .78); color: #fff; }
.fl-badge-price { right: .45rem; }
.fl-badge-price.is-free { background: #10b981; color: #022c22; }
.fl-badge-price.is-paid { background: rgb(255 255 255 / .92); color: #1e1b4b; }
.fl-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 2.8rem; height: 2.8rem;
  border-radius: 999px; display: flex; align-items: center; justify-content: center; padding-left: .2rem;
  background: rgb(214 0 43 / .94); color: #fff; font-size: 1rem; box-shadow: 0 6px 18px rgb(0 0 0 / .35); transition: opacity .2s; }
.fl-reveal { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: flex-end; gap: .5rem;
  padding: .7rem; color: #fff; opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s;
  background: linear-gradient(to top, rgb(10 6 25 / .97) 0%, rgb(10 6 25 / .88) 55%, rgb(10 6 25 / .35)); }
.fl-card:hover .fl-reveal, .fl-card.is-open .fl-reveal, .fl-cover:focus-within .fl-reveal { opacity: 1; transform: none; }
@media (hover: none) { .fl-card:hover .fl-reveal { opacity: 0; transform: translateY(12px); } .fl-card.is-open .fl-reveal { opacity: 1; transform: none; } }
.fl-card:hover .fl-play, .fl-card.is-open .fl-play { opacity: 0; }
.fl-why { font-size: .78rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.fl-shape-wide .fl-why { -webkit-line-clamp: 3; }
.fl-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.fl-actions .fl-btn { padding: .38rem .65rem; font-size: .74rem; }
.fl-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .55rem;
  font-weight: 800; font-size: .9rem; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.fl-title:hover { color: rgb(var(--brand-600)); }
.fl-meta { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* generated covers (for anything under copyright - no publisher art) */
.fl-gen { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: .85rem .8rem .8rem 1.05rem;
  color: #fff; overflow: hidden; container-type: inline-size;
  background: radial-gradient(circle at 80% 18%, rgb(255 255 255 / .28), transparent 38%),
              radial-gradient(rgb(255 255 255 / .12) 1.2px, transparent 1.4px) 0 0 / 14px 14px,
              linear-gradient(155deg, var(--c1), var(--c2)); }
.fl-gen::after { content: ""; position: absolute; inset: auto -30% -35% auto; width: 90%; aspect-ratio: 1; border-radius: 40%;
  background: rgb(255 255 255 / .08); transform: rotate(var(--tilt, 12deg)); }
.fl-flag { position: absolute; left: 0; top: 0; bottom: 0; width: .32rem;
  background: linear-gradient(#111 0 33.3%, #dd0000 33.3% 66.6%, #ffce00 66.6%); }
.fl-gen-emoji { position: absolute; top: 18%; left: 50%; transform: translateX(-50%) rotate(var(--tilt, 0deg)); font-size: 3.2rem;
  line-height: 1; filter: drop-shadow(0 8px 14px rgb(0 0 0 / .35)); }
.fl-shape-wide .fl-gen-emoji { top: 12%; left: auto; right: 10%; transform: rotate(var(--tilt, 0deg)); }
.fl-gen-title { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1.08;
  overflow-wrap: anywhere; text-shadow: 0 2px 10px rgb(0 0 0 / .35); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.fl-gen-sub { position: relative; z-index: 1; margin-top: .3rem; font-size: .68rem; font-weight: 700; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* tips */
.fl-tips { display: grid; gap: 1.5rem; align-items: center; padding: 1.5rem; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); }
@media (min-width: 768px) { .fl-tips { grid-template-columns: 1fr auto; padding: 2rem; } }
.fl-tip { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface2); }
.fl-tip > span { font-size: 1.2rem; line-height: 1; }
[data-theme="space"] .fl-btn-official, [data-theme="space"] .fl-btn-about { background: #e6ecff; }
[data-theme="funny"] .fl-cover { border: 2px solid #1c1917; box-shadow: 4px 4px 0 #1c1917; }
@media (prefers-reduced-motion: reduce) {
  .fl-cover, .fl-reveal, .fl-btn, .fl-dot, .fl-play { transition: none !important; }
  .fl-slide { animation: none; }
  .fl-card:hover .fl-cover, .fl-card.is-open .fl-cover, .fl-cover:focus-visible { transform: none; }
}

/* ---- theme personalities (v7) ---- */
/* Each of serious / funny / entertaining gets its own backdrop and its own
   way of reacting to hover, click and scroll. Colours, content and layout
   are untouched; everything is scoped to its [data-theme]. */

/* split-letter headings (hovertext.js): break only between words */
.split-word { display: inline-block; white-space: nowrap; }
@media (min-width: 768px) {
  /* "Arbeiten · Studieren · Ausbildung" stays on one line on desktop */
  [data-magnet] { white-space: nowrap; font-size: min(1em, 3.3vw); }
}

/* ===== serious: calm, professional, precise ===== */
[data-theme="serious"] .theme-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgb(var(--brand-100) / .9), transparent 70%),
    linear-gradient(rgb(15 23 42 / .045) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgb(15 23 42 / .045) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, #f8fafc, #f1f5f9);
}
/* fade the graph paper towards the bottom so long pages stay quiet */
[data-theme="serious"] .theme-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgb(248 250 252 / .85)); }
[data-theme="serious"] .card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
[data-theme="serious"] .card-hover:hover { transform: translateY(-3px); border-color: rgb(var(--brand-300));
  box-shadow: 0 1px 2px rgb(15 23 42 / .06), 0 12px 24px -12px rgb(15 23 42 / .22); }
[data-theme="serious"] .btn { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease; }
[data-theme="serious"] .btn-primary:hover, [data-theme="serious"] .btn-accent:hover { transform: translateY(-1px);
  box-shadow: 0 6px 14px -6px rgb(var(--brand-700) / .55); }
[data-theme="serious"] .btn-ghost:hover { transform: translateY(-1px); background: var(--surface2); }
[data-theme="serious"] .btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
[data-theme="serious"] .btn-accent { box-shadow: 0 2px 0 rgb(var(--accent-600)); }
[data-theme="serious"] .chip { border-radius: .4rem; box-shadow: inset 0 0 0 1px rgb(var(--brand-200)); }
/* underline slides in under nav + inline links */
[data-theme="serious"] header nav > a > span,
[data-theme="serious"] main a.font-bold:not(.btn):not(.chip) {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .25s ease, color .2s; }
[data-theme="serious"] header nav > a:hover > span,
[data-theme="serious"] main a.font-bold:not(.btn):not(.chip):hover { background-size: 100% 2px; }
[data-theme="serious"] header nav > a:hover { background: transparent; }
/* crisp, always-visible focus rings */
[data-theme="serious"] :is(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; border-radius: var(--radius-sm); }
[data-theme="serious"] .input:focus { box-shadow: 0 0 0 3px rgb(var(--brand-500) / .22); }
/* minimal motion: short fade-up, no wobble or tilt */
[data-theme="serious"] .reveal { transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
[data-theme="serious"] .anim-wiggle:hover, [data-theme="serious"] .anim-bounce-in { animation: none; }
[data-theme="serious"] [data-tilt] { transform: none !important; }
[data-theme="serious"] [data-tilt]::after { display: none; }
[data-theme="serious"] .mq-item:hover, [data-theme="serious"] .mq-item:focus-visible { transform: translateY(-2px); }

/* ===== funny: playful confetti + jelly ===== */
[data-theme="funny"] .theme-bg {
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill-opacity='.38'%3E%3Ccircle cx='24' cy='30' r='6' fill='%2322c55e'/%3E%3Ccircle cx='160' cy='22' r='4' fill='%23f97316'/%3E%3Ccircle cx='118' cy='120' r='7' fill='%23facc15'/%3E%3Ccircle cx='40' cy='170' r='4.5' fill='%23ec4899'/%3E%3Ccircle cx='196' cy='150' r='5' fill='%233b82f6'/%3E%3Crect x='80' y='40' width='12' height='5' rx='2.5' fill='%23ec4899' transform='rotate(35 86 42)'/%3E%3Crect x='176' y='86' width='12' height='5' rx='2.5' fill='%2322c55e' transform='rotate(-30 182 88)'/%3E%3Crect x='96' y='190' width='12' height='5' rx='2.5' fill='%23f97316' transform='rotate(60 102 192)'/%3E%3Cpath d='M20 100 l6-10 6 10z' fill='%233b82f6'/%3E%3Cpath d='M150 196 l6-10 6 10z' fill='%23facc15'/%3E%3C/g%3E%3Cg fill='none' stroke-width='2.5' stroke-linecap='round' stroke-opacity='.3'%3E%3Cpath d='M56 80 q8-10 16 0 t16 0' stroke='%23f97316'/%3E%3Cpath d='M140 60 q6 8 0 16 t0 16' stroke='%2322c55e'/%3E%3Cpath d='M60 128 l4 9 9 1-7 6 2 9-8-5-8 5 2-9-7-6 9-1z' stroke='%23ec4899' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(rgb(28 25 23 / .12) 1px, transparent 1.4px);
  background-size: 220px 220px, 22px 22px;
  animation: fn-drift 90s linear infinite;
}
[data-theme="funny"] .theme-bg::after { display: none; }
@keyframes fn-drift { to { background-position: 220px 440px, 0 0; } }
@keyframes fn-jelly {
  0% { transform: none; } 30% { transform: scale(1.04, .95) rotate(-1deg); } 50% { transform: scale(.97, 1.04) rotate(1.2deg); }
  70% { transform: scale(1.02, .98) rotate(-.6deg); } 100% { transform: var(--hover-transform); }
}
@keyframes fn-boing { 0% { transform: scale(1); } 35% { transform: scale(1.12, .88); } 60% { transform: scale(.94, 1.08); } 100% { transform: rotate(-2deg) scale(1.05); } }
[data-theme="funny"] .card-hover:hover { animation: fn-jelly .6s cubic-bezier(.3,1.5,.5,1); box-shadow: 7px 7px 0 #1c1917; }
[data-theme="funny"] .btn { transition: transform .25s cubic-bezier(.3,1.8,.5,1), box-shadow .15s ease, background .2s; }
[data-theme="funny"] .btn-primary:hover, [data-theme="funny"] .btn-accent:hover, [data-theme="funny"] .btn-ghost:hover {
  animation: fn-boing .45s cubic-bezier(.3,1.6,.5,1) both; box-shadow: 5px 5px 0 #1c1917; }
[data-theme="funny"] .btn-accent { box-shadow: 3px 3px 0 #1c1917; border: 2px solid #1c1917; }
/* AA: green-600 + white is only ~3.3:1, so solid green fills and green text use green-700 (~5:1) */
[data-theme="funny"] .btn-primary, [data-theme="funny"] .bg-brand-600 { background-color: rgb(var(--brand-700)); }
[data-theme="funny"] .btn-primary:hover { background-color: rgb(var(--brand-800)); }
[data-theme="funny"] .text-brand-600 { color: rgb(var(--brand-700)); }
[data-theme="funny"] .btn-primary { border: 2px solid #1c1917; }
/* squishy click: squash down, spring back on release */
[data-theme="funny"] .btn:active, [data-theme="funny"] .chip:active, [data-theme="funny"] .card-hover:active {
  animation: none; transform: scale(.92, .86) translateY(2px); box-shadow: 0 0 0 #1c1917; transition-duration: .08s; }
[data-theme="funny"] .chip { border: 1.5px solid #1c1917; transition: transform .25s cubic-bezier(.3,1.8,.5,1); }
[data-theme="funny"] a.chip:hover, [data-theme="funny"] button.chip:hover, [data-theme="funny"] .card-hover:hover .chip { transform: rotate(-4deg) scale(1.08); }
[data-theme="funny"] .card-hover:hover .chip:nth-child(even) { transform: rotate(4deg) scale(1.08); }
[data-theme="funny"] header nav > a:hover { animation: wiggle .4s ease-in-out; }
[data-theme="funny"] .input { border-color: #1c1917; }
[data-theme="funny"] .input:focus { border-color: #1c1917; box-shadow: 4px 4px 0 rgb(var(--brand-600)); }
[data-theme="funny"] :is(a, button, summary):focus-visible { outline: 3px dashed #1c1917; outline-offset: 3px; }
/* pop in with a little tilt */
[data-theme="funny"] .reveal { transform: translateY(26px) rotate(-2deg) scale(.95);
  transition: opacity .5s ease, transform .7s cubic-bezier(.3,1.7,.5,1); }
[data-theme="funny"] .reveal.in { transform: none; }

/* ===== entertaining: stage lights, glow, shine ===== */
[data-theme="entertaining"] .theme-bg {
  background:
    radial-gradient(40% 35% at 15% 20%, rgb(244 114 182 / .22), transparent 70%),
    radial-gradient(35% 40% at 85% 15%, rgb(167 139 250 / .24), transparent 70%),
    radial-gradient(45% 40% at 70% 85%, rgb(56 189 248 / .18), transparent 70%),
    radial-gradient(35% 35% at 20% 90%, rgb(251 191 36 / .14), transparent 70%),
    linear-gradient(120deg, #fff5fb, #f5f3ff, #ecfeff, #fff1f2);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 300% 300%;
  animation: en-mesh 22s ease-in-out infinite alternate;
}
@keyframes en-mesh {
  0%   { background-position: 0 0, 0 0, 0 0, 0 0, 0% 50%; }
  50%  { background-position: 6vw 4vh, -5vw 6vh, -4vw -5vh, 5vw -3vh, 100% 50%; }
  100% { background-position: -4vw 6vh, 4vw -4vh, 6vw 3vh, -3vw 4vh, 50% 0%; }
}
/* two sweeping stage spotlights */
[data-theme="entertaining"] .theme-bg::before, [data-theme="entertaining"] .theme-bg::after {
  content: ""; position: absolute; top: -20vh; width: 70vmax; height: 140vh; transform-origin: 50% 0;
  background: linear-gradient(180deg, rgb(255 255 255 / .75), rgb(255 255 255 / 0) 75%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); opacity: .55; filter: blur(6px); }
[data-theme="entertaining"] .theme-bg::before { left: -20vmax; animation: en-spot 14s ease-in-out infinite alternate; }
[data-theme="entertaining"] .theme-bg::after { right: -20vmax; animation: en-spot 17s ease-in-out infinite alternate-reverse;
  background: linear-gradient(180deg, rgb(251 207 232 / .8), rgb(251 207 232 / 0) 75%); }
@keyframes en-spot { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
/* neon card hover */
[data-theme="entertaining"] .card-hover:hover { transform: translateY(-7px) scale(1.025); border-color: rgb(var(--brand-400));
  box-shadow: 0 0 0 2px rgb(var(--brand-300) / .6), 0 0 28px -2px rgb(var(--brand-500) / .45), 0 18px 50px -12px rgb(var(--accent-500) / .55); }
/* buttons: gradient + glow + shine sweep (background layers, no clipping) */
[data-theme="entertaining"] .btn-primary {
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .35) 50%, transparent 65%) 160% 0 / 250% 100% no-repeat,
              linear-gradient(135deg, rgb(var(--brand-600)), rgb(var(--brand-700)) 55%, rgb(var(--accent-600)));
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, background-position .7s ease; }
[data-theme="entertaining"] .btn-primary:hover {
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .35) 50%, transparent 65%) -60% 0 / 250% 100% no-repeat,
              linear-gradient(135deg, rgb(var(--brand-600)), rgb(var(--brand-700)) 55%, rgb(var(--accent-600)));
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 0 0 3px rgb(var(--brand-300) / .55), 0 0 26px rgb(var(--brand-500) / .65), 0 12px 28px -10px rgb(var(--accent-600) / .8); }
[data-theme="entertaining"] .btn-accent:hover, [data-theme="entertaining"] .btn-ghost:hover {
  transform: translateY(-3px) scale(1.04); box-shadow: 0 0 0 3px rgb(var(--accent-400) / .45), 0 0 24px rgb(var(--accent-500) / .45); }
[data-theme="entertaining"] .btn:active { transform: scale(.95); transition-duration: .1s; }
[data-theme="entertaining"] .chip { transition: box-shadow .25s, transform .25s cubic-bezier(.34,1.56,.64,1); }
[data-theme="entertaining"] a.chip:hover, [data-theme="entertaining"] button.chip:hover { transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgb(var(--brand-300)), 0 0 16px rgb(var(--brand-400) / .6); }
[data-theme="entertaining"] header nav > a:hover { box-shadow: 0 0 14px rgb(var(--brand-400) / .45); }
[data-theme="entertaining"] .input:focus { box-shadow: 0 0 0 3px rgb(var(--brand-400) / .35), 0 0 18px rgb(var(--accent-500) / .3); }
[data-theme="entertaining"] :is(a, button, summary):focus-visible { outline: 3px solid rgb(var(--accent-600)); outline-offset: 3px; }
/* bouncy entrance */
[data-theme="entertaining"] .reveal { transform: translateY(34px) scale(.92);
  transition: opacity .5s ease, transform .75s cubic-bezier(.34,1.7,.5,1); }
[data-theme="entertaining"] .reveal.in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="funny"] .theme-bg, [data-theme="entertaining"] .theme-bg,
  [data-theme="entertaining"] .theme-bg::before, [data-theme="entertaining"] .theme-bg::after { animation: none !important; }
  [data-theme] .reveal { transform: none; }
  [data-theme="funny"] .card-hover:hover, [data-theme="funny"] .btn:hover, [data-theme="funny"] header nav > a:hover { animation: none !important; }
}

/* ---- language switch (app/static/i18n.js) ---- */
html.i18n-pending [data-i18n], html.i18n-pending [data-i18n-html] { visibility: hidden; }
/* Hindi: Devanagari needs taller lines (matras above/below) - "Noto Sans Devanagari" is in every
   theme's font stack and only downloaded when the page is in Hindi. */
html[lang="hi"] body { line-height: 1.65; }
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3 { line-height: 1.35 !important; letter-spacing: 0; }
html[lang="hi"] .btn, html[lang="hi"] .chip { line-height: 1.4; }
html[lang="de"] h1, html[lang="de"] h2, html[lang="de"] h3 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.lang-menu { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60; min-width: 15rem; padding: .4rem; }
.lang-menu button, .lang-menu a { display: flex; width: 100%; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: .75rem;
  font-weight: 700; font-size: .9rem; text-align: left; }
.lang-menu button:hover { background: rgb(var(--brand-500) / .1); }
.lang-menu button[aria-pressed="true"] { background: rgb(var(--brand-600)); color: #fff; }
.lang-menu .lm-note { font-size: .7rem; font-weight: 600; color: var(--muted); padding: .1rem .7rem .4rem; line-height: 1.35; }
.dmk-gt { position: fixed; left: 1rem; bottom: 1rem; z-index: 65; max-width: min(22rem, calc(100vw - 7rem)); padding: .75rem .9rem; font-size: .8rem; }
.dmk-gt-note { font-weight: 700; line-height: 1.35; }
.dmk-gt #dmk-gt-el { margin-top: .5rem; min-height: 1.5rem; }
.dmk-gt-row { display: flex; justify-content: space-between; gap: .5rem; margin-top: .5rem; }

/* ---- life in germany (v8) ---- */
.lg { --de-black: #111; --de-red: #dd0000; --de-gold: #ffce00; overflow-x: clip; }
.lg-dark { position: relative; isolation: isolate; color: #eef2ff; background: #070a18;
  --lg-glass: rgb(255 255 255 / .07); --lg-glass-line: rgb(255 255 255 / .14); --lg-sub: #b6bfdc; }
.lg-dark .muted, .lg-dark .lg-sub { color: var(--lg-sub); }
.lg-band { position: relative; }
.lg-band-2 { background: radial-gradient(1200px 500px at 85% -10%, rgb(var(--brand-600) / .35), transparent 60%),
  radial-gradient(900px 500px at 0% 110%, rgb(221 0 0 / .18), transparent 60%), #070a18; }
/* hero */
.lg-hero { overflow: hidden; background: #05070f; }
.lg-aurora { position: absolute; inset: -20%; z-index: -1; filter: blur(70px) saturate(140%); opacity: .85; pointer-events: none; }
.lg-aurora span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; mix-blend-mode: screen;
  animation: lg-drift 22s ease-in-out infinite alternate; }
.lg-aurora span:nth-child(1) { background: rgb(var(--brand-500)); left: -8%; top: -10%; }
.lg-aurora span:nth-child(2) { background: #dd0000; right: -12%; top: 5%; animation-delay: -6s; opacity: .55; }
.lg-aurora span:nth-child(3) { background: #ffce00; left: 30%; bottom: -25%; animation-delay: -11s; opacity: .45; }
.lg-aurora span:nth-child(4) { background: rgb(var(--pop)); right: 20%; bottom: -10%; animation-delay: -16s; opacity: .5; }
@keyframes lg-drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8%, 6%) scale(1.15); } 100% { transform: translate(-6%, 10%) scale(.9); } }
.lg-grid-bg { position: absolute; inset: 0; z-index: -1; opacity: .22; pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / .12) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .12) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%); }
.lg-flagbar { position: absolute; left: 0; right: 0; top: 0; height: 6px; display: flex; z-index: 2; }
.lg-flagbar i { flex: 1; } .lg-flagbar i:nth-child(1) { background: #000; } .lg-flagbar i:nth-child(2) { background: var(--de-red); } .lg-flagbar i:nth-child(3) { background: var(--de-gold); }
.lg-live-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border-radius: 999px; font-weight: 800; font-size: .78rem;
  letter-spacing: .12em; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .18); backdrop-filter: blur(8px); }
.lg-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 0 0 rgb(255 59 59 / .7); animation: lg-ping 1.6s infinite; display: inline-block; flex: none; }
@keyframes lg-ping { 70% { box-shadow: 0 0 0 .6rem rgb(255 59 59 / 0); } 100% { box-shadow: 0 0 0 0 rgb(255 59 59 / 0); } }
.lg-h1 { font-size: clamp(3.6rem, 13vw, 9.5rem); line-height: .86; font-weight: 800; letter-spacing: -.04em; margin-top: 1rem; }
.lg-h1-grad, .lg-grad-text { background: linear-gradient(90deg, #fff 0%, #ffce00 30%, #ff4d4d 60%, rgb(var(--brand-400)) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lg-shine 8s linear infinite; }
.lg-band:not(.lg-dark) .lg-grad-text { background-image: linear-gradient(90deg, rgb(var(--brand-600)), #dd0000 50%, #d4a000, rgb(var(--brand-600))); }
@keyframes lg-shine { to { background-position: -200% 0; } }
.lg-lead { margin-top: 1.25rem; font-size: clamp(1rem, 1.8vw, 1.25rem); max-width: 40rem; color: #cfd6ee; }
.lg-btn-glass { background: rgb(255 255 255 / .1); color: #fff; border: 1px solid rgb(255 255 255 / .25); backdrop-filter: blur(10px); box-shadow: none; }
.lg-btn-glass:hover { background: rgb(255 255 255 / .18); }
.lg-jump { display: flex; flex-wrap: wrap; gap: .4rem; }
.lg-jump a { font-size: .8rem; font-weight: 700; padding: .35rem .7rem; border-radius: 999px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); color: #dfe5fb; }
.lg-jump a:hover { background: rgb(255 255 255 / .16); }
.lg-glass { background: var(--lg-glass, color-mix(in srgb, var(--surface) 70%, transparent)); border: 1px solid var(--lg-glass-line, var(--line));
  border-radius: calc(var(--radius) + .25rem); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 20px 60px -25px rgb(0 0 0 / .6), inset 0 1px 0 rgb(255 255 255 / .08); }
.lg-clock { padding: 1.5rem; position: relative; overflow: hidden; }
.lg-clock::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #000 33%, var(--de-red) 33% 66%, var(--de-gold) 66%); }
.lg-label { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lg-sub); }
.lg-time { font-size: clamp(3rem, 8vw, 4.6rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.lg-time small { font-size: .45em; opacity: .6; margin-left: .1em; }
.lg-time-sm { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lg-diff { font-weight: 800; font-size: 1.05rem; color: var(--de-gold); }
.lg-clock-row { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed rgb(255 255 255 / .18); }
.lg-clock-weather { display: flex; align-items: center; gap: .9rem; margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: rgb(255 255 255 / .06); }
.lg-clock-weather[hidden] { display: none; }
.lg-wx-emoji { font-size: 2.6rem; line-height: 1; } .lg-wx-emoji-sm { font-size: 1.6rem; line-height: 1; }
.lg-daynight { display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: .7rem; text-align: center; }
.lg-sun { width: 3rem; height: 3rem; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #ffce00 45%, #ff8a00);
  box-shadow: 0 0 30px 6px rgb(255 206 0 / .55); transition: all .6s ease; }
.lg-daynight.is-night .lg-sun { background: radial-gradient(circle at 65% 35%, transparent 38%, #e8ecff 40%); box-shadow: 0 0 24px 2px rgb(200 210 255 / .35); transform: rotate(-20deg); }
.lg-aqi-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800;
  background: color-mix(in srgb, var(--c, #50ccaa) 85%, transparent); color: #06201c; white-space: nowrap; }
.lg-aqi-pill.is-dark { color: #fff; }
.lg-aqi-pill[hidden] { display: none; }
/* ticker */
.lg-ticker { position: relative; overflow: hidden; border-top: 1px solid rgb(255 255 255 / .12); background: rgb(0 0 0 / .45); backdrop-filter: blur(6px);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.lg-ticker-track { display: flex; width: max-content; gap: 0; animation: lg-marquee 60s linear infinite; padding: .8rem 0; }
.lg-ticker:hover .lg-ticker-track { animation-play-state: paused; }
.lg-tick { white-space: nowrap; font-size: .9rem; color: #d6dcf3; padding: 0 1.6rem; position: relative; display: inline-flex; align-items: center; gap: .5rem; }
.lg-tick::after { content: "✦"; position: absolute; right: -.35rem; color: var(--de-gold); opacity: .7; }
.lg-tick b { color: #fff; }
.lg-tick-live { color: #fff; font-weight: 800; }
@keyframes lg-marquee { to { transform: translateX(-50%); } }
/* edit button */
.lg-edit { position: absolute; right: 1rem; top: 1rem; z-index: 5; }
.lg-edit-menu { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 16rem; padding: .5rem; color: var(--text); }
.lg-edit-menu a { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border-radius: .6rem; font-weight: 700; font-size: .9rem; }
.lg-edit-menu a:hover { background: rgb(var(--brand-500) / .12); }
/* section heads */
.lg-head { max-width: 46rem; }
.lg-kicker { font-weight: 800; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--brand-600)); }
.lg-dark .lg-kicker { color: var(--de-gold); }
.lg-h2 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; margin: .5rem 0 .75rem; }
/* map + city cards */
.lg-map-card { padding: 1rem; display: flex; flex-direction: column; align-items: center; }
.lg-map { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.lg-map-land { fill: url(#lgFlag); opacity: .22; }
.lg-map-edge { fill: none; stroke: rgb(255 255 255 / .55); stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 6 5; }
.lg-pin { cursor: pointer; outline: none; }
.lg-pin-dot { fill: #ffce00; stroke: #111; stroke-width: 3; transition: r .2s; }
.lg-pin-pulse { fill: rgb(255 206 0 / .25); transform-origin: center; transform-box: fill-box; animation: lg-pulse 2.4s ease-out infinite; }
.lg-pin:nth-of-type(2n) .lg-pin-pulse { animation-delay: -1.2s; }
@keyframes lg-pulse { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.lg-pin-label { fill: #fff; font: 800 24px var(--font-display); text-anchor: middle; paint-order: stroke; stroke: #070a18; stroke-width: 6px; }
.lg-pin-temp { fill: #ffce00; font: 800 22px var(--font-body); text-anchor: middle; paint-order: stroke; stroke: #070a18; stroke-width: 6px; }
.lg-pin.is-on .lg-pin-dot, .lg-pin:focus-visible .lg-pin-dot { fill: #ff4d4d; }
.lg-credit { font-size: .7rem; color: var(--lg-sub, var(--muted)); opacity: .85; }
.lg-credit a { text-decoration: underline; }
.lg-city { padding: 1rem; position: relative; overflow: hidden; transition: transform .25s, border-color .25s; --heat: .5; }
.lg-city::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, #38bdf8, #ffce00, #ff4d4d); clip-path: inset(0 calc((1 - var(--heat)) * 100%) 0 0); }
.lg-city:hover, .lg-city.is-hot { transform: translateY(-3px); border-color: #ffce00; }
.lg-city-temp { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 800; line-height: 1; margin-top: .4rem; font-variant-numeric: tabular-nums; }
.lg-city-temp small { font-size: .45em; opacity: .7; }
.lg-city-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .6rem; font-size: .75rem; }
[data-live][hidden] { display: none !important; }
/* AQI compare */
.lg-aqi-bars { display: grid; gap: .7rem; }
.lg-aqi-row { display: grid; grid-template-columns: minmax(6.5rem, 9rem) 1fr; gap: .3rem .8rem; align-items: center; }
.lg-aqi-name { font-weight: 800; font-size: .9rem; }
.lg-aqi-track { height: .9rem; border-radius: 999px; background: rgb(255 255 255 / .08); overflow: hidden; }
.lg-aqi-fill { display: block; height: 100%; border-radius: 999px; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.lg-aqi-val { grid-column: 2; font-size: .75rem; color: var(--lg-sub); font-variant-numeric: tabular-nums; }
.lg-aqi-scale { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .65rem; font-weight: 700; }
.lg-aqi-scale span { display: inline-flex; align-items: center; gap: .3rem; }
.lg-aqi-scale span::before { content: ""; width: .7rem; height: .7rem; border-radius: 3px; background: var(--c); }
/* money */
.lg-rate { font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 800; line-height: 1.05; margin-top: .3rem; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #fff, #ffce00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: end; }
.lg-conv-field { display: grid; gap: .25rem; font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--lg-sub); min-width: 0; }
.lg-conv-field input { width: 100%; min-width: 0; background: rgb(255 255 255 / .08) !important; color: #fff !important; border: 1px solid rgb(255 255 255 / .2) !important;
  border-radius: var(--radius-sm); padding: .65rem .8rem; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lg-conv-eq { font-size: 1.4rem; padding-bottom: .55rem; color: var(--de-gold); }
.lg-fx-chip { font-size: .72rem; font-weight: 700; padding: .35rem .65rem; border-radius: 999px; background: rgb(255 206 0 / .12); color: #ffe27a; border: 1px solid rgb(255 206 0 / .3); text-align: left; }
.lg-fx-chip:hover { background: rgb(255 206 0 / .25); }
/* facts */
.lg-fact { padding: 1.4rem; position: relative; overflow: hidden; }
.lg-fact::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: linear-gradient(#111 33%, #dd0000 33% 66%, #ffce00 66%); }
.lg-fact-num { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .1rem; font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; line-height: 1; color: rgb(var(--brand-600)); font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lg-fact-num small { font-size: .4em; color: var(--muted); letter-spacing: 0; white-space: nowrap; margin-left: .2rem; }
.lg-src { display: inline-block; margin-top: .6rem; font-size: .75rem; font-weight: 800; color: rgb(var(--brand-600)); text-decoration: underline; text-underline-offset: 3px; }
/* videos */
.lg-cinema { background: radial-gradient(1000px 420px at 50% 0%, rgb(var(--brand-600) / .35), transparent 70%), #05060d; }
.lg-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }
.lg-tabs a { white-space: nowrap; padding: .5rem 1rem; border-radius: 999px; font-weight: 800; font-size: .85rem; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .15); }
.lg-tabs a:hover { background: #ffce00; color: #111; }
.lg-vsec { scroll-margin-top: 80px; }
.lg-vsec + .lg-vsec { border-top: 1px solid rgb(255 255 255 / .07); }
.lg-stage { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: calc(var(--radius) + .25rem); overflow: hidden; background: #000;
  box-shadow: 0 40px 90px -30px rgb(var(--brand-500) / .55), 0 0 0 1px rgb(255 255 255 / .1); }
.lg-stage iframe, .lg-stage-btn { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.lg-stage-btn img, .lg-stage-btn .lg-noimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.lg-stage-btn:hover img { transform: scale(1.04); }
.lg-stage-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .85), transparent 55%); }
.lg-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform .2s; filter: drop-shadow(0 8px 20px rgb(0 0 0 / .5)); }
.lg-stage-btn:hover .lg-play { transform: translate(-50%, -50%) scale(1.12); }
.lg-stage-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem 1.25rem; text-align: left; display: grid; gap: .2rem; color: #fff; }
.lg-stage-cap b { font-family: var(--font-display); font-size: clamp(1rem, 2.4vw, 1.6rem); line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lg-stage-cap small { color: #cfd6ee; font-size: .8rem; }
.lg-noimg { background: linear-gradient(135deg, rgb(var(--brand-700)), #dd0000 60%, #ffce00); display: block; }
.lg-strip { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 300px); gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .3rem .1rem 1rem; scrollbar-width: thin; }
.lg-thumb { scroll-snap-align: start; text-align: left; display: grid; gap: .35rem; border-radius: var(--radius-sm); padding: .4rem; transition: background .2s, transform .2s; }
.lg-thumb:hover { background: rgb(255 255 255 / .06); transform: translateY(-3px); }
.lg-thumb.is-on { background: rgb(255 206 0 / .12); box-shadow: inset 0 0 0 2px #ffce00; }
.lg-thumb-img { position: relative; aspect-ratio: 16 / 9; border-radius: calc(var(--radius-sm) - .2rem); overflow: hidden; background: #111; display: block; }
.lg-thumb-img img, .lg-thumb-img .lg-noimg { width: 100%; height: 100%; object-fit: cover; }
.lg-thumb-play { position: absolute; right: .5rem; bottom: .5rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .65); color: #fff; font-size: .75rem; }
.lg-thumb-t { font-weight: 800; font-size: .88rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #fff; }
.lg-thumb-c { font-size: .75rem; color: var(--lg-sub); }
@media (max-width: 640px) { .lg-stage-cap small { display: none; } .lg-stage-cap { padding: .7rem .9rem; } .lg-play svg { width: 64px; height: 46px; } }
/* jobs */
.lg-filter { display: flex; flex-wrap: wrap; gap: .5rem; }
.lg-filter button { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .95rem; border-radius: 999px; font-weight: 800; font-size: .85rem;
  background: var(--surface); border: 2px solid var(--line); }
.lg-filter button.is-on, .lg-filter button:hover { background: rgb(var(--brand-600)); color: #fff; border-color: rgb(var(--brand-600)); }
.lg-warn { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  background: color-mix(in srgb, #ffce00 16%, var(--surface)); border: 2px solid color-mix(in srgb, #ffce00 60%, var(--line)); color: var(--text); }
.lg-warn i, .lg-warn svg { color: #c2410c; }
.lg-co { padding: 1.25rem; display: flex; flex-direction: column; border-top: 5px solid var(--sc); }
.lg-co[hidden] { display: none; }
.lg-co-badge { width: 3.2rem; height: 3.2rem; flex: none; border-radius: 1rem; display: grid; place-items: center; font-weight: 900; font-size: 1.05rem;
  background: color-mix(in srgb, var(--sc) 18%, var(--surface)); color: var(--sc); border: 2px solid color-mix(in srgb, var(--sc) 40%, transparent); letter-spacing: -.02em; }
.lg-co-sector { font-size: .75rem; font-weight: 700; color: var(--muted); margin-top: .2rem; }
.lg-co-sector svg { display: inline-block; vertical-align: -2px; margin-right: .25rem; }
.lg-co-link { margin-top: auto; padding-top: .9rem; font-weight: 800; font-size: .9rem; color: var(--sc); overflow-wrap: anywhere; }
.lg-co-link:hover { text-decoration: underline; }
.gs-health { --sc: #e11d48; } .gs-it { --sc: #2563eb; } .gs-auto { --sc: #475569; } .gs-logi { --sc: #d97706; } .gs-portal { --sc: #16a34a; } .gs-other { --sc: #7c3aed; }
[data-theme="space"] .gs-auto { --sc: #94a3b8; } [data-theme="space"] .gs-it { --sc: #60a5fa; } [data-theme="space"] .gs-health { --sc: #fb7185; }
/* rules */
.lg-rules-band { background: linear-gradient(180deg, transparent, color-mix(in srgb, rgb(var(--brand-500)) 7%, transparent)); }
.lg-rule { padding: 0; overflow: hidden; }
.lg-rule summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .8rem; padding: 1rem 1.1rem; }
.lg-rule summary::-webkit-details-marker { display: none; }
.lg-rule-ic { width: 2.6rem; height: 2.6rem; flex: none; border-radius: .8rem; display: grid; place-items: center; background: rgb(var(--brand-100)); color: rgb(var(--brand-700)); }
.lg-rule-chev { margin-left: auto; flex: none; transition: transform .25s; color: var(--muted); }
.lg-rule[open] .lg-rule-chev { transform: rotate(180deg); }
.lg-rule[open] { box-shadow: var(--shadow), inset 4px 0 0 #dd0000; }
.lg-rule-body { padding: 0 1.1rem 1.1rem 4.5rem; font-size: .95rem; }
@media (max-width: 480px) { .lg-rule-body { padding-left: 1.1rem; } }
/* news */
.lg-news-panel { padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.lg-news-head { display: flex; gap: .9rem; align-items: center; }
.lg-news-flag { font-size: 2.4rem; line-height: 1; }
.lg-feed { border-radius: var(--radius-sm); padding: 1rem; background: var(--surface2); border: 2px solid var(--line); }
.lg-feed-title { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; color: rgb(var(--brand-600)); }
.lg-headlines { margin-top: .6rem; display: grid; gap: .55rem; counter-reset: h; }
.lg-headlines li { display: grid; grid-template-columns: 1.6rem 1fr; column-gap: .4rem; font-size: .9rem; line-height: 1.35; counter-increment: h; }
.lg-headlines li::before { content: counter(h); grid-row: span 2; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; background: rgb(var(--brand-600)); color: #fff; }
.lg-headlines a { font-weight: 700; } .lg-headlines a:hover { text-decoration: underline; }
.lg-headlines time { font-size: .72rem; color: var(--muted); }
.lg-links { display: grid; gap: .5rem; }
@media (min-width: 640px) { .lg-links { grid-template-columns: 1fr 1fr; } }
.lg-link-card { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; border-radius: var(--radius-sm); border: 2px solid var(--line); transition: border-color .2s, transform .2s; }
.lg-link-card:hover { border-color: rgb(var(--brand-400)); transform: translateY(-2px); }
.lg-link-card i, .lg-link-card svg { color: rgb(var(--brand-600)); margin-top: .1rem; }
.lg-link-card b { display: block; font-size: .9rem; line-height: 1.25; }
.lg-link-card small { display: block; font-size: .75rem; color: var(--muted); margin-top: .15rem; }
/* CTA */
.lg-cta { overflow: hidden; background: #05070f; margin-bottom: -5rem; }
/* themes */
[data-theme="funny"] .lg-glass { border: 2px solid #1c1917; box-shadow: 5px 5px 0 #1c1917; }
[data-theme="funny"] .lg-dark .lg-glass { border-color: #ffce00; box-shadow: 5px 5px 0 #ffce00; }
[data-theme="serious"] .lg-aurora { opacity: .45; }
[data-theme="serious"] .lg-h1 { letter-spacing: -.05em; }
[data-theme="kids"] .lg-co-badge, [data-theme="kids"] .lg-rule-ic { border-radius: 1.2rem; }
[data-theme="entertaining"] .lg-stage { box-shadow: 0 0 60px rgb(var(--brand-500) / .6), 0 0 0 2px rgb(var(--brand-400)); }
[data-theme="space"] .lg-rule-ic { background: rgb(34 211 238 / .12); color: rgb(var(--brand-300)); }
[data-theme="space"] .lg-fact-num, [data-theme="space"] .lg-src, [data-theme="space"] .lg-feed-title, [data-theme="space"] .lg-kicker { color: rgb(var(--brand-400)); }
@media (prefers-reduced-motion: reduce) {
  .lg-aurora span, .lg-dot, .lg-pin-pulse, .lg-h1-grad, .lg-grad-text { animation: none !important; }
  .lg-ticker-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .lg-ticker-track > [aria-hidden] { display: none; }
  .lg-stage-btn img, .lg-city, .lg-thumb { transition: none; }
}

/* ---------- accessibility + layout fixes ------------------------------------
   Skip link, focus rings for themes without one, WCAG AA text contrast, mobile overflow. */
.skip-link { position: fixed; left: 1rem; top: -200px; z-index: 300; padding: .6rem 1.1rem; border-radius: 999px;
  background: rgb(var(--brand-700)); color: #fff; font-weight: 800; box-shadow: 0 6px 20px -6px rgb(0 0 0 / .4); }
.skip-link:focus { top: .75rem; outline: 3px solid #fff; outline-offset: 2px; }
[data-theme="space"] .skip-link { background: rgb(var(--brand-300)); color: #04131c; }
main[tabindex="-1"]:focus { outline: none; }
[data-theme="kids"] :is(a, button, summary, [tabindex]:not([tabindex="-1"]), [role="button"]):focus-visible {
  outline: 3px solid rgb(var(--brand-600)); outline-offset: 3px; }
[data-theme="space"] :is(a, button, summary, [tabindex]:not([tabindex="-1"]), [role="button"]):focus-visible {
  outline: 2px solid rgb(var(--brand-300)); outline-offset: 3px; box-shadow: 0 0 0 5px rgb(34 211 238 / .25); }

/* contrast: brand-600 is used for text and for white-text fills; these shades reach 4.5:1 */
[data-theme="funny"] { --brand-600: 21 128 61; }          /* was 22 163 74 (3.3:1 on white) - same as funny's buttons */
[data-theme="space"] { --brand-600: 14 116 144; }         /* was 8 145 178 (3.7:1 with white text) - same as space .bg-brand-600 */
[data-theme="space"] .\!bg-brand-600 { background-color: rgb(14 116 144) !important; }
[data-theme="kids"] .text-accent-600 { color: rgb(180 83 9); }      /* amber 3.2:1 -> 5:1 */
[data-theme="funny"] .text-accent-600 { color: rgb(194 65 12); }    /* orange 3.6:1 -> 5.2:1 */
[data-theme="serious"] .text-accent-600 { color: rgb(15 118 110); } /* teal 3.7:1 -> 5.5:1 */
[data-theme="space"] .text-accent-600 { color: rgb(var(--accent-400)); } /* magenta on navy 3.7:1 -> 6:1 */
[data-theme]:not([data-theme="space"]) .lg-co-link { color: color-mix(in srgb, var(--sc) 70%, #000); }

/* mobile overflow: single-column grids size their implicit track to the widest nowrap/truncate
   child (e.g. Lab "Books & notes", course plans) and push past the viewport; let items shrink.
   Long button labels may wrap on very small phones instead of running off the screen. */
@media (max-width: 639px) {
  .grid > * { min-width: 0; }
}
@media (max-width: 400px) {
  .btn:not(.whitespace-nowrap):not(td .btn) { white-space: normal; text-align: center; max-width: 100%; }
}
/* FullCalendar list view on phones */
.fc .fc-list-event-title, .fc .fc-list-day-cushion { overflow-wrap: anywhere; white-space: normal; }
.fc .fc-list-table { table-layout: auto; width: 100%; }

/* /courses level tag + big level code: same colours, darkened only where white text (or the
   page background) would fall below WCAG AA; on the dark space theme the code is lightened. */
.lvl-badge { background: oklch(from var(--lvl) min(l, .52) c h) !important; }
.lvl-num { color: oklch(from var(--lvl) min(l, .6) c h) !important; }
[data-theme="space"] .lvl-num { color: oklch(from var(--lvl) max(l, .75) c h) !important; }
/* /lab level tabs: the count pill darkens its tab a little instead of lightening it */
.lab-count { background: rgb(0 0 0 / .18); }
