:root {
  --teal: #2dd4bf;
  --gold: #c9a227;
  --cream: #f6f1e4;
  --navy: #0b1220;
  --ink: #141414;
}

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

html, body {
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, #152033 0%, var(--navy) 55%, #070b12 100%);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--cream);
}

#app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px 8px;
  position: relative;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 4px 2px 10px;
  gap: 16px;
}

.label {
  font-size: 10px;
  letter-spacing: 0.2em;
  opacity: 0.62;
  text-transform: uppercase;
}

.score {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.best { font-size: 11px; opacity: 0.68; margin-top: 4px; }

.hud-right {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hud-btn {
  border: 1.5px solid rgba(246, 241, 228, 0.35);
  background: transparent;
  color: var(--cream);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hud-btn[hidden] { display: none; }
.hud-btn[aria-pressed="true"] {
  background: var(--cream);
  color: var(--navy);
}
.hud-btn:hover, .hud-btn:focus-visible {
  border-color: var(--teal);
}

#combo { color: var(--gold); min-width: 4.5em; text-align: right; }
#weapon-name { color: var(--teal); }

#stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 280px;
}

#game {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  background: #0b1220;
  border-radius: 6px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  touch-action: none;
  cursor: crosshair;
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.overlay.hidden { display: none; }

.card {
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  padding: 28px 32px 24px;
  min-width: min(320px, 92vw);
  max-width: 420px;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.kicker { font-weight: 700; margin-bottom: 6px; letter-spacing: 0.04em; }
.big { font-size: clamp(48px, 10vw, 64px); font-weight: 700; line-height: 1; }
.rank { font-size: 12px; letter-spacing: 0.18em; opacity: 0.55; margin: 8px 0 12px; text-transform: uppercase; }
.lead { font-size: 13px; line-height: 1.45; opacity: 0.72; margin: 8px 0 16px; }
.shared { font-size: 12px; color: #5a4a12; margin-bottom: 10px; }

.bar { height: 8px; background: #e6e0d2; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); }

.ranks {
  list-style: none;
  text-align: left;
  margin: 12px 0 4px;
  font-size: 12px;
}
.ranks li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
}
.ranks .is-current { font-weight: 700; color: #7a6410; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

button, .ghost-link {
  border: 1.5px solid #222;
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
}
button.ghost, .ghost-link { background: transparent; }
button:focus-visible, .ghost-link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.touch-bar {
  display: none;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 0;
}

.shot-mix {
  position: absolute;
  left: 16px;
  bottom: 18px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(220px, calc(100vw - 48px));
  padding: 10px 12px 11px;
  border-radius: 14px;
  background: rgba(246, 241, 228, 0.9);
  color: var(--ink);
  border: 1px solid rgba(20, 20, 20, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.shot-mix-row {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.shot-mix-row span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.shot-mix input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.shot-mix input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.16);
}

.shot-mix input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #141414;
  border: 2px solid #fff;
}

.shot-mix input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.16);
}

.shot-mix input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #141414;
  border: 2px solid #fff;
}

.hint a { color: var(--teal); }

.hint {
  text-align: center;
  font-size: 11px;
  opacity: 0.5;
  padding: 10px 4px 4px;
}

.title-mark {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #7a6410;
  margin-bottom: 6px;
}

h1 {
  font-size: clamp(28px, 6vw, 36px);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

@media (hover: none) and (pointer: coarse) {
  .touch-bar { display: flex; }
  .hint { display: none; }
  .shot-mix { bottom: 58px; }
}

@media (max-width: 640px) {
  #app { padding: 8px 10px 6px; }
  .hud-right { gap: 8px; font-size: 11px; }
}
