/* Kronwacht – Apple-artiges Design, Hell- & Dunkelmodus, Querformat */
:root {
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --bg: #f2f2f7; --bg2: #ffffff; --bg3: #f7f7fa; --fill: rgba(120,120,128,.14); --fill2: rgba(120,120,128,.22);
  --label: #0b0b0f; --label2: rgba(60,60,67,.66); --sep: rgba(60,60,67,.16);
  --glass: rgba(250,250,253,.74); --glass-b: rgba(255,255,255,.6);
  --tint: #0a84ff; --green: #34c759; --red: #ff3b30; --orange: #ff9500; --gold: #ffc400; --purple: #bf5af2;
  --r: 18px; --r-s: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  --spring: cubic-bezier(.2,.9,.3,1.18);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --bg2: #1c1c1e; --bg3: #2c2c2e; --fill: rgba(120,120,128,.26); --fill2: rgba(120,120,128,.36);
    --label: #f5f5f7; --label2: rgba(235,235,245,.62); --sep: rgba(84,84,88,.55);
    --glass: rgba(28,28,32,.72); --glass-b: rgba(255,255,255,.08);
    --shadow: 0 10px 30px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--label);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body { position: fixed; inset: 0; }
#app { position: fixed; inset: 0; height: 100dvh; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
canvas { display: block; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.hidden { display: none !important; }
.glass { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); border: .5px solid var(--glass-b); }
.muted { color: var(--label2); }
.small, small { font-size: 12.5px; }
.warn { color: var(--orange); font-weight: 600; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap { gap: 10px; } .row.gap-s { gap: 6px; } .row.wrap { flex-wrap: wrap; margin: 6px 0; }
.col { display: flex; flex-direction: column; }
.col.gap { gap: 10px; margin-top: 12px; }
.ic, .icon-btn span, .btn .ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* ---------- Karten & Buttons ---------- */
.card { background: var(--bg2); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 13px;
  background: var(--fill); color: var(--label); font-weight: 600; transition: transform .25s var(--spring), opacity .2s, background .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--tint); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-ghost { background: rgba(255,59,48,.12); color: var(--red); }
.btn.ghost { background: transparent; color: var(--tint); }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn.xl { min-height: 56px; font-size: 17px; border-radius: 16px; box-shadow: 0 8px 20px rgba(10,132,255,.35); }
.btn:disabled { opacity: .4; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
.icon-btn span, .icon-btn .ic { width: 22px; height: 22px; display: inline-flex; }
.icon-btn svg { width: 100%; height: 100%; }
.icon-btn.small { width: 44px; height: 44px; }
.icon-btn.small span, .icon-btn.small .ic { width: 18px; height: 18px; }
.icon-btn:active { background: var(--fill); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--fill); font-size: 12px; font-weight: 600; }
.pill.gold { background: rgba(255,196,0,.2); color: #b78300; }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border-radius: 99px; background: var(--fill); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip.short { color: var(--red); }
.chip .ic { width: 15px; height: 15px; }
.cur-ic { display: inline-flex; width: 17px; height: 17px; flex: none; }
.cur-ic svg { width: 100%; height: 100%; }
.cost { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rbadge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--rc); }
.rbadge.asc, .asc-anim { background: linear-gradient(90deg,#ff3b30,#ff9500,#ffcc00,#34c759,#0a84ff,#bf5af2,#ff3b30); background-size: 300% 100%; animation: rainbow 3s linear infinite; }
@keyframes rainbow { to { background-position: 300% 0; } }
.bar { position: relative; height: 6px; border-radius: 99px; background: var(--fill2); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--green); border-radius: 99px; transition: width .2s; }
.bar em { position: absolute; inset: 0 auto 0 0; background: #64d2ff; border-radius: 99px; opacity: .9; }

/* ---------- Segmented Control ---------- */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 10px; background: var(--fill); }
.seg-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; border-radius: 8px; background: var(--bg2); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.06); transition: transform .35s var(--spring), width .3s; }
.seg-btn { position: relative; z-index: 1; min-height: 40px; padding: 0 12px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--label2); }
.seg-btn.on { color: var(--label); }
.seg-btn:disabled { opacity: .35; }
.seg.big .seg-btn { min-height: 38px; font-size: 14.5px; }
.seg.tiny .seg-btn { min-height: 40px; padding: 0 6px; font-size: 11.5px; }
@media (prefers-color-scheme: dark) { .seg-thumb { background: #636366; } }

/* ---------- Schalter ---------- */
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--fill2); transition: background .25s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18); transition: transform .3s var(--spring); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .knob { transform: translateX(20px); }

