/* ============================================================
   adventure.css – Stufen 6–7 (größere Rätsel) und die Kapitel 8–10
   (Uhrenwerkstatt, Mondmarkt, Wolkenschiff)
   ============================================================ */

/* ---------- Größere Varianten (Stufe 6–7) ---------- */
.pipes-grid.pipes-n5 { grid-template-columns: repeat(5, 58px); grid-template-rows: repeat(5, 58px); }
.pipes-n5 .pipe-svg { width: 58px; height: 58px; }
.seq-n9 .slot, .seq-n10 .slot { width: 38px; height: 38px; }
.seq-n9 .slot svg, .seq-n10 .slot svg { width: 28px; height: 28px; }
.seq-n9, .seq-n10 { gap: 5px; flex-wrap: wrap; }

/* ---------- Gemeinsam: Rundenpunkte, Funkel ---------- */
.round-dots { display: flex; justify-content: center; gap: 8px; margin: 4px 0 10px; }
.rdot { width: 16px; height: 16px; border-radius: 50%; background: #eadbd5; border: 2px solid #d9c2b9; }
.rdot.done { background: #8fcf8a; border-color: #5e9f5a; }
.rdot.now { background: #ffd166; border-color: #e0a53a; transform: scale(1.15); }
.funkel .funkel-glow { animation: funkelGlow 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes funkelGlow { 0%, 100% { opacity: .2; transform: scale(.9); } 50% { opacity: .5; transform: scale(1.08); } }

/* ---------- Kapitel 8: Uhrenwerkstatt ---------- */
.scene-workshop .pendulum { animation: swing 1.6s ease-in-out infinite alternate; transform-origin: 1210px 380px; }
@keyframes swing { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.clocks-view, .calendar-view, .sudoku-view, .syl-view, .counter-view, .flags-view, .route-view { text-align: center; }
.cuckoo-card, .cal-page { background: #fff; border: 3px solid #e8d5cd; border-radius: 16px; padding: 10px 16px; font-size: 1.15rem; font-weight: 700; min-height: 70px; }
.cuckoo-card p, .cal-page p { margin: 6px 0 0; line-height: 1.45; }
.clock-wrap { display: flex; justify-content: center; margin: 10px 0 6px; }
.clock-big { width: min(220px, 60vw); height: auto; }
.clock-big .hand-h, .clock-big .hand-m { transition: transform .15s ease; }
.clock-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; }
.clock-ctrl { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.clock-ctrl span { max-width: 9em; text-align: right; }
.clock-ctrl .btn { min-width: 56px; font-size: 1.2rem; font-weight: 900; }
.cal-page { border-top: 18px solid var(--rose-deep); }
.cal-options { display: grid; gap: 8px; margin-top: 12px; }
.cal-options.days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cal-options.months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cal-btn { font-weight: 800; padding: 10px 4px; }
.cal-btn.wrong { opacity: .45; text-decoration: line-through; }
.grand-view .pendulum-mini { width: 60px; height: 70px; margin: 0 auto 4px; position: relative; }
.grand-view .pendulum-mini i { position: absolute; left: 28px; top: 0; width: 4px; height: 50px; background: #d9a441; transform-origin: top center; animation: swing 1.6s ease-in-out infinite alternate; }
.grand-view .pendulum-mini i::after { content: ""; position: absolute; left: -12px; bottom: -22px; width: 28px; height: 28px; border-radius: 50%; background: #d9a441; border: 3px solid #b5832a; }

/* ---------- Kapitel 9: Mondmarkt ---------- */
.sudoku-grid { display: inline-grid; gap: 0; border: 4px solid #5a4b57; border-radius: 10px; overflow: hidden; margin: 8px auto; background: #5a4b57; }
.sudoku-n4 { grid-template-columns: repeat(4, 62px); }
.sudoku-n6 { grid-template-columns: repeat(6, 50px); }
.scell { font: inherit; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-size: 1.6rem; font-weight: 900; background: #fffaf6; color: var(--ink); border: 0; border-right: 1px solid #d9c2b9; border-bottom: 1px solid #d9c2b9; padding: 0; }
.sudoku-n6 .scell { font-size: 1.35rem; }
.scell.br { border-right: 4px solid #5a4b57; }
.scell.bb { border-bottom: 4px solid #5a4b57; }
.scell.given { background: #f1e4dc; color: #7b3c52; }
.scell.given.wrong { background: #f7b9c6; }
.scell.open { cursor: pointer; color: #3b6fb0; }
.scell.open.selected { background: #fff3c4; box-shadow: inset 0 0 0 3px var(--sun-deep); }
.scell.open.wrong { background: #fbd0d8; color: #b0304a; }
.scell.open:focus-visible { outline: 4px solid var(--focus); outline-offset: -4px; }
.sudoku-grid.solved .scell.open { background: #dff3d8; color: #3c7a37; }
.sudoku-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 10px; }
.sudoku-key { min-width: 56px; font-size: 1.4rem; font-weight: 900; }
.syl-task { background: #fff; border: 3px solid #e8d5cd; border-radius: 16px; padding: 10px 16px; font-size: 1.1rem; font-weight: 700; }
.syl-task p { margin: 6px 0 0; }
.syl-built { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0; min-height: 52px; }
.syl-slot { min-width: 64px; height: 48px; border-radius: 10px; border: 3px dashed #d9c2b9; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 900; padding: 0 8px; }
.syl-slot.filled { border-style: solid; border-color: var(--sun-deep); background: #fff3c4; }
.syl-pool { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.syl-btn { font: inherit; font-size: 1.3rem; font-weight: 900; min-width: 64px; height: 52px; padding: 0 10px; border-radius: 10px; cursor: pointer; border: 3px solid #8c5a3a; background: linear-gradient(#ffe7a8, #f3c56c); color: var(--ink); box-shadow: 0 4px 0 #8c5a3a; }
.syl-btn:nth-child(3n+1) { background: linear-gradient(#cdeffa, #9fd2e6); }
.syl-btn:nth-child(3n+2) { background: linear-gradient(#ffd6df, #f3a9b9); }
.syl-btn[disabled] { opacity: .3; box-shadow: none; transform: translateY(4px); }
.syl-btn:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.shop-card { background: #fff; border: 3px solid #e8d5cd; border-radius: 16px; padding: 10px 16px; font-size: 1.1rem; font-weight: 700; }
.shop-card p { margin: 6px 0; }
.shop-items { list-style: none; padding: 0; margin: 6px auto; max-width: 340px; }
.shop-items li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 2px dotted #e8d5cd; }
.shop-items b { margin-left: auto; color: #7b3c52; }
.shop-emoji { font-size: 1.4rem; }
.coin-tray { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; min-height: 66px; margin: 12px auto 4px; padding: 8px; max-width: 520px; border-radius: 14px; background: #c58a5a; box-shadow: inset 0 4px 0 rgba(0, 0, 0, .12); }
.tray-empty { color: #fff8e6; font-weight: 700; }
.tray-sum { font-weight: 800; margin: 4px 0; }
.coin-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0; }
.coin-btn, .tray-coin { font: inherit; background: none; border: 0; padding: 2px; cursor: pointer; border-radius: 12px; }
.coin-btn:focus-visible, .tray-coin:focus-visible { outline: 4px solid var(--focus); }
.money { display: inline-flex; align-items: center; justify-content: center; font-weight: 900; color: #4a3b45; user-select: none; }
.coin { width: 50px; height: 50px; border-radius: 50%; font-size: .8rem; border: 3px solid rgba(0, 0, 0, .2); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.coin.copper { background: radial-gradient(#e9a27a, #c97a4c); width: 42px; height: 42px; }
.coin.gold { background: radial-gradient(#ffe39a, #e0b04a); }
.coin.euro { background: radial-gradient(#ffe39a 45%, #d6d6dc 47%); width: 56px; height: 56px; }
.note { height: 44px; min-width: 78px; border-radius: 6px; font-size: .95rem; border: 3px solid rgba(0, 0, 0, .2); }
.note.n500 { background: #cfd8e3; }
.note.n1000 { background: #f4b6b0; }

/* ---------- Kapitel 10: Wolkenschiff ---------- */
.eq-card .eqs { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0; }
.eq-card .eq { font-size: 1.7rem; font-weight: 900; letter-spacing: .04em; margin: 0; }
.eq-card .eq-ask { font-size: 1.2rem; }
.flag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 12px 0; padding: 10px 6px 4px; border-top: 3px solid #5a4b57; border-radius: 6px; }
.flag { width: 40px; height: 54px; display: inline-flex; flex-direction: column; align-items: center; position: relative; }
.flag svg { width: 40px; height: 50px; }
.flag-gap { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.flag-gap b { position: absolute; top: 8px; left: 0; right: 0; font-size: 1.2rem; color: #7a6a74; }
.flag-gap.selected svg { filter: drop-shadow(0 0 5px var(--sun-deep)); }
.flag-gap.selected::after { content: ""; position: absolute; bottom: -4px; left: 8px; right: 8px; height: 4px; border-radius: 2px; background: var(--sun-deep); }
.flag-gap:focus-visible { outline: 3px solid var(--focus); border-radius: 6px; }
.flag-colors { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.flag-color { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.flag-color i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #5a4b57; }
.route-wrap { display: flex; justify-content: center; }
.route-map { width: min(420px, 92%); height: auto; border-radius: 12px; border: 4px solid #5a4b57; }
.route-map .route-ship { transition: transform .25s ease; }
.prog { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-height: 44px; margin: 10px auto; padding: 6px; max-width: 520px; border-radius: 12px; background: #fff; border: 3px solid #e8d5cd; }
.prog-count { font-weight: 800; font-size: .85rem; color: var(--ink-soft); margin-right: 6px; }
.prog-empty { color: var(--ink-soft); }
.pcmd { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: #a9d9e8; font-weight: 900; }
.route-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 10px; }
.rkey { min-width: 58px; font-size: 1.5rem; font-weight: 900; }
.modal-finale-ship .finale-art { background: linear-gradient(#232647, #5a5f95 62%, #fff 62%); }
.finale-funkel { position: absolute; width: 70px; height: 70px; left: 22%; top: 12%; animation: funkelHop 2.4s ease-in-out infinite; }
@keyframes funkelHop { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }

@media (max-width: 700px) {
  .pipes-grid.pipes-n5 { grid-template-columns: repeat(5, 48px); grid-template-rows: repeat(5, 48px); }
  .pipes-n5 .pipe-svg { width: 48px; height: 48px; }
  .sudoku-n4 { grid-template-columns: repeat(4, 54px); }
  .sudoku-n6 { grid-template-columns: repeat(6, 44px); }
  .cal-options.days, .cal-options.months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clock-ctrl span { max-width: none; text-align: left; }
  .coin { width: 44px; height: 44px; }
  .coin.euro { width: 50px; height: 50px; }
  .flag { width: 30px; }
  .flag svg { width: 30px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .funkel .funkel-glow, .scene-workshop .pendulum, .grand-view .pendulum-mini i, .finale-funkel { animation: none !important; }
}
