/* Nappian und Neucke: Oberfläche im Stil der Chronik, Pergament und Tinte. */
:root {
  --parch: #efe3c6;
  --parch-deep: #e3d1a7;
  --parch-edge: #c9b07e;
  --ink: #3a2a18;
  --ink-soft: rgba(58, 42, 24, 0.62);
  --ink-faint: rgba(58, 42, 24, 0.28);
  --copper: #a8561f;
  --copper-light: #d2863f;
  --ore: #3f7a52;
  --ore-light: #6fae84;
  --blood: #8e3a2a;
  --wood: #5b3d25;
  --wood-light: #7a5535;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.23 0 0 0 0 0.16 0 0 0 0 0.09 0 0 0 0.16 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
  --ornament: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14'><g fill='none' stroke='%233a2a18' stroke-width='1.2' stroke-linecap='round'><path d='M4 7h74M122 7h74'/><path d='M100 1l6 6-6 6-6-6z' fill='%23a8561f' stroke='none'/><circle cx='86' cy='7' r='1.6' fill='%233a2a18' stroke='none'/><circle cx='114' cy='7' r='1.6' fill='%233a2a18' stroke='none'/></g></svg>");
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1b1d22; color: var(--ink); }
body { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(30,18,8,0.4) 100%); }

.hidden { display: none !important; }

/* Pergamentflächen */
.parch {
  position: relative; color: var(--ink);
  background: var(--parch) var(--grain);
  border: 1.5px solid var(--ink-soft);
  box-shadow: inset 0 0 0 3px var(--parch), inset 0 0 0 4px var(--ink-faint), 0 6px 18px rgba(20, 10, 0, 0.35);
}
.ornament { height: 14px; background: var(--ornament) center / auto 100% no-repeat; margin: 6px 0 10px; }

/* Knöpfe */
button {
  font: inherit; color: var(--ink); background: transparent;
  border: 1.5px solid var(--ink-soft); border-radius: 6px;
  padding: 12px 18px; min-height: 48px; cursor: pointer; line-height: 1.2;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary {
  color: #f6ecd4; font-weight: bold; letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--wood-light), var(--wood));
  border: 1.5px solid #3a2515; border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.25), 0 2px 0 #2e1c0f;
}
button.primary:active { box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.25); transform: translateY(2px); }

/* Spielanzeige */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }

/* Aufgabe als Schriftrolle */
#objective {
  position: absolute; left: calc(10px + var(--safe-left)); top: calc(10px + var(--safe-top));
  display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; max-width: calc(100vw - 150px);
  border-radius: 4px; font-size: 15px; text-align: left; line-height: 1.2;
}
#objective::before, #objective::after {
  content: ""; position: absolute; top: -4px; bottom: -4px; width: 10px; border-radius: 5px;
  background: linear-gradient(90deg, var(--parch-edge), var(--parch-deep) 50%, var(--parch-edge));
  border: 1px solid var(--ink-soft);
}
#objective::before { left: -6px; }
#objective::after { right: -6px; }
#objective svg { width: 20px; height: 20px; flex: none; }
#objective-short { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#objective-progress { font-size: 13px; color: var(--copper); font-weight: bold; white-space: nowrap; }
#objective-full {
  position: absolute; left: calc(10px + var(--safe-left)); top: calc(62px + var(--safe-top));
  max-width: min(360px, calc(100vw - 20px)); padding: 10px 14px; font-size: 15px; line-height: 1.4; border-radius: 4px;
}

