/* ============================================================
   Senioren-Tablet – Designsystem v2
   Ruhig, warm, kontrastreich. Große Ziele (min. 64 px),
   Signale nie nur über Farbe, Fokusringe deutlich.
   ============================================================ */

:root {
  --paper: #f3f1ec;
  --card: #fffefb;
  --ink: #222831;
  --muted: #5d6570;
  --line: #ddd7cb;

  --accent: #2e5079;
  --accent-ink: #223d5c;
  --accent-soft: #e9edf2;

  /* Gedeckte, erwachsene Funktionsfarben (nur für Icons, nicht als Bonbon-Flächen) */
  --green: #3e6b54;      --green-soft: #efece3;
  --plum: #5d5470;       --plum-soft: #efece3;
  --teal: #3f6b70;       --teal-soft: #efece3;
  --amber: #8a6a2f;      --amber-soft: #efece3;
  --rust: #8a5540;       --rust-soft: #efece3;
  --red: #a9433c;        --red-soft: #f4e6e4;

  --serif: "New York", "Georgia", "Times New Roman", serif;
  --radius: 18px;
  --shadow: 0 8px 26px rgba(34, 40, 49, 0.07);
  --shadow-soft: 0 3px 12px rgba(34, 40, 49, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 23px; }

body {
  font-family: "Avenir Next", "Avenir", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 85% -100px, #ebe6db 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: -0.01em; line-height: 1.22; font-family: var(--serif); font-weight: 600; }
.home-head .clock, .screen-title, .hero .greeting, .dialog h2 { font-family: var(--serif); font-weight: 600; }

/* ---------- Icons ---------- */
.ic {
  width: 1.25em; height: 1.25em;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; vertical-align: -0.28em;
}
.ic .f { fill: currentColor; stroke: none; }
.ic-lg { width: 2.1em; height: 2.1em; }

/* ---------- Buttons ---------- */
button {
  font-family: inherit; font-size: 1rem; cursor: pointer;
  border: none; border-radius: 16px; min-height: 66px;
  padding: 0.55rem 1.3rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-weight: 600; color: var(--ink); background: var(--card);
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button:active { transform: scale(0.985); }
button:focus-visible { outline: 4px solid rgba(46, 92, 138, 0.55); outline-offset: 3px; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(46,92,138,0.28); }
.btn-primary:active { background: var(--accent-ink); }
.btn-ghost { background: var(--card); color: var(--accent-ink); border: 2px solid var(--accent); }
.btn-quiet { background: transparent; color: var(--accent-ink); box-shadow: none; }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(169,67,60,0.28); }
.btn-lg { font-size: 1.12rem; min-height: 82px; padding: 0.7rem 1.6rem; }
.btn-block { width: 100%; }
button:disabled { opacity: 0.45; cursor: default; }

.btn-row { display: flex; gap: 0.9rem; margin-top: 1.1rem; flex-wrap: wrap; }
.btn-row > button { flex: 1; min-width: 210px; }

/* ---------- Demo-Kennzeichnung ---------- */
.demo-pill {
  position: fixed; top: 14px; right: 16px; z-index: 60;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--amber); background: var(--amber-soft);
  border: 1.5px solid #d8c48a; border-radius: 999px; padding: 3px 14px;
}
.tag {
  display: inline-flex; align-items: center; gap: 0.3em;
  border-radius: 999px; padding: 2px 12px;
  font-size: 0.72rem; font-weight: 700;
  background: var(--amber-soft); color: var(--amber); border: 1.5px solid #d8c48a;
}
.tag.ok { background: var(--green-soft); color: var(--green); border-color: #a9c9b7; }
.tag.info { background: var(--accent-soft); color: var(--accent-ink); border-color: #b7c9dc; }

.offline-banner {
  display: none;
  background: var(--amber-soft); border: 2px solid #d8c48a; color: #5c4a14;
  border-radius: 16px; margin: 0.8rem 1.4rem 0; padding: 0.7rem 1.1rem; font-size: 0.95rem;
}
.offline-banner.show { display: block; }

/* ---------- Ansichten ---------- */
.screen { display: none; }
.screen.active { display: block; }

/* ---------- Kopfbereiche ---------- */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem 0.6rem; padding-right: 130px;
}
.topbar .screen-title { font-size: 1.45rem; font-weight: 700; flex: 1; }
.btn-home {
  background: var(--card); color: var(--accent-ink);
  border: 1.5px solid var(--line); box-shadow: var(--shadow-soft);
  font-size: 1rem; min-height: 70px; padding: 0.5rem 1.3rem;
}

.content { padding: 0.6rem 1.5rem 2.2rem; }

/* ---------- Startseite ---------- */
.home-head {
  display: flex; align-items: baseline; gap: 1.2rem;
  padding: 1.4rem 1.6rem 0.4rem; padding-right: 120px;
}
.home-head .clock { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; }
.home-head .date { font-size: 1rem; color: var(--muted); }

.hero {
  display: flex; align-items: center; gap: 1.6rem;
  background: linear-gradient(135deg, #ffffff 0%, #fbf8f1 100%);
  border: 1.5px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
  margin: 0.6rem 1.5rem 1.3rem; padding: 1.1rem 1.7rem;
}
.hero .greeting { font-size: 1.5rem; font-weight: 700; }
.hero .hint { color: var(--muted); font-size: 0.98rem; margin-top: 0.25rem; max-width: 34ch; }
.hero .spacer { flex: 1; }

.tiles {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem; padding: 0 1.5rem 1.8rem;
}
.tile {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  min-height: 185px; flex-direction: column; gap: 0.75rem;
  font-size: 1.02rem; font-weight: 650; text-align: center; padding: 1rem;
}
.tile:hover, .tile:active { border-color: var(--accent); box-shadow: var(--shadow); }

/* Bild-Kacheln (Stillleben/Aquarell aus Higgsfield): Bild bleibt VOLLSTÄNDIG
   sichtbar, das Label steht darunter auf ruhiger Karte. */
.tile.tile-bild { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.tile.tile-bild .tile-bildwrap { display: block; width: 100%; aspect-ratio: 16 / 10; }
.tile.tile-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.tile-bild .tile-label {
  display: flex; align-items: center; justify-content: center; flex: 1;
  border-top: 1px solid var(--line); background: var(--card);
  padding: 0.75rem 0.7rem; font-size: 1.05rem; line-height: 1.3; min-height: 76px;
}
.tile.tile-bild.bild-fehlt .tile-bildwrap { display: none; }

/* Der Begrüßungsbereich IST der Sprech-Knopf */
.hero.hero-sprechen { width: calc(100% - 3rem); cursor: pointer; border: 1.5px solid var(--line); }
.hero.hero-sprechen:hover, .hero.hero-sprechen:active { border-color: var(--accent); box-shadow: var(--shadow); }
.hero-hinweis {
  margin-top: 0.7rem; font-weight: 700; color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 1.1rem;
  background: var(--accent-soft); border-radius: 999px; padding: 0.4rem 1.1rem;
}
.tile .chip {
  width: 74px; height: 74px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
}
.tile .chip .ic { width: 40px; height: 40px; }
/* Einheitlich ruhige Sand-Fläche, Funktion nur über die Icon-Farbe erkennbar —
   allein die Hilfe behält bewusst ihre rote Signalfläche. */
.chip { border: 1px solid #e2dccf; }
.chip.c-accent { background: var(--accent-soft); color: var(--accent); }
.chip.c-green  { background: var(--green-soft);  color: var(--green); }
.chip.c-amber  { background: var(--amber-soft);  color: var(--amber); }
.chip.c-plum   { background: var(--plum-soft);   color: var(--plum); }
.chip.c-teal   { background: var(--teal-soft);   color: var(--teal); }
.chip.c-rust   { background: var(--rust-soft);   color: var(--rust); }
.chip.c-red    { background: var(--red-soft);    color: var(--red); border-color: #e3c4c0; }

/* ---------- Karten ---------- */
.card {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.3rem; margin-bottom: 1rem;
}
.card h3 { font-size: 1.12rem; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.muted { color: var(--muted); font-size: 0.9rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.status-box {
  border-radius: 16px; padding: 1rem 1.2rem; margin: 0.8rem 0;
  font-size: 1.02rem; border: 2px solid #a9c9b7; background: var(--green-soft);
  display: flex; gap: 0.7rem; align-items: flex-start;
}
.status-box .ic { margin-top: 0.15em; color: var(--green); }
.status-box.warn { border-color: #d8c48a; background: var(--amber-soft); }
.status-box.warn .ic { color: var(--amber); }

/* ---------- Avatar ---------- */
.avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.avatar-svg { width: 128px; height: 128px; filter: drop-shadow(0 6px 12px rgba(38,48,59,0.12)); }
.avatar-svg.small { width: 92px; height: 92px; }
/* Beim Sprechen atmet der Orb ruhig — kein Hüpfen. */
.speaking .avatar-svg { animation: atmen 1.6s ease-in-out infinite; }
@keyframes atmen { 0%,100% { transform: scale(1);} 50% { transform: scale(1.045);} }
.avatar-svg .orb-ring-a { animation: ring-puls 4.5s ease-in-out infinite; transform-origin: center; }
@keyframes ring-puls { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }

/* ---------- Begleiter / Chat ---------- */
.chat-wrap { display: flex; gap: 1.5rem; align-items: flex-start; }
.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 62vh; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 1rem; }
.bubble {
  max-width: 78%; border-radius: 18px; padding: 0.75rem 1.05rem; font-size: 1.02rem;
  box-shadow: var(--shadow-soft);
}
.bubble.assistant { background: var(--card); border: 1.5px solid var(--line); align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.user { background: var(--accent-soft); border: 1.5px solid #c9d8e8; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble.typing { color: var(--muted); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.chips button { flex: 1 1 40%; min-height: 70px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow-soft); font-weight: 600; }
.chips button:hover { border-color: var(--accent); }
.provider-note { margin-top: 0.7rem; font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }

/* ---------- Kontakte ---------- */
.contact-card { display: flex; align-items: center; gap: 1.1rem; }
.pers {
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em;
  position: relative; flex-shrink: 0;
}
.pers .presence {
  position: absolute; right: 1px; bottom: 1px; width: 18px; height: 18px;
  border-radius: 50%; border: 3px solid #fff; background: #b9c1c9;
}
.pers .presence.online { background: #3a9d6c; }
.contact-card .info { flex: 1; min-width: 0; }
.contact-card .name { font-size: 1.18rem; font-weight: 700; }
.contact-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-actions button { min-height: 60px; font-size: 0.92rem; justify-content: flex-start; }

/* ---------- Feed ---------- */
.feed-item { display: flex; gap: 1rem; align-items: flex-start; }
.feed-item .chip { width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-item .chip .ic { width: 30px; height: 30px; }

/* ---------- Einkauf ---------- */
.product-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; }
.product-card .chip { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; }
.product-card .chip .ic { width: 34px; height: 34px; }
.product-card .p-name { font-weight: 700; font-size: 1.05rem; }
.product-card .p-price { font-weight: 700; font-size: 1.1rem; margin-top: 0.15rem; }
.product-card .p-meta { font-size: 0.82rem; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.55rem; }
.qty button {
  min-width: 64px; min-height: 60px; border-radius: 16px;
  background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent-ink);
}
.qty .n { font-size: 1.25rem; font-weight: 700; min-width: 2rem; text-align: center; }

.cart-bar {
  position: sticky; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px);
  border-top: 2px solid var(--accent);
  padding: 0.8rem 1.5rem; margin: 0 -1.5rem;
  display: flex; align-items: center; gap: 1rem; font-size: 1.05rem; font-weight: 700;
}

/* ---------- Termine ---------- */
.timeline-item { display: flex; gap: 1rem; align-items: flex-start; }
.time-badge {
  min-width: 120px; text-align: center; font-weight: 700; font-size: 1.05rem;
  background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 14px; padding: 0.5rem 0.6rem;
}

/* ---------- Fotos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.photo-card { padding: 0; overflow: hidden; cursor: pointer; border-radius: var(--radius); }
.photo-card img { width: 100%; height: 230px; object-fit: cover; display: block; }
.photo-card .ph-caption { padding: 0.8rem 1rem; }
.photo-card .ph-title { font-weight: 700; font-size: 1.02rem; }

.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(24, 30, 38, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem; gap: 1rem;
}
.lightbox img { max-width: 82vw; max-height: 62vh; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox .lb-caption { color: #f2eee4; text-align: center; max-width: 56ch; font-size: 1.05rem; }
.lightbox .lb-title { font-weight: 700; font-size: 1.25rem; margin-bottom: 0.2rem; }
.lightbox .lb-meta { color: #b8c0c9; font-size: 0.85rem; margin-top: 0.3rem; }

/* ---------- Spiele ---------- */
.game-hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.game-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.6rem; padding: 1.6rem 1.2rem; }

/* Spiel-Karten mit Bildkopf (Stillleben/Aquarell aus Higgsfield) */
.game-card-bild { padding-top: 0; overflow: hidden; }
.game-card-bild .game-bild {
  width: calc(100% + 2.4rem); margin: 0 -1.2rem 0.4rem;
  height: 190px; object-fit: cover; display: block;
  border-bottom: 1px solid var(--line);
}

.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 720px; margin: 0 auto; }
.mem-card { perspective: 600px; aspect-ratio: 1; background: none; border: none; padding: 0; min-height: 0; }
.mem-inner { position: relative; width: 100%; height: 100%; transition: transform 0.4s; transform-style: preserve-3d; }
.mem-card.open .mem-inner, .mem-card.done .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 18px; display: flex; align-items: center; justify-content: center;
}
.mem-front {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: rgba(255,255,255,0.75);
}
.mem-front .ic { width: 34px; height: 34px; opacity: 0.5; }
.mem-back { background: var(--card); border: 2px solid var(--line); transform: rotateY(180deg); }
.mem-back .ic { width: 52px; height: 52px; }
.mem-card.done .mem-back { background: var(--green-soft); border-color: #a9c9b7; }

/* Städte-Memory: Aquarell-Karten (Higgsfield), Hochformat 3:4 */
.memory-grid.staedte { grid-template-columns: repeat(4, 1fr); max-width: 860px; }
.memory-grid.staedte .mem-card { aspect-ratio: 3 / 4; }
.memory-grid.staedte .mem-face { overflow: hidden; }
.memory-grid.staedte .mem-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.memory-grid.staedte .mem-front { background: none; border: 2px solid var(--line); }
.memory-grid.staedte .mem-card.done .mem-back { outline: 4px solid var(--green); outline-offset: -4px; }

/* Clara als Spielpartnerin (Ecke oben rechts im Spielfeld) */
#game-area .card { position: relative; }
.clara-ecke {
  position: absolute; top: 1rem; right: 1.2rem; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  width: 190px;
}
.clara-portrait {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  border: 3px solid #fff; box-shadow: 0 4px 14px rgba(61,52,40,0.25);
}
.clara-bubble {
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 0.5rem 0.7rem; font-size: 0.95rem; line-height: 1.35; text-align: center;
  box-shadow: var(--shadow-soft); min-height: 2.4em;
}
.clara-bubble::before {
  content: ''; position: absolute; top: 86px; left: 50%;
  border: 7px solid transparent; border-bottom-color: #fff;
}

/* Sprachtrainer */
.vokabel-karte { display: flex; gap: 1.4rem; align-items: center; margin-top: 0.6rem; }
.vokabel-karte img {
  width: 260px; height: 260px; object-fit: cover; border-radius: 18px;
  border: 1.5px solid var(--line); box-shadow: var(--shadow-soft); flex-shrink: 0;
}
.vokabel-texte { flex: 1; display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start; }
.vokabel-de { font-size: 1.35rem; color: #7a6c58; }
.vokabel-fremd { font-family: Georgia, serif; font-size: 2.3rem; font-weight: 700; }
.quiz-optionen { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; }

/* Wetter */
.wetter-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.5rem 1.1rem; font-size: 1.05rem; min-height: 60px;
  box-shadow: var(--shadow-soft); margin-right: 110px;
}
.wetter-chip .ic { width: 30px; height: 30px; color: var(--amber); }
.wetter-stunden {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.6rem;
  margin: 1rem 0 0.4rem;
}
.wetter-stunde {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.7rem 0.3rem; font-size: 1rem;
}
.wetter-stunde .ic { width: 34px; height: 34px; color: var(--amber); }
.wetter-stunde .ws-zeit { color: var(--muted); font-size: 0.9rem; }
.wetter-stunde .ws-temp { font-weight: 700; font-size: 1.15rem; }
.wetter-stunde .ws-regen { font-size: 0.78rem; color: var(--accent-ink); min-height: 1.1em; }

/* Clara als Video (HeyGen/LiveAvatar): großes, warmes Bühnenformat */
.clara-video-buehne {
  width: min(680px, 92vw); aspect-ratio: 4 / 3;
  border-radius: 24px; overflow: hidden; background: #1d232c;
  box-shadow: var(--shadow); border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.clara-video-buehne img { width: 100%; height: 100%; object-fit: cover; }
.clara-video-buehne video { width: 100%; height: 100%; object-fit: cover; }

/* Sprech-Bühne (Begleiter, sprachzentriert) */
.sprech-buehne {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.4rem 0 0.6rem;
}
.sprech-buehne .avatar-svg { width: 250px; height: 250px; }
#tippen-bereich { max-width: 900px; margin: 1rem auto 0; }

/* Musikzimmer */
.musik-sender {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem;
  text-align: left; padding: 1rem 1.2rem; min-height: 96px;
  background: var(--card); border: 2px solid var(--line); border-radius: 16px;
}
.musik-sender strong { font-size: 1.15rem; font-family: var(--serif); }
.musik-sender .muted { font-size: 0.95rem; font-weight: 400; }
.musik-sender.aktiv { border-color: var(--green); background: var(--green-soft); }

/* Hörbücher */
.hb-regal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.hb-buch {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 0.8rem;
  background: var(--card); border: 2px solid var(--line); border-radius: 16px;
  min-height: 0; text-align: center; align-items: center;
}
.hb-buch img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--paper); }
.hb-buch .hb-titel { font-weight: 650; font-size: 1.02rem; line-height: 1.25; }
.hb-buch .muted { font-size: 0.88rem; font-weight: 400; }
.hb-kopf { display: flex; gap: 1.2rem; align-items: flex-start; }
.hb-kopf img { width: 150px; border-radius: 12px; flex-shrink: 0; }
.hb-kopf p { font-size: 1.02rem; }
.hb-kapitel { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.8rem; max-height: 430px; overflow-y: auto; }
.hb-kap {
  display: flex; justify-content: space-between; gap: 1rem; width: 100%;
  padding: 0.7rem 1rem; min-height: 64px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
}
.hb-kap.aktiv { border-color: var(--green); background: var(--green-soft); }

/* Kochbuch */
.zutaten-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.zutat-chip {
  font-size: 1.1rem; padding: 0.6rem 1.1rem; border-radius: 999px;
  background: var(--card); border: 2px solid var(--line); min-height: 56px;
}
.zutat-chip.aktiv { background: var(--green-soft); border-color: var(--green); font-weight: 700; }

/* Mühle */
.muehle-svg { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; border-radius: 18px; box-shadow: 0 4px 18px rgba(61,52,40,0.18); }
.muehle-hinweis { font-size: 1.15rem; text-align: center; margin: 0.4rem 0 1rem; min-height: 1.6em; }
.mb-stein { transition: transform 0.15s; }
.mb-auswahl { transform-origin: center; }

.quiz-answer { width: 100%; justify-content: flex-start; text-align: left; min-height: 78px; font-size: 1.08rem; background: var(--card); border: 2px solid var(--line); }
.quiz-answer.right { background: var(--green-soft); border-color: var(--green); }
.quiz-answer.wrong { background: var(--red-soft); border-color: var(--red); }
.quiz-progress { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 0.6rem 0 1rem; }
.quiz-progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }

.puzzle-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  width: min(62vh, 560px); aspect-ratio: 1; margin: 0 auto;
  background: var(--line); border-radius: 16px; padding: 6px;
}
.puzzle-tile { border-radius: 10px; background-size: 300% 300%; min-height: 0; padding: 0; border: none; }
.puzzle-tile.empty { background: transparent !important; box-shadow: none; cursor: default; }

/* ---------- Dialoge ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(24, 30, 38, 0.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.dialog {
  background: var(--card); border-radius: 26px; box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  max-width: 880px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 1.6rem 1.8rem;
  display: flex; flex-direction: column;
}
.dialog h2 { font-size: 1.4rem; margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.dialog .summary { font-size: 1.08rem; margin-bottom: 0.5rem; }
.dialog ul { list-style: none; }
.dialog li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
.dialog li:last-child { border-bottom: none; }
.dialog .total { font-size: 1.35rem; font-weight: 700; margin-top: 0.8rem; }
.dialog .btn-row {
  position: sticky; bottom: -1.6rem; margin-bottom: -1.6rem;
  background: var(--card); padding: 0.9rem 0 1.6rem;
}

/* ---------- Formulare ---------- */
label { font-size: 0.92rem; font-weight: 700; display: block; margin: 0.8rem 0 0.3rem; }
input, textarea, select {
  font-family: inherit; font-size: 1.02rem; color: var(--ink);
  padding: 0.7rem 1rem; border: 2px solid var(--line); border-radius: 14px;
  width: 100%; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(46,92,138,0.18); }

/* ---------- Anruf ---------- */
.call-overlay {
  position: fixed; inset: 0; z-index: 120;
  /* Warmer Wohnzimmer-Hintergrund (Higgsfield) statt hartem Dunkelgrau —
     sichtbar beim Klingeln und bevor das Videobild steht. */
  background: #171d24 url('assets/telefonie-hintergrund.jpg') center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
}
.call-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(23, 29, 36, 0.35); pointer-events: none;
}
.call-overlay video#remote-video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.call-overlay video#local-video {
  position: absolute; right: 24px; top: 24px; width: 220px; border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.35); box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  background: #232a33;
}
.call-status {
  position: absolute; top: 28px; left: 0; right: 0; text-align: center;
  color: #f2eee4; font-size: 1.3rem; font-weight: 700; z-index: 2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.call-controls {
  position: absolute; bottom: 40px; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: center; gap: 1.2rem;
}
.call-controls button { min-width: 220px; min-height: 84px; font-size: 1.1rem; border-radius: 999px; }
.call-avatar-big {
  width: 180px; height: 180px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 3rem; font-weight: 700;
  box-shadow: 0 0 0 18px rgba(255,255,255,0.06), 0 0 0 36px rgba(255,255,255,0.04);
}

/* ============================================================
   Großes Tablet (Samsung Galaxy Tab 14", ~1480 CSS-px breit):
   mehr Luft, größere Ziele, Inhalte gedeckelt statt gedehnt.
   ============================================================ */
@media (min-width: 1380px) {
  html { font-size: 26px; }
  .content, .tiles, .home-head, .hero { max-width: 1600px; margin-left: auto; margin-right: auto; }
  .hero { margin-left: auto; margin-right: auto; }
  .tiles { gap: 1.4rem; }
  .tile { min-height: 230px; }
  .tile.tile-bild .tile-label { font-size: 1.08rem; padding: 0.7rem 0.8rem; }
  .game-hub { gap: 1.4rem; }
  .game-card-bild .game-bild { height: 240px; }
  .muehle-svg { max-width: 780px; }
  .memory-grid { max-width: 900px; }
  .memory-grid.staedte { max-width: 1040px; }
  .clara-ecke { width: 230px; }
  .clara-portrait { width: 116px; height: 116px; }
  .clara-bubble { font-size: 1.02rem; }
  .vokabel-karte img { width: 330px; height: 330px; }
}

/* Hochformat (Tablet gedreht): Kacheln zweispaltig, Spiele-Hub zweispaltig */
@media (max-width: 1100px) and (orientation: portrait) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .game-hub { grid-template-columns: repeat(2, 1fr); }
  .vokabel-karte { flex-direction: column; }
}

