:root {
  color-scheme: dark;
  --ink: #f6f3e8;
  --muted: #b9c5bf;
  --panel: rgba(18, 24, 28, 0.78);
  --panel-strong: rgba(11, 15, 18, 0.92);
  --line: rgba(255, 255, 255, 0.16);
  --teal: #35d0ba;
  --amber: #f4b942;
  --coral: #f96f5d;
  --grass: #76c66e;
  --shadow: rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0b1114;
}

body {
  color: var(--ink);
}

button {
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  min-height: 480px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(53, 208, 186, 0.12), transparent 28%),
    radial-gradient(circle at 80% 72%, rgba(244, 185, 66, 0.10), transparent 30%),
    #0b1114;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 460px) auto;
  gap: 14px;
  align-items: start;
  pointer-events: none;
}

.hud-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 48px var(--shadow);
  backdrop-filter: blur(10px);
}

.meter {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meter-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.meter-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transition: transform 120ms ease-out;
}

.meter-fill.hp {
  background: linear-gradient(90deg, var(--coral), #ffd166);
}

.meter-fill.xp {
  background: linear-gradient(90deg, var(--teal), #8be9fd);
}

.stats {
  justify-self: end;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
  max-width: 560px;
}

.stats span,
.pause-badge {
  min-width: 88px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 48px var(--shadow);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  backdrop-filter: blur(10px);
}

.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 10, 12, 0.58);
  backdrop-filter: blur(8px);
}

.modal.hidden,
.hidden {
  display: none;
}

.modal-panel {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  padding: clamp(18px, 4vw, 34px);
}

.start-panel {
  width: min(580px, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 8vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

.modal-panel h1 {
  font-size: clamp(28px, 6vw, 46px);
}

.intro {
  max-width: 40rem;
  margin: 14px auto 22px;
  color: var(--muted);
  font-size: clamp(15px, 2.5vw, 18px);
  line-height: 1.5;
}

.primary-button,
.upgrade-button {
  border: 0;
  border-radius: 8px;
  color: #061113;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

.primary-button {
  min-width: 168px;
  padding: 13px 22px;
  background: linear-gradient(135deg, var(--teal), #f6d365);
  box-shadow: 0 14px 40px rgba(53, 208, 186, 0.26);
}

.primary-button:hover,
.upgrade-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.primary-button:active,
.upgrade-button:active {
  transform: translateY(0);
}

.control-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}

.control-strip span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.upgrade-button {
  min-height: 148px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(150deg, rgba(53, 208, 186, 0.96), rgba(244, 185, 66, 0.96));
  text-align: left;
}

.upgrade-button.weapon {
  background: linear-gradient(150deg, rgba(139, 233, 253, 0.98), rgba(196, 139, 255, 0.98));
}

.upgrade-button.weapon-upgrade {
  background: linear-gradient(150deg, rgba(244, 185, 66, 0.98), rgba(249, 111, 93, 0.98));
}

.upgrade-button strong,
.upgrade-button span {
  display: block;
}

.upgrade-button strong {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.2;
}

.upgrade-button span {
  color: rgba(6, 17, 19, 0.78);
  font-size: 13px;
  line-height: 1.35;
}

.pause-badge {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  .hud {
    grid-template-columns: 1fr;
  }

  .stats {
    justify-self: stretch;
    justify-content: stretch;
  }

  .stats span {
    flex: 1 1 90px;
  }

  .upgrade-grid {
    grid-template-columns: 1fr;
  }

  .upgrade-button {
    min-height: 108px;
  }
}
