@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 50%, #16213e 100%);
  font-family: "Orbitron", monospace;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(255, 20, 147, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(0, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(57, 255, 20, 0.05) 0%,
      transparent 70%
    );
  animation: ambientGlow 8s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes ambientGlow {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }
  100% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.game-container {
  position: relative;
  border: 3px solid #00ffff;
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5),
    inset 0 0 30px rgba(0, 255, 255, 0.1);
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.8),
    rgba(26, 10, 46, 0.8)
  );
  padding: 10px;
  animation: screenFlicker 0.1s infinite alternate;
}

@keyframes screenFlicker {
  0% {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5),
      inset 0 0 30px rgba(0, 255, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.7),
      inset 0 0 35px rgba(0, 255, 255, 0.15);
  }
}

canvas {
  display: block;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
  position: relative;
}

.scan-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 255, 0.03) 2px,
    rgba(0, 255, 255, 0.03) 4px
  );
  pointer-events: none;
  border-radius: 10px;
}

.title-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Orbitron", monospace;
  font-weight: 900;
  font-size: 2rem;
  color: #ff1493;
  text-shadow: 0 0 10px #ff1493, 0 0 20px #ff1493, 0 0 30px #ff1493;
  animation: titlePulse 2s ease-in-out infinite alternate;
  letter-spacing: 3px;
}

@keyframes titlePulse {
  0% {
    text-shadow: 0 0 10px #ff1493, 0 0 20px #ff1493, 0 0 30px #ff1493;
  }
  100% {
    text-shadow: 0 0 20px #ff1493, 0 0 30px #ff1493, 0 0 40px #ff1493;
  }
}

/* Credits Popup Styles */
.credits-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  z-index: 1000;
  border-radius: 10px;
}

.credits-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    145deg,
    rgba(26, 10, 46, 0.95),
    rgba(15, 15, 15, 0.95)
  );
  border: 3px solid #00ffff;
  border-radius: 15px;
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.6),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
  padding: 30px;
  width: 450px;
  text-align: center;
  animation: creditsPopIn 0.3s ease-out;
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes creditsPopIn {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.credits-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #ff1493;
  font-size: 24px;
  cursor: pointer;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  text-shadow: 0 0 10px #ff1493;
  transition: all 0.2s ease;
}

.credits-close:hover {
  color: #ff6600;
  text-shadow: 0 0 15px #ff6600;
  transform: scale(1.1);
}

.credits-title {
  font-family: "Orbitron", monospace;
  font-weight: 900;
  font-size: 24px;
  color: #39ff14;
  text-shadow: 0 0 15px #39ff14;
  margin-bottom: 25px;
  letter-spacing: 2px;
}

.credits-company {
  margin-bottom: 25px;
}

.credits-company-logo {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 2px solid #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
  margin-bottom: 10px;
}

.credits-company-name {
  font-family: "Orbitron", monospace;
  font-weight: 700;
  font-size: 18px;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
  letter-spacing: 1px;
}

.credits-team {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
}

.credits-person {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.credits-avatar {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid #ff1493;
  box-shadow: 0 0 15px rgba(255, 20, 147, 0.4);
  margin-bottom: 10px;
  object-fit: cover;
}

.credits-name {
  font-family: "Orbitron", monospace;
  font-weight: 700;
  font-size: 14px;
  color: #bf00ff;
  text-shadow: 0 0 8px #bf00ff;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.credits-role {
  font-family: "Orbitron", monospace;
  font-weight: 400;
  font-size: 11px;
  color: #00ffff;
  text-shadow: 0 0 5px #00ffff;
  letter-spacing: 0.5px;
  text-align: center;
  max-width: 120px;
  line-height: 1.3;
}

.credits-assets {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid rgba(0, 255, 255, 0.3);
}

.credits-assets-title {
  font-family: "Orbitron", monospace;
  font-weight: 700;
  font-size: 16px;
  color: #ffff00;
  text-shadow: 0 0 10px #ffff00;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.credits-assets-text {
  font-family: "Orbitron", monospace;
  font-weight: 400;
  font-size: 12px;
  color: #39ff14;
  text-shadow: 0 0 5px #39ff14;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* Cutscene Styles */
#cutscene-container {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  display: none;
  z-index: 1000;
}

.cutscene-scene {
  width: 100%;
  height: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 2px solid #34495e;
  overflow: hidden;
  backdrop-filter: blur(2px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #ecf0f1;
}

.cutscene-loading-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #7f8c8d;
  font-size: 18px;
  text-align: center;
}

.cutscene-object {
  position: absolute;
  z-index: 10;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  backface-visibility: hidden;
  transition: all var(--animation-duration, 1000ms)
    var(--animation-easing, ease-in-out) var(--animation-delay, 0ms);
}

.cutscene-object img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.cutscene-object.placeholder {
  background: #7f8c8d;
  border: 2px dashed #95a5a6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  min-width: 60px;
  min-height: 40px;
}

.cutscene-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cutscene-text-content {
  position: absolute;
  text-align: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  max-width: 80%;
  font-size: 18px;
  line-height: 1.6;
  z-index: 100;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: white;
  user-select: none;
  transform: translate(-50%, -50%);
}

.cutscene-continue-button {
  position: absolute;
  padding: 12px 24px;
  background: #3498db;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  z-index: 9999 !important;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
  user-select: none;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.cutscene-continue-button:hover {
  background: #2980b9;
  transform: translate(-50%, -50%) translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

.cutscene-choice-button {
  position: absolute;
  padding: 12px 20px;
  background: #e74c3c;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
  user-select: none;
  z-index: 9999 !important;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.cutscene-choice-button:hover {
  background: #c0392b;
  transform: translate(-50%, -50%) translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5);
}

.cutscene-choice-button.text-choice {
  background: #e74c3c;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.cutscene-choice-button.text-choice:hover {
  background: #c0392b;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

.cutscene-choice-button.graphic-choice {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  transition: filter 0.2s !important;
  z-index: 9999 !important;
  /* FIXED: Keep the centering transform, but don't let JS override it */
  transform: translate(-50%, -50%) !important;
  /* FIXED: Ensure the button area is clickable */
  min-width: 40px;
  min-height: 40px;
}

.cutscene-choice-button.graphic-choice:hover {
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) !important;
  /* FIXED: Keep centering transform on hover */
  transform: translate(-50%, -50%) !important;
}

.cutscene-choice-button.missing-graphic {
  background: #7f8c8d;
  border: 2px dashed #bdc3c7;
  color: white;
  font-weight: bold;
  width: 100px;
  height: 40px;
  font-size: 12px;
}

.cutscene-choice-button.missing-graphic:hover {
  background: #95a5a6;
}