/* ============================================================
   Weltreise — ruhige 3D-Erde, große Ziele, klare Detailkarte
   ============================================================ */
.wr-buehne {
  position: relative; border-radius: 22px; overflow: hidden;
  background: #0b1020; box-shadow: var(--shadow);
}
.wr-buehne canvas { width: 100%; display: block; }
.wr-knopfleiste {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 0.6rem; padding: 0.8rem; flex-wrap: wrap; justify-content: center;
  background: linear-gradient(transparent, rgba(11, 16, 32, 0.85) 40%);
}
.wr-knopfleiste .btn-ghost { background: rgba(255, 254, 251, 0.92); }
.wr-hinweis {
  position: absolute; top: 0.8rem; left: 0; right: 0; text-align: center;
  color: #e8e4d8; font-size: 1.05rem; text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  pointer-events: none;
}
.wr-clara {
  position: absolute; top: 1rem; right: 1rem; width: 340px;
  background: rgba(255, 254, 251, 0.97); border-radius: 18px; padding: 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  box-shadow: 0 10px 34px rgba(0,0,0,0.35);
}
.wr-clara img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; }
.wr-clara-text { font-size: 1.08rem; text-align: center; line-height: 1.4; }
.wr-clara-knoepfe { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.wr-clara-knoepfe button { min-height: 62px; }

.wr-detail-karte { max-width: 1100px; margin: 1.1rem auto 0; }
.wr-detail-kopf { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; }
.wr-detail-kopf img { width: 380px; max-width: 100%; border-radius: 16px; border: 1.5px solid var(--line); }
.wr-detail-titelzeile h3 { font-size: 1.5rem; }
.wr-detail-text { font-size: 1.15rem; line-height: 1.55; margin-top: 0.8rem; max-width: 75ch; }
.wr-wissen {
  background: var(--accent-soft); border-radius: 14px; padding: 0.7rem 1rem;
  font-size: 1.05rem; margin-top: 0.7rem; max-width: 75ch;
}
.wr-video-rahmen { position: relative; aspect-ratio: 16 / 9; max-width: 960px; margin-top: 0.8rem; }
.wr-video-rahmen iframe {
  width: 100%; height: 100%; border: 0; border-radius: 16px; background: #000;
}
@media (min-width: 1380px) {
  .wr-clara { width: 380px; }
}

/* ============================================================
   Claras feste Ecke — immer oben rechts, auf jedem Bildschirm.
   Porträt, Orb und Video behalten in jedem Gesprächszustand ihre Größe.
   ============================================================ */
.avatar-ecke {
  position: fixed; top: 12px; right: 14px; z-index: 90;
  /* Zwei Begleiter NEBENEINANDER (Kugel links, Gesicht rechts), die
     Beschriftung darunter über beide. */
  display: grid;
  grid-template-columns: auto auto;
  justify-items: center; align-items: start;
  gap: 0.3rem 0.55rem;
  width: 264px;
}
.avatar-ecke > .ecke-label { grid-column: 1 / -1; }
/* Ohne zweite Kugel bleibt die Ecke schmal und einspaltig wie bisher. */
.avatar-ecke:not(.zwei-begleiter) { grid-template-columns: auto; width: 132px; }
.ecke-knopf {
  width: 108px; height: 108px; border-radius: 50%; padding: 0; min-height: 0;
  overflow: hidden; border: 3px solid #fffefb; position: relative;
  box-shadow: 0 6px 22px rgba(34, 40, 49, 0.28);
  background: var(--accent-soft);
}
.ecke-knopf img, .ecke-knopf video { width: 100%; height: 100%; object-fit: cover; }
.ecke-knopf .avatar-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ecke-knopf .avatar-svg { width: 86%; height: 86%; }
.ecke-punkt {
  position: absolute; right: 9px; bottom: 9px; width: 18px; height: 18px;
  border-radius: 50%; background: #9aa4ad; border: 2.5px solid #fffefb;
}
.avatar-ecke.verbinde .ecke-punkt { background: var(--amber); animation: ecke-puls 1s infinite alternate; }
.avatar-ecke.live .ecke-punkt { background: var(--green); animation: ecke-puls 1.4s infinite alternate; }
@keyframes ecke-puls { from { transform: scale(1); } to { transform: scale(1.25); } }
.ecke-label {
  font-size: 0.78rem; text-align: center; line-height: 1.25; color: var(--accent-ink);
  background: rgba(255, 254, 251, 0.94); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.25rem 0.7rem; max-width: 200px;
  box-shadow: var(--shadow-soft);
}

/* Demo-Marke rückt nach links neben die Ecke */
.demo-pill { right: 160px; }

/* Kompakte Begrüßungszeile unter dem Kopf */
.gruss-zeile {
  margin: 0.15rem 1.6rem 0.9rem; font-size: 1.12rem; line-height: 1.45;
  color: var(--muted); max-width: 62ch; padding-right: 140px;
}
.gruss-zeile strong { color: var(--ink); font-family: var(--serif); font-size: 1.22rem; margin-right: 0.4rem; }
.home-head { padding-right: 160px; }
.topbar { padding-right: 160px; }

/* ============================================================
   Weltreise v2: Erde groß links, ruhige Bedienspalte rechts,
   Video nahezu Vollbild. (Ersetzt die alten .wr-buehne-Regeln.)
   ============================================================ */
.wr-rahmen {
  display: flex; gap: 1rem; padding: 0 1.5rem 1rem;
  height: calc(100vh - 128px); min-height: 480px;
}
.wr-links {
  flex: 1.7; position: relative; border-radius: 22px; overflow: hidden;
  background: #0c1224; box-shadow: var(--shadow);
}
.wr-links canvas { width: 100%; height: 100%; display: block; }
.wr-hinweis {
  position: absolute; bottom: 0.8rem; left: 0; right: 0; text-align: center;
  color: #cfd4de; font-size: 0.95rem; text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  pointer-events: none; margin: 0;
}
.wr-rechts {
  flex: 1; max-width: 460px; display: flex; flex-direction: column;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-soft); padding: 1.3rem; overflow-y: auto;
}
.wr-titel { font-size: 1.45rem; }
.wr-untertitel { color: var(--muted); margin: 0.3rem 0 0.9rem; font-size: 1rem; }
.wr-text { font-size: 1.08rem; line-height: 1.5; }
.wr-wissen {
  background: var(--accent-soft); border-radius: 14px; padding: 0.65rem 0.9rem;
  font-size: 1rem; margin-top: 0.7rem;
}
.wr-knoepfe { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1rem; }
.wr-fuss { margin-top: auto; padding-top: 1rem; }
.wr-fuss .muted { font-size: 0.85rem; }
.wr-detail-bild { margin: -1.3rem -1.3rem 1rem; }
.wr-detail-bild img { width: 100%; height: 200px; object-fit: cover; display: block; }
.wr-clara-kopf { text-align: center; }
.wr-clara-kopf img {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  border: 3px solid #fff; box-shadow: var(--shadow);
}

