/* Konzept: Die Nacht draussen ist sein weisser Gelstift auf Schwarz. Drinnen, in den Häusern, liegt das
   weisse Blatt mit Kugelschreiber: gesetzt wie eine Bibel, weil auch das Album eine ist.
   Gold gibt es nur am Heiligenschein. */
:root {
  --night: #070710;
  --chalk: #f0eee6;
  --paper: #f3f2ed;
  --ink: #0d0d14;
  --ball: #1d3fd8;      /* sein Kugelschreiber */
  --star: #5b86ff;
  --halo: #d6a62c;      /* nur Heiligenschein */
  --dim: #8f8fa3;
  --fraktur: "UnifrakturCook", "Old English Text MT", "Times New Roman", serif;
  --marker: "Permanent Marker", "Comic Sans MS", system-ui, sans-serif;
  --bible: "Old Standard TT", "Iowan Old Style", Georgia, serif;
  --hand: "Reenie Beanie", "Bradley Hand", cursive;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; touch-action: manipulation; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:root { --app-h: 100vh; }
body:not(.reading) { position: fixed; inset: 0; width: 100%; overflow: hidden; }
body { background: var(--night); color: var(--chalk); font-family: var(--bible); overflow: hidden; -webkit-tap-highlight-color: transparent; }
body.reading { overflow: auto; touch-action: pan-y; }
html:has(body.reading) { touch-action: pan-y; }
body.reading .room { touch-action: pan-y; }
canvas#world { position: fixed; inset: 0 0 auto; width: 100%; height: var(--app-h); display: block; touch-action: none; cursor: default; }
.fraktur { font-family: var(--fraktur); font-weight: 700; }
.marker { font-family: var(--marker); font-weight: 400; }
.hand { font-family: var(--hand); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px dashed var(--star); outline-offset: 3px; }

/* ── Oberfläche ── */
.ui { position: fixed; inset: 0 0 auto; height: var(--app-h); pointer-events: none; z-index: 5; }
.ui button { pointer-events: auto; }
.ghost { font-size: 15px; letter-spacing: .03em; padding: 8px 12px; color: var(--chalk); opacity: .78; transition: opacity .2s, transform .2s; }
.ghost:hover { opacity: 1; transform: rotate(-1.5deg); }

.intro-brand { transition: opacity .3s; position: absolute; top: calc(18px + env(safe-area-inset-top, 0px)); left: 0; right: 0; margin: 0; text-align: center; font-size: clamp(18px, 2.4vw, 26px); opacity: .9; }
.intro-brand .marker { display: inline-block; margin-left: .6em; color: var(--dim); font-size: .62em; letter-spacing: .28em; }
#pullHint { position: absolute; left: 0; right: 0; bottom: calc(8vh + env(safe-area-inset-bottom, 0px)); margin: 0; text-align: center; font-size: clamp(26px, 4.2vw, 56px); transform: rotate(-1.5deg); animation: nag 1.6s ease-in-out infinite; }
#pullHint[data-done] { opacity: 0; animation: none; transition: opacity .15s; }
#skip { position: absolute; right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); font-size: 13px; opacity: .55; }
#loading { position: absolute; left: 0; right: 0; top: 48%; margin: 0; text-align: center; color: var(--dim); font-size: 18px; }
@keyframes nag { 50% { transform: rotate(1deg) scale(1.03); } }

#meter { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: max(14px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 8px; }
#meter svg { width: 92px; height: 52px; overflow: visible; }
#meter div { display: grid; line-height: 1.15; }
.meter-label { font-size: 12px; letter-spacing: .08em; color: var(--dim); }
#meterCount { font-size: 17px; color: var(--chalk); font-variant-numeric: tabular-nums; }
.top-actions { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); display: flex; gap: 2px; }

