/* Martian Civil War — UI shell. The game itself is drawn on <canvas>. */

:root {
  --ink: #f6ece1;
  --ink-dim: #b6a092;
  --panel: #24140f;
  --panel-2: #311d16;
  --line: #4d2f24;
  --gold: #f0b04a;          /* UI accent: lamp amber */
  --gold-deep: #c47a1c;
  --stone: #9d8f86;
  --danger: #e2634a;
  --good: #9fd93a;
  --faction: #c9503a;       /* overridden by the house you pick */
  --faction-dark: #8a2e1f;
  --shadow: 0 18px 50px rgba(0, 0, 0, .6);
  --font: "Trebuchet MS", "Gill Sans", "Avenir Next", system-ui, sans-serif;
}

body[data-faction="red"]   { --faction: #c9503a; --faction-dark: #8a2e1f; }
body[data-faction="green"] { --faction: #63a052; --faction-dark: #3b6a32; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #150b08;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app { position: relative; width: 100vw; height: 100vh; height: 100dvh; }

#stage { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

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

#hud {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  pointer-events: none;
}

#hud > * { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.hud-mid { flex: 1; justify-content: center; }

.level-tag { display: flex; flex-direction: column; line-height: 1.15; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
#hud-level { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
#hud-name { font-size: 17px; font-weight: 700; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 17px;
  color: var(--ink);
  background: rgba(28, 17, 13, .93);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  /* no backdrop-filter: this sits over the LIVE canvas, and blurring a
     moving backdrop flashes whenever a child transforms on hover */
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: rgba(60, 36, 27, .97); border-color: var(--gold-deep); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(.95); }

.score-box {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1;
  padding: 3px 12px; border-radius: 11px;
  background: rgba(28, 17, 13, .93);
  border: 1px solid var(--line);
  /* no backdrop-filter: this sits over the LIVE canvas, and blurring a
     moving backdrop flashes whenever a child transforms on hover */
  min-width: 92px;
}
.score-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
#hud-score { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--faction); }

/* Ammo queue */
.ammo-rack {
  display: flex; gap: 7px; align-items: center;
  padding: 7px 11px; border-radius: 13px;
  background: rgba(28, 17, 13, .93);
  border: 1px solid var(--line);
  /* no backdrop-filter: this sits over the LIVE canvas, and blurring a
     moving backdrop flashes whenever a child transforms on hover */
}
.ammo {
  position: relative;
  width: 32px; height: 32px; border-radius: 50%;
  padding: 0; font: inherit; cursor: pointer; color: var(--ink);
  display: grid; place-items: center;
  font-size: 15px;
  background: #3b241c;
  border: 2px solid #58382b;
  transition: transform .18s cubic-bezier(.3,1.5,.5,1), opacity .2s, filter .2s;
}
.ammo.current {
  border-color: var(--faction);
  box-shadow: 0 0 0 3px rgba(240, 176, 74, .18), 0 4px 14px rgba(240, 176, 74, .3);
  transform: scale(1.22);
}
.ammo:hover { border-color: var(--faction); transform: translateY(-1px); }
.ammo-name {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-dim); padding-left: 5px; min-width: 66px;
}

/* Targets still standing */
.target-counter {
  position: absolute; top: 66px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; align-items: center;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(28, 17, 13, .92);
  border: 1px solid var(--line);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim);
  /* no backdrop-filter: this sits over the LIVE canvas, and blurring a
     moving backdrop flashes whenever a child transforms on hover */
  pointer-events: none;
}
.target-counter b { color: var(--ink); font-size: 14px; }

/* Hint bubble */
.hint {
  position: absolute; left: 50%; bottom: 42px; transform: translateX(-50%);
  padding: 9px 18px; border-radius: 999px;
  background: rgba(28, 17, 13, .94);
  border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-dim);
  /* no backdrop-filter: this sits over the LIVE canvas, and blurring a
     moving backdrop flashes whenever a child transforms on hover */
  pointer-events: none;
  transition: opacity .4s ease;
}
.hint.gone { opacity: 0; }

