/* Cozy Corner v4: Grundlagen. Schriften, Farbvariablen (Tag/Nacht), Reset, Buttons und kleine Bausteine.
   Alle Seiten (Welt, Beitreten, 404, Rechtliches) laden diese Datei. */

@font-face { font-family: 'DM Serif Display'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/dm-serif-display-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/dm-serif-display-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Grenze Gotisch'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/grenze-gotisch-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Grenze Gotisch'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/grenze-gotisch-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/caveat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/caveat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('../fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-style: italic; font-display: swap; src: url('../fonts/cormorant-garamond-latin-600-italic.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/nunito-latin-800-normal.woff2') format('woff2'); }

/* ───────── Gemeinsame Variablen ───────── */
:root {
  --radius: 18px;
  --radius-s: 10px;
  --font-b: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Segoe Script', cursive;
  --font-serif-i: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --gutter: 16px;
}

/* Tag: "Flieder und Gold". Helles Fliederlicht, tiefes Pflaumenviolett als Tinte, Violett als Akzent, warmes Gold.
   Dieselbe Farbwelt wie die Nacht (Indigo/Violett/Gold), nur bei Tageslicht. */
:root, :root[data-theme='day'] {
  color-scheme: light;
  --bg: #ece6fb;
  --bg2: #d8cdf3;
  --surface: rgba(240, 234, 252, .8);
  --surface-2: rgba(250, 247, 255, .93);
  --surface-solid: #f1ecfc;
  --ink: #2a1f4d;
  --text: #372b62;
  --muted: #5b4e87;
  --line: rgba(142, 104, 48, .45);
  --line-soft: rgba(110, 82, 190, .22);
  --accent: #6b4fe0;          /* Violett, dunkel genug für Text */
  --accent-2: #7a5af8;
  --gold: #b88a3e;
  --gold-ink: #7a5416;        /* Gold als Textfarbe (Kontrast) */
  --glow: rgba(150, 110, 235, .5);
  --lav: #8f73f0;
  --shadow: 0 22px 60px -18px rgba(42, 31, 77, .46), 0 2px 6px rgba(42, 31, 77, .1);
  --scrim: rgba(42, 31, 77, .38);
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --display-weight: 400;
  --display-track: 0;
  --btn-gold: linear-gradient(135deg, #f8e3ac 0%, #e6bf70 52%, #cb9847 100%);
  --btn-gold-ink: #2a1f4d;
  --hud-glass: rgba(240, 234, 252, .66);
  --paper-ink: rgba(42, 31, 77, .06);
}

/* Nacht: "Bordeaux-Nacht". Weinrot, Rosé, Mondcreme, Gold. */
:root[data-theme='night'] {
  color-scheme: dark;
  --bg: #20080e;
  --bg2: #42121d;
  --surface: rgba(54, 14, 23, .74);
  --surface-2: rgba(85, 23, 37, .78);
  --surface-solid: #3a101a;
  --ink: #f1e6c8;
  --text: #efe0e3;
  --muted: #c4a9ae;
  --line: rgba(217, 195, 138, .3);
  --line-soft: rgba(217, 195, 138, .14);
  --accent: #f2c5cd;
  --accent-2: #da7888;
  --gold: #d9c38a;
  --gold-ink: #e6d29c;
  --glow: rgba(218, 120, 136, .5);
  --lav: #f2c5cd;
  --shadow: 0 26px 70px -16px rgba(14, 0, 3, .85), 0 2px 8px rgba(0, 0, 0, .35);
  --scrim: rgba(17, 2, 6, .58);
  --font-display: 'Grenze Gotisch', 'DM Serif Display', Georgia, serif;
  --display-weight: 700;
  --display-track: .01em;
  --btn-gold: linear-gradient(135deg, #f1e6c8 0%, #d9c38a 52%, #b99b55 100%);
  --btn-gold-ink: #320d16;
  --hud-glass: rgba(45, 12, 20, .55);
  --paper-ink: rgba(241, 230, 200, .05);
}

/* ───────── Reset ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); color: var(--ink); line-height: 1.15; }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--btn-gold-ink); }

/* Fokus: immer sichtbar, goldener Ring */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

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

/* Dünne Rollbalken in Gold */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── Buttons und kleine Bausteine (gemeinsam mit Spielen genutzt) ───────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 22px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  font-family: var(--font-b); font-weight: 800; font-size: .92rem; letter-spacing: .03em; line-height: 1.1;
  text-decoration: none; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s, background .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 10px 26px -10px var(--glow), 0 0 0 1px var(--line-soft); color: var(--ink); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.gold {
  background: var(--btn-gold); color: var(--btn-gold-ink); border-color: transparent;
  box-shadow: 0 8px 24px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn.gold:hover { color: var(--btn-gold-ink); box-shadow: 0 14px 34px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .6); filter: brightness(1.05); }
.btn.sm { min-height: 36px; padding: 7px 16px; font-size: .82rem; }
.btn.lg { min-height: 54px; padding: 15px 34px; font-size: 1.02rem; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px;
  border-radius: 999px; border: 1px solid var(--line-soft); background: var(--surface);
  font-size: .8rem; font-weight: 700; color: var(--muted); line-height: 1.2;
}
.chip svg { width: 14px; height: 14px; }

.card {
  position: relative; border-radius: var(--radius); border: 1px solid var(--line-soft);
  background: var(--surface); padding: 18px 20px;
}
.panel-section { margin: 0 0 26px; }
.panel-section:last-child { margin-bottom: 0; }

.todo-note { font-family: var(--font-hand); font-size: 1.3rem; color: var(--gold-ink); }

/* Bewegung reduzieren: per Systemwunsch oder Einstellung (data-motion) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}
:root[data-motion='reduced'] *, :root[data-motion='reduced'] *::before, :root[data-motion='reduced'] *::after {
  animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important;
}