/* Vollbild-Video: ganze Fläche, oben nur Zurück + Titel */
#video-vollbild {
  position: fixed; inset: 0; z-index: 85; background: #0b0e16;
  display: flex; flex-direction: column;
}
#video-vollbild .vv-leiste {
  display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem;
  padding-right: 120px; /* Platz für Claras kleine Ecke */
}
#video-vollbild .vv-leiste .btn-ghost { background: rgba(255,254,251,0.94); min-height: 64px; }
#video-vollbild .vv-titel {
  color: #e8e4d8; font-family: var(--serif); font-size: 1.1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#video-vollbild .vv-flaeche { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 0.6rem 0.6rem; }
#video-vollbild iframe, #video-vollbild video {
  width: 100%; height: 100%; max-width: calc((100vh - 90px) * 16 / 9);
  border: 0; border-radius: 14px; background: #000; object-fit: contain;
}
/* Rechte Weltreise-Spalte: Überschrift weicht Claras Ecke aus */
.wr-rechts > .wr-titel:first-child, .wr-rechts .wr-clara-kopf:first-child { padding-right: 80px; }

/* Weltreise-Detail: Weltkugel tritt ab, das Ziel bekommt die ganze Bühne */
.wr-rahmen.detail-modus .wr-links { display: none; }
.wr-rahmen.detail-modus .wr-rechts { max-width: none; padding: 0; overflow: hidden; }
.wr-detail-gross { display: flex; height: 100%; }
.wr-detail-bildseite { flex: 1.25; min-width: 0; }
.wr-detail-bildseite img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wr-detail-infoseite {
  flex: 1; padding: 1.4rem 1.5rem; overflow-y: auto;
  display: flex; flex-direction: column; min-width: 380px;
}
.wr-detail-infoseite .wr-knoepfe { margin-top: auto; padding-top: 1rem; }