/* ---------- Overlays ---------- */

.overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 20px;
  /* A solid scrim rather than a frosted one. Panel cards lift on hover, and
     transforming a child inside a backdrop-filtered container makes the
     browser re-composite the blur — which reads as a glitchy flash. Nothing in
     this game is worth that. */
  background: rgba(12, 7, 5, .90);
  z-index: 10;
  animation: fade .22s ease;
}
.overlay.hidden { display: none; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.panel {
  width: min(430px, 100%);
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop .28s cubic-bezier(.2, 1.3, .5, 1);
}
.panel.wide { width: min(880px, 100%); text-align: left; }
@keyframes pop { from { transform: translateY(14px) scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }

.panel h2 { margin: 0 0 4px; font-size: 27px; letter-spacing: -.01em; }
.panel .sub { margin: 0; color: var(--ink-dim); font-size: 13px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.panel-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}
.legend { font-size: 11px; color: var(--ink-dim); }
.legend b { color: var(--gold); font-weight: 700; }

.stars { display: flex; justify-content: center; gap: 9px; margin: 14px 0 18px; }
.star {
  font-size: 40px; line-height: 1; color: #45302a;
  transition: transform .3s cubic-bezier(.2,1.6,.4,1), color .3s;
}
.star.on { color: var(--gold); text-shadow: 0 0 22px rgba(245, 196, 81, .55); }
.star.pop { animation: starPop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes starPop { 0% { transform: scale(0) rotate(-40deg) } 70% { transform: scale(1.35) rotate(6deg) } 100% { transform: scale(1) } }

.result-rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; font-size: 14px; }
.result-rows .row { display: flex; justify-content: space-between; color: var(--ink-dim); }
.result-rows .row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.result-rows .total { padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.result-rows .total b { color: var(--gold); font-size: 18px; }
.result-rows .best b { color: var(--ink-dim); }
.result-msg { margin: 0 0 18px; font-size: 13px; color: var(--ink-dim); min-height: 17px; }

.panel-actions { display: flex; gap: 10px; justify-content: center; }

.btn {
  padding: 11px 22px;
  font: inherit; font-weight: 700; font-size: 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink);
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-color: var(--gold-deep); color: #2a1e05;
}
.btn.ghost { background: transparent; }
.btn.big { padding: 15px 40px; font-size: 17px; }
.btn.tiny { padding: 6px 12px; font-size: 11px; color: var(--ink-dim); }

/* Level select grid */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  max-height: min(52vh, 430px);
  overflow-y: auto;
  padding-right: 4px;
}
.level-card {
  position: relative;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  color: inherit; font: inherit;
  transition: transform .14s ease, border-color .15s ease, background .15s ease;
}
.level-card:hover:not(.locked) { transform: translateY(-3px); border-color: var(--gold-deep); background: var(--panel-2); }
.level-card .n { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.level-card .t { display: block; font-size: 14px; font-weight: 700; margin: 3px 0 8px; }
.level-card .s { font-size: 14px; letter-spacing: 2px; color: #45302a; }
.level-card .s .on { color: var(--gold); }
.level-card.locked { opacity: .42; cursor: not-allowed; }
.level-card.locked::after { content: "🔒"; position: absolute; top: 11px; right: 12px; font-size: 13px; }
.level-card.cleared { border-color: rgba(240, 176, 74, .34); }

/* Title */
.title-card { text-align: center; animation: pop .4s cubic-bezier(.2, 1.3, .5, 1); }
.title-card h1 {
  margin: 0; font-size: clamp(46px, 11vw, 92px); line-height: .92; letter-spacing: -.03em;
  text-transform: uppercase; font-weight: 800;
  background: linear-gradient(180deg, #ffe9c6, #e8843c 52%, #a83a22);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 30px rgba(200, 80, 40, .4));
}
.title-card h1 span { display: block; color: transparent; }
.eyebrow { margin: 0 0 10px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: #a07a5e; }
.tagline { margin: 14px 0 28px; color: var(--ink-dim); font-size: 15px; }
.credit { margin: 22px 0 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8a7264; }

/* Scrollbar */
.level-grid::-webkit-scrollbar { width: 8px; }
.level-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

@media (max-width: 720px) {
  #hud { padding: 10px; }
  #hud-name { font-size: 14px; }
  .ammo-rack { padding: 5px 8px; gap: 5px; }
  .ammo { width: 25px; height: 25px; font-size: 12px; }
  .ammo-name { display: none; }
  .score-box { min-width: 70px; }
  .target-counter { top: 58px; font-size: 11px; }
  .panel { padding: 22px; }
}


/* ---------- house select ---------- */

.faction-picker {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.faction-card {
  --c: var(--faction);
  width: min(260px, 88vw);
  padding: 20px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(58,34,26,.9), rgba(28,16,12,.95));
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform .16s ease, border-color .18s ease, box-shadow .18s ease;
}
.faction-card.red   { --c: #c9503a; }
.faction-card.green { --c: #63a052; }
.faction-card:hover {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px var(--c) inset;
}
.faction-card .crest {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 25px;
  background: var(--c);
  color: #1c0f0b;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.faction-card .fname { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.faction-card .fblurb { font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); }
.faction-card .pick {
  margin-top: 6px; padding: 7px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  background: var(--c); color: #1c0f0b;
}
.faction-card.chosen { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }

.foot-actions { display: flex; gap: 8px; }
#house-name { color: var(--faction); }

@media (max-width: 720px) {
  .faction-card { padding: 14px; }
  .faction-card .fblurb { display: none; }
}


/* ---------- firing solution readout ---------- */

.readout {
  position: absolute; top: 66px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px; align-items: stretch;
  padding: 4px; border-radius: 12px;
  background: rgba(28, 17, 13, .93);
  border: 1px solid var(--line);
  /* no backdrop-filter: this sits over the LIVE canvas, and blurring a
     moving backdrop flashes whenever a child transforms on hover */
  pointer-events: none;
}
.readout .ro {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 74px; padding: 3px 10px;
  border-right: 1px solid var(--line);
}
.readout .ro:last-child { border-right: 0; }
.readout .ro b {
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.readout .ro i {
  font-style: normal; font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-dim);
}
.readout .wind b { color: #8fd0ff; }

/* ---------- armory ---------- */

.weapon-shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 11px;
  max-height: min(56vh, 460px);
  overflow-y: auto;
  padding-right: 4px;
}
.weapon-shop::-webkit-scrollbar { width: 8px; }
.weapon-shop::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.shop-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.shop-card.owned { border-color: rgba(240, 176, 74, .38); }
.shop-card.locked { opacity: .5; }
.shop-icon {
  flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 19px;
  background: #3b241c; border: 2px solid #58382b;
}
.shop-card.owned .shop-icon { border-color: var(--gold); }
.shop-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.shop-name { font-size: 14px; font-weight: 700; }
.shop-blurb { font-size: 11.5px; line-height: 1.4; color: var(--ink-dim); }
.shop-stats {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #8a7264;
}
.shop-stats em { font-style: normal; color: var(--gold); font-weight: 700; }
.shop-card .btn { flex: 0 0 auto; white-space: nowrap; }
.shop-card .btn:disabled { cursor: default; transform: none; }

.result-rows .credit b { color: var(--good); }

@media (max-width: 720px) {
  .readout { top: 58px; }
  .readout .ro { min-width: 58px; padding: 2px 6px; }
  .readout .ro b { font-size: 13px; }
  .weapon-shop { grid-template-columns: 1fr; }
}


/* fuel gauge in the firing readout */
.readout .fuel { position: relative; }
.readout .fuel b { color: var(--good); }
.fuel-bar {
  position: absolute; left: 8px; right: 8px; bottom: 2px;
  height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.fuel-bar > span {
  display: block; height: 100%; width: 100%;
  background: var(--good);
  transition: width .12s linear;
}


/* which build is loaded — a stale cached page otherwise looks like a bug */
.build {
  display: inline-block;
  margin: 10px 0 0;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: #6f5a4c;
}
.panel-foot .build { margin: 0 10px 0 0; color: #6f5a4c; }


/* arsenal readout + armory sections */
.ammo.module { border-color: #4c6b3a; background: #2b3a22; }
.rack-split {
  width: 1px; height: 20px; margin: 0 3px;
  background: var(--line);
}
.shop-section {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: 9px;
  margin: 6px 0 -2px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
}
.shop-section i {
  font-style: normal; letter-spacing: .06em; text-transform: none;
  font-size: 11px; color: var(--ink-dim); font-weight: 400;
}


/* firing rack: armed vs held-back mounts */
.ammo { position: relative; }
.ammo > i {
  position: absolute; bottom: -3px; right: -3px;
  font-style: normal; font-size: 8px; font-weight: 700;
  padding: 1px 3px; border-radius: 5px;
  background: #1b1113; color: var(--ink-dim);
  border: 1px solid var(--line);
}
.ammo:not(.current) { opacity: .46; filter: grayscale(.6); }
.ammo.current > i { background: var(--faction); color: #1c0f0b; border-color: transparent; }
.ammo.over { opacity: .22; cursor: not-allowed; }
.ammo.module { opacity: 1; filter: none; }


/* ---------- arming the volley ---------- */

.fp-meter { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fp-bar {
  flex: 1; height: 12px; border-radius: 7px;
  background: rgba(0,0,0,.42);
  border: 1px solid var(--line);
  overflow: hidden;
}
.fp-bar > span { display: block; height: 100%; width: 0; background: var(--good); transition: width .16s ease, background .16s ease; }
.fp-label { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.fp-label b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }

.arming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 9px;
  max-height: min(46vh, 380px);
  overflow-y: auto;
  padding-right: 4px;
}
.arming-grid::-webkit-scrollbar { width: 8px; }
.arming-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.arm-card {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: inherit; font: inherit; text-align: left;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, opacity .15s;
}
.arm-card:hover { transform: translateY(-2px); }
.arm-card.armed { border-color: var(--faction); background: var(--panel-2); box-shadow: 0 0 0 1px var(--faction) inset; }
.arm-card.unaffordable { opacity: .38; cursor: not-allowed; }
.arm-card.unaffordable:hover { transform: none; }

.arm-key {
  position: absolute; top: 6px; right: 8px;
  font-size: 9px; color: #6f5a4c; font-weight: 700;
}
.arm-icon { font-size: 20px; width: 26px; text-align: center; }
.arm-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.arm-body b { font-size: 13px; }
.arm-body i { font-style: normal; font-size: 11px; color: var(--gold); }
.arm-body em {
  font-style: normal; font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: #8a7264;
}
.arm-fp {
  font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}
.arm-card.armed .arm-fp { color: var(--faction); }
.arm-fp small { display: block; font-size: 8px; letter-spacing: .1em; }

.arming-fitted {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line);
}
.fitted-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
.fitted-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #2b3a22; border: 1px solid #4c6b3a; color: #cfe6b4;
}


/* ---------- fire bar: laying each gun, then letting fly ---------- */

.firebar {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 14px;
  background: rgba(28, 17, 13, .95);
  border: 1px solid var(--line);
  /* no backdrop-filter: this sits over the LIVE canvas, and blurring a
     moving backdrop flashes whenever a child transforms on hover */
  box-shadow: 0 14px 36px rgba(0,0,0,.45);
}
.firebar.hidden { display: none; }
.fb-mounts { display: flex; gap: 5px; }
.fb-mount {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 16px; color: var(--ink);
  background: #2b1b16; border: 2px solid #4a3129;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.fb-mount:hover { transform: translateY(-2px); }
.fb-mount.active {
  border-color: var(--tracer, var(--gold));
  box-shadow: 0 0 0 2px rgba(255,255,255,.06) inset, 0 0 14px -2px var(--tracer, var(--gold));
  transform: translateY(-2px);
}
.fb-step {
  width: 28px; height: 34px; border-radius: 9px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-dim); font-size: 16px; cursor: pointer;
}
.fb-step:hover { color: var(--ink); border-color: var(--gold-deep); }
.fb-fire { padding: 9px 18px; font-size: 13px; letter-spacing: .08em; }
.readout .mount b { color: var(--gold); font-size: 12px; }

@media (max-width: 720px) {
  .firebar { bottom: 12px; padding: 6px; gap: 5px; }
  .fb-mount { width: 28px; height: 28px; font-size: 13px; }
  .fb-fire { padding: 7px 12px; font-size: 11px; }
}


/* ---------- keyboard reference + keyboard cursor ---------- */

.keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.keys-col h3 {
  margin: 0 0 8px; font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
}
.keys-col h3:not(:first-child) { margin-top: 16px; }
.keys-col dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: baseline; }
.keys-col dt { white-space: nowrap; }
.keys-col dd { margin: 0; font-size: 12px; color: var(--ink-dim); line-height: 1.35; }
kbd {
  display: inline-block; min-width: 20px; padding: 2px 6px; margin-right: 2px;
  font: 700 11px/1.4 var(--font);
  text-align: center; color: var(--ink);
  background: #2f1d17; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px;
}

/* the shared keyboard cursor: whatever is highlighted, Enter takes */
.kb-focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 12px;
}


/* ---------- shield placement ---------- */

.arming-split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.arming-left { min-width: 0; }
.shield-head {
  margin: 0 0 8px; font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
}
.shield-head i {
  font-style: normal; letter-spacing: .04em; text-transform: none;
  color: var(--ink-dim); font-weight: 400; margin-left: 6px;
}
.shield-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.shield-cell {
  position: relative;
  aspect-ratio: 1 / .72;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 4px;
  border-radius: 9px;
  background: #26170f;
  border: 1px solid var(--line);
  color: var(--ink); font: inherit;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.shield-cell:hover { background: #331f14; }
.shield-cell.weak { border-color: #a8412c; background: #33150f; }
.shield-cell.weak::after {
  content: "!"; position: absolute; top: 3px; right: 6px;
  font-size: 10px; font-weight: 700; color: #ff8a5c;
}
.shield-cell.has-plate { border-color: #9a8b74; }
.shield-cell.has-screen { border-color: #6aa8cc; }
.sc-icon { font-size: 15px; line-height: 1; min-height: 15px; }
.sc-name { font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-dim); text-align: center; }
.sc-bar { display: block; width: 78%; height: 3px; border-radius: 2px; background: rgba(0,0,0,.45); overflow: hidden; }
.sc-bar > i { display: block; height: 100%; background: var(--good); }
.shield-cell.has-plate .sc-bar > i { background: #c9a58a; }
.shield-cell.has-screen .sc-bar > i { background: #8fd0ff; }

.shield-stock { display: flex; gap: 8px; margin-top: 9px; }
.stock-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #2b1b16; border: 1px solid var(--line); color: var(--ink-dim);
}
.stock-chip b { color: var(--ink); }
.shield-note { margin: 9px 0 0; font-size: 10.5px; line-height: 1.45; color: #8a7264; }

@media (max-width: 780px) { .arming-split { grid-template-columns: 1fr; } }


/* owning more than one of a gun */
.shop-icon { position: relative; }
.shop-icon .copies {
  position: absolute; bottom: -3px; right: -6px;
  font-style: normal; font-size: 9px; font-weight: 700;
  padding: 1px 4px; border-radius: 7px;
  background: var(--gold); color: #241409;
}
.shop-name .have { color: var(--gold); font-size: 12px; }
