/* Gemeinsamer Look für Lernwelt und Gedicht-Quest: ein Schulheft –
   Karopapier, Füller-Blau, Sticker mit dicken Umrissen (wie der Einmaleins-Blitz) */
:root {
  --paper: #fdfaf1;
  --grid: #d3e2ef;
  --margin: #e8665f;
  --ink: #1f2a44;
  --pen: #2447a8;
  --muted: #66708a;
  --hi: #fff06a;
  --sun: #ffc93c;
  --tomato: #ff7a59;
  --mint: #6fd6a4;
  --sky: #8cc8ff;
  --lilac: #c4b0ff;
  --peach: #ffd0bf;
  --lemon: #ffe79a;
  --lime: #cdeea0;
  --space: var(--sky); /* Lieblingsfarbe des Kindes */
}
* { box-sizing: border-box; }
[hidden], .ohneBelohnung [data-belohnung] { display: none !important; }
html, body { margin: 0; }
body {
  color: var(--ink);
  font-family: "Patrick Hand", "Chalkboard SE", "Comic Sans MS", cursive;
  font-size: 21px;
  min-height: 100vh; display: flex; padding: 28px 16px 40px 16px;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}
body::before {
  content: ""; position: fixed; top: 0; bottom: 0; left: 64px; width: 3px;
  background: var(--margin); opacity: .55; pointer-events: none;
}
.display, h1, .btn, .stamp, .xpgain, .ptile .nm, .island .nm, .game .nm {
  font-family: "Lilita One", "Marker Felt", "Arial Rounded MT Bold", sans-serif;
  font-weight: 400;
}
.screen { display: none; width: 100%; max-width: 700px; }
.screen.active { display: block; margin: auto; animation: slidein .35s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(14px) rotate(.4deg); } }

.card {
  position: relative; background: #fff; text-align: center;
  border: 3px solid var(--ink); border-radius: 10px 14px 12px 16px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 34px 30px 30px;
}
.card::before {
  content: ""; position: absolute; top: -18px; left: 50%; width: 140px; height: 34px; margin-left: -70px;
  background: repeating-linear-gradient(-45deg, rgba(255, 201, 60, .9) 0 9px, rgba(255, 226, 140, .9) 9px 18px);
  transform: rotate(-3deg); border-left: 2px dashed rgba(0,0,0,.08); border-right: 2px dashed rgba(0,0,0,.08);
}
h1 { font-size: 46px; line-height: 1.05; margin: 4px 0 14px; letter-spacing: .5px; }
.hl { background: linear-gradient(transparent 52%, var(--hi) 52% 88%, transparent 88%); padding: 0 6px; }
h2 {
  display: table; margin: 30px auto 14px; padding: 0 8px;
  font-size: 27px; font-weight: 400;
  background: linear-gradient(transparent 58%, var(--hi) 58% 92%, transparent 92%);
}

.btn {
  cursor: pointer; color: var(--ink); font-size: 26px; letter-spacing: .5px;
  background: var(--sun); border: 3px solid var(--ink); border-radius: 16px;
  padding: 14px 30px; box-shadow: 5px 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px) rotate(-1deg); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.mint { background: var(--mint); }
