/* =============================================================================
   style.css - HUD, overlays, loader/splash/help for the tank simulator.
   Deliberately looks like stencilled military instrumentation.
   ========================================================================== */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: #0b0d0c; overflow: hidden;
  font-family: "Consolas", "DejaVu Sans Mono", "Microsoft YaHei", monospace;
  color: #d8d3c2; user-select: none; -webkit-user-select: none;
}
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* ------------------------------------------------------------- overlays --- */
.overlay { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s linear; }
#fumes { background: radial-gradient(ellipse at 50% 55%, rgba(150,135,90,.55), rgba(90,80,50,.75) 80%); mix-blend-mode: screen; }
#fireOverlay { background: radial-gradient(ellipse at 50% 110%, rgba(255,90,20,.75), rgba(120,20,0,0) 65%); }
#flash { background: #fff7e0; transition: opacity .08s linear; }

#maskPeri {
  background:
    radial-gradient(ellipse 46% 30% at 50% 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,.97) 78%),
    linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.25));
  opacity: 1;
}

#reticle { position: fixed; inset: 0; pointer-events: none; }
#reticle canvas {
  position: absolute; left: 50%; top: 50%;
  width: min(86vh, 86vw); height: min(86vh, 86vw);
  transform: translate(-50%, -50%);
  opacity: .92;
}
#reticle::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 41%, rgba(0,0,0,.99) 47%);
}
#zoomLabel {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  color: #9ab08c; font-size: 15px; letter-spacing: 2px; text-shadow: 0 0 6px #000;
}
#crosshair {
  position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: rgba(255,240,200,.85); box-shadow: 0 0 6px #000; pointer-events: none;
}

