:root {
  --lime: #9dff4a;
  --blood: #ff4d3a;
  --amber: #ffc14a;
  --muted: #8aa094;
  --text: #e8f0ea;
  --panel: rgba(10, 16, 14, 0.82);
  --line: #2d3b34;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050807;
  color: var(--text);
  font-family: "Share Tech Mono", ui-monospace, monospace;
}

canvas {
  display: block;
}

#blocker {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: stretch;
  padding: clamp(0.75rem, 2vh, 1.25rem) clamp(0.85rem, 2vw, 1.5rem);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(157, 255, 74, 0.12), transparent 42%),
    radial-gradient(ellipse at 85% 80%, rgba(255, 77, 58, 0.12), transparent 40%),
    linear-gradient(160deg, rgba(5, 8, 7, 0.72), rgba(5, 8, 7, 0.92)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(157, 255, 74, 0.015) 3px,
      rgba(157, 255, 74, 0.015) 4px
    );
  z-index: 10;
}

#blocker.hidden {
  display: none;
}

.home-shell {
  width: min(1040px, 100%);
  max-height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 0;
}

.home-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1.25rem;
  align-items: end;
  flex-shrink: 0;
}

.home-brand {
  text-align: left;
  min-width: 0;
}

.home-topbar-meta {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
  align-content: end;
}

.home-hint {
  margin: 0;
  text-align: right;
  max-width: 16rem;
  font-size: 0.68rem;
  line-height: 1.35;
}

.eyebrow {
  color: var(--lime);
  letter-spacing: 0.28em;
  font-size: 0.68rem;
  margin-bottom: 0.35rem;
}

h1 {
  font-family: Anton, Impact, sans-serif;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 0.9;
  margin-bottom: 0.35rem;
  text-shadow: 0 0 40px rgba(157, 255, 74, 0.22);
}

.tagline {
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.4;
  font-size: 0.8rem;
}

.menu-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
}

.menu-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  min-height: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition:
    opacity 160ms ease,
    transform 180ms ease;
  visibility: hidden;
}

.menu-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
  z-index: 1;
}

.menu-panel[hidden] {
  display: none !important;
}

.menu-panel.is-active:not([hidden]) {
  display: grid;
}

.hub-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hub-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(10, 16, 14, 0.75);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.hub-chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.hub-chip strong {
  color: var(--lime);
  font-weight: 400;
  font-family: Anton, Impact, sans-serif;
  letter-spacing: 0.04em;
}

.menu-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.1rem;
  align-content: start;
}