/* ---------- Menü-Grundgerüst ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: calc(46px + var(--sat)); padding: var(--sat) calc(14px + var(--sar)) 0 calc(14px + var(--sal)); z-index: 2; border-width: 0 0 .5px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-ic { width: 24px; height: 24px; color: var(--gold); display: inline-flex; }
.brand-ic svg { width: 100%; height: 100%; }
.curs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cur { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 6px; border-radius: 99px; background: var(--fill); font-size: 13px; white-space: nowrap; }
.pages { flex: 1; position: relative; overflow: hidden; }
.page { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px calc(16px + var(--sar)) 16px calc(16px + var(--sal)); display: none; }
.page.on { display: block; animation: pageIn .35s var(--spring); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.tabbar { flex: none; display: flex; justify-content: center; gap: 4px; height: calc(50px + var(--sab)); padding: 0 var(--sar) var(--sab) var(--sal); border-width: .5px 0 0; z-index: 2; }
.tab { flex: 0 1 170px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--label2); font-size: 13px; font-weight: 600; min-height: 44px; }
.tab .ic { width: 22px; height: 22px; }
.tab.on { color: var(--tint); }

/* ---------- Spielen ---------- */
.play-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(220px, 1fr); gap: 14px; }
.play-grid .col { gap: 12px; }
.maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.map-card { position: relative; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; transition: transform .3s var(--spring), border-color .2s; }
.map-card:active { transform: scale(.97); }
.map-card.sel { border-color: var(--tint); }
.map-card.locked { opacity: .6; }
.map-prev { width: 100%; aspect-ratio: 2/1; border-radius: 10px; }
.map-info { display: flex; flex-direction: column; } .map-info small { color: var(--label2); }
.lock-badge { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; }
.lock-badge svg { width: 100%; height: 100%; }
.aow-card { display: flex; gap: 14px; align-items: center; }
.aow-art { width: 90px; height: 90px; flex: none; color: var(--tint); padding: 12px; border-radius: 22px; background: linear-gradient(135deg, rgba(10,132,255,.15), rgba(191,90,242,.18)); }
.aow-art svg { width: 100%; height: 100%; }
.aow-card p { margin: 4px 0 6px; }
.run-card { display: flex; flex-direction: column; gap: 8px; border: 1.5px solid rgba(10,132,255,.35); }
.records { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 14px; }
.rec small { display: block; color: var(--label2); } .rec b { font-size: 17px; }
.ach-list { display: flex; flex-direction: column; gap: 8px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--fill); opacity: .55; }
.ach.got { opacity: 1; background: rgba(255,196,0,.14); }
.ach-ic { width: 28px; height: 28px; color: var(--gold); flex: none; } .ach-ic svg { width: 100%; height: 100%; }
.ach small { display: block; color: var(--label2); }

