:root {
  --bg: #fff6e5;
  --ink: #2d2433;
  --card: #ffffff;
  --shadow: 0 4px 0 rgba(45, 36, 51, .18);
  font-family: "Baloo 2", "Comic Sans MS", "Segoe UI Rounded", "Nunito", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.screen { display: none; height: 100dvh; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.screen.on { display: flex; }

/* ---------- Start ---------- */
#start { align-items: center; justify-content: center; gap: 12px; padding-inline: 16px; position: relative; }
h1 { margin: 0; font-size: clamp(40px, 11vw, 64px); letter-spacing: 1px; }
.hero { display: flex; gap: 4px; height: 90px; }
.hero .ani { width: 72px; height: 72px; }
.bigbuttons { display: grid; gap: 18px; width: min(420px, 100%); }
.big {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px; border: 4px solid var(--ink); border-radius: 28px;
  font-size: 28px; font-weight: 700; background: #ffe066; box-shadow: var(--shadow);
}
.big.pick { background: #9be37a; }
.big:active { transform: translateY(3px); box-shadow: none; }
.big:disabled { opacity: .55; cursor: default; }
.bigicon { font-size: 64px; line-height: 1.1; }
/* Strichcode-Bild auf den Scan-Knöpfen (statt Kamera: man scannt nur Strichcodes, keine Gerichte) */
.barcode { width: 1.45em; height: .9em; display: block; margin: .1em auto; }
.soon { font-size: 15px; font-weight: 600; }
.legal-link { position: absolute; bottom: calc(12px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--ink); opacity: .55; }
.gear { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; background: none; border: 0; font-size: 22px; opacity: .45; }

.tagline { margin: -10px 0 0; font-size: 19px; font-weight: 700; opacity: .75; text-align: center; }
/* Niedrige Bildschirme (kleine Handys): Startseite kompakter, damit Titel, Knöpfe und Impressum Platz haben */
@media (max-height: 720px) {
  #start { gap: 8px; padding-bottom: 30px; }
  .hero { height: 64px; }
  .big { padding: 10px; }
  #start .bigicon { font-size: 48px; }
  #start .big.small .bigicon { font-size: 30px; }
  .bigbuttons { gap: 12px; }
  .tagline { margin-top: -6px; font-size: 17px; }
}
.help { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: var(--card); font-size: 20px; font-weight: 800; line-height: 1; padding: 0; opacity: .7; }

/* ---------- Bilderbuch (erster Start) ---------- */
#intro { align-items: center; padding-inline: 16px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.introbar { width: 100%; display: flex; align-items: center; justify-content: center; position: relative; min-height: 48px; }
.introdots { display: flex; gap: 8px; }
.introdots span { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--ink); background: transparent; }
.introdots span.on { background: var(--ink); }
.introskip { position: absolute; right: 0; font-size: 15px; font-weight: 700; opacity: .65; }
.introstage { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.iplate { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 800; animation: pop .5s both cubic-bezier(.3, 1.7, .5, 1); }
.iplate .ifood { font-size: 52px; line-height: 1; display: grid; }
.iplate .ifood .fsvg { width: 52px; height: 52px; }
.igrid { display: grid; grid-template-columns: repeat(10, var(--cell, 30px)); grid-auto-rows: var(--cell, 30px); }
.icell { display: grid; place-items: center; transition: opacity .3s; }
.icell .pop, .icrown .pop { width: 92%; height: 92%; }
.igrid.focus .icell:not(.hop) { opacity: .12; }
.icell.hop .pop { animation: hop .45s ease-in-out 3 !important; }
.introtitle { margin: 6px 0 0; font-size: clamp(24px, 7vw, 34px); text-align: center; line-height: 1.15; }
.introsub { margin: 2px 0 0; min-height: 1.4em; font-size: 19px; font-weight: 700; text-align: center; opacity: 0; transition: opacity .4s; }
.introsub.show { opacity: .8; }
.introchips:empty { display: none; }
.introchips.nudge .chip:first-child { animation: hop .6s ease-in-out infinite; }
.introfoot { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 14px; }
.big.introgo { width: 100%; flex-direction: row; justify-content: center; padding: 12px; font-size: 26px; background: #9be37a; }
.big.introgo.last { background: #ffe066; }
.introparents { font-size: 15px; font-weight: 700; opacity: .75; }
.introparents[hidden] { display: none; }
.icrowns { display: grid; grid-template-columns: repeat(5, min(17vw, 76px)); grid-auto-rows: min(17vw, 76px); gap: 18px 6px; padding-top: 14px; }
.icrown { display: grid; place-items: center; transition: opacity .3s, filter .3s; }
.icrown .pop { position: relative; }
.icrown.wait { opacity: .3; filter: grayscale(1); }
.icrown.cpop .pop { animation: crownpop .4s ease-out !important; }

/* Sprechblase (erklärt beim ersten Mal) */
.bubble { position: fixed; z-index: 950; max-width: min(300px, calc(100% - 20px)); padding: 10px 16px; border: 3px solid var(--ink); border-radius: 20px;
  background: #fff3b0; font-size: 18px; font-weight: 800; line-height: 1.25; text-align: center; box-shadow: var(--shadow); pointer-events: none;
  animation: bubblein .4s both cubic-bezier(.3, 1.7, .5, 1); }
.bubble[hidden] { display: none; }
.bubble::after { content: ''; position: absolute; left: calc(var(--ax, 50%) - 10px); bottom: -12px; width: 18px; height: 18px; background: #fff3b0;
  border: 3px solid var(--ink); border-top: 0; border-left: 0; transform: rotate(45deg); }
.bubble.below::after { bottom: auto; top: -12px; transform: rotate(-135deg); }
@keyframes bubblein { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Für Eltern: kurze Erklärung oben in den Einstellungen */
.parentsbox { background: #fff6d6; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 12px; margin: 0 0 12px; }
.parentsbox h4 { margin: 0 0 4px; font-size: 16px; }
.parentsbox .about { margin: 0; }

/* ---------- Kopfzeile ---------- */
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.bar h2 { margin: 0; font-size: 24px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); font-size: 26px; box-shadow: var(--shadow); flex: none; }
.per100 { font-weight: 700; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 2px 8px; }

/* ---------- Auswahl ---------- */
.pickscroll { overflow-y: auto; padding: 0 16px 24px; }
.picksearch { padding: 0 16px 12px; }
.picksearch[hidden] { display: none; }
.pickscroll h3 { margin: 14px 4px 8px; font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.tile {
  aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 22px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: var(--shadow); padding: 4px;
}
.tile:active { transform: translateY(3px); box-shadow: none; }
.tile .fi { font-size: 48px; line-height: 1; }
.tile .fn { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.1; }
.tiles.colors { grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 8px; }
.tiles.cats { grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 8px; }
.tile.cat .fi { font-size: 52px; }
.tile.cat .fn { font-size: 14px; }
.tile.color { background: var(--card); }
.blob { width: 72%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--ink); }
.fsvg { width: 1em; height: 1em; display: block; }
.dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--ink); vertical-align: -3px; }
.ti { display: inline-flex; vertical-align: -4px; }

/* ---------- Scanner ---------- */
.round.small { width: 44px; height: 44px; font-size: 20px; }
.torch[hidden] { display: none; }
.torch.on { background: #ffe066; box-shadow: 0 0 0 4px #fff3b0, var(--shadow); }
.cam { position: relative; flex: 1; min-height: 0; margin: 0 12px 12px; border: 4px solid var(--ink); border-radius: 28px; overflow: hidden; background: #2d2433; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame {
  position: absolute; left: 10%; right: 10%; top: 50%; height: 34%; transform: translateY(-50%);
  border: 5px dashed #fff; border-radius: 22px; box-shadow: 0 0 0 9999px rgba(45, 36, 51, .35); overflow: hidden;
}
.frame[hidden] { display: none; }
.laser { position: absolute; left: 6%; right: 6%; height: 4px; border-radius: 2px; background: #ff5fa2; box-shadow: 0 0 10px #ff5fa2; animation: laser 1.6s ease-in-out infinite alternate; }
.peek { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 2px; padding: 0 6px; pointer-events: none; }
.peekani { pointer-events: auto; flex: 0 1 52px; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.peekani .ani { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.peekani.hop { animation: hop .45s ease-in-out 2; }
.msgrow { display: flex; justify-content: center; gap: 4px; width: 100%; max-width: 380px; }
.msgrow .peekani { flex-basis: 48px; }
.jumping { animation: hop .6s var(--d, 0s) ease-in-out infinite; }
.scanmsg {
  position: absolute; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center;
}
.scanmsg[hidden] { display: none; }
.msgani { position: relative; width: 150px; height: 150px; }
.msgbig { position: absolute; right: -16px; top: -10px; font-size: 54px; }
.loading .msgani { animation: hop .6s ease-in-out infinite; }
.msgname { margin: 0; font-weight: 800; font-size: 18px; }
.msgtext { margin: 0; font-size: 15px; max-width: 300px; opacity: .8; }
.scanmsg .retry { flex: none; width: min(260px, 100%); margin-top: 8px; }
.codeform { display: flex; gap: 8px; padding: 0 12px 12px; }
.codeform[hidden] { display: none; }
.codeform input { flex: 1; min-width: 0; height: 48px; border: 3px solid var(--ink); border-radius: 14px; padding: 0 12px; font: inherit; font-size: 18px; }
.ok.small { width: auto; padding: 0 18px; }
.fimg { width: 1.3em; height: 1.3em; object-fit: contain; border-radius: 6px; background: #fff; }

/* ---------- Tierfeld ---------- */
.field { flex: 1; min-height: 0; display: grid; place-content: center; overflow: hidden; padding: 4px; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; }
/* Zeichnung mit dem Finger (Tiere bewegen) */
.ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 300; overflow: visible; transition: opacity 1.2s; }
.ink path { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .35; }
.ink.fade { opacity: 0; }

.cell.inshape { z-index: 250 !important; }
.field.shaped .cell:not(.inshape) { opacity: .3; }
.cell { width: var(--cell); height: var(--cell); display: grid; place-items: center; transition: opacity .3s; }
.inner {
  width: 100%; height: 100%;
  /* --mx/--my: Herumlaufen (Pixel weg vom eigenen Platz), --ix/--iy: angetippt im Raster, --t: wie lange der Weg dauert */
  transform: translate(calc(var(--dx, 0%) + var(--mx, 0px) + var(--ix, 0px)), calc(var(--dy, 0%) + var(--my, 0px) + var(--iy, 0px))) rotate(var(--r, 0deg)) scale(var(--s, 1));
  transition: transform var(--t, .5s) ease-in-out;
}
.pop { width: 100%; height: 100%; animation: pop .5s var(--d, 0s) both cubic-bezier(.3, 1.7, .5, 1); }
.raster .inner, .sorted .inner { --dx: 0%; --dy: 0%; --r: 0deg; --s: 1; }
.ani { width: 100%; height: 100%; overflow: visible; display: block; }
.field.focus .cell:not(.hop) { opacity: .12; }
.pop { position: relative; }
.crown { position: absolute; left: 50%; top: -22%; width: 60%; transform: translateX(-50%) rotate(-8deg); overflow: visible; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.cell.hop .pop { animation: hop .45s ease-in-out 3; }
/* Bewegen: Tiere wackeln leicht hin und her (mit Krone). Beim Sortieren und wenn ausgeschaltet: still. */
.field.move:not(.sorted) .pop { animation: pop .5s var(--d, 0s) both cubic-bezier(.3, 1.7, .5, 1), wig 2.4s var(--w, 0s) ease-in-out infinite; }
.field.move:not(.sorted) .cell.hop .pop { animation: hop .45s ease-in-out 3; }
/* Herumlaufen: in Laufrichtung schauen. Beim Sortieren laufen alle an ihren Platz zurück. */
.pop { scale: var(--fx, 1) 1; transition: scale .3s; }
.sorted .inner { --ix: 0px !important; --iy: 0px !important; }
.sorted .inner, .raster .inner { --mx: 0px !important; --my: 0px !important; --t: .9s !important; --fx: 1 !important; }
.sorted .pop, .raster .pop { --fx: 1 !important; }

/* Tier-Zeichnung */
.ani .b  { fill: currentColor; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.ani .d  { fill: color-mix(in srgb, currentColor 68%, #000); }
.ani .s  { stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.ani .l  { fill: color-mix(in srgb, currentColor 35%, #fff); }
.ani .dl { fill: none; stroke: color-mix(in srgb, currentColor 62%, #000); stroke-width: 3; stroke-linecap: round; }
.ani .eye { fill: var(--ink); }
.ani .ck { fill: #ff5d8a; opacity: .45; }
.ani .ln { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ani .wh { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; opacity: .7; }

/* ---------- Legende ---------- */
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 6px 8px; }
.legend[hidden] { display: none; }
.chip {
  display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 3px;
  border: 2.5px solid var(--ink); border-radius: 999px; background: var(--c); font-weight: 800; font-size: 16px;
  box-shadow: 0 3px 0 rgba(45, 36, 51, .18);
}
.chip .ca { width: 30px; height: 30px; color: var(--c); }
.chip .ci { font-size: 18px; width: 28px; height: 28px; display: grid; place-items: center; background: #fff; border-radius: 50%; }
.chip.active { outline: 3px solid var(--ink); outline-offset: 2px; }
.chip .cw { font-size: 12px; font-weight: 700; }
.vitrow { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px; padding: 0 8px 4px; min-height: 30px; }
.vlabel { font-weight: 800; font-size: 14px; }
.vgroup { display: flex; gap: 1px; padding: 3px 4px; border: 0; border-radius: 10px; background: none; }
.vgroup.active { background: #fff; box-shadow: 0 0 0 2.5px var(--ink); }
.vcr { width: 22px; height: 17px; overflow: visible; }
.vitrow.many .vcr { width: 15px; height: 12px; }
.vitrow.many .vgroup { padding: 2px 2px; }
.vitrow.many { gap: 2px 6px; }
.vnone { font-weight: 800; font-size: 14px; opacity: .6; }
.vest { font-weight: 800; font-size: 16px; opacity: .55; padding: 0 3px; }
.gear.inbar { position: static; }
.prev { position: relative; width: 52px; height: 52px; font-size: 26px; display: grid; place-items: center; padding: 0; }
.prev[hidden] { display: none; }
.prev .pi { display: grid; place-items: center; line-height: 1; }
.prev .pi .fsvg, .prev .pi .fimg { width: 30px; height: 30px; }
.prev .px { position: absolute; right: -6px; bottom: -6px; font-size: 13px; font-weight: 800; background: #ffe066; border: 2px solid var(--ink); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.about { font-size: 14px; margin: 0 0 8px; line-height: 1.35; }

/* ---------- Aktionen ---------- */
.actions { display: flex; gap: 12px; padding: 8px 16px 14px; }
.act {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 60px; border: 3px solid var(--ink); border-radius: 20px; background: var(--card);
  font-size: 18px; font-weight: 800; box-shadow: var(--shadow); white-space: nowrap; padding: 0 8px;
}
.act span { font-size: 28px; }
.act:active { transform: translateY(3px); box-shadow: none; }
/* Knöpfe unten: Bild oben, Wort darunter */
.actions { gap: 6px; padding: 8px 8px 14px; }
.act { flex-direction: column; gap: 0; height: 64px; font-size: 12px; padding: 0 2px; min-width: 0; border-radius: 18px; line-height: 1.1; }
.act span { font-size: 26px; line-height: 1.1; }
.act.on { background: #fff3b0; }
.act.hop span { animation: hop .45s ease-in-out 2; }

/* ---------- Favoriten und Zuletzt gesehen ---------- */
.big.favs { background: #ffc6dd; }
.favbtn.on { background: #ffd6e6; }
.favbtn.hop { animation: hop .45s ease-in-out 2; }
.fimg { object-fit: contain; }
.tile .fi .fimg { width: 1em; height: 1em; display: block; }
.empty { text-align: center; font-size: 20px; font-weight: 700; padding-top: 40px; }
.empty .msgani { width: 120px; height: 120px; margin: 0 auto; }
.empty .msgani .ani { width: 100%; height: 100%; }

/* ---------- Startknöpfe nebeneinander ---------- */
.smallrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.big.small { flex-direction: column; gap: 0; padding: 8px 6px; font-size: 19px; }
.big.small .bigicon { font-size: 36px; }
.big.day { background: #ffb37a; }

/* ---------- Mein Tag ---------- */
.dayscroll { display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; }
.dayscroll > * { flex-shrink: 0; }
.dayq { margin: 0; font-size: 22px; font-weight: 800; text-align: center; }
.daysearch { width: 100%; height: 54px; border: 3px solid var(--ink); border-radius: 18px; padding: 0 16px; font: inherit; font-size: 20px; font-weight: 700; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.dayhits:empty { display: none; }
.dayhits { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.dayhits .tile .fi { font-size: 38px; }
.dayadd { display: flex; gap: 10px; }
.dayadd .act { height: 60px; font-size: 15px; }
.daylist { display: flex; flex-direction: column; gap: 8px; }
.dayempty { text-align: center; opacity: .65; font-weight: 700; margin: 4px 0; }
.dayitem { display: flex; align-items: center; gap: 8px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 6px 6px 6px 10px; box-shadow: var(--shadow); }
.dicon { font-size: 26px; display: grid; place-items: center; width: 30px; flex: none; }
.dicon .fsvg, .dicon .fimg { width: 28px; height: 28px; }
.dopen { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.dname { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; line-height: 1.1; overflow-wrap: anywhere; }
.dsize { display: flex; gap: 3px; align-items: center; flex: none; }
.dsz { width: 38px; height: 38px; border-radius: 12px; border: 2px solid transparent; background: #f4efe6; display: grid; place-items: center; padding: 0; font-size: var(--px); line-height: 1; opacity: .55; }
.dsz .fsvg, .dsz .fimg { width: var(--px); height: var(--px); }
.dsz.on { border-color: var(--ink); background: #ffe066; opacity: 1; }
.ddel { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; font-size: 16px; opacity: .5; padding: 0; flex: none; }
.big.dayok { background: #ffe066; flex-direction: row; justify-content: center; gap: 10px; padding: 12px; font-size: 22px; }
.big.dayok .bigicon { font-size: 34px; }
.big.dayok[hidden] { display: none; }
.dayadd[hidden] { display: none; }
.dayitem.ro { cursor: pointer; }
.dayitem .dlabel { font-size: 13px; font-weight: 700; opacity: .7; padding-right: 6px; }
.dayresult { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 8px; }
.daycard { display: flex; gap: 10px; align-items: flex-start; border: 3px solid var(--ink); border-radius: 20px; padding: 10px; background: var(--card); box-shadow: var(--shadow); }
.daycard.good { background: #eaffdf; }
.daycard.more { background: #fff6d6; }
.dani { position: relative; width: 84px; height: 84px; flex: none; margin-top: 10px; }
.daycard.good .dani { animation: hop .6s ease-in-out 3; }
.daycard.more .dani:not(.fill) svg, .dani .dgray svg { opacity: .3; filter: grayscale(1); } /* fehlt noch: Tier ausgegraut wie eine fehlende Krone */
.dlayer { position: absolute; inset: 0; }
.dani .ani { width: 100%; height: 100%; overflow: visible; }
.dbadge { position: absolute; right: -10px; bottom: -6px; font-size: 34px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.dtext { flex: 1; min-width: 0; }
.dtext h4 { margin: 0 0 4px; font-size: 19px; }
/* Zahl der gesammelten Kronen (0–10), groß neben der Überschrift */
.dcount { float: right; min-width: 52px; height: 52px; margin: -4px 0 4px 8px; padding: 0 8px; border: 3px solid var(--ink); border-radius: 16px; background: #ffd84a; font-size: 34px; line-height: 46px; text-align: center; }
.dtext p { margin: 6px 0 0; font-weight: 700; font-size: 15px; line-height: 1.25; }
.dbar { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.dbar span { display: block; height: 100%; }
.dcrowns { display: flex; gap: 4px; flex-wrap: wrap; }
.dcrowns .miss { opacity: .25; filter: grayscale(1); }
.dcrowns .vcr { width: 26px; height: 20px; }
.dcrowns .dbreak { flex-basis: 100%; height: 0; }
/* Kronen zählen: erst blass, dann leuchtet eine nach der anderen auf */
.dcrowns .got.wait { opacity: .25; filter: grayscale(1); }
.dcrowns .got.cpop, .dcount.cpop { animation: crownpop .35s ease-out; }
@keyframes crownpop { 0% { transform: scale(.6); } 60% { transform: scale(1.45); } 100% { transform: scale(1); } }
/* Alle 10 Kronen: Kronen-Regen */
.crownrain { position: fixed; inset: 0; pointer-events: none; z-index: 900; overflow: hidden; }
.crownrain span { position: absolute; top: -40px; animation: crownfall 1.8s ease-in forwards; }
.crownrain .vcr { width: 34px; height: 26px; }
@keyframes crownfall { to { transform: translateY(calc(100vh + 80px)) rotate(var(--r)); } }
.dfrom { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 8px; font-size: 13px; font-weight: 700; }
.dfl { width: 100%; font-weight: 800; }
.dvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; width: 100%; }
.dvfrom { display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 4px 8px; }
.dvfrom .vcr { width: 30px; height: 23px; flex: none; }
.dvpic { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; font-size: 28px; flex: none;
  border: 0; background: none; padding: 0; }
.dvpic > * { width: 100%; height: 100%; object-fit: contain; }
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.tile.tip { position: relative; padding: 4px 2px; min-width: 0; overflow-wrap: break-word; }
.tile.tip .fi { font-size: 34px; }
.tile.tip .fn { font-size: 11px; }
.vmiss { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: center; margin-top: 8px; }
.vmname { display: flex; flex-direction: column; align-items: center; text-align: center; font-weight: 800; font-size: 12px; line-height: 1.1; }
.vmname .vcr { width: 34px; height: 26px; }

/* ---------- Kurze Meldung ---------- */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000;
  background: var(--ink); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 999px; max-width: calc(100% - 32px); text-align: center; }
.toast[hidden] { display: none; }

/* ---------- Einstellungen ---------- */
dialog { border: 3px solid var(--ink); border-radius: 20px; padding: 16px 20px; max-width: 360px; width: calc(100% - 32px); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(45, 36, 51, .4); }
dialog h3 { margin: 0 0 8px; }
.reportcancel { text-align: center; margin: 8px 0 0; }
.linkbtn { background: none; border: 0; padding: 4px 8px; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0 0 10px; }
fieldset legend { font-weight: 800; margin-bottom: 2px; }
fieldset label { display: block; padding: 3px 0; }
.hint { font-size: 13px; opacity: .75; }
.avoid .sub { font-weight: 800; font-size: 14px; margin: 8px 0 0; opacity: .8; }
.avoid summary { cursor: pointer; padding: 3px 0; font-weight: 700; }
.warn { margin: 0 12px 4px; padding: 6px 10px; border: 3px solid var(--ink); border-radius: 14px; background: #ffe9a8;
  font-weight: 800; font-size: 15px; line-height: 1.3; }
.warn.soft { background: #fff; font-weight: 700; }
.warn small { display: block; font-weight: 400; font-size: 12px; opacity: .75; }
.ok { width: 100%; height: 48px; border: 3px solid var(--ink); border-radius: 14px; background: #9be37a; font-weight: 800; font-size: 18px; }

/* ---------- Animationen ---------- */
@keyframes laser { from { top: 10%; } to { top: 86%; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes wig { 0%, 100% { rotate: 0deg; } 25% { rotate: -6deg; } 75% { rotate: 6deg; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-25%) scale(1.1); } }

@media (prefers-reduced-motion: reduce) {
  .pop { animation: none !important; }
}

/* Sprachen: bis die Texte da sind nichts zeigen; lange Wörter trennen */
html.loading body { visibility: hidden; }
.tile .fn, .act b, .dname { hyphens: auto; overflow-wrap: anywhere; }
.act b { font-weight: inherit; display: block; max-width: 100%; min-width: 0; text-align: center; white-space: normal; }
.sel { display: block; width: 100%; height: 40px; border: 3px solid var(--ink); border-radius: 12px; background: #fff;
  font: inherit; font-weight: 700; padding: 0 8px; color: var(--ink); }
.selrow { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.selrow[hidden], .ok.test[hidden] { display: none !important; }
.ok.test { height: 40px; font-size: 15px; margin-top: 4px; background: #fff; }

/* Zurück-Wischen vom linken Rand: Pfeil kommt mit dem Finger herein */
#swipeBack { position: fixed; left: -48px; top: 50%; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 22px; background: var(--card); border: 3px solid var(--ink); box-shadow: var(--shadow); pointer-events: none; z-index: 1000;
  opacity: 0; transform: translate(var(--sx, 0px), -50%); transition: opacity .15s, background .15s; }
#swipeBack.ready { background: #9be37a; }