.menu-nav-btn {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.menu-nav-btn:hover {
  border-color: #5f8f3a;
  transform: translateY(-2px);
}

.menu-nav-btn:active {
  transform: translateY(0);
}

.menu-nav-kicker {
  color: var(--lime);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.menu-nav-title {
  font-family: Anton, Impact, sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  line-height: 1;
}

.menu-nav-desc {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.hub-deploy {
  flex-shrink: 0;
}

.pwa-tip {
  margin: 0.45rem 0 0;
  color: #5f7368;
  font-size: 0.68rem;
  line-height: 1.4;
  text-align: center;
}

.pwa-tip strong {
  color: var(--muted);
  font-weight: 400;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.panel-head h2 {
  font-family: Anton, Impact, sans-serif;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  font-weight: 400;
  line-height: 1;
  margin: 0 0 0.15rem;
}

.menu-back {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(12, 18, 16, 0.92);
  color: var(--lime);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-back:hover {
  border-color: var(--lime);
  background: rgba(20, 32, 24, 0.95);
}

.panel-body {
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.panel-body-compact {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.panel-body-stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.ops-block h3 {
  font-family: Anton, Impact, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.45rem;
  font-weight: 400;
}

.map-blurb-lg {
  font-size: 0.9rem;
  min-height: 0;
  margin: 0;
  color: var(--text);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.card-head h2 {
  font-family: Anton, Impact, sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.card-note {
  color: var(--muted);
  font-size: 0.72rem;
}

.weapon-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

@media (max-width: 820px) {
  .home-topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .home-topbar-meta {
    justify-items: start;
  }

  .home-hint {
    text-align: left;
    max-width: none;
  }

  .menu-nav {
    grid-template-columns: 1fr 1fr;
  }

  .weapon-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .menu-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 720px) {
  h1 {
    font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  }

  .tagline {
    display: none;
  }

  .menu-nav-btn {
    padding: 0.7rem 0.8rem;
  }

  .menu-nav-title {
    font-size: 1.15rem;
  }
}

.weapon-card {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(18, 24, 22, 0.9);
  color: var(--text);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "slot name"
    "slot desc"
    "slot stats";
  column-gap: 0.85rem;
  row-gap: 0.2rem;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.weapon-card:hover {
  border-color: #5f8f3a;
  transform: translateY(-1px);
}

.weapon-card.locked {
  opacity: 0.72;
  border-style: dashed;
  background: rgba(12, 14, 16, 0.92);
}

.weapon-card.locked:hover {
  border-color: #e0b84a;
}

.weapon-card.locked .weapon-name {
  color: #b7cfc0;
}

.weapon-unlock {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #e8f0a8;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.weapon-unlock.owned {
  color: #7a9a6a;
}

.weapon-unlock.buy {
  color: #f0d35a;
}

.weapon-card.secret-weapon {
  border-color: #5a3a6a;
  background: linear-gradient(145deg, rgba(24, 16, 32, 0.95), rgba(12, 18, 28, 0.95));
}

.weapon-card.secret-weapon.owned {
  border-color: #66e0ff;
  box-shadow: 0 0 18px rgba(100, 200, 255, 0.12);
}

.weapon-card.secret-weapon .weapon-slot {
  color: #c86cff;
}

.weapon-card.secret-weapon.owned .weapon-slot {
  color: #66e0ff;
}

.access-code {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(120, 140, 130, 0.35);
}

.access-code label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #8a9a92;
  margin-bottom: 0.4rem;
}

.access-code-row {
  display: flex;
  gap: 0.45rem;
}

.access-code-row input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(8, 12, 14, 0.95);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  padding: 0.55rem 0.7rem;
}

.access-code-row input:focus {
  outline: none;
  border-color: #c86cff;
}

.access-code-row button {
  appearance: none;
  border: 1px solid #5a3a6a;
  background: #1a1424;
  color: #e8d0ff;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.access-code-row button:hover {
  border-color: #c86cff;
  color: #fff;
}

.wep-slot.locked {
  opacity: 0.35;
  text-decoration: line-through;
  text-decoration-color: #5a4030;
}

.wep-slot.hidden {
  display: none;
}

.weapon-slot {
  grid-area: slot;
  align-self: center;
  font-family: Anton, Impact, sans-serif;
  font-size: 1.6rem;
  color: var(--lime);
  letter-spacing: 0.04em;
  min-width: 2rem;
}

.weapon-name {
  grid-area: name;
  font-family: Anton, Impact, sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.weapon-desc {
  grid-area: desc;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.weapon-stats {
  grid-area: stats;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.35rem;
  color: #b7cfc0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.map-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.mini-btn {
  appearance: none;
  width: 100%;
  margin: 0.35rem 0 0.55rem;
  border: 1px solid #5a3a6a;
  background: #1a1424;
  color: #e8d0ff;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.mini-btn:hover {
  border-color: #c86cff;
}

.ff-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.upgrade-list {
  display: grid;
  gap: 0.4rem;
  max-height: none;
  overflow: visible;
}

.upgrade-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 1fr 1fr;
  gap: 0.3rem;
  align-items: center;
}

.upgrade-row.locked {
  opacity: 0.4;
}

.upgrade-name {
  font-family: Anton, Impact, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.upgrade-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #121816;
  color: #e8f0a8;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.3rem;
  cursor: pointer;
}

.upgrade-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#objective-hud {
  position: absolute;
  left: 50%;
  top: 4.2rem;
  transform: translateX(-50%);
  padding: 0.35rem 0.75rem;
  background: rgba(8, 12, 14, 0.72);
  border: 1px solid rgba(157, 255, 74, 0.35);
  color: #d8f0c8;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: min(90vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
}

#perk-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 10, 0.72);
}

#perk-overlay.hidden {
  display: none;
}

.perk-panel {
  width: min(920px, 94vw);
  padding: 1.4rem 1.5rem 1.6rem;
  border: 1px solid #5f8f3a;
  background: linear-gradient(160deg, rgba(18, 28, 22, 0.98), rgba(10, 14, 16, 0.98));
  color: var(--text);
}

.perk-panel h2 {
  font-family: Anton, Impact, sans-serif;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
}

.perk-panel p {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.perk-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 820px) {
  .perk-choices {
    grid-template-columns: 1fr;
  }
}

.perk-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(20, 28, 24, 0.95);
  color: var(--text);
  padding: 0.9rem;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
}

.perk-card:hover {
  border-color: #9dff4a;
  transform: translateY(-1px);
}

.perk-icon {
  font-size: 1.5rem;
}

.perk-name {
  font-family: Anton, Impact, sans-serif;
  letter-spacing: 0.05em;
}

.perk-blurb {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.map-opt {
  appearance: none;
  border: 1px solid var(--line);
  background: #121816;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 0.5rem;
  min-height: 2.8rem;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    color 120ms ease,
    background 120ms ease;
}

.map-opt:hover {
  border-color: var(--lime);
  color: var(--text);
}

.map-opt.active {
  border-color: var(--lime);
  color: #0b100e;
  background: var(--lime);
}

.map-blurb {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  margin: 0 0 1rem;
  min-height: 2em;
}

.view-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.view-opt {
  appearance: none;
  border: 1px solid var(--line);
  background: #121816;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    color 120ms ease,
    background 120ms ease;
}

.view-opt:hover {
  border-color: var(--lime);
  color: var(--text);
}

.view-opt.active {
  border-color: var(--lime);
  color: #0b100e;
  background: var(--lime);
}

.controls-head {
  margin-top: 0.25rem;
}

.controls-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.controls-list li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border: 1px solid #3a4a42;
  background: #18201c;
  color: var(--lime);
  font-family: inherit;
  font-size: 0.85em;
}

#start-btn {
  appearance: none;
  border: 2px solid var(--lime);
  background: rgba(10, 16, 14, 0.85);
  color: var(--lime);
  font-family: Anton, Impact, sans-serif;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0;
  transition:
    background 120ms ease,
    color 120ms ease,
    transform 120ms ease;
}

#start-btn:hover {
  background: var(--lime);
  color: #0b100e;
  transform: translateY(-1px);
}

.hint {
  margin-top: 0.75rem;
  color: #5f7368;
  font-size: 0.75rem;
  text-align: center;
}

.threat-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 820px) {
  .threat-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.threat-item {
  border: 1px solid var(--line);
  background: rgba(18, 24, 22, 0.85);
  padding: 0.65rem 0.7rem;
  display: grid;
  gap: 0.2rem;
}

.threat-item.threat-boss {
  grid-column: 1 / -1;
  border-color: #a84488;
  background:
    linear-gradient(120deg, rgba(80, 20, 70, 0.45), transparent 55%),
    rgba(22, 14, 28, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 68, 170, 0.12);
}

.threat-item.threat-boss .threat-wave {
  color: #ff66bb;
}

.threat-item.threat-boss .threat-name {
  color: #ffd0ea;
  font-size: 1.25rem;
}

.threat-boss-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.threat-wave {
  color: var(--lime);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.threat-name {
  font-family: Anton, Impact, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.threat-desc {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

/* —— Zombucks coin —— */
.z-coin {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff8c8 0%, #f0d35a 28%, #9dff4a 62%, #4f8f1c 100%);
  border: 2px solid #d4b84a;
  box-shadow:
    inset 0 -2px 3px rgba(40, 60, 10, 0.35),
    inset 0 2px 2px rgba(255, 255, 255, 0.35),
    0 0 10px rgba(157, 255, 74, 0.28);
  flex-shrink: 0;
}

.z-coin.sm {
  width: 1rem;
  height: 1rem;
  border-width: 1.5px;
}

.z-coin-core {
  font-family: Anton, Impact, sans-serif;
  font-size: 0.65rem;
  line-height: 1;
  color: #3d5a12;
  text-shadow: 0 1px 0 rgba(255, 255, 200, 0.35);
}

.z-coin.sm .z-coin-core {
  font-size: 0.55rem;
}

.wallet,
.wallet-hud {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #e8f0a8;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.shop-card .shop-blurb {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.shop-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 820px) {
  .shop-list {
    grid-template-columns: 1fr;
  }
}

.shop-item {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(18, 24, 22, 0.9);
  color: var(--text);
  text-align: left;
  padding: 0.8rem 0.85rem;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.shop-item:hover:not(:disabled) {
  border-color: #d4b84a;
  transform: translateY(-1px);
}

.shop-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shop-name {
  font-family: Anton, Impact, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.shop-desc {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.shop-price {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  color: #e8f0a8;
  font-size: 0.85rem;
}

.skin-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

@media (max-width: 820px) {
  .skin-list {
    grid-template-columns: 1fr;
  }
}

.skin-item {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(18, 24, 22, 0.92);
  color: var(--text);
  text-align: left;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "emoji name"
    "emoji desc"
    "emoji price";
  column-gap: 0.65rem;
  row-gap: 0.15rem;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.skin-item:hover {
  border-color: #d4b84a;
  transform: translateY(-1px);
}

.skin-item.owned {
  border-color: #4a6a48;
}

.skin-item.equipped {
  border-color: #9dff4a;
  background: rgba(30, 48, 28, 0.95);
  box-shadow: inset 0 0 0 1px rgba(157, 255, 74, 0.25);
}

.skin-item.secret:not(.owned) {
  border-style: dashed;
  border-color: #8a6a2a;
  background: linear-gradient(145deg, rgba(28, 22, 12, 0.95), rgba(18, 20, 16, 0.95));
}

.skin-item.secret:not(.owned) .skin-price {
  color: #f0d35a;
}

.skin-emoji {
  grid-area: emoji;
  align-self: center;
  font-size: 1.55rem;
  line-height: 1;
  width: 1.8rem;
  text-align: center;
}

.skin-name {
  grid-area: name;
  font-family: Anton, Impact, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.skin-desc {
  grid-area: desc;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.skin-price {
  grid-area: price;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  color: #e8f0a8;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.skin-item.equipped .skin-price {
  color: #9dff4a;
}

.skin-item.owned:not(.equipped) .skin-price {
  color: #8aaa7a;
}

#loot-toasts {
  position: absolute;
  right: 1.1rem;
  top: 4.2rem;
  display: grid;
  gap: 0.35rem;
  pointer-events: none;
}

.loot-toast {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #6a7a30;
  color: #e8f0a8;
  font-size: 0.85rem;
  animation: loot-pop 1.2s ease forwards;
}

@keyframes loot-pop {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  15% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px);
  }
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

#hud.hidden {
  display: none;
}

/* —— Mobile / touch controls —— */
#touch-controls {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#touch-controls.hidden {
  display: none;
}

.touch-look {
  position: absolute;
  top: 0;
  right: 0;
  width: 58%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
}

.touch-stick {
  position: absolute;
  left: max(0.75rem, env(safe-area-inset-left));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  width: 8.5rem;
  height: 8.5rem;
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-items: center;
}

.touch-stick-base {
  width: 7.2rem;
  height: 7.2rem;
  border-radius: 50%;
  border: 2px solid rgba(157, 255, 74, 0.35);
  background: rgba(8, 14, 12, 0.35);
  position: relative;
}

.touch-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.6rem;
  height: 2.6rem;
  margin: -1.3rem 0 0 -1.3rem;
  border-radius: 50%;
  background: rgba(157, 255, 74, 0.55);
  border: 2px solid rgba(232, 240, 234, 0.65);
  box-shadow: 0 0 16px rgba(157, 255, 74, 0.25);
  will-change: transform;
}

.touch-label {
  position: absolute;
  bottom: -0.15rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(138, 160, 148, 0.85);
  pointer-events: none;
}

.touch-actions {
  position: absolute;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "reload fire"
    "jump fire";
  gap: 0.55rem;
  pointer-events: auto;
  align-items: end;
}

#touch-reload {
  grid-area: reload;
}

#touch-jump {
  grid-area: jump;
}

#touch-fire {
  grid-area: fire;
}

.touch-top-btns {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  display: flex;
  gap: 0.4rem;
  pointer-events: auto;
  z-index: 2;
}

.touch-btn {
  appearance: none;
  border: 2px solid rgba(157, 255, 74, 0.45);
  background: rgba(10, 16, 14, 0.55);
  color: #e8f0ea;
  font-family: Anton, Impact, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  min-width: 3.4rem;
  min-height: 3.4rem;
  border-radius: 999px;
  padding: 0.55rem 0.7rem;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:active,
.touch-btn.is-active {
  background: rgba(157, 255, 74, 0.28);
  border-color: #9dff4a;
  color: #9dff4a;
}

.touch-btn-sm {
  min-width: 2.6rem;
  min-height: 2.6rem;
  font-size: 0.85rem;
  border-radius: 0.55rem;
}

.touch-fire {
  width: 5.4rem;
  height: 5.4rem;
  font-size: 1.15rem;
  background: rgba(255, 77, 58, 0.28);
  border-color: rgba(255, 77, 58, 0.75);
  color: #ffc8c0;
}

.touch-fire:active,
.touch-fire.is-active {
  background: rgba(255, 77, 58, 0.55);
  border-color: #ff4d3a;
  color: #fff;
}

body.touch-play {
  touch-action: none;
  overscroll-behavior: none;
}

body.touch-play #weapon-strip,
body.touch-play #view-badge,
body.touch-play #flashlight-badge {
  display: none;
}

body.touch-play .top {
  gap: 0.55rem 0.85rem;
  padding: 0.55rem 0.7rem;
  padding-right: 7.5rem;
  font-size: 0.85rem;
}

body.touch-play #health-bar {
  width: 84px;
}

@media (max-width: 820px) {
  .home-shell {
    gap: 0.5rem;
  }

  .hub-chip {
    padding: 0.28rem 0.45rem;
    font-size: 0.65rem;
  }

  .menu-nav-btn {
    padding: 0.7rem 0.75rem;
  }

  #start-btn {
    font-size: 1.25rem;
    padding: 0.95rem 1rem;
    min-height: 3.2rem;
  }

  .weapon-card {
    padding: 0.75rem;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .touch-stick {
    width: 6.8rem;
    height: 6.8rem;
    bottom: 0.55rem;
  }

  .touch-stick-base {
    width: 5.8rem;
    height: 5.8rem;
  }

  .touch-fire {
    width: 4.6rem;
    height: 4.6rem;
  }

  body.touch-play .top {
    padding-top: 0.35rem;
  }
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

.hud-block {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.label {
  color: var(--muted);
  font-size: 0.75rem;
}

#health-bar {
  width: 120px;
  height: 10px;
  border: 1px solid #3a4a42;
  background: #0a100d;
  overflow: hidden;
}

#health-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff4d3a, #ffc14a);
}

#weapon-strip {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  max-width: min(96vw, 920px);
}

.wep-slot {
  border: 1px solid #2d3b34;
  background: rgba(0, 0, 0, 0.4);
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.45rem;
}

.wep-slot i {
  font-style: normal;
  color: var(--lime);
  margin-right: 0.25rem;
}

.wep-slot.active {
  border-color: var(--lime);
  color: var(--text);
  background: rgba(157, 255, 74, 0.12);
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(232, 240, 234, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  transition:
    width 120ms ease,
    height 120ms ease;
}

#crosshair.shotgun {
  width: 34px;
  height: 34px;
}

#crosshair.rifle {
  width: 12px;
  height: 12px;
}

#crosshair.sniper {
  width: 22px;
  height: 22px;
  border-radius: 2px;
}