/* Ruhige Einblendung, wenn Clara etwas auf die Einkaufsliste gesetzt hat.
   Unten mittig, damit sie den Avatar oben rechts nicht verdeckt. */
#einkauf-hinweis {
  position: fixed;
  left: 50%;
  bottom: -6rem;
  transform: translateX(-50%);
  z-index: 60;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  background: #2e5079;
  color: #fdfaf4;
  font-size: 1.25rem;
  box-shadow: 0 10px 28px rgba(30, 34, 40, 0.28);
  opacity: 0;
  transition: bottom 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}
#einkauf-hinweis.sichtbar { bottom: 2.2rem; opacity: 1; }

/* Großes, eindeutiges Löschen in der Einkaufsliste — für 80-Jährige muss
   sofort klar sein, was der Knopf tut. Rot, groß, mit Berührungsfläche. */
.loeschen-knopf {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: 2px solid #b5483f;
  background: #fdf2f0;
  color: #b5483f;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.loeschen-knopf:hover { background: #b5483f; color: #fff; }
.loeschen-knopf:active { transform: scale(0.94); }

/* Die Sprachkugel bleibt auch bei geöffneter Einkaufsliste erreichbar. */
body.einkaufsliste-offen .avatar-ecke { z-index: 110; }
body.auftragsplanung-offen .avatar-ecke { z-index: 110; }
.el-listenpositionen { list-style: none; padding: 0; }
.el-listenzeile { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; }
.el-position { flex: 0 0 38px; text-align: center; font-size: 1.4rem; color: var(--accent-ink); }
.el-listenname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.el-rueckfrage { padding: 0.7rem; border: 2px solid var(--accent); border-radius: 16px; margin-bottom: 1rem; flex-shrink: 0; }
.el-rueckfrage h3 { margin-top: 0; font-size: 1.05rem; }
.el-rueckfrage p { font-size: 0.85rem; }
.el-rueckfrage .btn-row { position: static; margin-bottom: 0; padding-bottom: 0; }
.el-listenpositionen { flex-shrink: 0; }
.el-varianten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.el-variante { display: flex; flex-direction: column; align-items: start; gap: 0.3rem; padding: 0.7rem; text-align: left; min-height: 100px; font-size: 0.85rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.el-variante small { color: var(--muted); }
@media (max-width: 800px) {
  .el-varianten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .el-listenzeile > img, .el-listenzeile > span[style*="64px"] { display: none; }
  .el-listenzeile { flex-wrap: wrap; }
  .el-listenname { min-width: 120px; }
}

/* „Sprechen“-Knopf im Diktat-Betrieb: pulsiert ruhig, damit sichtbar ist,
   dass das Mikrofon läuft. */
.diktat-an {
  background: #b5483f !important;
  animation: diktat-puls 1.8s ease-in-out infinite;
}
@keyframes diktat-puls {
  0%, 100% { box-shadow: 0 0 0 0 rgba(181, 72, 63, 0.45); }
  50%      { box-shadow: 0 0 0 14px rgba(181, 72, 63, 0); }
}

/* ============================================================
   ZWEI BEGLEITER in der Ecke: oben das Gesicht (Video-Avatar mit
   geklonter Stimme), darunter die Sprach-Kugel (OpenAI-Stimme).
   Beide nutzen dasselbe Gehirn — die Nutzerin wählt einfach.
   ============================================================ */
.ecke-zweit {
  /* Exakt so groß wie das Gesicht daneben (siehe .ecke-knopf). */
  width: 108px; height: 108px; min-height: 0; padding: 0;
  border-radius: 50%; border: 3px solid #fffefb;
  background: #efe9dd;                    /* warmes Sand statt kühlem Blau */
  box-shadow: 0 6px 22px rgba(34, 40, 49, 0.28);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; order: -1;             /* steht LINKS vom Gesicht */
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.ecke-zweit svg { width: 100%; height: 100%; }
.ecke-zweit:hover { transform: scale(1.06); }
.ecke-zweit:active { transform: scale(0.95); }
/* Während eines Gesprächs ist die zweite Kugel nicht bedienbar;
   ihr Platz bleibt erhalten, damit der Hauptbegleiter nicht verrutscht. */
.avatar-ecke.live .ecke-zweit,
.avatar-ecke.verbinde .ecke-zweit { visibility: hidden; pointer-events: none; }

/* Wetter rückt neben das Datum statt an den rechten Rand — dort ist jetzt
   die Begleiter-Ecke. */
.home-head .wetter-chip { margin-left: 0.4rem; }

/* ============================================================
   Varianten-Auswahl und Favoriten
   Bei „Butter" gibt es viele Marken. Statt zu raten, erscheinen
   nummerierte Karten — antippen oder die Nummer sagen.
   ============================================================ */
.varianten-karte { border: 2px solid var(--accent); background: #fffdf8; }
.produkt-wahl {
  position: relative; text-align: left; cursor: pointer;
  border: 2px solid var(--linie, #e4dccd); padding: 0.9rem;
  transition: border-color 0.15s ease, transform 0.1s ease;
  /* Bild oben, Name darunter — als Knopf wäre sonst alles nebeneinander. */
  display: flex; flex-direction: column; gap: 0.35rem; align-items: stretch;
}
.produkt-wahl:hover { border-color: var(--accent); }
.produkt-wahl:active { transform: scale(0.98); }
.wahl-nummer {
  position: absolute; top: -14px; left: -14px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fffefb;
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(34, 40, 49, 0.25);
}

/* Stern zum Merken der Lieblingsmarke */
.stern-knopf {
  position: absolute; top: 8px; right: 8px;
  width: 46px; height: 46px; min-height: 0; padding: 0;
  border-radius: 50%; border: none; background: rgba(255, 254, 251, 0.9);
  color: #cfc6b6; font-size: 1.7rem; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 40, 49, 0.14);
  transition: color 0.15s ease, transform 0.1s ease;
}
.stern-knopf:hover { color: #d9a441; }
.stern-knopf:active { transform: scale(0.9); }
.stern-knopf.ist-favorit { color: #d9a441; }
.product-card { position: relative; }

/* EIN großer Anruf-Knopf je Kontakt — die Wahl zwischen vier Wegen war für
   eine 85-Jährige eine Zumutung. Die Technik entscheidet jetzt selbst. */
.btn-anrufen { width: 100%; font-size: 1.35rem; padding: 1rem 1.2rem; }
.contact-actions { display: flex; flex-direction: column; gap: 0.5rem; }

/* ─────────────── Weltreise: flache Europakarte ───────────────
   Ein Tipp auf das Europa-Schild klappt statt der Kugel diese Karte auf:
   Ausschnitt derselben Erd-Aufnahme, fingergroße Schilder, Linien zeigen
   vom Schild zum echten Ort. Kein Drehen, kein Zoomen. */
.wr-rahmen.europa-modus .wr-rechts,
.wr-rahmen.europa-modus #wr-canvas,
.wr-rahmen.europa-modus .wr-hinweis { display: none; }
.wr-rahmen.europa-modus .wr-links { flex: 1; }

#wr-europa {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0c1224;
}
.wr-eu-flaeche {
  position: relative; height: 100%; aspect-ratio: 1200 / 718; max-width: 100%;
  container-type: size; /* Schilder skalieren mit der Kartengröße */
}
.wr-eu-flaeche > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; user-select: none; -webkit-user-drag: none;
}
.wr-eu-linien { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wr-eu-linien line { stroke: rgba(255, 254, 251, 0.55); stroke-width: 2px; }
.wr-eu-punkt {
  position: absolute; width: clamp(9px, 1.4cqw, 16px); height: clamp(9px, 1.4cqw, 16px); border-radius: 50%;
  background: #b5483f; border: 3px solid #fffefb;
  transform: translate(-50%, -50%); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.wr-eu-punkt.gemerkt { background: #b08a2e; }
.wr-eu-schild {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(16, 22, 36, 0.85); color: #fdf9ef;
  font-family: Georgia, serif; font-weight: 600;
  font-size: clamp(0.8rem, 1.9cqw, 1.35rem);
  padding: 0.4em 0.95em; min-height: 2.6em;
  border: 2px solid rgba(255, 254, 251, 0.55); border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.wr-eu-schild:active { transform: translate(-50%, -50%) scale(0.95); }
.wr-eu-zurueck {
  position: absolute; left: 1rem; bottom: 1rem;
  background: #fffdf9; color: #3d3428;
  font-family: Georgia, serif; font-size: 1.2rem; font-weight: 600;
  padding: 0.7rem 1.4rem; min-height: 56px;
  border: 2px solid #b8a888; border-radius: 14px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Hervorhebung: Beim Überfahren (Maus) und Antippen leuchtet das Schild
   auf — man sieht sofort, welches Ziel man gleich auswählt. */
.wr-eu-schild { transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease; }
.wr-eu-schild:hover, .wr-eu-schild:focus-visible {
  background: #fdf9ef; color: #1a2338;
  border-color: #b08a2e;
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 0 4px rgba(176, 138, 46, 0.45), 0 4px 18px rgba(0, 0, 0, 0.55);
  z-index: 5; outline: none;
}
.wr-eu-schild:active {
  background: #fdf9ef; color: #1a2338;
  transform: translate(-50%, -50%) scale(1.05);
}

/* ─────────────── Fernsehzeitung ─────────────── */
.fz-liste { display: flex; flex-direction: column; gap: 0.35rem; }
.fz-zeile {
  display: flex; align-items: baseline; gap: 0.9rem;
  padding: 0.55rem 0.9rem; border-radius: 12px; background: #fbf7ee;
  font-size: 1.15rem;
}
.fz-zeile.fz-tipp { background: #f2f7f2; border: 1px solid #cfe0cf; }
.fz-zeile.fz-vorbei { opacity: 0.5; }
.fz-zeit { font-weight: 700; min-width: 3.6rem; font-variant-numeric: tabular-nums; }
.fz-sender { min-width: 6.5rem; font-weight: 650; color: #6b5f4e; }
.fz-titel { flex: 1; }
.fz-unter { color: #8a7d68; font-size: 0.95em; }
.fz-senderwahl { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fz-senderknopf { min-height: 52px; padding: 0.4rem 1rem; }
.fz-senderknopf.aktiv { background: var(--accent, #5b7d9e); color: #fffdf9; }

/* Kugel-Gespräch: ruhiges „Atmen" der Kugel, solange die Sitzung läuft —
   der Ton-Pegel legt Wachstum und Leuchten obendrauf (setMundPegel). */
.avatar-ecke.live #ecke-orb svg { animation: kugel-atmen 2.8s ease-in-out infinite; }
@keyframes kugel-atmen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.fz-einschalten { min-height: 48px; padding: 0.35rem 0.9rem; font-size: 1rem; white-space: nowrap; }

/* Fernsehen: Kopfleiste (Startseite Fernsehen / Fernsehprogramm / Abendprogramm) */
/* Rechts Platz lassen für die Begleiter-Ecke (wie .topbar). */
.fz-nav { display: flex; gap: 0.6rem; padding: 0.2rem 170px 0.6rem 1.5rem; flex-shrink: 0; }
.fz-nav-knopf { flex: 1; min-height: 64px; font-size: 1.25rem; }
.fz-nav-knopf.aktiv { background: var(--accent, #5b7d9e); color: #fffdf9; font-weight: 650; }

/* ─────── Fotos: Navigation RECHTS statt unten (Martins Auftrag 08.08.) ───────
   Die Blätter-Leiste nahm den Bildern die Höhe weg — jetzt steht sie als
   schmale Spalte rechts, die Fotos bekommen die volle Höhe. */
#screen-fotos #fotos-kiosk { flex-direction: row; gap: 0.9rem; align-items: stretch; }
#screen-fotos .kiosk-flaeche { flex: 1; }
#screen-fotos .blaetter-leiste {
  flex-direction: column; justify-content: center; gap: 0.9rem;
  width: 150px; flex-shrink: 0; min-height: 0; padding: 0 0 0.4rem;
}
#screen-fotos .blaetter-knopf { width: 100%; min-height: 84px; }
#screen-fotos .blaetter-punkte { flex-wrap: wrap; justify-content: center; max-width: 100%; text-align: center; }

/* Foto-Karten: Das BILD füllt die ganze Karte, der Monatsname liegt als
   schmaler dunkler Balken UNTEN AUF dem Bild (statt einer dicken Fußzeile,
   die die halbe Karte fraß — Martins Meldung 08.08.). */
#screen-fotos .foto-raster .wahl-karte { position: relative; }
#screen-fotos .foto-raster .wk-fuss {
  position: absolute; left: 0; right: 0; bottom: 0;
  border-top: none; justify-content: flex-start;
  background: linear-gradient(transparent, rgba(22, 17, 10, 0.78));
  padding: 1.6rem 0.8rem 0.45rem;
}
#screen-fotos .foto-raster .wk-fuss b {
  color: #fdf9ef; font-size: 1.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
/* Jahres-Knöpfe kompakter — mehr Höhe für die Bilder. */
#foto-jahre .fz-senderknopf { min-height: 56px; padding: 0.3rem 0.85rem; font-size: 1.1rem; }

/* Lightbox/Rückblick: Bild LINKS in voller Höhe, Bedienung als rechte
   Spalte — kein verschenkter Platz mehr (Martins Foto-Beleg 08.08.). */
.lightbox { flex-direction: row; align-items: center; justify-content: center; gap: 1.4rem; padding: 1.2rem; }
.lightbox img.lb-bild {
  max-height: calc(100vh - 2.4rem); max-width: calc(100vw - 360px);
  width: auto; height: auto; object-fit: contain;
  opacity: 0; transform: scale(0.985); transition: opacity 0.7s ease, transform 0.9s ease;
}
.lightbox .lb-seite {
  width: 290px; flex-shrink: 0; max-height: 96vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.8rem; justify-content: center;
}
.lightbox .lb-seite .btn-lg { width: 100%; min-height: 72px; }
.lightbox .lb-caption { text-align: left; max-width: none; }
.lightbox .lb-caption { opacity: 0; transition: opacity 0.9s ease 0.15s; }
.lightbox .lb-bild.lb-da, .lightbox .lb-caption.lb-da { opacity: 1; transform: scale(1); }
.lightbox .lb-kommentar {
  font-family: var(--serif, Georgia), Georgia, serif; font-style: italic;
  font-size: 1.35rem; line-height: 1.45; color: #fdf6e6;
  max-width: 60ch; margin-bottom: 0.35rem;
}

/* ─────── Robuster Touch für Senioren (Praxistest Brunhilde 08.08.) ───────
   Langes, festes oder zittriges Drücken darf NIE im Nichts enden:
   - kein Textmarkieren/Kontextmenü bei langem Druck
   - keine Tipp-Verzögerung, kein Doppeltipp-Zoom
   - kein blaues Aufblitzen                                             */
html, body { touch-action: manipulation; }
body {
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea { user-select: text; -webkit-user-select: text; }
img { -webkit-user-drag: none; }
/* Sichtbare Rückmeldung beim Drücken — „das Tablet hat mich gehört". */
button:active, .tile:active, .wahl-karte:active, .zeile:active,
.product-card:active, .fz-zeile:active, .med-karte:active {
  transform: scale(0.985);
  filter: brightness(0.96);
}

/* Mühle MAXIMAL (08.08.): Brett mittig mit voller Höhe, alle Texte in zwei
   schmalen Seitenspalten — keine Platzverschwendung oben/unten, große
   Steine und Klickflächen für Touch. */
#muehle-brett-wrap { display: flex; justify-content: center; align-items: center; min-height: 0; }
#muehle-brett-wrap svg.muehle-svg { width: min(62vh, 92vw, 620px); height: auto; display: block; }
.muehle-karte { padding: 0.7rem 1rem !important; }
.muehle-rahmen { display: flex; gap: 1rem; flex: 1; min-height: 0; align-items: stretch; }
.muehle-rahmen #muehle-brett-wrap { flex: 1; }
.muehle-seite {
  width: clamp(180px, 19vw, 250px); flex-shrink: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 0.9rem; justify-content: center;
}
.muehle-seite .clara-ecke.muehle-clara { position: static; width: auto; }
body.spiel-offen #screen-spiele #muehle-brett-wrap { flex: 1 1 auto; }
body.spiel-offen #screen-spiele #muehle-brett-wrap svg.muehle-svg { height: 100%; width: auto; max-width: 100%; }

/* ─────────────── Medikamente ─────────────── */
#screen-medikamente.active { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.med-raster {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; overflow: hidden;
}
.med-karte { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.med-planzeile { display: flex; gap: 0.6rem; margin-top: 0.3rem; }
.med-plan {
  flex: 1; text-align: center; padding: 0.5rem 0.4rem; border-radius: 12px;
  background: #f3efe4; color: #8a7d68; font-size: 1.05rem;
}
.med-plan b { display: block; font-size: 1.5rem; line-height: 1.2; }
.med-plan.aktiv { background: var(--green-soft, #e7f1e9); color: #2e5c3f; border: 1px solid #a9c9b7; }

/* Diktat-Prüfung: das große rote ✕ zum Verwerfen falsch verstandener Artikel */
.pruef-x {
  background: #a9433c; color: #fffdf9; border: none;
  font-weight: 650;
}
.pruef-x:active { background: #8c3327; }

/* Antippbare Programmzeilen mit Info-Knopf */
.fz-zeile.fz-klickbar { cursor: pointer; align-items: center; }
.fz-info { min-height: 48px; padding: 0.35rem 0.8rem; font-size: 1rem; white-space: nowrap; flex-shrink: 0; }

/* Mittlere, einzeilige Zeile fürs Fernsehprogramm (Senderleiste braucht Platz;
   die vollständigen Angaben stehen im Info-Popup). */
.fz-zeile.fz-mittel { font-size: 1.2rem; padding: 0.7rem 1rem; }
.fz-zeile.fz-mittel .fz-titel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Abendprogramm: Senderspalten wie in der gedruckten Fernsehzeitung */
.fz-abend-raster {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; overflow: hidden;
}
.fz-spalte {
  display: flex; flex-direction: column; gap: 0.4rem; min-height: 0;
  background: #fbf7ee; border-radius: 14px; padding: 0.5rem 0.6rem; overflow: hidden;
}
.fz-spalten-kopf {
  font-weight: 700; font-size: 1.15rem; color: #6b5f4e; text-align: center;
  border-bottom: 2px solid #d8cdb8; padding-bottom: 0.25rem; flex-shrink: 0;
}
.fz-abend-zelle {
  display: flex; gap: 0.6rem; align-items: baseline; cursor: pointer;
  background: #fffdf7; border-radius: 10px; padding: 0.4rem 0.6rem;
  font-size: 1.05rem; line-height: 1.25;
}
.fz-abend-zelle.prime { background: #f2f7f2; border: 1px solid #cfe0cf; font-weight: 650; }
.fz-abend-zelle .fz-zeit { min-width: 3.2rem; }
.fz-abend-titel {
  flex: 1; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ============================================================
   Kiosk-Konzept: Ein Bildschirm = eine Entscheidung. Nichts scrollt —
   Inhalte liegen auf ganzen Seiten, geblättert wird unten oder per Wischen. */
.kiosk-rumpf {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  padding: 0 1.5rem 0.8rem;
}
/* Kiosk-Bildschirme füllen GENAU die Bildschirmhöhe — nichts scrollt. */
#screen-home.active, #screen-fernsehen.active {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}
#screen-home .gruss-zeile { flex-shrink: 0; }
.kiosk-flaeche { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.blaetter-leiste {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 0.6rem;
  /* VORFAHRT: Die Leiste darf nie zusammengedrückt werden — eher geben
     die Kacheln nach (deren Zeilen dürfen schrumpfen). Tablet-Befund. */
  flex-shrink: 0; min-height: 72px;
}
.blaetter-knopf {
  min-height: 60px; padding: 0.6rem 1.6rem;
  background: var(--card); border: 2px solid #b8a888; border-radius: 14px;
  font-family: Georgia, serif; font-size: 1.15rem; font-weight: 600;
  color: var(--ink); cursor: pointer;
}
.blaetter-knopf:disabled { opacity: 0.35; cursor: default; }
.blaetter-punkte { display: flex; gap: 10px; }
.blaetter-punkt {
  width: 14px; height: 14px; border-radius: 50%; background: #c9bda6;
}
.blaetter-punkt.aktiv { background: var(--accent, #5b7d9e); }

/* Startseite im Kiosk: genau 3×2 Kacheln, die die Fläche füllen.
   minmax-Zeilen als Sicherheitsnetz: Selbst wenn die Höhenkette in einem
   ungewöhnlichen Fenster zusammenbricht, bleiben die Kacheln sichtbar. */
.tiles-kiosk {
  flex: 1; min-height: 0;
  grid-template-rows: repeat(2, minmax(110px, 1fr)); padding: 0;
  /* WICHTIG: Ab 1380 px zentriert eine Altregel .tiles mit Auto-Rändern —
     Auto-Ränder schalten das Flex-Dehnen ab und die Breite kollabierte
     auf Inhaltsgröße. Feste Breite macht das Zentrieren wieder harmlos. */
  width: min(100%, 1600px);
}
.tiles-kiosk .tile { min-height: 0; height: 100%; }
/* Die Begrüßung darf die Kacheln nie verdrängen — höchstens zwei Zeilen. */
.gruss-zeile {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Fernsehen-Bereich: vier große Zeilen je Seite. */
.fz-seitentitel { font-size: 1.35rem; margin: 0.4rem 0 0.7rem; }
.fz-liste.fz-kiosk { flex: 1; min-height: 0; justify-content: flex-start; gap: 0.7rem; }
.fz-zeile.fz-gross { font-size: 1.3rem; padding: 1rem 1.2rem; }
.fz-zeile.fz-gross .fz-einschalten { font-size: 1.1rem; min-height: 56px; }

/* Spiele-Hub: Ist ein Spiel/Bereich offen, verschwindet der Hub —
   sichtbar bleibt nur der Inhalt plus eine große Zurück-Zeile. */
/* Auch mit ID-Spezifität (#screen-spiele .game-hub weiter unten) —
   sonst blieb der gequetschte Kachel-Hub ÜBER dem offenen Spiel stehen. */
body.spiel-offen .game-hub, body.spiel-offen #spiele-weiter,
body.spiel-offen #screen-spiele .game-hub, body.spiel-offen #screen-spiele #spiele-weiter { display: none; }

/* ─── Kiosk-Feinschliff (Martins Review vom 02.08., Nachmittag) ─── */

/* Startseite: Bild-Kacheln tragen ihren Namen IMMER als Banner über dem
   Bild — vorher verschwand die Beschriftung in der festen Kachelhöhe. */
.tiles-kiosk .tile-bild { position: relative; overflow: hidden; }
.tiles-kiosk .tile-bild .tile-bildwrap { position: absolute; inset: 0; }
.tiles-kiosk .tile-bild .tile-bildwrap img { width: 100%; height: 100%; object-fit: cover; }
.tiles-kiosk .tile-bild .tile-label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  background: rgba(255, 253, 249, 0.93);
  font-family: Georgia, serif; font-size: 1.45rem; font-weight: 700;
  color: var(--ink, #3d3428); text-align: center; padding: 0.75rem 0.5rem;
}

/* Spiele-Hub: sechs kompakte Karten füllen GENAU einen Bildschirm. */
#screen-spiele.active { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#screen-spiele .content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; width: min(100%, 1600px); }
#screen-spiele .game-hub {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr;
  gap: 1rem;
}
/* Sofort-Fix 02.08.: Die Kompression hatte Titel und Knöpfe aus den
   Karten gequetscht — Bild bekommt feste, kleine Höhe, Titel und Knopf
   sind IMMER sichtbar. */
#screen-spiele .game-card { min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 0.4rem; }
#screen-spiele .game-card .game-bild { height: 84px; flex: 0 0 auto; object-fit: cover; }
#screen-spiele .game-card h3 { margin: 0; font-size: 1.25rem; }
#screen-spiele .game-card p.muted { display: none; }
#screen-spiele .game-card .btn-primary { margin-top: auto; }
/* Das Innenfeld nimmt NUR Platz, wenn wirklich etwas offen ist — vorher
   fraß das leere Feld die halbe Höhe und die Spielkarten schrumpften. */
#screen-spiele #game-area { flex: 0 0 auto; }
body.spiel-offen #screen-spiele #game-area { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* Direkteinstieg (Musik/Hörbücher/Nachrichten von der Startseite):
   wirkt wie eine eigene Seite — ohne "Zurück zur Übersicht"-Zeile. */


/* Einkaufen: fester Rahmen, geblätterte Treffer — die Seite scrollt nie. */
#screen-einkauf.active { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#screen-einkauf .content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; width: min(100%, 1600px); }
#einkauf-content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.el-kopf { display: flex; gap: 0.8rem; align-items: stretch; }
.el-kopf .btn-lg { white-space: nowrap; }
.el-kopf input {
  flex: 1; font-size: 1.2rem; padding: 0.8rem 1rem;
  border: 2px solid var(--linie, #d8cdbc); border-radius: 14px; background: #fffdf9;
}
.el-rubrikzeile { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0; flex-shrink: 0; }
.el-kiosk { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.el-kiosk .kiosk-flaeche { overflow: hidden; }
.el-kiosk-grid {
  height: 100%; overflow: hidden;
  grid-template-rows: 1fr 1fr;
}
.el-kiosk-grid .product-card { min-height: 0; overflow: hidden; }
#screen-einkauf .cart-bar { position: static; margin-top: 0.6rem; flex-shrink: 0; }

/* Hörbücher/Musik: feste Zeilenraster je Blätterseite. */
.hb-regal.hb-kiosk { grid-template-rows: 1fr 1fr; overflow: hidden; flex: 1; min-height: 0; }
/* Bücher liegend: kleines Titelbild links, Titel + Autor lesbar rechts —
   vorher füllte das Cover die Karte und der Text verschwand. */
.hb-kiosk .hb-buch {
  min-height: 0; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr;
  grid-template-rows: min-content min-content;
  align-content: center; align-items: start;
  column-gap: 0.9rem; row-gap: 0.15rem; text-align: left;
}
.hb-kiosk .hb-buch img {
  grid-row: 1 / 3; align-self: center;
  height: 100%; max-height: 92px; aspect-ratio: 1; width: auto;
}
.hb-kiosk .hb-buch .hb-titel {
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hb-kiosk .hb-buch .muted {
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.musik-kiosk { overflow: hidden; }

/* ════════════════ BLATT-SYSTEM v2 (Martins Freigabe, 02.08.) ════════════════
   EIN Gerüst für alle Seiten: einzeilige Kopfzeile, feste Inhaltsfläche,
   Blätter-Fußleiste. Kacheln sind IMMER zweigeteilt (Bild oben, Name unten,
   normales Layout — keine Überlagerungen). Diese Schicht steht bewusst am
   Dateiende und überstimmt ältere Regeln. */

/* HARTE Kiosk-Garantie: Die Seite selbst kann NIE scrollen. Höhe = die
   ECHTE sichtbare Fläche (--echte-hoehe, vom Gerät gemessen) — und die
   alte body-Mindesthöhe (100vh) wird ausdrücklich aufgehoben, sie schob
   den Seitenfuß unsichtbar unter die Browserleiste (Tablet-Befund). */
html, body { height: var(--echte-hoehe, 100dvh); min-height: 0; overflow: hidden; }
.screen.active { display: flex; flex-direction: column; height: var(--echte-hoehe, 100dvh); overflow: hidden; }
.screen.active > .content { flex: 1; min-height: 0; overflow-y: auto; }
.topbar { padding: 0.55rem 260px 0.55rem 1.5rem; flex-shrink: 0; }
.topbar .screen-title { font-size: 1.4rem; }

/* Startseite: Uhr, Datum, Wetter und Gruß in EINER Zeile. */
.home-head {
  display: flex; align-items: center; gap: 1rem; flex-shrink: 0;
  /* Rechts bleibt Platz für Kugel und Porträt — nichts wird verdeckt. */
  /* 330px Reserve rechts: die beiden Begleiter bleiben frei antippbar,
     der Gruß läuft vorher mit … aus. */
  padding: 0.8rem 330px 0.45rem 1.5rem;
}
.home-head .clock { font-size: 1.7rem; white-space: nowrap; }
.home-head .date { font-size: 1rem; white-space: nowrap; }
.home-head .wetter-chip { white-space: nowrap; flex-shrink: 0; }
.gruss-inline {
  flex: 1; min-width: 0; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 1.05rem; color: var(--muted-ink, #6b5f4e);
}
.gruss-inline strong { color: var(--ink, #3d3428); font-size: 1.15rem; }

/* Kachel v2: oben Bild (60 %), unten Name (40 %) — fest verschraubt. */
.tile-v2 {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  /* Die alte .tile-Regel zentriert Kinder — hier müssen sie sich STRECKEN,
     sonst schrumpfen Bild und Namenszeile auf Briefmarkengröße (Tablet-Fund). */
  align-items: stretch; justify-content: stretch;
}
.tile-v2 .tv2-bild {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: #ece4d2;
}
.tile-v2 .tv2-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-v2 .tv2-name {
  /* Schlankes Namensband — das Bild bekommt den Löwenanteil (Martins
     Tablet-Review: zu viel Weiß). */
  flex: 0 0 68px; display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-weight: 700; font-size: 1.5rem;
  border-top: 1.5px solid var(--line); background: var(--card);
}

/* Wahl-Karte: Bild oben, Fußzeile mit Titel + Knopf. */
.wahl-karte { display: flex; flex-direction: column; padding: 0; overflow: hidden; min-height: 0; }
.wahl-karte .wk-bild { flex: 1; min-height: 0; overflow: hidden; background: #ece4d2; }
.wahl-karte .wk-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wahl-karte .wk-fuss {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.6rem 0.9rem; border-top: 1.5px solid var(--line); flex-shrink: 0;
}
.wahl-karte .wk-fuss b { font-family: Georgia, serif; font-size: 1.2rem; }

/* Zeilen-Liste: höchstens vier große Zeilen, ein Knopf je Zeile. */
.zeilen-liste { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.zeilen-liste .zeile {
  flex: 1; min-height: 0; display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 0 1.2rem;
}
.zeile .z-kopf { font-weight: 700; font-size: 1.25rem; font-family: Georgia, serif; flex-shrink: 0; }

/* „Darum kümmere ich mich" (Concierge): ruhige Statusworte, keine Technik. */
.auftrag-status { min-width: 8.5rem; }
.auftrag-status.a-fertig { color: var(--green); }
.auftrag-status.a-laeuft { color: var(--amber); }
.auftrag-status.a-frage { color: var(--accent); }
.zeile .z-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.2rem; }
.zeile .z-unter { color: #8a7d68; font-size: 0.95em; }

/* Konvertierte Bereiche: kein internes Scrollen mehr. */
#screen-familie.active > .content, #screen-termine.active > .content,
#screen-fotos.active > .content {
  overflow: hidden; display: flex; flex-direction: column;
}
#screen-familie .kiosk-rumpf, #screen-termine .kiosk-rumpf, #screen-fotos .kiosk-rumpf,
#screen-einkauf .kiosk-rumpf { min-height: 0; padding: 0; }

/* Fotos: Sechser-Raster aus Wahl-Karten. */
.foto-raster { height: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 1rem; overflow: hidden; }
.erinnerung-raster { height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; gap: 1rem; overflow: hidden; }
.erinnerung-raster .card { overflow: hidden; }
.erinnerung-raster p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }


/* Versionsmarke: winzig, stört nie, verrät den laufenden Stand. */
#stand-marke {
  position: fixed; right: 6px; bottom: 4px; z-index: 40;
  font-size: 10px; color: rgba(61, 52, 40, 0.4); pointer-events: none;
}
/* Geräte mit Gestenleiste: Fußleisten respektieren den geschützten Rand. */
.blaetter-leiste, .cart-bar { padding-bottom: max(0.8rem, env(safe-area-inset-bottom)); }


/* ─── Einkaufen: Ordnung in Karte und Rubrikzeile (Tablet-Review) ─── */
/* Rubriken: genau EINE Zeile — seitlich wischbar statt stapelnd. */
.el-rubrikzeile {
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding-bottom: 0.2rem;
}
.el-rubrikzeile::-webkit-scrollbar { display: none; }
.el-rubrikzeile > * { flex-shrink: 0; }

/* Produktkarte im Sechser-Raster: feste innere Ordnung — Bild schrumpft,
   Name, eine Meta-Zeile und der Knopf sind IMMER sichtbar. */
.el-kiosk-grid .product-card {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0.6rem 0.8rem;
}
.el-kiosk-grid .product-card img {
  flex: 1 1 auto; min-height: 0; height: auto !important;
  width: 100%; object-fit: contain;
}
.el-kiosk-grid .p-name {
  flex: 0 0 auto; font-size: 1.1rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.el-kiosk-grid .p-meta {
  flex: 0 0 auto; font-size: 0.85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.el-kiosk-grid .p-meta:nth-of-type(n+2) { display: none; } /* nur eine Meta-Zeile */
.el-kiosk-grid .product-card .btn-primary,
.el-kiosk-grid .product-card .btn-ghost { flex: 0 0 auto; margin-top: auto; min-height: 48px; }


/* ─── Spiele füllen den festen Bildschirm (Martins Regel: NIE scrollen) ─── */
body.spiel-offen #screen-spiele #game-area { overflow: hidden; display: flex; flex-direction: column; }
body.spiel-offen #screen-spiele #game-area > .card { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
/* Memory: acht Spalten statt vier — alle Karten auf einen Blick, Fläche voll genutzt.
   Die KARTE füllt die Rasterzelle, das INNERE hält das Seitenverhältnis und
   zentriert sich — so bleiben die Karten auch auf niedrigen Fenstern Karten
   statt flachgedrückter Streifen (Martins Screenshot 02.08.). */
.memory-grid, .memory-grid.staedte {
  max-width: none; width: 100%; flex: 1; min-height: 0; height: 100%;
  grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 0.7rem; align-content: stretch;
}
.memory-grid .mem-card, .memory-grid.staedte .mem-card {
  aspect-ratio: auto; height: 100%; min-height: 0;
  display: flex; justify-content: center;
}
.memory-grid .mem-inner {
  height: 100%; width: auto; aspect-ratio: 1; max-width: 100%; margin: auto;
}
.memory-grid.staedte .mem-inner { aspect-ratio: 3 / 4; }


/* ─── Städte-Memory: schwebende Groß-Karte mit Wahrzeichen-Info ─── */
#mem-zoom {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
#mem-zoom .mz-buehne {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  animation: mz-rein 0.35s ease;
}
#mem-zoom.raus .mz-buehne { animation: mz-raus 0.35s ease forwards; }
#mem-zoom .mz-karte {
  width: min(38vh, 34vw); aspect-ratio: 3 / 4;
  border-radius: 22px; overflow: hidden; background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45); border: 4px solid #fffdf9;
}
#mem-zoom .mz-karte img { width: 100%; height: 100%; object-fit: cover; display: block; }
#mem-zoom .mz-info {
  max-width: min(560px, 80vw);
  background: rgba(16, 22, 36, 0.9); color: #fdf9ef;
  font-family: Georgia, serif; font-size: 1.2rem; line-height: 1.5;
  padding: 0.9rem 1.3rem; border-radius: 16px; text-align: center;
}
#mem-zoom .mz-info strong { font-size: 1.35rem; }
@keyframes mz-rein { from { opacity: 0; transform: scale(0.45); } }
@keyframes mz-raus { to { opacity: 0; transform: scale(0.55); } }

/* Städtekarten füllen die volle Spielhöhe (mehr Karte, weniger Leerraum). */
.memory-grid.staedte { grid-template-rows: repeat(2, 1fr); height: 100%; align-content: stretch; }
.memory-grid.staedte .mem-card { aspect-ratio: auto; height: 100%; min-height: 0; }


/* Innencontainer der Medienseiten: Blätter-Leiste hat Vorfahrt —
   Hörbücher/Musik/Nachrichten wurden unten abgeschnitten (Tablet-Fotos). */
#hb-seiten, #musik-seiten, #nachrichten-seiten {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
#hb-seiten .kiosk-flaeche, #musik-seiten .kiosk-flaeche,
#nachrichten-seiten .kiosk-flaeche { overflow: hidden; }

/* REWE catalog: readable cards even at tablet height; fixed conversation corner. */
#screen-einkauf .el-rubrikzeile { min-height: 52px; margin: .35rem 0; align-items: center; }
#screen-einkauf .el-rubrikzeile .btn-ghost { min-height: 48px; padding: .35rem .65rem; font-size: .85rem; }
#screen-einkauf .el-rubrikzeile select { padding: .4rem; min-height: 48px; font-size: .9rem !important; }
#screen-einkauf .el-rubrikzeile label { font-size: .85rem; }
#screen-einkauf .el-kiosk-grid { flex: 1; min-height: 0; grid-template-rows: minmax(0,1fr); gap: .7rem; }
#screen-einkauf .el-kiosk-grid .product-card { padding: .45rem; gap: .2rem; }
#screen-einkauf .el-kiosk-grid .product-card img { min-height: 45px; max-height: 130px; width: 100%; }
#screen-einkauf .el-kiosk-grid .p-name { width:100%; white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.15; font-size:.95rem; }
#screen-einkauf .el-kiosk-grid .p-meta { display:block; font-size:.75rem; width:100%; }
#screen-einkauf .el-kiosk-grid .p-meta:nth-of-type(n+3) { display:none; }
#screen-einkauf .el-kiosk-grid .product-card > .btn-primary { display:none; }
#screen-einkauf .el-kiosk-grid .stern-knopf { width:40px; height:40px; font-size:1.5rem; }
#screen-einkauf .el-kiosk-grid .tag { font-size:.7rem; }
@media (min-height:1000px) { #screen-einkauf .el-kiosk-grid { grid-template-rows:repeat(2,minmax(0,1fr)); } }
@media (max-width:700px) {
  #screen-einkauf .el-kopf .btn-lg { min-width:48px; white-space:normal; font-size:.85rem; }
  #screen-einkauf .el-kopf input { min-width:0; }
  #screen-einkauf .el-rubrikzeile label { min-width:0 !important; }
  #screen-einkauf .el-rubrikzeile select { max-width:100% !important; min-width:0; }
}
/* Keep the current question and its answers visible without a wall of product cards. */
.el-rueckfrage h3 { margin: 0 0 .35rem; }
.el-rueckfrage p { margin: .3rem 0; font-size: .85rem; line-height: 1.3; }
.el-rueckfrage .btn-row { margin-top: .4rem; gap: .5rem; }
.el-rueckfrage .btn-row button { min-height: 54px; padding: .5rem .7rem; font-size: .9rem; }

/* Product price and description stay visible together at tablet height. */
#screen-einkauf .el-kiosk-grid .rewe-produkt {
  display:grid; grid-template-columns: minmax(58px,25%) minmax(0,1fr);
  grid-template-rows:auto auto minmax(22px,1fr) 36px; align-items:center; column-gap:.5rem;
  text-align:left;
}
#screen-einkauf .el-kiosk-grid .rewe-produkt > img { grid-column:1;grid-row:1 / 4;min-height:60px;height:100% !important;max-height:140px; }
#screen-einkauf .el-kiosk-grid .rewe-produkt .p-name { grid-column:2;grid-row:1;font-size:.85rem;padding-right:20px; }
#screen-einkauf .el-kiosk-grid .rewe-produkt .el-preis { grid-column:2;grid-row:2; }
.el-preis { display:block;line-height:1.15; }
.el-preis strong { font-size:1.1rem;color:#264c32; }
.el-preis small { display:block;font-size:.62rem;color:var(--muted); }
.el-preis small:empty { display:none; }
.el-preis-fehlt { font-size:.75rem;color:var(--muted); }
#screen-einkauf .el-kiosk-grid .rewe-produkt .el-beschreibung { grid-column:2;grid-row:3;font-size:.67rem;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
#screen-einkauf .el-kiosk-grid .rewe-produkt .el-details-knopf { grid-column:1 / -1;grid-row:4;min-height:36px;padding:.1rem .4rem;font-size:.72rem;background:#f5f2ec;border:1px solid #cfc8bc;border-radius:8px; }
#screen-einkauf .el-kiosk-grid .rewe-produkt .stern-knopf { top:3px;right:3px;width:30px;height:30px;font-size:1.2rem; }
#screen-einkauf .el-kiosk-grid .rewe-produkt > .tag { position:absolute;bottom:42px;left:8px;max-width:25%;font-size:.5rem;background:white; }
.el-produkt-details { display:flex;gap:1rem;align-items:flex-start; }
.el-produkt-details > img { width:140px;height:190px;object-fit:contain;background:white;border-radius:12px; }
.el-produkt-details .el-preis strong { font-size:1.5rem; }
.el-produkt-details .el-preis small { font-size:.8rem; }
.el-produkt-details p { margin:.6rem 0;font-size:.95rem; }
.el-produkt-details small { font-size:.75rem;color:var(--muted); }

/* Gemeinsamer Einkaufsassistent: eine Aufgabe je Bildschirm, feste Sprachkugel. */
#screen-einkauf #einkauf-content:has(.ew-shell) { padding:.6rem 1.4rem .7rem; overflow:hidden; min-height:0; flex:1; }
.ew-shell { height:100%; min-height:0; display:flex; flex-direction:column; gap:.65rem; }
.ew-heading { flex-shrink:0; padding-right:110px; }
.ew-heading > span { font-size:.85rem; color:var(--muted,#665e54); }
.ew-heading h1 { margin:.2rem 0; font-size:clamp(1.5rem,2.5vw,2.25rem); line-height:1.2; }
.ew-heading p { margin:.25rem 0; font-size:1rem; }
.ew-main { flex:1; min-height:0; overflow:auto; touch-action:pan-y; display:flex; flex-direction:column; justify-content:center; }
.ew-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; min-height:0; }
.ew-option { position:relative; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:.4rem; min-height:105px; padding:1rem .8rem; border:2px solid #d5cec2; background:#fffdf8; border-radius:18px; font-size:1.25rem; color:#26251f; }
.ew-option:hover,.ew-option:focus-visible { border-color:#41674a; outline:3px solid #8baa83; }
.ew-option img { height:75px; max-width:100%; object-fit:contain; }
.ew-number { align-self:flex-start; background:#ece7dc; border-radius:50%; width:32px; height:32px; display:grid; place-items:center; font-size:1rem; }
.ew-actions { display:flex; flex-wrap:wrap; gap:.65rem; flex-shrink:0; }
.ew-button { min-height:56px; font-size:1.05rem; padding:.65rem 1rem; flex:1; }
.ew-footer { display:flex; align-items:center; gap:.8rem; flex-wrap:wrap; flex-shrink:0; padding-top:.45rem; border-top:1px solid #d5cec2; }
.ew-footer form { display:flex; flex:1; gap:.5rem; }
.ew-footer input { min-width:0; flex:1; width:160px; min-height:48px; padding:.5rem; border:1px solid #c6bdaf; border-radius:10px; font-size:1rem; }
.ew-footer button { min-height:48px; }
.ew-product { display:grid; grid-template-columns:minmax(100px,25%) 1fr; align-items:center; gap:1.6rem; }
.ew-product img { width:100%; max-height:200px; object-fit:contain; background:white; border-radius:16px; }
.ew-product h2 { margin:.25rem 0; font-size:1.7rem; }
.ew-description { font-size:1rem; line-height:1.4; }
.ew-quantity { display:flex; align-items:center; gap:.6rem; margin-top:.7rem; }
.ew-quantity span { flex:1; font-size:1.1rem; }
.ew-summary { max-width:850px; font-size:1.5rem; line-height:1.5; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); border:0; }
@media (max-width:760px) { .ew-options { grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem; }.ew-option {min-height:80px;font-size:1rem;padding:.5rem;}.ew-footer {gap:.35rem;}.ew-heading {padding-right:90px;}.ew-product h2 {font-size:1.3rem;} }

#screen-einkauf .topbar [onclick="goZurueck()"] { display:none; }

.ew-product img { max-height:150px; }
.ew-product h2 { font-size:28px; }
.ew-product p { margin:.3rem 0; }
.ew-product .ew-description { font-size:18px; }
.ew-quantity { flex-shrink:0; margin-top:.5rem; }
.ew-button { font-size:20px; }
.ew-main:has(.ew-product) { justify-content:flex-start; }

/* Quantity controls retain their full height inside the scrollable wizard. */
.ew-main > * { flex-shrink:0; }
.ew-count-form { display:flex; align-items:center; flex-wrap:wrap; gap:.6rem; margin-top:.8rem; padding-bottom:.5rem; }
.ew-count-form input { width:100px; min-height:52px; font-size:1.2rem; border:2px solid #889; border-radius:10px; padding:.4rem; }
.ew-count-form button { min-height:52px; }
/* Reserve the existing compact conversation corner without shifting pages. */
#screen-auftraege [role="tablist"] { padding-right: 132px; flex-wrap: wrap; }
#screen-auftraege .content { overflow-y: auto; }
#screen-auftraege [role="tab"][aria-selected="true"] { outline: 3px solid var(--ink, #233448); outline-offset: -5px; }

/* Concierge: one scroll area, no footer covering choices or the answer field. */
.dialog[data-art="auftragsplanung"] { display: block; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.dialog[data-art="auftragsplanung"] .btn-row { position: static; bottom: auto; margin: .7rem 0 0; padding: 0; flex-wrap: wrap; }
.plan-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
.plan-dialog-head h2 { flex: 1 1 14rem; }
.plan-optionen { padding: 0; margin: 1rem 0; list-style: none; }
.plan-optionen .plan-auswahl { width: 100%; display: flex; gap: .6rem; text-align: left; justify-content: flex-start; white-space: normal; min-width: 0; font-size: 1rem; padding: .8rem; }
.plan-nummer { flex: 0 0 auto; }
.plan-optionen details { margin: .35rem 0 .6rem; font-size: .9rem; }
.plan-optionen summary { cursor: pointer; padding: .45rem .15rem; }
.plan-optionen details p { margin: .5rem 0; }
.plan-hinweise { background: var(--paper); padding: .7rem; border-radius: 12px; font-size: .85rem; }
.plan-hinweise p + p { margin-top: .4rem; }
.plan-hinweis { font-size: .9rem; margin: .5rem 0; }
@media (max-width: 600px) {
 body.auftragsplanung-offen .overlay { padding: .4rem; }
 .dialog[data-art="auftragsplanung"] { padding: .8rem; border-radius: 16px; max-height: 96vh; max-height: 96dvh; }
 .dialog[data-art="auftragsplanung"] .btn-row > button { flex: 1 1 100%; min-width: 0; width: 100%; white-space: normal; }
}
