/* TANK ISLAND - Copyright (C) 2026 Jan-Maurice Dahlmanns
   SPDX-License-Identifier: GPL-3.0-or-later */
:root {
  --accent: #4fc3ff;
  --accent2: #ffb43a;
  --enemy: #ff4b3a;
  --ok: #6dff9e;
  --panel: rgba(8, 16, 26, 0.72);
  --panel-border: rgba(79, 195, 255, 0.35);
  --text: #d8e8f4;
  --muted: #7f97aa;
  /* Local fonts only (no font downloads from third parties). */
  --font-display: "Bahnschrift", "DIN Alternate", "Eurostile", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  --font-body: "Bahnschrift", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05080c; color: var(--text);
  font-family: var(--font-body); user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#overlay { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hidden { display: none !important; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 .35em; margin: 0 .1em; border: 1px solid var(--panel-border);
  border-bottom-width: 2px; border-radius: 3px; background: rgba(79,195,255,.08); font-family: var(--font-display);
  font-size: .75em; text-align: center; color: #fff; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; font-size: 16px; }
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 4px;
  box-shadow: 0 0 18px rgba(0,0,0,.4), inset 0 0 12px rgba(79,195,255,.05); padding: 8px 12px; }
#topLeft { position: absolute; left: 14px; top: 14px; min-width: 230px; }
#topLeft .energy { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: #fff; display: flex; align-items: baseline; gap: 8px; }
#topLeft .ico { color: var(--accent2); font-size: 22px; }
.sub { font-size: 14px; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
#topLeft .caps { display: flex; gap: 14px; margin-top: 4px; font-size: 14px; color: var(--muted); font-weight: 700; }
#topLeft .caps b { color: #fff; }
#researchStatus { margin-top: 4px; color: var(--accent); }
#topCenter { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; }
#objective { font-family: var(--font-display); font-size: 14px; letter-spacing: 1px; color: #fff; text-shadow: 0 0 6px #000;
  background: var(--panel); border: 1px solid var(--panel-border); padding: 5px 14px; border-radius: 3px; }
#timer { font-family: var(--font-display); font-size: 13px; color: var(--muted); margin-top: 3px; text-shadow: 0 0 4px #000; }
#mapWrap { position: absolute; right: 14px; top: 14px; border: 1px solid var(--panel-border); border-radius: 4px;
  background: #000; box-shadow: 0 0 18px rgba(0,0,0,.5); line-height: 0; }
#mapWrap canvas { width: 220px; height: 220px; }
#mapWrap.big { right: 50%; top: 50%; transform: translate(50%, -50%); }
#mapWrap.big canvas { width: min(80vh, 80vw); height: min(80vh, 80vw); }
#messages { position: absolute; left: 14px; top: 130px; width: 420px; display: flex; flex-direction: column; gap: 3px; }
#messages .msg { font-size: 16px; font-weight: 700; text-shadow: 0 0 4px #000, 0 0 2px #000; padding: 1px 0; transition: opacity .6s; }
#messages .msg.warn { color: var(--accent2); }
#messages .msg.bad { color: var(--enemy); }
#messages .msg.good { color: var(--ok); }
#messages .msg.info { color: var(--accent); }

#crosshair { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%,-50%); }
#crosshair i { position: absolute; background: rgba(255,255,255,.85); box-shadow: 0 0 3px #000; }
#crosshair i:nth-child(1) { left: 16px; top: 0; width: 2px; height: 10px; }
#crosshair i:nth-child(2) { left: 16px; bottom: 0; width: 2px; height: 10px; }
#crosshair i:nth-child(3) { top: 16px; left: 0; width: 10px; height: 2px; }
#crosshair i:nth-child(4) { top: 16px; right: 0; width: 10px; height: 2px; }
#crosshair.enemy i { background: var(--enemy); }
#crosshair.friend i { background: var(--ok); }
#lockRing { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 2px solid var(--enemy);
  border-radius: 50%; box-shadow: 0 0 8px var(--enemy); }
#lockRing::after { content: 'LOCK'; position: absolute; top: 48px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 10px; color: var(--enemy); }
#targetInfo { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); font-weight: 700;
  font-size: 15px; text-shadow: 0 0 4px #000; white-space: nowrap; }

