/* Meine Horchwelt Tonie-Finder – Regalbretter für die Figuren, Farben und Schrift aus dem Meine Horchwelt-Logo. */
:root {
  color-scheme: light;
  --wall: #FFFCF7;
  --wall-deep: #F1EADC;
  --paper: #FFFFFF;
  --ink: #1B2A4A;
  --ink-soft: #4A5677;
  --rule: #E6E1D6;
  --wood: #C87838;
  --wood-top: #DE9A5C;
  --wood-shade: #8E4F22;
  --mustard: #F8AE28;
  --mustard-ink: #1B2A4A;
  --leaf: #2F8F6B;
  --alert: #C2412D;

  --c-music: #D9577F; --c-adventure: #2F8F6E; --c-animals: #C27A1E; --c-dinos: #5E8F2E;
  --c-vehicles: #2F6FBF; --c-heroes: #C7412E; --c-movies: #4357B8; --c-fairy: #9A55B8;
  --c-stories: #1C8A92; --c-knowledge: #5A6478; --c-sleep: #6B5CC4;

  --serif: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 4.4vw, 3.25rem);
  --step-4: clamp(2.6rem, 7vw, 5.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--sans);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap {
  max-width: 1180px; margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; text-wrap: balance; }

/* ---------- Kopf ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.brand img { display: block; height: 44px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.top-link { white-space: nowrap; font-weight: 700; text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ink); }
.top-link:hover { background: var(--ink); color: var(--wall); }

/* ---------- Hero mit oberem Regal ---------- */
.hero { padding-block: 28px 8px; }
.hero h1 { font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.01em; max-width: 13ch; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 46ch; margin: 22px 0 0; }
.topshelf { margin: 40px 0 0; }
.topshelf-figures { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 230px; padding-inline: 2%; }
.topshelf-figures button { flex: 1 1 0; min-width: 0; height: 100%; max-width: 160px; border: 0; padding: 0; background: none; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; }
.topshelf-figures img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 6px 4px rgb(31 37 68 / .22)); transform-origin: 50% 100%; transition: transform .2s ease; }
.topshelf-figures button:hover img, .topshelf-figures button:focus-visible img { transform: translateY(-6px); }
.topshelf-figures .ghost { flex: 1 1 0; max-width: 160px; height: 60%; border-radius: 48% 48% 10px 10px; background: var(--wall-deep); }
.topshelf figcaption { margin-top: 12px; font-size: var(--step--1); color: var(--ink-soft); text-align: right; }
@media (max-width: 640px) {
  .topshelf-figures { height: 160px; }
  .topshelf-figures > :nth-child(n+5) { display: none; }
}
/* Der eine inszenierte Moment: die Figuren fallen beim Laden aufs Regal */
.topshelf-figures.loaded img { animation: drop .7s cubic-bezier(.25, 1.4, .5, 1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes drop { from { transform: translateY(-46px); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }

/* Holzbrett: Oberkante hell, Vorderkante dunkler, Schatten an der Wand */
.plank {
  height: 16px; border-radius: 3px;
  background: linear-gradient(var(--wood-top) 0 5px, var(--wood) 5px calc(100% - 2px), var(--wood-shade) calc(100% - 2px));
  box-shadow: 0 10px 14px -8px rgb(31 37 68 / .35);
}

/* ---------- Finder: Fragen links, Regal rechts ---------- */
main { padding-block: 56px 80px; display: flex; flex-direction: column; gap: 72px; }
.finder { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 920px) { .finder { grid-template-columns: minmax(0, 1fr); } }
.quiz {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px);
  max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 24px;
}
@media (max-width: 920px) { .quiz { position: static; max-height: none; overflow: visible; } }
.example { margin: 0; font-size: var(--step--1); color: var(--leaf); font-weight: 700; }
.q { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.q-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; padding: 0; margin-bottom: 4px; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.25; }
.q-title small { font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); }
.agepick { display: flex; align-items: center; gap: 12px; }
.agepick output { font-family: var(--serif); font-size: 2.75rem; line-height: 1; min-width: 1.4ch; text-align: center; font-variant-numeric: tabular-nums; }
.agepick span { color: var(--ink-soft); }
.agepick input[type=range] { flex: 1; min-width: 0; accent-color: var(--wood); height: 28px; cursor: pointer; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; }
.tile span { flex: 1; }
.tile input, .pill input { position: absolute; opacity: 0; pointer-events: none; }
.tile span {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 14px; cursor: pointer;
  background: var(--wall); border: 2px solid transparent; font-weight: 700; font-size: var(--step--1); line-height: 1.2;
  transition: background .15s, color .15s;
}
.tile span::before { content: ""; width: 12px; height: 12px; border-radius: 4px; flex: none; background: var(--c); }
.tile span:hover { border-color: var(--c); }
.tile input:checked + span { background: var(--c); color: #fff; }
.tile input:checked + span::before { background: #fff; }
.tile input:disabled + span { opacity: .4; cursor: default; border-color: transparent; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill span { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--wall); border: 2px solid transparent; font-weight: 700; font-size: var(--step--1); cursor: pointer; }
.pill span:hover { border-color: var(--ink); }
.pill input:checked + span { background: var(--ink); color: var(--paper); }
.tile input:focus-visible + span, .pill input:focus-visible + span { outline: 3px solid var(--mustard); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--leaf); flex: none; }
.check.small { font-weight: 400; font-size: var(--step--1); }
.hint { margin: 0; color: var(--alert); font-size: var(--step--1); max-width: 60ch; }

/* ---------- Ergebnisse als Regal ---------- */
.results { display: flex; flex-direction: column; gap: 28px; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.results-head h2 { font-size: var(--step-3); line-height: 1.05; }
.results-head p { margin: 8px 0 0; color: var(--ink-soft); }
.sort { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.sort button { border: 0; background: none; padding: 4px 0; cursor: pointer; font-weight: 700; color: var(--ink-soft); border-bottom: 3px solid transparent; }
.sort button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--mustard); }

.shelf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); column-gap: 0; row-gap: 44px; }
.results-head h2 { font-size: var(--step-2); }
@media (max-width: 460px) { .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot { display: flex; flex-direction: column; padding-inline: 14px; min-width: 0; }
.slot .figure { position: relative; height: 210px; border: 0; padding: 0 0 2px; background: none; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; }
.slot .figure img { max-height: 190px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 6px 4px rgb(31 37 68 / .2)); transition: transform .18s ease; }
.slot .figure:hover img, .slot .figure:focus-visible img { transform: translateY(-5px); }
.slot .plank { margin-inline: -14px; border-radius: 0; }
.shelf-grid .slot:first-child .plank { border-radius: 3px 0 0 3px; }
.tag { padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.tag h3 { font-size: 1.1875rem; line-height: 1.22; overflow-wrap: break-word; hyphens: auto; }
.tag h3 button { all: unset; cursor: pointer; }
.tag h3 button:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tag h3 button:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
.tag .series { font-size: var(--step--1); color: var(--ink-soft); }
.tag .facts { font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tag .fit { color: var(--ink); font-weight: 700; }
.tag .topics { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--step--1); font-weight: 700; }
.tag .topics span { display: inline-flex; align-items: center; gap: 5px; }
.tag .topics span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.buy { margin-top: 8px; align-self: flex-start; font-weight: 700; font-size: var(--step--1); text-decoration: none; padding: 7px 13px; border-radius: 999px; background: var(--mustard); color: var(--mustard-ink); }
.buy:hover { background: var(--ink); color: var(--wall); }
.slot .buy { white-space: nowrap; }
@media (max-width: 460px) {
  .slot { padding-inline: 10px; }
  .slot .plank { margin-inline: -10px; }
  .slot .buy { padding: 6px 11px; font-size: 0.8125rem; }
  .brand img { height: auto; width: 150px; max-width: 45vw; }
}

.stickers { position: absolute; left: 0; top: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sticker { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper); color: var(--ink); }
.sticker.best { background: var(--mustard); color: var(--mustard-ink); }
.sticker.new { background: var(--leaf); color: #fff; }
.sticker.xmas { background: #B8312F; color: #fff; }
.sticker.out, .sticker.last { background: var(--ink); color: var(--wall); }

.empty { grid-column: 1 / -1; background: var(--paper); border-radius: 18px; padding: 28px; max-width: 60ch; }
.empty strong { font-family: var(--serif); font-weight: 400; font-size: var(--step-1); display: block; margin-bottom: 6px; }
.ghost-slot { height: 260px; border-bottom: 16px solid var(--wall-deep); margin-inline: 14px; }
.more { align-self: flex-start; border: 2px solid var(--ink); background: none; border-radius: 999px; padding: 12px 22px; font-weight: 700; cursor: pointer; }
.more:hover { background: var(--ink); color: var(--wall); }

/* Hinweis auf die Toniebox */
.boxnote { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; background: var(--paper); border-radius: 18px; padding: 20px 24px; }
.boxnote h3 { font-size: var(--step-1); }
.boxnote p { margin: 4px 0 0; color: var(--ink-soft); max-width: 55ch; }
.toniebox { width: 64px; height: 56px; position: relative; margin-top: 10px; }
.toniebox::before { content: ""; position: absolute; inset: 8px 0 0; border-radius: 10px; background: #D4483B; box-shadow: inset 0 -6px 0 rgb(0 0 0 / .14); }
.toniebox::after { content: ""; position: absolute; top: 0; left: 12px; width: 10px; height: 14px; border-radius: 6px 6px 2px 2px; background: #9A9AA6; box-shadow: 30px 0 0 #9A9AA6; }
@media (max-width: 620px) { .boxnote { grid-template-columns: minmax(0, 1fr); } .toniebox { display: none; } }

/* ---------- Newsletter ---------- */
.letter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 48px; align-items: start; border-top: 2px solid var(--ink); padding-top: 36px; }
@media (max-width: 820px) { .letter { grid-template-columns: minmax(0, 1fr); } }
.letter h2 { font-size: var(--step-2); line-height: 1.15; }
.letter-text p { color: var(--ink-soft); margin: 12px 0 0; max-width: 46ch; }
.letter-form { display: flex; flex-direction: column; gap: 14px; }
.letter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.letter-row input { flex: 1 1 220px; min-width: 0; padding: 13px 16px; border-radius: 999px; border: 2px solid var(--rule); background: var(--paper); }
.letter-row input:focus { border-color: var(--ink); outline: none; }
.letter-row button { padding: 13px 22px; border-radius: 999px; border: 0; background: var(--ink); color: var(--wall); font-weight: 700; cursor: pointer; }
.letter-row button:disabled { opacity: .6; cursor: default; }
.letter-msg { margin: 0; min-height: 1.4em; font-weight: 700; }
.letter-msg.ok { color: var(--leaf); }
.letter-msg.err { color: var(--alert); }

/* ---------- Fuß ---------- */
.foot { padding-block: 36px 48px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; font-size: var(--step--1); color: var(--ink-soft); }
.foot p { margin: 0; max-width: 80ch; }
.foot img { height: 40px; width: auto; align-self: flex-start; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 700; color: var(--ink); }

/* ---------- Detailansicht als Seitenblatt ---------- */
.sheet {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw;
  border: 0; padding: 0; background: var(--wall); color: var(--ink); overflow: hidden;
}
.sheet[open] { animation: slidein .28s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: rgb(23 28 46 / .55); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 640px) {
  .sheet { margin: auto 0 0; width: 100vw; height: auto; max-height: 92dvh; border-radius: 22px 22px 0 0; }
  .sheet[open] { animation-name: slideup; }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
}
.sheet-body { height: 100%; max-height: inherit; overflow: auto; padding: 22px max(24px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) 24px; display: flex; flex-direction: column; gap: 20px; }
.sheet-close { align-self: flex-end; border: 0; background: var(--paper); border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.sheet-stage { position: relative; }
.sheet-stage .figure-wrap { height: 260px; display: flex; align-items: flex-end; justify-content: center; }
.sheet-stage img { max-height: 250px; object-fit: contain; filter: drop-shadow(0 8px 6px rgb(31 37 68 / .22)); }
.sheet h2 { font-size: var(--step-3); line-height: 1.05; }
.sheet .series { color: var(--ink-soft); margin: 0 0 6px; }
.facts-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; margin: 0; padding: 16px 0; border-block: 1px solid var(--rule); }
.facts-list dt { color: var(--ink-soft); }
.facts-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet .desc { white-space: pre-line; margin: 0; max-width: 62ch; }
.sheet details { border-top: 1px solid var(--rule); padding-top: 12px; }
.sheet summary { cursor: pointer; font-weight: 700; }
.sheet details ol { margin: 10px 0 0; padding-left: 22px; color: var(--ink-soft); font-size: var(--step--1); }
.sheet details p { margin: 10px 0 0; color: var(--ink-soft); font-size: var(--step--1); white-space: pre-line; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-actions a { flex: 1 1 200px; text-align: center; padding: 13px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid var(--ink); }
.sheet-actions a.primary { background: var(--mustard); border-color: var(--mustard); color: var(--mustard-ink); }
.sheet .fine { font-size: 0.8125rem; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Handy: Knopf oben rechts darf umbrechen statt aus dem Bild zu laufen */
@media (max-width: 520px) {
  .top-link { white-space: normal; text-align: center; line-height: 1.15; max-width: 11rem; font-size: .85rem; }
}