/* ---------- Figuren ---------- */
.fig-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.fig-card { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; text-align: center; transition: transform .3s var(--spring); }
.fig-card:active { transform: scale(.96); }
.fig-card b { font-size: 13.5px; } .fig-card small { color: var(--label2); font-size: 11px; line-height: 1.2; }
.fig-card.locked .fig-ic { filter: grayscale(.8); }
.lab-tag { font-size: 11px; font-weight: 700; color: var(--rc); margin-top: 2px; }
.fig-head { display: flex; gap: 14px; align-items: center; }
.fig-head p { margin: 4px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.stats.tight { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.stat { background: var(--fill); border-radius: 10px; padding: 6px 9px; }
.stat small { display: block; color: var(--label2); font-size: 11px; } .stat b { font-size: 14px; }
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.path { padding: 10px 12px; box-shadow: none; background: var(--fill); }
.path ol { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--label2); }
.path li.special { color: var(--purple); font-weight: 600; }
.unlock-box { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.unlock-box p { margin: 0; }
.lab { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.node-row { display: flex; flex-direction: column; gap: 8px; padding: 12px; box-shadow: none; background: var(--fill); }
.nr-main small { display: block; color: var(--label2); }
.eff { font-size: 13px; margin-top: 2px; } .eff b { color: var(--green); }
.nr-buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Skilltrees ---------- */
.trees { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.page#p-trees { display: none; }
.page#p-trees.on { display: flex; flex-direction: column; }
.tree-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.page#p-trees { padding-top: 8px; padding-bottom: 8px; }
.tree-top .seg-btn { padding: 0 7px; font-size: 12.5px; }
.tree-top .btn.small { padding: 0 8px; }
.tree-top .muted { display: inline-flex; align-items: center; gap: 4px; }
.tree-vp { position: relative; flex: 1; min-height: 110px; overflow: hidden; border-radius: var(--r); background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rc) 22%, var(--bg2)), var(--bg2)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rc) 45%, transparent); touch-action: none; }
.tree-vp.asc { box-shadow: inset 0 0 0 3px #ff9500; }
.tree-cv { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tree-lines { position: absolute; inset: 0; overflow: visible; }
.tree-lines path { fill: none; stroke: var(--fill2); stroke-width: 4; stroke-linecap: round; }
.tree-lines path.on { stroke: var(--tint); }
.tnode { position: absolute; transform: translate(-25px, -25px); display: grid; grid-template-columns: 50px 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; width: 200px; text-align: left; }
.tnode .tn-ring { grid-row: 1 / 3; }
.tn-ring { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--tint) calc(var(--p) * 360deg), var(--fill2) 0); box-shadow: var(--shadow); transition: transform .3s var(--spring); }
.tn-lvl { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); font-weight: 800; font-size: 13.5px; }
.tnode:active .tn-ring { transform: scale(.92); }
.tn-name { font-size: 12.5px; font-weight: 700; line-height: 1.15; align-self: end; }
.tn-eff { font-size: 11px; color: var(--label2); align-self: start; }
.tnode.locked { opacity: .45; }
.tnode.can .tn-ring { box-shadow: 0 0 0 3px rgba(52,199,89,.55), var(--shadow); animation: glow 1.6s ease-in-out infinite; }
.tnode.full .tn-ring { background: conic-gradient(var(--gold) 360deg, var(--gold) 0); }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(52,199,89,.25), var(--shadow); } }
.zoom-btns { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoom-btns .icon-btn { border-radius: 12px; }

/* ---------- Schmiede ---------- */
.forge-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.forge-card { display: flex; gap: 14px; align-items: center; }
.forge-cv { width: 200px; height: 134px; border-radius: 14px; background: linear-gradient(#2a1d17, #120c0a); flex: none; }
.forge-info { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.big-num { display: flex; align-items: center; gap: 6px; font-size: 26px; font-weight: 800; }
.big-num .cur-ic { width: 26px; height: 26px; }
.forge-grid .bar i { background: linear-gradient(90deg, #5ee0a0, #30d158); }

/* ---------- Einstellungen ---------- */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.group h4 { font-size: 12.5px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 6px 14px; }
.group + .group { margin-top: 16px; }
.list { padding: 0; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 14px; }
.list-row + .list-row { box-shadow: inset 0 .5px 0 var(--sep); }
.list-row.tap:active { background: var(--fill); }
.row-ic { width: 29px; height: 29px; border-radius: 7px; color: #fff; padding: 5px; flex: none; display: inline-flex; }
.row-ic svg { width: 100%; height: 100%; }
.row-label { flex: 1; display: flex; flex-direction: column; }
.row-label small { color: var(--label2); }
.chev { color: var(--label2); font-size: 22px; }
.version { display: block; width: 100%; margin-top: 16px; padding: 12px; color: var(--label2); font-size: 12.5px; text-align: center; }
textarea.code { width: 100%; height: 110px; border-radius: 12px; border: 0; padding: 10px; background: var(--fill); color: var(--label); font: 12px ui-monospace, Menlo, monospace; -webkit-user-select: text; user-select: text; resize: none; margin: 8px 0 10px; }
.inp { min-height: 36px; border-radius: 10px; border: 0; padding: 0 10px; background: var(--fill); color: var(--label); font: inherit; font-size: 14px; }
input.inp { width: 90px; -webkit-user-select: text; user-select: text; }

/* ---------- Sheets ---------- */
#overlay-root { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#overlay-root > * { pointer-events: auto; }
.sheet-wrap { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); opacity: 0; transition: opacity .3s; }
.sheet { position: relative; width: min(560px, calc(100vw - 24px - var(--sal) - var(--sar))); max-height: calc(100dvh - 18px); display: flex; flex-direction: column;
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25); transform: translateY(105%); transition: transform .42s var(--spring); padding-bottom: var(--sab); }
.sheet.wide { width: min(780px, calc(100vw - 24px - var(--sal) - var(--sar))); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 99px; background: var(--fill2); margin: 7px auto 0; flex: none; touch-action: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 18px; flex: none; }
.sheet-head h2 { font-size: 19px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 18px; }
.sheet-body > p:first-child { margin-top: 0; }
.recruit-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.rc-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; box-shadow: none; background: var(--fill); }
.rc-card b { font-size: 12px; text-align: center; }
.rc-card.dis { opacity: .45; }

/* ---------- Hinweise ---------- */
#toast-root { position: fixed; top: calc(52px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px) scale(.96); transition: all .35s var(--spring); max-width: 70vw; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { color: var(--red); }
#banner-root { position: fixed; top: 30%; left: 0; right: 0; display: flex; justify-content: center; z-index: 45; pointer-events: none; }
.banner { text-align: center; color: #fff; text-shadow: 0 3px 16px rgba(0,0,0,.6); opacity: 0; transform: scale(.85); transition: all .45s var(--spring); }
.banner.show { opacity: 1; transform: none; }
.b-title { font-size: 34px; font-weight: 900; letter-spacing: -.03em; }
.b-sub { font-size: 15px; font-weight: 600; opacity: .9; }
.banner.blood .b-title { color: #ff4d4d; } .banner.gold .b-title { color: #ffd60a; }

/* ---------- Ergebnis & Tutorial ---------- */
.result-wrap, .tut-wrap { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .3s; z-index: 60; padding: 10px calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); }
.result-wrap.open, .tut-wrap.open { opacity: 1; }
.result { width: min(860px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 24px; padding: 14px 20px 16px; box-shadow: var(--shadow); transform: scale(.94); transition: transform .45s var(--spring); }
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; margin-bottom: 8px; }
.res-head .btn { min-width: 120px; }
.result-wrap.open .result, .tut-wrap.open .tut { transform: none; }
.result h1 { font-size: 22px; }
.res-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.pill .ic { width: 14px; height: 14px; }
.dmg-bars { display: flex; flex-direction: column; gap: 5px; }
.dbar { display: grid; grid-template-columns: 108px 1fr 60px; align-items: center; gap: 8px; font-size: 12.5px; }
.dbar b { text-align: right; } .dbar .bar i { background: linear-gradient(90deg, #ff9500, #ff3b30); }
.rewards { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.rw { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--fill); }
.rw span:nth-child(2) { flex: 1; } .rw b { font-size: 17px; color: var(--green); font-variant-numeric: tabular-nums; }
.rw .cur-ic { width: 22px; height: 22px; }
.new-ach { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tut { width: min(460px, 100%); padding: 22px; border-radius: 24px; text-align: center; transform: scale(.94); transition: transform .45s var(--spring); }
.tut-ic { width: 60px; height: 60px; margin: 0 auto 10px; color: var(--tint); padding: 12px; border-radius: 18px; background: rgba(10,132,255,.14); }
.tut-ic svg { width: 100%; height: 100%; }
.tut p { color: var(--label2); margin: 8px 0 14px; }
.dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--fill2); transition: all .3s; } .dots i.on { width: 20px; border-radius: 99px; background: var(--tint); }

/* ---------- Spiel ---------- */
.game { position: fixed; inset: 0; background: #111; overflow: hidden; touch-action: none; }
#cv { position: absolute; inset: 0; touch-action: none; }
.hud-top { position: absolute; top: calc(4px + var(--sat)); left: calc(4px + var(--sal)); right: calc(4px + var(--sar)); height: 46px; border-radius: 14px; display: flex; align-items: center; gap: 4px; padding: 0 4px; color: var(--label); z-index: 5; }
.hstat { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 32px; border-radius: 10px; background: var(--fill); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hstat .ic { width: 18px; height: 18px; }
.hstat.lives .ic { color: var(--red); }
.hstat.moon b { font-size: 12.5px; }
.hstat.moon.warn { background: rgba(255,59,48,.85); color: #fff; animation: pulse 1s ease-in-out infinite; }
.hstat.castlebar .bar { width: 70px; } .hstat.castlebar .bar.foe i { background: var(--red); }
.hstat.castlebar b { font-size: 12px; min-width: 34px; }
.hstat.age .bar { width: 48px; } .hstat.age .bar i { background: var(--purple); } .hstat.age b { font-size: 12.5px; }
.spacer { flex: 1; }
.seg.speed .seg-btn { min-height: 36px; padding: 0 10px; }
.seg.speed { padding: 2px; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.boss-bar { position: absolute; top: calc(52px + var(--sat)); left: 50%; transform: translateX(-50%); width: min(380px, 46vw); z-index: 4; text-align: center; color: #fff; text-shadow: 0 1px 4px #000; font-size: 12.5px; pointer-events: none; }
.boss-bar .bar { height: 9px; margin-top: 2px; background: rgba(0,0,0,.55); box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.boss-bar .bar i { background: linear-gradient(90deg, #ff2d55, #ff9500); }
.pause-ov { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.35); }
.pause-card { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 18px; font-weight: 700; }
.pause-card .ic { color: var(--tint); }
#leak-flash { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 0 rgba(255,0,0,0); z-index: 3; }
#leak-flash.on { animation: leak .5s ease-out; }
@keyframes leak { from { box-shadow: inset 0 0 70px 12px rgba(255,30,30,.75); } }

/* Laden (Tower Defense) */
.shop { position: absolute; top: calc(52px + var(--sat)); bottom: calc(6px + var(--sab)); right: calc(4px + var(--sar)); width: 112px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; padding: 6px; z-index: 5; }
.shop-head { display: flex; gap: 4px; align-items: center; }
.rar-btn { flex: 1; min-height: 40px; border-radius: 9px; background: color-mix(in srgb, var(--rc, #8e8e93) 28%, transparent); color: var(--label); font-size: 11.5px; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--rc, #8e8e93); padding: 0 4px; }
.shop-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 5px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.shop-card { display: flex; flex-direction: column; align-items: center; padding: 3px 0 4px; border-radius: 11px; background: var(--fill); touch-action: none; transition: transform .25s var(--spring); min-height: 56px; }
.shop-card:active { transform: scale(.93); }
.shop-card.dis { opacity: .4; }
.shop-card.active { box-shadow: inset 0 0 0 2px var(--tint); }
.shop-card .price { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-hint { font-size: 11.5px; text-align: center; color: var(--tint); font-weight: 700; }
.wave-btn { min-height: 44px; border-radius: 12px; background: var(--green); color: #fff; font-weight: 800; font-size: 12.5px; line-height: 1.1; padding: 2px 4px; }
.wave-btn:disabled { background: var(--fill2); color: var(--label2); }
.wave-btn.pulse { animation: pulse 1.2s ease-in-out infinite; }

/* Info-Panel (Tower Defense) */
.figpanel { position: absolute; top: calc(52px + var(--sat)); bottom: calc(6px + var(--sab)); left: calc(4px + var(--sal)); width: 300px; border-radius: 18px; padding: 10px 12px; z-index: 6; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; animation: slideIn .35s var(--spring); touch-action: pan-y; }
@keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } }
.fp-head { display: flex; align-items: center; gap: 8px; }
.fp-title { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.lvl-row small { color: var(--label2); } .bar.xp i { background: linear-gradient(90deg, #a6ff7a, #34c759); }
.tm small { display: block; color: var(--label2); margin-bottom: 3px; } .tm .seg { width: 100%; }
.figpanel .paths { grid-template-columns: 1fr; gap: 6px; }
.upath { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 12px; background: var(--fill); }
.upath small { color: var(--label2); line-height: 1.25; }
.upath .done { color: var(--purple); font-weight: 600; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: var(--fill2); }
.pips i.on { background: var(--green); } .pips i.sp.on { background: var(--purple); }
.tip { font-size: 11px; text-align: center; }

/* Age of War */
.minimap { position: absolute; top: calc(52px + var(--sat)); left: calc(8px + var(--sal)); width: calc(100vw - 150px - var(--sal) - var(--sar)); height: 18px; z-index: 5; }
.aow-right { position: absolute; top: calc(52px + var(--sat)); bottom: calc(6px + var(--sab)); right: calc(4px + var(--sar)); width: 124px; border-radius: 16px; padding: 6px; z-index: 5; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.king-btn { position: relative; display: flex; align-items: center; gap: 4px; min-height: 46px; border-radius: 12px; background: var(--fill); padding: 0 5px; font-weight: 700; overflow: hidden; }
.king-btn .k-ic { width: 26px; height: 26px; flex: none; } .king-btn .k-ic svg { width: 100%; height: 100%; }
.king-btn small { font-size: 10.5px; line-height: 1.1; text-align: left; }
.king-btn .cd-ring { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,.45) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.king-btn.ready { background: linear-gradient(135deg, #ff9500, #ff3b30); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
.recruit { width: 100%; }
.lbl { color: var(--label2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.slot { position: relative; aspect-ratio: 1; min-height: 50px; border-radius: 12px; background: var(--fill); box-shadow: inset 0 0 0 2px var(--rc, transparent); display: grid; place-items: center; touch-action: none; }
.slot.tower { border: 1.5px dashed var(--fill2); }
.slot .lvl, .ucard .lvl { position: absolute; left: 3px; bottom: 2px; font-size: 10px; font-weight: 800; padding: 0 4px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; }
.slot.partner, .ucard.partner { box-shadow: inset 0 0 0 2px var(--rc, transparent), 0 0 0 3px #ffd60a; animation: pulse .9s infinite; }
.slot.asc, .ucard.asc { box-shadow: inset 0 0 0 2px #ff9500; }
.deck { position: absolute; left: calc(4px + var(--sal)); right: calc(134px + var(--sar)); bottom: calc(6px + var(--sab)); height: 70px; border-radius: 16px; display: flex; gap: 6px; padding: 6px; overflow-x: auto; overscroll-behavior: contain; z-index: 5; touch-action: pan-x; scrollbar-width: none; }
.ucard { position: relative; flex: 0 0 58px; height: 58px; border-radius: 12px; background: var(--fill); box-shadow: inset 0 0 0 2px var(--rc, #8e8e93); display: grid; place-items: center; overflow: hidden; touch-action: pan-x; transition: transform .2s var(--spring); }
.ucard:active { transform: scale(.92); }
.ucard .cost { position: absolute; right: 3px; top: 2px; font-size: 10.5px; font-weight: 800; color: #ffd60a; text-shadow: 0 1px 2px #000; }
.ucard .cdov { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,.55) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.ucard.dis { opacity: .55; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 90; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--glass); box-shadow: 0 0 0 2px var(--rc), var(--shadow); pointer-events: none; }
.u-ic { pointer-events: none; }

.wobble { animation: wobble .4s ease; }
@keyframes wobble { 20% { transform: translateX(-5px) rotate(-3deg); } 40% { transform: translateX(5px) rotate(3deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* ---------- Bitte drehen ---------- */
#rotate { position: fixed; inset: 0; z-index: 999; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 30px; text-align: center;
  background: radial-gradient(120% 80% at 50% 30%, #1e2a5a, #05060c); color: #fff; }
#rotate .phone { width: 74px; height: 128px; border: 5px solid #fff; border-radius: 18px; position: relative; animation: rot 2.4s var(--spring) infinite; }
#rotate .phone::after { content: ''; position: absolute; top: 8px; left: 50%; width: 22px; height: 6px; margin-left: -11px; border-radius: 4px; background: #fff; }
#rotate h2 { font-size: 22px; } #rotate p { margin: 0; opacity: .75; max-width: 280px; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (orientation: portrait) { #rotate { display: flex; } }

/* ---------- Kleinere Geräte (iPhone SE) ---------- */
@media (max-height: 380px) {
  .play-grid { gap: 10px; }
  .btn.xl { min-height: 50px; }
  .fig-grid { gap: 8px; }
  .records { padding: 10px; }
  .figpanel { width: 268px; }
}
@media (max-width: 700px) {
  .tab span:last-child { display: none; }
  .hstat.age .bar, .hstat.castlebar .bar { width: 44px; }
  .cur b { font-size: 12px; }
  .maps { gap: 6px; }
  .fig-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .fig-card small { display: none; }
  .recruit-grid { grid-template-columns: repeat(4, 1fr); }
}
/* Ausblendende Overlays blockieren keine Taps mehr */
.result-wrap:not(.open), .tut-wrap:not(.open), .sheet-wrap:not(.open) { pointer-events: none !important; }

/* ---------- Version 1.1 ---------- */
.hud-top { overflow: hidden; }
.hud-top .hstat { flex-shrink: 1; min-width: 0; overflow: hidden; }
.hud-top .seg, .hud-top .icon-btn { flex: none; }
.seg.speed .seg-btn { padding: 0 7px; font-size: 12.5px; }
.aow-strip { position: absolute; top: calc(54px + var(--sat)); left: calc(4px + var(--sal)); right: calc(134px + var(--sar)); height: 30px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px; padding: 0 8px; z-index: 5; }
.aow-strip .minimap { position: static; flex: 1; min-width: 60px; width: auto; height: 18px; }
.cbar { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cbar .ic { width: 16px; height: 16px; }
.cbar .bar { width: 56px; height: 7px; } .cbar.foe .bar i { background: var(--red); }
.cbar.foe .ic { color: var(--red); } .cbar.mine .ic { color: var(--tint); }
.merge-all-btn { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border-radius: 12px; background: rgba(191,90,242,.16); color: var(--purple);
  font-weight: 800; font-size: 11.5px; line-height: 1.1; padding: 2px 6px; text-align: left; }
.merge-all-btn .ic { width: 18px; height: 18px; }
.merge-all-btn.dis { opacity: .4; }
.merge-btn { background: var(--purple) !important; }
.merge-tip { font-size: 11.5px; line-height: 1.3; }
.talent { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 12px; background: rgba(255,196,0,.14); }
.talent b { font-size: 13px; color: #b78300; } .talent small { color: var(--label); }
@media (prefers-color-scheme: dark) { .talent b { color: #ffd60a; } }
.patrol-hint { position: absolute; top: calc(56px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 4px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; }
.patrol-hint .ic { color: var(--orange); }
.reward-now { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; box-shadow: none; background: var(--fill); }
.reward-now .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reward-now .chip { font-size: 13.5px; padding: 4px 10px 4px 6px; }
.goals { margin: 0; padding-left: 18px; font-size: 13px; }
.goals li + li { margin-top: 2px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.rtable th { text-align: left; font-size: 11.5px; color: var(--label2); font-weight: 600; padding: 4px 6px; }
.rtable td { padding: 6px; border-top: .5px solid var(--sep); }
.rtable td.r { text-align: right; } .rtable .unl { color: var(--green); font-weight: 600; font-size: 12px; }
.merge-all-btn { justify-content: center; text-align: center; font-size: 11px; padding: 2px 4px; overflow: hidden; }
.merge-all-btn .ic { display: none; }
