:root { --ink: #1f2933; --panel: rgba(255,255,255,.95); --dark: rgba(28,30,36,.92); --acc: #f59e0b; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --shadow: 0 6px 20px rgba(0,0,0,.25); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #23262d; color: var(--ink); font-family: var(--font); }
body { position: fixed; inset: 0; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
#app { position: absolute; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
#boot { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #23262d; color: #fff; }
.logo { font-size: clamp(34px, 7vw, 76px); font-weight: 900; letter-spacing: -1px; color: #ffd166; text-shadow: 0 4px 0 #8a5a00, 0 8px 24px rgba(0,0,0,.5); text-align: center; }
.logo span { display: inline-block; margin-left: 10px; padding: 0 12px; border-radius: 12px; background: #ef476f; color: #fff; text-shadow: none; transform: rotate(-6deg); font-size: .7em; }
.sub { margin-top: 10px; font-weight: 700; opacity: .85; text-align: center; }

.btn { appearance: none; border: 0; border-radius: 14px; padding: 11px 16px; min-height: 44px; font: 800 16px var(--font); color: #fff; cursor: pointer; background: linear-gradient(180deg, #fbbf24, #f59e0b); box-shadow: 0 4px 0 #b45309, 0 6px 14px rgba(0,0,0,.2); touch-action: manipulation; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b45309; }
.btn:disabled { filter: grayscale(1) opacity(.5); cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 #cbd2d9, 0 6px 14px rgba(0,0,0,.12); }
.btn.green { background: linear-gradient(180deg, #4ade80, #16a34a); box-shadow: 0 4px 0 #166534; }
.btn.red { background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: 0 4px 0 #991b1b; }
.btn.small { min-height: 36px; padding: 7px 11px; font-size: 14px; border-radius: 11px; }
.btn.big { min-height: 56px; font-size: 19px; padding: 14px 26px; border-radius: 18px; }
.btn.wide { width: 100%; }

#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.top { position: absolute; top: calc(8px + var(--sat)); left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; pointer-events: none; }
.top > * { pointer-events: auto; }
.chip { background: var(--dark); color: #fff; border-radius: 99px; padding: 7px 12px; font-weight: 800; font-size: 14px; white-space: nowrap; box-shadow: var(--shadow); }
.chip.bad { background: rgba(185,28,28,.95); animation: pulse 1s infinite; }
.chip.money { color: #ffd166; font-size: 16px; }
.spacer { flex: 1; }
.speed { display: flex; background: var(--dark); border-radius: 99px; padding: 3px; box-shadow: var(--shadow); }
.speed button { border: 0; background: none; color: #fff; font: 800 14px var(--font); min-width: 40px; min-height: 34px; border-radius: 99px; cursor: pointer; }
.speed button.on { background: var(--acc); color: #1f2933; }
@keyframes pulse { 50% { opacity: .65; } }

.bottom { position: absolute; left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); bottom: calc(8px + var(--sab)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.bottom > * { pointer-events: auto; }
.advisor { align-self: flex-start; max-width: min(560px, 92vw); display: flex; gap: 8px; align-items: center; background: var(--panel); border-radius: 16px; padding: 8px 12px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); border-left: 6px solid var(--acc); }
.advisor .face { font-size: 26px; }
.hint { align-self: center; background: var(--dark); color: #fff; border-radius: 12px; padding: 6px 12px; font-size: 13px; font-weight: 700; text-align: center; max-width: 94vw; }
.bar { display: flex; gap: 6px; align-items: stretch; }
.tools { flex: 1; display: flex; gap: 5px; background: var(--dark); border-radius: 18px; padding: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x; box-shadow: var(--shadow); scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tool { flex: 0 0 auto; min-width: 62px; border: 0; border-radius: 13px; background: rgba(255,255,255,.1); color: #fff; font: 800 11px var(--font); padding: 5px 6px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; touch-action: manipulation; }
.tool i { font-style: normal; font-size: 23px; line-height: 1.1; }
.tool small { font-weight: 700; opacity: .75; font-size: 10px; }
.tool.on { background: var(--acc); color: #1f2933; box-shadow: 0 0 0 3px #fff inset; }
.tool.nav { background: rgba(255,255,255,.22); }
.sep { flex: 0 0 2px; background: rgba(255,255,255,.2); border-radius: 2px; margin: 4px 2px; }

.modal-wrap { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(10,14,20,.5); padding: calc(10px + var(--sat)) 10px calc(10px + var(--sab)); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fbfaf7; border-radius: 22px; width: min(720px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.45); overflow: hidden; }
.modal.narrow { width: min(460px, 100%); }
.modal h2 { margin: 0; padding: 14px 18px 10px; font-size: 21px; display: flex; align-items: center; gap: 10px; }
.modal h2 .x { margin-left: auto; }
.body { overflow: auto; padding: 2px 18px 18px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.body p { margin: 8px 0; line-height: 1.45; }
.tabs { display: flex; gap: 6px; padding: 0 18px 10px; flex-wrap: wrap; }
.tabs button { border: 0; border-radius: 99px; padding: 8px 13px; font: 800 14px var(--font); background: #e6e2da; color: var(--ink); cursor: pointer; }
.tabs button.on { background: var(--ink); color: #fff; }
.row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e8e4dc; }
.row:last-child { border-bottom: 0; }
.row .ic { font-size: 30px; width: 40px; text-align: center; flex: 0 0 auto; }
.row .tx { flex: 1; min-width: 0; }
.row .tx b { display: block; font-size: 16px; }
.row .tx span { display: block; font-size: 13px; opacity: .78; line-height: 1.35; }
.row .tx em { font-style: normal; color: #b45309; font-weight: 800; font-size: 13px; }
.meter { height: 9px; border-radius: 9px; background: #e2ddd3; overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: #22c55e; border-radius: 9px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed #ddd6ca; font-size: 14px; }
.kv b { white-space: nowrap; }
.log { font-size: 13px; line-height: 1.4; }
.log div { padding: 5px 0; border-bottom: 1px solid #eee9e0; }
.log .bad { color: #b91c1c; } .log .good { color: #15803d; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px 16px; justify-content: flex-end; }
h3 { margin: 14px 0 4px; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; opacity: .6; }

#toasts { position: absolute; top: calc(56px + var(--sat)); left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 10px; }
.toast { background: var(--dark); color: #fff; border-radius: 14px; padding: 8px 14px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); animation: toast 5.5s forwards; max-width: min(640px, 94vw); text-align: center; }
.toast.bad { background: rgba(153,27,27,.95); } .toast.good { background: rgba(21,128,61,.95); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px); } 6%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#menu { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(20,22,28,.35), rgba(20,22,28,.8)); padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); overflow: auto; }
.menu-box { width: min(520px, 100%); display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.lvls { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) { .menu-box { width: min(860px, 100%); } .lvls { grid-template-columns: 1fr 1fr; } }
.menu-box .logo { margin-bottom: 4px; }
.menu-box .sub { color: #fff; margin: 0 0 12px; }
.lvl { display: flex; gap: 12px; align-items: center; text-align: left; background: #fbfaf7; border: 0; border-radius: 18px; padding: 12px 14px; cursor: pointer; font-family: var(--font); color: var(--ink); box-shadow: 0 4px 0 #cbd2d9; }
.lvl:disabled { opacity: .55; }
.lvl .n { font-size: 30px; }
.lvl b { display: block; font-size: 17px; } .lvl span { font-size: 13px; opacity: .75; }
@media (max-height: 480px) { .advisor { display: none; } .tool { min-width: 54px; } .tool i { font-size: 19px; } }
/* Version 2: Vortriebsart und Ebenenwechsel */
.methods { align-self: center; display: flex; gap: 5px; background: var(--dark); border-radius: 16px; padding: 5px; box-shadow: var(--shadow); max-width: 94vw; overflow-x: auto; }
.methods .tool { min-width: 92px; }
.layerbtn { font-size: 15px !important; background: linear-gradient(180deg, #60a5fa, #2563eb) !important; box-shadow: 0 4px 0 #1e40af, 0 6px 14px rgba(0,0,0,.2) !important; }
