:root {
  --bg: #0e1a3a;
  --card: #16244d;
  --card-2: #1d2f63;
  --ink: #f4f1e8;
  --ink-dim: #aab6d8;
  --gold: #ffc83d;
  --gold-2: #ff9f1c;
  --green: #3fbf7f;
  --red: #e5484d;
  --radius: 18px;
  --font: "Georgia", "Palatino Linotype", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; background: var(--bg); color: var(--ink); font-family: var(--font-ui); overflow: hidden; -webkit-tap-highlight-color: transparent; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }

#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, #02061a99 100%); }

/* HUD */
#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: calc(12px + env(safe-area-inset-top)) 16px 0; pointer-events: none; gap: 12px; }
#hud h1 { margin: 0; font-family: var(--font); font-weight: normal; font-size: clamp(18px, 4.5vw, 28px); text-shadow: 0 2px 12px #000a; letter-spacing: .02em; }
.hud-buttons { display: flex; gap: 8px; pointer-events: auto; }
.hud-buttons button { background: #16244de8; border: 1px solid #ffffff30; border-radius: 999px; padding: 8px 14px; font-size: 15px; }
.hud-buttons button:hover { background: #1d2f63; }

/* Sprechblasen */
#bubbles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.bubble { position: absolute; transform: translate(-50%, -100%); max-width: 230px; background: #fffdf4; color: #2a2a3a; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.35; box-shadow: 0 6px 20px #0006; opacity: 0; transition: opacity .25s; }
.bubble.show { opacity: 1; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fffdf4; }
.bubble b { color: #b0472a; }

/* Overlays */
#intro, #modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: #050b1cd6; z-index: 10; }
#intro[hidden], #modal[hidden], #toast[hidden], #admin[hidden] { display: none; }
.intro-card, .modal-card { background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid #ffffff22; border-radius: 24px; box-shadow: 0 20px 60px #000a; animation: pop .35s cubic-bezier(.2, 1.4, .5, 1); }
.intro-card { max-width: 480px; padding: 28px 26px; text-align: center; }
.intro-card h2 { font-family: var(--font); font-weight: normal; font-size: 28px; margin: 6px 0 10px; }
.intro-card p { color: var(--ink-dim); line-height: 1.6; margin: 0 0 22px; }
.intro-emoji { font-size: 54px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-card { position: relative; width: min(640px, 100%); max-height: min(88vh, 900px); overflow-y: auto; padding: 22px 22px 26px; }
.close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #ffffff18; font-size: 16px; }
.close:hover { background: #ffffff30; }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-right: 36px; }
.modal-icon { font-size: 40px; width: 64px; height: 64px; display: grid; place-items: center; background: #ffffff12; border-radius: 18px; flex: none; }
.modal-day { color: var(--gold); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.modal-card h2 { margin: 2px 0 0; font-family: var(--font); font-weight: normal; font-size: clamp(22px, 5vw, 30px); }

button.primary { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #3a2400; border: 0; border-radius: 999px; padding: 12px 26px; font-weight: 600; font-size: 16px; box-shadow: 0 6px 18px #ff9f1c55; }
button.primary:hover { filter: brightness(1.07); }
button.primary:disabled { filter: grayscale(.8) brightness(.8); cursor: default; }
button.ghost { background: #ffffff14; border: 1px solid #ffffff30; border-radius: 999px; padding: 8px 16px; }
button.ghost:hover { background: #ffffff28; }

/* Toast */
#msgs { position: fixed; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: min(560px, calc(100vw - 24px)); pointer-events: none; }   /* oben unter der Kopfzeile: Hilfetext und Meldungen stapeln sich, Joystick/Knöpfe/Karte bleiben frei */
#toast { background: #fffdf4f2; color: #2a2a3a; padding: 9px 16px; border-radius: 14px; box-shadow: 0 8px 24px #0007; max-width: min(460px, 100%); text-align: center; font-size: 15px; line-height: 1.35; animation: toastIn .25s; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; width: 100%; height: 100%; }

/* Inhalts-Blöcke */
.block { margin: 18px 0; }
.block:first-child { margin-top: 4px; }
.text-block { font-family: var(--font); font-size: 18px; line-height: 1.7; white-space: pre-wrap; }
.text-block h3 { margin: 0 0 8px; font-weight: normal; font-size: 22px; color: var(--gold); }
.signature { margin-top: 14px; font-family: var(--font-hand); font-size: 22px; color: var(--gold); }
.poem { font-family: var(--font); font-style: italic; font-size: 20px; line-height: 1.8; text-align: center; white-space: pre-wrap; padding: 14px 10px; border-top: 1px solid #ffffff20; border-bottom: 1px solid #ffffff20; }
.poem .author { display: block; margin-top: 14px; font-size: 14px; color: var(--ink-dim); font-style: normal; }
.photo { margin: 0; background: #fff; padding: 10px 10px 14px; border-radius: 4px; box-shadow: 0 8px 24px #0007; transform: rotate(-1.2deg); }
.photo img { display: block; width: 100%; height: auto; border-radius: 2px; }
.photo figcaption { color: #333; font-family: var(--font-hand); text-align: center; padding-top: 10px; font-size: 17px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.gallery .photo:nth-child(even) { transform: rotate(1.2deg); }
.audio-card { background: #ffffff10; border: 1px solid #ffffff22; border-radius: var(--radius); padding: 14px; }
.audio-card .audio-title { font-family: var(--font); font-size: 19px; margin-bottom: 8px; }
.audio-card audio, .block video { width: 100%; }
.block video { border-radius: 12px; background: #000; max-height: 60vh; }
.lyrics { margin-top: 12px; white-space: pre-wrap; font-family: var(--font); font-style: italic; line-height: 1.7; color: var(--ink-dim); }
.hint-block { text-align: center; font-family: var(--font); font-size: 19px; line-height: 1.6; }
.hint-block .big { font-size: 56px; display: block; margin-bottom: 6px; }
.coupon { position: relative; background: linear-gradient(135deg, #fff4cf, #ffd978); color: #5a3a00; border-radius: 16px; padding: 22px 22px 18px; text-align: center; border: 3px dashed #b9801f; }
.coupon::before, .coupon::after { content: ""; position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%; background: var(--card); transform: translateY(-50%); }
.coupon::before { left: -15px; } .coupon::after { right: -15px; }
.coupon h3 { margin: 0 0 6px; font-family: var(--font); font-size: 24px; }
.coupon p { margin: 0 0 10px; line-height: 1.5; }
.coupon small { display: block; opacity: .7; margin-bottom: 12px; }
.coupon .stamp { display: inline-block; border: 3px solid #2d8a55; color: #2d8a55; padding: 4px 14px; border-radius: 8px; font-weight: 700; transform: rotate(-6deg); letter-spacing: .1em; }
.quiz .q { margin: 16px 0 8px; font-family: var(--font); font-size: 18px; }
.quiz .opts { display: grid; gap: 8px; }
.quiz .opt { text-align: left; background: #ffffff12; border: 1px solid #ffffff2a; border-radius: 12px; padding: 11px 14px; }
.quiz .opt:hover:not(:disabled) { background: #ffffff22; }
.quiz .opt.right { background: #2d8a5560; border-color: var(--green); }
.quiz .opt.wrong { background: #e5484d55; border-color: var(--red); }
.quiz .result { margin-top: 16px; text-align: center; font-family: var(--font); font-size: 18px; color: var(--gold); }
.input-block textarea, .input-block input { width: 100%; background: #ffffff12; color: var(--ink); border: 1px solid #ffffff30; border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; margin: 8px 0 10px; resize: vertical; }
.input-block .saved { color: var(--green); margin-left: 10px; }
.link-block a { color: var(--gold); }

/* Minispiele */
.mg-intro { text-align: center; color: var(--ink-dim); margin: 6px 0 14px; line-height: 1.5; }
.mg-status { text-align: center; font-size: 15px; margin: 8px 0; color: var(--gold); min-height: 22px; }
.mg-win { text-align: center; font-size: 22px; font-family: var(--font); color: var(--gold); padding: 18px 0; animation: pop .35s; }
.arena { position: relative; height: 320px; border-radius: var(--radius); overflow: hidden; background: linear-gradient(#0a1230, #25397a); border: 1px solid #ffffff22; touch-action: manipulation; user-select: none; }
.flake { position: absolute; font-size: 34px; cursor: pointer; line-height: 1; padding: 6px; will-change: transform; }
.flake.pop { transition: transform .2s, opacity .2s; opacity: 0; }
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.mem-card { aspect-ratio: 1; perspective: 600px; border: 0; background: none; padding: 0; }
.mem-card .in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .4s; }
.mem-card.flipped .in, .mem-card.matched .in { transform: rotateY(180deg); }
.mem-card .face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px; backface-visibility: hidden; font-size: clamp(26px, 8vw, 40px); overflow: hidden; }
.mem-card .front { background: linear-gradient(135deg, #2f4a9a, #1c2c66); border: 2px solid #ffffff30; }
.mem-card .back { background: #fffdf4; transform: rotateY(180deg); }
.mem-card.matched .back { background: #cdf2dd; }
.mem-card img { width: 100%; height: 100%; object-fit: cover; }
.simon { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 300px; margin: 0 auto; }
.simon button { aspect-ratio: 1; border: 0; border-radius: 20px; opacity: .45; transition: opacity .1s, transform .1s; }
.simon button.lit { opacity: 1; transform: scale(1.05); box-shadow: 0 0 28px currentColor; }
.simon button:nth-child(1) { background: #e5484d; color: #e5484d; }
.simon button:nth-child(2) { background: #3fbf7f; color: #3fbf7f; }
.simon button:nth-child(3) { background: #ffc83d; color: #ffc83d; }
.simon button:nth-child(4) { background: #4a8bff; color: #4a8bff; }
.slide-board { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 0 auto; background: #0a1230; border-radius: 12px; padding: 4px; }
.slide-tile { position: absolute; width: 33.333%; height: 33.333%; padding: 3px; transition: left .15s, top .15s; }
.slide-tile > div { width: 100%; height: 100%; border-radius: 10px; display: grid; place-items: center; font-size: 30px; font-family: var(--font); color: #3a2400; background: linear-gradient(135deg, #ffe08a, #ffc83d); background-size: cover; }
.slide-board.has-image .slide-tile > div { color: #fff; text-shadow: 0 1px 4px #000; }
.word-pool, .word-slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.word-pool button, .word-slots span { width: 42px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; font-family: var(--font); }
.word-pool button { background: #ffe08a; color: #3a2400; border: 0; }
.word-pool button:disabled { opacity: .2; }
.word-slots span { border: 2px dashed #ffffff44; }
.word-slots span.filled { border-style: solid; border-color: var(--gold); color: var(--gold); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }


/* Minispiele 2 (Türchen 7–24) */
.tm-btn { display: block; margin: 12px auto 0; padding: 14px 30px; border: 0; border-radius: 999px; font: 600 18px var(--font); color: #3a2400; background: linear-gradient(#ffc83d, #ff9f1c); box-shadow: 0 4px 16px #ff9f1c55; touch-action: manipulation; }
.tm-btn:active { transform: scale(.96); }
.odd-grid, .num-grid, .lo-grid, .whack-grid { display: grid; gap: 8px; max-width: 360px; margin: 0 auto; touch-action: manipulation; }
.odd-cell, .num-cell, .lo-cell, .hole { aspect-ratio: 1; border: 0; border-radius: 14px; background: #ffffff14; font-size: clamp(22px, 7vw, 36px); line-height: 1; display: grid; place-items: center; color: var(--ink); transition: transform .12s, opacity .2s, background .2s; }
.odd-cell.right { background: #3fbf7f88; transform: scale(1.08); }
.num-grid { grid-template-columns: repeat(4, 1fr); }
.num-cell { font: 600 clamp(20px, 6vw, 30px) var(--font); background: linear-gradient(135deg, #ffe08a, #ffc03a); color: #3a2400; }
.num-cell.done { opacity: .18; transform: scale(.9); }
.lo-cell { background: #1a2550; border: 2px solid #ffffff22; }
.lo-cell.on { background: radial-gradient(circle, #ffe9a0, #ff9f1c 80%); box-shadow: 0 0 18px #ffb73c88; }
.tm-bar { position: relative; height: 56px; max-width: 360px; margin: 14px auto; border-radius: 28px; background: #0a1230; border: 1px solid #ffffff22; overflow: hidden; touch-action: manipulation; }
.tm-zone { position: absolute; top: 0; bottom: 0; background: #3fbf7f66; border-left: 2px solid #3fbf7f; border-right: 2px solid #3fbf7f; transition: background .2s; }
.tm-zone.flash { background: #8dffb8cc; }
.tm-star { position: absolute; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; font-size: 30px; line-height: 36px; text-align: center; pointer-events: none; }
.maze { display: grid; width: min(340px, 86vw); aspect-ratio: 1; margin: 0 auto; background: #0a1230; border: 2px solid #ffffff55; border-radius: 6px; touch-action: none; user-select: none; }
.mz { display: grid; place-items: center; font-size: clamp(14px, 4.4vw, 24px); line-height: 1; border: 0 solid #9fb4ff; }
.mz.wt { border-top-width: 2px; } .mz.wr { border-right-width: 2px; } .mz.wb { border-bottom-width: 2px; } .mz.wl { border-left-width: 2px; }
.mz.trail { background: #ffc83d22; }
.dpad { display: grid; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(2, 54px); gap: 6px; justify-content: center; margin: 10px auto 0; }
.dpad button { border: 0; border-radius: 12px; background: #ffffff1c; color: var(--ink); font-size: 20px; touch-action: manipulation; }
.dpad-up { grid-column: 2; grid-row: 1; } .dpad-left { grid-column: 1; grid-row: 2; } .dpad-down { grid-column: 2; grid-row: 2; } .dpad-right { grid-column: 3; grid-row: 2; }
.hm-word { text-align: center; font: 600 clamp(22px, 7vw, 32px) var(--font); letter-spacing: 3px; color: var(--gold); margin: 10px 0; word-break: break-word; }
.hm-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 380px; margin: 0 auto; }
.hm-keys button { width: 38px; height: 42px; border: 0; border-radius: 9px; background: #ffe08a; color: #3a2400; font: 600 16px var(--font); touch-action: manipulation; }
.hm-keys button.good { background: #3fbf7f; color: #fff; } .hm-keys button.bad { background: #e5484d55; color: #fff; } .hm-keys button:disabled { opacity: .5; }
.stack-arena { background: linear-gradient(#0a1230, #1d2c63 70%, #3b4c86); }
.gift-blk { position: absolute; border-radius: 4px; border: 2px solid #ffffff55; box-shadow: inset 0 0 0 3px #ffffff22; }
.run-arena { background: linear-gradient(#0a1230, #25397a 70%, #dfe8ff 70%); }
.run-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(#f4f8ff, #c9d6f5); }
.run-deer, .run-obs { position: absolute; bottom: 28%; line-height: 1; font-size: 34px; will-change: transform; }
.run-deer { left: 46px; transform-origin: bottom; } .run-deer.hurt { animation: shake .35s; filter: drop-shadow(0 0 8px #e5484d); }
.run-obs { left: 0; }
.whack-grid { grid-template-columns: repeat(3, 1fr); max-width: 300px; }
.hole { position: relative; background: radial-gradient(ellipse at 50% 70%, #050a1c 55%, #1a2550 56%); font-size: 0; overflow: hidden; }
.hole.up { font-size: clamp(30px, 10vw, 46px); } .hole.got { background: #3fbf7f66; } .hole.oops { background: #e5484d88; }

/* Admin */
#admin .btn-link { color: inherit; background: #ffffff1a; border: 1px solid #ffffff30; border-radius: 8px; padding: 5px 9px; text-decoration: none; font-size: 13px; }
#admin { position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 15; background: #16244de6; border: 1px solid #ffffff30; border-radius: 14px; padding: 10px 12px; font-size: 13px; max-width: calc(100vw - 24px); }
#admin b { color: var(--gold); }
#admin input[type=date] { background: #ffffff18; color: var(--ink); border: 1px solid #ffffff30; border-radius: 8px; padding: 4px 6px; }
#admin button { background: #ffffff18; border: 1px solid #ffffff30; border-radius: 8px; padding: 4px 8px; margin: 3px 2px; font-size: 12px; }
#admin .row { margin-top: 4px; }

/* Spaziergang: Joystick, Tür-Knopf, Hilfetext */
#joy { position: fixed; left: calc(24px + env(safe-area-inset-left)); bottom: calc(34px + env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; background: #ffffff1a; border: 2px solid #ffffff40; backdrop-filter: blur(4px); touch-action: none; z-index: 5; }
#joy[hidden] { display: none; }
/* zweiter Steuerknüppel rechts unten: Blickrichtung (Daumen rechts), links bleibt Laufen */
#look { position: fixed; right: calc(24px + env(safe-area-inset-right)); bottom: calc(34px + env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; background: #ffffff14; border: 2px dashed #ffffff40; touch-action: none; z-index: 5; }
#look[hidden] { display: none; }
#look::before { content: "👁"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; opacity: .35; pointer-events: none; }
#look-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #9ec8ff); box-shadow: 0 4px 14px #0008; pointer-events: none; }
#look.active { background: #ffffff2e; border-color: #ffffff77; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffd25a); box-shadow: 0 4px 14px #0008; pointer-events: none; }
#interact { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; animation: pop .25s; white-space: nowrap; }
#interact[hidden] { display: none; }
#help { max-width: 100%; text-align: center; background: #16244de8; border: 1px solid #ffffff30; border-radius: 14px; padding: 10px 16px; font-size: 14px; line-height: 1.45; color: var(--ink); display: none; }
#help.show { display: block; animation: toastIn .4s; }
kbd { background: #ffffff22; border: 1px solid #ffffff44; border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font: inherit; font-size: 12px; }

@media (max-width: 640px) {
  #hud h1 { font-size: 16px; max-width: 24vw; line-height: 1.15; }
  .hud-buttons { gap: 5px; flex-wrap: nowrap; justify-content: flex-end; }
  .hud-buttons button { padding: 6px 7px; font-size: 15px; white-space: nowrap; }
  .hud-buttons .l { display: none; }
  #help { font-size: 13px; }
}
@media (max-width: 640px) { #toast { font-size: 13.5px; padding: 7px 13px; border-radius: 12px; } }
@media (pointer: coarse) {
  #interact { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(184px + env(safe-area-inset-bottom)); }
}

/* Ladebildschirm */
#loading { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(ellipse at 50% 40%, #1d2f63, #0a1230); color: var(--ink); font-family: var(--font); font-size: 18px; transition: opacity .8s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading p { margin: 0; color: var(--ink-dim); }
#loading .bar { width: min(320px, 70vw); height: 8px; border-radius: 99px; background: #ffffff18; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .35s ease-out; }
#loading small { max-width: min(380px, 80vw); text-align: center; color: #aab6d8aa; font-family: var(--font-ui); font-size: 13px; line-height: 1.5; min-height: 40px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #ffffff22; border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#actions { position: fixed; right: calc(18px + env(safe-area-inset-right)); bottom: calc(182px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
#actions[hidden] { display: none; }
#actions button { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #ffffff40; background: #16244de8; font-size: 24px; touch-action: manipulation; }
#actions button:active { background: #2a3f85; transform: scale(.94); }

#stars { position: fixed; left: 16px; top: calc(54px + env(safe-area-inset-top)); z-index: 4; background: #16244de8; border: 1px solid #ffd25a66; color: #ffd25a; border-radius: 999px; padding: 4px 12px; font-size: 14px; pointer-events: none; }
#stars[hidden] { display: none; }
@media (max-width: 640px) { #stars { top: calc(66px + env(safe-area-inset-top)); } }
@media (max-width: 640px) and (orientation: portrait) { #stars { top: auto; bottom: calc(6px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); } }   /* Handy hochkant: Sterne-Zähler unten mittig, oben liegen Kopfzeile und Meldungen */

.nametag { position: absolute; transform: translate(-50%, -100%); font-size: 12px; letter-spacing: .04em; color: #ffe9b0; text-shadow: 0 1px 4px #000c; background: #0a1230aa; border-radius: 999px; padding: 1px 9px; opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity .2s; }

#minimap { position: fixed; right: 14px; top: calc(62px + env(safe-area-inset-top)); width: 150px; height: 150px; border-radius: 50%; border: 2px solid #ffffff44; box-shadow: 0 6px 24px #0008; z-index: 4; background: #0a1230b0; cursor: pointer; }
#minimap[hidden] { display: none; }
@media (max-width: 640px) { #minimap { width: 104px; height: 104px; top: auto; bottom: calc(198px + env(safe-area-inset-bottom)); left: 14px; right: auto; } }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 40; }
#flash.go { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* Türchen-Übersicht */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.cal-cell { position: relative; aspect-ratio: 1; border-radius: 16px; border: 2px solid #ffffff22; background: #ffffff10; font-family: var(--font); font-size: 26px; display: grid; place-items: center; align-content: center; gap: 2px; padding: 4px; }
.cal-cell small { font-family: var(--font-ui); font-size: 11px; opacity: .8; }
.cal-cell.locked { opacity: .5; }
.cal-cell.todo { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #3a2400; border-color: #fff3; box-shadow: 0 0 18px #ffc83d66; }
.cal-cell.done { background: #2d8a5550; border-color: var(--green); }
.cal-cell:hover:not(.locked) { filter: brightness(1.12); transform: translateY(-1px); }
#cross { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #ffffffb0; box-shadow: 0 0 0 1px #0a123099, 0 0 8px #fff6; pointer-events: none; z-index: 3; }
#cross[hidden] { display: none; }
#cross.locked { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #fff; box-shadow: 0 0 0 1px #0a1230aa, 0 0 12px #ffd25acc; }

/* Handy: größere Bedienelemente, schwebender Joystick */
#joy.active { background: #ffffff2e; border-color: #ffffff77; }
@media (pointer: coarse) {
  #joy, #look { width: 126px; height: 126px; }
  #joy-knob { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
  #look-knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  #actions button { width: 54px; height: 54px; font-size: 23px; }
  #interact { font-size: 15.5px; padding: 11px 18px; }
  .hud-buttons button { min-width: 44px; min-height: 44px; }
}
/* Querformat auf dem Handy: wenig Höhe -> Karte oben rechts, Knöpfe kleiner */
@media (pointer: coarse) and (max-height: 520px) {
  #minimap { width: 84px; height: 84px; top: calc(58px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); bottom: auto; left: auto; }
  #joy, #look { width: 118px; height: 118px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  #look { right: calc(14px + env(safe-area-inset-right)); } #look-knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  #actions { bottom: calc(14px + env(safe-area-inset-bottom)); flex-direction: row; right: calc(14px + env(safe-area-inset-right) + 130px); }
  #actions button { width: 52px; height: 52px; font-size: 22px; }
  #interact { bottom: calc(76px + env(safe-area-inset-bottom)); }
  #stars { top: calc(52px + env(safe-area-inset-top)); }
  #msgs { top: calc(70px + env(safe-area-inset-top)); max-width: calc(100vw - 260px); }
  #toast { font-size: 13px; padding: 6px 12px; }
}
@media (max-width: 480px) { #hud h1 { display: none; } #hud { justify-content: flex-end; } }

/* Admin-Leiste: kompakt oben links statt über dem Joystick */
#admin { left: 12px; right: auto; bottom: auto; top: calc(96px + env(safe-area-inset-top)); }
#admin #adm-tog { background: none; border: 0; padding: 2px 4px; margin: 0; font-size: 13px; color: var(--gold); font-weight: 600; }
#admin.min { padding: 4px 8px; border-radius: 999px; opacity: .85; }
#admin.min #adm-body { display: none; }
@media (min-width: 641px) { #admin { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); } }

/* Wegweiser zum heutigen Türchen */
#goal { position: fixed; z-index: 4; transform: translate(-50%, -50%); pointer-events: none; display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 3px 8px #0009); animation: bob 1.6s ease-in-out infinite; }
#goal[hidden] { display: none; }
#goal i { font-style: normal; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #3a2400; font-size: 20px; border: 2px solid #fff8; }
#goal b { position: absolute; top: 9px; font-size: 0; }
#goal small { margin-top: 3px; background: #0a1230bb; border-radius: 99px; padding: 1px 9px; white-space: nowrap; font-size: 12px; color: #ffe9b0; }
@keyframes bob { 50% { margin-top: -6px; } }
.hud-buttons, #stars { transition: opacity .8s; }
body.idle .hud-buttons, body.idle #stars { opacity: .3; }

/* Barrierefreiheit: sichtbarer Tastaturfokus, weniger Bewegung auf Wunsch */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  #goal, .modal-card, .intro-card, #interact, #toast { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

/* Schmale Handys (≤ 380 px): alles etwas kleiner, damit Knöpfe, Joystick und „Öffnen“ nebeneinander passen */
@media (max-width: 380px) {
  #hud { padding-left: 6px; padding-right: 6px; } .hud-buttons { gap: 3px; } .hud-buttons button { min-width: 40px; width: 40px; min-height: 40px; height: 40px; padding: 0; font-size: 17px; }
  #joy, #look { width: 118px; height: 118px; bottom: calc(24px + env(safe-area-inset-bottom)); } #joy { left: calc(12px + env(safe-area-inset-left)); } #look { right: calc(12px + env(safe-area-inset-right)); }
  #joy-knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; } #look-knob { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  #actions { bottom: calc(154px + env(safe-area-inset-bottom)); right: calc(12px + env(safe-area-inset-right)); } #actions button { width: 52px; height: 52px; font-size: 22px; }
  #interact { font-size: 14.5px; padding: 11px 14px; bottom: calc(160px + env(safe-area-inset-bottom)); }
  #minimap { width: 88px; height: 88px; bottom: calc(166px + env(safe-area-inset-bottom)); }
}


/* ====================================================================
   Weihnachtliche Dialoge (Türchen, Intro, Hilfe)
   ==================================================================== */
#modal, #intro { background: radial-gradient(ellipse at 50% 30%, #0b1636dd, #03081ae6); }
#modal::before, #intro::before { content: ""; position: absolute; left: 0; right: 0; top: -420px; height: calc(100% + 420px); pointer-events: none; opacity: .6; will-change: transform;
  background-image: radial-gradient(2.2px 2.2px at 30px 40px, #fff 55%, transparent 60%), radial-gradient(1.6px 1.6px at 250px 150px, #fff 55%, transparent 60%), radial-gradient(3px 3px at 130px 300px, #fff 50%, transparent 60%), radial-gradient(1.8px 1.8px at 340px 360px, #fff 55%, transparent 60%);
  background-size: 420px 420px; animation: snowDrift 22s linear infinite; }   /* nur transform animiert (läuft auf der Grafikkarte, kein Neuzeichnen) */
@keyframes snowDrift { to { transform: translateY(420px); } }

.modal-card, .intro-card {
  border: 2px solid transparent; border-radius: 26px;
  background: radial-gradient(120% 70% at 50% 0%, #34509f 0%, #1f326b 36%, #13204a 100%) padding-box, linear-gradient(135deg, #fff0b8, #d79a1e 38%, #fff0b8 62%, #b9801f) border-box;
  box-shadow: inset 0 0 0 6px #14224c, inset 0 0 0 7px #ffc83d4d, 0 26px 70px #000c, 0 0 46px #ffc83d1f;
  animation: cardOpen .5s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes cardOpen { from { transform: perspective(900px) rotateX(-14deg) translateY(18px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
/* Lichterkette am oberen Rand, blinkt abwechselnd */
.modal-card::before, .modal-card::after, .intro-card::before, .intro-card::after { content: ""; position: absolute; left: 14px; right: 14px; top: 9px; height: 30px; pointer-events: none; z-index: 3; background-repeat: repeat-x; background-size: 120px 30px; filter: drop-shadow(0 0 4px #ffd35a77); }
.modal-card::before, .intro-card::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22120%22%20height%3D%2230%22%20viewBox%3D%220%200%20120%2030%22%3E%3Cpath%20d%3D%22M0%204%20Q60%2030%20120%204%22%20stroke%3D%22%231f6b4c%22%20stroke-width%3D%221.6%22%20fill%3D%22none%22%2F%3E%3Crect%20x%3D%2212.8%22%20y%3D%228.5%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2214.4%22%20cy%3D%2214.1%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%23ff5a5a%22%2F%3E%3Cellipse%20cx%3D%2213.5%22%20cy%3D%2212.8%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%2234.4%22%20y%3D%2213.9%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2236%22%20cy%3D%2219.5%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%23ffd35a%22%2F%3E%3Cellipse%20cx%3D%2235.1%22%20cy%3D%2218.2%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%2258.4%22%20y%3D%2216%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2260%22%20cy%3D%2221.6%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%236cc0ff%22%2F%3E%3Cellipse%20cx%3D%2259.1%22%20cy%3D%2220.3%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%2282.4%22%20y%3D%2213.9%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2284%22%20cy%3D%2219.5%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%237dff9a%22%2F%3E%3Cellipse%20cx%3D%2283.1%22%20cy%3D%2218.2%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%22104%22%20y%3D%228.5%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%22105.6%22%20cy%3D%2214.1%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%23ff9ad6%22%2F%3E%3Cellipse%20cx%3D%22104.69999999999999%22%20cy%3D%2212.8%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3C%2Fsvg%3E"); animation: twinkleA 1.6s ease-in-out infinite alternate; }
.modal-card::after, .intro-card::after { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22120%22%20height%3D%2230%22%20viewBox%3D%220%200%20120%2030%22%3E%3Cpath%20d%3D%22M0%204%20Q60%2030%20120%204%22%20stroke%3D%22%231f6b4c%22%20stroke-width%3D%221.6%22%20fill%3D%22none%22%2F%3E%3Crect%20x%3D%2212.8%22%20y%3D%228.5%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2214.4%22%20cy%3D%2214.1%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%23ffd35a%22%2F%3E%3Cellipse%20cx%3D%2213.5%22%20cy%3D%2212.8%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%2234.4%22%20y%3D%2213.9%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2236%22%20cy%3D%2219.5%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%237dff9a%22%2F%3E%3Cellipse%20cx%3D%2235.1%22%20cy%3D%2218.2%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%2258.4%22%20y%3D%2216%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2260%22%20cy%3D%2221.6%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%23ff5a5a%22%2F%3E%3Cellipse%20cx%3D%2259.1%22%20cy%3D%2220.3%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%2282.4%22%20y%3D%2213.9%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%2284%22%20cy%3D%2219.5%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%23ff9ad6%22%2F%3E%3Cellipse%20cx%3D%2283.1%22%20cy%3D%2218.2%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3Crect%20x%3D%22104%22%20y%3D%228.5%22%20width%3D%223.2%22%20height%3D%223%22%20fill%3D%22%232a3a2a%22%2F%3E%3Cellipse%20cx%3D%22105.6%22%20cy%3D%2214.1%22%20rx%3D%223%22%20ry%3D%224.1%22%20fill%3D%22%236cc0ff%22%2F%3E%3Cellipse%20cx%3D%22104.69999999999999%22%20cy%3D%2212.8%22%20rx%3D%220.9%22%20ry%3D%221.3%22%20fill%3D%22%23fff%22%20opacity%3D%22.7%22%2F%3E%3C%2Fsvg%3E"); animation: twinkleB 1.6s ease-in-out infinite alternate; }
@keyframes twinkleA { from { opacity: 1; } to { opacity: .3; } }
@keyframes twinkleB { from { opacity: .3; } to { opacity: 1; } }

/* Aufbau: feste Kopfzeile, scrollender Inhalt */
.modal-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; max-height: min(90vh, 920px); }
.modal-head { flex: none; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin: 0; padding: 44px 24px 4px; }
.modal-head::after { content: "❄"; display: block; width: 100%; margin-top: 8px; font-size: 13px; line-height: 14px; color: #ffc83d; background: linear-gradient(90deg, transparent, #ffc83d99 22%, transparent 46%, transparent 54%, #ffc83d99 78%, transparent) center / 100% 1px no-repeat; }
#modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px 30px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%); }
.modal-icon { position: relative; width: 68px; height: 68px; border-radius: 50%; font-size: 35px; background: radial-gradient(circle at 35% 28%, #fff6d8, #ffd36a 55%, #cf8a1a); box-shadow: 0 0 0 3px #13204a, 0 0 0 5px #ffc83d, 0 8px 20px #000a, 0 0 26px #ffc83d66; outline: 5px dotted #3fa56e; outline-offset: 7px; margin: 6px 0 12px; }
.modal-icon::after { content: "🎀"; position: absolute; right: -14px; bottom: -10px; font-size: 22px; filter: drop-shadow(0 2px 3px #0008); }
.modal-day { font-size: 12.5px; letter-spacing: .3em; color: #ffd77a; }
.modal-day::before, .modal-day::after { content: "✦"; color: #ff7a7f; margin: 0 .7em; letter-spacing: 0; }
.modal-card h2 { font-size: clamp(24px, 6vw, 33px); line-height: 1.15; background: linear-gradient(180deg, #fffbe6, #ffc83d 62%, #e8920a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 5px #0009); }
.close { top: 14px; right: 14px; z-index: 4; width: 36px; height: 36px; color: #fff; font-size: 15px; background: radial-gradient(circle at 35% 28%, #ff8a8d, #c3262c 70%); border: 2px solid #ffd77a; box-shadow: 0 4px 10px #0008; }
.close::before { content: ""; position: absolute; left: 50%; top: -7px; width: 10px; height: 7px; margin-left: -5px; border-radius: 2px 2px 0 0; background: linear-gradient(90deg, #b9801f, #ffe08a, #b9801f); }
.close:hover { background: radial-gradient(circle at 35% 28%, #ffa0a3, #d83a40 70%); }

/* Inhalts-Blöcke */
.block { margin: 22px 0; }
.text-block { position: relative; background: linear-gradient(170deg, #fffaf0, #f4e8cf); color: #3b2a1a; padding: 24px 24px 22px; border-radius: 6px 6px 10px 10px; box-shadow: 0 10px 26px #0008, inset 0 0 0 1px #d9c08f66; font-size: 18.5px; line-height: 1.7; }
.text-block::before { content: "🎄"; position: absolute; top: -17px; right: 18px; font-size: 32px; filter: drop-shadow(0 3px 3px #0007); }
.text-block h3 { color: #9b2226; font-size: 24px; margin-bottom: 10px; }
.text-block .signature, .signature { color: #9b2226; margin-top: 16px; }
.poem { position: relative; padding: 34px 18px 32px; border: 1px solid #ffc83d66; border-radius: 16px; background: radial-gradient(ellipse at 50% 0%, #ffffff14, transparent 70%), #ffffff08; color: #fff6dc; font-size: 20.5px; }
.poem::before, .poem::after { content: "✦  ❄  ✦"; position: absolute; left: 0; right: 0; text-align: center; color: #ffc83d; font-size: 15px; letter-spacing: .2em; line-height: 1; font-style: normal; }
.poem::before { top: 12px; } .poem::after { bottom: 12px; }
.poem .author { color: #ffd77a; }
.photo { position: relative; padding: 11px 11px 16px; border-radius: 3px; box-shadow: 0 12px 28px #000a; }
.photo::before { content: ""; position: absolute; top: -11px; left: 50%; width: 84px; height: 24px; margin-left: -42px; transform: rotate(-3deg); background: repeating-linear-gradient(135deg, #c3262cdd 0 9px, #fffdf0dd 9px 18px); box-shadow: 0 2px 5px #0005; opacity: .92; }
.photo figcaption { color: #4a3322; }
.gallery .photo:nth-child(odd)::before { transform: rotate(3deg); }
.audio-card { position: relative; background: linear-gradient(135deg, #19573f, #0f3a2b); border: 1px solid #ffc83d77; border-radius: 16px; padding: 16px 16px 14px; box-shadow: 0 8px 22px #0007; }
.audio-card .audio-title { color: #fff2c2; font-size: 20px; }
.lyrics { color: #d6e6dc; }
.hint-block { position: relative; overflow: hidden; color: #fff; padding: 24px 22px; border-radius: 18px; border: 2px solid #ffd77a88; background: radial-gradient(circle, #ffffff1c 2px, transparent 3px) 0 0 / 22px 22px, linear-gradient(160deg, #b3282f, #7a141b); box-shadow: 0 10px 26px #0008; }
.hint-block::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: repeating-linear-gradient(90deg, #ffe08a 0 14px, #d79a1e 14px 28px); opacity: .55; pointer-events: none; }
.hint-block .big { position: relative; font-size: 54px; }
.coupon { border-radius: 14px; box-shadow: 0 10px 26px #0008; background: linear-gradient(135deg, #fff6d6, #ffd978 55%, #f2b73e); }
.coupon::before, .coupon::after { background: #172859; }
.coupon h3 { color: #6b1d12; }
.quiz .q { color: #fff2c2; }
.quiz .opts { counter-reset: o; }
.quiz .opt { position: relative; padding: 11px 14px 11px 50px; border: 2px solid #ffffff30; background: #ffffff10; color: var(--ink); transition: background .15s, border-color .15s, transform .1s; }
.quiz .opt::before { counter-increment: o; content: counter(o, upper-alpha); position: absolute; left: 10px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--font-ui); color: #3a2400; background: linear-gradient(180deg, #ffe08a, #ffb02e); }
.quiz .opt:hover:not(:disabled) { border-color: #ffc83d99; background: #ffffff1c; transform: translateX(2px); }
.quiz .opt.right { border-color: var(--green); background: #2d8a5566; } .quiz .opt.right::before { content: "✓"; background: #3fbf7f; color: #fff; }
.quiz .opt.wrong { border-color: var(--red); background: #e5484d55; } .quiz .opt.wrong::before { content: "✕"; background: #e5484d; color: #fff; }
.input-block textarea, .input-block input { background: #fffaf0; color: #3b2a1a; border: 2px solid #d9c08f; font-family: var(--font); font-size: 17px; }
.input-block textarea:focus, .input-block input:focus { outline: none; border-color: #ffc83d; box-shadow: 0 0 0 4px #ffc83d44; }
.link-block a { display: inline-block; padding: 9px 20px; border-radius: 999px; border: 1px solid #ffc83d88; background: #ffffff10; text-decoration: none; }
button.primary { border: 1px solid #ffe9a0aa; box-shadow: 0 6px 18px #ff9f1c55, inset 0 1px 0 #fff8; }

/* Minispiele im Dialog */
.mg-intro { color: #dfe7ff; font-family: var(--font); font-size: 17px; }
.arena { border: 2px solid #ffc83d55; box-shadow: inset 0 0 30px #0006; }
.mg-win { font-size: 25px; text-shadow: 0 0 22px #ffc83daa; }

/* Intro-Karte */
.intro-card { padding: 50px 28px 30px; }
.intro-card h2 { font-size: clamp(26px, 6.5vw, 34px); background: linear-gradient(180deg, #fffbe6, #ffc83d 62%, #e8920a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 5px #0009); }
.intro-card p { color: #dfe7ff; }

/* Querformat am Handy: Kopfzeile kompakt nebeneinander */
@media (max-height: 560px) {
  .modal-card::before, .modal-card::after { height: 24px; top: 6px; background-size: 96px 24px; }
  .modal-head { flex-direction: row; text-align: left; gap: 14px; padding: 30px 56px 2px 22px; justify-content: flex-start; align-items: center; }
  .modal-icon { width: 46px; height: 46px; font-size: 24px; margin: 4px 8px 4px 4px; outline-width: 3px; outline-offset: 5px; }
  .modal-icon::after { font-size: 15px; right: -10px; bottom: -8px; }
  .modal-head::after { display: none; }
  .modal-card h2 { font-size: 22px; } .modal-day { font-size: 11px; }
  #modal-body { padding: 10px 20px 18px; }
}
@media (max-width: 480px) {
  .modal-head { flex-direction: row; text-align: left; align-items: center; justify-content: flex-start; gap: 14px; padding: 40px 54px 0 20px; }
  .modal-icon { width: 54px; height: 54px; font-size: 28px; margin: 6px 10px 8px 8px; outline-width: 4px; outline-offset: 5px; }
  .modal-icon::after { font-size: 17px; right: -11px; bottom: -8px; }
  .modal-day { font-size: 11px; letter-spacing: .22em; } .modal-day::before { display: none; }
  .modal-card h2 { font-size: clamp(21px, 6vw, 26px); }
  .modal-head::after { position: absolute; left: 20px; right: 20px; bottom: -6px; width: auto; text-align: center; }
  .modal-head { position: relative; margin-bottom: 14px; }
}
@media (max-width: 480px) { #modal-body { padding: 12px 16px 24px; } .text-block { padding: 22px 18px 20px; font-size: 17.5px; } }
@media (prefers-reduced-motion: reduce) { #modal::before, #intro::before, .modal-card::before, .modal-card::after, .intro-card::before, .intro-card::after { animation: none !important; } .modal-card::after, .intro-card::after { opacity: 0; } }

/* Übersicht: heutiges Türchen pulsiert sacht, Zähler */
.cal-cell.now { animation: calNow 2.2s ease-in-out infinite; }
@keyframes calNow { 50% { box-shadow: 0 0 0 5px #ffc83d44, 0 0 26px #ffc83d99; } }
.cal-count { text-align: center; margin: 2px 0 12px; color: #ffd9a0; font-size: 15px; letter-spacing: .03em; }
@media (prefers-reduced-motion: reduce) { .cal-cell.now { animation: none; } }

/* Foto groß ansehen */
.photo img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 50% 40%, #1a2a5acc, #060b1ef2); cursor: zoom-out; animation: lbIn .25s ease-out; outline: none; }
.lightbox img { max-width: 100%; max-height: calc(100% - 50px); object-fit: contain; border: 10px solid #fffdf4; border-bottom-width: 14px; border-radius: 3px; box-shadow: 0 18px 60px #000c; }
.lb-cap { color: #ffe9b8; font-family: var(--font-hand); font-size: 20px; text-align: center; max-width: 90vw; }
@keyframes lbIn { from { opacity: 0; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }
/* Quiz-Rückmeldung */
.quiz .fb { min-height: 1.4em; margin: 6px 2px 14px; font-size: 15px; }
.quiz .fb.ok { color: #9be9b8; } .quiz .fb.no { color: #ffb3a8; }
.lb-count { color: #ffffffaa; font-size: 13px; letter-spacing: .12em; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 14px; background: #0a1230aa; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; }
.lb-prev { left: max(8px, env(safe-area-inset-left)); } .lb-next { right: max(8px, env(safe-area-inset-right)); }
.lb-nav:hover { background: #1c2c66dd; }
