:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  color: #fff0ce;
  background: #251e1a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
.button {
  font: 800 13px Arial;
  letter-spacing: 0.05em;
  color: #fff1d0;
  background: #574134;
  border: 2px solid #caa169;
  border-radius: 7px;
  min-height: 44px;
  padding: 10px 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
button:hover,
.button:hover {
  background: #795435;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #fff1ad;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
#game {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #39291f;
}
.hud {
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  background: #33271f;
  border-bottom: 3px solid #d09d59;
}
.hud small,
.ammo-label {
  display: block;
  color: #ccad7e;
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 800;
}
.hud b {
  font-size: 24px;
}
.round-display {
  text-align: center;
}
.round-display b {
  font-size: 18px;
}
.round-display span {
  color: #ffdb81;
  margin-left: 10px;
}
.tools {
  display: flex;
  gap: 6px;
}
.tools button {
  font-size: 10px;
  padding: 8px;
  min-width: 44px;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.playing canvas {
  cursor: none;
  touch-action: none;
}
.bottom {
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 20px;
  background: #33271f;
  border-top: 3px solid #d09d59;
}
#ammo {
  color: #ffd16e;
  font-size: 26px;
  letter-spacing: 5px;
}
.combo-wrap {
  text-align: center;
}
.combo-wrap b {
  color: #ffd475;
  font-size: 27px;
}
#reload {
  background: #ecc274;
  color: #37271d;
  border-color: #ffe0a0;
  min-width: 138px;
}
.reloading {
  animation: pulse 0.5s infinite alternate;
}
@keyframes pulse {
  to {
    opacity: 0.65;
  }
}
#overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: #211b159e;
  overflow-y: auto;
  padding: 15px;
}
#overlay[hidden],
#banner[hidden],
#boss-tint[hidden],
[hidden] {
  display: none !important;
}
#panel {
  background: #362a22f5;
  border: 3px solid #dbac69;
  box-shadow:
    0 0 0 7px #2a211ddd,
    0 18px 55px #0008;
  border-radius: 10px;
  padding: 25px 35px;
  text-align: center;
  max-width: 520px;
  width: 100%;
  max-height: 100%;
  overflow: auto;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #e1b576;
  font-weight: 800;
}
h1 {
  font: 900 clamp(38px, 6vw, 65px) / 0.91 Georgia;
  margin: 20px 0 10px;
  letter-spacing: -0.04em;
  text-shadow: 3px 4px #9e4932;
}
h1 em {
  color: #f3bf67;
  font-style: normal;
}
h2 {
  font: 900 34px Georgia;
  margin: 16px 0;
}
.subtitle {
  color: #e0c29b;
  font: italic 19px Georgia;
}
.rules {
  font-size: 14px;
  line-height: 1.6;
  margin: 20px 0;
}
.primary {
  display: flex;
  width: 100%;
  background: #e9ae50;
  color: #33251c;
  border: 2px solid #ffe1a6;
  box-shadow: 0 4px #976035;
  font-size: 20px;
  min-height: 52px;
  margin: 15px 0 10px;
}
.primary:hover {
  background: #ffd078;
}
.controls {
  font-size: 12px;
  line-height: 1.65;
  color: #d4bfa2;
}
.best {
  border-top: 1px solid #786049;
  padding-top: 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
}
.best b {
  margin-left: 12px;
  color: #ffda88;
  font-size: 18px;
}
#banner {
  position: absolute;
  z-index: 3;
  top: 32%;
  left: 5%;
  right: 5%;
  text-align: center;
  padding: 20px;
  background: #34291cef;
  border: 2px solid #ebbf72;
  pointer-events: none;
}
#banner small {
  display: block;
  color: #ffcc75;
  font: 900 30px Georgia;
}
#banner strong {
  display: block;
  font-size: 17px;
  margin-top: 10px;
}
#boss-tint {
  position: absolute;
  inset: 0;
  background: #240e0a99;
  pointer-events: none;
  z-index: 2;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.stats div {
  font-size: 11px;
  color: #dcc2a0;
}
.stats b {
  display: block;
  color: #fff1c9;
  font-size: 24px;
  margin-top: 4px;
}
.final-score {
  font: 900 52px Georgia;
  color: #ffd480;
}
.rotate {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#debug {
  position: absolute;
  bottom: 75px;
  left: 20px;
  background: #000d;
  color: #fff;
  font: 11px monospace;
  z-index: 8;
  padding: 5px;
}
@media (max-width: 550px) {
  .hud {
    padding: 7px 10px;
    gap: 5px;
  }
  .hud b {
    font-size: 18px;
  }
  .tools {
    gap: 4px;
  }
  .tools button {
    padding: 5px;
    font-size: 9px;
  }
  .bottom {
    padding: 7px 10px;
  }
  .bottom #ammo {
    font-size: 22px;
    letter-spacing: 2px;
  }
  #reload {
    min-width: 118px;
    padding: 8px;
  }
  .rotate {
    display: block;
    position: absolute;
    bottom: 71px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 9px;
    color: #ffe6b8;
    pointer-events: none;
  }
  #panel {
    padding: 20px;
  }
  #fullscreen {
    display: none;
  }
}
@media (max-height: 550px) {
  #game {
    min-height: 360px;
  }
  .hud {
    height: 58px;
  }
  .bottom {
    height: 55px;
  }
  #panel {
    padding: 12px 25px;
  }
  h1 {
    font-size: 38px;
    margin: 10px 0;
  }
  .rules,
  .subtitle,
  .controls {
    margin: 8px 0;
  }
  .best {
    display: none;
  }
  .primary {
    min-height: 44px;
    margin: 8px 0;
  }
  .stats {
    margin: 10px 0;
  }
  .final-score {
    font-size: 36px;
  }
  .rotate {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
