/* ================= Quest of Numbers – Cozy Medieval Fantasy ================= */
:root {
  --parchment: #F5ECD7; --parchment-2: #EADBB8; --oak: #3E2723; --oak-2: #5D4037;
  --gold: #D4A359; --gold-2: #B8862F; --moss: #4A6B53; --moss-2: #35503d; --red: #a8312e;
  --text: #3E2723; --muted: #7a6650; --bg: #e8dcc0; --card: var(--parchment); --shadow: 0 6px 22px rgba(62, 39, 35, .25);
  --font-title: 'MedievalSharp', 'Palatino Linotype', Georgia, serif;
  --font: 'Alegreya', 'Palatino Linotype', Georgia, serif;
  --hand: 'Patrick Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  --radius: 16px;
}
body.night {
  --parchment: #2f2622; --parchment-2: #3a2f29; --text: #efe3cc; --muted: #b8a68c; --bg: #1b1513; --card: #2b221e;
  --shadow: 0 6px 22px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg); font-size: 17px; line-height: 1.45;
  background-image: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .35), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(74, 107, 83, .18), transparent 45%);
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  transition: background-color .4s, color .4s;
}
body.night { background-image: radial-gradient(circle at 20% 10%, rgba(212, 163, 89, .08), transparent 40%), radial-gradient(circle at 80% 90%, rgba(74, 107, 83, .12), transparent 45%); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; margin: .2em 0 .4em; color: var(--text); }
h2 { font-size: 1.6rem; } h3 { font-size: 1.2rem; }
.muted { color: var(--muted); } .small { font-size: .85em; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Pergament-Schriftrollen ---------- */
.scroll-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; position: relative;
  border: 2px solid rgba(62, 39, 35, .18);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 30%), repeating-linear-gradient(0deg, rgba(120, 90, 50, .025) 0 2px, transparent 2px 6px);
}
.scroll-card::before, .scroll-card::after {
  content: ''; position: absolute; left: 10px; right: 10px; height: 10px; border-radius: 10px;
  background: linear-gradient(180deg, #8b6b45, #5d4037); opacity: .55;
}
.scroll-card::before { top: -5px; } .scroll-card::after { bottom: -5px; }
body.night .scroll-card { border-color: rgba(212, 163, 89, .18); background-image: none; }

/* ---------- Holz-Buttons ---------- */
.btn {
  border: none; border-radius: 12px; padding: 12px 20px; font-size: 1.05rem; font-weight: 700; color: #fff8e8;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; transition: transform .1s, filter .2s;
}
.btn:active { transform: translateY(2px) scale(.98); }
.btn.wood {
  background: linear-gradient(180deg, #7a5134, #4e3221); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .25);
  background-image: repeating-linear-gradient(95deg, rgba(255, 255, 255, .05) 0 3px, transparent 3px 11px), linear-gradient(180deg, #7a5134, #4e3221);
  border: 2px solid #3E2723; text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
}
.btn.wood:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; color: var(--text); border: 2px solid #9a6b25; }
body.night .btn.ghost { border-color: var(--gold); }
.btn.ghost:hover { background: rgba(212, 163, 89, .15); }
.btn.small { padding: 8px 14px; min-height: 40px; font-size: .95rem; }
.btn.big { font-size: 1.2rem; padding: 14px 26px; }
.btn:disabled { opacity: .6; cursor: wait; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 2px solid rgba(212, 163, 89, .6); background: rgba(255, 255, 255, .12); font-size: 1.25rem; color: inherit; }
.icon-btn:hover { background: rgba(212, 163, 89, .25); }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.chip { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--moss); color: #fff; font-size: .85rem; font-weight: 700; }
.chip.ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--gold); }
.tag { font-family: var(--hand); color: #8a5a1e; letter-spacing: .5px; }
body.night .tag { color: var(--gold); }

/* ---------- Screens ---------- */
.screen { display: none; min-height: 100vh; padding: 14px; padding-bottom: 40px; max-width: 1400px; margin: 0 auto; }
.screen.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Start ---------- */
.title-banner { text-align: center; margin: 10px auto 18px; }
.title-banner h1 { font-size: clamp(2.2rem, 7vw, 4rem); margin: 0; color: var(--oak); text-shadow: 2px 2px 0 var(--gold), 4px 4px 0 rgba(0, 0, 0, .12); }
body.night .title-banner h1 { color: var(--gold); text-shadow: 2px 2px 0 #000; }
.subtitle { font-family: var(--font-title); font-size: 1.3rem; color: var(--moss); margin: 0; }
body.night .subtitle { color: #8fbf9a; }
.title-art { display: flex; justify-content: center; align-items: flex-end; gap: 0; height: 130px; }
.title-castle { width: 190px; } .title-hero { width: 82px; margin-left: -36px; animation: bob 2.4s ease-in-out infinite; }
.start-card { max-width: 900px; margin: 0 auto; text-align: center; }
.story { font-size: 1.1rem; }
.profile-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 14px 0 20px; }
.tile {
  background: rgba(255, 255, 255, .35); border: 2px solid rgba(212, 163, 89, .6); border-radius: 14px; padding: 10px 6px; color: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s, box-shadow .15s;
}
body.night .tile { background: rgba(255, 255, 255, .04); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0, 0, 0, .15); }
.tile-art { position: relative; width: 64px; height: 84px; }
.tile-art svg:first-child { width: 64px; height: 84px; }
.tile-crown { position: absolute; width: 30px; top: -8px; left: 17px; }
.tile small { color: var(--muted); }
.start-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; margin-bottom: 14px;
  background: linear-gradient(180deg, #5a3a26, #3E2723); color: #f5ecd7; box-shadow: var(--shadow); border: 2px solid #2a1a17;
}
.who { display: flex; align-items: center; gap: 10px; }
.who small { color: var(--gold); }
.mini-av { width: 40px; height: 52px; display: inline-block; vertical-align: middle; }
.mini-av svg { width: 100%; height: 100%; }
.stats { display: flex; gap: 14px; font-weight: 700; flex: 1; justify-content: center; flex-wrap: wrap; }
.top-actions { display: flex; gap: 6px; }
.topbar .icon-btn { color: #f5ecd7; }

/* ---------- Karte ---------- */
.map-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 20px; }
.map-hero-art { display: flex; align-items: flex-end; }
.mh { position: relative; width: 100px; } .mh svg { width: 100px; animation: bob 2.6s ease-in-out infinite; }
.mh .hero-crown, .hero-fig .hero-crown, .v-hero .hero-crown { position: absolute; width: 40px; top: -14px; left: 30px; animation: none; }
.cat-train { display: flex; gap: 2px; margin-left: -8px; }
.cat-train .cat { width: 52px; }
.map-king svg { width: 120px; }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.chapter.locked { filter: grayscale(.8); opacity: .65; }
.chapter.cleared { border-color: var(--moss); }
.ch-head { display: flex; gap: 14px; align-items: center; }
.ch-head h3 { margin: 0; } .ch-head p { margin: 2px 0; font-size: .92rem; }
.ch-art { width: 92px; flex-shrink: 0; } .ch-art svg { width: 100%; height: 70px; }
.ch-prog { font-weight: 700; color: var(--moss); }
.nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.node {
  position: relative; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--oak); background: var(--parchment-2); font-weight: 700; font-size: 1.05rem;
  color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0; transition: transform .15s;
}
.node.open:hover { transform: scale(1.08); }
.node.closed { opacity: .55; cursor: not-allowed; font-size: .9rem; }
.node.done { background: transparent; border-color: transparent; }
.node.done svg.seal { width: 112%; height: 112%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.node.current { background: var(--gold); box-shadow: 0 0 0 4px rgba(212, 163, 89, .35); animation: pulse 1.6s infinite; }
.node.boss { border-style: double; border-width: 5px; }
.boss-mark { position: absolute; right: -6px; top: -8px; font-style: normal; font-size: .95rem; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(212, 163, 89, .05); } }

/* ---------- Kampf ---------- */
.battle-bar .section-title { display: flex; flex-direction: column; line-height: 1.1; }
.battle-bar .section-title small { color: var(--gold); font-family: var(--font-title); }
.hearts { display: flex; gap: 2px; flex: 1; justify-content: center; }
.heart { width: 30px; height: 28px; }
.score-chip { font-weight: 700; background: rgba(0, 0, 0, .25); padding: 6px 12px; border-radius: 10px; }
.path-strip {
  position: relative; height: 120px; margin-bottom: 14px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #cfe0c3 0%, #a9c49a 100%); border: 2px solid rgba(62, 39, 35, .25); box-shadow: var(--shadow);
}
body.night .path-strip { background: linear-gradient(180deg, #233026, #1a241c); }
.path-svg { width: 100%; height: 100%; display: block; }
.walker { position: absolute; width: 44px; transform: translate(-50%, -88%); transition: left .9s cubic-bezier(.4, 1.4, .6, 1), top .9s; z-index: 2; }
.walker svg { width: 100%; }
.cat-walker { width: 30px; transform: translate(-50%, -70%); z-index: 1; }
.cat-walker.c0 { transition-delay: .15s; } .cat-walker.c1 { transition-delay: .3s; } .cat-walker.c2 { transition-delay: .45s; }
.cat-walker svg { animation: catbob .5s ease-in-out infinite alternate; }
.cat-walker.c1 svg { animation-delay: .15s; } .cat-walker.c2 svg { animation-delay: .3s; }
.path-info { position: absolute; right: 10px; bottom: 6px; font-weight: 700; background: rgba(245, 236, 215, .85); color: #3E2723; padding: 2px 10px; border-radius: 8px; font-size: .9rem; }

.battle-layout { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.15fr); gap: 18px; align-items: start; }
.arena {
  --ground: #a08a6a; position: relative; height: 230px; border-radius: 16px; overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #f6e7c8 0%, #f1d9a8 55%, var(--ground) 55%, color-mix(in srgb, var(--ground), #000 25%) 100%);
  border: 2px solid rgba(62, 39, 35, .3);
}
body.night .arena { background: linear-gradient(180deg, #1f2436 0%, #2d3046 55%, color-mix(in srgb, var(--ground), #000 45%) 55%, color-mix(in srgb, var(--ground), #000 65%) 100%); }
.arena.throne { background: linear-gradient(180deg, #3b2a40 0%, #563b4e 55%, #6d1f2a 55%, #3d0f17 100%); }
.arena-sky { position: absolute; inset: 0; background: radial-gradient(circle at 80% 18%, rgba(255, 240, 200, .8) 0 22px, transparent 24px); }
body.night .arena-sky { background: radial-gradient(circle at 80% 18%, rgba(240, 240, 255, .7) 0 16px, transparent 18px); }
.fighter { position: absolute; bottom: 14px; display: flex; align-items: flex-end; transition: transform .25s; }
.hero-side { left: 6%; }
.hero-fig { position: relative; width: 110px; } .hero-fig svg:first-child { width: 110px; }
.cats { display: flex; margin-left: -10px; position: relative; }
.cats .cat { width: 48px; transition: transform .2s; }
.foe-side { right: 6%; gap: 10px; }
.foe-fig { width: 110px; animation: bob 2s ease-in-out infinite; } .foe-fig svg { width: 100%; }
.foe-fig.guard { width: 130px; } .foe-fig.boss { width: 140px; }
.cage-side svg { width: 90px; }
.hero-side.attack { transform: translateX(60px); } .foe-side.attack { transform: translateX(-60px); }
.hurt { animation: hurt .5s; }
@keyframes hurt { 25% { transform: translateX(-8px); filter: brightness(1.8) saturate(.3); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.cat.cheer { animation: cheer .55s ease-out 2; }
@keyframes cheer { 40% { transform: translateY(-26px) rotate(-8deg); } }
.meow-bubble { position: absolute; top: -32px; background: #fff; color: #3E2723; border-radius: 12px; padding: 2px 8px; font-family: var(--hand); font-size: 1rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); animation: pop .3s; white-space: nowrap; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.hp-bar { position: absolute; top: 10px; right: 10px; left: 40%; height: 22px; background: rgba(0, 0, 0, .35); border-radius: 12px; overflow: hidden; border: 2px solid #2a1a17; }
.hp-fill { height: 100%; background: linear-gradient(90deg, #c0392b, #e67e22); transition: width .6s; }
.hp-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .82rem; font-weight: 700; text-shadow: 0 1px 2px #000; }
.float-layer { position: absolute; inset: 0; pointer-events: none; }
.float { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-family: var(--font-title); font-size: 2rem; font-weight: 700; animation: floatUp 1.4s ease-out forwards; text-shadow: 0 2px 0 #3E2723; }
.float.gold { color: #ffd76a; } .float.crit { color: #ff6fae; top: 25%; font-size: 2.3rem; }
.float.dmg { color: #ff8a80; left: 78%; } .float.dmg-hero { color: #ff8a80; left: 20%; }
@keyframes floatUp { to { transform: translate(-50%, -70px); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes catbob { to { transform: translateY(-4px); } }
.cat.walk { animation: catbob .45s ease-in-out infinite alternate; } .cat.d1 { animation-delay: .15s; } .cat.d2 { animation-delay: .3s; }

.task-card { padding-top: 22px; }
.task-head { display: flex; gap: 8px; flex-wrap: wrap; }
.task-text { font-size: 1.3rem; font-weight: 600; margin: 12px 0; }
.answer-row { display: flex; gap: 10px; }
.answer-row.pyr { justify-content: center; }
.answer-input {
  flex: 1; min-width: 0; font-size: 1.5rem; font-family: var(--hand); padding: 8px 14px; border-radius: 12px; border: 3px solid var(--gold);
  background: #fffdf6; color: #1d4f91; min-height: 52px;
}
body.night .answer-input { background: #241d1a; color: #9cc7ff; }
.answer-input:focus { outline: none; box-shadow: 0 0 0 4px rgba(212, 163, 89, .35); }
.input-hint { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.task-tools { margin-top: 10px; }
.hint-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(212, 163, 89, .18); border-left: 5px solid var(--gold); }
.hint-box p { margin: 4px 0; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: 12px; animation: pop .25s; }
.feedback.good { background: rgba(74, 107, 83, .18); border-left: 5px solid var(--moss); }
.feedback.bad { background: rgba(168, 49, 46, .14); border-left: 5px solid var(--red); }
.fb-head { font-family: var(--font-title); font-size: 1.25rem; }
.feedback p { margin: 6px 0; }
.err-line { font-weight: 700; }
.src { color: var(--muted); display: block; margin-top: 6px; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* Pyramide als Steinmauer */
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 10px 0 14px; }
.pyr-row { display: flex; gap: 4px; }
.brick {
  width: 70px; height: 44px; border-radius: 6px; font-family: var(--hand); font-size: 1.35rem; text-align: center; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #c9b79a, #a8916f); border: 2px solid #6d5a44; color: #2b2118; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.brick.known { font-family: var(--font); font-weight: 700; }
input.brick { background: #fffdf6; color: #1d4f91; border-style: dashed; padding: 0; }
input.brick:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 163, 89, .4); }
input.brick.revealed { background: #fbe9bf; color: var(--gold-2); border-style: solid; }
body.night input.brick { background: #241d1a; color: #9cc7ff; }
@media (max-width: 420px) { .brick { width: 56px; height: 40px; font-size: 1.15rem; } }

/* Karopapier */
.paper-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; border: 2px solid rgba(62, 39, 35, .18); position: sticky; top: 10px; }
.paper-toolbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.tool-group { display: flex; gap: 4px; align-items: center; }
.tool { width: 44px; height: 44px; border-radius: 10px; border: 2px solid rgba(62, 39, 35, .25); background: rgba(255, 255, 255, .4); font-size: 1.2rem; color: var(--text); }
body.night .tool { background: rgba(255, 255, 255, .05); }
.tool.active { background: var(--gold); border-color: var(--oak); }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .8); background: var(--c); box-shadow: 0 0 0 2px rgba(62, 39, 35, .3); }
.swatch.active { box-shadow: 0 0 0 3px var(--gold); transform: scale(1.12); }
.grid-host { border-radius: 10px; overflow: hidden; border: 2px solid rgba(62, 39, 35, .25); }
.grid-stack { position: relative; width: 100%; aspect-ratio: 22 / 20; }
.grid-stack canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.grid-ink { touch-action: none; cursor: crosshair; }
.grid-host[data-tool="type"] .grid-ink { cursor: text; }
.grid-host[data-tool="eraser"] .grid-ink { cursor: cell; }
.grid-keys { position: absolute; opacity: 0; width: 1px; height: 1px; left: 0; top: 0; pointer-events: none; font-size: 16px; }
.paper-note { font-size: .85rem; color: var(--muted); margin: 8px 4px 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(30, 20, 15, .6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 14px; backdrop-filter: blur(3px); }
.modal-box { width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; text-align: center; animation: unroll .35s ease; }
.modal-box.wide { max-width: 760px; }
@keyframes unroll { from { transform: scaleY(.2); opacity: 0; } }
.modal-x { position: absolute; top: 6px; right: 8px; width: 44px; height: 44px; border: none; background: none; font-size: 1.3rem; color: var(--muted); }
.field { display: block; text-align: left; font-weight: 700; margin: 12px 0; }
.field input { display: block; width: 100%; margin-top: 6px; font-size: 1.3rem; padding: 10px 14px; border-radius: 12px; border: 3px solid var(--gold); background: #fffdf6; color: #3E2723; font-family: var(--hand); }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0 6px; }
.pin-dots span { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--oak); transition: background .15s; }
body.night .pin-dots span { border-color: var(--gold); }
.pin-dots span.on { background: var(--gold); }
.pin-err { color: var(--red); min-height: 1.3em; font-weight: 700; margin: 4px 0; }
body.night .pin-err { color: #ff8a80; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 290px; margin: 0 auto; }
.numpad button {
  height: 64px; border-radius: 14px; font-size: 1.6rem; font-weight: 700; color: #fff8e8; border: 2px solid #3E2723;
  background: linear-gradient(180deg, #7a5134, #4e3221); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
}
.numpad button:active { transform: translateY(2px); }
.numpad .ok { background: linear-gradient(180deg, #5d8a6a, var(--moss-2)); }
.welcome-art, .camp-art, .victory-art, .boss-intro { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 6px 0 10px; }
.welcome-art > svg { width: 100px; } .cat-row { display: flex; } .cat-row .cat { width: 56px; }
.cat-row.sleep .cat { transform: rotate(8deg); opacity: .95; }
.cat.cheer-loop { animation: cheer .7s ease-out infinite; } .cat-row .cat:nth-child(2).cheer-loop { animation-delay: .2s; } .cat-row .cat:nth-child(3).cheer-loop { animation-delay: .4s; }
.egg { background: linear-gradient(90deg, rgba(255, 111, 174, .2), rgba(212, 163, 89, .2)); padding: 10px; border-radius: 12px; }
.camp-art .campfire { width: 150px; } .camp-hero svg { width: 80px; }
.flames .f1 { animation: flick 1s infinite alternate; transform-origin: 60px 78px; } .flames .f2 { animation: flick .7s infinite alternate-reverse; transform-origin: 60px 78px; } .flames .f3 { animation: flick .5s infinite alternate; transform-origin: 60px 78px; }
@keyframes flick { to { transform: scaleY(1.12) scaleX(.94); } }
.boss-intro svg { width: 140px; } .boss-intro .cage { width: 100px; }
.lordnull .glow { animation: glow 1.2s infinite alternate; } .lordnull .orb { animation: glow 1.6s infinite alternate; }
@keyframes glow { to { opacity: .45; } }
.lordnull.rage { animation: shake .4s 3; }
.victory-art .cage { width: 140px; } .v-hero { position: relative; } .v-hero svg:first-child { width: 100px; }
.big-bonus { font-family: var(--font-title); font-size: 1.5rem; color: #8a5a1e; }
body.night .big-bonus { color: var(--gold); }
.seal-big svg { width: 110px; animation: pop .5s; }
.book-group { text-align: left; border-bottom: 2px solid var(--gold); padding-bottom: 4px; margin-top: 18px; }
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; text-align: left; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .3); cursor: pointer; }
body.night .toggle { background: rgba(255, 255, 255, .04); }
.toggle input { display: none; }
.toggle .sw { width: 48px; height: 28px; border-radius: 14px; background: #8d7a66; position: relative; flex-shrink: 0; transition: background .2s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.toggle input:checked + .sw { background: var(--moss); }
.toggle input:checked + .sw::after { transform: translateX(20px); }
.toggle .tl { display: flex; flex-direction: column; font-weight: 600; }
.toggle .tl small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.ai-info { margin-top: 16px; padding: 10px; border-radius: 12px; background: rgba(74, 107, 83, .15); }
.hall-wrap { overflow-x: auto; }
.hall { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hall th, .hall td { padding: 8px 6px; border-bottom: 1px solid rgba(62, 39, 35, .15); white-space: nowrap; }
.hall th { font-family: var(--font-title); font-weight: 400; }
.hall tr.me { background: rgba(212, 163, 89, .25); font-weight: 700; }
.hall-name { text-align: left; display: flex; align-items: center; gap: 6px; }
.hall-name .mini-av { width: 26px; height: 34px; }

/* Urkunde */
.certificate { border: 6px double var(--gold-2); padding: 24px; border-radius: 10px; background: #fbf3df; color: #3E2723; position: relative; }
.certificate h1 { font-size: 2.4rem; color: #7a2e2e; }
.cert-crown svg { width: 80px; }
.cert-name { font-family: var(--hand); font-size: 2.4rem; margin: 0; color: #3E2723; }
.cert-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-weight: 700; }
.cert-date { font-style: italic; margin-top: 18px; }
.cert-seal { position: absolute; right: 18px; bottom: 14px; } .cert-seal svg { width: 70px; }
#print-area { display: none; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; inset: 0; padding: 30px; }
  .no-print { display: none; }
}

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--oak); color: #f5ecd7; padding: 12px 20px; border-radius: 12px; z-index: 80; box-shadow: var(--shadow); border: 2px solid var(--gold); max-width: 90vw; text-align: center; animation: pop .25s; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .battle-layout { grid-template-columns: 1fr; }
  .paper-card { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .screen { padding: 8px; }
  .map-hero { grid-template-columns: 1fr; text-align: center; }
  .map-hero-art { justify-content: center; } .map-king { display: none; }
  .chapters { grid-template-columns: 1fr; }
  .arena { height: 190px; }
  .hero-fig, .hero-fig svg:first-child { width: 78px; } .cats .cat { width: 34px; }
  .foe-fig { width: 82px; } .foe-fig.guard, .foe-fig.boss { width: 100px; } .cage-side svg { width: 60px; }
  .hp-bar { left: 30%; }
  .path-strip { height: 96px; } .walker { width: 34px; } .cat-walker { width: 22px; }
  .heart { width: 24px; height: 22px; }
  .battle-bar .section-title small { display: none; }
  .task-text { font-size: 1.15rem; }
  .tool { width: 40px; height: 40px; }
  .stats { order: 3; width: 100%; }
}

.mix-line { background: rgba(212, 163, 89, .15); border-radius: 10px; padding: 8px 10px; font-size: .92rem; }

/* ---------- Barrierefreiheit ---------- */
.answer-input::placeholder, .field input::placeholder { color: #857a6c; }
:focus-visible { outline: 3px solid #1d4f91; outline-offset: 2px; }
body.night :focus-visible { outline-color: #9cc7ff; }
.answer-input:focus-visible, input.brick:focus-visible { outline: none; }
.grid-stack:focus-within { box-shadow: 0 0 0 3px rgba(29, 79, 145, .5); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.jump-btn { display: none; }
@media (max-width: 980px) {
  #screen-battle.active ~ .jump-btn, .jump-btn.show {
    display: flex; position: fixed; right: 14px; bottom: 18px; z-index: 40; align-items: center; gap: 6px;
    padding: 12px 16px; min-height: 48px; border-radius: 24px; border: 2px solid #3E2723; font-weight: 700; color: #fff8e8;
    background: linear-gradient(180deg, #5d8a6a, var(--moss-2)); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  }
}