.btn.sky { background: var(--sky); }
.btn.lilac { background: var(--lilac); }
.btn.white { background: #fff; }
.btn.small { font-size: 20px; padding: 8px 18px; box-shadow: 3px 3px 0 var(--ink); }
.btn.huge { font-size: 38px; padding: 18px 56px; margin-top: 22px; transform: rotate(-1.5deg); background: var(--tomato); }
.btn.huge:hover { transform: rotate(0) translate(-1px, -1px); }
.btn.huge:active { transform: translate(4px, 4px); }
.keysBtn { text-decoration: none !important; font-size: 24px !important; }
.keysBtn.off { opacity: .3; filter: grayscale(1); }
.link { background: none; border: none; font-family: inherit; font-size: 20px; color: var(--muted); cursor: pointer; text-decoration: underline; }
.actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.hint { color: var(--muted); font-size: 20px; margin-top: 14px; min-height: 1.2em; line-height: 1.35; }

.whoami { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.whoami .me { display: flex; align-items: center; gap: 10px; font-size: 26px; }
.whoami .me span:first-child { font-size: 38px; }

.buddy { display: flex; align-items: center; gap: 18px; margin: 8px 0 0; text-align: left; }
.buddy .mascot { font-size: 66px; animation: bob 2.6s ease-in-out infinite; white-space: nowrap; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-5deg); } }
.bubble {
  position: relative; flex: 1; background: #fff; border: 3px solid var(--ink); border-radius: 22px;
  padding: 12px 18px; font-size: 23px; line-height: 1.25;
}
.bubble::before, .bubble::after { content: ""; position: absolute; top: 50%; border: 12px solid transparent; border-left: 0; }
.bubble::before { left: -15px; margin-top: -12px; border-right-color: var(--ink); }
.bubble::after { left: -10px; margin-top: -9px; border-width: 9px; border-left: 0; border-right-color: #fff; }

.xpbar { height: 20px; background: #fff; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; margin: 6px 0 2px; }
.xpbar div {
  height: 100%; border-right: 2.5px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--tomato) 0 10px, var(--sun) 10px 20px);
  transition: width .6s;
}

