@font-face { font-family: 'Noto Serif'; src: url('../fonts/NotoSerif-Regular.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'Noto Serif'; src: url('../fonts/NotoSerif-Bold.ttf') format('truetype'); font-weight: 700; }
@font-face { font-family: 'Noto Serif'; src: url('../fonts/NotoSerif-Italic.ttf') format('truetype'); font-style: italic; }

:root { --cyan: #4fe6ff; --pink: #ff5fb8; --gold: #ffd84a; --bg: rgba(10, 12, 30, 0.82); --line: rgba(120, 200, 255, 0.25); --ui: system-ui, 'Segoe UI', sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05060f; color: #e8f0ff; font-family: var(--ui); }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; color: #e8f0ff; background: linear-gradient(180deg, rgba(60, 70, 120, 0.85), rgba(30, 34, 70, 0.9)); border: 1px solid var(--line); border-radius: 10px; padding: 10px 18px; cursor: pointer; transition: transform .08s, box-shadow .15s, border-color .15s; }
button:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(79, 230, 255, 0.45); transform: translateY(-1px); }
button.primary { background: linear-gradient(180deg, #1fb5d6, #1874b8); border-color: #7af0ff; }
button.danger { background: linear-gradient(180deg, #a3305a, #6e1d3c); }
input, select { font: inherit; color: #e8f0ff; background: rgba(5, 8, 22, 0.8); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; margin-top: 4px; }
input:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 10px rgba(79, 230, 255, 0.35); }
label { display: block; font-size: 14px; color: #b9c8ea; }
code { background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 4px; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; background: radial-gradient(ellipse at 50% 30%, rgba(40, 20, 90, 0.35), rgba(2, 3, 12, 0.6)); backdrop-filter: blur(2px); }
#menu { background: radial-gradient(ellipse at 50% 20%, rgba(70, 30, 140, 0.5), rgba(2, 4, 14, 0.55) 70%); }
.menuBox { width: min(560px, 94vw); max-height: 94vh; overflow: hidden auto; padding: 26px 30px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 0 60px rgba(79, 230, 255, 0.15), inset 0 0 40px rgba(120, 60, 255, 0.1); }
.menuBox.small { width: min(420px, 94vw); }
.panel { display: flex; flex-direction: column; gap: 10px; }
.panel h2 { margin: 6px 0; font-family: 'Noto Serif', serif; }
.panel h3 { margin: 12px 0 2px; font-size: 15px; color: var(--cyan); }
.row { margin: 2px 0; }
.row.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.back { margin-top: 8px; }
.msg { min-height: 1.2em; color: var(--gold); margin: 4px 0; }
.note { font-size: 13px; color: #9aaad0; }
.list { display: flex; flex-direction: column; gap: 6px; max-height: 32vh; overflow: auto; }
.item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(20, 24, 54, 0.7); }
.item .grow { flex: 1; min-width: 0; }
.item .sub { font-size: 12px; color: #92a2c8; }
.item button { padding: 6px 10px; }

.wordmark { margin: 0; text-align: center; font-family: 'Noto Serif', serif; font-weight: 700; font-size: clamp(34px, 6.4vw, 60px); letter-spacing: 0.5px; line-height: 1.05; }
.wordmark span:first-child { background: linear-gradient(180deg, #e4fdff, #4fe6ff 60%, #2a7dff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(79, 230, 255, 0.8)); }
.wordmark span:last-child { background: linear-gradient(180deg, #ffe3f4, #ff5fb8 60%, #9a3cff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(255, 95, 184, 0.8)); }
.tag { text-align: center; margin: 4px 0 18px; color: #b9c8ea; font-style: italic; font-family: 'Noto Serif', serif; }

.loadBox { width: min(460px, 90vw); text-align: center; padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 12px 0; }
#loadBar { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 0 12px var(--cyan); transition: width .2s; }

/* Spielanzeige */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
#crosshair::before, #crosshair::after { content: ''; position: absolute; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 6px rgba(79, 230, 255, 0.9); }
#crosshair::before { left: 10px; top: 2px; width: 2px; height: 18px; }
#crosshair::after { top: 10px; left: 2px; height: 2px; width: 18px; }
#hotbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; background: rgba(8, 10, 26, 0.7); border: 1px solid var(--line); border-radius: 12px; }
.slot { position: relative; width: 52px; height: 52px; border: 1px solid rgba(140, 170, 255, 0.25); border-radius: 8px; background: rgba(20, 24, 54, 0.55) center / 40px no-repeat; image-rendering: pixelated; }
.slot.sel { border-color: var(--cyan); box-shadow: 0 0 12px rgba(79, 230, 255, 0.9), inset 0 0 10px rgba(79, 230, 255, 0.35); }
.slot.pick { border-color: var(--gold); box-shadow: 0 0 10px rgba(255, 216, 74, 0.8); }
.slot .n { position: absolute; right: 4px; bottom: 1px; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.slot .k { position: absolute; left: 4px; top: 1px; font-size: 10px; color: #8fa0c8; }
.slot .dur { position: absolute; left: 6px; right: 6px; bottom: 4px; height: 3px; background: rgba(0, 0, 0, 0.6); border-radius: 2px; }
.slot .dur i { display: block; height: 100%; border-radius: 2px; background: #6dff8a; }
.slot.pulse { animation: pulse .35s; }
@keyframes pulse { 50% { transform: scale(1.12); box-shadow: 0 0 18px var(--gold); } }
#heldName { position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); font-size: 16px; text-shadow: 0 0 8px #000, 0 0 3px #000; opacity: 0; transition: opacity .4s; }
#modeTag { position: absolute; top: 10px; right: 12px; font-size: 13px; color: #b9c8ea; text-shadow: 0 0 4px #000; }
#toasts { position: absolute; top: 14%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.toast { padding: 7px 14px; border-radius: 10px; background: rgba(10, 12, 30, 0.85); border: 1px solid var(--line); font-size: 15px; animation: tin .25s; }
.toast.good { border-color: #6dff8a; box-shadow: 0 0 12px rgba(109, 255, 138, 0.4); }
.toast.warn { border-color: var(--gold); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
#chat { position: absolute; left: 12px; bottom: 90px; width: min(460px, 60vw); }
#chatLog { display: flex; flex-direction: column; gap: 2px; }
.cl { padding: 3px 8px; background: rgba(5, 6, 18, 0.55); border-radius: 6px; font-size: 14px; text-shadow: 0 1px 2px #000; transition: opacity 1s; word-wrap: break-word; }
.cl.sys { color: #ffd84a; }
.cl.old { opacity: 0; }
#chat.open .cl.old { opacity: 1; }
#chatInput { pointer-events: auto; margin-top: 6px; }
#playerList { position: absolute; top: 12%; left: 50%; transform: translateX(-50%); min-width: 260px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
#debug { position: absolute; top: 8px; left: 8px; margin: 0; padding: 8px 10px; background: rgba(0, 0, 0, 0.6); font: 12px/1.35 ui-monospace, monospace; color: #d8f6ff; border-radius: 8px; white-space: pre; }
#hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #c8d6f6; text-shadow: 0 0 4px #000; text-align: center; transition: opacity 2s; }
#underwater { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(10, 80, 140, 0.05), rgba(2, 30, 70, 0.5)); opacity: 0; transition: opacity .3s; }

/* Inventar */
.invBox { display: flex; gap: 18px; padding: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; max-width: 96vw; max-height: 92vh; overflow: auto; }
.invBox h2 { margin: 0 0 8px; font-family: 'Noto Serif', serif; }
.grid { display: grid; grid-template-columns: repeat(9, 52px); gap: 4px; }
#invHotbar { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
#creativeGrid { max-height: 300px; overflow: auto; }
#invTabs { display: flex; gap: 6px; margin-bottom: 10px; }
#invTabs button { padding: 5px 12px; font-size: 14px; }
#invTabs button.on { border-color: var(--cyan); box-shadow: 0 0 10px rgba(79, 230, 255, 0.4); }
.invLeft .slot, #creativeGrid .slot { cursor: pointer; }
.invRight { width: 330px; }
#recipes { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; padding-right: 4px; }
.rec { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(20, 24, 54, 0.6); }
.rec.no { opacity: 0.45; }
.rec .ic { width: 36px; height: 36px; background: center / 32px no-repeat; image-rendering: pixelated; flex: none; }
.rec .grow { flex: 1; font-size: 13px; }
.rec .need { color: #9aaad0; font-size: 12px; }
.rec button { padding: 5px 9px; font-size: 13px; }
#stationTag { font-size: 13px; color: var(--gold); font-family: var(--ui); }
.settingsGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.settingsGrid .full { grid-column: 1 / -1; }
.chk { display: flex; align-items: center; gap: 8px; }
.chk input { width: auto; margin: 0; }
input[type=range] { padding: 0; }
* { scrollbar-color: rgba(79, 230, 255, 0.35) rgba(10, 12, 30, 0.4); scrollbar-width: thin; }

/* Konto */
.kontoHead { margin: 0 0 2px; font-family: 'Noto Serif', serif; }
.tabs { display: flex; gap: 6px; margin: 8px 0 10px; }
.tabs button { flex: 1; padding: 7px 10px; font-size: 14px; }
.tabs button.on { border-color: var(--cyan); box-shadow: 0 0 12px rgba(79, 230, 255, 0.45); }
#kontoCode { font-family: ui-monospace, monospace; letter-spacing: 2px; text-transform: uppercase; }

/* Verwaltung */
.vBox { width: min(920px, 96vw); height: min(720px, 92vh); display: flex; flex-direction: column; padding: 20px 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 0 60px rgba(255, 216, 74, 0.12), inset 0 0 40px rgba(120, 60, 255, 0.1); }
.vHead { display: flex; align-items: baseline; gap: 14px; }
.vHead h2 { margin: 0; font-family: 'Noto Serif', serif; color: var(--gold); text-shadow: 0 0 14px rgba(255, 216, 74, 0.45); }
.vHead .note { flex: 1; }
#vBody { flex: 1; overflow: auto; padding-right: 6px; min-height: 0; }
#vBody h3 { margin: 16px 0 6px; font-size: 15px; color: var(--cyan); }
.vRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.vInline { display: flex; align-items: center; gap: 8px; }
.vInline select { width: auto; margin: 0; }
.vList { display: flex; flex-direction: column; gap: 6px; }
.vList .item { flex-wrap: wrap; }
.vList .item.gesperrt { opacity: 0.7; border-color: rgba(255, 95, 95, 0.5); }
.vDot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.vbadge { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 6px; font-size: 11px; vertical-align: 2px; border: 1px solid; }
.vbadge.a { color: var(--gold); border-color: rgba(255, 216, 74, 0.6); }
.vbadge.o { color: #6dff8a; border-color: rgba(109, 255, 138, 0.6); }
.vbadge.g { color: #ff7a7a; border-color: rgba(255, 95, 95, 0.7); }
.vSearch { margin: 4px 0 10px; }
.vResult { position: relative; margin: 6px 0 12px; padding: 12px 40px 12px 14px; border-radius: 12px; border: 1px solid #6dff8a; background: rgba(20, 60, 40, 0.45); box-shadow: 0 0 16px rgba(109, 255, 138, 0.25); }
.vResult.bad { border-color: var(--gold); background: rgba(70, 55, 10, 0.45); box-shadow: none; }
.vResLabel { font-size: 13px; color: #b9c8ea; }
.vBig { margin: 4px 0 6px; font: 700 30px/1.2 ui-monospace, monospace; letter-spacing: 3px; color: #fff; text-shadow: 0 0 16px rgba(79, 230, 255, 0.8); user-select: all; }
.vClose { position: absolute; top: 6px; right: 6px; padding: 2px 9px; }
.vGrid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 6px 0; }
.vGrid .k { color: #9aaad0; font-size: 14px; }

/* Figuren-Editor */
.figBox { display: flex; gap: 22px; padding: 20px 22px; height: min(760px, 94vh); background: var(--bg); border: 1px solid var(--line); border-radius: 18px; max-width: 96vw; max-height: 94vh; overflow: auto; box-shadow: 0 0 60px rgba(79, 230, 255, 0.15); }
.figLeft { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 300px; flex: none; }
.figLeft .msg { text-align: center; }
.figActions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: auto; }
.figActions button { width: 100%; }
#figOk { font-size: 18px; padding: 12px 18px; }
#figCanvas { width: 300px; height: 383px; border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 35%, rgba(70, 40, 150, 0.55), rgba(5, 6, 20, 0.9) 75%); cursor: grab; touch-action: none; }
#figCanvas:active { cursor: grabbing; }
.figRight { width: min(500px, 60vw); display: flex; flex-direction: column; min-height: 0; }
.figRight h2 { margin: 0 0 4px; font-family: 'Noto Serif', serif; }
#figOpts { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; overflow: auto; padding-right: 6px; min-height: 0; }
.figRow .lbl { font-size: 13px; color: #b9c8ea; margin-bottom: 4px; }
.figRow .lbl b { color: #e8f0ff; font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.sw { width: 24px; height: 24px; padding: 0; border-radius: 7px; border: 2px solid rgba(255, 255, 255, 0.15); }
.sw:hover { transform: scale(1.1); }
.sw.on { border-color: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.8); }
.choices { display: flex; flex-wrap: wrap; gap: 5px; }
.choices button { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.choices button.on { border-color: var(--cyan); background: linear-gradient(180deg, #1fb5d6, #1874b8); }

/* Schriftzug über der Anmeldung (Modus „Anmeldung zuerst“) */
#kontoMarke { font-size: 40px; white-space: nowrap; text-align: center; margin: 0 0 6px; }