#crosshair.minigun {
  width: 28px;
  height: 28px;
  border-style: dashed;
}

#crosshair.flame {
  width: 40px;
  height: 28px;
  border-radius: 40%;
  border-color: rgba(255, 120, 40, 0.85);
}

#crosshair.launcher {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border-color: rgba(157, 255, 74, 0.9);
}

#scope-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 16vmin, rgba(0, 0, 0, 0.92) 34vmin);
  z-index: 5;
}

#scope-overlay.hidden {
  display: none;
}

.scope-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34vmin;
  height: 34vmin;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(180, 220, 160, 0.35);
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}

.scope-cross-h,
.scope-cross-v {
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(157, 255, 74, 0.55);
  transform: translate(-50%, -50%);
}

.scope-cross-h {
  width: 28vmin;
  height: 1px;
}

.scope-cross-v {
  width: 1px;
  height: 28vmin;
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(232, 240, 234, 0.85);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#crosshair::before {
  width: 2px;
  height: 28px;
}

#crosshair::after {
  width: 28px;
  height: 2px;
}

#message {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  font-family: Anton, Impact, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 200ms ease;
}

#message.show {
  opacity: 1;
}

#headshot-flash {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%) scale(0.85);
  font-family: Anton, Impact, sans-serif;
  font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: 0.08em;
  color: #ff4d6a;
  text-shadow:
    0 0 18px rgba(255, 60, 80, 0.75),
    0 2px 16px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}

