:root {
  --bg: #0b0e14;
  --panel: rgba(14, 18, 27, 0.86);
  --panel2: rgba(24, 30, 44, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --text: #e8ecf3;
  --muted: #9aa4b5;
  --accent: #22d3ee;
  --accent2: #67e8f9;
  --neon2: #e879f9;
  --blue: #3b82f6;
  --red: #ef4444;
  --green: #4ade80;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
input, select, button, textarea { font-family: inherit; }
.hidden { display: none !important; }
#app { position: fixed; inset: 0; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- Boot ---------- */
#boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(circle at 50% 40%, #1b2333, #07090d); z-index: 50; }
#boot p { color: var(--muted); max-width: 520px; text-align: center; padding: 0 16px; }
.logo { font-weight: 900; font-size: 54px; letter-spacing: 6px; font-style: italic; text-shadow: 0 0 18px rgba(34, 211, 238, 0.55), 0 0 42px rgba(232, 121, 249, 0.25); }
.logo span { color: var(--accent); margin-left: 10px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.12); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- UI Grundelemente ---------- */
#ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#ui > * { pointer-events: auto; }
.screen { position: absolute; inset: 0; display: flex; }
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); font-weight: 650; font-size: 15px; cursor: pointer; transition: background 0.15s, transform 0.08s, border-color 0.15s; text-decoration: none; }
.btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #22d3ee, #6366f1); color: #04121a; border-color: transparent; box-shadow: 0 0 18px rgba(34, 211, 238, 0.35); }
.btn.primary:hover { background: linear-gradient(135deg, #67e8f9, #818cf8); box-shadow: 0 0 26px rgba(34, 211, 238, 0.55); }
.btn.danger { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); }
.btn.danger:hover { background: rgba(239,68,68,0.3); }
.btn.big { padding: 14px 24px; font-size: 17px; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.field input[type=text], .field input[type=password], .field select { padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,0.35); color: var(--text); font-size: 15px; outline: none; user-select: text; -webkit-user-select: text; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.err { color: #fca5a5; min-height: 20px; font-size: 14px; }
.ok { color: #86efac; }
h1, h2, h3 { margin: 0 0 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.seg { display: inline-flex; background: rgba(0,0,0,0.35); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 7px; font-weight: 650; cursor: pointer; }
.seg button.on { background: rgba(255,255,255,0.12); color: var(--text); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Login ---------- */
#scr-login { align-items: flex-start; justify-content: center; overflow-y: auto; padding: 16px 0; background: linear-gradient(90deg, rgba(5,7,11,0.85), rgba(5,7,11,0.35)); }
.login-box { width: min(420px, calc(100vw - 32px)); padding: 30px 28px; margin: auto; }
.login-box .row .grow { min-width: 0; }
.login-box .row input { min-width: 0; width: 100%; }
.login-box .logo { font-size: 40px; text-align: center; margin-bottom: 6px; }
.login-box .tag { text-align: center; color: var(--muted); margin-bottom: 22px; }
.login-box .seg { width: 100%; margin-bottom: 18px; }
.login-box .seg button { flex: 1; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Hauptmenü ---------- */
#scr-main { background: linear-gradient(90deg, rgba(5,7,11,0.92) 0%, rgba(5,7,11,0.6) 38%, rgba(5,7,11,0.15) 100%); }
.mm-side { width: 330px; flex: none; padding: 30px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.mm-side .logo { font-size: 29px; letter-spacing: 3px; margin-bottom: 4px; white-space: nowrap; }
.mm-user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); margin: 14px 0 12px; width: 100%; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.mm-user:hover { background: rgba(255,255,255,0.09); }
.mm-user > div:last-child { min-width: 0; }
.mm-user .av { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; background: #333; flex: none; }
.mm-user .av canvas, .mm-user .av img { width: 100%; height: 100%; display: block; }
.mm-user b { display: block; font-size: 16px; }
.mm-user small { color: var(--muted); }
.mm-nav { display: flex; flex-direction: column; gap: 6px; }
.mm-nav button { text-align: left; justify-content: flex-start; padding: 11px 16px; font-size: 16px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); font-weight: 700; cursor: pointer; letter-spacing: 0.3px; }
.mm-nav button:hover { background: rgba(255,255,255,0.07); }
.mm-nav button.on { background: rgba(34,211,238,0.13); border-color: rgba(34,211,238,0.5); color: var(--accent2); box-shadow: 0 0 14px rgba(34,211,238,0.2) inset; }
.mm-nav .sep { height: 1px; background: var(--line); margin: 6px 0; }
.mm-nav .short { display: none; }
.mm-foot { margin-top: auto; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mm-content { flex: 1; min-width: 0; padding: 36px 40px 0 10px; overflow: auto; display: flex; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mm-panel { width: min(900px, 100%); padding: 26px 28px; align-self: flex-start; margin-bottom: 36px; }
/* Start-Leiste bleibt beim Scrollen immer sichtbar */
.actbar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 14px; margin: 20px -28px -26px; padding: 14px 28px; background: rgba(12,16,24,0.97); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; box-shadow: 0 -10px 24px rgba(0,0,0,0.35); }
.actbar .summary { margin-right: auto; display: flex; flex-direction: column; min-width: 0; }
.actbar .summary b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actbar .summary span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actbar .err { min-height: 0; }
.actbar .err:empty { display: none; }
.sel-desc { display: none; }
.cards.maps { position: relative; }
.card b i { font-style: normal; color: var(--accent2); }
.mm-panel h2 { font-size: 24px; }
.mm-panel .sub { color: var(--muted); margin: -6px 0 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { position: relative; border-radius: 12px; border: 2px solid var(--line); background: rgba(255,255,255,0.04); padding: 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.card:hover { background: rgba(255,255,255,0.08); }
.card.on { border-color: var(--accent); background: rgba(34,211,238,0.1); box-shadow: 0 0 16px rgba(34,211,238,0.25); }
.card b { display: block; font-size: 15px; margin-bottom: 4px; }
.card small { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: block; }
.card .swatch { height: 56px; border-radius: 8px; margin-bottom: 10px; display: flex; align-items: flex-end; padding: 6px 8px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.9); text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin: 18px 0 10px; }

.rooms { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.room { display: grid; grid-template-columns: 1fr 150px 120px 80px 110px; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.room:hover { background: rgba(255,255,255,0.08); }
.room b { font-size: 15px; }
.room small { color: var(--muted); display: block; }
.empty { color: var(--muted); padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }

table.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tscroll table.lb th, .tscroll table.lb td { white-space: nowrap; }
table.lb th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; padding: 8px; border-bottom: 1px solid var(--line); }
table.lb td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
table.lb tr.me td { background: rgba(34,211,238,0.12); }
table.lb td.rank { width: 46px; font-weight: 800; color: var(--accent2); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.tile b { display: block; font-size: 22px; }
.tile small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Charakter */
.char-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.preview3d { width: 300px; height: 380px; border-radius: 12px; background: radial-gradient(circle at 50% 35%, #2a3550, #0d111a); border: 1px solid var(--line); position: relative; overflow: hidden; }
.preview3d canvas { width: 100%; height: 100%; display: block; }
.face-editor { margin-top: 16px; }
.crop { position: relative; width: 240px; height: 240px; border-radius: 12px; overflow: hidden; background: #000; cursor: grab; border: 1px solid var(--line); touch-action: none; }
.crop:active { cursor: grabbing; }
.crop canvas, .crop video { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop .guide { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(ellipse 36% 46% at 50% 50%, transparent 98%, rgba(0,0,0,0.45) 100%); }
.crop .guide::after { content: ''; position: absolute; left: 22%; right: 22%; top: 42%; border-top: 1px dashed rgba(255,255,255,0.4); }
.class-detail { padding: 14px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); margin-top: 12px; }
.bars { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.bar-o { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.bar-o i { display: block; height: 100%; background: linear-gradient(90deg, #22d3ee, #e879f9); border-radius: 4px; }

.keys { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 15px; }
kbd { display: inline-block; min-width: 26px; padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.25); border-bottom-width: 3px; background: rgba(255,255,255,0.06); font-family: inherit; font-weight: 700; font-size: 13px; text-align: center; margin-right: 4px; }

/* ---------- Overlays im Spiel ---------- */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4,6,10,0.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 30; }
.ov-box { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 24px); overflow: auto; padding: 24px 26px; overscroll-behavior: contain; }
.ov-box.narrow { width: min(420px, calc(100vw - 32px)); }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cls-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cls-card { border-radius: 12px; border: 2px solid var(--line); background: rgba(255,255,255,0.04); padding: 12px; cursor: pointer; transition: all 0.12s; }
.cls-card:hover { background: rgba(255,255,255,0.08); transform: translateY(-2px); }
.cls-card.on { border-color: var(--accent); background: rgba(34,211,238,0.1); box-shadow: 0 0 18px rgba(34,211,238,0.3); }
.cls-card .ic { height: 120px; border-radius: 9px; margin-bottom: 10px; position: relative; overflow: hidden; }
.cls-card .ic canvas { width: 100%; height: 100%; }
.cls-card b { font-size: 16px; display: block; }
.cls-card .role { font-size: 12px; color: var(--accent2); text-transform: uppercase; font-weight: 700; letter-spacing: 0.6px; }
.cls-card p { font-size: 12.5px; color: var(--muted); margin: 6px 0 8px; line-height: 1.35; min-height: 52px; }
.cls-card .st { font-size: 12px; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; color: var(--muted); }
.cls-card .st span:nth-child(even) { color: var(--text); text-align: right; font-weight: 600; }
.team-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.end-title { font-size: 34px; font-weight: 900; text-align: center; letter-spacing: 1px; margin-bottom: 4px; }
.end-sub { text-align: center; color: var(--muted); margin-bottom: 16px; }
#ov-loading .ov-box { text-align: center; }
#ov-loading .spinner { margin: 10px auto 16px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--font); }
#hud-dmg .di { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#hud-dmg .di i { position: absolute; left: -28px; top: -178px; width: 0; height: 0; border-left: 28px solid transparent; border-right: 28px solid transparent; border-bottom: 24px solid rgba(239,68,68,0.85); filter: drop-shadow(0 0 4px rgba(0,0,0,0.6)); }
#hud-vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(200,0,0,0.55) 100%); }
#hud-vignette.low { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: inset 0 0 90px rgba(200,0,0,0.35); } 50% { box-shadow: inset 0 0 160px rgba(200,0,0,0.6); } }
#hud-cross { position: absolute; left: 50%; top: 50%; --gap: 6px; transition: opacity 0.12s; }
#hud-cross i { position: absolute; background: #fff; box-shadow: 0 0 2px rgba(0,0,0,0.9); }
#hud-cross .ch-t, #hud-cross .ch-b { width: 2px; height: 9px; left: -1px; }
#hud-cross .ch-l, #hud-cross .ch-r { width: 9px; height: 2px; top: -1px; }
#hud-cross .ch-t { bottom: var(--gap); } #hud-cross .ch-b { top: var(--gap); }
#hud-cross .ch-l { right: var(--gap); } #hud-cross .ch-r { left: var(--gap); }
#hud-cross .ch-d { width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; }
#hud-hit { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hud-hit i { position: absolute; width: 10px; height: 2px; background: #fff; box-shadow: 0 0 2px #000; }
#hud-hit i:nth-child(1) { transform: translate(5px, 5px) rotate(45deg); }
#hud-hit i:nth-child(2) { transform: translate(-15px, 5px) rotate(-45deg); }
#hud-hit i:nth-child(3) { transform: translate(5px, -7px) rotate(-45deg); }
#hud-hit i:nth-child(4) { transform: translate(-15px, -7px) rotate(45deg); }
#hud-hit.on { animation: hit 0.22s ease-out; }
#hud-hit.head i { background: #e879f9; }
#hud-hit.kill i { background: #ef4444; width: 14px; }
@keyframes hit { 0% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1); } }
#hud-scope { position: absolute; inset: 0; display: none; }
#hud-scope.on { display: block; background: radial-gradient(circle at center, transparent 0, transparent 33vh, rgba(2,8,14,0.95) calc(33vh + 2px)); }
#hud-scope .scope-ring { position: absolute; left: 50%; top: 50%; width: 66vh; height: 66vh; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid rgba(34,211,238,0.9); box-shadow: 0 0 22px rgba(34,211,238,0.6), inset 0 0 40px rgba(34,211,238,0.15);
  background: linear-gradient(rgba(34,211,238,0.8), rgba(34,211,238,0.8)) center/2px 100% no-repeat, linear-gradient(rgba(34,211,238,0.8), rgba(34,211,238,0.8)) center/100% 2px no-repeat; }
#hud-scope .scope-ring::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #e879f9; box-shadow: 0 0 10px #e879f9; }

#hud-top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; }
.tb-teams { display: flex; align-items: stretch; gap: 6px; }
.tb .ts { min-width: 64px; padding: 6px 12px; font-size: 26px; font-weight: 900; border-radius: 8px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.tb .ts.t0 { background: rgba(59,130,246,0.85); }
.tb .ts.t1 { background: rgba(239,68,68,0.85); }
.tb .ts.mine { box-shadow: 0 0 0 2px #fff inset; }
.tb .tmid { background: rgba(0,0,0,0.6); border-radius: 8px; padding: 4px 14px; min-width: 120px; display: flex; flex-direction: column; justify-content: center; }
.tb .time { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tb .objs { display: flex; gap: 6px; justify-content: center; margin-top: 2px; }
.tb .flagst { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.tb .zone { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; color: #111;
  background: linear-gradient(0deg, var(--cc) var(--cp), var(--zc) var(--cp)); border: 2px solid rgba(255,255,255,0.7); }
.tb-sub { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 4px; text-shadow: 0 1px 2px #000; }
.tb-ffa { display: flex; gap: 14px; align-items: center; background: rgba(0,0,0,0.6); padding: 6px 16px; border-radius: 8px; font-size: 15px; }
#hud-mini { position: absolute; top: 14px; left: 14px; width: 190px; height: 190px; }
#hud-feed { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.feed { background: rgba(0,0,0,0.55); padding: 5px 10px; border-radius: 6px; font-size: 14px; transition: opacity 0.6s; }
.feed .w { color: #cbd5e1; font-size: 12px; margin: 0 4px; }
.feed.fade { opacity: 0; }
#hud-center { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
#hud-center div { font-size: 22px; font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,0.9); transition: opacity 0.5s; white-space: nowrap; }
#hud-center div.fade { opacity: 0; }
#hud-popups { position: absolute; top: 57%; left: 50%; transform: translateX(-50%); }
#hud-popups div { font-weight: 900; font-size: 18px; text-align: center; text-shadow: 0 2px 4px #000; animation: popup 1.4s ease-out forwards; }
@keyframes popup { 0% { opacity: 0; transform: translateY(8px) scale(0.8); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
#hud-hp { position: absolute; left: 22px; bottom: 22px; min-width: 230px; background: rgba(0,0,0,0.5); padding: 10px 14px; border-radius: 10px; }
#hud-hp .cls { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
#hud-hp .val { font-size: 40px; font-weight: 900; line-height: 1; margin: 2px 0 6px; }
#hud-hp .bar { height: 8px; background: rgba(255,255,255,0.15); border-radius: 4px; overflow: hidden; }
#hud-hp .bar div { height: 100%; background: var(--green); transition: width 0.15s; }
#hud-hp .buffs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
#hud-hp .buffs span { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 5px; background: rgba(34,211,238,0.22); color: var(--accent2); }
#hud-ammo { position: absolute; right: 22px; bottom: 22px; text-align: right; background: rgba(0,0,0,0.5); padding: 10px 14px; border-radius: 10px; min-width: 230px; }
#hud-ammo .wname { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
#hud-ammo .val b { font-size: 40px; font-weight: 900; }
#hud-ammo .val b.low { color: #f87171; }
#hud-ammo .val span { font-size: 18px; color: var(--muted); margin-left: 4px; }
#hud-ammo .rbar { height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; overflow: hidden; margin: 4px 0; opacity: 0; }
#hud-ammo .rbar div { height: 100%; background: var(--accent); }
#hud-ammo .abil { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.ab { position: relative; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ab svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.ab circle { fill: rgba(0,0,0,0.4); stroke: rgba(255,255,255,0.9); stroke-width: 3; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; transition: stroke-dashoffset 0.1s linear; }
.ab b { position: absolute; left: 0; width: 34px; text-align: center; color: #fff; font-size: 14px; }
.ab.ready circle { stroke: var(--accent); fill: rgba(34,211,238,0.22); }
.ab.ready span { color: var(--text); }
#hud-info { position: absolute; right: 14px; bottom: 150px; font-size: 12px; color: rgba(255,255,255,0.6); text-shadow: 0 1px 2px #000; }
#hud-chat { position: absolute; left: 22px; bottom: 130px; width: 380px; }
#hud-chat .lines div { font-size: 14px; text-shadow: 0 1px 3px #000; padding: 1px 0; transition: opacity 0.8s; }
#hud-chat .lines div.fade { opacity: 0; }
#hud-chat.open .lines div.fade { opacity: 1; }
#hud-chat input { display: none; width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.7); color: #fff; outline: none; pointer-events: auto; user-select: text; }
#hud-chat.open input { display: block; }
#hud-score { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(900px, calc(100vw - 40px)); background: rgba(8,10,16,0.88); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
#hud-score h2 { font-size: 18px; text-align: center; }
.sb-team { margin-bottom: 12px; }
.sb-team h3 { font-size: 15px; display: flex; justify-content: space-between; border-left: 4px solid var(--tc); padding-left: 10px; }
.sb-team table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-team th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 4px 6px; }
.sb-team td { padding: 5px 6px; border-top: 1px solid rgba(255,255,255,0.06); }
.sb-team tr.me td { background: rgba(34,211,238,0.14); }
.sb-team tr.dead td { opacity: 0.55; }
.sb-team .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
#hud-death { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); }
.dcard { background: rgba(8,10,16,0.82); border: 1px solid var(--line); border-radius: 14px; padding: 16px 22px; text-align: center; min-width: 340px; }
.dcard .killer { display: flex; align-items: center; gap: 14px; justify-content: center; text-align: left; margin-bottom: 10px; }
.dcard .face { width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 2px solid rgba(239,68,68,0.7); flex: none; }
.dcard .killer small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.dcard .killer b { display: block; font-size: 22px; }
.dcard .killer span { color: var(--muted); font-size: 13px; }
.dcard .resp { font-size: 16px; }
.dcard .resp b { color: var(--accent2); font-size: 20px; }
.dcard .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
#hud-prot { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); font-size: 13px; font-weight: 800; color: #93c5fd; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 1px 3px #000; }


/* ---------- Responsiv ---------- */
@media (max-width: 1000px) {
  .mm-side { width: 260px; padding: 24px 16px; }
  .mm-content { padding: 20px 16px 0 0; }
  .mm-panel { margin-bottom: 20px; }
  .cls-cards { grid-template-columns: repeat(3, 1fr); }
  .char-wrap { grid-template-columns: 1fr; }
  .room { grid-template-columns: 1fr 110px 90px; }
  .room .hide-s { display: none; }
}

/* Handy hochkant / schmale Fenster: Kopfzeile + Tab-Leiste, Inhalt füllt den Rest */
@media (max-width: 700px) {
  #scr-main { flex-direction: column; background: linear-gradient(180deg, rgba(5,7,11,0.92) 0%, rgba(5,7,11,0.7) 100%); }
  .mm-side { width: 100%; padding: 10px 12px 0; padding-top: max(10px, env(safe-area-inset-top)); gap: 8px; overflow: visible; }
  .mm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mm-side .logo { font-size: 22px; letter-spacing: 2px; margin: 0; }
  .mm-user { width: auto; max-width: 58%; margin: 0; padding: 5px 12px 5px 5px; gap: 9px; border-radius: 12px; }
  .mm-user .av { width: 34px; height: 34px; border-radius: 8px; }
  .mm-user b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mm-user small { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mm-nav { flex-direction: row; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
  .mm-nav::-webkit-scrollbar { display: none; }
  .mm-nav .sep { display: none; }
  .mm-nav button { flex: none; padding: 8px 15px; font-size: 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); }
  .mm-nav .full { display: none; }
  .mm-nav .short { display: inline; }
  .mm-foot { display: none; }
  .mm-content { padding: 0; }
  .mm-panel { width: 100%; margin: 0; min-height: 100%; padding: 16px 14px 0; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .mm-panel h2 { font-size: 20px; margin-bottom: 8px; }
  .mm-panel .sub { font-size: 13px; margin: -4px 0 12px; }
  .section-title { margin: 14px 0 8px; font-size: 12px; }
  .cards.modes { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 10px 12px; }
  .card.mode small, .card.map small { display: none; }
  .card.mode b, .card.map b { margin: 0; font-size: 14px; }
  .sel-desc { display: block; font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.35; }
  .cards.maps { display: flex; overflow-x: auto; gap: 8px; scroll-snap-type: x proximity; margin: 0 -14px; padding: 2px 14px 4px; scrollbar-width: none; }
  .cards.maps::-webkit-scrollbar { display: none; }
  .cards.maps .card { flex: 0 0 128px; scroll-snap-align: center; padding: 8px; }
  .card .swatch { height: 44px; margin-bottom: 6px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.opts { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .field { margin-bottom: 10px; }
  .field label { font-size: 11.5px; }
  .field input[type=text], .field input[type=password], .field select { font-size: 16px; padding: 10px; }
  .actbar { margin: 12px -14px 0; padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-radius: 0; gap: 10px; }
  .actbar .go { flex: 1; max-width: 240px; }
  .actbar .summary b { font-size: 14px; }
  .actbar .summary span { font-size: 12px; }
  .preview3d { width: 100%; height: 250px; }
  .keys { grid-template-columns: 130px 1fr; font-size: 14px; }
  .cls-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Handy quer / niedrige Fenster: schmale Seitenleiste, alles kompakter */
@media (max-height: 520px) and (min-width: 701px) {
  .mm-side { width: 200px; padding: 10px 8px 10px max(10px, env(safe-area-inset-left)); gap: 4px; }
  .mm-side .logo { font-size: 20px; letter-spacing: 2px; margin: 0 0 0 6px; }
  .mm-user { margin: 6px 0 4px; padding: 6px; gap: 8px; }
  .mm-user .av { width: 32px; height: 32px; border-radius: 8px; }
  .mm-user b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mm-user small { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mm-nav { gap: 1px; }
  .mm-nav button { padding: 7px 12px; font-size: 14px; }
  .mm-nav .sep { margin: 3px 0; }
  .mm-foot { display: none; }
  .mm-content { padding: 8px max(10px, env(safe-area-inset-right)) 0 4px; }
  .mm-panel { width: 100%; padding: 14px 16px; margin-bottom: 8px; }
  .mm-panel h2 { font-size: 19px; margin-bottom: 6px; }
  .mm-panel .sub { font-size: 13px; margin: -2px 0 8px; }
  .section-title { margin: 10px 0 6px; font-size: 11.5px; }
  .card { padding: 8px 10px; }
  .card.mode small, .card.map small { display: none; }
  .card.mode b, .card.map b { margin: 0; font-size: 13.5px; }
  .sel-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
  .cf-head { display: none; }
  .field.rn { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 4px; }
  .field.rn label { flex: none; }
  .field.rn input { flex: 1; min-width: 0; }
  .cards.modes { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .cards.maps { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; padding-bottom: 2px; }
  .cards.maps::-webkit-scrollbar { display: none; }
  .cards.maps .card { flex: 0 0 132px; }
  .map-desc { display: none !important; }
  .card .swatch { height: 26px; margin-bottom: 5px; font-size: 10px; padding: 3px 6px; }
  .form-grid.opts { grid-template-columns: repeat(4, 1fr); gap: 0 8px; }
  .field { margin-bottom: 8px; gap: 4px; }
  .field label { font-size: 11px; }
  .field input[type=text], .field input[type=password], .field select { font-size: 15px; padding: 8px 9px; }
  .actbar { margin: 10px -16px -14px; padding: 8px 16px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .btn.big { padding: 11px 20px; font-size: 16px; }
  .char-wrap { grid-template-columns: 200px 1fr; gap: 14px; }
  .preview3d { width: 200px; height: 260px; }
  /* Anmeldung quer: Konto links, Gast rechts */
  .login-box { width: min(760px, calc(100vw - 24px)); padding: 14px 22px 16px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; align-items: start; }
  .login-box .logo, .login-box .tag { grid-column: 1 / -1; }
  .login-box .logo { font-size: 28px; }
  .login-box .tag { margin-bottom: 10px; }
  .login-box .seg { margin-bottom: 10px; }
  .login-box .field { margin-bottom: 8px; }
  .login-box .err { min-height: 0; margin-bottom: 4px; }
  .lb-guest { align-self: center; }
  .lb-guest .divider { margin: 0 0 12px; }
  .lb-guest .row { flex-direction: column; align-items: stretch; }
  .lb-guest .guestbtn { width: 100%; }
  /* Overlays im Spiel */
  .ov-box { padding: 12px 16px; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); }
  .ov-head { margin-bottom: 8px; }
  .ov-head h2 { font-size: 19px; }
  .cls-cards { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .cls-card { padding: 7px; }
  .cls-card:hover { transform: none; }
  .cls-card .ic { height: 60px; margin-bottom: 4px; }
  .cls-card p { display: none; }
  .cls-card b { font-size: 14px; }
  .cls-card .role { font-size: 10px; }
  .cls-card .st { font-size: 10.5px; gap: 1px 6px; }
  #ov-class .ov-foot { margin-top: 8px !important; justify-content: flex-end !important; }
  #ov-class .hint { display: none; }
  .end-title { font-size: 24px; }
  .end-sub { margin-bottom: 8px; }
  table.lb { font-size: 12.5px; }
  table.lb td { padding: 5px 6px; }
  table.lb th { padding: 5px 6px; }
  .menu-list { gap: 6px; }
}

/* ---------- Touch-Steuerung ---------- */
#touch { position: fixed; inset: 0; z-index: 15; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
#touch button { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: none; }
.tc-btn, .tc-sm { display: flex; align-items: center; justify-content: center; padding: 0; color: rgba(255,255,255,0.92); border: 2px solid rgba(255,255,255,0.32); background: rgba(8,12,20,0.34); cursor: pointer; transition: transform 0.06s, background 0.1s; }
.tc-btn { position: absolute; border-radius: 50%; aspect-ratio: 1; height: auto; pointer-events: auto; }
.tc-btn svg { width: 46%; height: 46%; pointer-events: none; }
.tc-btn.on, .tc-sm.on { background: rgba(34,211,238,0.38); border-color: var(--accent); transform: scale(0.93); }
.tc-btn.act { border-color: var(--accent); color: var(--accent2); background: rgba(34,211,238,0.2); box-shadow: 0 0 14px rgba(34,211,238,0.45); }
.tc-act { position: absolute; right: calc(8px + env(safe-area-inset-right)); bottom: calc(6px + env(safe-area-inset-bottom)); width: clamp(220px, 64vmin, 340px); aspect-ratio: 1; pointer-events: none; }
.tc-fire { right: 9%; bottom: 23%; width: 30%; border-color: rgba(34,211,238,0.85); background: rgba(34,211,238,0.16); box-shadow: 0 0 18px rgba(34,211,238,0.3); }
.tc-fire svg { width: 52%; height: 52%; }
.tc-jump { right: 0.5%; bottom: 0.5%; width: 19%; }
.tc-crouch { right: 25%; bottom: 0; width: 17%; }
.tc-ads { right: 42%; bottom: 18%; width: 20%; }
.tc-reload { right: 0; bottom: 54%; width: 16.5%; }
.tc-abil { right: 24.5%; bottom: 60%; width: 19.5%; }
.tc-nade { right: 46%; bottom: 47%; width: 17.5%; }
.tc-ads.scope.act { color: #f0abfc; border-color: #e879f9; box-shadow: 0 0 14px rgba(232,121,249,0.5); background: rgba(232,121,249,0.2); }
.tc-btn.cd::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--accent) var(--p, 100%), rgba(255,255,255,0.14) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); pointer-events: none; }
.tc-btn.cd:not(.ready) { color: rgba(255,255,255,0.45); }
.tc-btn.cd.ready { border-color: rgba(34,211,238,0.7); }
.tc-btn .lbl { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; font-size: 10.5px; font-weight: 700; white-space: nowrap; color: rgba(255,255,255,0.85); text-shadow: 0 1px 3px #000; pointer-events: none; }
.tc-top { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); display: flex; gap: 8px; }
.tc-sm { width: 42px; height: 42px; border-radius: 11px; pointer-events: auto; }
.tc-sm svg { width: 54%; height: 54%; pointer-events: none; }
.tc-stick { position: absolute; left: calc(100px + env(safe-area-inset-left)); bottom: calc(100px + env(safe-area-inset-bottom)); width: 0; height: 0; pointer-events: none; }
.tc-stick.idle { opacity: 0.5; }
.tc-base { position: absolute; left: -64px; top: -64px; width: 128px; height: 128px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); background: radial-gradient(circle, rgba(34,211,238,0.08), rgba(8,12,20,0.3)); }
.tc-knob { position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.32); border: 2px solid rgba(255,255,255,0.7); box-shadow: 0 0 12px rgba(34,211,238,0.4); }
#touch.dead .tc-act, #touch.dead .tc-stick { display: none; }

#rotate-hint { display: none; position: fixed; inset: 0; z-index: 60; background: radial-gradient(circle at 50% 40%, #1b2333, #07090d); color: var(--text); align-items: center; justify-content: center; text-align: center; }
#rotate-hint > div { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; }
#rotate-hint svg { color: var(--accent); animation: rot 2.2s ease-in-out infinite; }
#rotate-hint b { font-size: 20px; }
#rotate-hint span { color: var(--muted); }
@keyframes rot { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) { body.touch.ingame #rotate-hint { display: flex; } }

/* HUD im Touch-Modus: kompakt, Platz für Daumen */
body.touch #hud-mini { width: 104px; height: 104px; top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); }
body.touch #hud-top { transform: translateX(-50%) scale(0.8); transform-origin: top center; top: 6px; }
body.touch #hud-feed { top: calc(60px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
body.touch .feed { font-size: 11.5px; padding: 3px 8px; }
body.touch .feed .w { font-size: 10.5px; }
body.touch #hud-hp { left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(calc(-100% - 5px)); min-width: 0; width: 150px; padding: 6px 10px; border-radius: 9px; }
body.touch #hud-hp .cls { font-size: 9.5px; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.touch #hud-hp .val { font-size: 22px; margin: 0 0 3px; }
body.touch #hud-hp .bar { height: 5px; }
body.touch #hud-hp .buffs { position: absolute; bottom: 100%; left: 0; margin-bottom: 4px; }
body.touch #hud-ammo { right: auto; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(5px); min-width: 0; width: 120px; padding: 6px 10px; border-radius: 9px; text-align: left; }
body.touch #hud-ammo .wname { font-size: 9.5px; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.touch #hud-ammo .val b { font-size: 22px; }
body.touch #hud-ammo .val span { font-size: 13px; }
body.touch #hud-ammo .abil { display: none; }
body.touch #hud-info { right: auto; bottom: auto; left: calc(12px + env(safe-area-inset-left)); top: calc(116px + env(safe-area-inset-top)); font-size: 10.5px; }
body.touch #hud-chat { left: calc(10px + env(safe-area-inset-left)); bottom: auto; top: calc(134px + env(safe-area-inset-top)); width: min(360px, 44vw); }
body.touch #hud-chat .lines div { font-size: 12px; }
body.touch #hud-chat.open { z-index: 16; }
body.touch #hud-chat input { font-size: 16px; }
body.touch #hud-center { top: 22%; }
body.touch #hud-center div { font-size: 17px; }
body.touch #hud-popups div { font-size: 15px; }
body.touch #hud-death { bottom: auto; top: 46%; transform: translate(-50%, -50%) scale(0.82); }
body.touch #hud-score { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow: auto; padding: 10px 12px; width: min(760px, calc(100vw - 20px)); z-index: 17; }
body.touch #hud-score h2 { font-size: 15px; margin-bottom: 6px; }
body.touch .sb-team table { font-size: 12px; }
body.touch .sb-team td { padding: 3px 5px; }
body.touch .sb-team h3 { font-size: 13px; margin-bottom: 4px; }
body.touch #hud-prot { top: 60%; }
