@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'VT323', monospace;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: #18120A;
  background-image: 
    linear-gradient(45deg, #241a0e 25%, transparent 25%, transparent 75%, #241a0e 75%, #241a0e),
    linear-gradient(45deg, #241a0e 25%, transparent 25%, transparent 75%, #241a0e 75%, #241a0e);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  animation: gradientShift 5s ease infinite;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.app {
  max-width: 12000px;
  margin: 0 auto;
  padding: 12px;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  max-height: 100vh;
  overflow: hidden;
}


header {
  text-align: center;
  margin-bottom: 12px;
  padding: 8px 0;
}

header h1 {
  font-family: 'VT323', monospace;
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 900;
  text-shadow:
    4px 4px 0px #3f3f3f,
    -2px -2px 0px #000;
  letter-spacing: 4px;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
}

header p {
  opacity: 0.95;
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 700;
  text-shadow: 2px 2px 0px #000;
  color: #00eaff;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 1px;
  margin-top: 8px;
}

main {
  background: #C6C6C6;
  color: #3f3f3f;
  border: 4px solid #000;
  box-shadow: inset 4px 4px #fff, inset -4px -4px #555;
  border-radius: 0;
  padding: 8px;
  font-size: 30px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px;

  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-items: center;
  /* max-height: calc(101vh - 120px); */
  /* overflow: hidden; */
}


.game-center {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
  grid-column: 2;
}

.game-container {
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 100%;
}

:fullscreen .game-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: auto;
  padding-bottom: 0;
  /* 1200/2000 = 60% maintains aspect ratio (fallback) */
  aspect-ratio: 2000 / 1200;
  /* Maintain 2000:1200 aspect ratio (modern browsers) */
  border-radius: 0;
  overflow: hidden;
  background: #87CEEB;
  border: 4px solid #222;
  box-shadow: none;
}


@supports (aspect-ratio: 1) {
  .game-wrapper {
    padding-bottom: 0;
    height: auto;
  }
}


#gameCanvas {
  outline: none;
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  object-fit: contain;
  image-rendering: pixelated;
  
}


.game-title {
  font-family: 'VT323', monospace;
}


.menu-screen {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);

  z-index: 10;
}

.menu-content {
  background: rgba(0, 0, 0, 0.5);
  padding: 40px 50px;
  border-radius: 0;
  border: 4px solid #fff;
  text-align: center;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}


.game-title {
  font-family: 'VT323', monospace;
  font-size: clamp(90px, 14vw, 180px);
  font-weight: 900;
  color: #fff;
  text-shadow: 4px 4px #3f3f3f;
  margin-bottom: 24px;
  transform: skewX(-5deg);
  text-align: center;
  width: 100%;
  line-height: 1;
  letter-spacing: 4px;
}


.menu-content h3 {
  font-family: 'VT323', monospace;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 900;
  color: #fff;
  text-shadow:
    4px 4px #000;
  margin: 20px 0 24px 0;
  letter-spacing: 3px;
  text-transform: uppercase;
}


.char-select {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin: 24px 0;
  background-size: 300px 300px;
}

.char-option {
  background: #8b8b8b;
  border-radius: 0;
  padding: 20px;
  width: 160px;
  height: 200px;
  cursor: pointer;
  border: 4px solid #333;
  box-shadow: inset 4px 4px #aaa, inset -4px -4px #333;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.char-option:hover {
  background: #999;
}

.char-option.selected {
  border: 4px solid #fff;
  background: #a0a0a0;
  box-shadow: inset 4px 4px #ccc, inset -4px -4px #555;
}

.preview-box {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  border-radius: 12px;
}




.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  border-radius: 30px;
}

.btn-main {
  background: #7d7d7d;
  color: white;
  border: 4px solid #000;
  border-top-color: #dbdbdb;
  border-left-color: #dbdbdb;
  border-right-color: #5b5b5b;
  border-bottom-color: #5b5b5b;
  border-radius: 0;
  padding: 24px 120px;
  font-size: 36px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
  font-family: 'VT323', monospace;
  letter-spacing: 2px;
  text-transform: none;
}