#headshot-flash.show {
  animation: hs-pop 0.85s ease-out forwards;
}

@keyframes hs-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.7);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(1.05);
  }
}

#view-badge {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0.55rem;
  border: 1px solid #2d3b34;
}

#flashlight-badge {
  position: absolute;
  right: 1rem;
  bottom: 3rem;
  color: #f0e0b0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0.55rem;
  border: 1px solid #5a4a28;
  text-shadow: 0 0 8px rgba(255, 200, 100, 0.45);
}

#flashlight-badge.off {
  color: var(--muted);
  border-color: #2d3b34;
  text-shadow: none;
}

#damage-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 45%, rgba(255, 40, 30, 0.45) 100%);
  opacity: 0;
  transition: opacity 80ms linear;
}

/* Online co-op lobby */
.coop-card .shop-blurb code {
  color: var(--lime);
  font-size: 0.85em;
}
.coop-field {
  display: grid;
  gap: 0.3rem;
  margin: 0.75rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.coop-field input,
.coop-join-row input {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.08em;
}
.coop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.coop-actions button,
.coop-join-row button {
  appearance: none;
  border: 1px solid #5f8f3a;
  background: rgba(157, 255, 74, 0.08);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.08em;
}
.coop-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.coop-actions button.hidden {
  display: none;
}
.coop-join-row {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  min-width: 12rem;
}
.coop-join-row input {
  width: 5.5rem;
  text-transform: uppercase;
  text-align: center;
}
.coop-code-line {
  margin-top: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  font-size: 0.8rem;
}
.coop-code-line strong {
  color: var(--lime);
  font-size: 1.35rem;
  letter-spacing: 0.2em;
}
.coop-player-list {
  list-style: none;
  margin: 0.6rem 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.coop-player-list li {
  border: 1px solid var(--line);
  padding: 0.4rem 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.coop-player-list li.ready {
  border-color: #5f8f3a;
  color: var(--text);
}
.coop-player-list li.host {
  box-shadow: inset 3px 0 0 var(--lime);
}
