/* Boomlet — same TOKEHUNT palette as the rest of the concept lab. */

:root {
  --navy: #04101d;
  --panel: #081a2e;
  --panel-edge: #14374f;
  --cyan: #3fd9ff;
  --cyan-dim: #8fb3c7;
  --lime: #b8f235;
  --danger: #ff5470;
  --gold: #ffe14d;
  --font: "Courier New", ui-monospace, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: #dff3ff;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: .06em;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#gameShell { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ HUD --- */

#hud {
  position: absolute;
  top: calc(6px + env(safe-area-inset-top));
  left: 8px; right: 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: start;
  pointer-events: none;
  text-transform: uppercase;
}
.teamHud {
  background: rgba(8,26,46,.82);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 5px 7px 6px;
  min-width: 0;
}
.teamHud small { display: block; font-size: 8.5px; color: var(--cyan-dim); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teamHud.foe { text-align: right; }
.unitRow { display: grid; grid-template-columns: auto 1fr; gap: 5px; align-items: center; margin-top: 2px; min-width: 0; }
.teamHud.foe .unitRow { grid-template-columns: 1fr auto; }
.uName { font-size: 8px; color: #dff3ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 74px; }
.uName.dead { color: var(--cyan-dim); text-decoration: line-through; }
.uName.active { color: var(--lime); }

.bar { position: relative; height: 8px; border-radius: 4px; background: #0a2036; border: 1px solid var(--panel-edge); overflow: hidden; min-width: 34px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; width: 100%; transition: width .3s ease; }
.bar.hp i { background: linear-gradient(90deg, #6fb52a, var(--lime)); }
.bar.hp.foeBar i { left: auto; right: 0; background: linear-gradient(90deg, #c23, var(--danger)); }

.midHud { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.chip {
  background: rgba(8,26,46,.82);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 9.5px;
  color: var(--gold);
  white-space: nowrap;
}
.windChip span { color: var(--cyan-dim); margin-right: 5px; font-size: 8px; }
.windChip b { color: var(--gold); letter-spacing: .04em; }
.bar.timer { width: 100%; height: 5px; }
.bar.timer i { background: var(--cyan); transition: none; }
.bar.timer i.low { background: var(--danger); }

/* ------------------------------------------------------------- controls --- */

#controls {
  position: absolute;
  left: 10px; right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  pointer-events: none;
}
#controls button { pointer-events: auto; }

.movePad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.movePad button {
  font: inherit; font-size: 20px;
  width: 46px; height: 52px;
  color: var(--cyan);
  background: rgba(8,26,46,.85);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  cursor: pointer;
  touch-action: none;
}
.movePad button:active { background: rgba(20,55,79,.9); color: var(--lime); }
.movePad button:disabled { filter: grayscale(.7) brightness(.55); }
.bar.move { grid-column: 1 / -1; height: 4px; margin-top: 2px; }
.bar.move i { background: var(--lime); transition: none; }

#aimHint {
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  margin-bottom: 6px;
  align-self: end;
  text-align: center;
  font-size: 8.5px;
  color: var(--cyan-dim);
  letter-spacing: .14em;
  text-transform: uppercase;
  padding-bottom: 4px;
  text-shadow: 0 0 6px rgba(4,16,29,.9);
}

.weaponPad { display: flex; gap: 6px; }
.weaponPad button {
  position: relative;
  font: inherit;
  width: 54px; height: 54px;
  background: rgba(8,26,46,.85);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  cursor: pointer;
  touch-action: none;
}
.weaponPad button b { display: block; font-size: 22px; font-weight: 400; }
.weaponPad button small { position: absolute; top: 3px; right: 6px; font-size: 8px; color: var(--cyan-dim); }
.weaponPad button.selected { border-color: var(--lime); box-shadow: 0 0 12px rgba(184,242,53,.3); }
.weaponPad button:disabled { filter: grayscale(.7) brightness(.55); cursor: default; }

/* ------------------------------------------------------------- overlays --- */

.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(2,8,16,.78);
  z-index: 5;
}

.panel {
  width: min(360px, 100%);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  padding: 22px 20px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), inset 0 0 40px rgba(63,217,255,.04);
  text-transform: uppercase;
}

h1 { font-size: 38px; line-height: 1; color: var(--cyan); text-shadow: 0 0 18px rgba(63,217,255,.6); }
h1 span { color: var(--danger); text-shadow: 0 0 18px rgba(255,84,112,.55); }
h2 { font-size: 18px; color: var(--cyan); text-shadow: 0 0 14px rgba(63,217,255,.55); margin-bottom: 6px; }
.tagline { margin: 8px 0 10px; font-size: 11px; color: var(--cyan-dim); letter-spacing: .28em; }
.lore { font-size: 10px; color: var(--cyan-dim); line-height: 1.6; margin-bottom: 12px; text-transform: none; }
.howLine { font-size: 9.5px; color: var(--cyan-dim); margin-bottom: 10px; }

.howList { list-style: none; text-align: left; margin-bottom: 14px; }
.howList li { font-size: 10px; color: var(--cyan-dim); padding: 3.5px 0; }
.howList b { color: var(--cyan); margin-right: 6px; }
.howList b.good { color: var(--lime); }
.howList b.bad { color: var(--gold); }

.traineeRow { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.traineeCard { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 7px 10px 9px; }
.traineeCard span { display: block; font-size: 9px; color: var(--cyan-dim); }
.traineeCard strong { display: block; font-size: 14px; color: var(--cyan); margin-top: 2px; }
.arrowBtn {
  font: inherit; font-size: 15px;
  color: var(--lime);
  background: rgba(4,16,29,.7);
  border: 1px solid var(--panel-edge); border-radius: 12px;
  padding: 0 14px;
  cursor: pointer;
}
.arrowBtn:active { background: rgba(20,55,79,.7); }

.bestCard { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 9px 12px 11px; margin-bottom: 16px; }
.bestCard span { font-size: 10px; color: var(--cyan-dim); }
.bestCard strong { display: block; font-size: 27px; color: var(--cyan); text-shadow: 0 0 14px rgba(63,217,255,.5); }
.bestCard small { font-size: 10px; color: var(--lime); }

.primaryBtn {
  width: 100%;
  font: inherit; letter-spacing: .14em; text-transform: uppercase;
  font-size: 17px;
  color: #0c2405;
  background: linear-gradient(180deg, #96dd3f, #7dc832);
  border: 0; border-radius: 12px;
  padding: 14px 0;
  box-shadow: 0 5px 0 #47761a, 0 10px 24px rgba(125,200,50,.35);
  cursor: pointer;
}
.primaryBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #47761a; }
.primaryBtn:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; cursor: default; }

.secondaryBtn {
  font: inherit; letter-spacing: .12em; text-transform: uppercase;
  font-size: 12px;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--panel-edge); border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
}

/* -------------------------------------------------------------- results --- */

.compactPanel { padding: 18px 18px 16px; }
.scoreLine { font-size: 38px; color: var(--cyan); text-shadow: 0 0 16px rgba(63,217,255,.55); margin-bottom: 6px; }

.gradeBadge {
  width: 58px; height: 58px; line-height: 56px;
  margin: 0 auto 10px;
  font-size: 30px;
  color: #0c2405;
  background: linear-gradient(180deg, #96dd3f, #7dc832);
  border-radius: 14px;
  box-shadow: 0 0 22px rgba(184,242,53,.45);
}

.resultGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.resultGrid div { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 7px 4px; }
.resultGrid small { display: block; font-size: 9px; color: var(--cyan-dim); }
.resultGrid strong { font-size: 15px; color: var(--cyan); }

.newBest { color: var(--lime); font-size: 13px; margin-bottom: 6px; animation: flash .6s steps(2) infinite; }
.retryHint { font-size: 10px; color: var(--cyan-dim); letter-spacing: .18em; margin-bottom: 12px; }
@keyframes flash { 50% { filter: brightness(1.6); } }
