:root {
  color-scheme: dark;
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: radial-gradient(circle at 12% 10%, #6632d8 0%, #182b52 46%, #0a1326 100%);
  --panel: rgba(7, 10, 30, 0.92);
  --panel-alt: rgba(15, 18, 42, 0.9);
  --panel-border: rgba(125, 195, 255, 0.25);
  --text: #f6fcff;
  --muted: rgba(215, 237, 255, 0.75);
  --accent: #5ef5ff;
  --accent-strong: #ff7ae6;
  --shadow: 0 30px 70px rgba(5, 2, 12, 0.78);
  --glow: 0 0 18px rgba(94, 245, 255, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 3vw, 3rem);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 75% 15%, rgba(255, 138, 234, 0.28), transparent 45%),
    radial-gradient(circle at 20% 25%, rgba(98, 196, 255, 0.3), transparent 50%);
  opacity: 0.6;
  mix-blend-mode: screen;
  z-index: -1;
}

.game-shell {
  width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  padding: clamp(1.5rem, 3vw, 2.6rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 2vw, 2.6rem);
  align-items: flex-start;
}

.hero-copy {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 0.35rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.stat {
  min-width: 150px;
  background: var(--panel-alt);
  border-radius: 22px;
  border: 1px solid rgba(123, 210, 255, 0.25);
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 25%, rgba(94, 245, 255, 0.35), transparent 65%);
  opacity: 0.6;
}

.stat > * {
  position: relative;
  z-index: 2;
}

.stat .label {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.62);
}

.stat .value {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  color: #eaf9ff;
  text-shadow: var(--glow);
}

.stat .value-sm {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gun-name {
  font-size: 1.3rem;
  color: var(--accent-strong);
  text-shadow: 0 0 16px rgba(255, 122, 246, 0.55);
}

.loadup {
  flex-basis: 100%;
  background: var(--panel-alt);
  border-radius: 22px;
  border: 1px solid rgba(123, 210, 255, 0.25);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: relative;
  overflow: hidden;
}

.loadup::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 25%, rgba(255, 122, 246, 0.2), transparent 65%);
  opacity: 0.8;
  pointer-events: none;
}

.loadup > * {
  position: relative;
  z-index: 2;
}

.mode-toggle {
  background: var(--panel-alt);
  border-radius: 22px;
  border: 1px solid rgba(123, 210, 255, 0.25);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
}

.mode-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(94, 245, 255, 0.18), transparent 65%);
  opacity: 0.65;
  pointer-events: none;
}

.mode-toggle > * {
  position: relative;
  z-index: 2;
}

.mode-toggle-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.mode-toggle .label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.62);
}

.mode-blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.mode-toggle-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mode-btn {
  flex: 1 1 160px;
  border-radius: 18px;
  border: 1px solid rgba(119, 205, 255, 0.35);
  background: rgba(8, 14, 30, 0.75);
  padding: 0.75rem 1rem;
  color: #e6f7ff;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mode-btn.active {
  background: linear-gradient(120deg, #66faff 0%, #7e5bff 45%, #ff48bc 100%);
  color: #08010e;
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(102, 250, 255, 0.35);
}

.loadup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.loadup .label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.62);
}

.load-text {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}

.load-track {
  position: relative;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(111, 196, 255, 0.45);
  overflow: hidden;
  box-shadow: inset 0 6px 24px rgba(4, 7, 20, 0.9);
}

.load-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(120deg, rgba(94, 245, 255, 0.95), rgba(255, 122, 230, 0.95));
  box-shadow: 0 0 24px rgba(94, 245, 255, 0.55);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.playfield {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.canvas-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.canvas-headline h2 {
  margin: 0 0 0.35rem;
}

.canvas-headline p {
  margin: 0;
  color: var(--muted);
  max-width: 40ch;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 26px;
  border: 1px solid rgba(125, 210, 255, 0.3);
  background: linear-gradient(180deg, rgba(19, 30, 61, 0.9) 0%, rgba(8, 14, 30, 0.95) 70%);
  box-shadow: inset 0 0 40px rgba(8, 16, 35, 0.9), 0 0 35px rgba(36, 132, 255, 0.25);
  cursor: pointer;
}

.status-text {
  margin: 0;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

button {
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(119, 205, 255, 0.45);
  padding: 0.65rem 1.6rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  color: #e9fbff;
  background: rgba(9, 16, 42, 0.7);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(12, 70, 144, 0.45);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

button.primary {
  background: linear-gradient(120deg, #66faff 0%, #7e5bff 45%, #ff48bc 100%);
  color: #08010e;
  border: none;
  box-shadow: 0 16px 36px rgba(102, 250, 255, 0.35);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hotkeys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  border-left: 1px solid rgba(118, 208, 255, 0.18);
  padding-left: 1rem;
}

.hotkeys p:not(.label) {
  margin: 0;
  color: rgba(226, 244, 255, 0.82);
  font-weight: 600;
}

.hotkey-card {
  background: var(--panel-alt);
  border-radius: 18px;
  border: 1px solid rgba(118, 208, 255, 0.2);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: inset 0 0 20px rgba(7, 12, 38, 0.55);
}

.hotkey-card .label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(111, 196, 255, 0.45);
  padding: 0.15rem 0.65rem;
  margin-right: 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

@media (max-width: 960px) {
  .hero {
    flex-direction: column;
  }

  .stats {
    justify-content: flex-start;
  }

  .hotkeys {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(118, 208, 255, 0.18);
    padding-top: 0.8rem;
    width: 100%;
  }

  .mode-toggle-buttons {
    flex-direction: column;
  }

  .mode-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .panel {
    border-radius: 24px;
    padding: 1.3rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  canvas {
    border-radius: 20px;
  }
}
