/* GLADBACH UPRISING - Copyright (c) 2026 Jan-Maurice Dahlmanns - MIT License (see LICENSE) */

:root {
  --bg: #0d0b0a;
  --panel: rgba(18, 16, 15, 0.94);
  --panel2: #1d1a18;
  --line: #3a332d;
  --text: #e9e1d6;
  --dim: #9a8f82;
  --red: #e03b2e;
  --red2: #ff6a4d;
  --blue: #3b7bff;
  --cash: #8fd46a;
  --fuel: #ff9b3d;
  --sup: #7ab8ff;
  --good: #6ee08a;
  --warn: #ffc24a;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.4 var(--font); user-select: none; }
canvas#game { position: fixed; inset: 0; display: block; cursor: default; }
body.targeting canvas#game { cursor: crosshair; }
body.hoverEnemy canvas#game { cursor: crosshair; }
.hidden { display: none !important; }
button { font: inherit; color: var(--text); background: #2a2420; border: 1px solid #4a4038; border-radius: 3px; padding: 7px 14px; cursor: pointer; }
button:hover { background: #3a302a; border-color: #6a5a4c; }
button.primary { background: #7a1f17; border-color: #b8372a; }
button.primary:hover { background: #9a2a1f; }
button:disabled { opacity: 0.45; cursor: default; }
select, input[type=range] { font: inherit; background: #221d1a; color: var(--text); border: 1px solid #4a4038; border-radius: 3px; padding: 4px 6px; }
a { color: var(--red2); }
kbd { font: 12px var(--mono); background: #2a2420; border: 1px solid #5a4c40; border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.center { text-align: center; }
.warn { color: var(--warn); }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; top: 0; left: 0; right: 0; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: linear-gradient(#141110f0, #0d0b0ad0); border-bottom: 1px solid #3a2a22; }
#topbar .spacer { flex: 1; pointer-events: none; }
.res { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; min-width: 86px; }
.res b { font-variant-numeric: tabular-nums; }
.res.cash b { color: var(--cash); } .res.fuel b { color: var(--fuel); } .res.sup b { color: var(--sup); }
.res.sup.full b { color: #ff4c4c; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.ico { width: 16px; height: 16px; border-radius: 3px; display: inline-block; }
.ico.cash { background: radial-gradient(circle at 40% 35%, #c6f0a0, #4f7a3a); }
.ico.fuel { background: linear-gradient(#ffb36a, #b0402a); border-radius: 3px 3px 6px 6px; }
.ico.sup { background: linear-gradient(#a8d4ff, #2a5a9a); clip-path: polygon(50% 0, 100% 40%, 80% 100%, 20% 100%, 0 40%); }
.chip { padding: 3px 10px; font-size: 13px; }
.chip.alert { border-color: var(--warn); color: var(--warn); }
#clock, #timerBox { font: 600 14px var(--mono); color: #d8cfc4; }
#timerBox { color: var(--warn); padding: 2px 8px; border: 1px solid #6a5a2a; border-radius: 3px; background: #2a2410; }

#objectives { position: absolute; top: 44px; right: 10px; width: 320px; padding: 10px 12px; }
#objectives h4 { margin: 0 0 6px; color: var(--red2); letter-spacing: 1px; text-transform: uppercase; font-size: 12px; }
.obj { padding: 2px 0; }
.obj.done { color: var(--good); text-decoration: line-through; opacity: 0.8; }
.obj.failed { color: #ff5a4a; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 18px #0008; }

#msgs { position: absolute; left: 240px; bottom: 236px; width: 520px; pointer-events: none !important; display: flex; flex-direction: column; gap: 3px; }
.msg { background: #000a; padding: 3px 8px; border-left: 3px solid #888; font-size: 13px; transition: opacity 2s; width: fit-content; max-width: 100%; }
.msg.good { border-color: var(--good); } .msg.warn { border-color: var(--warn); color: #ffe2a0; } .msg.alert { border-color: #ff3a2a; color: #ffb0a0; }
.msg.fade { opacity: 0; }

#dialog { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); width: min(620px, 90vw); display: flex; gap: 12px; padding: 10px 14px; background: #0d0b0aee; border: 1px solid #5a2a22; border-radius: 4px; pointer-events: none !important; }
#dialog .portrait { width: 52px; height: 52px; flex: none; border-radius: 3px; display: grid; place-items: center; font: 700 20px var(--font); color: #fff; background: linear-gradient(135deg, #8a2a1f, #3a0f0a); border: 1px solid #b8372a; }
#dialog .portrait.cops { background: linear-gradient(135deg, #2a4a8a, #0f1a3a); border-color: #3b7bff; }
#dialog .who { font-weight: 700; color: var(--red2); }
#dialog .text { font-size: 14px; }

#bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 230px; display: flex; gap: 6px; padding: 6px; background: linear-gradient(transparent, #0a0807e0 18%); pointer-events: none !important; }
#bottom > .panel { pointer-events: auto; }
#mmPanel { width: 230px; padding: 4px; flex: none; }
#minimap { width: 220px; height: 220px; display: block; cursor: pointer; image-rendering: pixelated; }
#selPanel { flex: 1; min-width: 200px; padding: 8px; overflow: hidden; }
#cmdPanel { width: 316px; flex: none; padding: 6px; }
#cmdGrid { display: grid; grid-template-columns: repeat(5, 58px); grid-template-rows: repeat(3, 58px); gap: 4px; }
.cmd { position: relative; width: 58px; height: 58px; padding: 0; border-radius: 3px; background: linear-gradient(#2c2622, #1a1613); border: 1px solid #5a4a3c; overflow: hidden; display: grid; place-items: center; }
.cmd:hover { border-color: #e0a060; }
.cmd img { width: 54px; height: 54px; display: block; }
.cmd .glyph { font-size: 20px; font-weight: 700; color: #f0d8b8; letter-spacing: -1px; }
.cmd .hk { position: absolute; left: 3px; top: 1px; font: 700 11px var(--mono); color: #ffd36a; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.cmd.empty { background: #15121088; border-color: #2a2420; cursor: default; }
.cmd.dim { opacity: 0.55; }
.cmd.disabled { opacity: 0.25; filter: grayscale(1); }

.single { display: flex; gap: 12px; }
.portrait img { width: 96px; height: 96px; border: 1px solid #5a4a3c; border-radius: 3px; background: #000; }
.info { flex: 1; min-width: 0; }
.info h3 { margin: 0 0 4px; font-size: 16px; }
.owner { font-size: 13px; font-weight: 400; }
.bar { height: 6px; background: #000; border: 1px solid #333; margin: 2px 0 6px; max-width: 320px; }
.bar i { display: block; height: 100%; }
.queue { display: flex; gap: 4px; margin-top: 6px; }
.queue img { width: 34px; height: 34px; border: 1px solid #5a4a3c; cursor: pointer; }
.queue img.first { border-color: #4aa8ff; }
.cargo { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.cargo img { width: 26px; height: 26px; border: 1px solid #444; cursor: pointer; }
.multi { display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; max-height: 210px; overflow: hidden; }
.mi { position: relative; width: 38px; height: 38px; border: 1px solid #4a3e34; background: #000; cursor: pointer; }
.mi img { width: 36px; height: 36px; display: block; }
.mi i { position: absolute; left: 0; bottom: 0; height: 3px; }
.mi.more { display: grid; place-items: center; color: var(--dim); font-size: 12px; }
.pad { padding: 30px 0; }

#tooltip { position: fixed; width: 320px; background: #0d0b0af2; border: 1px solid #6a5040; border-radius: 4px; padding: 8px 10px; font-size: 13px; pointer-events: none; z-index: 20; }
#tooltip .hk2 { color: #ffd36a; font-family: var(--mono); }
#tooltip .cost { margin: 2px 0 4px; font-weight: 700; display: flex; gap: 10px; }
.cost .cash { color: var(--cash); } .cost .fuel { color: var(--fuel); } .cost .sup { color: var(--sup); }
.cost .cash::before { content: '€ '; } .cost .fuel::before { content: '⛽ '; } .cost .sup::before { content: '▲ '; }

#fps { position: fixed; right: 330px; bottom: 236px; font: 12px var(--mono); color: #9f9; background: #0008; padding: 2px 6px; pointer-events: none; }
#toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: #1d1a18f0; border: 1px solid #6a5040; padding: 8px 16px; border-radius: 4px; z-index: 40; }

/* ---------------------------------------------------------------- menus */
#screens { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.screen { position: absolute; inset: 0; pointer-events: auto; overflow: auto; padding: 30px 40px; display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(ellipse at 50% 30%, #2a0f0b 0%, #120c0a 45%, #070605 100%); }
.screen::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.025;
  background: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px); }
.screen.dim-bg { background: #070605d0; }
.screen h2 { margin: 6px 0 18px; font-size: 26px; letter-spacing: 3px; text-transform: uppercase; color: #f0e2d0; text-shadow: 0 0 18px #a0201888; }
.logo { margin: 7vh 0 30px; text-align: center; }
.logo .l1 { font: 900 clamp(38px, 7vw, 78px)/1 var(--font); letter-spacing: 6px; color: #f3e6d6; text-shadow: 0 0 2px #000, 4px 4px 0 #6a1510, 0 0 40px #e03b2e88; transform: skew(-4deg); }
.logo .l2 { margin-top: 12px; font: 700 15px var(--mono); letter-spacing: 8px; color: var(--red2); }
.menu { display: flex; flex-direction: column; gap: 8px; width: 300px; z-index: 1; }
.menu button { padding: 11px; font-size: 16px; letter-spacing: 1px; }
.menu.horiz { flex-direction: row; width: auto; flex-wrap: wrap; justify-content: center; }
.foot { margin-top: auto; padding-top: 20px; font-size: 12px; color: var(--dim); text-align: center; z-index: 1; }
.agebox { max-width: 640px; background: #120d0bee; border: 1px solid #6a2a20; border-radius: 4px; padding: 20px 26px; z-index: 1; }
.agebox p { margin: 0 0 12px; }
.gorepick { display: block; margin: 8px 0 18px; }

.split { display: flex; gap: 16px; width: min(1100px, 100%); min-height: 0; flex: 1; z-index: 1; }
.list { width: 320px; flex: none; display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.list .item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; }
.list .item.sel { border-color: var(--red); background: #3a1c16; }
.list .item.locked { opacity: 0.5; }
.list .num { font: 900 22px var(--font); color: var(--red2); width: 24px; }
.list .t { flex: 1; display: flex; flex-direction: column; }
.list .t small { color: var(--dim); font-size: 12px; }
.list .ok { color: var(--good); font-size: 18px; }
.split .info { flex: 1; background: #120d0bdd; border: 1px solid var(--line); border-radius: 4px; padding: 14px 18px; overflow: auto; }
.split .info h3 { margin: 0 0 4px; font-size: 20px; }
.split .info h4 { margin: 14px 0 4px; color: var(--red2); text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.split.sk .info { display: flex; gap: 16px; align-items: flex-start; }
#skPreview { border: 1px solid var(--line); flex: none; }
.skside { flex: 1; }
.prow { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.prow.closed > :not(select:first-of-type):not(.sw) { opacity: 0.35; }
.sw { width: 14px; height: 14px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: -2px; }
.pname { width: 90px; font-weight: 700; }
.opts { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.opts label { display: flex; justify-content: space-between; max-width: 340px; gap: 10px; }
.row-btns { display: flex; gap: 10px; align-items: center; margin-top: 16px; z-index: 1; width: min(1100px, 100%); justify-content: flex-end; }
.row-btns > span { margin-right: auto; }
.slots { width: min(720px, 100%); display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.slot { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #120d0bdd; border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; }
.slot.empty { opacity: 0.6; }
.slot > div:last-child { display: flex; gap: 6px; }
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: min(1150px, 100%); z-index: 1; }
.help h3 { margin: 12px 0 4px; color: var(--red2); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.help p { margin: 0 0 8px; }
.help table { border-collapse: collapse; width: 100%; }
.help td { padding: 4px 6px; border-bottom: 1px solid #2a2420; vertical-align: top; }
.help td:first-child { white-space: nowrap; color: #ffd8a0; }
.cashT { color: var(--cash); } .fuelT { color: var(--fuel); }
.settings { display: flex; flex-direction: column; gap: 12px; width: min(520px, 100%); z-index: 1; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.about { width: min(760px, 100%); z-index: 1; }
.about h3 { color: var(--red2); margin: 16px 0 4px; }
.brief { width: min(860px, 100%); background: #120d0bee; border: 1px solid #5a2a20; border-radius: 4px; padding: 20px 26px; z-index: 1; overflow: auto; }
.bhead { border-left: 4px solid var(--red); padding-left: 12px; margin-bottom: 14px; }
.bhead.cops { border-color: var(--blue); }
.bhead h2 { margin: 2px 0; text-align: left; }
.bnum { font: 700 13px var(--mono); letter-spacing: 4px; color: var(--red2); text-transform: uppercase; }
.bcols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bcols h4 { color: var(--red2); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; margin: 10px 0 4px; }
.bcols ul { margin: 0; padding-left: 18px; }
#pauseInfo { margin-top: -8px; }
#endTitle.win { color: var(--good); } #endTitle.lose { color: #ff5a4a; }
.endtext { max-width: 720px; text-align: center; font-size: 16px; z-index: 1; }
.stats { z-index: 1; margin: 10px 0 20px; }
.stats table { border-collapse: collapse; }
.stats th, .stats td { padding: 5px 12px; border-bottom: 1px solid #2a2420; text-align: right; }
.stats td:first-child, .stats th:first-child { text-align: left; }
.loading { margin: auto; font: 700 22px var(--mono); letter-spacing: 6px; color: var(--red2); animation: blink 1.2s infinite; }

@media (max-width: 1100px) {
  #cmdPanel { width: 266px; }
  #cmdGrid { grid-template-columns: repeat(5, 48px); grid-template-rows: repeat(3, 48px); }
  .cmd { width: 48px; height: 48px; }
  .cmd img { width: 44px; height: 44px; }
  .portrait img { width: 70px; height: 70px; }
  .help, .bcols { grid-template-columns: 1fr; }
}
