:root {
  --glass: rgba(12, 14, 20, .78);
  --glass-2: rgba(22, 26, 36, .9);
  --line: rgba(255, 255, 255, .08);
  --text: #eef1f6;
  --muted: #8b93a7;
  --accent: #2ee59d;
  --accent-2: #19b97b;
  --danger: #ff5a5f;
  --warn: #ffb020;
  --info: #4ea8ff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0c10; color: var(--text); font: 14px/1.4 Inter, system-ui, sans-serif; user-select: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none; width: 100%; }
input:focus, select:focus { border-color: var(--accent); }
select option { background: #151922; }
.btn-primary { background: var(--accent); color: #062417; border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 700; letter-spacing: .02em; width: 100%; transition: background .15s; }
.btn-primary:hover { background: #5cf0b6; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; width: 100%; }
.btn-ghost:hover { background: rgba(255,255,255,.06); }
.btn-ghost.danger { color: var(--danger); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; text-align: center; }
.error { color: var(--danger); min-height: 18px; font-size: 13px; }
kbd { font: 600 11px 'Chakra Petch', monospace; background: rgba(255,255,255,.1); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; margin-right: 6px; }

/* ---------- Login ---------- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 20%, rgba(46,229,157,.18), transparent 60%), linear-gradient(160deg, rgba(8,10,14,.6), rgba(8,10,14,.95)); z-index: 50; }
.auth-card { width: min(380px, 92vw); background: var(--glass-2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; backdrop-filter: blur(10px); display: grid; gap: 14px; }
.logo { font: 700 38px/1 'Chakra Petch', sans-serif; letter-spacing: .06em; }
.logo span { color: var(--accent); margin-left: 6px; }
.tagline { margin: -6px 0 4px; color: var(--muted); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,.05); border-radius: 8px; padding: 3px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px; border-radius: 6px; font-weight: 600; }
.tabs button.active { background: rgba(255,255,255,.1); color: var(--text); }
#authForm { display: grid; gap: 10px; }
.online { color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- Panels ---------- */
.panel { position: fixed; z-index: 30; background: var(--glass-2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; backdrop-filter: blur(10px); }
.panel h2 { margin: 0 0 14px; font: 700 20px 'Chakra Petch', sans-serif; letter-spacing: .03em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

#charEditor { left: 24px; top: 50%; transform: translateY(-50%); width: 340px; }
.ce-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.ce-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ce-grid input[type=color] { padding: 2px; height: 36px; cursor: pointer; }

#inventory { right: 24px; top: 50%; transform: translateY(-50%); width: 380px; }
.inv-head { display: flex; justify-content: space-between; align-items: baseline; }
#invWeight { color: var(--muted); font: 600 13px 'Chakra Petch'; }
#invGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 330px; overflow-y: auto; }
.slot { aspect-ratio: 1; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; text-align: center; position: relative; cursor: pointer; padding: 6px; font-size: 11px; }
.slot .em { font-size: 26px; line-height: 1; }
.slot .cnt { position: absolute; top: 4px; right: 6px; font: 700 11px 'Chakra Petch'; color: var(--accent); }
.slot.sel { border-color: var(--accent); background: rgba(46,229,157,.1); }
.slot.empty { cursor: default; opacity: .35; }
#invActions { margin-top: 12px; }
#invSel { margin-bottom: 8px; font-weight: 600; }

#help { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#topRight { position: absolute; top: 18px; right: 22px; text-align: right; display: grid; gap: 4px; }
.money { font: 700 22px 'Chakra Petch', sans-serif; text-shadow: 0 2px 6px rgba(0,0,0,.7); color: #7dffb7; }
.money.bank { font-size: 17px; color: #9fd3ff; }
.money .ico { font-size: 15px; margin-right: 6px; }
.jobline { font: 600 13px 'Chakra Petch'; color: #d7dbe5; text-shadow: 0 1px 4px #000; }
.clock { font: 700 15px 'Chakra Petch'; color: #fff; text-shadow: 0 1px 4px #000; }

#chat { position: absolute; top: 18px; left: 18px; width: min(460px, 60vw); pointer-events: auto; }
#chatLog { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 6px; scrollbar-width: thin; }
.msg { background: rgba(0,0,0,.45); border-radius: 6px; padding: 4px 9px; font-size: 13px; text-shadow: 0 1px 2px #000; width: fit-content; max-width: 100%; word-break: break-word; transition: opacity .6s; }
.msg b { margin-right: 6px; }
.msg.fade { opacity: 0; }
#chat.open .msg.fade { opacity: 1; }
#chatInput { margin-top: 6px; background: rgba(0,0,0,.7); }

#bottomLeft { position: absolute; left: 18px; bottom: 18px; display: grid; gap: 6px; }
#minimap { width: 220px; height: 220px; border-radius: 12px; border: 2px solid rgba(255,255,255,.15); background: #10141b; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.bars { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4px; }
.bar { height: 7px; background: rgba(0,0,0,.55); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; transition: width .4s; }
.bar.health i { background: #3ddc84; }
.bar.hunger i { background: #ffb020; }
.bar.thirst i { background: #4ea8ff; }
#streetName { font: 600 13px 'Chakra Petch'; text-shadow: 0 1px 3px #000; }

#speedo { position: absolute; right: 26px; bottom: 26px; text-align: right; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.spd b { font: 700 58px/1 'Chakra Petch'; }
.spd small { font: 600 14px 'Chakra Petch'; margin-left: 4px; color: #cfd4df; }
.vinfo { display: flex; gap: 12px; justify-content: flex-end; font: 600 13px 'Chakra Petch'; margin-top: 4px; }
.plate { display: inline-block; margin-top: 6px; background: #f4f4f0; color: #1b2a6b; font: 700 14px 'Chakra Petch'; padding: 2px 10px; border-radius: 4px; border: 2px solid #1b2a6b; letter-spacing: .08em; text-shadow: none; }

#prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--glass); border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
#prompt kbd { background: var(--accent); color: #062417; border: 0; }

#notifications { position: absolute; left: 18px; bottom: 290px; display: flex; flex-direction: column-reverse; gap: 6px; width: 320px; }
.toast { background: var(--glass); border-left: 4px solid var(--info); padding: 9px 12px; border-radius: 8px; font-size: 13px; animation: slide .25s ease-out; }
.toast.success { border-color: var(--accent); }
.toast.error { border-color: var(--danger); }
@keyframes slide { from { transform: translateX(-20px); opacity: 0; } }

#waypointInfo { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: var(--glass); padding: 6px 14px; border-radius: 999px; font: 600 13px 'Chakra Petch'; color: #ffd43b; }
#announce { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, #ff5a5f, #ff9f1a); color: #fff; padding: 14px 26px; border-radius: 10px; font: 700 18px 'Chakra Petch'; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 80vw; text-align: center; }

/* ---------- Menü ---------- */
#menu { position: fixed; right: 26px; top: 120px; width: 330px; z-index: 25; background: var(--glass-2); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.menu-head { padding: 14px 16px; background: linear-gradient(135deg, var(--accent-2), #0f7d58); }
#menuTitle { font: 700 19px 'Chakra Petch'; color: #fff; }
#menuSub { font-size: 12px; color: rgba(255,255,255,.85); }
#menuItems { max-height: 52vh; overflow-y: auto; }
.mi { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mi .r { color: var(--muted); font: 600 13px 'Chakra Petch'; white-space: nowrap; }
.mi.sel { background: rgba(46,229,157,.14); box-shadow: inset 3px 0 var(--accent); }
.mi.static { cursor: default; color: var(--muted); }
.mi-input { display: flex; gap: 6px; padding: 8px 16px 12px; background: rgba(46,229,157,.06); }
.mi-input input { padding: 7px 10px; }
.mi-input button { width: auto; padding: 7px 14px; }
.menu-foot { font-size: 11px; color: var(--muted); padding: 8px 16px; }

/* ---------- Große Karte ---------- */
#bigmap { position: fixed; inset: 0; z-index: 28; background: rgba(5,7,10,.88); display: grid; place-items: center; align-content: center; gap: 8px; }
#bigmapCanvas { width: min(84vh, 92vw); height: min(84vh, 92vw); border-radius: 14px; border: 2px solid rgba(255,255,255,.15); cursor: crosshair; }
#bigmap p { color: var(--muted); margin: 0; }

/* ---------- Tod ---------- */
#death { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; align-content: center; gap: 10px; background: radial-gradient(ellipse, rgba(120,0,0,.25), rgba(40,0,0,.75)); pointer-events: none; }
#death h1 { margin: 0; font: 700 56px 'Chakra Petch'; letter-spacing: .1em; color: #ff6b6b; text-shadow: 0 4px 20px #000; }
#death button { width: auto; pointer-events: auto; }
#death p { margin: 0; }

#loading { position: fixed; inset: 0; display: grid; place-items: center; z-index: 60; background: #0a0c10; font: 600 18px 'Chakra Petch'; color: var(--muted); }

@media (max-width: 700px) {
  #minimap { width: 140px; height: 140px; }
  #charEditor, #inventory { left: 50%; right: auto; transform: translate(-50%, -50%); width: 94vw; }
  #notifications { bottom: 210px; width: 70vw; }
}