#wraithPanel { position: absolute; left: 14px; bottom: 14px; width: 300px; }
#wraithPanel .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
#wraithPanel label { width: 52px; font-family: var(--font-display); font-size: 11px; color: var(--muted); }
#wraithPanel .bar { flex: 1; height: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
#wraithPanel .bar > div { height: 100%; width: 100%; background: linear-gradient(90deg, #2fa0ff, #6fdcff); transition: width .1s; }
#wraithPanel .bar.boost > div { background: linear-gradient(90deg, #ff9b2f, #ffd36f); }
#wraithPanel .bar.msl > div { background: linear-gradient(90deg, #d14bff, #ff8bf0); }
#wraithPanel .bar.orb > div { background: linear-gradient(90deg, #ff3b3b, #ffb0a0); }
#hpVal { width: 46px; text-align: right; font-family: var(--font-display); font-size: 12px; }
#hpBar.low { background: linear-gradient(90deg, #ff3030, #ff8060) !important; }

#callbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
#callbar .slot { width: 78px; height: 74px; background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 4px; position: relative; text-align: center; padding-top: 4px; overflow: hidden; }
#callbar .slot .k { position: absolute; left: 4px; top: 2px; font-family: var(--font-display); font-size: 11px; color: var(--accent2); }
#callbar .slot .ic { font-size: 22px; line-height: 28px; margin-top: 4px; }
#callbar .slot .n { font-size: 12px; font-weight: 700; }
#callbar .slot .c { font-size: 12px; color: var(--accent2); font-weight: 700; }
#callbar .slot.off { opacity: .35; filter: grayscale(1); }
#callbar .slot.poor .c { color: var(--enemy); }
#callbar .slot .cd { position: absolute; left: 0; bottom: 0; width: 100%; background: rgba(79,195,255,.25); }
#callbar .slot.flash { box-shadow: 0 0 12px var(--accent); border-color: var(--accent); }

#orderPanel { position: absolute; right: 14px; bottom: 14px; font-size: 14px; color: var(--muted); font-weight: 700; min-width: 170px; }
#orderPanel b { color: #fff; font-family: var(--font-display); font-size: 13px; margin-left: 6px; }
#hint { position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%); font-size: 18px; font-weight: 700;
  text-shadow: 0 0 5px #000, 0 0 2px #000; color: #fff; white-space: nowrap; }
#hint .bad { color: var(--enemy); }

#menuPanel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 440px; padding: 14px 18px; }
#menuPanel h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 16px; color: var(--accent); letter-spacing: 2px; }
#menuPanel .opt { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 16px; font-weight: 600; }
#menuPanel .opt .k { width: 26px; font-family: var(--font-display); color: var(--accent2); font-size: 13px; }
#menuPanel .opt .nm { flex: 1; }
#menuPanel .opt .cost { color: var(--accent2); width: 60px; text-align: right; }
#menuPanel .opt .st { width: 140px; text-align: right; font-size: 13px; color: var(--muted); }
#menuPanel .opt.off { opacity: .45; }
#menuPanel .opt .desc { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
#menuPanel .foot { margin-top: 8px; font-size: 13px; color: var(--muted); }

#respawn { position: absolute; left: 50%; top: 38%; transform: translate(-50%,-50%); text-align: center;
  font-family: var(--font-display); font-size: 30px; color: var(--enemy); text-shadow: 0 0 12px #000; }
#respawnTime { font-size: 18px; color: #fff; margin-top: 8px; }
#damageFlash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(255,0,0,.45) 100%); opacity: 0; transition: opacity .25s; }
#tutorial { position: absolute; right: 14px; top: 250px; width: 260px; font-size: 15px; font-weight: 600; }
#tutorial h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 12px; color: var(--accent2); letter-spacing: 1px; }
#fps { position: absolute; right: 250px; top: 14px; font-family: monospace; color: #9f9; text-shadow: 0 0 3px #000; }