.btn-main:active {
  border-top-color: #5b5b5b;
  border-left-color: #5b5b5b;
  border-right-color: #dbdbdb;
  border-bottom-color: #dbdbdb;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  padding: 8px 18px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}


.info {
  width: 100%;
  max-width: 300px;
  font-family: 'VT323', monospace;
  grid-column: 1;
  font-size: 24px;
  justify-self: start;
  color: #fff;
  text-shadow: 2px 2px 0px #000;
}

.info h2 {
  margin: 12px 0 8px;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0px #000;
}

.info ul {
  padding-left: 18px;
  font-size: 24px;
}

.info li {
  margin-bottom: 6px;
  line-height: 1.5;
}


footer {
  text-align: center;
  margin-top: 20px;
  opacity: 0.7;
}


.char-preview {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

.char-preview img {
  width: 100px;
  height: 100px;
  image-rendering: pixelated;
  object-fit: contain;

}


.info.boxed.fancy {
  background: #8b8b8b;
  border-radius: 0;
  padding: 24px;
  border: 4px solid #333;
  box-shadow: inset 4px 4px #aaa, inset -4px -4px #333;
  width: 280px;

}


.enemy-select-panel {
  grid-column: 3;
  width: 100%;
  max-width: 280px;
  background: #8b8b8b;
  border-radius: 0;
  padding: 24px;
  border: 4px solid #333;
  box-shadow: inset 4px 4px #aaa, inset -4px -4px #333;
  text-align: center;
  justify-self: flex-start;
}

.enemy-select-panel h3 {
  font-family: 'VT323', monospace;
  font-size: 24px;
  margin-bottom: 16px;
  text-shadow: 2px 2px 0px #aaa;
  color: #333;
  font-weight: 900;
  letter-spacing: 2px;
}

.enemy-select-panel select {
  width: 100%;
  padding: 22px 30px;
  font-size: 24px;
  border-radius: 0;
  border: 2px solid #000;
  font-weight: 800;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: inset 2px 2px #ddd;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 45px;
}

.enemy-select-panel select:hover {
  background: #eee;
}

.enemy-select-panel select:focus {
  outline: none;
  border-color: #000;
  box-shadow: none;
}

.enemy-select-panel select:active {
  transform: translateY(0);
}



#game-fullscreen-layer:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #399cd6;
}


#game-fullscreen-layer:fullscreen .game-wrapper {
  width: min(100vw, calc(100vh * 2000 / 1200));
  height: min(100vh, calc(100vw * 1200 / 2000));
  aspect-ratio: 2000 / 1200;
  max-width: none;
  max-height: none;
}

#game-fullscreen-layer:fullscreen #gameCanvas {
  width: 100%;
  height: 100%;
}


#game-fullscreen-layer:fullscreen .game-container {
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

#gameOverUI {
  position: absolute;
  inset: 0;
  background: rgba(40, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 10;
}

#gameOverUI button {
  padding: 12px 30px;
  font-size: 20px;
  cursor: pointer;
}


.score-hud,
#scoreHUD {
  position: absolute;
  top: 18px;
  left: 22px;
  right: auto;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: #fff;
  padding: 16px 24px;
  border-radius: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 20;
  font-weight: 800;
  box-shadow: 0 6px 22px rgba(8, 12, 30, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(6px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.score-hud {
  z-index: 120 !important;
}

.score-label {
  font-size: 18px;
  opacity: 0.9;
}

.score-value {
  font-size: 32px;
}


.pulse {
  animation: pulse 220ms ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}


.score-popup {
  position: absolute;
  left: 8px;
  top: -20px;
  background: linear-gradient(180deg, #ffd966, #ffb84d);
  color: #2b1b00;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 900;
  transform: translateY(0) scale(0.98);
  opacity: 0;
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1), opacity 260ms ease;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28), 0 2px 0 rgba(255, 255, 255, 0.06) inset;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.score-popup.show {
  transform: translateY(-30px) scale(1.04);
  opacity: 1;
}

.score-popup::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: -6px;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle at 30% 30%, #fff9c4, #ffd966);
  border-radius: 50%;
  opacity: 0.95;
  transform: scale(0.8);
}

.menu-score {
  display: none !important;
}

#pauseUI {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.pause-box {
  background: #8b8b8b;
  padding: 32px 64px;
  border: 4px solid #000;
  box-shadow: inset 4px 4px #aaa, inset -4px -4px #333;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-radius: 0;
}