.edge-hint { background: rgba(7, 7, 16, .78); border-radius: 6px 11px 5px 12px; position: absolute; bottom: calc(5.5vh + env(safe-area-inset-bottom, 0px)); font-size: clamp(14px, 1.5vw, 19px); padding: 10px 12px; line-height: 1.1; max-width: 42vw; color: var(--chalk); opacity: .9; transition: transform .2s, opacity .2s; text-shadow: 0 0 10px var(--night), 0 0 4px var(--night), 0 0 2px var(--night); }
.edge-hint:hover { transform: scale(1.06) rotate(-1deg); opacity: 1; }
#prevHouse { left: max(8px, env(safe-area-inset-left, 0px)); text-align: left; }
#nextHouse { right: max(8px, env(safe-area-inset-right, 0px)); text-align: right; }
.edge-hint .done { color: var(--halo); }

.enter { position: absolute; left: 50%; transform: translateX(-50%) rotate(-1.4deg); display: grid; justify-items: center; gap: 1px; padding: 7px 18px 9px; max-width: calc(100vw - 24px); color: var(--chalk); background: var(--night); border: 2.5px solid var(--chalk); border-radius: 9px 15px 7px 17px / 14px 8px 16px 9px; white-space: nowrap; animation: bob 1.36s ease-in-out infinite; transition: background .15s; }
.enter:hover { background: #15151f; }
.enter > .fraktur { font-size: clamp(25px, 2.8vw, 40px); line-height: 1; }
.enter-cta { font-size: clamp(14px, 1.3vw, 17px); color: var(--star); }
kbd { font: inherit; display: inline-block; border: 1.5px solid currentColor; border-radius: 4px 7px 5px 6px; padding: 0 6px; margin-right: 3px; }
.touch kbd { display: none; }
.enter[hidden] { display: none; }
@keyframes bob { 50% { transform: translate(-50%, 5px) rotate(1deg); } }
#hud > * { transition: opacity .6s; }
#hud.asleep > * { opacity: 0; pointer-events: none; }
#keysHint { position: absolute; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); margin: 0; text-align: center; font-size: 13px; color: var(--dim); transition: opacity 1s; text-shadow: 0 0 6px var(--night); }

#awake { display: grid; place-content: center; text-align: center; text-shadow: 0 0 40px var(--night), 0 0 12px var(--night); animation: fadeAway 6s ease forwards; }
#awake[hidden] { display: none; }
#awake p { margin: 0; }
#awake .fraktur { font-size: clamp(64px, 12vw, 180px); line-height: 1; color: var(--halo); }
#awake .marker { font-size: clamp(18px, 2.4vw, 30px); }
@keyframes fadeAway { 0% { opacity: 0; transform: scale(.9); } 12%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ── Häuser ── */
.room { position: fixed; inset: 0 0 auto; height: var(--app-h); touch-action: pan-y; z-index: 10; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; will-change: clip-path; }
.room.paper { background: var(--paper); color: var(--ink); --accent: var(--ball); }
.room.night { background: var(--night); color: var(--chalk); --accent: var(--star); }
.room-bar { position: sticky; top: 0; z-index: 2; padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.back { pointer-events: auto; font-size: 16px; padding: 6px 12px; background: var(--ink); color: var(--paper); transform: rotate(-.8deg); border-radius: 3px 8px 4px 9px; transition: transform .15s; }
.night .back { background: var(--chalk); color: var(--night); }
.back:hover { transform: rotate(.6deg) scale(1.04); }
.page { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 72px max(16px, env(safe-area-inset-left, 0px)); }
@media (min-width: 720px) { .page { padding-left: 48px; padding-right: 48px; } }
h2, h3, p { margin: 0; }
.eyebrow { color: var(--accent); font-size: clamp(16px, 1.6vw, 20px); transform: rotate(-1deg); transform-origin: left; }
.center { text-align: center; transform: none; }
.xl { font-size: clamp(64px, 11.5vw, 168px); line-height: .92; text-wrap: balance; }
.xxl { font-size: clamp(84px, 17vw, 260px); line-height: .88; text-align: center; }
.head { padding-block: 8px 28px; }
.head.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: end; }
.head.split > div { min-width: 0; }
.head.split img { max-width: min(60vw, 300px); height: auto; justify-self: end; margin-top: -6px; }
@media (min-width: 860px) { .head.split { grid-template-columns: minmax(0, 1fr) 280px; column-gap: 28px; } .head.split img { max-width: 100%; } }
.ink { filter: invert(1) contrast(1.05); mix-blend-mode: multiply; height: auto; }
.tilt-r { transform: rotate(5deg); } .tilt-l { transform: rotate(-4deg); }
.sprite-eye { filter: none; max-height: 340px; width: auto !important; }

.scripture { max-width: 66ch; }
.scripture p { margin-block: 0 .85em; }
.scripture .lead { font-size: 1.32em; line-height: 1.34; font-style: italic; }
sup { font-family: var(--hand); color: var(--accent); font-size: 1.05em; font-weight: 400; vertical-align: .32em; line-height: 0; margin-right: .08em; font-style: normal; }
.shout { font-size: clamp(38px, 5.6vw, 74px); line-height: 1; margin-block: .5em .55em !important; }
.substance { list-style: none; margin: 18px 0 30px; padding: 0; display: grid; gap: 22px; }
@media (min-width: 760px) { .substance { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; } }
.substance li { min-width: 0; }
.substance h3 { font-size: clamp(21px, 2vw, 26px); line-height: 1.12; color: var(--accent); margin-bottom: 6px; transform: rotate(-1deg); }
.amen { font-size: clamp(54px, 9.6vw, 142px); line-height: .96; margin-block: 34px 26px; }
.next { display: block; margin-top: 30px; font-size: clamp(18px, 2vw, 25px); color: var(--accent); padding: 8px 0; text-align: left; transition: transform .15s; }
.next:hover { transform: translateX(6px) rotate(-.5deg); }
.next:empty { display: none; }

/* Gesetz und Randnotizen */
.verse-grid { display: grid; gap: 28px; }
.verse-grid > * { min-width: 0; }
.margin { display: none; }
@media (min-width: 900px) {
  .verse-grid { grid-template-columns: minmax(0, 66ch) minmax(0, 1fr); gap: 56px; }
  .margin { display: grid; justify-items: center; align-content: start; gap: 20px; }
  .margin img { max-width: 100%; height: auto; }
  .margin .hand { color: var(--ball); font-size: 1.6em; line-height: 1.02; text-align: center; transform: rotate(-3deg); }
  .margin .ankh { transform: rotate(8deg); }
}
.band { position: relative; margin-block: 40px 0; margin-inline: calc(50% - 50vw); padding: clamp(36px, 7vw, 90px) max(16px, calc(50vw - 512px)); background: #000; color: var(--chalk); overflow: hidden; }
.band .static { opacity: .2; }
.band .amen { position: relative; margin: 0; text-shadow: 0 0 22px #000, 0 0 8px #000; }
.amen-row { display: grid; gap: 8px; align-items: center; }
.amen-row > * { min-width: 0; }
.amen-row .amen { margin-block: 24px 0; }
.amen-row .hole { width: min(70vw, 300px); height: auto; justify-self: center; }
@media (min-width: 900px) { .amen-row { grid-template-columns: minmax(0, 1fr) 280px; } }

/* Zeitung */
.masthead { border-bottom: 3px double var(--ink); padding-bottom: 6px; margin-bottom: 18px; }
.masthead img { display: block; width: min(92%, 640px); margin: 0 auto 6px; }
.edition { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 18px; font-size: .78em; letter-spacing: .03em; font-style: italic; border-top: 1px solid var(--ink); padding-top: 4px; }
.dek { font-size: 1.3em; font-style: italic; margin-top: 8px; }
.tip { color: var(--ball); font-size: 1.45em; line-height: 1.1; margin-block: 14px; transform: rotate(-.8deg); }
.columns { display: grid; gap: 18px; margin-top: 16px; }
@media (min-width: 820px) { .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; } .columns.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.columns p { min-width: 0; }
.bitter { font-family: var(--marker); font-size: 1.28em; line-height: 1.22; transform: rotate(-1deg); }
.redact { display: inline; padding: 0 2px; background: var(--ink); color: transparent; line-height: 1.2; transition: color .15s, background .25s; border-radius: 2px; text-align: left; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.redact:hover, .redact:focus-visible, .redact.open { background: transparent; color: var(--ink); text-decoration: underline wavy var(--ball) 2px; text-underline-offset: 3px; }
.slogan { font-size: clamp(24px, 3.4vw, 42px); margin-top: 28px; color: var(--ball); transform: rotate(-1deg); line-height: 1.15; }

/* Wand der Fernseher: lauter echte Pasqua-Fernseher */
.wall .screen { border: 0; border-radius: 0; background: url("assets/tvbig-0.webp") center / 100% 100% no-repeat; aspect-ratio: 893 / 1100; overflow: visible; display: block; }
.wall .static { inset: 26.35% 15.19% 25.83% 8.45%; border-radius: 13%; }
.wall .thumb { position: absolute; left: 9.3%; top: 27.1%; width: 74.7%; height: 46.4%; object-fit: cover; border-radius: 15% / 19%; filter: saturate(.72) contrast(1.05); transition: filter .2s; }
.wall .static { left: 9.3%; top: 27.1%; right: auto; bottom: auto; width: 74.7%; height: 46.4%; border-radius: 15% / 19%; opacity: .36; transition: opacity .2s; }
.wall .screen:hover .static, .wall .screen:focus-visible .static { opacity: .07; }
.wall .screen:hover .thumb, .wall .screen:focus-visible .thumb { filter: none; }
.wall .play { position: absolute; left: 46.6%; top: 67%; transform: translate(-50%, -50%) rotate(-2deg); white-space: nowrap; font-size: clamp(14px, 1.3vw, 18px); }
.wall .screen:hover { transform: rotate(-1.5deg) scale(1.03); }

.wall { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 30px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.wall li { min-width: 0; }
.screen { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border: 3px solid var(--chalk); border-radius: 26px 31px 24px 34px / 30px 24px 34px 26px; overflow: hidden; color: var(--chalk); text-decoration: none; background: #000; transition: transform .18s; }
.paper .screen { border-color: var(--ink); }
.screen:hover { transform: rotate(-1.2deg) scale(1.02); }
.static { position: absolute; inset: 0; background-image: url("assets/static.webp"); background-size: 180px 135px; opacity: .55; animation: snow .22s steps(4) infinite; }
.screen:hover .static { opacity: .9; }
@keyframes snow { to { background-position: 180px -135px; } }
.play { position: relative; font-size: 22px; padding: 2px 10px; background: #000; transform: rotate(-2deg); }
.vt { font-size: 1.12em; line-height: 1.22; margin-top: 10px; }
.vs { color: var(--dim); font-size: .82em; font-style: italic; }
.big { max-width: 880px; aspect-ratio: 16 / 9; }
.player iframe { width: 100%; max-width: 880px; aspect-ratio: 16 / 9; border: 3px solid var(--ink); border-radius: 14px; display: block; background: #000; }
.watch-out { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 14px; }
.watch-out a { color: var(--ball); font-size: 19px; }

/* Kathedrale */
.cathedral .page { display: grid; justify-items: center; }
.priest { width: min(66vw, 340px); height: auto; margin-block: 4px 18px; animation: hover 2.72s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-9px); } }
.by { color: var(--halo); letter-spacing: .34em; font-size: clamp(20px, 2.6vw, 34px); margin-top: 10px; padding-left: .34em; text-align: center; }
.windows { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 0; margin: 40px 0 14px; width: 100%; }
.windows li { width: clamp(36px, 8vw, 86px); aspect-ratio: 1 / 2.3; border: 2px solid var(--chalk); border-radius: 50% 50% 3px 3px / 26% 26% 2% 2%; background: radial-gradient(circle at 50% 30%, rgba(91, 134, 255, .34), transparent 70%); }
.soon { color: var(--star); font-size: 1.5em; line-height: 1.1; text-align: center; max-width: 34ch; text-wrap: balance; }
.cathedral .next { margin-inline: auto; text-align: center; }

/* Ablassbrief */
.ablass { width: 100%; display: grid; gap: 28px; margin-top: 64px; padding-top: 44px; border-top: 2px solid var(--chalk); text-align: left; }
.ablass > * { min-width: 0; }
@media (min-width: 860px) { .ablass { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 56px; align-items: start; } }
.ablass h3 { font-size: clamp(48px, 7vw, 92px); line-height: .95; margin-bottom: 12px; color: var(--halo); }
#sinForm { display: grid; gap: 8px; margin-top: 22px; }
#sinForm label { color: var(--star); font-size: 18px; }
#sin { width: 100%; font: inherit; font-size: max(16px, 1.1em); color: var(--chalk); background: transparent; border: 0; border-bottom: 2.5px solid var(--chalk); padding: 8px 2px; border-radius: 0; }
#sin:focus { outline: 0; border-bottom-color: var(--star); }
#sin::placeholder { color: var(--dim); font-style: italic; }
.absolve { justify-self: start; margin-top: 8px; background: var(--halo); color: var(--night); padding: 9px 20px; font-size: 21px; border-radius: 4px 10px 5px 12px; transform: rotate(-1deg); transition: transform .15s; }
.absolve:hover { transform: rotate(1deg) scale(1.05); }
.chips { display: grid; gap: 4px; margin-top: 22px; justify-items: start; }
.chip { text-align: left; color: var(--dim); font-style: italic; padding: 4px 0; font-size: .92em; line-height: 1.25; }
.chip:hover { color: var(--chalk); }
.chip::before { content: "† "; color: var(--halo); font-style: normal; }
.letter-wrap { margin: 0; }
.letter-wrap img { width: 100%; height: auto; display: block; transform: rotate(1.4deg); box-shadow: 0 0 60px rgba(91, 134, 255, .22); background: var(--paper); }
.letter-wrap figcaption { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.letter-wrap a { color: var(--halo); font-size: 19px; }
.letter-wrap .hand { color: var(--dim); font-size: 1.3em; line-height: 1; }

/* Atelier */
.sheet { margin: 0; }
.sheet img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }
.sheet figcaption { color: var(--ball); font-size: 1.7em; line-height: 1.05; transform: rotate(-1deg); margin-top: 6px; }
.placeholder { font-size: 1.3em; margin-top: 26px; font-style: italic; max-width: 40ch; }
.placeholder .hand { color: var(--ball); font-style: normal; }

/* Nur lesen */
body.reading canvas#world, body.reading #hud, body.reading #introUI, body.reading .back { display: none; }
body.reading .room { height: auto; position: static; clip-path: none !important; overflow: visible; display: block !important; }
body.reading #rooms::before { content: "Heilige Scheisse!!!"; display: block; font-family: var(--fraktur); font-weight: 700; text-align: center; font-size: clamp(60px, 13vw, 170px); line-height: 1; padding: 26px 16px 10px; background: var(--night); color: var(--chalk); }
body.reading .room-bar { display: none; }
body.reading .room .page { padding-top: 34px; }
#backToGame { display: none; }
body.reading #backToGame { display: block; position: fixed; z-index: 30; right: max(12px, env(safe-area-inset-right, 0px)); top: calc(10px + env(safe-area-inset-top, 0px)); background: var(--night); color: var(--chalk); padding: 7px 12px; font-size: 15px; border-radius: 3px 8px 4px 9px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
@media (max-width: 560px) {
  .meter-label { display: none; }
  #meter svg { width: 58px; height: 34px; }
  .ghost { font-size: 13px; padding: 7px 8px; }
  .edge-hint { font-size: 14px; }
  #keysHint { font-size: 12px; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
}

/* Handy quer: wenig Höhe */
@media (max-height: 480px) and (orientation: landscape) {
  .enter { padding: 3px 12px 4px; }
  .enter > .fraktur { font-size: 21px; }
  .enter-cta { font-size: 12px; }
  .edge-hint { bottom: 4px; font-size: 13px; padding: 6px 8px; }
  #keysHint { display: none; }
  #pullHint { bottom: 4px; font-size: 22px; }
  #meter svg { width: 58px; height: 34px; }
  .meter-label { display: none; }
}

/* ── Handy: Gamepad ── */
#pad { display: none; }
.touch #pad { display: flex; justify-content: space-between; align-items: flex-end; position: absolute; left: 0; right: 0; bottom: 0; padding: 0 max(14px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.touch .edge-hint { display: none; }
#pad button, #dpad { pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#dpad { display: flex; gap: 8px; }
#padActions { display: flex; gap: 10px; align-items: flex-end; }
#pad button { --size: 68px; width: var(--size); height: var(--size); display: grid; place-items: center; padding: 0; color: var(--chalk); background: rgba(7, 7, 16, .74); border: 2.5px solid var(--chalk); transition: transform .08s, background .08s, color .08s; }
#padL { border-radius: 46% 40% 44% 50% / 42% 48% 46% 44%; }
#padR { border-radius: 40% 48% 50% 42% / 46% 42% 44% 50%; }
#pad svg { width: 58%; height: 58%; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
#padJump { --size: 58px; border-radius: 50% 44% 48% 46%; font-size: 14px; margin-bottom: 26px; }
#padA { --size: 76px; border-radius: 46% 50% 44% 48%; font-size: 19px; }
#padA.ready { background: var(--ball); border-color: var(--chalk); animation: padPulse .68s ease-in-out infinite; }
#pad button.on { background: var(--chalk); color: var(--night); transform: scale(.93) rotate(-2deg); animation: none; }
@keyframes padPulse { 50% { transform: scale(1.08); } }
.touch #keysHint { color: var(--chalk); text-shadow: 0 0 6px var(--night), 0 0 3px var(--night), 0 0 2px var(--night); bottom: calc(102px + env(safe-area-inset-bottom, 0px)); }
.touch .enter { padding: 5px 16px 7px; }
.touch .enter-cta { display: none; }
.touch .ghost { min-height: 44px; }
canvas#world, #hud { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (max-height: 480px) and (orientation: landscape) {
  #pad button { --size: 62px; }
  #padJump { --size: 52px; margin-bottom: 20px; }
  #padA { --size: 68px; }
  .touch #pad { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .touch #meter { top: 6px; }
  .touch .top-actions { top: 2px; }
  .touch .enter { padding: 2px 12px 4px; }
}

/* ── Karte ── */
#map { position: fixed; inset: 0 0 auto; height: var(--app-h); touch-action: manipulation; z-index: 8; display: grid; place-items: center; background: rgba(7, 7, 16, .95); overflow: hidden; }
#map[hidden] { display: none; }
#mapClose { position: absolute; z-index: 2; top: calc(8px + env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); opacity: 1; min-height: 44px; }
.map-ring { --S: min(calc(100vw - 16px), calc(var(--app-h) - 16px), 680px); position: relative; width: var(--S); height: var(--S); }
.map-earth { position: absolute; left: 30%; top: 30%; width: 40%; height: 40%; opacity: .62; }
.map-title { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: calc(var(--S) * .095); text-shadow: 0 0 14px var(--night), 0 0 6px var(--night), 0 0 3px var(--night); pointer-events: none; }
#mapYou { position: absolute; width: calc(var(--S) * .15); height: auto; left: calc(50% + var(--x, 0) * var(--S) * .235); top: calc(50% + var(--y, -1) * var(--S) * .235); transform: translate(-50%, -50%); filter: drop-shadow(0 0 5px var(--star)); pointer-events: none; }
.map-house { position: absolute; width: calc(var(--S) * .27); left: calc(50% + var(--x) * var(--S) * .37); top: calc(50% + var(--y) * var(--S) * .37); transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 1px; padding: 2px; color: var(--chalk); transition: transform .12s; }
.map-house:hover, .map-house:active { transform: translate(-50%, -50%) scale(1.09) rotate(-2deg); }
.map-house img { height: calc(var(--S) * .19); width: auto; max-width: 100%; object-fit: contain; }
.map-house span { font-size: clamp(11px, calc(var(--S) * .032), 18px); line-height: 1.05; text-shadow: 0 0 6px var(--night); }
.map-house.done span { color: var(--halo); }

/* ── Steuerung am Computer ── */
#tutorial { position: fixed; inset: 0 0 auto; height: var(--app-h); z-index: 7; display: grid; place-items: start center; padding: clamp(8px, 2.5vh, 24px) 16px 16px; background: linear-gradient(rgba(7, 7, 16, .7) 60%, rgba(7, 7, 16, .12) 74%); animation: tutIn .35s ease both; }
#tutorial[hidden] { display: none; }
@keyframes tutIn { from { opacity: 0; } }
.tut-panel { display: grid; justify-items: center; gap: 6px; max-width: min(760px, 100%); padding: 26px clamp(20px, 4vw, 48px) 22px; background: var(--night); border: 3px solid var(--chalk); border-radius: 14px 26px 12px 30px / 24px 13px 28px 14px; transform: rotate(-.5deg); box-shadow: 0 0 70px rgba(91, 134, 255, .22); }
.tut-panel h2 { font-size: clamp(46px, 5.6vw, 76px); line-height: 1; }
.tut-try { color: var(--star); font-size: 27px; line-height: 1; transform: rotate(-1deg); }
.tut-keys { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 76px) minmax(0, 1fr); column-gap: 9px; row-gap: 9px; align-items: center; margin-block: 16px 20px; }
.tut-key { display: grid; place-items: center; width: 76px; height: 76px; color: var(--chalk); border: 3px solid var(--chalk); border-bottom-width: 7px; border-radius: 15px 20px 14px 22px / 20px 14px 22px 15px; transition: transform .07s, background .1s, color .1s, border-color .1s; }
.tut-key svg { width: 54%; height: 54%; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.k-up { grid-column: 3; grid-row: 2; }
.k-left { grid-column: 2; grid-row: 3; animation: tutHint 2.4s .1s infinite; }
.k-ghost { grid-column: 3; grid-row: 3; opacity: .2; }
.k-right { grid-column: 4; grid-row: 3; animation: tutHint 2.4s .9s infinite; }
.k-up { animation: tutHint 2.4s 1.7s infinite; }
@keyframes tutHint { 0%, 22%, 100% { background: transparent; color: var(--chalk); } 9% { background: var(--chalk); color: var(--night); } }
.tut-key.done { background: var(--ball); color: var(--chalk); animation: none; }
.tut-key.on { background: var(--chalk); color: var(--night); border-bottom-width: 3px; transform: translateY(4px); animation: none; }
.tut-label { font-size: 16px; line-height: 1.16; }
.tut-up { grid-column: 1 / -1; grid-row: 1; text-align: center; margin-bottom: 2px; }
.tut-left { grid-column: 1; grid-row: 3; text-align: right; padding-right: 8px; }
.tut-right { grid-column: 5; grid-row: 3; text-align: left; padding-left: 8px; }
.tut-go { background: var(--chalk); color: var(--night); padding: 10px 28px; font-size: 22px; border-radius: 5px 12px 6px 13px; transform: rotate(-1deg); transition: transform .12s; }
.tut-go:hover { transform: rotate(1deg) scale(1.05); }
.tut-more { color: var(--dim); font-style: italic; font-size: 16px; text-align: center; margin-top: 12px; }
@media (max-width: 640px), (max-height: 800px) {
  .tut-panel { padding: 14px 16px; }
  .tut-keys { grid-template-columns: minmax(0, 1fr) repeat(3, 52px) minmax(0, 1fr); margin-block: 8px 10px; }
  .tut-key { width: 52px; height: 52px; }
  .tut-label { font-size: 13px; }
  .tut-panel h2 { font-size: 38px; }
  .tut-try { font-size: 21px; }
  .tut-more { font-size: 14px; margin-top: 6px; }
}