/* Holztäfelchen rechts oben */
#hud-buttons { position: absolute; right: calc(10px + var(--safe-right)); top: calc(10px + var(--safe-top)); display: flex; gap: 8px; }
button.plaque {
  width: 46px; height: 46px; padding: 0; border-radius: 7px; position: relative;
  background: linear-gradient(180deg, var(--wood-light), var(--wood)); border: 1.5px solid #3a2515;
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.25), 0 2px 0 #2e1c0f; color: #f6ecd4;
}
button.plaque svg { width: 26px; height: 26px; display: block; margin: auto; }
button.plaque.off::after { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; background: #f6ecd4; transform: rotate(-35deg); }

/* Hebel: dezent, deutlich erst beim Berühren */
/* Hebel rechts für den Daumen der rechten Hand, Umsehen links */
#joy-area { position: absolute; right: 0; bottom: 0; width: 58%; height: 60%; }
#look-area { position: absolute; left: 0; bottom: 0; width: 42%; height: 60%; }
#joystick {
  position: absolute; right: calc(30px + var(--safe-right)); bottom: calc(38px + var(--safe-bottom));
  width: 98px; height: 98px; border-radius: 50%; pointer-events: none; opacity: 0.45; transition: opacity 0.15s;
  border: 1.5px dashed rgba(246, 236, 212, 0.9);
}
#joystick.active { opacity: 1; border-style: solid; }
#stick {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f6ecd4, var(--parch-deep)); border: 1.5px solid var(--ink-soft);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Aktionstaste: Kupfermedaillon mit Zeichen und Schildchen */
#btn-action {
  position: absolute; right: calc(34px + var(--safe-right)); bottom: calc(172px + var(--safe-bottom));
  width: 84px; height: 84px; border-radius: 50%; padding: 0; overflow: visible;
  background: radial-gradient(circle at 40% 35%, var(--copper-light), var(--copper) 70%);
  border: 3px solid #f6ecd4; color: #fff5e3;
  box-shadow: 0 0 0 2px rgba(58, 42, 24, 0.5), 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(210, 134, 63, 0.6);
  animation: pulse 1.5s ease-out infinite;
}
#btn-action svg { width: 44px; height: 44px; display: block; margin: auto; }
#action-label {
  position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%);
  font-size: 13px; font-weight: bold; color: var(--ink); white-space: nowrap;
  background: var(--parch); border: 1px solid var(--ink-soft); border-radius: 3px; padding: 2px 8px;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 2px rgba(58, 42, 24, 0.5), 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(210, 134, 63, 0.6); }
  100% { box-shadow: 0 0 0 2px rgba(58, 42, 24, 0.5), 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 22px rgba(210, 134, 63, 0); }
}

/* Untertitel als Pergamentstreifen */
#subtitle {
  position: absolute; left: calc(14px + var(--safe-left)); right: calc(14px + var(--safe-right));
  bottom: calc(160px + var(--safe-bottom)); font-size: 17px; line-height: 1.45; padding: 12px 16px 10px; border-radius: 3px;
}
#subtitle-speaker { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); margin-bottom: 3px; font-weight: bold; }
#subtitle-speaker:empty { display: none; }
#subtitle-text { font-style: italic; }
#subtitle-next { display: block; text-align: right; font-size: 12px; color: var(--ink-soft); margin-top: 6px; letter-spacing: 0.08em; }
#tap-catcher { position: absolute; inset: 0; }

/* Kurzmeldung */
#toast {
  position: absolute; left: 50%; top: calc(66px + var(--safe-top)); transform: translateX(-50%);
  padding: 8px 14px 8px 30px; border-radius: 3px; font-size: 14px; font-weight: bold; white-space: nowrap; max-width: 92vw;
  overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
#toast::before { content: ""; position: absolute; left: 10px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9533a, var(--blood)); }

/* Titelkarte */
#title-card {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center;
  padding: 18px 34px; min-width: 260px; max-width: 86vw; pointer-events: none; opacity: 0; transition: opacity 0.5s;
}
#title-card.show { opacity: 1; }
#title-card .kicker { margin: 0 0 4px; }
#title-card h2 { margin: 0; font-size: 30px; line-height: 1.1; }