/* Polaroids zur Kinderauswahl */
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; padding: 6px; }
.ptile {
  font-family: inherit; cursor: pointer; background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 6px; padding: 14px 8px 12px;
  box-shadow: 5px 5px 0 var(--ink); transition: transform .1s;
}
.ptile:nth-child(3n+1) { transform: rotate(-2.5deg); }
.ptile:nth-child(3n+2) { transform: rotate(1.8deg); }
.ptile:nth-child(3n) { transform: rotate(-1deg); }
.ptile:hover { transform: rotate(0) scale(1.04); }
.ptile .av { font-size: 62px; line-height: 1.15; background: #eef6ff; border: 2px solid var(--ink); border-radius: 4px; margin-bottom: 8px; }
.ptile .nm { font-size: 26px; word-break: break-word; }
.ptile .st { font-size: 17px; color: var(--muted); }
.ptile.add { border-style: dashed; box-shadow: none; }
.ptile.add .av { background: var(--paper); color: var(--tomato); font-family: "Lilita One", sans-serif; }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; max-width: 500px; margin: 0 auto; }
.avatars button, .colors button { font-size: 34px; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 4px 0; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.avatars button.on { background: var(--hi); transform: rotate(-6deg) scale(1.1); }
.colors { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.colors button { width: 52px; height: 52px; border-radius: 50%; }
.colors button.on { transform: scale(1.2); outline: 3px dashed var(--ink); outline-offset: 3px; }
input.big, textarea, select, input[type=date], input[type=number] {
  font-family: inherit; color: var(--pen); font-size: 22px;
  border: 2.5px solid var(--ink); border-radius: 10px; padding: 6px 12px; background: #fff; outline: none;
}
input.big { font-size: 34px; text-align: center; width: 100%; max-width: 380px; border: none; border-bottom: 3px solid var(--ink); border-radius: 0; background: transparent; }
input:focus, textarea:focus { background: #fffbe0; }

.stamp {
  display: inline-block; font-size: 52px; color: var(--tomato); letter-spacing: 2px;
  border: 5px solid var(--tomato); border-radius: 14px; padding: 2px 22px; transform: rotate(-7deg);
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--tomato);
  animation: stamp .45s cubic-bezier(.2, 1.6, .5, 1) both;
}
@keyframes stamp { from { transform: scale(2.4) rotate(-18deg); opacity: 0; } }
.xpgain {
  display: inline-block; margin-top: 16px; font-size: 32px; background: var(--hi);
  border: 3px solid var(--ink); border-radius: 12px; padding: 4px 22px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(2deg);
}
.news { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.news div { background: #fff; border: 2.5px solid var(--ink); border-left: 10px solid var(--mint); border-radius: 8px; padding: 6px 16px; font-size: 23px; }
.news div:nth-child(even) { border-left-color: var(--sky); }

.confetti { position: fixed; top: -30px; width: 12px; height: 16px; border: 2px solid var(--ink); pointer-events: none; animation: fall 2.8s ease-in forwards; z-index: 10; }
@keyframes fall { to { transform: translateY(115vh) rotate(720deg); } }

@media (max-width: 560px) {
  body { padding: 24px 10px 30px; font-size: 19px; }
  body::before { left: 6px; }
  h1 { font-size: 36px; }
  .card { padding: 28px 16px 22px; box-shadow: 5px 5px 0 var(--ink); }
  .avatars { grid-template-columns: repeat(4, 1fr); }
  .btn.huge { padding: 16px 40px; font-size: 30px; }
  .buddy .mascot { font-size: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* Nuss und sein Kleiderschrank (Gedicht-Quest und Diktat) */
.mascot svg, .buddyon svg { display: block; overflow: visible; }
.buddy .mascot { width: 104px; height: 104px; flex: none; }
button.mascot { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button.mascot:hover { scale: 1.08; }
.buddyon { width: 58px; height: 58px; top: -34px; }
.neu { display: inline-block; margin-left: 8px; font-size: 15px; background: var(--tomato); color: #fff; border: 2px solid var(--ink); border-radius: 9px; padding: 0 7px; transform: rotate(4deg); animation: pulse 1.4s ease-in-out infinite; }
.closetStage { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 0; }
.closetStage .bubble { max-width: 230px; font-size: 21px; }
.nussBig { width: 230px; height: 230px; flex: none; animation: bob 2.6s ease-in-out infinite; }
/* Nuss fährt Streife (Polizeiauto, SEK-Wagen, Hubschrauber, Boot ...), solange gescannt und gelesen wird */
.streife { margin: 10px auto 0; max-width: 460px; }
.streife[hidden], .abenteuer[hidden] { display: none; }
.szene { position: relative; height: 230px; border-radius: 18px; overflow: hidden; border: 3px solid var(--ink, #1f2a44); background: #bfe6ff; }
.szene[data-ort="wald"] { background: #cdeccd; }
.szene[data-ort="berge"] { background: #d8ecff; }
.szene[data-ort="strand"] { background: #a8e0ff; }
.szene[data-ort="schnee"] { background: #eef6ff; }
.szene[data-ort="nacht"] { background: #2b3566; }
.kulisse { position: absolute; left: 0; display: flex; white-space: nowrap; animation: kulisse 14s linear infinite; }
.kulisse span { padding-right: .6em; }
.kulisse.fern { top: 14px; font-size: 52px; opacity: .85; }
.kulisse.nah { bottom: 40px; font-size: 30px; animation-duration: 6s; z-index: 1; }
@keyframes kulisse { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.strasse { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: #59606e;
  background-image: repeating-linear-gradient(90deg, #fff 0 34px, transparent 34px 72px); background-size: 72px 5px; background-repeat: repeat-x; background-position: 0 20px;
  animation: strasse .6s linear infinite; }
.szene[data-ort="strand"] .strasse { background-color: #e8c98a; }
.szene[data-ort="schnee"] .strasse { background-color: #9aa3b5; }
@keyframes strasse { from { background-position-x: 0; } to { background-position-x: -72px; } }
.auto { position: absolute; left: 50%; bottom: 6px; width: 270px; height: 144px; margin-left: -135px; z-index: 2; animation: ruckel .5s ease-in-out infinite; }
.auto svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fahrer { position: absolute; left: 70px; bottom: 50px; width: 120px; height: 120px; animation: wipp 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.fahrer svg { width: 100%; height: 100%; }
.auto .rad { transform-box: fill-box; transform-origin: center; animation: rad .5s linear infinite; }
.auto .blau { fill: #2f6fde; animation: blink .5s steps(1) infinite; }
.auto .rot { fill: #e8384f; animation: blink .5s steps(1) infinite reverse; }
/* je Fahrzeug: wo Nuss sitzt und wie es sich bewegt */
.auto[data-fahrzeug="sekwagen"] .fahrer { left: 128px; bottom: 30px; width: 86px; height: 86px; }
.auto[data-fahrzeug="hubschrauber"] { bottom: 58px; animation: schweb 2.4s ease-in-out infinite; }
.auto[data-fahrzeug="hubschrauber"] .fahrer { left: 138px; bottom: 44px; width: 72px; height: 72px; }
.auto[data-fahrzeug="boot"] { animation: schaukel 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.auto[data-fahrzeug="boot"] .fahrer { left: 64px; bottom: 50px; }
.szene:has(.auto[data-fahrzeug="boot"]) .strasse { background: #4aa8e8; }
.auto[data-fahrzeug="motorrad"] .fahrer { left: 50px; bottom: 56px; width: 110px; height: 110px; }
.auto[data-fahrzeug="gelaendewagen"] .fahrer { bottom: 60px; }
.auto .rotor { transform-box: fill-box; transform-origin: center; animation: rotor .25s linear infinite; }
.auto .heckrotor { transform-box: fill-box; transform-origin: center; animation: rad .3s linear infinite; }
.auto .welle { animation: welle 1.2s linear infinite; }
@keyframes rotor { 50% { transform: scaleX(.12); } }
@keyframes schweb { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes schaukel { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes welle { to { transform: translateX(-30px); } }
@keyframes rad { to { transform: rotate(360deg); } }
@keyframes ruckel { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes wipp { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-4px); } }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: .25; } }
.abenteuer { margin-top: 10px; padding: 12px 16px; border-radius: 14px; background: #fff7d6; border: 3px solid var(--ink, #1f2a44); font-size: 20px; line-height: 1.4; text-align: left; }
.abenteuer b { display: block; margin-bottom: 4px; }
.abenteuer.spricht { box-shadow: 0 0 0 4px var(--hi, #ffc93c); }
@media (prefers-reduced-motion: reduce) { .kulisse, .strasse, .auto, .fahrer, .auto .rad, .auto .blau, .auto .rot, .auto .rotor, .auto .heckrotor, .auto .welle { animation-duration: 8s; } }
.nussBig.hop svg { animation: hop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 40% { transform: translateY(-16px) scale(1.06) rotate(3deg); } }
.swatches { display: flex; gap: 10px; justify-content: center; align-items: center; min-height: 46px; margin: 6px 0 2px; font-size: 19px; color: var(--muted); }
.swatches button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--ink); cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.swatches button.on { outline: 4px solid var(--ink); outline-offset: 3px; }
.slotrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.slotname { width: 100%; font-family: "Lilita One", sans-serif; font-size: 19px; color: var(--muted); text-align: left; margin-top: 8px; }
.tile {
  position: relative; cursor: pointer; font-family: inherit; color: var(--ink); width: 104px; padding: 8px 4px 6px;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); transition: transform .1s;
}
.tile:nth-child(odd) { transform: rotate(-1.5deg); }
.tile:nth-child(even) { transform: rotate(1.5deg); }
.tile:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--ink); }
.tile .te { font-size: 38px; line-height: 1.1; display: block; }
.tile .tn { font-size: 17px; display: block; }
.tile.on { background: var(--mint); }
.tile.on::after { content: "✓"; position: absolute; top: -12px; right: -10px; width: 28px; height: 28px; line-height: 24px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); font-family: "Lilita One", sans-serif; font-size: 18px; }
.tile.locked { background: #f4f6f9; border-style: dashed; box-shadow: none; }
.tile.locked .te { filter: grayscale(1); opacity: .35; }
.tile.locked .tn { color: var(--muted); }
.tile .neu { position: absolute; top: -12px; left: -8px; margin: 0; }
@media (max-width: 560px) { .closetStage { flex-direction: column; } .nussBig { width: 190px; height: 190px; } .tile { width: 88px; } .buddy .mascot { width: 80px; height: 80px; } }


/* Eltern-Hinweis (stimmeWarnen in gemeinsam.js) */
.warnbox { border: 2.5px solid #e0a100; background: #fff6d6; border-radius: 12px; padding: 10px 14px; margin-top: 12px; font-size: 18px; text-align: left; }
