/* Systemchen · Modul sonnensystem – ruhiger Weltraum, helle Karten, große Tippflächen */
:root {
  --space: #03040c;
  --glass: rgba(14, 20, 44, .78);
  --glass-line: rgba(160, 180, 255, .22);
  --paper: #faf6ee;
  --paper-2: #f0e8d8;
  --line: #e2d6bd;
  --ink: #2b2a33;
  --ink-soft: #625c55;
  --sun: #ffc23a;
  --sun-dark: #b87800;
  --green: #4a7c23;
  --green-light: #7ab648;
  --blue: #3b7fc4;
  --red: #c0392b;
  --stamp: #c0392b;
  --focus: #ffd36a;
  --tap: 56px;
  --radius: 18px;
  --panel-w: min(400px, 40vw);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Lora', Georgia, serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--space); color: #eef1ff;
  font-family: var(--font); font-size: 17px;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, summary:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body.lvl-1 #scene { cursor: grab; }
#scene.can-grab { cursor: grab; }
#scene.grabbing { cursor: grabbing; }

/* ---------- Labels im 3D-Bild ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 800; font-size: 15px; color: #fff;
  background: rgba(10, 16, 40, .62); border: 1px solid rgba(255, 255, 255, .18); padding: 3px 10px; border-radius: 999px;
  text-shadow: 0 1px 2px #000; will-change: transform; }
button.lbl { pointer-events: auto; min-height: 40px; min-width: 56px; padding: 6px 14px; cursor: pointer; }
button.lbl:hover { background: rgba(40, 60, 120, .85); }
.lbl.sel { background: var(--sun); color: #2b1d00; text-shadow: none; border-color: #fff; }
.lbl-sun { color: #ffe9a6; }
.lbl-at { background: rgba(237, 41, 57, .85); }
.lbl-dir { background: rgba(70, 140, 40, .85); }
.lbl-small { font-size: 13px; font-weight: 700; opacity: .9; }
.lbl-day { background: rgba(255, 210, 90, .9); color: #3a2a00; text-shadow: none; }
.lbl-night { background: rgba(20, 30, 80, .9); }
.lbl-month { font-size: 13px; padding: 2px 8px; background: rgba(10, 16, 40, .45); }
.lbl-season { font-size: 15px; font-weight: 800; padding: 3px 12px; color: #fff; opacity: .92; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.lbl-planet { font-size: 15px; }

/* ---------- Kopfzeile ---------- */
#top { position: fixed; left: 0; right: 0; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  background: linear-gradient(rgba(3, 4, 12, .92), rgba(3, 4, 12, .55) 70%, rgba(3, 4, 12, 0)); }
.tb { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line); color: #fff; font-weight: 700; }
.tb.round { width: 48px; padding: 0; justify-content: center; }
.tb:hover { background: rgba(40, 56, 110, .9); }
.brand { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; margin-right: auto; }
.brand-small { font-size: 12px; color: #b9c3ea; font-weight: 700; letter-spacing: .02em; }
.brand-title { font-family: var(--font-title); font-size: 22px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#levels { display: flex; gap: 6px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 4px; }
#levels button { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: transparent; color: #d8defa; font-weight: 700; font-size: 15px; }
#levels button.on { background: var(--sun); color: #2b1d00; }
#levels .lv-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .14); font-weight: 800; }
#levels button.on .lv-n { background: rgba(255, 255, 255, .55); }
.demo { font-size: 13px; font-weight: 700; color: #ffe2a0; background: rgba(120, 80, 0, .45); border: 1px solid rgba(255, 210, 120, .4); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }

/* ---------- HUD ---------- */
#hud { position: fixed; z-index: 10; top: 78px; left: max(14px, env(safe-area-inset-left)); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 10px 16px 10px 12px; max-width: min(520px, calc(100vw - var(--panel-w) - 40px)); }
.hud-ico, .hud-moon { grid-row: 1 / 3; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; }
.hud-ico .ic { width: 28px; height: 28px; }
.hud-ico.day { background: rgba(255, 194, 58, .2); color: var(--sun); }
.hud-ico.night { background: rgba(120, 150, 255, .18); color: #b9c8ff; }
.hud-moon svg { width: 40px; height: 40px; }
.hud-big { font-size: 30px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hud-big.sm { font-size: 22px; }
.hud-sub { font-size: 15px; color: #cdd5f5; }
.hud-sub b { color: #fff; }
.hud-sub .ec { color: #ffb38a; }

/* ---------- Himmel über Österreich ---------- */
.sky { position: fixed; z-index: 9; left: max(14px, env(safe-area-inset-left)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px); width: 300px; height: 170px; border-radius: var(--radius); overflow: hidden; border: 2px solid rgba(255, 255, 255, .35); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.sky canvas { width: 100%; height: 100%; display: block; }
.sky-t { position: absolute; left: 8px; top: 6px; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; }

/* ---------- Mond von der Erde aus + Mondleiste ---------- */
#moonbox { position: fixed; z-index: 9; left: max(14px, env(safe-area-inset-left)); top: 160px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
#insetWrap { position: relative; width: 190px; text-align: center; }
#insetCanvas { width: 190px; height: 190px; border-radius: 50%; display: block; border: 3px solid var(--sun); box-shadow: 0 0 0 4px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .6); background: #000; }
#insetWrap span { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 800; background: var(--glass); padding: 3px 10px; border-radius: 999px; }
#strip { display: grid; grid-template-columns: repeat(4, 64px); gap: 4px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px; padding: 6px; }
.ph { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #c6cdea; text-align: center; line-height: 1.1; }
.ph svg { width: 34px; height: 34px; }
.ph.on { background: rgba(255, 194, 58, .25); color: #fff; outline: 2px solid var(--sun); }

/* ---------- Steuerleiste ---------- */
#dock { position: fixed; z-index: 15; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: calc(100vw - 28px); }
.dk { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); color: #fff; font-weight: 800; font-size: 16px; }
.dk:hover { background: rgba(40, 56, 110, .95); }
.dk.big { background: var(--sun); color: #2b1d00; border-color: #ffe29a; min-width: 150px; justify-content: center; }
.dk.kasten { background: #2f6b3a; border-color: #7ab648; }
.dk-seg { display: inline-flex; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 4px; }
.dk-seg button { min-height: 48px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: #d8defa; font-weight: 800; }
.dk-seg button.on { background: #fff; color: #1b2340; }
body:not(.sys) #btnTasks, body:not(.sys) #btnKasten { display: none; }

/* ---------- Chip: aktuelle Aufgabe im System ---------- */
.chip { position: fixed; z-index: 16; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 28px)); display: flex; flex-direction: column; gap: 10px;
  background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); border: 3px solid var(--sun); }
#chipText { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: 16px; line-height: 1.35; }
.chip .btn { align-self: flex-end; }

/* ---------- Panel ---------- */
#panel { position: fixed; z-index: 18; top: 76px; right: max(12px, env(safe-area-inset-right)); bottom: 12px; width: var(--panel-w); display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); border-radius: 22px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); overflow: hidden; transition: transform .28s ease, opacity .28s ease; }
#panel.collapsed { transform: translateX(110%); opacity: 0; pointer-events: none; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0; background: var(--paper-2); border-bottom: 1px solid var(--line); }
#panelTabs { display: flex; gap: 4px; flex: 1; min-width: 0; }
#panelTabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; border: 0; border-radius: 14px 14px 0 0; background: transparent; color: var(--ink-soft); font-weight: 800; font-size: 15px; padding: 0 8px; }
#panelTabs button.on { background: var(--paper); color: var(--ink); box-shadow: 0 -2px 0 var(--sun) inset; }
#btnCollapse { background: var(--ink); border: 0; width: 44px; min-height: 44px; margin-bottom: 6px; }
#panelBody { flex: 1; overflow: auto; padding: 14px 14px 20px; -webkit-overflow-scrolling: touch; }
.panel-lead { margin: 0 0 12px; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }
.panel-lead b { color: var(--ink); }

/* Aufgaben-Karten */
.tasklist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tcard { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 8px 12px; border-radius: 16px; border: 2px solid var(--line); background: #fff; text-align: left; min-height: 150px; }
.tcard:hover { border-color: var(--sun); }
.tcard-art { display: block; height: 82px; border-radius: 12px; background: #0b1230; overflow: hidden; }
.tcard-art svg { width: 100%; height: 100%; display: block; }
.tcard-n { position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: #2b1d00; font-weight: 800; font-size: 14px; border: 2px solid #fff; }
.tcard-title { font-weight: 800; font-size: 15px; line-height: 1.2; }
.tcard.done { background: #fbf7ec; }
.tcard.done .tcard-art { opacity: .7; }
.tcard .stamp { position: absolute; right: -6px; top: 40px; width: 78px; height: 78px; color: var(--stamp); opacity: .85; mix-blend-mode: multiply; }
.fin { width: 100%; margin-top: 14px; }

/* Aufgabe im Detail */
.tdetail { display: flex; flex-direction: column; gap: 12px; }
.link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--blue); font-weight: 800; min-height: 44px; padding: 0 4px; }
.tdetail-art { height: 104px; border-radius: 16px; background: #0b1230; overflow: hidden; }
.tdetail-art svg { width: 100%; height: 100%; display: block; }
.q { display: flex; gap: 10px; align-items: flex-start; }
.q p, .hintbox p, .msg p, .donebox p, .riddle p, .m-text p, .note p { margin: 0; line-height: 1.45; }
.q p { font-size: 19px; font-weight: 800; }
.riddle { background: #1b2340; color: #fff; border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; }
.riddle .rnum { grid-column: 1 / 3; font-size: 13px; font-weight: 800; color: var(--sun); }
.riddle p { font-size: 17px; font-weight: 700; }
.speak { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--ink); display: grid; place-items: center; }
.speak .ic { width: 22px; height: 22px; }
.speak.playing { background: var(--sun); border-color: var(--sun-dark); animation: pulse 1s ease-in-out infinite; }
.riddle .speak, .note .speak { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12); color: #fff; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.answer { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: flex; gap: 8px; align-items: center; }
.opt { flex: 1; min-height: 60px; text-align: left; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 17px; line-height: 1.3; }
.opt:hover:not(:disabled) { border-color: var(--sun); background: #fffaf0; }
.opt.right { background: #e7f4dc; border-color: var(--green-light); }
.opt.wrong { background: #fbe9e6; border-color: #e3a79f; color: #8a4038; text-decoration: line-through; text-decoration-thickness: 2px; }
.opt:disabled { cursor: default; }
.status { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 15px; background: var(--paper-2); padding: 10px 12px; border-radius: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: 999px; border: 2px solid transparent; font-weight: 800; font-size: 16px; }
.btn .ic { width: 20px; height: 20px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #3c6a1b; }
.btn-primary:disabled { background: #b9c2ae; cursor: default; }
.btn-sys { background: #1b2340; color: #fff; flex: 1; }
.btn-sys:hover { background: #2a3770; }
.btn-soft { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-soft:hover { border-color: var(--sun); }
.btn.big { min-height: 64px; font-size: 19px; padding: 0 28px; }
.hintbox, .msg { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: #fff7df; border: 2px solid #f1d58a; font-size: 16px; }
.msg.warn { background: #fdeee8; border-color: #efb9a6; }
.donebox { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: #eef7e6; border: 2px solid #b8dc98; }
.donebox > div { display: flex; gap: 10px; align-items: flex-start; padding-right: 70px; font-size: 16px; }
.donebox .stamp { position: absolute; right: 6px; top: 4px; width: 74px; height: 74px; color: var(--stamp); }

/* Sortierspiel */
.sg { display: flex; flex-direction: column; gap: 10px; }
.sg-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; align-items: stretch; padding: 8px; border-radius: 14px; background: #1b2340; }
.sg-slots.awaiting .sg-slot:not(.filled) { border-color: var(--sun); }
.sg-lead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; font-size: 12px; font-weight: 800; }
.sg-lead-art svg { width: 44px; height: 44px; }
.sun-lead { display: block; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fff6c8, #ffc23a 55%, #ff9a1f); box-shadow: 0 0 16px #ffb52e; }
.sg-slot { min-width: 0; min-height: 104px; border-radius: 12px; border: 2px dashed rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .06); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 4px; position: relative; }
.sg-slot-label { font-size: 13px; font-weight: 800; color: #d6dcf6; }
.sg-slot.over { border-color: var(--sun); background: rgba(255, 194, 58, .2); }
.sg-slot.ok { border-style: solid; border-color: var(--green-light); background: rgba(122, 182, 72, .22); }
.sg-tray { display: flex; flex-wrap: wrap; gap: 6px; min-height: 70px; padding: 8px; border-radius: 14px; background: var(--paper-2); border: 2px dashed var(--line); }
.sg-card { width: 76px; min-height: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; border: 2px solid var(--line); background: #0b1230; color: #fff; touch-action: none; }
.sg-slot .sg-card { width: 100%; border-color: transparent; }
.sg-art { display: block; width: 60px; height: 52px; }
.sg-art svg { width: 100%; height: 100%; }
.sg-label { font-size: 12px; font-weight: 800; line-height: 1.1; text-align: center; }
.sg-card.picked { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 194, 58, .5); }
.sg-card.dragging { opacity: .35; }
.sg-card.ok { border-color: var(--green-light); cursor: default; }
.sg-card.bad { border-color: #e86a55; animation: shake .5s; }
.sg-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: .92; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.sg-actions { display: flex; justify-content: flex-end; }

/* Experimentierkasten */
.kgrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.kcard { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 8px; border-radius: 16px; border: 2px solid var(--line); background: #fff; }
.kcard.active { border-color: #9fcf72; background: #f6fbef; }
.kcard-art { border-radius: 12px; background: #0b1230; overflow: hidden; min-height: 86px; }
.kcard-art svg { width: 100%; height: 100%; display: block; }
.kcard h3 { margin: 2px 0 4px; font-size: 17px; }
.kcard p { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-soft); line-height: 1.3; }
.kcard p .speak { width: 36px; height: 36px; }
.kcard p .speak .ic { width: 18px; height: 18px; }
.kctl { display: flex; flex-wrap: wrap; gap: 6px; }
.kctl .btn { min-height: 48px; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px 0 6px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper-2); font-weight: 800; }
.switch .knob { width: 46px; height: 28px; border-radius: 999px; background: #c9bea8; position: relative; transition: background .2s; }
.switch .knob::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); }
.switch.on { border-color: var(--green-light); background: #eef7e6; }
.switch.on .knob { background: var(--green); }
.switch.on .knob::after { transform: translateX(18px); }
.seg { min-height: 48px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 14px; }
.seg.on { background: #1b2340; color: #fff; border-color: #1b2340; }

/* ---------- Steckbrief ---------- */
.info { position: fixed; z-index: 12; left: max(14px, env(safe-area-inset-left)); top: 160px; width: min(360px, calc(100vw - 28px)); max-height: calc(100vh - 260px); overflow: auto;
  background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.info .close, .note .close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper-2); display: grid; place-items: center; color: var(--ink); }
.info-head { display: flex; align-items: center; gap: 12px; padding-right: 48px; }
.info-img { width: 64px; height: 64px; border-radius: 50%; background-size: 200% 100%; background-position: 30% 50%; box-shadow: inset -10px -8px 18px rgba(0, 0, 0, .55), 0 0 0 2px var(--line); flex: none; }
.info h2 { margin: 0; font-family: var(--font-title); font-size: 26px; flex: 1; }
.info dl { margin: 10px 0 0; display: grid; grid-template-columns: 1fr; gap: 2px; }
.info dt { font-size: 12px; font-weight: 800; color: var(--sun-dark); text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
.info dd { margin: 0; font-size: 16px; line-height: 1.4; }
.credit { margin: 12px 0 0; font-size: 12px; color: var(--ink-soft); }

/* ---------- Hinweise ---------- */
.note { position: fixed; z-index: 17; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px); width: min(560px, calc(100vw - 28px));
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 58px 12px 12px; border-radius: var(--radius); background: rgba(27, 35, 64, .96); border: 2px solid var(--sun); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 16px; }
.note .close { background: rgba(255, 255, 255, .15); color: #fff; }
body:not(.sys) .note, body:not(.sys) .toast { left: calc((100vw - var(--panel-w)) / 2); }
.toast { position: fixed; z-index: 40; left: 50%; top: 168px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); max-width: calc(100vw - 28px); }
.toast.warn { background: #fdeee8; }
.toast.ok { background: #eef7e6; }
.toast.stamp { background: #fffaf0; border: 3px solid var(--stamp); }
.toast .stamp { width: 54px; height: 54px; color: var(--stamp); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(2, 3, 10, .55); backdrop-filter: blur(2px); }
.modal-card { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); color: var(--ink); border-radius: 24px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.modal-card h1 { font-family: var(--font-title); font-size: 32px; margin: 0 0 12px; }
.m-kicker { margin: 0; color: var(--sun-dark); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.m-art { height: 150px; border-radius: 18px; background: #0b1230; overflow: hidden; margin-bottom: 14px; }
.m-art svg { width: 100%; height: 100%; display: block; }
.m-text { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; margin-bottom: 18px; }
.mstamps { display: flex; flex-wrap: wrap; gap: 8px; }
.mstamp { position: relative; width: 104px; min-height: 100px; border-radius: 14px; border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6px; font-size: 12px; font-weight: 800; text-align: center; color: var(--ink-soft); }
.mstamp.on { border-style: solid; background: #fff; color: var(--ink); }
.mstamp .stamp { width: 64px; height: 64px; color: var(--stamp); }
.m-count { font-weight: 800; margin: 10px 0; }
.curr { margin: 10px 0; padding: 10px 14px; background: var(--paper-2); border-radius: 14px; font-size: 14px; line-height: 1.45; }
.curr summary { font-weight: 800; cursor: pointer; min-height: 32px; }
.curr ul { padding-left: 18px; margin: 6px 0; }
.small { font-size: 13px; color: var(--ink-soft); }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* ---------- Schmal / Hochformat ---------- */
@media (max-width: 1100px) {
  #levels .lv-t { display: none; }
  #levels button { padding: 0 6px; }
}
@media (max-width: 820px), (orientation: portrait) and (max-width: 1024px) {
  :root { --panel-w: 100vw; }
  .brand-small { display: none; }
  .brand-title { font-size: 18px; }
  .demo { display: none; }
  #panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 56vh; border-radius: 22px 22px 0 0; }
  #panel.collapsed { transform: translateY(105%); }
  #hud { max-width: calc(100vw - 28px); padding: 8px 12px; }
  .hud-big { font-size: 24px; }
  .sky { width: 240px; height: 136px; }
  #moonbox { top: 150px; }
  #insetWrap, #insetCanvas { width: 140px; }
  #insetCanvas { height: 140px; }
  #strip { grid-template-columns: repeat(4, 52px); }
  .ph span { display: none; }
  body:not(.sys) .note { left: 50%; bottom: calc(56vh + 10px); }
  body:not(.sys) #dock { display: none; }
  .chip { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px); }
}
@media (max-width: 520px) {
  .tb span { display: none; }
  .tb { width: 48px; padding: 0; justify-content: center; }
  .dk span { display: none; }
  .dk.big span { display: inline; }
  .dk.big { min-width: 0; }
  .tasklist { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Hinweise (Tooltips, ../../js/tooltip.js) ---------- */
:root { --tip-bg: #1c2a5a; --tip-fg: #f4f6ff; --tip-border: rgba(255, 255, 255, .25); --tip-font: 'Nunito', system-ui, sans-serif; --tip-size: 15px; --tip-radius: 10px; --tip-shadow: 0 6px 18px rgba(0, 0, 20, .45); }
/* Spielstand: kleine Zurücksetzen-Knöpfe in der Level-Auswahl */
#levels .lv-reset { min-height: 30px; width: 30px; padding: 0; margin-left: -4px; align-self: center; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .12); color: #d8defa; border-radius: 50%; }
#levels .lv-reset .ic { width: 16px; height: 16px; }
#levels .lv-reset:hover { background: rgba(255, 255, 255, .25); }
@media (max-width: 820px) { #levels .lv-reset { display: none; } }
