/* Grundlagen: Farben, Schrift, Bildschirm-Gerüst. Alles Farbige hängt an den Variablen unten -> Design an EINER Stelle änderbar.
   Stil wie die Homepage der Spielegarage: beiger Pergament-Hintergrund, helle Panels, blaue Rahmen, Gold. */
:root {
  /* Flächen */
  --bg0: #ebdabe; --bg1: #e2cca4; --surf: #fdf6e7; --surf2: #f5ead2; --surf3: #ecdcb8;
  --line: rgba(60, 40, 10, .14); --line-gold: rgba(184, 134, 11, .5);
  /* Schrift */
  --text: #222222; --muted: #6e6250;
  /* Marke (wie Homepage) */
  --blue: #1a75ff; --blue-dark: #0044b3; --gold: #b8860b; --gold-light: #ffd700;
  --accent: var(--blue); --accent2: var(--blue-dark); --accent-ink: #ffffff;
  --blue-grad: linear-gradient(135deg, #2b86ff, #0044b3);
  --gold-grad: linear-gradient(180deg, #ffe27a 0%, #e8b92c 50%, #b8860b 100%);
  /* Spielfarben */
  --mint: #2f9e62; --danger: #d63a32; --violet: #7b4fd6; --teal: #1f9c96; --orange: #e8590c;
  /* Formen */
  --r: 20px; --r-s: 12px; --frame: 4px solid var(--blue);
  --shadow: 8px 10px 20px rgba(0, 0, 0, .18); --shadow-big: 12px 15px 30px rgba(0, 0, 0, .25);
  --panel: #fdf6e7; --panel-edge: inset 0 1px 0 rgba(255, 255, 255, .8);
  --font: "Segoe UI", Tahoma, Geneva, Verdana, system-ui, -apple-system, sans-serif;
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-title: "Almendra", "Cinzel", Georgia, serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue-dark); }
[hidden] { display: none !important; }

/* Hintergrund: Pergament mit blauem und goldenem Licht wie auf der Homepage */
#app { position: fixed; inset: 0; background-color: var(--bg0);
  background-image:
    radial-gradient(circle at 12% 15%, rgba(26, 117, 255, .13), transparent 42%),
    radial-gradient(circle at 88% 85%, rgba(184, 134, 11, .18), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(255, 215, 0, .12), transparent 35%),
    repeating-linear-gradient(0deg, rgba(120, 90, 40, .025) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #efe0c6, #e6d2ad); }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); overflow: hidden; }
.screen.enter-forward { animation: in-fwd .24s ease-out; }
.screen.enter-back { animation: in-back .24s ease-out; }
@keyframes in-fwd { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .screen.enter-forward { animation-name: in-back; } [dir="rtl"] .screen.enter-back { animation-name: in-fwd; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.pad { padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 820px; margin: 0 auto; }
.pad > * { flex-shrink: 0; }
.pad.wide { max-width: 1100px; }

.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .ok { color: var(--mint); } .big { font-size: 1.3rem; }
.gold-t { font-family: var(--font-display); font-weight: 700; color: var(--gold); }

#layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#layer > * { pointer-events: auto; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; padding: 0 16px; }
#offline { position: fixed; top: var(--safe-t); left: 0; right: 0; z-index: 70; background: var(--danger); color: #fff; text-align: center; padding: 4px 8px; font-size: .85rem; font-weight: 800; }

/* Ladebildschirm (unter dem Intro, bis die App bereit ist) */
#splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: radial-gradient(60% 45% at 50% 45%, #f6ead2, var(--bg0)); transition: opacity .35s; }
#splash.out { opacity: 0; pointer-events: none; }
.splash-logo { width: min(70vw, 420px); height: auto; filter: drop-shadow(6px 10px 18px rgba(0, 0, 0, .35)); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.03); } }

/* Intro: Video, danach Logo */
#intro { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: opacity .6s ease; }
#intro.out { opacity: 0; pointer-events: none; }
.intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; transform: translateZ(0); background: #000; }
#intro.playing .intro-video { opacity: 1; }
#intro.show-logo .intro-video { opacity: 0; transition-duration: .7s; }
.intro-logo { position: relative; width: min(82vw, 560px); opacity: 0; transform: scale(.86); pointer-events: none; }
.intro-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 40px rgba(0, 0, 0, .55)); }
#intro.show-logo { background: radial-gradient(65% 55% at 50% 50%, #fbf1dc 0%, #ebdabe 55%, #cdb488 100%); transition: background .7s; }
#intro.show-logo .intro-logo { animation: logo-in 1.1s cubic-bezier(.2, 1.3, .4, 1) .25s forwards; }
@keyframes logo-in { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
.intro-shine { position: absolute; inset: 0; overflow: hidden; -webkit-mask: url("../assets/brand/logo.webp") center / contain no-repeat; mask: url("../assets/brand/logo.webp") center / contain no-repeat; }
.intro-shine::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; left: -40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent); transform: skewX(-18deg); }
#intro.show-logo .intro-shine::after { animation: shine 1.1s ease-in-out 1.1s forwards; }
@keyframes shine { to { left: 120%; } }
.intro-skip { position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .6); color: #fff; font-weight: 700; opacity: 0; animation: fade-in .4s ease .6s forwards; }
.intro-skip:hover { background: rgba(0, 0, 0, .65); border-color: var(--gold-light); }
.intro-sound { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(22px + var(--safe-b)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.2rem; }
@keyframes fade-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
