/* Inat ✦ 14 – Y2K-Kitsch, mobile-first */

:root {
  --hot: #ff2e93;
  --bubble: #ff8fd1;
  --baby: #ffd6ef;
  --lilac: #c58cff;
  --lav: #e9d4ff;
  --sky: #8fe3ff;
  --lime: #c6ff3d;
  --ink: #3a0045;
  --muted: #8a3d8f;
  --white: #fff;
  --font: "Comic Neue", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  --bubbly: "Rubik Bubbles", "Arial Rounded MT Bold", system-ui, sans-serif;
  --script: "Pacifico", "Brush Script MT", cursive;
  --chrome: linear-gradient(180deg, #fff 0%, #ffd6ef 22%, #ff8fd1 45%, #c58cff 55%, #ffe6f6 70%, #fff 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.45 var(--font);
  color: var(--ink);
  background: #ffb3df;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Hintergrund: Verlauf, Sterne, Herzen, Funkeln ---------- */
.sky {
  position: fixed; inset: 0; z-index: -2;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23ffffff' fill-opacity='.55'%3E%3Cpath d='M20 8l3 9 9 3-9 3-3 9-3-9-9-3 9-3z'/%3E%3Cpath d='M86 70l2 6 6 2-6 2-2 6-2-6-6-2 6-2z'/%3E%3C/g%3E%3Cpath d='M88 18c-3-5-11-3-10 3 1 5 10 9 10 9s9-4 10-9c1-6-7-8-10-3z' fill='%23ff2e93' fill-opacity='.25'/%3E%3Ccircle cx='40' cy='92' r='2.5' fill='%23fff' fill-opacity='.7'/%3E%3C/svg%3E"),
    radial-gradient(circle at 15% 10%, #fff3fb 0, transparent 35%),
    radial-gradient(circle at 85% 30%, #e7c7ff 0, transparent 40%),
    linear-gradient(160deg, #ff9fd8 0%, #ff6fc0 35%, #d58cff 70%, #9fd8ff 100%);
}
.twinkles span {
  position: fixed; z-index: -1; color: #fff; pointer-events: none;
  text-shadow: 0 0 6px #fff, 0 0 12px var(--hot);
  animation: twinkle 2.4s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }

.sparkle {
  position: fixed; z-index: 99; pointer-events: none; color: #fff; font-size: 14px;
  text-shadow: 0 0 6px var(--hot); animation: fall .9s ease-out forwards;
}
@keyframes fall { to { transform: translateY(26px) scale(.3) rotate(90deg); opacity: 0; } }

/* ---------- Laufband ---------- */
.marquee {
  overflow: hidden; white-space: nowrap;
  background: var(--ink); color: var(--lime);
  font: 700 14px/1 var(--font); letter-spacing: .08em;
  padding: 7px 0; border-bottom: 3px dashed var(--bubble);
}
.marquee > div { display: inline-block; animation: run 22s linear infinite; }
.marquee span { padding-right: 2em; }
@keyframes run { to { transform: translateX(-50%); } }

/* ---------- Kopf ---------- */
.hero { position: relative; text-align: center; padding: 18px 16px 8px; max-width: 680px; margin: 0 auto; }
.kicker { margin: 0; font-weight: 700; color: var(--white); text-shadow: 1px 1px 0 var(--hot); letter-spacing: .1em; }
.bubble {
  position: relative; margin: 0; line-height: 1;
  font: 400 clamp(76px, 24vw, 140px) var(--bubbly);
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px var(--hot);
  filter: drop-shadow(3px 4px 0 var(--ink)) drop-shadow(0 0 14px rgba(255,255,255,.8));
}
.bubble::after {
  content: attr(data-text); position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.95) 50%, transparent 65%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 0; animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0% { background-position: 130% 0; } 60%,100% { background-position: -130% 0; } }
.script { margin: 4px 0 0; font: 22px/1.3 var(--script); color: var(--white); text-shadow: 2px 2px 0 var(--hot), 0 0 10px var(--lilac); }
.burst {
  position: absolute; right: 6px; top: 34px; width: 74px; height: 74px;
  display: grid; place-items: center;
  background: var(--lime); color: var(--ink);
  clip-path: polygon(50% 0, 61% 18%, 82% 10%, 79% 32%, 100% 40%, 84% 55%, 96% 75%, 73% 77%, 68% 100%, 50% 86%, 32% 100%, 27% 77%, 4% 75%, 16% 55%, 0 40%, 21% 32%, 18% 10%, 39% 18%);
  animation: spin 9s linear infinite;
}
.burst span { font: 26px var(--bubbly); animation: spin 9s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.deco { position: absolute; font-size: 26px; color: var(--white); text-shadow: 0 0 8px var(--hot); animation: bob 3s ease-in-out infinite; }
.d1 { left: 8px; top: 44px; }
.d2 { display: none; left: 22%; bottom: 0; color: var(--hot); text-shadow: 0 0 6px #fff; animation-delay: -1s; }
.d3 { display: none; right: 24%; bottom: -4px; color: var(--sky); animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(10deg); } }

/* ---------- Karte ---------- */
.card {
  position: relative;
  margin: 14px 12px 20px; padding: 18px 14px 14px;
  max-width: 680px;
  background: rgba(255, 255, 255, .88);
  border: 4px solid var(--hot); border-radius: 26px;
  box-shadow: 8px 8px 0 var(--lilac), 0 0 0 8px rgba(255,255,255,.45);
}
.tape {
  position: absolute; width: 92px; height: 26px; top: -14px;
  background: repeating-linear-gradient(45deg, rgba(198,255,61,.85) 0 8px, rgba(255,255,255,.85) 8px 16px);
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.t1 { left: 18px; transform: rotate(-8deg); }
.t2 { right: 18px; transform: rotate(7deg); background: repeating-linear-gradient(45deg, rgba(143,227,255,.85) 0 8px, rgba(255,255,255,.85) 8px 16px); }
.card-title {
  margin: 0 0 12px; text-align: center;
  font: 24px/1.2 var(--script); color: var(--hot);
  text-shadow: 1px 1px 0 #fff, 2px 2px 0 var(--lav);
}

/* ---------- Jelly-Buttons ---------- */
.jelly {
  position: relative; cursor: pointer;
  border: 2px solid #fff; border-radius: 999px;
  padding: 9px 16px; color: #fff; font-weight: 700;
  background: linear-gradient(180deg, #ffa3dc 0%, var(--hot) 55%, #d4006e 100%);
  box-shadow: 0 4px 0 #a3005a, 0 6px 14px rgba(160, 0, 90, .35), inset 0 -3px 6px rgba(0,0,0,.15);
  text-shadow: 0 1px 1px rgba(120, 0, 60, .6);
  transition: transform .08s, box-shadow .08s;
}
.jelly::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 3px; height: 40%;
  border-radius: 999px; background: linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.1));
  pointer-events: none;
}
.jelly:active { transform: translateY(3px); box-shadow: 0 1px 0 #a3005a, 0 2px 6px rgba(160, 0, 90, .35); }
.jelly:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.jelly.ghost { background: linear-gradient(180deg, #fff 0%, var(--lav) 100%); color: var(--ink); text-shadow: none; box-shadow: 0 4px 0 var(--lilac); }
.jelly:disabled { filter: grayscale(.5) opacity(.7); cursor: default; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.modes .jelly { padding: 8px 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.modes .jelly small { font-weight: 400; font-size: 12px; opacity: .95; }
.modes .jelly:not([aria-selected="true"]) {
  background: linear-gradient(180deg, #fff 0%, var(--baby) 100%); color: var(--hot); text-shadow: none;
  box-shadow: 0 4px 0 var(--bubble);
}
.modes .jelly[aria-selected="true"]::after { content: "✦"; position: absolute; right: 8px; top: -10px; color: var(--lime); font-size: 20px; text-shadow: 0 0 4px var(--ink); }

/* ---------- Bühne ---------- */
.task { margin: 0 0 12px; text-align: center; }
.task b { color: var(--hot); }
.stage { display: grid; gap: 14px; padding: 4px 2px 8px; }
.stage.grid4 { grid-template-columns: 1fr 1fr; gap: 12px; }
.polaroid {
  position: relative; margin: 0;
  background: #fff; padding: 8px 8px 28px;
  box-shadow: 0 6px 16px rgba(80, 0, 70, .25);
  transform: rotate(-1.5deg);
}
.stage .polaroid:nth-child(even) { transform: rotate(1.8deg); }
.stage.single .polaroid { width: min(100%, 330px); justify-self: center; }
.polaroid .ph { overflow: hidden; background: var(--baby); aspect-ratio: 4 / 5; }
.stage.grid4 .polaroid { padding: 6px 6px 22px; }
.stage.grid4 .polaroid .ph { aspect-ratio: 3 / 4; }
.polaroid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid figcaption {
  position: absolute; left: 0; right: 0; bottom: 3px; text-align: center;
  font: 16px/1.2 var(--script); color: var(--hot);
}
.stage.grid4 .polaroid figcaption { font-size: 13px; bottom: 2px; }
.polaroid .sticker {
  position: absolute; right: -8px; top: -10px; font-size: 26px;
  filter: drop-shadow(1px 2px 0 rgba(0,0,0,.2));
}
.composite {
  position: relative; aspect-ratio: 1; padding: 8px; border-radius: 18px;
  background: conic-gradient(from 0deg, var(--hot), var(--lilac), var(--sky), var(--lime), var(--bubble), var(--hot));
  box-shadow: 0 6px 16px rgba(80, 0, 70, .3);
}
.composite canvas { width: 100%; height: 100%; display: block; border-radius: 12px; }
.qlabel {
  position: absolute; z-index: 1; font-weight: 700; font-size: 13px;
  background: var(--lime); color: var(--ink); padding: 2px 8px; border-radius: 999px; border: 2px solid #fff;
}
.qlabel:nth-of-type(1) { left: 14px; top: 14px; }
.qlabel:nth-of-type(2) { right: 14px; top: 14px; }
.qlabel:nth-of-type(3) { left: 14px; bottom: 14px; }
.qlabel:nth-of-type(4) { right: 14px; bottom: 14px; }
.loading { text-align: center; padding: 40px 10px; font: 20px var(--script); color: var(--hot); }

/* ---------- Eingabe ---------- */
.guess { margin-top: 10px; }
.guess label { display: block; font-weight: 700; margin-bottom: 6px; }
.guess .row { display: flex; gap: 8px; }
.guess input {
  flex: 1; min-width: 0;
  font: 700 22px var(--font); color: var(--ink);
  padding: 8px 16px; border-radius: 999px;
  border: 3px solid var(--bubble); background: #fff;
  box-shadow: inset 0 2px 5px rgba(160,0,90,.15);
}
.guess input:focus { outline: none; border-color: var(--hot); box-shadow: 0 0 0 4px var(--lav); }
.guess .go { white-space: nowrap; }
.err { color: #d4006e; font-weight: 700; min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }

.stats { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.stats span {
  font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--lav); border: 2px dashed var(--lilac);
}

/* ---------- Fuß ---------- */
.foot { text-align: center; color: #fff; padding: 0 16px 28px; text-shadow: 1px 1px 0 var(--hot); }
.linkish { background: none; border: 0; color: #fff; font-weight: 700; text-decoration: underline wavy var(--lime); cursor: pointer; padding: 4px; text-shadow: inherit; }
.counter { margin: 10px 0 0; font-weight: 700; }
.counter span { font-family: ui-monospace, Menlo, monospace; background: #000; color: var(--lime); padding: 1px 6px; letter-spacing: 2px; text-shadow: none; }
.tiny { font-size: 12px; margin: 6px 0 0; }

/* ---------- Popups ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(90, 0, 80, .35); backdrop-filter: blur(2px); }
.pop {
  position: fixed; z-index: 30; left: 12px; right: 12px; top: 50%; transform: translateY(-50%);
  max-width: 460px; margin: 0 auto; max-height: calc(100dvh - 32px); overflow: auto;
  background: linear-gradient(180deg, #fff 0%, var(--baby) 100%);
  border: 4px solid #fff; border-radius: 26px; padding: 22px 18px 18px;
  box-shadow: 0 0 0 4px var(--hot), 8px 10px 0 4px var(--lilac), 0 20px 40px rgba(80,0,70,.35);
  animation: popin .25s cubic-bezier(.3,1.6,.6,1);
}
@keyframes popin { from { transform: translateY(-50%) scale(.85); opacity: 0; } }
.pop p { margin: 0 0 10px; }
.pop-title { margin: 0 0 10px; padding: 0 28px; text-align: center; font: 24px/1.25 var(--script); color: var(--hot); text-shadow: 1px 1px 0 #fff; }
.x {
  position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #fff; background: var(--hot); color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 0 #a3005a;
}
.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.rules { margin: 0; padding-left: 20px; }
.rules li::marker { content: "✦ "; color: var(--hot); }

.loading-text { text-align: center; font: 20px var(--script); color: var(--hot); }
.candy { height: 22px; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--hot); background: #fff; overflow: hidden; }
.candy i {
  display: block; height: 100%; width: 0; transition: width .15s linear;
  background: repeating-linear-gradient(-45deg, var(--hot) 0 10px, var(--bubble) 10px 20px);
  background-size: 28px 28px; animation: candy .6s linear infinite;
}
@keyframes candy { to { background-position: 28px 0; } }

.stars { text-align: center; font-size: 30px; letter-spacing: 4px; margin: 0; color: #ffd400; text-shadow: 0 0 2px #b38f00, 0 0 10px #fff; }
.stars .off { color: rgba(58, 0, 69, .18); text-shadow: none; }
.pts { text-align: center; font-weight: 700; }
.pts b { background: var(--lime); padding: 1px 8px; border-radius: 999px; }
.restable { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 14px; }
.restable td { background: #fff; padding: 6px 8px; vertical-align: middle; }
.restable td:first-child { border-radius: 14px 0 0 14px; width: 52px; }
.restable td:last-child { border-radius: 0 14px 14px 0; }
.restable th { font-size: 12px; text-align: left; color: var(--muted); padding: 0 8px; font-weight: 700; }
.restable td.num { text-align: right; font-weight: 700; white-space: nowrap; }
.restable img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; display: block; border: 2px solid var(--bubble); }
.restable small { color: var(--muted); }
.restable tfoot td { background: var(--lime); font-weight: 700; }
.q { font-weight: 700; color: var(--hot); }
.hint { font-size: 13px; color: var(--muted); }

.guestbook { background: #fff; border: 3px dashed var(--bubble); border-radius: 16px; padding: 12px 14px; }
.gb-head { font-size: 13px; color: var(--muted); font-weight: 700; }

@keyframes wiggle { 0%,100% { transform: translateY(-50%) rotate(0); } 25% { transform: translateY(-50%) rotate(-2deg); } 75% { transform: translateY(-50%) rotate(2deg); } }
.wiggle { animation: wiggle .3s 2; }

/* ---------- Breitere Screens ---------- */
@media (min-width: 720px) {
  .card { margin: 18px auto 26px; padding: 24px 24px 18px; }
  .stage.single .polaroid, .composite { width: min(440px, 100%); justify-self: center; }
  .stage.grid4 { grid-template-columns: repeat(4, 1fr); }
  .burst { right: 40px; width: 96px; height: 96px; }
  .d2, .d3 { display: block; }
  .d2 { left: 8%; bottom: 40px; }
  .d3 { right: 8%; bottom: 10px; }
  .burst span { font-size: 34px; }
  .script { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* ---------- Tagebuch-Login (nur gehostete, verschlüsselte Version) ---------- */
.diary {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.6) 0, transparent 30%),
    linear-gradient(160deg, #ff9fd8 0%, #ff6fc0 40%, #d58cff 100%);
  transition: opacity .45s;
}
.diary-out { opacity: 0; pointer-events: none; }
.diary-book {
  position: relative; width: min(380px, 100%); text-align: center;
  padding: 34px 20px 22px 34px; border-radius: 10px 26px 26px 10px;
  background:
    repeating-linear-gradient(transparent 0 27px, rgba(197,140,255,.35) 27px 28px),
    linear-gradient(90deg, var(--hot) 0 16px, #fff 16px);
  border: 4px solid #fff;
  box-shadow: 0 0 0 4px var(--hot), 10px 12px 0 4px var(--lilac), 0 24px 50px rgba(80,0,70,.35);
}
.diary-lock { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 46px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.2)); }
.diary-kicker { margin: 0; font-weight: 700; color: var(--muted); font-size: 13px; letter-spacing: .1em; }
.diary-title { margin: 4px 0; font: 34px/1.15 var(--script); color: var(--hot); text-shadow: 2px 2px 0 var(--lav); }
.diary-sub { margin: 0 0 14px; font-weight: 700; }
.diary-row { display: flex; gap: 8px; }
.diary-row input {
  flex: 1; min-width: 0; font: 700 16px var(--font); padding: 9px 14px;
  border-radius: 999px; border: 3px solid var(--bubble); background: #fff;
}
.diary-row input:focus { outline: none; border-color: var(--hot); box-shadow: 0 0 0 4px var(--lav); }
.diary-msg { min-height: 1.3em; margin: 10px 0 0; font-size: 14px; font-weight: 700; }
.diary-msg.bad { color: #fff; background: var(--hot); border-radius: 999px; padding: 4px 10px; display: inline-block; }
