/* SPIELWERK – Oberfläche */
:root {
  --gold: #e7bd62; --gold2: #b8862f; --ink: #1b1424; --ink2: #261c33; --parch: #f4e9d0; --parch2: #e6d4ad;
  --txt: #f6efe2; --muted: #b9aec8; --acc: #e7bd62; --danger: #e0605b; --ok: #6fd39a;
  --hud-h: 58px; --inv-h: 112px; --stage-w: 1600px; --stage-h: 900px;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fs: 17px;
}
body[data-world="w1"] { --acc: #f2b660; }
body[data-world="w2"] { --acc: #5fc4e8; }
body[data-world="w3"] { --acc: #45d6b4; }
body[data-world="w4"] { --acc: #d98cf0; }
body[data-world="w5"] { --acc: #9ee06f; }
body[data-world="w6"] { --acc: #f08a5d; }
body[data-world="finale"] { --acc: #ffffff; }
body.big-text { --fs: 21px; --inv-h: 128px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #07050b; color: var(--txt); font-family: var(--sans); font-size: var(--fs); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 6px; }

#app { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--hud-h) minmax(0, 1fr) var(--inv-h); background: radial-gradient(ellipse at 50% 40%, #1d1528 0%, #0a070f 70%); }

/* ---------- HUD ---------- */
#hud { min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: linear-gradient(#1c1427, #120d1a); border-bottom: 1px solid #3a2c48; box-shadow: 0 4px 20px #0008; z-index: 5; }
.logo { font-family: var(--serif); font-weight: bold; letter-spacing: .18em; color: var(--gold); font-size: 1.15em; text-shadow: 0 0 12px #e7bd6255; white-space: nowrap; }
.logo span { color: var(--muted); font-size: .7em; letter-spacing: .05em; font-weight: normal; margin-left: 6px; }
#hud-place { flex: 1; text-align: center; font-family: var(--serif); font-size: 1.1em; color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .6s; }
#hud-crystals { display: flex; gap: 6px; }
.hud-crystal { width: 16px; height: 24px; clip-path: polygon(50% 0, 100% 30%, 78% 100%, 22% 100%, 0 30%); background: #2b2236; box-shadow: inset 0 0 0 2px #4a3d5a; transition: all .5s; }
.hud-crystal.has { background: linear-gradient(135deg, #fff, var(--c) 45%, #0006); filter: drop-shadow(0 0 6px var(--c)); }
#hud-timer { white-space: nowrap; font-variant-numeric: tabular-nums; background: #0006; padding: 4px 10px; border-radius: 20px; border: 1px solid #fff2; }
#hud-timer.paused { opacity: .6; }
.hud-btn { position: relative; background: #ffffff0d; border: 1px solid #ffffff22; border-radius: 10px; height: 40px; min-width: 40px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, transform .1s; }
.hud-btn:hover { background: #ffffff1f; }
.hud-btn:active { transform: scale(.96); }
.hud-btn.active { background: var(--acc); color: #1b1424; }
.hud-btn svg { width: 20px; height: 20px; }
.hud-btn .t { font-size: .85em; }
#wall-badge { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border-radius: 10px; font-size: 12px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }
.hud-btn.pulse { animation: pulseBtn 1.2s 3; }
@keyframes pulseBtn { 50% { box-shadow: 0 0 0 8px #e7bd6233; background: #e7bd6244; } }
#btn-sound.muted .snd-on { display: none; } #btn-sound:not(.muted) .snd-off { display: none; }

/* ---------- Bühne ---------- */
#stage-wrap { position: relative; overflow: hidden; }
#stage { position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: 50% 50%; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 1px #ffffff14, 0 30px 80px #000c; background: #000; }
#scene-bg, #scene-dyn { position: absolute; inset: 0; }
#scene-bg > svg, #scene-dyn > svg { width: 100%; height: 100%; display: block; }
#scene-dyn { pointer-events: none; }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
#hotspots { position: absolute; inset: 0; z-index: 2; }
.vignette { position: absolute; inset: 0; pointer-events: none; z-index: 4; background: radial-gradient(ellipse at 50% 45%, transparent 55%, #0009 100%); }

.hs { position: absolute; background: transparent; border: 0; padding: 0; cursor: pointer; border-radius: 18px; transition: box-shadow .2s, background .2s; }
.hs:hover, .hs:focus-visible { background: radial-gradient(ellipse, #ffffff1a, transparent 70%); box-shadow: 0 0 0 2px #ffffff55, 0 0 30px #ffe9b044; }
.hs-egg:hover { box-shadow: 0 0 0 2px #ffd86b88, 0 0 24px #ffd86b55; }
body.show-hs .hs:not(.hs-egg) { box-shadow: 0 0 0 3px #ffffffaa, 0 0 26px #ffe9b099; background: #ffffff12; animation: hsPulse 1.6s ease-in-out infinite; }
@keyframes hsPulse { 50% { box-shadow: 0 0 0 3px #ffffff44, 0 0 10px #ffe9b044; } }
body.holding .hs { cursor: copy; }
body.holding .hs:hover, .hs.drop-hover { box-shadow: 0 0 0 4px var(--acc), 0 0 40px var(--acc); background: #ffffff22; }
.hs > svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.hs-fig { border-radius: 40% 40% 12px 12px; }
.hs-fig.flip > svg { transform: scaleX(-1); }
.hs-fig:hover > svg { filter: drop-shadow(0 0 12px #fff8); }
.hs-exit { display: flex; align-items: center; justify-content: center; }
.exit-arrow { font-size: 54px; color: #fff; opacity: .38; text-shadow: 0 0 14px #000; transition: opacity .2s; pointer-events: none; }
.hs-exit:hover .exit-arrow, .hs-exit:focus-visible .exit-arrow, body.show-hs .hs-exit .exit-arrow { opacity: .9; }

#tip { position: fixed; transform: translate(-50%, calc(-100% - 10px)); background: #120d1aee; color: #fff; padding: 6px 12px; border-radius: 8px; font-size: .9em; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 50; white-space: nowrap; border: 1px solid #ffffff22; }
#tip.on { opacity: 1; }

/* Szenenwechsel */
#fade { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: var(--fade-col, #07050b); }
#fade.iris.on { clip-path: circle(150% at 50% 50%); animation: irisIn .6s ease-in forwards; pointer-events: all; }
#fade.iris.off { animation: irisOut .55s ease-out forwards; }
@keyframes irisIn { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(150% at 50% 50%); } }
@keyframes irisOut { from { clip-path: circle(150% at 50% 50%); } to { clip-path: circle(0% at 50% 50%); } }
#fade.fade.on { animation: fadeIn .6s forwards; pointer-events: all; } #fade.fade.off { animation: fadeOut .5s forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
#fade.off { clip-path: circle(0% at 50% 50%); }
#fade.fade.off { clip-path: none; opacity: 0; }

/* ---------- Dialog ---------- */
#dialog { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%) translateY(20px); bottom: calc(var(--inv-h) + 14px); width: min(calc(var(--stage-w) * .94), 1400px); min-height: 120px; display: none; gap: 18px; align-items: stretch; padding: 16px 22px 16px 16px; background: linear-gradient(180deg, #1f1630f2, #140e1ef7); border: 2px solid var(--acc); border-radius: 18px; box-shadow: 0 20px 60px #000c, inset 0 0 40px #0006; cursor: pointer; opacity: 0; transition: opacity .25s, transform .25s; }
#dialog.on { display: flex; opacity: 1; transform: translateX(-50%); }
#dialog.narr { border-color: #ffffff44; font-style: italic; }
#dialog.grey { border-color: #9a9ca8; background: linear-gradient(#2a2b31f2, #17181cf7); }
#dialog.choice { cursor: default; }
.dlg-portrait { width: 130px; flex: none; margin-top: -60px; filter: drop-shadow(0 6px 10px #000a); }
.dlg-portrait svg { width: 130px; height: 169px; }
.dlg-body { flex: 1; display: flex; flex-direction: column; justify-content: center; position: relative; }
.dlg-name { font-family: var(--serif); color: var(--acc); font-weight: bold; font-size: 1.05em; letter-spacing: .04em; margin-bottom: 4px; }
.dlg-text { font-size: 1.22em; line-height: 1.45; }
.dlg-text b { color: #ffe3a3; }
.dlg-next { position: absolute; right: 0; bottom: -4px; color: var(--acc); animation: nextBob 1s infinite; font-size: .9em; }
@keyframes nextBob { 50% { transform: translateY(4px); } }
.dlg-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.dlg-choice { text-align: left; background: #ffffff0c; border: 1px solid #ffffff2a; border-radius: 12px; padding: 10px 14px; cursor: pointer; font-size: 1.05em; transition: background .15s, border-color .15s, transform .1s; }
.dlg-choice:hover, .dlg-choice:focus-visible { background: #ffffff1c; border-color: var(--acc); transform: translateX(4px); }
.dlg-choice.done { opacity: .6; }
.dlg-choice .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--acc); color: #1b1424; font-weight: bold; font-size: .8em; margin-right: 6px; }

/* ---------- Inventar ---------- */
#inv-bar { display: flex; flex-direction: column; background: linear-gradient(#150f1d, #1d1528); border-top: 1px solid #3a2c48; padding: 6px 14px 8px; z-index: 5; }
#inv-status { min-height: 22px; font-size: .9em; color: var(--muted); }
#inv-status b { color: var(--acc); }
#inv-row { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 0; }
#inv-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .7em; letter-spacing: .25em; color: #8a7b9c; text-transform: uppercase; }
#inv { flex: 1; display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; height: 100%; align-items: center; scrollbar-width: thin; }
.inv-empty { color: #8a7b9c; font-style: italic; }
.inv-item { flex: none; width: calc(var(--inv-h) - 40px); height: calc(var(--inv-h) - 40px); background: radial-gradient(circle at 50% 35%, #3a2c4a, #1f1729); border: 2px solid #4a3a5c; border-radius: 14px; cursor: grab; position: relative; padding: 4px; touch-action: none; transition: transform .12s, border-color .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.inv-item:hover { transform: translateY(-3px); border-color: #8e78a8; }
.inv-item.sel { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc), 0 0 22px var(--acc); transform: translateY(-5px); }
.inv-item.new::after { content: ""; position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.inv-item.drop-hover { border-color: var(--acc); box-shadow: 0 0 20px var(--acc); }
.inv-item .ico { width: 70%; height: 62%; pointer-events: none; }
.inv-item .ico svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 3px #0008); }
.inv-item .nm { font-size: 10.5px; line-height: 1.1; text-align: center; color: #d9cfe6; pointer-events: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.drag-ghost { position: fixed; width: 76px; height: 76px; transform: translate(-50%, -50%) rotate(-8deg); pointer-events: none; z-index: 80; filter: drop-shadow(0 10px 14px #000c); }
.drag-ghost svg { width: 100%; height: 100%; }
body.dragging, body.dragging * { cursor: grabbing !important; }

.item-fly { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(.3); z-index: 60; text-align: center; pointer-events: none; animation: flyPop .5s cubic-bezier(.3, 1.6, .5, 1) forwards; transition: left .55s ease-in, top .55s ease-in, transform .55s ease-in, opacity .55s; }
.item-fly .ico { width: 170px; height: 170px; margin: auto; filter: drop-shadow(0 0 30px #ffe9b0aa); animation: spinY 2.2s ease-in-out infinite; }
.item-fly .ico svg { width: 100%; height: 100%; }
.item-fly .lbl { font-family: var(--serif); font-size: 1.6em; color: #fff; text-shadow: 0 2px 10px #000; margin-top: 6px; }
.item-fly.go { transform: translate(-50%, -50%) scale(.25); opacity: .2; }
@keyframes flyPop { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes spinY { 50% { transform: rotateY(25deg) translateY(-6px); } }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; top: calc(var(--hud-h) + 16px); transform: translate(-50%, -20px); max-width: min(760px, 92vw); background: #1d1528f2; border: 1px solid var(--acc); color: #fff; padding: 12px 20px; border-radius: 14px; box-shadow: 0 10px 40px #000a; z-index: 70; opacity: 0; pointer-events: none; transition: all .3s; text-align: center; line-height: 1.4; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Fenster ---------- */
#overlays { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.modal-wrap { position: absolute; inset: 0; background: #05030acc; backdrop-filter: blur(3px); display: grid; place-items: center; pointer-events: all; animation: fadeIn .2s; padding: 16px; }
.modal-wrap.out { animation: fadeOut .22s forwards; }
.modal { position: relative; width: min(720px, 96vw); max-height: 94vh; overflow: auto; background: linear-gradient(180deg, #241a33, #170f22); border: 2px solid var(--acc); border-radius: 20px; padding: 26px 30px 22px; box-shadow: 0 30px 90px #000, inset 0 0 60px #0006; animation: popIn .3s cubic-bezier(.3, 1.4, .5, 1); }
.modal.small { width: min(480px, 94vw); }
.modal.wide { width: min(1200px, 96vw); }
@keyframes popIn { from { transform: scale(.88); opacity: 0; } }
.modal-title { margin: 0 40px 14px 0; font-family: var(--serif); color: var(--acc); font-size: 1.5em; line-height: 1.2; }
.modal-body { line-height: 1.55; }
.modal-body p { margin: .5em 0; }
.modal-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #ffffff33; background: #ffffff0f; cursor: pointer; }
.modal-x:hover { background: #ffffff22; }
.btn { background: linear-gradient(180deg, var(--acc), color-mix(in srgb, var(--acc) 70%, #000)); color: #1b1424; border: 0; border-radius: 12px; padding: 11px 20px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 #0007; transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.1); } .btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0007; }
.btn.ghost { background: #ffffff12; color: var(--txt); border: 1px solid #ffffff33; }
.btn.danger { background: linear-gradient(#e46b66, #b2413d); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--acc); text-decoration: underline; cursor: pointer; padding: 2px 4px; }
.link.danger { color: #ff9b96; }
.txt { width: 100%; font: inherit; font-size: 1.1em; padding: 10px 12px; border-radius: 10px; border: 2px solid #ffffff33; background: #0005; color: #fff; }
.privacy { font-size: .85em; color: var(--muted); border-left: 3px solid var(--acc); padding-left: 10px; }

.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* Gegenstand im Detail */
.item-stage { perspective: 700px; height: 230px; display: grid; place-items: center; cursor: grab; background: radial-gradient(circle, #ffffff14, transparent 65%); border-radius: 16px; touch-action: none; }
.item-3d { width: 190px; height: 190px; transition: transform .08s; transform-style: preserve-3d; filter: drop-shadow(0 18px 18px #000a); }
.item-3d svg { width: 100%; height: 100%; }
.item-desc { font-size: 1.1em; }
.item-extra { background: var(--parch); color: #3a2a1a; border-radius: 10px; padding: 14px 18px; font-family: var(--serif); box-shadow: inset 0 0 30px #b8945a55; }
.item-extra table { border-collapse: collapse; width: 100%; } .item-extra td, .item-extra th { border-bottom: 1px dashed #b89a6a; padding: 4px 6px; text-align: left; }

/* Schloss */
.lock { display: flex; gap: 12px; justify-content: center; margin: 18px 0 6px; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wheel button { width: 56px; height: 34px; border-radius: 8px; border: 1px solid #ffffff33; background: #ffffff12; cursor: pointer; }
.wheel button:hover { background: #ffffff28; }
.wheel .val { width: 56px; height: 66px; text-align: center; font-family: var(--serif); font-size: 36px; font-weight: bold; border-radius: 10px; border: 2px solid var(--gold2); background: linear-gradient(#f6e7c4, #d2b47a); color: #3b2610; box-shadow: inset 0 4px 10px #0005; text-transform: uppercase; }
.wheel small { color: var(--muted); }
.lock-msg { text-align: center; min-height: 1.5em; color: var(--acc); }
.lock-modal.opened .lock .val { background: linear-gradient(#d9ffe8, #8fdcae); border-color: var(--ok); }

/* Karten */
.card-modal { background: transparent; border: 0; box-shadow: none; padding: 10px; }
.card-big { background: var(--parch); color: #2e2216; border-radius: 14px; padding: 26px 30px; font-family: var(--serif); box-shadow: 0 20px 60px #000, inset 0 0 50px #b58f5a66; position: relative; transform: rotate(-.6deg); }
.card-big h3 { margin: 4px 0 10px; font-size: 1.6em; color: #3b2410; }
.card-kind { font-family: var(--sans); font-size: .75em; letter-spacing: .14em; text-transform: uppercase; color: #8a6a3a; }
.card-text { font-size: 1.15em; line-height: 1.55; }
.card-src { margin-top: 14px; font-family: var(--sans); font-size: .78em; color: #7a6448; border-top: 1px dashed #b89a6a; padding-top: 8px; }
.card-insight .card-big { background: linear-gradient(135deg, #fff4cf, #f0d68f); box-shadow: 0 0 60px #ffd76a66, 0 20px 60px #000; }
.card-spur .card-big { background: linear-gradient(#cfd0d6, #a9abb4); color: #222; transform: rotate(1deg); }
.card-spur .card-big h3 { color: #222; } .card-spur .card-text { font-style: italic; font-size: 1.3em; }
.card-wissen .card-big { background: linear-gradient(#e8f1fb, #c9dcf0); }
.card-perspektive .card-big { background: linear-gradient(#e6f6dc, #c4e3b0); }
.card-pinned { text-align: center; color: var(--muted); }
.card-modal .modal-btns { justify-content: center; }
.card-modal .modal-x { top: 20px; right: 20px; background: #0003; color: #333; border-color: #0002; }

/* Easter Egg */
.egg-modal { border-color: #ffd86b; background: radial-gradient(circle at 50% 0%, #3d2a10, #170f22 60%); }
.egg-badge { display: inline-block; background: #ffd86b; color: #3b2610; font-family: var(--sans); font-size: .55em; padding: 3px 10px; border-radius: 20px; vertical-align: middle; margin-right: 6px; }
.egg-art { text-align: center; } .egg-art svg { width: 160px; height: 160px; filter: drop-shadow(0 0 20px #ffd86b66); animation: spinY 3s ease-in-out infinite; }
.egg-quote { display: flex; gap: 14px; align-items: center; background: #ffffff0c; border-radius: 14px; padding: 8px 14px; margin-top: 10px; }
.egg-quote svg { width: 70px; height: 91px; flex: none; }
.egg-ref { font-size: .82em; color: var(--muted); }

/* Hinweise */
.hint-poeppel { display: flex; gap: 18px; align-items: flex-start; }
.hint-poeppel > svg { width: 120px; height: 156px; flex: none; }
.hint-goal { background: #ffffff10; border-left: 4px solid var(--acc); padding: 8px 12px; border-radius: 6px; }
.hint-goal small { display: block; color: var(--muted); font-size: .75em; text-transform: uppercase; letter-spacing: .1em; }
.hint-step { animation: popIn .3s; }

.settings .row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.settings input[type=range] { flex: 1; accent-color: var(--acc); }
.settings input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--acc); }
.menu .modal-btns { flex-direction: column; align-items: stretch; }
.menu-info { color: var(--muted); }

/* Kristall-Animation */
.crystal-show { position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center; gap: 30px; background: radial-gradient(circle, #ffffff22, #05030add 60%); animation: fadeIn .4s; pointer-events: none; }
.crystal-show.out { animation: fadeOut .6s forwards; }
.crystal-big { width: 200px; animation: crystalRise 1.4s cubic-bezier(.2, 1.4, .4, 1); filter: drop-shadow(0 0 40px var(--c)); }
.crystal-big svg { width: 100%; animation: spinY 3s ease-in-out infinite; }
@keyframes crystalRise { from { transform: translateY(200px) scale(.2) rotate(-30deg); opacity: 0; } }
.crystal-txt { display: flex; flex-direction: column; gap: 6px; font-family: var(--serif); text-shadow: 0 2px 10px #000; animation: popIn .8s .4s both; }
.crystal-txt small { color: var(--muted); letter-spacing: .2em; text-transform: uppercase; font-family: var(--sans); }
.crystal-txt b { font-size: 2.6em; color: #fff; }
.crystal-txt span { font-size: 1.2em; } .crystal-txt em { color: #ffe08a; font-style: normal; font-size: 1.5em; font-weight: bold; }

/* Pause durch Spielleitung */
body.gm-paused::after { content: "⏸  Pause – die Spielleitung hat das Spiel angehalten"; position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: #05030aee; font-family: var(--serif); font-size: 2em; color: var(--gold); }

/* ---------- Titelbildschirm ---------- */
#title { position: fixed; inset: 0; z-index: 44; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(ellipse at 50% 30%, #2c1f3e, #0a070f 70%); overflow: auto; padding: 30px 16px; }
#title.on { display: flex; }
.title-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.title-bg i { position: absolute; bottom: -80px; width: 40px; height: 40px; opacity: .14; animation: floatUp linear infinite; border: 3px solid var(--gold); }
@keyframes floatUp { to { transform: translateY(-120vh) rotate(360deg); } }
.title-logo { text-align: center; position: relative; }
.title-logo h1 { margin: 0; font-family: var(--serif); font-size: clamp(48px, 9vw, 120px); letter-spacing: .14em; background: linear-gradient(180deg, #fff3cf, #e7bd62 45%, #9c6a22); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 24px #e7bd6255); animation: glowT 4s ease-in-out infinite; }
@keyframes glowT { 50% { filter: drop-shadow(0 6px 34px #e7bd62aa); } }
.title-logo p { margin: 0; font-family: var(--serif); font-size: clamp(18px, 2.4vw, 30px); color: #d9cbe9; letter-spacing: .08em; }
.title-logo .sub { font-family: var(--sans); font-size: .85em; color: var(--muted); letter-spacing: .25em; text-transform: uppercase; margin-top: 10px; }
#title-slots { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; position: relative; }
.slot { width: 250px; background: linear-gradient(#251a34ee, #170f22ee); border: 2px solid #4b3a5e; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.slot:not(.empty) { border-color: var(--gold2); }
.slot-h { font-size: .75em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.slot-g { font-family: var(--serif); font-size: 1.4em; margin: 0; color: #fff; }
.slot-p { margin: 0; color: var(--muted); }
.slot-c { display: flex; gap: 4px; } .slot-c i { width: 12px; height: 18px; clip-path: polygon(50% 0, 100% 30%, 78% 100%, 22% 100%, 0 30%); background: #3a2d4a; } .slot-c i.on { background: var(--gold); }
.slot.empty p { color: #8a7b9c; font-style: italic; margin: 18px 0; }
.title-foot { display: flex; gap: 12px; position: relative; flex-wrap: wrap; justify-content: center; }
.title-note { position: relative; color: #8a7b9c; font-size: .82em; text-align: center; max-width: 700px; }

/* ---------- Ermittlungswand ---------- */
.wall-modal { width: min(1500px, 98vw); height: 94vh; display: flex; flex-direction: column; background: #2a1d14; border-color: #c49a5a; padding: 18px 20px 14px; }
.wall-modal .modal-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wall-help { color: #e8d9bd; font-size: .95em; margin-bottom: 10px; }
.wall-count, .wall-progress { float: right; background: #0004; padding: 2px 10px; border-radius: 12px; color: #ffe1a0; font-weight: bold; }
.wall-board { position: relative; flex: 1; overflow: auto; border-radius: 12px; background: radial-gradient(circle at 20% 30%, #b88a55 0 2px, transparent 3px) 0 0/23px 23px, radial-gradient(circle at 70% 60%, #8d6337 0 1.5px, transparent 2.5px) 0 0/17px 17px, linear-gradient(135deg, #a8773f, #8a5c2c); box-shadow: inset 0 0 0 10px #5a3a1c, inset 0 0 60px #0007; padding: 22px 20px 30px; }
.wall-threads { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; overflow: visible; }
.thread { fill: none; stroke: #c0182b; stroke-width: 3; filter: drop-shadow(0 2px 2px #0007); stroke-linecap: round; }
.thread.good { stroke: #ffd24d; stroke-width: 4; }
.thread.snap { stroke-dasharray: 6 10; animation: snap .9s forwards; }
@keyframes snap { to { opacity: 0; stroke-dashoffset: 60; } }
.wall-cards { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 14px; position: relative; z-index: 1; min-width: 1100px; }
.wall-cards.two { grid-template-columns: 1fr 1fr; gap: 160px; min-width: 0; max-width: 1100px; margin: 0 auto; }
.wall-col { display: flex; flex-direction: column; gap: 14px; }
.wall-col-h { text-align: center; font-family: var(--serif); font-weight: bold; color: #fff; background: color-mix(in srgb, var(--c, #c9a45c) 70%, #000); padding: 6px; border-radius: 6px; box-shadow: 0 3px 6px #0006; font-size: .9em; }
.wcard { position: relative; background: var(--parch); color: #2e2216; border-radius: 4px; padding: 16px 12px 10px; box-shadow: 0 6px 12px #0008; transform: rotate(var(--rot)); cursor: pointer; transition: transform .15s, box-shadow .15s; font-size: .88em; line-height: 1.3; }
.wcard:hover { transform: rotate(0) scale(1.04); z-index: 3; }
.wcard.sel { box-shadow: 0 0 0 4px #ffd24d, 0 10px 24px #000a; transform: rotate(0) scale(1.06); z-index: 4; }
.wcard small { display: block; font-size: .72em; letter-spacing: .12em; text-transform: uppercase; color: #8a6a3a; }
.wcard b { display: block; font-family: var(--serif); font-size: 1.05em; margin: 2px 0 6px; }
.wcard .pin { position: absolute; top: -6px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a8a, #b01c2c); box-shadow: 0 3px 4px #0008; }
.wcard-insight { background: linear-gradient(135deg, #fff4cf, #f0d68f); }
.wcard-insight .pin { background: radial-gradient(circle at 35% 35%, #fff2a8, #c9971c); }
.wcard-spur { background: linear-gradient(#d4d5da, #a9abb4); font-style: italic; }
.wcard-wissen { background: linear-gradient(#eef5fc, #cfe0f2); }
.wcard-perspektive { background: linear-gradient(#ecf8e3, #c9e7b6); }
.wread { font-size: .78em; background: #0001; border: 1px solid #0003; border-radius: 6px; padding: 2px 8px; cursor: pointer; color: #3b2a1a; }
.wread:hover { background: #0002; }
.finale .wcard { font-size: 1em; }
.wall-dossier.left { right: auto; left: 18px; transform: rotate(-3deg); }
.wall-dossier { position: absolute; right: 18px; bottom: 16px; width: 150px; background: #e9dcc0; color: #3a2a1a; padding: 8px; border-radius: 4px; box-shadow: 0 8px 16px #0009; transform: rotate(3deg); z-index: 3; text-align: center; font-family: var(--serif); }
.dossier-h { font-weight: bold; font-size: .85em; }
.dossier-pic { position: relative; width: 120px; height: 150px; margin: 4px auto; background: #555a; overflow: hidden; }
.dossier-pic svg { width: 100%; height: 100%; }
.dossier-cover { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
.dossier-cover i { background: repeating-linear-gradient(45deg, #2b2b33, #2b2b33 6px, #34343e 6px, #34343e 12px); border: 1px solid #0005; transition: opacity .6s; }
.dossier-cover i.off { opacity: 0; }

/* Spielleitungs-Nachricht */
.gm-msg { border-color: #7fd3ff; }

/* Schmale Bildschirme */
@media (max-width: 1150px) { .logo span, .hud-btn .t { display: none; } #hud { gap: 8px; } }
@media (max-width: 560px) { .logo { font-size: .9em; letter-spacing: .08em; } #hud-crystals, #hud-place { display: none; } .hud-btn { min-width: 34px; padding: 0 8px; } }
@media (max-width: 760px) {
  :root { --hud-h: 50px; --inv-h: 96px; --fs: 15px; }
  .logo span, .hud-btn .t { display: none; }
  #hud { gap: 6px; padding: 0 8px; }
  #hud-place { font-size: .9em; }
  .dlg-portrait { width: 80px; margin-top: -30px; } .dlg-portrait svg { width: 80px; height: 104px; }
  #dialog { width: 96vw; padding: 10px 12px; }
  .dlg-text { font-size: 1.05em; }
  .modal { padding: 20px 16px; }
}
@media (max-height: 560px) { #hud-crystals { display: none; } }

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }

/* Sektor-Titelkarte & Leitsätze */
.sector-card { position: fixed; inset: 0; z-index: 62; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; pointer-events: none; background: radial-gradient(ellipse, #000a 0%, transparent 70%); animation: fadeIn .6s; text-align: center; }
.sector-card.out { animation: fadeOut .7s forwards; }
.sector-card small { font-family: var(--sans); letter-spacing: .35em; color: var(--c); font-size: 1em; text-shadow: 0 0 20px var(--c); animation: popIn .8s both; }
.sector-card b { font-family: var(--serif); font-size: clamp(30px, 5vw, 64px); color: #fff; text-shadow: 0 4px 30px #000, 0 0 40px var(--c); animation: popIn .9s .2s both; }
.sector-card span { color: #ddd; letter-spacing: .15em; text-transform: uppercase; font-size: .9em; animation: popIn .9s .5s both; }
.crystal-txt .leitsatz { font-family: var(--sans); font-style: normal; letter-spacing: .18em; font-size: 1.05em; color: #fff; margin-top: 8px; }
.card-leit { font-family: var(--sans); font-size: .8em; letter-spacing: .14em; color: #8a5a10; font-weight: bold; margin-bottom: 8px; }
.ep-leit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.ep-leit div { background: #ffffff0c; border-left: 4px solid var(--c); border-radius: 8px; padding: 8px 10px; font-size: .85em; letter-spacing: .08em; }
.ep-leit small { display: block; color: var(--muted); letter-spacing: 0; }
@media (max-width: 760px) { .ep-leit { grid-template-columns: 1fr; } }
.wall-modal:not(.finale) .wall-board { padding-right: 190px; }

/* Hinweis-Kompass mit Suse, Nadine und Pöppel */
.hint-bubble { display: flex; gap: 14px; align-items: flex-start; background: #ffffff0c; border-radius: 16px; padding: 10px 14px 10px 8px; margin: 10px 0; animation: popIn .35s; border-left: 4px solid var(--hb, var(--acc)); }
.hint-bubble > svg { width: 84px; height: 109px; flex: none; margin-top: -6px; }
.hint-bubble b { display: block; color: var(--hb, var(--acc)); font-family: var(--serif); font-size: 1.05em; }
.hint-bubble small { display: block; color: var(--muted); font-style: italic; }
.hint-bubble p { margin: 4px 0 0; font-size: 1.05em; }
.hint-suse { --hb: #6fa8dc; } .hint-nadine { --hb: #e85d8a; } .hint-poeppel { --hb: #e7bd62; }
.hint-team { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hint-team svg { width: 74px; height: 96px; }
.hint-team p { flex: 1 1 220px; margin-left: 8px; }

/* Schwierigkeitsgrade */
.modal.diff-modal { width: min(760px, 94vw); }
.diff-h { margin: 14px 0 6px; font-weight: 700; color: var(--acc); }
.diff-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.diff-opt { cursor: pointer; display: block; }
.diff-opt input { position: absolute; opacity: 0; pointer-events: none; }
.diff-card { display: block; height: 100%; padding: 12px; border-radius: 14px; border: 2px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); transition: border-color .15s, background .15s, transform .15s; }
.diff-card b { display: block; font-size: 1.1em; margin-bottom: 4px; }
.diff-card i { font-style: normal; margin-right: 6px; }
.diff-card small { color: var(--muted); line-height: 1.35; display: block; }
.diff-opt:hover .diff-card { transform: translateY(-2px); }
.diff-opt input:checked + .diff-card { border-color: var(--acc); background: rgba(231,189,98,.12); box-shadow: 0 0 0 3px rgba(231,189,98,.18); }
.diff-opt input:focus-visible + .diff-card { outline: 3px solid var(--acc); outline-offset: 2px; }
@media (max-width: 700px) { .diff-pick { grid-template-columns: 1fr; } }

/* Intro */
.intro { position: fixed; inset: 0; z-index: 85; background: #07050b; display: grid; grid-template-rows: 1fr auto auto; animation: fadeIn .5s; }
.intro.out { animation: fadeOut .6s forwards; }
.intro-stage { position: relative; overflow: hidden; cursor: pointer; }
.intro-scene { position: absolute; inset: 0; animation: inScene 1.1s ease both; }
.intro-scene.out { animation: outScene .9s ease forwards; }
.intro-art { position: absolute; inset: 0; width: 100%; height: 100%; animation: kenBurns 14s ease-out both; }
.intro-fig { position: absolute; animation: rise .9s cubic-bezier(.3,1.3,.5,1) both; }
.intro-fig.flip svg { transform: scaleX(-1); }
.intro-fig svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 18px #000a); }
.intro-text { max-width: 980px; margin: 0 auto; padding: 18px 26px 6px; font-family: var(--serif); font-size: clamp(17px, 2.1vw, 26px); line-height: 1.5; text-align: center; color: var(--txt); opacity: 0; }
.intro-text.in { animation: inText .9s .25s ease forwards; }
.intro-text b { color: var(--gold, #e7bd62); }
.intro-ctrl { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 10px 16px 22px; flex-wrap: wrap; }
.intro-dots { display: flex; gap: 6px; margin-right: 10px; }
.intro-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ffffff22; transition: background .3s; }
.intro-dots i.on { background: var(--acc); }
@keyframes inScene { from { opacity: 0; } to { opacity: 1; } }
@keyframes outScene { to { opacity: 0; } }
@keyframes kenBurns { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes inText { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.in-pulse { animation: pulseS 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.in-flicker { animation: flicker 3s infinite; }
.in-greywipe { animation: greyWipe 4s 0.6s ease-in-out both; }
@keyframes greyWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.in-shadow { animation: shadowMove 4.6s .3s ease-in-out both; }
@keyframes shadowMove { from { transform: translateX(-120px); } to { transform: translateX(1500px); } }
.in-fly { animation: flyOut 1.6s .5s cubic-bezier(.4,0,.2,1) both; }
@keyframes flyOut { from { transform: translate(0,0) scale(1.4); } to { transform: translate(var(--dx), var(--dy)) scale(1); } }
.in-burst { animation: burstOut 1.2s .4s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes burstOut { from { transform: scale(.2); opacity: 1; } to { transform: scale(6); opacity: 0; } }
body.reduce-motion .intro-art, body.reduce-motion .in-shadow, body.reduce-motion .in-greywipe, body.reduce-motion .in-fly { animation-duration: .01s; }

#btn-home { border-color: #e7bd6266; }

/* Kleine Tipps */
.tips-opt { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: #ffffff0a; border: 1px solid #ffffff1c; cursor: pointer; }
.tips-opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--acc); flex: none; }
.tips-opt small { display: block; color: var(--muted); }
.tip-nudge { position: fixed; left: 18px; bottom: calc(var(--inv-h, 110px) + 16px); z-index: 42; display: flex; gap: 10px; align-items: flex-end; max-width: min(520px, 92vw); padding: 12px 40px 12px 10px; border-radius: 18px; background: linear-gradient(180deg, #2a1f38f5, #1a1226f8); border: 2px solid #7fc4e8; box-shadow: 0 16px 40px #000b; animation: nudgeIn .5s cubic-bezier(.3,1.4,.5,1); }
.tip-nudge.out { animation: fadeOut .4s forwards; }
.tip-nudge > svg { width: 74px; height: 96px; flex: none; }
.tip-nudge b { display: block; color: #7fc4e8; }
.tip-nudge small { color: var(--muted); }
.tip-nudge p { margin: 4px 0 6px; line-height: 1.4; }
.tn-btns { display: flex; gap: 14px; }
.tn-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #ffffff33; background: #ffffff10; color: #fff; cursor: pointer; }
@keyframes nudgeIn { from { opacity: 0; transform: translateY(30px) scale(.9); } }

/* Easter-Egg-Kompass */
.egg-compass { border-color: #ffd86b; }
.ec-head { display: flex; gap: 14px; align-items: center; background: #ffffff0a; border-radius: 14px; padding: 8px 14px; }
.ec-head > svg { width: 70px; height: 91px; flex: none; }
.ec-bar { height: 10px; border-radius: 6px; background: #ffffff18; margin-top: 8px; overflow: hidden; }
.ec-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd86b, #f08a5d); }
.ec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-top: 14px; }
.ec-world { border: 1px solid #ffffff1c; border-left: 5px solid var(--c); border-radius: 12px; padding: 8px 12px; background: #ffffff06; }
.ec-world h4 { margin: 0 0 8px; display: flex; justify-content: space-between; color: var(--c); font-family: var(--serif); }
.ec-world h4 span { color: var(--txt); font-family: var(--sans); font-size: .9em; }
.ec-eggs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ec-egg { text-align: center; font-size: .78em; line-height: 1.25; padding: 6px 4px; border-radius: 10px; background: #00000030; }
.ec-egg svg { width: 44px; height: 44px; display: block; margin: 0 auto 2px; }
.ec-egg.found { background: #ffd86b18; }
.ec-q { width: 40px; height: 40px; margin: 0 auto 4px; border-radius: 50%; border: 2px dashed #ffd86b88; display: grid; place-items: center; font-weight: 800; color: #ffd86b; }
.ec-egg .link { display: block; margin: 4px auto 0; font-size: 1em; }
body.egg-glow .hs-egg { box-shadow: 0 0 0 3px #ffd86b, 0 0 34px #ffd86bcc; background: #ffd86b22; animation: hsPulse 1.2s ease-in-out infinite; }

/* Großer Rückweg-Button im Finale */
.hs-bigbtn > svg { filter: drop-shadow(0 0 18px #e7bd62aa); }
.hs-bigbtn:hover > svg { transform: scale(1.04); }

/* Easter-Egg-Party */
.egg-party { position: fixed; inset: 0; z-index: 29; pointer-events: none; overflow: hidden; animation: fadeIn .6s; }
.egg-party.out { animation: fadeOut .7s forwards; }
.ep-disco { position: absolute; inset: 0; background: conic-gradient(from 0deg at 50% 0%, #ff5ea833, #5fc4e833, #9ee06f33, #f2c14e33, #d98cf033, #ff5ea833); mix-blend-mode: screen; animation: spin 6s linear infinite; transform-origin: 50% 0%; }
.ep-ball { position: absolute; left: 50%; top: -20px; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #b8b8c8 40%, #55556a); animation: epDrop 1.4s cubic-bezier(.3,1.4,.5,1) both, spin 4s linear infinite; box-shadow: 0 0 60px #fff8; }
.ep-ball i { position: absolute; width: 12px; height: 12px; left: calc(50% - 6px + 44px * cos(calc(var(--i) * 11.25deg))); top: calc(50% - 6px + 44px * sin(calc(var(--i) * 11.25deg))); background: #f4e9d0; border-radius: 3px; opacity: .8; }
@keyframes epDrop { from { transform: translateY(-160px); } to { transform: translateY(40px); } }
.ep-title { position: absolute; left: 0; right: 0; top: 190px; text-align: center; font-family: var(--serif); font-size: clamp(30px, 5vw, 64px); font-weight: 800; color: #ffd86b; text-shadow: 0 0 30px #ffd86b99, 0 4px 0 #7a4a10; animation: rise 1s .4s both; letter-spacing: .04em; }
.ep-line { position: absolute; left: 0; bottom: 120px; display: flex; gap: 6px; width: max-content; transform: translateX(-110%); }
.egg-party.dance .ep-line { animation: conga 5.2s linear forwards; }
.ep-dancer { width: 110px; animation: danceBob .45s ease-in-out infinite alternate; animation-delay: calc(var(--d) * -.11s); }
.ep-dancer svg { width: 100%; height: auto; filter: drop-shadow(0 8px 10px #000a); }
@keyframes conga { from { transform: translateX(-110%); } to { transform: translateX(110vw); } }
@keyframes danceBob { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-18px) rotate(6deg); } }

/* Urkunde */
.egg-cert { position: relative; text-align: center; padding: 26px 30px 18px; border-radius: 14px; background: radial-gradient(circle at 50% 0%, #fffaf0, #f4e9d0); color: #3a2614; border: 6px double #c9a45c; }
.egg-cert h3 { font-family: Georgia, serif; font-size: 2.2em; margin: 6px 0; color: #8a5a10; }
.egg-cert .ec-name { display: block; font-family: Georgia, serif; font-size: 1.8em; margin: 4px 0 8px; border-bottom: 2px solid #c9a45c; padding-bottom: 4px; }
.ec-seal { position: absolute; top: 14px; right: 18px; width: 64px; height: 64px; border-radius: 50%; background: #c43c32; color: #ffd86b; display: grid; place-items: center; font-size: 34px; box-shadow: 0 0 0 4px #e7bd62; }
.ec-sign { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-family: Georgia, serif; }
.ec-sign small { color: #7a5a3a; }
.ec-figs { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.ec-figs svg { width: 80px; height: 104px; }
@media print {
  body.print-cert * { visibility: hidden !important; }
  body.print-cert .egg-cert, body.print-cert .egg-cert * { visibility: visible !important; }
  body.print-cert .egg-cert { position: fixed; left: 5%; top: 5%; width: 90%; }
}

/* Weltenkarte */
.wm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.wm-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border-radius: 16px; border: 2px solid var(--c); background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--c) 30%, transparent), #170f22 70%); color: var(--txt); cursor: pointer; font: inherit; transition: transform .15s, box-shadow .15s; }
.wm-card:hover, .wm-card:focus-visible { transform: translateY(-3px); box-shadow: 0 0 24px color-mix(in srgb, var(--c) 60%, transparent); }
.wm-card.here { outline: 3px dashed var(--c); outline-offset: 3px; }
.wm-sym { width: 64px; height: 64px; display: grid; place-items: center; font-size: 34px; color: var(--c); }
.wm-sym svg { width: 64px; height: 64px; }
.wm-card small { color: var(--muted); text-align: center; }

/* ---------- Handy quer (Landscape, wenig Höhe) ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --hud-h: 40px; --inv-h: 0px; --inv-w: 82px; --fs: 14px; }
  #app { grid-template-columns: minmax(0, 1fr) var(--inv-w); grid-template-rows: var(--hud-h) minmax(0, 1fr); }
  #hud { grid-column: 1 / -1; gap: 6px; padding: 0 8px; }
  .logo { font-size: .85em; letter-spacing: .08em; } .logo span, .hud-btn .t, #hud-crystals { display: none; }
  #hud-place { font-size: .85em; }
  .hud-btn { height: 32px; min-width: 32px; padding: 0 7px; }
  #hud-timer { font-size: .85em; }
  #stage-wrap { grid-column: 1; grid-row: 2; }
  #inv-bar { grid-column: 2; grid-row: 2; padding: 4px; border-top: 0; border-left: 1px solid #3a2c48; }
  #inv-row { flex-direction: column; gap: 4px; }
  #inv-label { display: none; }
  #inv { flex-direction: column; overflow-y: auto; overflow-x: hidden; gap: 6px; padding: 2px 0; justify-content: flex-start; }
  .inv-item { width: 70px; height: 70px; border-radius: 12px; }
  .inv-item .nm { font-size: 9px; }
  .inv-empty { font-size: .7em; text-align: center; padding-top: 8px; }
  #inv-status { position: fixed; left: 8px; top: calc(var(--hud-h) + 6px); z-index: 20; min-height: 0; max-width: 60vw; font-size: .8em; background: #120d1acc; border-radius: 10px; padding: 3px 10px; }
  #inv-status:empty { display: none; }
  #dialog { bottom: 8px; width: calc(var(--stage-w) * .98); min-height: 0; padding: 8px 12px 8px 8px; gap: 10px; border-radius: 14px; }
  .dlg-portrait { width: 64px; margin-top: -22px; } .dlg-portrait svg { width: 64px; height: 83px; }
  .dlg-text { font-size: .98em; line-height: 1.35; }
  .dlg-choice { padding: 6px 10px; font-size: .95em; }
  .dlg-choices { gap: 5px; margin-top: 6px; }
  .modal { padding: 14px 16px 12px; max-height: 96vh; border-radius: 14px; }
  .modal-title { font-size: 1.15em; margin-bottom: 8px; }
  .modal-btns { margin-top: 10px; }
  .modal-wrap { padding: 6px; }
  .tip-nudge { bottom: 8px; left: 8px; max-width: 70vw; padding: 8px 34px 8px 8px; }
  .tip-nudge > svg { width: 48px; height: 62px; }
  .intro-text { font-size: 15px; padding: 8px 16px 2px; }
  .intro-ctrl { padding: 6px 10px 10px; }
  #title { gap: 10px; padding: 10px; }
  .title-logo h1 { font-size: 2.4em; margin: 0; } .title-logo .sub { display: none; }
  .title-note { display: none; }
  .slot { padding: 10px 14px; }
}

/* ---------- Handy hochkant: Bitte drehen ---------- */
#rotate-hint { display: none; }
@media (orientation: portrait) and (max-width: 640px) {
  body:not(.rotate-ok) #rotate-hint { display: flex; position: fixed; inset: 0; z-index: 95; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 30px; text-align: center; background: radial-gradient(ellipse at 50% 30%, #2c1f3e, #0a070f 70%); }
  #rotate-hint .rh-phone { width: 70px; height: 120px; border: 5px solid var(--gold, #e7bd62); border-radius: 14px; animation: rhTurn 2.4s ease-in-out infinite; }
  #rotate-hint p { font-size: 1.1em; line-height: 1.5; margin: 0; }
  @keyframes rhTurn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
}

/* Sichere Ränder (Notch/Kamera-Aussparung auf Handys) */
#app { padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); }

.suse-spruch { font-style: italic; color: #9fd0ff; font-size: .92em; margin-top: 4px !important; }

/* ---------- Handy quer: besser lesbar (v0.6.3) ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --hud-h: 32px; --inv-w: 70px; --fs: 16px; }
  .logo, #hud-timer { display: none; }
  #hud { gap: 4px; padding: 0 6px; }
  #hud-place { font-size: .8em; text-align: left; }
  .hud-btn { height: 28px; min-width: 30px; padding: 0 5px; border-radius: 8px; }
  .hud-btn svg { width: 18px; height: 18px; }
  .inv-item { width: 60px; height: 60px; }
  .inv-item .nm { font-size: 8.5px; }
  /* Dialog: größere Schrift, darf höher werden, bleibt scrollbar */
  #dialog { bottom: 4px; width: calc(100vw - var(--inv-w) - 12px); left: calc((100vw - var(--inv-w)) / 2); max-height: 62vh; overflow-y: auto; padding: 8px 12px 8px 6px; gap: 8px; }
  .dlg-portrait { width: 52px; margin-top: 0; } .dlg-portrait svg { width: 52px; height: 68px; }
  .dlg-name { font-size: .85em; margin-bottom: 2px; }
  .dlg-text { font-size: 1.02em; line-height: 1.38; }
  .dlg-choice { font-size: 1em; padding: 7px 10px; }
  /* Fenster nutzen den ganzen Bildschirm */
  .modal-wrap { padding: 0; }
  .modal, .modal.small, .modal.wide, .modal.diff-modal { width: 100vw; max-height: 100dvh; height: auto; border-radius: 0; border-width: 0 0 0 0; padding: 12px 14px 10px; font-size: 15px; }
  .modal-title { font-size: 1.1em; margin: 0 40px 6px 0; }
  .modal-x { top: 6px; right: 8px; width: 34px; height: 34px; }
  .modal-btns .btn { padding: 9px 14px; font-size: 15px; }
  #toast { top: calc(var(--hud-h) + 6px); font-size: 14px; padding: 8px 14px; }
  #tip { font-size: 13px; }
  .tip-nudge p { font-size: 15px; }
}
/* Vollbild-Knopf für Handys */
#fs-btn { display: none; }
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  body:not(.on-title):not(.is-fullscreen) #fs-btn { display: flex; position: fixed; z-index: 41; left: 6px; top: calc(var(--hud-h) + 6px); align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid #e7bd6288; background: #1d1528e6; color: #fff; font: inherit; font-size: 13px; }
}

/* ---------- Festtags-Modi (seit 0.8.1) ---------- */
#fest-deko { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
#fest-deko > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fest-tint { position: absolute; inset: 0; }
body.fest-halloween .fest-tint { background: radial-gradient(ellipse at 50% 45%, transparent 38%, rgba(28, 0, 48, .58) 100%), linear-gradient(rgba(50, 15, 80, .24), rgba(255, 110, 0, .08)); }
body.fest-weihnachten .fest-tint { background: linear-gradient(rgba(180, 215, 255, .2), transparent 45%), linear-gradient(transparent 82%, rgba(255, 255, 255, .14)); }
body.fest-ostern .fest-tint { background: linear-gradient(rgba(255, 245, 210, .13), rgba(215, 255, 205, .1)); }
body.fest-silvester .fest-tint { background: linear-gradient(rgba(15, 15, 60, .4), transparent 52%); }
body.fest-weltspieltag .fest-tint { background: radial-gradient(circle at 88% 0%, rgba(255, 230, 120, .34), transparent 42%); }
.fest-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
#title .fest-fx { position: fixed; z-index: 0; }
.fest-fx i { position: absolute; top: -24px; width: var(--s); height: var(--s); background: var(--c); opacity: .85; animation: festFall linear infinite; }
#title .fest-fx i { animation-name: festFallT; }
@keyframes festFall { from { transform: translate(0, -30px) rotate(0); } to { transform: translate(var(--dx), 980px) rotate(540deg); } }
@keyframes festFallT { from { transform: translate(0, -30px) rotate(0); } to { transform: translate(var(--dx), 110vh) rotate(540deg); } }
body.fest-weihnachten .fest-fx i { border-radius: 50%; opacity: .9; box-shadow: 0 0 6px #fff9; }
body.fest-ostern .fest-fx i { border-radius: 70% 0 70% 0; opacity: .8; }
body.fest-halloween .fest-fx i { border-radius: 0 70% 0 70%; opacity: .75; }
body.fest-fasching .fest-fx i { height: calc(var(--s) * .55); }
body.fest-weltspieltag .fest-fx i { top: auto; bottom: -30px; background: radial-gradient(circle at 35% 35%, #ffffffcc, #a5d8ff33 60%, transparent 70%); border: 1.5px solid #ffffffaa; border-radius: 50%; width: calc(var(--s) * 1.8); height: calc(var(--s) * 1.8); animation-name: festRise; }
body.fest-weltspieltag #title .fest-fx i { animation-name: festRiseT; }
@keyframes festRise { from { transform: translate(0, 0); } to { transform: translate(var(--dx), -980px); } }
@keyframes festRiseT { from { transform: translate(0, 0); } to { transform: translate(var(--dx), -110vh); } }
body.fest-silvester .fest-fx i, body.fest-silvester #title .fest-fx i { clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); animation-name: festTwinkle; animation-timing-function: ease-in-out; width: calc(var(--s) * 1.6); height: calc(var(--s) * 1.6); }
@keyframes festTwinkle { 0%, 100% { opacity: .12; transform: scale(.6); } 50% { opacity: .9; transform: scale(1); } }
.fest-licht { animation: festLicht 2.8s ease-in-out infinite alternate; }
@keyframes festLicht { from { opacity: .5; } to { opacity: 1; } }
.fest-funkeln { animation: festFunkeln 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes festFunkeln { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.fest-glimmen { animation: festLicht 1.8s ease-in-out infinite alternate; }
.fest-geist { animation: festSchweben 5s ease-in-out infinite; }
@keyframes festSchweben { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
body.reduce-motion .fest-fx { display: none; }
body.reduce-motion .fest-licht, body.reduce-motion .fest-funkeln, body.reduce-motion .fest-glimmen, body.reduce-motion .fest-geist { animation: none; }
.hs-fest svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px #0007); }
.hs-fest.fest-an { cursor: default; }
.fest-titel { color: #e7bd62; letter-spacing: .08em; margin: 8px 0 0; font-weight: 700; font-size: 1.05em; }
.fest-feier-figs { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.fest-feier-figs svg { width: 100px; height: 130px; }
.fest-feier p { text-align: center; font-size: 1.08em; }
.fest-stand { background: #e7bd6222; border-radius: 10px; padding: 8px 12px; }
.fest-wissen { background: #ffffff0d; border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.fest-wissen p { margin: 4px 0 0; }
.fest-kal { columns: 2; padding-left: 18px; margin: 10px 0; }
.fest-kal li { break-inside: avoid; margin-bottom: 4px; }
.advent-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.advent-tuer { min-height: 54px; border-radius: 10px; border: 2px solid #e7bd62; background: #7a2323; color: #f4e9d0; font: inherit; font-size: 1.25em; cursor: pointer; padding: 4px; overflow-wrap: anywhere; }
.advent-tuer:nth-child(3n+2) { background: #24603a; }
.advent-tuer:nth-child(3n) { background: #6b4a1d; }
.advent-tuer.auf { background: #f4e9d0; color: #3b2a1c; }
.advent-tuer small { font-size: .62em; line-height: 1.1; display: block; }
.advent-tuer.zu { opacity: .45; cursor: not-allowed; }
.advent-inhalt { min-height: 50px; margin-top: 12px; background: #ffffff0d; border-radius: 12px; padding: 10px 14px; }
.advent-inhalt:empty { display: none; }
.settings select { font: inherit; max-width: 100%; }
.fest-info { margin-top: -4px; }
@media (max-width: 760px), (max-height: 500px) {
  .fest-kal { columns: 1; }
  .advent-grid { grid-template-columns: repeat(6, 1fr); gap: 5px; }
  .advent-tuer { min-height: 38px; font-size: 1em; }
  .fest-feier-figs svg { width: 64px; height: 83px; }
}
/* Festtags-Vorschau (seit 0.8.1) */
.fv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fv-tab.on { background: #e7bd6233; border-color: #e7bd62; }
.fv-kopf { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.fv-kopf b { font-size: 1.15em; }
.fv-kopf span { color: #e7bd62; }
.fv-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 8px 0; }
.fv-fig { text-align: center; background: #ffffff0a; border-radius: 10px; padding: 4px 2px 6px; }
.fv-fig svg { width: 84px; height: 109px; overflow: visible; }
.fv-fig small { display: block; font-size: .78em; line-height: 1.15; }
.fv-wissen { font-size: .92em; }
@media (max-width: 760px), (max-height: 500px) { .fv-figs { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); } .fv-fig svg { width: 60px; height: 78px; } }

/* Festtags-Deko auf dem Startbildschirm (0.8.2) */
.fest-titeldeko { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.ftd-kette { position: absolute; top: 0; left: 0; width: 100%; height: 70px; }
.ftd-l { animation: ftdBlink 1.6s ease-in-out infinite; filter: drop-shadow(0 0 6px currentColor); }
@keyframes ftdBlink { 50% { opacity: .35; } }
.ftd-ecke { position: absolute; bottom: 4vh; font-size: clamp(48px, 8vw, 110px); filter: drop-shadow(0 8px 12px #0008); animation: ftdWipp 4s ease-in-out infinite; }
.ftd-l1 { left: 5vw; } .ftd-r1 { right: 5vw; animation-delay: -2s; }
@keyframes ftdWipp { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .ftd-l, .ftd-ecke { animation: none; } }

/* ---------- Inventar: Wischen und „mehr“-Pfeil (v0.9.1, Fix Handy) ---------- */
.inv-item { touch-action: none; }
#inv-bar { position: relative; }
#inv-bar.inv-mehr::after, #inv-bar.inv-zurueck::before { position: absolute; z-index: 6; pointer-events: none; color: #1a1030; background: var(--acc, #e7bd62); border-radius: 999px; font-size: 13px; font-weight: bold; padding: 1px 8px; box-shadow: 0 2px 8px #0008; animation: invPuls 1.6s ease-in-out infinite; }
#inv-bar.inv-mehr::after { content: "▶ mehr"; right: 6px; bottom: 6px; }
#inv-bar.inv-zurueck::before { content: "◀"; left: 34px; bottom: 6px; }
#inv-bar.inv-senkrecht.inv-mehr::after { content: "▼"; right: 50%; transform: translateX(50%); bottom: 2px; font-size: 11px; padding: 0 10px; }
#inv-bar.inv-senkrecht.inv-zurueck::before { content: "▲"; left: 50%; transform: translateX(-50%); top: 2px; bottom: auto; font-size: 11px; padding: 0 10px; }
@keyframes invPuls { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #inv-bar.inv-mehr::after, #inv-bar.inv-zurueck::before { animation: none; } }

/* ---------- Handy quer: größere Inventarleiste mit zwei Spalten (v0.9.1) ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --inv-w: 136px; }
  #inv { display: grid; grid-template-columns: repeat(2, 60px); grid-auto-rows: 60px; justify-content: center; align-content: start; gap: 6px; }
  .inv-empty { grid-column: 1 / -1; }
}

/* ---------- Startbildschirm: 8 Speicherplätze + Sichern/Laden (v0.9.1) ---------- */
#title { justify-content: safe center; }
#title-slots { display: grid; grid-template-columns: repeat(4, minmax(170px, 210px)); gap: 12px; }
#title-slots .slot { width: auto; padding: 12px; gap: 5px; }
#title-slots .slot-g { font-size: 1.15em; }
#title-slots .slot.empty p { margin: 6px 0; }
.title-saves { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; position: relative; }
@media (max-width: 900px) { #title-slots { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }

/* ---------- Kino: Zwischensequenzen (seit 0.9.2) ---------- */
.kino .kino-balken { height: 0; background: #000; transition: height .8s ease; }
.kino { grid-template-rows: auto 1fr auto auto auto; }
.kino .kino-balken { height: clamp(10px, 3.2vh, 34px); animation: kinoBalken .9s ease both; }
@keyframes kinoBalken { from { height: 0; } }
.kino .intro-stage { box-shadow: inset 0 0 120px #000c; }
.kino-titel { position: absolute; left: 50%; top: 10%; transform: translateX(-50%); z-index: 3; text-align: center; color: #fff; opacity: 0; pointer-events: none; text-shadow: 0 4px 20px #000; }
.kino-titel small { display: block; font-size: clamp(11px, 1.2vw, 15px); letter-spacing: .3em; color: var(--gold, #e7bd62); }
.kino-titel b { font-family: var(--serif); font-size: clamp(26px, 4.4vw, 58px); }
.kino-titel.an { animation: kinoTitel 4.2s ease forwards; }
@keyframes kinoTitel { 0% { opacity: 0; transform: translate(-50%, 14px); } 15%, 70% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.kino-wer { color: var(--gold, #e7bd62); font-weight: bold; }
.intro-scene.kam-still .intro-art { animation: none; }
.intro-scene.kam-pan-l .intro-art { animation: kamPanL 12s ease-out both; }
.intro-scene.kam-pan-r .intro-art { animation: kamPanR 12s ease-out both; }
.intro-scene.kam-zoom-raus .intro-art { animation: kamZoomRaus 9s ease-out both; }
.intro-scene.kam-wackeln .intro-art { animation: kamWackeln .5s ease-in-out 4, kenBurns 14s ease-out both; }
.intro-scene.kam-flug .intro-art { animation: kamFlug 7s cubic-bezier(.5,0,.3,1) both; }
@keyframes kamPanL { from { transform: scale(1.18) translateX(6%); } to { transform: scale(1.18) translateX(-6%); } }
@keyframes kamPanR { from { transform: scale(1.18) translateX(-6%); } to { transform: scale(1.18) translateX(6%); } }
@keyframes kamZoomRaus { from { transform: scale(1.5); } to { transform: scale(1); } }
@keyframes kamWackeln { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-12px, 6px) rotate(-.6deg); } 75% { transform: translate(12px, -6px) rotate(.6deg); } }
@keyframes kamFlug { from { transform: scale(.6) translateY(10%); opacity: .3; } to { transform: scale(1.25); opacity: 1; } }
.kino-blitz::after { content: ''; position: absolute; inset: 0; background: #fff; animation: kinoBlitz .7s ease-out forwards; pointer-events: none; }
@keyframes kinoBlitz { from { opacity: .9; } to { opacity: 0; } }
.intro-fig.schweben svg { animation: kinoSchweben 3s ease-in-out infinite; }
.intro-fig.zittern svg { animation: kinoZittern .25s linear infinite; }
.intro-fig.wachsen { animation: kinoWachsen 1.6s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes kinoSchweben { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes kinoZittern { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes kinoWachsen { from { transform: scale(.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.k-blink { animation: kBlink 1.2s steps(2) infinite; }
@keyframes kBlink { 50% { opacity: .15; } }
.k-dreh { transform-box: fill-box; transform-origin: center; animation: kDreh 6s linear infinite; }
@keyframes kDreh { to { transform: rotate(360deg); } }
.k-tentakel { transform-box: fill-box; transform-origin: bottom center; animation: kTentakel 2.4s ease-in-out infinite alternate; }
@keyframes kTentakel { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.kino-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.kino-karte { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 14px 10px; border-radius: 12px; border: 2px solid #e7bd6255; background: #1a1424; color: #fff; font: inherit; cursor: pointer; text-align: center; }
.kino-karte span { font-size: 28px; } .kino-karte small { opacity: .7; font-size: 12px; }
.kino-karte.zu { opacity: .45; cursor: default; }
button.kino-karte:hover, button.kino-karte:focus-visible { border-color: var(--gold, #e7bd62); background: #2a1f36; }
body.reduce-motion .kino-art, body.reduce-motion .intro-fig svg { animation-duration: .01s !important; }
/* Gefundene Easter Eggs nochmal ansehen (seit 0.9.2) */
button.ec-egg { border: 1px solid #ffd86b44; color: inherit; font: inherit; font-size: .78em; cursor: pointer; width: 100%; }
button.ec-egg:hover, button.ec-egg:focus-visible { background: #ffd86b30; border-color: #ffd86b; }
.ec-nochmal { display: block; margin-top: 3px; font-size: .9em; color: #ffd86b; }
/* Splitter-Sammlung (0.9.3) */
.w7-sk-reihe{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin:8px 0 14px}
.w7-sk{border:2px dashed #b89a5a;border-radius:10px;padding:8px 4px;text-align:center;background:rgba(231,189,98,.08);display:flex;flex-direction:column;align-items:center;gap:4px}
.w7-sk.da{border-style:solid;background:rgba(231,189,98,.22)}
.w7-sk svg{width:44px;height:44px}
.w7-sk b{font-size:1.15em}
.w7-sk small{font-size:.75em;opacity:.8}
.w7-sk-q{width:44px;height:44px;line-height:44px;font-size:1.6em;opacity:.5}
.w7-sk-tipp{background:rgba(255,255,255,.06);border-left:4px solid #e7bd62;padding:8px 12px;border-radius:6px}
.w7-sk-hinweis{font-size:.85em;opacity:.85}
@media (max-width:640px){.w7-sk-reihe{grid-template-columns:repeat(3,1fr)}}
/* Schnelltest (0.9.3) */
.st-modal .st-gr{border:1px solid rgba(255,255,255,.12);border-radius:10px;padding:6px 12px;margin:8px 0}
.st-modal h4{margin:4px 0 6px;color:#e7bd62}
.st-modal .st-z{display:block;padding:4px 0;cursor:pointer}
.st-modal details{margin:4px 0 4px 18px}
.st-laeuft{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:rgba(10,6,16,.78);color:#ffe9a8;font-size:1.5em}
.speicherhilfe ol { margin: 6px 0 10px 1.2em; line-height: 1.5; }
.speicherhilfe .sh-status { background: #ffffff12; border-radius: 8px; padding: 8px 12px; }
.speicherhilfe h4 { margin: 12px 0 4px; color: var(--gold, #e7bd62); }
