* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05070a;
  color: #f4f7fb;
  font-family:
    Inter, "Segoe UI", "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
}

button {
  font: inherit;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hud__top {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.meter {
  min-width: 104px;
  border: 1px solid rgba(147, 183, 214, 0.36);
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  padding: 8px 10px;
}

.meter span {
  display: block;
  color: #91a5b7;
  font-size: 11px;
  line-height: 1;
}

.meter strong {
  display: block;
  margin-top: 4px;
  color: #f5fbff;
  font-size: 20px;
  line-height: 1;
}

.message {
  position: absolute;
  left: 50%;
  bottom: 88px;
  width: min(560px, calc(100vw - 32px));
  min-height: 28px;
  transform: translateX(-50%);
  text-align: center;
  color: #f5fbff;
  font-size: 15px;
  text-shadow: 0 2px 8px #000;
}

.objective {
  position: absolute;
  top: 88px;
  left: 18px;
  width: min(360px, calc(100vw - 36px));
  border-left: 3px solid #e1f45b;
  background: rgba(7, 10, 14, 0.68);
  padding: 9px 12px;
  text-shadow: 0 2px 8px #000;
}

.objective span {
  display: block;
  color: #91a5b7;
  font-size: 11px;
  line-height: 1;
}

.objective strong {
  display: block;
  margin-top: 4px;
  color: #f4f7fb;
  font-size: 14px;
  line-height: 1.35;
}

.look-hint {
  position: absolute;
  top: 18px;
  right: 18px;
  max-width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(225, 244, 91, 0.42);
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.72);
  color: #f4f7fb;
  padding: 9px 12px;
  font-size: 13px;
  text-shadow: 0 2px 8px #000;
}

.look-hint.is-hidden {
  display: none;
}

.mini-map {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(147, 183, 214, 0.36);
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.mini-map__cell {
  width: 7px;
  height: 7px;
  background: rgba(95, 111, 119, 0.18);
}

.mini-map__cell.is-wall {
  background: rgba(125, 143, 151, 0.62);
}

.mini-map__cell.is-door {
  background: #bd3333;
}

.mini-map__cell.is-exit {
  background: #38e4d8;
}

.mini-map__cell.is-key {
  background: #ff3040;
}

.mini-map__cell.is-player {
  background: #e1f45b;
  box-shadow: 0 0 10px rgba(225, 244, 91, 0.85);
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(245, 252, 255, 0.88);
  box-shadow: 0 0 8px rgba(83, 208, 255, 0.55);
}

.crosshair::before {
  left: 10px;
  top: 2px;
  width: 2px;
  height: 18px;
}

.crosshair::after {
  left: 2px;
  top: 10px;
  width: 18px;
  height: 2px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(2, 4, 7, 0.48), rgba(2, 4, 7, 0.72)),
    radial-gradient(circle at 50% 30%, rgba(66, 144, 170, 0.18), transparent 34%),
    #05070a;
}

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

.overlay__panel {
  width: min(560px, 100%);
  border: 1px solid rgba(162, 198, 222, 0.36);
  border-radius: 8px;
  background: rgba(9, 13, 18, 0.88);
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.eyebrow {
  margin: 0 0 10px;
  color: #66d9ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.08;
}

.overlay p {
  color: #d7e3ec;
  line-height: 1.75;
}

#startButton {
  width: 160px;
  height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 6px;
  background: #e1f45b;
  color: #10130c;
  font-weight: 800;
  cursor: pointer;
}

.damage-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 36, 36, 0);
  transition: background 120ms ease;
}

.damage-flash.is-active {
  background: rgba(255, 36, 36, 0.24);
}

@media (max-width: 560px) {
  .hud__top {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 6px;
  }

  .meter {
    min-width: calc(50% - 3px);
    padding: 7px 8px;
  }

  .meter strong {
    font-size: 18px;
  }

  .overlay__panel {
    padding: 22px;
  }

  .objective {
    top: 124px;
    left: 10px;
  }

  .look-hint {
    top: auto;
    right: 10px;
    bottom: 100px;
  }

  .mini-map {
    right: 10px;
    bottom: 10px;
  }
}