/* ---------------- SCREENS ---------------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(3,6,10,.35), rgba(3,6,10,.75)); z-index: 10; padding: 30px; }
.screen.dim { background: rgba(3, 6, 10, .78); }
.screen h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: 4px; font-size: 34px; margin: 0 0 18px; color: #fff;
  text-shadow: 0 0 18px rgba(79,195,255,.6); text-transform: uppercase; }
.logo { text-align: center; margin-bottom: 40px; }
.logo .l1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(48px, 10vw, 120px); letter-spacing: .12em; color: #fff;
  text-shadow: 0 0 30px rgba(79,195,255,.9), 0 0 4px #9fe2ff; line-height: 1; }
.logo .l2 { font-family: var(--font-display); font-weight: 700; letter-spacing: .6em; color: var(--accent2); font-size: clamp(14px, 2vw, 22px); margin-top: 10px; }
.menu { display: flex; flex-direction: column; gap: 10px; min-width: 280px; }
.menu.horiz { flex-direction: row; }
button { font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; font-size: 15px; padding: 12px 22px; color: var(--text);
  background: rgba(10, 24, 38, .85); border: 1px solid var(--panel-border); border-radius: 3px; cursor: pointer; text-transform: uppercase;
  transition: all .12s; }
button:hover { background: rgba(79, 195, 255, .18); border-color: var(--accent); color: #fff; box-shadow: 0 0 14px rgba(79,195,255,.35); }
button.primary { border-color: var(--accent2); color: #fff; background: rgba(255,180,58,.16); }
button.primary:hover { background: rgba(255,180,58,.32); box-shadow: 0 0 14px rgba(255,180,58,.4); }
button:disabled { opacity: .4; cursor: default; }
#titleScreen .foot { position: absolute; bottom: 16px; color: var(--muted); font-size: 14px; }
.split { display: flex; gap: 18px; width: min(1000px, 100%); height: min(480px, 60vh); }
.list { width: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.list .item { padding: 10px 14px; background: var(--panel); border: 1px solid rgba(255,255,255,.08); border-radius: 3px; cursor: pointer; }
.list .item:hover { border-color: var(--panel-border); }
.list .item.sel { border-color: var(--accent2); background: rgba(255,180,58,.12); }
.list .item.locked { opacity: .4; cursor: default; }
.list .item .t { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: #fff; }
.list .item .s { font-size: 13px; color: var(--muted); }
.list .item .done { color: var(--ok); float: right; font-size: 12px; }
.info { flex: 1; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 4px; padding: 16px 20px; overflow-y: auto; display: flex; gap: 18px; }
.info .txt { flex: 1; }
.info h3 { font-family: var(--font-display); margin: 0 0 8px; color: var(--accent2); }
.info p { font-size: 17px; line-height: 1.4; margin: 0 0 10px; }
.info .meta { color: var(--muted); font-size: 14px; }
.info canvas { width: 220px; height: 220px; border: 1px solid var(--panel-border); flex: none; }
.row-btns { display: flex; gap: 12px; margin-top: 18px; align-items: center; }
.row-btns label, .settings label { font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }
select { font-family: var(--font-body); font-weight: 700; font-size: 15px; background: #0b1622; color: #fff; border: 1px solid var(--panel-border); padding: 6px 8px; }
.settings { display: grid; grid-template-columns: 1fr; gap: 14px; background: var(--panel); border: 1px solid var(--panel-border); padding: 20px 28px; min-width: 420px; }
.settings label { justify-content: space-between; font-size: 17px; }
.settings input[type=range] { width: 200px; accent-color: var(--accent); }
.settings input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.help { display: flex; gap: 30px; max-width: 1000px; background: var(--panel); border: 1px solid var(--panel-border); padding: 18px 26px; max-height: 70vh; overflow-y: auto; }
.help > div { flex: 1; }
.help h3 { font-family: var(--font-display); color: var(--accent2); font-size: 15px; margin: 10px 0 4px; }
.help p { font-size: 16px; line-height: 1.4; margin: 0 0 6px; }
.help table { border-collapse: collapse; font-size: 16px; }
.help td { padding: 4px 10px 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.brief { max-width: 760px; font-size: 19px; line-height: 1.5; text-align: center; background: var(--panel); border: 1px solid var(--panel-border); padding: 18px 26px; }
.brief .obj { color: var(--accent2); margin-top: 10px; font-weight: 700; }
.click { margin-top: 26px; font-family: var(--font-display); letter-spacing: 3px; color: var(--accent); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.stats { display: grid; grid-template-columns: auto auto; gap: 6px 40px; font-size: 19px; background: var(--panel); border: 1px solid var(--panel-border); padding: 18px 30px; margin-bottom: 20px; }
.stats .v { color: #fff; font-weight: 700; text-align: right; }
.stats .rank { grid-column: 1 / 3; text-align: center; font-family: var(--font-display); font-size: 40px; color: var(--accent2); margin-top: 8px; }
.loading { font-family: var(--font-display); letter-spacing: 4px; color: var(--accent); animation: blink 1s infinite; }
#endTitle.win { color: var(--ok); }
#endTitle.lose { color: var(--enemy); }

@media (max-width: 760px) {
  .split { flex-direction: column; height: auto; }
  .list { width: 100%; max-height: 30vh; }
  .help { flex-direction: column; }
  .settings { min-width: 0; width: 100%; }
}

/* Credits & License screen, platform links */
.about { max-width: 820px; max-height: 62vh; overflow-y: auto; text-align: left; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 4px; padding: 18px 24px; font-size: 16px; line-height: 1.5; user-select: text; }
.about h3 { font-family: var(--font-display); color: var(--accent2); font-size: 15px; letter-spacing: 1px; margin: 14px 0 6px; }
.about h3:first-child { margin-top: 0; }
.about p { margin: 0 0 8px; }
.about a, .foot a { color: var(--accent); }
.about code { color: var(--accent2); }