.pause-box h2 {
  font-family: 'VT323', monospace;
  font-size: 120px;
  margin: 0;
  text-shadow: 4px 4px #000;
  letter-spacing: 4px;
  line-height: 1;
  color: #fff;
}

.pause-instruction {
  font-family: 'VT323', monospace;
  font-size: 48px;
  color: #fff;
  text-shadow: 2px 2px #000;
  opacity: 1;
  margin: 0;
}

#gameOverUI {
  position: absolute;
  inset: 0;
  background: rgba(40, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 60;
  backdrop-filter: blur(6px) saturate(120%);
}

#gameOverUI h1 {
  font-size: 140px;
  margin: 0 0 8px 0;
  letter-spacing: 2px;
  text-shadow: 4px 4px #000;
  transform: translateY(-6px) scale(0.98);
  animation: popIn 420ms cubic-bezier(.2, .9, .2, 1) forwards;
}

#gameOverUI p {
  font-size: 48px;
  margin: 0 0 18px 0;
  opacity: 0.95;
}

.gameover-buttons button {
  padding: 24px 60px;
  font-size: 48px;
  margin: 12px;
  border-radius: 0;
  cursor: pointer;
  background: #7d7d7d;
  border: 4px solid #000;
  border-top-color: #dbdbdb;
  border-left-color: #dbdbdb;
  border-right-color: #5b5b5b;
  border-bottom-color: #5b5b5b;
  color: #fff;
  text-shadow: 2px 2px #000;
  font-weight: 400;
  box-shadow: none;
  font-family: 'VT323', monospace;
  transition: all 0.15s ease;
}