/* Fenster */
.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: rgba(24, 16, 8, 0.6); overflow-y: auto;
}
.sheet { width: min(520px, 100%); max-height: 100%; overflow-y: auto; padding: 26px 24px 22px; border-radius: 3px; }
.sheet h1 { font-size: 42px; line-height: 1.0; margin: 4px 0 8px; font-weight: bold; }
.sheet h2 { font-size: 26px; margin: 0 0 10px; line-height: 1.15; }
.sheet p { line-height: 1.5; margin: 0 0 12px; font-size: 17px; }
.kicker { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--copper); font-weight: bold; margin: 0 0 6px; }
.sub { color: var(--ink-soft); }
.note { border-left: 3px solid var(--ore); padding: 8px 12px; font-size: 15px; background: rgba(63, 122, 82, 0.08); }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 14px; }
.buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.story-text { font-size: 19px; line-height: 1.55; font-style: italic; }
.chronik-svg { width: 100%; height: auto; border: 1px solid var(--ink-faint); display: block; margin-bottom: 12px; background: #f5ebd3; }
.chronik-text { font-style: italic; font-size: 18px; }

/* Karten */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.card-tile { border: 1.5px solid var(--ink-soft); border-radius: 4px; padding: 12px; min-height: 96px; font-size: 14px; text-align: left; background: rgba(255, 250, 235, 0.45); color: var(--ink); line-height: 1.25; }
.card-tile.locked { color: var(--ink-soft); border-style: dashed; background: transparent; }
.card-tile .kicker { font-size: 10px; margin-bottom: 4px; }
.card-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.card-icon svg { width: 40px; height: 40px; display: block; }

/* Quiz */
.answers { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.answers button { text-align: left; font-size: 16px; }
.answers button.correct { background: rgba(63, 122, 82, 0.18); border-color: var(--ore); color: #24502f; font-weight: bold; }
.answers button.wrong { background: rgba(142, 58, 42, 0.14); border-color: var(--blood); color: var(--blood); }
.explain { border-left: 3px solid var(--copper); padding: 8px 12px; font-size: 15px; background: rgba(168, 86, 31, 0.08); }
.progress { font-size: 12px; color: var(--ink-soft); letter-spacing: 0.12em; text-transform: uppercase; }

@media (min-width: 700px) and (orientation: landscape) {
  #subtitle { left: 50%; right: auto; transform: translateX(-50%); width: min(640px, 90vw); bottom: calc(40px + var(--safe-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  #btn-action { animation: none; }
  #title-card { transition: none; }
}

/* Schurfplan (Minispiel) */
.schurf-stats { display: flex; gap: 16px; align-items: flex-end; margin: 4px 0 10px; font-size: 15px; }
.schurf-stats .label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--copper); font-weight: bold; margin-bottom: 2px; }
.kraft i { display: inline-block; width: 5px; height: 13px; margin-right: 2px; background: var(--ink-faint); border-radius: 1px; vertical-align: middle; }
.kraft i.on { background: var(--copper); }
.schurf-grid { display: grid; gap: 3px; border: 1.5px solid var(--ink-soft); padding: 4px; background: rgba(58, 42, 24, 0.08); }
.schurf-grid .cell, .sw { min-height: 0; padding: 0; border: 1px solid rgba(58, 42, 24, 0.4); border-radius: 2px; position: relative; }
.schurf-grid .cell { aspect-ratio: 1; width: 100%; }
.cell.soil, .sw.soil { background: #b08a5a; }
.cell.rock, .sw.rock { background: #d7cdb1; }
.cell.sand, .sw.sand { background: #dcb57a; }
.cell.ore, .sw.ore { background: #3b3e41 linear-gradient(135deg, transparent 42%, #4f9a6a 42%, #4f9a6a 56%, transparent 56%); }
.cell.water, .sw.water { background: #7fa6c2 repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.4) 5px 7px); }
.cell.loose, .sw.loose { background-image: linear-gradient(48deg, transparent 46%, rgba(58, 42, 24, 0.75) 46%, rgba(58, 42, 24, 0.75) 51%, transparent 51%), linear-gradient(-28deg, transparent 62%, rgba(58, 42, 24, 0.75) 62%, rgba(58, 42, 24, 0.75) 66%, transparent 66%); }
.cell.dug { background: #3a2a18; }
.cell.dug.ore::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #7fcf98, #3f7a52); }
.cell.timbered { box-shadow: inset 0 0 0 3px var(--wood-light); }
.cell.flooded { background: #4f7fa0 !important; }
.cell.can, .sw.can { outline: 2px solid var(--copper); outline-offset: -2px; cursor: pointer; }
.cell.can:active { transform: scale(0.92); }
.schurf-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; margin-top: 8px; color: var(--ink-soft); }
.sw { display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }
.schurf-msg { min-height: 2.6em; font-style: italic; font-size: 15px; margin: 8px 0 0; }

/* Schmelzofen (Minispiel Kapitel 3) */
.feuer-wrap { display: flex; gap: 14px; align-items: stretch; margin: 4px 0 8px; }
.feuer-art { flex: 1; min-width: 0; text-align: center; }
.feuer-svg { width: 100%; max-height: 34vh; display: block; }
.feuer-glow { margin: 4px 0 0 !important; font-size: 15px !important; font-weight: bold; color: var(--copper); }
.crack { opacity: 0; transition: opacity 0.2s; }
.crack.on { opacity: 1; }
#feuer-sparks { transition: opacity 0.3s; }
#feuer-bellows.puff { animation: puff 0.25s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes puff { 40% { transform: scaleY(0.6); } }
.feuer-gauge { position: relative; width: 44px; flex: none; border: 1.5px solid var(--ink-soft); border-radius: 3px;
  background: linear-gradient(0deg, #4a3a30, #7a2a1a 30%, #b8321e 45%, #e0702a 62%, #f2b84a 80%, #fff2c8); }
.feuer-gauge .band { position: absolute; left: 0; right: 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: rgba(255, 250, 235, 0.45); }
.feuer-gauge .band.over { border-bottom: 2px dashed var(--blood); border-top: 0; background: repeating-linear-gradient(45deg, rgba(142, 58, 42, 0.5) 0 4px, transparent 4px 8px); }
.feuer-gauge .band span { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); margin-right: 4px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.feuer-gauge .needle { position: absolute; left: -6px; right: -6px; height: 4px; margin-bottom: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 1.5px var(--parch); transition: bottom 0.05s linear; }
.feuer-gauge .needle::after { content: ""; position: absolute; right: -8px; top: -5px; border: 7px solid transparent; border-left-color: var(--ink); border-right: 0; }
.feuer-art { padding-right: 52px; } /* Platz für die Beschriftung der Skala */
.feuer-stats { flex-wrap: wrap; gap: 10px 16px; }
.feuer-stats .bar { display: inline-block; width: 86px; height: 12px; border: 1px solid var(--ink-soft); border-radius: 2px; vertical-align: middle; background: rgba(58, 42, 24, 0.08); overflow: hidden; }
.feuer-stats .bar i { display: block; height: 100%; width: 0; background: var(--ore); }
.feuer-stats .bar.fuel i { background: var(--copper); }
.feuer-stats .bar.fuel.low { border-color: var(--blood); animation: blink 0.8s steps(2) infinite; }
@keyframes blink { 50% { border-color: transparent; } }
.feuer-buttons { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 10px; }
.feuer-buttons button { min-height: 64px; font-size: 18px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.feuer-buttons button:active { transform: scale(0.96); }
.sheet.feuer-hot { box-shadow: inset 0 0 0 3px var(--blood), 0 6px 18px rgba(20, 10, 0, 0.35); }

/* Rückblick ins Zechsteinmeer */
#story[data-theme="sea"] { background: rgba(10, 30, 45, 0.78); }
#story[data-theme="sea"] .sheet { background: #dde8ec var(--grain); }
#story[data-theme="sea"] .kicker { color: #2f5d7a; }
#story-art svg { width: 100%; height: auto; display: block; border: 1px solid var(--ink-faint); margin-bottom: 12px; }
.sea-art .swim > g { animation: swim 6s ease-in-out infinite alternate; }
.sea-art .swim > g:nth-child(2) { animation-duration: 8s; }
.sea-art .sink circle { animation: sink 7s linear infinite; }
@keyframes swim { to { translate: 24px -4px; } }
@keyframes sink { to { translate: 0 70px; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sea-art .swim > g, .sea-art .sink circle, #feuer-bellows.puff, .feuer-stats .bar.fuel.low { animation: none; }
}

/* Anleitung mit Hand */
#coach { position: absolute; pointer-events: none; z-index: 5; }
#coach-hand { position: absolute; width: 54px; height: 54px; color: #fff5e3; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
#coach-hand svg { width: 100%; height: 100%; stroke-width: 2.2; }
#coach-text { position: absolute; width: max-content; max-width: min(260px, 70vw); padding: 8px 12px; font-size: 15px; font-weight: bold; border-radius: 3px; line-height: 1.35; }
.coach-joy { right: calc(40px + var(--safe-right)); bottom: calc(60px + var(--safe-bottom)); }
.coach-joy #coach-hand { right: 22px; bottom: 0; animation: drag 1.6s ease-in-out infinite; }
.coach-joy #coach-text { right: 0; bottom: 120px; }
.coach-look { left: calc(40px + var(--safe-left)); bottom: calc(170px + var(--safe-bottom)); }
.coach-look #coach-hand { left: 30px; bottom: 0; animation: swipe 1.8s ease-in-out infinite; }
.coach-look #coach-text { left: 0; bottom: 74px; }
.coach-action { right: calc(34px + var(--safe-right)); bottom: calc(172px + var(--safe-bottom)); width: 84px; height: 84px; }
.coach-action #coach-hand { left: -36px; top: -30px; transform: rotate(-30deg); animation: tap 1s ease-in-out infinite; }
.coach-action #coach-text { right: 0; bottom: 140px; }
.coach-keys { left: 50%; top: calc(120px + var(--safe-top)); transform: translateX(-50%); }
.coach-keys #coach-hand { display: none; }
.coach-keys #coach-text { position: static; display: block; }
@keyframes drag { 0%, 100% { transform: translate(0, 0); opacity: 0.4; } 15% { opacity: 1; } 60% { transform: translate(6px, -48px); opacity: 1; } }
@keyframes swipe { 0%, 100% { transform: translateX(30px); } 50% { transform: translateX(-50px); } }
@keyframes tap { 0%, 100% { transform: rotate(-30deg) translate(0, 0); } 50% { transform: rotate(-30deg) translate(8px, 10px) scale(0.92); } }

#btn-skip { position: absolute; right: calc(14px + var(--safe-right)); bottom: calc(18px + var(--safe-bottom)); width: auto; height: 40px; padding: 0 16px; font-size: 14px; font-weight: bold; z-index: 6; }

/* Hilfe */
.help-row { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; font-size: 15px; line-height: 1.4; }
.help-icon { flex: none; width: 40px; height: 40px; color: var(--copper); }
.help-icon svg { width: 40px; height: 40px; }
#story-art .candle { animation: flicker 0.9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom; }
@keyframes flicker { to { transform: scale(0.85, 1.1) skewX(4deg); } }

/* Bewegung der Fenster: Pergament entrollt sich, Toast gleitet ein */
.overlay:not(.hidden) .sheet { animation: unroll 0.32s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes unroll { from { transform: translateY(14px) scale(0.96); opacity: 0; } }
#toast:not(.hidden) { animation: toastIn 0.35s ease-out; }
@keyframes toastIn { from { transform: translate(-50%, -14px); opacity: 0; } }
#objective-full:not(.hidden) { animation: scrollDown 0.3s ease-out; transform-origin: top; }
@keyframes scrollDown { from { transform: scaleY(0.2); opacity: 0; } }
#subtitle:not(.hidden) { animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.card-icon { animation: none; }
.overlay:not(.hidden) .card-icon { animation: cardIn 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.4); }
@keyframes cardIn { from { transform: rotateY(90deg) scale(0.6); } }
@media (prefers-reduced-motion: reduce) {
  #coach-hand, .overlay .sheet, #toast, #objective-full, #subtitle, .card-icon, #story-art .candle { animation: none !important; }
}

/* Zielpfeil am Rand */
#pointer { position: absolute; left: 0; top: 0; width: 44px; height: 44px; pointer-events: none !important; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); transition: opacity 0.2s; }
#pointer svg { width: 44px; height: 44px; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { #pointer svg { animation: none; } }

/* Steinsammlung */
h3.section { font-size: 18px; margin: 18px 0 4px; border-top: 1px solid var(--ink-faint); padding-top: 12px; }
.gem-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gem-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; min-height: 0; font-size: 11px; border: 1.5px solid var(--ink-soft); border-radius: 4px; background: rgba(255, 250, 235, 0.45); }
.gem-tile span { color: var(--ink); line-height: 1.1; text-align: center; }
.gem-tile svg { width: 28px; height: 28px; }
.gem-tile.locked { border-style: dashed; color: var(--ink-faint); background: transparent; }
.mineral-icon svg { width: 48px; height: 48px; }

/* Name und Urkunde */
.name-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 22px; padding: 10px 12px; border: 1.5px solid var(--ink-soft); border-radius: 4px; background: #fff8e6; color: var(--ink); margin: 4px 0 10px; }
.certificate { text-align: center; border: 3px double var(--ink-soft); padding: 16px 12px; position: relative; }
.cert-name { font-size: 28px !important; font-style: italic; color: var(--copper); margin: 6px 0 10px !important; border-bottom: 1px solid var(--ink-faint); padding-bottom: 6px; }
.cert-list { text-align: left; font-size: 15px; line-height: 1.6; margin: 10px auto; padding-left: 20px; max-width: 320px; }
.seal-mark { width: 64px; height: 64px; margin: 8px auto 4px; color: #fff5e3; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #c9533a, var(--blood)); padding: 10px; box-sizing: border-box; animation: cardIn 0.8s cubic-bezier(0.2, 0.8, 0.3, 1.4); }
.seal-mark svg { width: 100%; height: 100%; }

/* Anleitungen zu den Minispielen (js/howto.js) */
.howto-goal { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 10px; line-height: 1.45; }
.howto-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--copper); color: #fff5e3; }
.howto-icon svg { width: 22px; height: 22px; }
.howto-steps { list-style: none; counter-reset: step; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.howto-steps li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; font-size: 15px; padding: 6px 8px; border: 1.5px solid var(--ink-faint); border-radius: 4px; background: rgba(255, 250, 235, 0.45); }
.howto-steps li .howto-icon { background: var(--wood-light); }
.howto-watch { font-size: 14px; line-height: 1.45; padding: 6px 10px; border-left: 3px solid var(--blood); background: rgba(142, 58, 42, 0.07); }
.howto-watch ul { margin: 4px 0 0; padding-left: 18px; }
.howto-q { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; font-size: 20px; font-weight: bold; z-index: 2; color: #f6ecd4; }
.howto-overlay { position: absolute; inset: 0; z-index: 3; overflow: auto; padding: 18px 18px 20px; border-radius: inherit; }
#modal-sheet { position: relative; }
.schurf-grid .cell .cost { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: bold; color: var(--ink); pointer-events: none; text-shadow: 0 0 3px rgba(255, 250, 235, 0.9); }
.schurf-grid .cell { position: relative; }

/* Einstellungen: große Schrift */
body.big-text #subtitle, body.big-text .sheet p, body.big-text .answers button, body.big-text #objective-full { font-size: 20px; }
body.big-text .story-text, body.big-text .chronik-text { font-size: 22px; }
body.big-text #objective { font-size: 17px; }
body.big-text button { font-size: 18px; }
body.big-text .card-tile { font-size: 16px; }
body.big-text .schurf-msg, body.big-text .explain { font-size: 17px; }

/* Einstellungen: Hebel links für die linke Hand (Standard ist rechts), Medaillon rechts unten */
body.left-hand #joy-area { right: auto; left: 0; }
body.left-hand #look-area { left: auto; right: 0; }
body.left-hand #joystick { right: auto; left: calc(30px + var(--safe-left)); }
body.left-hand #btn-action { bottom: calc(44px + var(--safe-bottom)); }
body.left-hand .coach-joy { right: auto; left: calc(40px + var(--safe-left)); }
body.left-hand .coach-joy #coach-hand { right: auto; left: 22px; }
body.left-hand .coach-joy #coach-text { right: auto; left: 0; }
body.left-hand .coach-look { left: auto; right: calc(40px + var(--safe-right)); }
body.left-hand .coach-look #coach-hand { left: auto; right: 30px; }
body.left-hand .coach-look #coach-text { left: auto; right: 0; }
body.left-hand .coach-action { bottom: calc(44px + var(--safe-bottom)); }
