* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #bdeeff;
  color: #f3fbff;
  touch-action: none;
  user-select: none;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

#game-root,
#game {
  width: 100%;
  height: 100%;
}

#game {
  display: block;
}

.hud {
  pointer-events: none;
  position: fixed;
  z-index: 5;
}

.hud-top {
  inset: 0;
}

.status-block.player {
  position: fixed;
  left: 50%;
  bottom: 120px;
  width: min(320px, calc(100vw - 40px));
  transform: translateX(-50%);
  background: rgba(11, 83, 96, 0.45);
  border-color: rgba(167, 244, 255, 0.55);
}

.status-block.enemy {
  position: fixed;
  top: 12px;
  left: 50%;
  width: min(360px, calc(100vw - 40px));
  transform: translateX(-50%);
  border-color: rgba(255, 124, 112, 0.34);
}

.status-block {
  padding: 10px 12px;
  border: 1px solid rgba(192, 246, 255, 0.3);
  background: rgba(9, 21, 28, 0.5);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  box-shadow: 0 0 28px rgba(0, 220, 255, 0.08);
}

.label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: #d8f9ff;
}

.bar {
  height: 12px;
  padding: 2px;
  margin-top: 6px;
  border: 1px solid rgba(230, 251, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

.bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #33f7ff, #f8ff72);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(51, 247, 255, 0.7);
}

.bar.hit {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 16px rgba(255, 255, 255, 0.55),
    0 0 28px rgba(255, 78, 78, 0.42);
}

.bar.boost span {
  background: linear-gradient(90deg, #5dffab, #34a7ff);
}

.bar.heat span {
  background: linear-gradient(90deg, #ff6154, #ffd15c);
}

.round-info {
  position: fixed;
  top: 86px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  padding: 10px 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(9, 21, 28, 0.4);
  backdrop-filter: blur(8px);
  border-radius: 6px;
}

.warning {
  position: fixed;
  z-index: 7;
  inset: 0;
  color: #ff3434;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
  text-shadow: 0 0 16px rgba(255, 50, 50, 0.45);
}

.warning.hidden {
  display: none;
}

.warning div {
  position: absolute;
  top: 23%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(28px, 4vw, 46px);
}

.warning span {
  position: absolute;
  display: block;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 900;
  line-height: 1;
}

.warning.mode-front .warning-up,
.warning.mode-front .warning-left,
.warning.mode-front .warning-right,
.warning.mode-top .warning-left,
.warning.mode-top .warning-right,
.warning.mode-left .warning-up,
.warning.mode-left .warning-right,
.warning.mode-right .warning-up,
.warning.mode-right .warning-left {
  display: none;
}

.warning-up {
  top: 30%;
  left: 50%;
  transform: translateX(-50%) scaleX(1.25);
  animation: warningPulse 0.28s infinite alternate;
}

.warning-left {
  top: 43%;
  left: 30%;
  animation: warningSlideLeft 0.22s infinite alternate;
}

.warning-right {
  top: 43%;
  right: 30%;
  animation: warningSlideRight 0.22s infinite alternate;
}

@keyframes warningPulse {
  from {
    opacity: 0.55;
    transform: translateX(-50%) scale(0.9, 0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1.22, 1.12);
  }
}

@keyframes warningSlideLeft {
  from {
    opacity: 0.55;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-8px);
  }
}

@keyframes warningSlideRight {
  from {
    opacity: 0.55;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(8px);
  }
}

#lock-state {
  color: #ffed6a;
  font-size: 14px;
  font-weight: 800;
}

#range-state {
  margin-top: 3px;
  color: #b8d8df;
  font-size: 12px;
}

.reticle {
  pointer-events: none;
  position: fixed;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 237, 106, 0.7);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 18px rgba(255, 237, 106, 0.28),
    inset 0 0 18px rgba(255, 237, 106, 0.12);
}

.reticle::before,
.reticle::after,
.reticle span::before,
.reticle span::after {
  position: absolute;
  display: block;
  content: "";
  background: rgba(255, 237, 106, 0.8);
}

.reticle::before {
  left: 50%;
  top: -14px;
  width: 1px;
  height: 18px;
}

.reticle::after {
  left: 50%;
  bottom: -14px;
  width: 1px;
  height: 18px;
}

.reticle span::before {
  left: -14px;
  top: 50%;
  width: 18px;
  height: 1px;
}

.reticle span::after {
  right: -14px;
  top: 50%;
  width: 18px;
  height: 1px;
}

.message {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 36px));
  transform: translate(-50%, -50%);
  padding: 20px 22px;
  text-align: center;
  border: 1px solid rgba(205, 249, 255, 0.28);
  background: rgba(6, 9, 12, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 8px;
}

.message.hidden {
  display: none;
}

.message h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 7vw, 42px);
  line-height: 1;
}

.message p {
  margin: 0;
  color: #b8d8df;
  font-size: 15px;
}

.cinematic {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  background: #020407;
}

.cinematic.hidden {
  display: none;
}

.cinematic video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cinematic-card {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 32px));
  padding: 26px 28px;
  text-align: center;
  border: 1px solid rgba(192, 246, 255, 0.35);
  background: rgba(4, 10, 14, 0.62);
  box-shadow: 0 0 42px rgba(82, 223, 255, 0.18);
  border-radius: 8px;
}

.cinematic-card h2 {
  margin: 0 0 8px;
  color: #f7feff;
  font-size: clamp(34px, 8vw, 72px);
  line-height: 1;
}

.cinematic-card p {
  margin: 0;
  color: #bceaf2;
  font-size: clamp(15px, 3vw, 22px);
}

.controls {
  pointer-events: none;
  position: fixed;
  z-index: 5;
  left: 20px;
  bottom: 16px;
  display: flex;
  max-width: calc(100vw - 40px);
  gap: 8px;
  flex-wrap: wrap;
}

.controls span {
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.32);
  border-radius: 4px;
  color: #d1e6eb;
  font-size: 12px;
}

.weapon-table {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 210px));
  gap: 8px;
  transform: translateX(-50%);
}

.weapon-table div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(192, 246, 255, 0.28);
  background: rgba(9, 21, 28, 0.58);
  backdrop-filter: blur(8px);
  border-radius: 5px;
}

.weapon-table span {
  color: #aee8f0;
  font-size: 11px;
}

.weapon-table strong {
  color: #f4feff;
  font-size: 13px;
}

.weapon-table b {
  color: #ffed6a;
  font-size: 13px;
}

@media (max-width: 760px) {
  .hud-top {
    inset: 0;
  }

  .round-info {
    top: 92px;
  }

  .controls {
    display: none;
  }

  .weapon-table {
    left: 10px;
    right: 10px;
    bottom: 10px;
    grid-template-columns: 1fr;
    transform: none;
  }

  .message p::after {
    display: block;
    margin-top: 6px;
    content: "Tap jump / slide move / auto beam";
  }
}
