/* Missionen (A-178): Anzeige im Kopf über der Braustube und das Missions-Menü (js/kapitel-ui.js).
   Eine Hauptsache pro Bildschirm: oben der Weg der Feste, groß das laufende Kapitel, darunter die gefeierten Feste kompakt. */

/* ---------- Anzeige im Kopf (#mission neben dem nächsten Ziel) ---------- */
#mission { --kc: var(--gold); position: relative; padding: 5px 9px 6px 11px; background: linear-gradient(90deg, color-mix(in srgb, var(--kc) 16%, #1c0f07), rgba(28,15,7,.92));
  border: 2px solid var(--gold-d); border-left: 4px solid var(--kc); display: flex; flex-direction: column; gap: 3px; }
#mission[hidden] { display: none; }
.mh-kopf { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mh-nr { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 3px; display: grid; place-items: center; font-family: var(--pix); font-size: 9px; color: var(--gold-l);
  background: #1a0e07; border: 2px solid var(--kc); border-radius: 50%; }
#mission .mh-kopf small { display: block; flex: 1; min-width: 0; color: var(--gold); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-punkte { flex: 0 0 auto; display: flex; gap: 3px; }
.mh-punkte i { width: 8px; height: 8px; background: #1a0e07; border: 1px solid #6a4a2a; }
.mh-punkte i.ok { background: var(--gold); border-color: var(--gold-l); }
.mh-punkte i.jetzt { border-color: var(--gold); animation: misPuls 1.6s ease-in-out infinite; }
.mh-text { font-size: 14px; line-height: 1.2; color: var(--cream); }
.mh-text b { font-family: var(--pix); font-size: 11px; }
.mh-prog { display: flex; align-items: center; gap: 6px; }
.mh-prog .misbar { flex: 1; width: auto; height: 5px; margin: 0; }
#mission .mh-prog em { flex: 0 0 auto; font-size: 12px; font-style: normal; color: var(--muted); }
#mission .misbar.kater { margin: 1px 0 0; }

/* ---------- Gemeinsam ---------- */
.story .misbar { display: block; width: auto; height: 8px; margin: 0; background: #140a05; border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--wood); }
.story .misbar i, #mission .misbar i { background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold-l)); }
.story .misbar.kater i, #mission .misbar.kater i { background: linear-gradient(90deg, #8a6a9a, #f4c23c); }
@keyframes misPuls { 50% { box-shadow: 0 0 0 2px rgba(244,194,60,.25), 0 0 10px rgba(244,194,60,.7); } }

/* ---------- Weg der Feste (Plaketten-Band) ---------- */
.mis-weg { container-type: inline-size; padding: 10px 12px 10px; margin-bottom: 14px; background: linear-gradient(#2f1b0e, #1c0f07); border: 2px solid #3a2212; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.mw-kopf { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.mw-titel { font-family: var(--pix); font-size: 11px; color: var(--gold); }
.mw-zahl { color: var(--muted); font-size: 16px; }
.mw-zahl b { font-family: var(--pix); font-size: 12px; color: var(--gold-l); }
.mw-bonus { margin-left: auto; padding: 2px 8px; font-size: 15px; color: var(--ink); background: linear-gradient(var(--gold-l), var(--gold)); border: 2px solid var(--ink); box-shadow: 2px 2px 0 #000; }
.mw-band { --gap: 5px; display: grid; grid-template-columns: repeat(18, 1fr); gap: 8px var(--gap); }
@container (max-width: 640px) { .mw-band { grid-template-columns: repeat(9, 1fr); } }

.wp { position: relative; aspect-ratio: 1; width: 100%; max-width: 58px; justify-self: center; padding: 0; background: none; border: 0; cursor: pointer; }
.wp > img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* die Scheibe sitzt wie bei der gemalten Plakette etwas unter der Mitte (unter dem Band) */
.wp-nr { position: absolute; left: 12.5%; top: 21%; width: 75%; height: 75%; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--pix); font-size: clamp(7px, 1.9cqi, 10px); }
.wp.zu .wp-nr { color: #6a5040; background: #1a0e07; border: 2px solid #3a2212; }
.wp.zu { cursor: default; }
.wp-schloss { position: absolute; right: -3px; bottom: -4px; font-size: 11px; filter: grayscale(1) brightness(.75); }
.wp.cur .wp-nr { color: var(--ink); background: radial-gradient(circle at 35% 30%, var(--gold-l), var(--gold) 55%, var(--gold-d)); border: 2px solid var(--ink); animation: misPuls 1.6s ease-in-out infinite; }
.wp.cur::after { content: ''; position: absolute; left: 50%; top: -6px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--gold); }
.wp.kater .wp-nr { color: #e8d8f0; background: #2a1a30; border: 2px dashed #8a6a9a; }
.wp-haken { position: absolute; right: -2px; bottom: -3px; width: 14px; height: 14px; display: grid; place-items: center; font-size: 11px; line-height: 1;
  color: #0e2a06; background: #9ef08a; border: 2px solid #0e2a06; border-radius: 50%; }
/* Verbindungsstück zur vorigen Plakette: golden, soweit der Weg gegangen ist */
.wp::before { content: ''; position: absolute; top: 58%; right: 100%; width: var(--gap); height: 3px; background: #3a2212; }
.wp.fin::before, .wp.cur::before, .wp.kater::before { background: var(--gold-d); }
.mw-band .wp:first-child::before { display: none; }
@container (max-width: 640px) { .mw-band .wp:nth-child(9n+1)::before { display: none; } }
.wp.mini { display: inline-block; width: 30px; max-width: 30px; vertical-align: middle; margin-right: 8px; flex: 0 0 auto; }
.wp.mini::before { display: none; }
.mw-gesamt { height: 6px; margin: 12px 0 0; background: #140a05; border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--wood); }
.mw-gesamt i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-d), var(--gold-l)); }
.mw-info { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Die große Karte: laufendes Kapitel, Kater, Ende ---------- */
.mis-karte { --kc: var(--gold); position: relative; margin-bottom: 18px; padding: 14px 14px 12px; scroll-margin-top: 8px;
  background: linear-gradient(170deg, color-mix(in srgb, var(--kc) 20%, #2a170b), #1c0f07 60%);
  border: 3px solid var(--gold-d); border-top: 6px solid var(--kc); box-shadow: 0 0 0 2px #000, 5px 5px 0 rgba(0,0,0,.45); }
.mk-kopf { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 10px; }
.mk-plak { width: 72px; height: 72px; display: grid; place-items: center; }
.mk-plak img { width: 72px; height: 72px; }
.mk-plak.offen { position: relative; }
.mk-plak.offen img { filter: grayscale(.55) brightness(.8) drop-shadow(0 0 8px rgba(244,194,60,.45)); }
.mk-plak.offen::after { content: '?'; position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); font-family: var(--pix); font-size: 16px; color: var(--gold-l); text-shadow: 2px 2px 0 #000; }
.mk-plak.kater-ico { font-size: 44px; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.5)); animation: katerWackel 3s ease-in-out infinite; }
@keyframes katerWackel { 25% { transform: rotate(-8deg); } 75% { transform: rotate(6deg) translateY(2px); } }
.mk-titel { min-width: 0; }
.mk-titel small { display: block; font-size: 14px; color: var(--muted); }
#menuBody .mk-titel h3 { margin: 4px 0 5px; font-family: var(--pix); font-size: clamp(12px, 1.6vw, 17px); line-height: 1.35; color: var(--gold-l); text-shadow: 2px 2px 0 #000; }
.mk-ort { font-size: 16px; color: var(--cream); }
.mk-zahl { align-self: start; padding: 6px 8px; font-size: 16px; color: var(--muted); background: rgba(0,0,0,.35); border: 2px solid #3a2212; }
.mk-zahl b { font-family: var(--pix); font-size: 16px; color: var(--gold-l); }
.mk-text { margin: 0 0 12px; font-size: 16px; line-height: 1.35; color: #e8d8bc; }

.mk-liste { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.mk-liste li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 7px 10px; font-size: 16px; line-height: 1.25; background: rgba(0,0,0,.28); border: 2px solid transparent; }
.mk-haken { width: 22px; height: 22px; display: grid; place-items: center; font-size: 14px; border: 2px solid #5a4030; background: #140a05; }
.mk-liste li.ok { color: #b8e8a8; }
.mk-liste li.ok .mk-haken { color: #0e2a06; background: #9ef08a; border-color: #0e2a06; }
.mk-liste li.ok .mk-t { opacity: .85; }
.mk-liste li.jetzt { color: var(--cream); background: linear-gradient(90deg, rgba(244,194,60,.16), rgba(244,194,60,.05)); border-color: var(--gold-d); }
.mk-liste li.jetzt .mk-haken { color: var(--ink); background: var(--gold); border-color: var(--ink); font-size: 10px; animation: misPuls 1.6s ease-in-out infinite; }
.mk-liste li.jetzt .mk-t { color: var(--gold-l); }
.mk-liste li.offen { color: #c8b494; }
.mk-inhalt { min-width: 0; padding-top: 2px; }
.mk-prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mk-prog .misbar { flex: 1; }
.mk-prog small { flex: 0 0 auto; font-size: 14px; color: var(--muted); }
.mk-liste .mis-akt { margin-top: 7px; }
.mk-liste .mis-akt .btn { padding: 6px 12px; font-size: 15px; }
.mk-lohn { margin: 0 0 10px; padding: 6px 10px; font-size: 14px; color: var(--muted); border-left: 3px solid var(--gold-d); background: rgba(0,0,0,.2); }
.mis-karte .kap-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.mis-karte .kap-btns .btn, .mis-fest .kap-btns .btn { padding: 5px 10px; font-size: 14px; }
.story a.btn.link { margin-top: 0; }

.mis-karte.kater { --kc: #8a6a9a; }
.kt-uhr { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 4px 0 8px; }
.kt-uhr b { font-family: var(--pix); font-size: 26px; color: var(--cream); text-shadow: 3px 3px 0 #000; }
.kt-uhr span { color: var(--muted); font-size: 16px; }
.mis-karte.kater .misbar { height: 10px; }
.kt-vorschau { display: flex; align-items: center; margin: 12px 0 0; padding: 8px 10px; font-size: 15px; color: #e8d8bc; background: rgba(0,0,0,.25); border: 1px dashed #5a4a6a; }
.mis-karte.ende { --kc: var(--gold-l); }

/* ---------- Gefeierte Feste ---------- */
#menuBody .mis-sek { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; font-family: var(--pix); font-size: 10px; color: var(--gold); font-weight: 400; }
.mis-sek::after { content: ''; flex: 1; height: 2px; background: #3a2212; }
.mis-sek small { font-family: var(--ui); font-size: 15px; color: var(--muted); }
.mis-feste { display: flex; flex-direction: column; gap: 4px; }
.mis-fest { --kc: var(--gold); background: rgba(0,0,0,.25); border: 1px solid #3a2212; border-left: 4px solid var(--kc); scroll-margin-top: 8px; }
.mis-fest summary { list-style: none; display: grid; grid-template-columns: 24px 26px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 5px 10px 5px 8px; cursor: pointer; }
.mis-fest summary::-webkit-details-marker { display: none; }
.mis-fest summary img { grid-row: 1 / span 2; width: 24px; height: 24px; }
.mf-nr { grid-row: 1 / span 2; font-family: var(--pix); font-size: 9px; color: var(--muted); text-align: right; }
.mf-name { font-size: 16px; color: var(--cream); line-height: 1.15; }
.mf-ort { grid-column: 3; font-size: 13px; color: var(--muted); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-pfeil { grid-column: 4; grid-row: 1 / span 2; color: var(--gold); transition: transform .15s; }
.mis-fest[open] .mf-pfeil { transform: rotate(90deg); }
.mis-fest[open] summary { border-bottom: 1px dashed #3a2212; }
.mis-fest[open] .mf-name { color: var(--gold-l); }
.mf-inhalt { padding: 10px 12px 12px; }
.mf-inhalt .mk-text { font-size: 15px; }
.mf-inhalt .mk-liste li { padding: 4px 8px; font-size: 15px; }
.mis-fest.blink { animation: misBlink 1.2s ease-out; }
@keyframes misBlink { 0%, 40% { background: rgba(244,194,60,.3); box-shadow: 0 0 0 2px var(--gold); } }
.mis-zu { margin: 10px 0 0; padding: 7px 10px; font-size: 15px; color: #8a7058; border: 1px dashed #3a2212; text-align: center; }

@media (hover: hover) {
  .wp.fin:hover, .wp.cur:hover { transform: translateY(-2px); filter: brightness(1.15); }
  .mis-fest summary:hover { background: rgba(244,194,60,.08); }
}
@media (prefers-reduced-motion: reduce) {
  .wp.cur .wp-nr, .mk-liste li.jetzt .mk-haken, .mh-punkte i.jetzt, .mk-plak.kater-ico { animation: none; }
}
@media (max-width: 700px) {
  .mis-karte { padding: 12px 10px 10px; }
  .mk-kopf { gap: 10px; }
  .mk-plak, .mk-plak img { width: 56px; height: 56px; }
  #menuBody .mk-titel h3 { font-size: 13px; }
  .mk-liste li { gap: 8px; padding: 7px 8px; }
}