/* ------------------------------------------------------------------ hud --- */
#hud { position: fixed; inset: 0; pointer-events: none; font-size: 12px; }
.panel {
  position: absolute; background: rgba(14,18,15,.72);
  border: 1px solid rgba(150,160,130,.28); border-radius: 3px;
  padding: 7px 9px; backdrop-filter: blur(2px);
  box-shadow: 0 2px 14px rgba(0,0,0,.5);
}
.panel .row.head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid rgba(150,160,130,.25); padding-bottom: 4px; margin-bottom: 6px;
  letter-spacing: 1px;
}
.panel .row.head span { color: #e8e2cf; font-weight: bold; font-size: 13px; }
.panel .row.head em { color: #8d9a7c; font-style: normal; font-size: 10px; }
.panel .grid { display: grid; grid-template-columns: auto auto; gap: 2px 14px; }
.panel .grid > div { display: flex; justify-content: space-between; gap: 10px; }
.panel label { color: #8d9a7c; font-size: 10px; }
.panel .grid span { color: #ded8c6; }
.panel .grid span.ok { color: #9fd07a; }
.panel .grid span.warn { color: #e0bb55; }
.panel .grid span.bad { color: #e07a5f; }
.bar { height: 3px; background: rgba(255,255,255,.09); margin: 0 0 6px; border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fa05c, #d8c04a 70%, #d05a3a); }

#statusPanel { left: 12px; top: 12px; width: 268px; }
#gunPanel { right: 12px; top: 12px; width: 250px; }

#checklist { left: 12px; top: 218px; width: 268px; }
#checklist h3 { margin: 0 0 6px; font-size: 11px; color: #a9b894; letter-spacing: 1px; font-weight: normal; }
#checklist ul { list-style: none; margin: 0; padding: 0; }
#checklist li { color: #b9b3a2; padding: 1px 0 1px 2px; font-size: 11px; line-height: 1.45; }
#checklist li .tick { display: inline-block; width: 15px; color: #7d8a6d; }
#checklist li.done { color: #7f8a72; text-decoration: line-through; }
#checklist li.done .tick { color: #9fd07a; }

#log {
  position: absolute; right: 12px; bottom: 64px; width: 380px; text-align: right;
  font-size: 11.5px; line-height: 1.6; text-shadow: 0 1px 3px #000;
}
#log div { color: #c9c3b0; }
#log div.ok { color: #a8d883; }
#log div.warn { color: #e8bb5a; }
#log div.radio { color: #7fc6d8; font-style: italic; }

#tip {
  position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%);
  min-width: 260px; max-width: 520px; text-align: center;
  background: rgba(12,16,13,.86); border: 1px solid rgba(160,175,140,.35);
  border-radius: 3px; padding: 7px 14px; box-shadow: 0 3px 18px rgba(0,0,0,.6);
}
#tip b { color: #f0ead6; letter-spacing: 1px; font-size: 12.5px; }
#tip .val { color: #a8d883; margin-left: 10px; }
#tip .key {
  margin-left: 10px; color: #d9c46a; border: 1px solid rgba(217,196,106,.5);
  border-radius: 2px; padding: 0 5px; font-size: 10.5px;
}
#tip .sub { color: #9aa48c; font-size: 10.5px; margin-top: 3px; }

#hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  color: #8c9480; font-size: 11px; text-shadow: 0 1px 3px #000;
}
#hint b { color: #d9c46a; }

/* --------------------------------------------------- loader/splash/help --- */
#loader, #splash, #help {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1a1f1b, #070908 75%);
}
#splash { background: radial-gradient(ellipse at 50% 40%, rgba(24,30,25,.92), rgba(5,7,6,.97) 75%); cursor: pointer; }
#help { background: rgba(6,8,7,.93); z-index: 30; overflow: auto; }
.box { max-width: 940px; padding: 26px 34px; text-align: center; }
.box h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: 6px; color: #e9e3cf; font-weight: 600; }
.box h2 { margin: 0 0 22px; font-size: 12px; letter-spacing: 4px; color: #8b9779; font-weight: normal; }
.box p { color: #b6b0a0; line-height: 1.8; font-size: 13px; }
.box .lead { max-width: 700px; margin: 0 auto 26px; }
.box .go { color: #d9c46a; letter-spacing: 3px; font-size: 15px; animation: pulse 1.8s infinite; }
.box .tiny { color: #6f7a66; font-size: 11px; margin-top: 20px; }
@keyframes pulse { 0%,100% { opacity: .45 } 50% { opacity: 1 } }
.spinner {
  width: 34px; height: 34px; margin: 8px auto 14px; border: 2px solid rgba(200,210,180,.2);
  border-top-color: #cdd6b4; border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.err { color: #e08a6a; max-width: 700px; text-align: left; }
.err pre { white-space: pre-wrap; font-size: 11px; color: #b9a08c; }

#help .box { text-align: left; max-width: 1080px; }
#help h1 { text-align: center; font-size: 20px; letter-spacing: 4px; margin-bottom: 18px; }
#help .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 34px; }
#help section { margin-bottom: 14px; }
#help h3 {
  color: #d9c46a; font-size: 12px; letter-spacing: 2px; margin: 0 0 6px;
  border-bottom: 1px solid rgba(217,196,106,.28); padding-bottom: 3px; font-weight: normal;
}
#help table { border-collapse: collapse; width: 100%; }
#help td { padding: 2px 6px; font-size: 11.5px; color: #b6b0a0; vertical-align: top; }
#help td:first-child { color: #e0dbc8; width: 118px; white-space: nowrap; }
#help .foot { color: #8c9480; font-size: 11.5px; margin-top: 12px; border-top: 1px solid rgba(150,160,130,.2); padding-top: 10px; }
#helpClose {
  float: right; background: rgba(30,36,30,.9); color: #d8d3c2; font-family: inherit; font-size: 11px;
  border: 1px solid rgba(160,175,140,.4); border-radius: 2px; padding: 4px 10px; cursor: pointer;
}
#helpClose:hover { background: rgba(60,70,55,.9); }

@media (max-width: 1100px) {
  #checklist { display: none; }
  #help .cols { grid-template-columns: 1fr; }
}
