:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #101210;
  color: #f3efe6;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(220, 62, 36, 0.18), transparent 28%),
    linear-gradient(135deg, #151815 0%, #24241c 45%, #171717 100%);
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: wait;
}

.shell {
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
}

.game-panel {
  position: relative;
  width: min(100%, 430px);
  height: min(100svh - 24px, 820px);
  min-height: 600px;
  border: 2px solid #3c3a30;
  border-radius: 8px;
  overflow: hidden;
  background: #151515;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.game-panel:not(.is-playing) canvas,
.game-panel:not(.is-playing) .hud,
.game-panel:not(.is-playing) .controls {
  visibility: hidden;
}

.hud {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  background: rgba(17, 18, 16, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(8px);
}

.hud-audio {
  display: grid;
  grid-template-columns: 82px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 5px 10px 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 15, 13, 0.36);
}

.audio-mute {
  height: 26px;
  border-radius: 6px;
  background: rgba(247, 200, 79, 0.22);
  color: #fff4df;
  font-size: 12px;
  font-weight: 700;
}

.audio-mute[aria-pressed="true"] {
  background: rgba(217, 79, 53, 0.48);
}

.audio-slider {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.audio-slider .hud-label {
  margin-bottom: 0;
  text-align: right;
}

.audio-slider input {
  width: 100%;
  min-width: 0;
  accent-color: #f7c84f;
}

.hud-main {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1px;
}

.hud-main > div {
  padding: 9px 8px 8px;
  text-align: center;
}

.hud-subheader {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 10px;
  align-items: center;
  padding: 5px 10px 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 18, 16, 0.42);
}

.hud-label {
  display: block;
  margin-bottom: 2px;
  color: #bdb6a8;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.hud strong {
  font-size: 17px;
  line-height: 1;
}

.hud-life {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  text-align: left;
}

.hud-life .hud-label {
  grid-column: 1 / -1;
  text-align: left;
}

.life-meter {
  position: relative;
  height: 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(58, 31, 31, 0.88);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.58);
}

.life-meter-fill {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: #49c65a;
  transition: width 180ms ease, background-color 180ms ease;
}

.hud-time {
  min-width: 0;
}

.hud-time strong {
  display: block;
  overflow: hidden;
  color: #f3efe6;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-cooldown {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 8px;
}

.hud-cooldown .hud-label {
  margin-bottom: 0;
  text-align: right;
}

.cooldown-meter {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background: rgba(48, 32, 24, 0.92);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.cooldown-meter-fill {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: #f7c84f;
  transition: width 80ms linear, background-color 120ms ease;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #20211f;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.overlay {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  background:
    linear-gradient(rgba(12, 13, 12, 0.22), rgba(12, 13, 12, 0.78)),
    url("assets/level-1/background-incio/zone-01-senkata-disturbios-commercial-gate-v1.png") center / cover no-repeat;
}

.overlay.is-hidden {
  display: none;
}

.overlay h1 {
  margin: 0;
  color: #f7c84f;
  font-size: 46px;
  line-height: 0.95;
  letter-spacing: 0;
}

.overlay p {
  max-width: 310px;
  margin: 0;
  color: #e5dcc8;
  font-size: 15px;
  line-height: 1.45;
}

.overlay button {
  min-width: 150px;
  min-height: 48px;
  border-radius: 8px;
  background: #d94f35;
  color: #fff8ec;
  font-weight: 700;
  box-shadow: 0 8px 0 #7e291c;
}

.overlay button:disabled {
  opacity: 0.82;
  box-shadow: 0 4px 0 #7e291c;
}

.controls {
  position: absolute;
  z-index: 5;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.18fr;
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.controls button {
  height: 58px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(246, 238, 220, 0.14);
  color: #fff4df;
  font-size: 30px;
  font-weight: 800;
  backdrop-filter: blur(10px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

#attackButton {
  background: rgba(247, 200, 79, 0.28);
  color: #ffe189;
}

@media (max-height: 640px) {
  .game-panel {
    min-height: 520px;
  }

  .controls button {
    height: 50px;
    font-size: 24px;
  }
}
