@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --sky1: #4fbdf0; --sky2: #c8eeff; --g1: #86bf2a; --g2: #5e9420;
  --horizon: 24vh;
  --top-safe: env(safe-area-inset-top, 0px);
  --bot-safe: env(safe-area-inset-bottom, 0px);
  --ink: #23324a;
  color-scheme: light;
}

/* ---- absolut starr: kein Zoom, kein Scrollen, kein Markieren ---- */
html, body {
  position: fixed; inset: 0; margin: 0; padding: 0; overflow: hidden;
  width: 100%; height: 100%;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  background: #4fbdf0;
  font-family: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, svg { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

#app { position: fixed; inset: 0; overflow: hidden; }

/* ---------- Szene ---------- */
#scene { position: absolute; inset: 0; overflow: hidden; }
#scene > div { position: absolute; left: 0; right: 0; transition: opacity .7s ease; }
.sky { top: 0; bottom: 0; background: linear-gradient(180deg, var(--sky1), var(--sky2) calc(var(--horizon) + 4vh)); transition: background .8s; }
.celestial { top: 0; height: 0; z-index: 1; }
.celestial .orb { position: absolute; right: 86px; top: calc(var(--top-safe) + 6px); width: clamp(64px, 9vmin, 104px); aspect-ratio: 1; animation: orb-float 9s ease-in-out infinite; }
.celestial .orb .rays { transform-origin: 0 0; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orb-float { 50% { transform: translateY(-6px); } }
.clouds { top: 0; height: var(--horizon); pointer-events: none; }
.clouds .cloud { position: absolute; left: 0; opacity: .95; animation: drift linear infinite; will-change: transform; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(110vw); } }
.horizon { bottom: calc(100% - var(--horizon) - 2px); height: 34vh; }
.horizon .strip { position: absolute; inset: 0; width: 100%; height: 100%; }
.ground { top: var(--horizon); bottom: 0; background: linear-gradient(180deg, var(--g1), var(--g2)); }
.ground .deco { position: absolute; inset: 0; }
.ground .deco > span { position: absolute; display: block; transform: translate(-50%, -100%); }
.ground .deco > span svg { width: 100%; height: auto; display: block; }
.photo { top: 0; height: calc(var(--horizon) + 70px); background: #9cc no-repeat; opacity: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 70px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 70px), transparent); }
.photo { z-index: 1; }
.photo2 { top: calc(var(--horizon) - 10px); bottom: 0; background: #6a6 no-repeat; opacity: 0; filter: blur(1.6px) saturate(1.05);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 50px); mask-image: linear-gradient(180deg, transparent, #000 50px); z-index: 0; }
.photo2::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.0) 30%, rgba(0,0,0,.16)); }
.nightshade { inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(180deg, rgba(4, 10, 40, .0), rgba(6, 14, 50, .55) var(--horizon), rgba(4, 8, 30, .62)); }

#app.real .photo, #app.real .photo2 { opacity: 1; }
#app.real .sky, #app.real .clouds, #app.real .horizon, #app.real .ground, #app.real .celestial { opacity: 0; }
#app.night .nightshade { opacity: 1; }
#app.night.real .photo { filter: brightness(.55) saturate(.65) hue-rotate(8deg); }
#app.night.real .photo2 { filter: blur(1.6px) brightness(.5) saturate(.6) hue-rotate(8deg); }
#app.night.real .nightshade { background: linear-gradient(180deg, rgba(8, 18, 60, .55), rgba(6, 14, 50, .45)); }
#app.night .clouds { opacity: .25; }

#fx, #weather { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#fx { z-index: 1; }
#weather { z-index: 3; }

/* ---------- Tiere ---------- */
#field { position: absolute; inset: 0; z-index: 2; }
.animal { position: absolute; display: block; transform-origin: 50% 100%; }
.animal .pose { position: absolute; inset: 0; transform-origin: 50% 100%; animation: breathe var(--bd, 3.4s) ease-in-out var(--bdl, 0s) infinite; }
.animal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transition: opacity .45s ease; }
.animal img.real { opacity: 0; }
#app.real .animal img.real { opacity: 1; }
#app.real .animal img.comic { opacity: 0; }
.animal .shadow { position: absolute; left: 14%; right: 14%; bottom: -5%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 30, 0, .32), rgba(0, 30, 0, 0)); }
.animal[data-base="floe"] .shadow { left: -2%; right: -2%; bottom: -9%; height: 22%; background: radial-gradient(closest-side, #ffffff 70%, #cdeefc 88%, rgba(255, 255, 255, 0) 100%); box-shadow: 0 6px 0 -2px rgba(0, 60, 120, .25); }
.animal[data-base="water"] .shadow { left: -6%; right: -6%; bottom: -6%; height: 20%; background: radial-gradient(closest-side, rgba(255, 255, 255, .0) 55%, rgba(255, 255, 255, .7) 66%, rgba(255, 255, 255, 0) 80%); animation: ripple 2.6s ease-in-out infinite; }
@keyframes ripple { 50% { transform: scale(1.12); opacity: .6; } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.03); } }
.animal.hidden { visibility: hidden; }
.animal.enter { animation: pop-in .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.animal.leave { animation: pop-out .35s ease-in both; }
@keyframes pop-in { from { transform: translateY(18%) scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-out { to { transform: translateY(10%) scale(.3); opacity: 0; } }
#app.night .animal img { filter: brightness(.9); }
#app.focus #field .animal:not(.hidden) { opacity: .28; transform: scale(.94); transition: opacity .4s, transform .4s; }
#field .animal { transition: opacity .5s, transform .5s; }

/* ---------- Bühne (großes Tier) ---------- */
#stage { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#stage.on { pointer-events: auto; }
#stage .glow { position: absolute; left: 50%; top: 50%; width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .75), rgba(255, 255, 255, .25) 55%, rgba(255, 255, 255, 0)); opacity: 0; transform: scale(.6); transition: opacity .45s, transform .6s cubic-bezier(.2, 1.4, .4, 1); }
#app.night #stage .glow { background: radial-gradient(closest-side, rgba(255, 240, 190, .55), rgba(255, 230, 160, .15) 55%, rgba(255, 255, 255, 0)); }
#stage.on .glow { opacity: 1; transform: none; }
#stage .actor { position: absolute; transform-origin: 0 0; display: none; }
#stage.on .actor, #stage.out .actor { display: block; }
#stage .body { position: absolute; inset: 0; transform-origin: 50% 100%; }
#stage .body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
#stage .base { position: absolute; left: 12%; right: 12%; bottom: -4%; height: 9%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 30, 0, .3), rgba(0, 30, 0, 0)); }
#stage .actor[data-base="floe"] .base { left: -4%; right: -4%; bottom: -8%; height: 18%; background: radial-gradient(closest-side, #fff 70%, #cdeefc 88%, rgba(255, 255, 255, 0)); }
#stage .actor[data-base="water"] .base { left: -8%; right: -8%; bottom: -6%; height: 16%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, .8) 66%, rgba(255, 255, 255, 0) 80%); }
#stage .label { position: absolute; left: 0; right: 0; text-align: center; font-weight: 700; letter-spacing: .02em; color: #fff;
  font-size: clamp(44px, 8.5vmin, 112px); line-height: 1; white-space: nowrap;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .18), 0 0 26px rgba(0, 0, 0, .18); }
#stage .label .w { display: inline-block; margin: 0 .16em; }
#stage .label .c { display: inline-block; opacity: 0; transform: translateY(40%) scale(.4); }
#stage .label.show .c { animation: letter .5s cubic-bezier(.3, 1.8, .5, 1) forwards; }
@keyframes letter { to { opacity: 1; transform: none; } }
#stage .label.hide { opacity: 0; transform: translateY(20px); transition: opacity .3s, transform .3s; }

#bursts { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
#bursts .p { position: absolute; left: 0; top: 0; font-size: 34px; line-height: 1; will-change: transform, opacity; }

/* ---------- Kopfleiste ---------- */
#top { position: absolute; z-index: 10; left: 0; right: 0; top: 0; padding: calc(var(--top-safe) + 12px) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
#top > * { pointer-events: auto; }
.round { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff, #e8f6ff 60%, #cbe7f9); box-shadow: 0 6px 0 rgba(20, 70, 120, .25), 0 10px 22px rgba(0, 40, 80, .2), inset 0 -4px 0 rgba(30, 120, 190, .18);
  transition: transform .15s; }
.round:active { transform: scale(.92) translateY(2px); }
#worldBtn .ico { font-size: 36px; line-height: 1; }
#worldBtn .badge { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 17px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
#worldBtn .badge:empty { display: none; }
.round.small { width: 46px; height: 46px; opacity: .55; margin-top: 11px; }
.round.small span { font-size: 22px; color: #3a6a90; }
.round.small svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.round.small .ring { fill: none; stroke: #ff8a3d; stroke-width: 4; stroke-dasharray: 107; stroke-dashoffset: 107; stroke-linecap: round; }
.round.small.press { opacity: 1; }
.round.small.press .ring { transition: stroke-dashoffset 1.3s linear; stroke-dashoffset: 0; }

#mode { position: relative; display: flex; height: 68px; padding: 6px; border-radius: 40px; gap: 0;
  background: rgba(255, 255, 255, .88); box-shadow: 0 6px 0 rgba(20, 70, 120, .22), 0 10px 22px rgba(0, 40, 80, .18); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#mode button { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 0 22px 0 8px; height: 56px; border-radius: 30px; font-weight: 600; font-size: 22px; color: #5b7790; transition: color .3s; }
#mode button[aria-checked="true"] { color: #fff; }
#mode .knob { position: absolute; z-index: 0; top: 6px; height: 56px; border-radius: 30px; background: linear-gradient(180deg, #ffad42, #ff7a2f); box-shadow: inset 0 -4px 0 rgba(160, 60, 0, .25), 0 3px 8px rgba(255, 110, 30, .45); transition: left .45s cubic-bezier(.3, 1.4, .5, 1), width .45s cubic-bezier(.3, 1.4, .5, 1), background .4s; }
#app.real #mode .knob { background: linear-gradient(180deg, #4fc0ff, #2a86e8); box-shadow: inset 0 -4px 0 rgba(0, 60, 160, .25), 0 3px 8px rgba(40, 130, 230, .45); }
.mi { width: 44px; height: 44px; border-radius: 50%; background: #fff center / 82% no-repeat; box-shadow: 0 2px 5px rgba(0, 0, 0, .15); flex: none; }
.mi-real { background-size: cover; }

/* ---------- Auswahlblätter ---------- */
.sheet { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(10, 30, 60, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s ease; }
.sheet[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet-inner { position: relative; width: min(940px, 94vw); max-height: 92vh; border-radius: 36px; padding: 30px 28px 26px; background: linear-gradient(180deg, #ffffff, #eef8ff);
  box-shadow: 0 30px 80px rgba(0, 20, 60, .35); animation: sheet-in .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes sheet-in { from { transform: translateY(40px) scale(.94); opacity: 0; } }
.sheet h2 { margin: 0 70px 20px 6px; font-size: 32px; font-weight: 700; color: #2d4a6a; }
.sheet h3 { margin: 26px 4px 10px; font-size: 22px; color: #2d4a6a; }
.sheet .close { position: absolute; right: 18px; top: 18px; width: 56px; height: 56px; font-size: 24px; color: #4a6a8a; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(136px, 40vw), 1fr)); gap: 14px; }
.card { position: relative; height: 150px; border-radius: 26px; overflow: hidden; text-align: left; box-shadow: 0 6px 0 rgba(0, 0, 0, .12), 0 10px 20px rgba(0, 30, 60, .14); transition: transform .2s; }
.card:active { transform: scale(.96); }
.card .bg { position: absolute; inset: 0; }
.card .imgs { position: absolute; left: 8px; right: 8px; bottom: 34px; height: 64px; display: flex; justify-content: center; gap: 2px; }
.card .imgs img { height: 100%; width: auto; max-width: 33%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .2)); }
.card .name { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-weight: 700; font-size: 21px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.card.sel { outline: 5px solid #ff8a3d; outline-offset: 3px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.row:empty { display: none; }
.chip { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 22px 0 14px; border-radius: 34px; background: #fff; font-size: 21px; font-weight: 600; color: #4b6680; box-shadow: 0 4px 0 rgba(0, 0, 0, .1), 0 6px 14px rgba(0, 30, 60, .1); transition: transform .15s; }
.chip:active { transform: scale(.95); }
.chip .e { font-size: 32px; }
.chip.sel { background: linear-gradient(180deg, #ffad42, #ff7a2f); color: #fff; }
.chip[disabled] { opacity: .35; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll, .scroll * { touch-action: pan-y; }
.opt { display: flex; align-items: center; gap: 16px; padding: 14px 8px; font-size: 21px; border-bottom: 1px solid #e3eef7; }
.opt input { width: 30px; height: 30px; accent-color: #ff7a2f; }
.wide { display: block; width: 100%; margin: 18px 0 6px; height: 56px; border-radius: 18px; background: #e6f3ff; font-weight: 600; font-size: 20px; color: #2d6aa0; }
.tip { margin-top: 14px; padding: 16px 18px; border-radius: 18px; background: #fff7e6; font-size: 17px; line-height: 1.45; color: #6a5530; }
#credits { font-size: 13.5px; line-height: 1.5; color: #5c7088; }
#credits div { padding: 5px 4px; border-bottom: 1px solid #edf3f8; }
#credits a { color: #2d6aa0; text-decoration: none; }

/* ---------- kleine Bildschirme ---------- */
@media (max-width: 560px) {
  .celestial .orb { right: 12px; top: calc(var(--top-safe) + 74px); width: 58px; }
  .round { width: 56px; height: 56px; }
  #worldBtn .ico { font-size: 30px; }
  #mode { height: 58px; padding: 5px; }
  #mode button { height: 48px; font-size: 18px; gap: 6px; padding: 0 14px 0 5px; }
  #mode .knob { top: 5px; height: 48px; }
  .mi { width: 38px; height: 38px; }
  .round.small { width: 40px; height: 40px; margin-top: 8px; }
  .sheet h2 { font-size: 25px; }
  .card { height: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  .clouds .cloud, .celestial .orb, .animal .pose { animation: none !important; }
}
