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

html, body {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, #3a0c0c 0%, #120707 35%, #050505 100%);
  color: #ffffff;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.app-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.game-phone {
  width: min(100vw, 430px);
  height: min(100svh, 920px);
  aspect-ratio: 9 / 16;
  background: linear-gradient(180deg, rgba(18,18,18,0.98), rgba(8,8,8,0.98));
  border: 2px solid rgba(255, 80, 80, 0.45);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 30px rgba(255, 0, 0, 0.25),
    inset 0 0 25px rgba(255, 255, 255, 0.03);
}

.game-header {
  padding: 10px 12px 6px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
}

.game-logo {
  width: 100%;
  max-height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 60, 60, 0.45));
}

.hud {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 0 12px 10px;
}

.hud-box {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 80, 80, 0.18);
  backdrop-filter: blur(4px);
}

.game-area {
  position: relative;
  flex: 1;
  overflow: hidden;
  margin: 0 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 80, 80, 0.22);
  background-color: #0b0b0b;
  background-image:
    linear-gradient(rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    url("assets/bg-radio-pattern-tile.png");
  background-repeat: repeat;
  background-size: auto, 220px 220px;
  animation: scrollBg 10s linear infinite;
  touch-action: none;
}

@keyframes scrollBg {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 0, 0 220px;
  }
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 2px,
      rgba(0,0,0,0.00) 2px,
      rgba(0,0,0,0.00) 5px
    );
  opacity: 0.25;
  z-index: 1;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(35px);
  pointer-events: none;
  z-index: 1;
}

.glow-1 {
  width: 140px;
  height: 140px;
  top: 40px;
  left: -30px;
  background: rgba(255, 0, 0, 0.18);
}

.glow-2 {
  width: 120px;
  height: 120px;
  right: -20px;
  top: 180px;
  background: rgba(255, 255, 255, 0.10);
}

.player {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 84px;
  z-index: 4;
  background-image: url("assets/player-area0-catcher.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 0 10px rgba(255, 80, 80, 0.55));
}

.item {
  position: absolute;
  z-index: 3;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
}

.item.note {
  background-image: url("assets/item-note-musical.png");
}

.item.virus {
  background-image: url("assets/item-virus-digital.png");
}

.item.lightning {
  background-image: url("assets/item-lightning-red.png");
}

.item.bomb {
  background-image: url("assets/item-noise-bomb.png");
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
  z-index: 6;
}

.overlay.show {
  display: flex;
}

.overlay-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
  padding: 22px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 80, 80, 0.22);
  background: rgba(20, 20, 20, 0.94);
  box-shadow: 0 0 25px rgba(255, 0, 0, 0.18);
}

.overlay-card h1,
.overlay-card h2 {
  margin-bottom: 10px;
  color: #ffffff;
}

.overlay-card p {
  margin-bottom: 10px;
  color: #dddddd;
  line-height: 1.4;
}

.main-btn,
.back-btn {
  border: none;
  cursor: pointer;
  border-radius: 14px;
  font-weight: bold;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.main-btn:hover,
.back-btn:hover {
  transform: scale(1.03);
  opacity: 0.95;
}

.main-btn {
  margin-top: 8px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(180deg, #ff4040, #c41717);
  box-shadow: 0 0 16px rgba(255, 0, 0, 0.28);
}

.game-footer {
  padding: 12px 12px 16px;
  text-align: center;
}

.back-btn {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  color: #ffffff;
  background: linear-gradient(180deg, #2e2e2e, #171717);
  border: 1px solid rgba(255, 80, 80, 0.24);
}

.game-footer p {
  font-size: 0.88rem;
  color: #d7d7d7;
}

.credits-link {
  border: none;
  background: transparent;
  color: #ffffff;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.88rem;
  text-shadow: 0 0 8px rgba(255, 60, 60, 0.75);
}

.credits-link:hover {
  color: #ff4d4d;
}

.blood-effect,
.green-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

.blood-effect {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 0, 0, 0.8) 0 5px, transparent 6px),
    radial-gradient(circle at 74% 18%, rgba(255, 0, 0, 0.7) 0 8px, transparent 9px),
    radial-gradient(circle at 85% 62%, rgba(180, 0, 0, 0.7) 0 7px, transparent 8px),
    radial-gradient(circle at 28% 78%, rgba(255, 20, 20, 0.65) 0 9px, transparent 10px),
    radial-gradient(circle at 54% 42%, rgba(255, 0, 0, 0.35) 0 16px, transparent 18px),
    radial-gradient(circle at center, rgba(255, 0, 0, 0.12), transparent 55%);
  border: 4px solid rgba(255, 0, 0, 0.45);
}

.blood-effect.show {
  animation: bloodFlash 0.45s ease-out;
}

@keyframes bloodFlash {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  20% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

.green-flash {
  background:
    radial-gradient(circle at center, rgba(0, 255, 100, 0.42), rgba(0, 255, 100, 0.16) 35%, transparent 72%);
  box-shadow: inset 0 0 50px rgba(0, 255, 120, 0.7);
}

.green-flash.show {
  animation: greenFlash 0.28s ease-out;
}

@keyframes greenFlash {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.credits-modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 20;
}

.credits-modal.show {
  display: flex;
}

.credits-card {
  position: relative;
  width: min(92vw, 390px);
  padding: 28px 22px 24px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(255, 0, 0, 0.18), transparent 38%),
    linear-gradient(180deg, #151515, #050505);
  border: 1px solid rgba(255, 80, 80, 0.42);
  box-shadow:
    0 0 35px rgba(255, 0, 0, 0.28),
    inset 0 0 18px rgba(255, 255, 255, 0.04);
}

.credits-card h2 {
  margin-bottom: 14px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.credits-card p {
  margin-bottom: 10px;
  color: #dddddd;
  line-height: 1.45;
}

.credits-card a {
  color: #ff4d4d;
  font-weight: bold;
}

.close-credits {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.close-credits:hover {
  background: rgba(255, 0, 0, 0.45);
}

@media (max-width: 420px) {
  .hud-box {
    font-size: 0.8rem;
    padding: 7px 4px;
  }

  .player {
    width: 76px;
    height: 76px;
  }

  .game-logo {
    max-height: 62px;
  }
}