.gameover-buttons button:hover {
  background: #999;
  transform: scale(1.1);
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.gameover-buttons button:active {
  transform: scale(0.95);
  border-top-color: #5b5b5b;
  border-left-color: #5b5b5b;
  border-right-color: #dbdbdb;
  border-bottom-color: #dbdbdb;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.final-card {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #111827, #0b1220);
  color: #fff;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  min-width: 86px;
}

.final-card .final-label {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 800;
  letter-spacing: 1px;
}

.final-card .final-value {
  font-size: 26px;
  font-weight: 900;
  margin-top: 4px;
  color: #ffd966;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.final-card.pop {
  animation: finalPop 560ms cubic-bezier(.2, .9, .2, 1);
}

@keyframes finalPop {
  0% {
    transform: translateY(-6px) scale(0.96);
    opacity: 0;
  }

  60% {
    transform: translateY(2px) scale(1.06);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

:root {
  --accent-1: #ff7a00;
  --accent-2: #ffd84d;
  --bg-1: #0f1724;
  --glass: rgba(255, 255, 255, 0.06);
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.menu-screen .menu-content {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 0;
  padding: 52px 36px;
  box-shadow: none;
  border: 4px solid #fff;
  max-width: 840px;
  margin: 14px auto;
  position: relative;
}

.game-title {
  font-family: 'VT323', monospace;
  font-size: clamp(90px, 14vw, 180px);
  text-align: center;
  margin: 12px 0 24px 0;
  color: #fff;
  font-weight: 900;
  text-shadow:
    4px 4px #3f3f3f;
  letter-spacing: 4px;
  transform: skewX(-5deg);
  line-height: 1;
}

.char-select {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin: 8px 0 20px 0;
}

.char-option {
  width: 160px;
  height: 200px;
  background: #8b8b8b;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px;
  box-shadow: inset 4px 4px #aaa, inset -4px -4px #333;
  cursor: pointer;
  transition: none;
}

.char-option.selected {
  transform: none;
  box-shadow: inset 4px 4px #ccc, inset -4px -4px #555;
  border: 4px solid #fff;
}

.char-option .char-preview {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.char-option .char-preview img {
  max-width: 100px;
  max-height: 100px;
  width: 100px;
  height: 100px;
  display: block;
  object-fit: contain;
}

.char-option span {
  margin-top: 8px;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-family: 'Righteous', 'Montserrat', sans-serif;
  letter-spacing: 1px;
}

.menu-buttons {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.btn-main {
  background: #7d7d7d;
  color: #fff;
  padding: 20px 60px;
  border-radius: 0;
  font-weight: 900;
  font-size: 28px;
  border: 4px solid #000;
  border-top-color: #dbdbdb;
  border-left-color: #dbdbdb;
  border-right-color: #5b5b5b;
  border-bottom-color: #5b5b5b;
  box-shadow: none;
  cursor: pointer;
  font-family: 'VT323', monospace;
  letter-spacing: 2px;
  text-transform: none;
}

.btn-main:hover {
  transform: none;
  background: #8e8e8e;
}

.enemy-select {
  position: absolute;
  right: 22px;
  top: 720px;
}

.enemy-select select {
  padding: 10px 14px;
  font-size: 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #fff, #f3f3f3);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
  font-weight: 800;
}


.game-wrapper {
  border-radius: 0;
  padding: 14px;
  background: #87CEEB;
  box-shadow: none;
}

.game-container {
  border-radius: 0;
  overflow: hidden;
}

#scoreHUD {
  left: 18px;
  top: 18px;
  right: auto;
  min-width: 84px;
}

.score-value {
  font-weight: 900;
  color: #fff;
}

.char-option:hover {
  transform: none;
  background: #999;
}


.score-hud,
#scoreHUD {
  position: absolute;
  top: 12px;
  left: 12px;
  right: auto;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0;
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 120 !important;
  font-weight: 800;
  box-shadow: none;
  backdrop-filter: blur(6px) saturate(120%);
  border: 4px solid #fff;
  pointer-events: auto;
  cursor:pointer;
}



.score-hud.shine {
  animation: shine 520ms ease;
}

@keyframes shine {
  0% {
    box-shadow: 0 6px 22px rgba(8, 12, 30, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  }

  50% {
    box-shadow: 0 14px 40px rgba(255, 210, 90, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
  }

  100% {
    box-shadow: 0 6px 22px rgba(8, 12, 30, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.02);
    transform: translateY(0);
  }
}


.hearts-container {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 12px;
  z-index: 120;
  pointer-events: none;
}

.heart {
  width: 48px;
  height: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff4444' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(4px 4px 0 #000);
}

.heart.lost {
  filter: grayscale(100%) brightness(50%) drop-shadow(2px 2px 0 #000);
  opacity: 0.5;
}

#musicBtn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: 'VT323', monospace;
  font-size: 24px;
  padding: 12px 24px;
  background: #7d7d7d;
  color: #fff;
  border: 4px solid #000;
  border-top-color: #dbdbdb;
  border-left-color: #dbdbdb;
  border-right-color: #5b5b5b;
  border-bottom-color: #5b5b5b;
  cursor: pointer;
  z-index: 200;
  text-shadow: 2px 2px #000;
}

#musicBtn:active {
  border-top-color: #5b5b5b;
  border-left-color: #5b5b5b;
  border-right-color: #dbdbdb;
  border-bottom-color: #dbdbdb;
}

.score-label {
  font-size: 32px;
  color: #ffd700;
  text-shadow: 2px 2px 0 #000;
}

.score-value {
  font-size: 56px;
  color: #fff;
  text-shadow: 4px 4px 0 #000;
}

.kills-hud {
  top: 110px !important;
  left: 18px !important;
}

