/* ====== GLOBAL ====== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  background: radial-gradient(circle at top, #0047ab, #001f4d);
  font-family: "Arial Black", Impact, sans-serif;
  color: #ffd700;
  text-align: center;
}

.game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* ====== BACK BUTTON ====== */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 215, 0, 0.15);
  border: 2px solid #ffd700;
  border-radius: 8px;
  color: #ffd700;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  font-family: "Arial Black", Impact, sans-serif;
  transition: all 0.2s ease;
  z-index: 100;
}

.back-button:hover {
  background: #ffd700;
  color: #001f4d;
  transform: translateX(-4px);
}

.back-button svg {
  transition: transform 0.2s ease;
}

.back-button:hover svg {
  transform: translateX(-4px);
}

/* ====== QUESTION ====== */
h1 {
  font-size: clamp(28px, 5vw, 48px);
  margin: 30px 0 40px;
  text-shadow: 3px 3px 0 #000;
}

/* ====== ANSWER BOARD ====== */
#answers {
  list-style: none;
  padding: 0;
  margin: 0 auto 40px;
  max-width: 700px;
}

#answers li {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: linear-gradient(to bottom, #1a1a1a, #000);
  border: 3px solid #ffd700;
  border-radius: 14px;

  font-size: clamp(18px, 4vw, 28px);
  padding: 15px 20px;
  margin: 14px 0;

  box-shadow:
    0 0 10px rgba(255, 215, 0, 0.6),
    inset 0 0 10px rgba(0, 0, 0, 0.8);

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ====== CORRECT FLASH ====== */
.correct {
  animation: flashGlow 0.6s ease-in-out 3;
}

@keyframes flashGlow {
  0% {
    box-shadow:
      0 0 10px rgba(255, 215, 0, 0.6),
      inset 0 0 10px rgba(0, 0, 0, 0.8);
  }
  50% {
    box-shadow:
      0 0 30px rgba(255, 255, 255, 1),
      0 0 60px rgba(255, 215, 0, 1),
      inset 0 0 10px rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
  }
  100% {
    box-shadow:
      0 0 10px rgba(255, 215, 0, 0.6),
      inset 0 0 10px rgba(0, 0, 0, 0.8);
  }
}

/* ====== CONTROLS ====== */
.controls {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

input {
  font-size: clamp(16px, 3vw, 22px);
  padding: 12px;
  width: min(320px, 100%);
  border-radius: 8px;
  border: 2px solid transparent;
  outline: none;
  text-align: center;
  background: #1a1a1a;
  color: #ffd700;
  transition: border-color 0.2s ease;
}

input:focus {
  border-color: #ffd700;
}

input::placeholder {
  color: rgba(255, 215, 0, 0.5);
}

button {
  font-size: clamp(16px, 3vw, 22px);
  padding: 12px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;

  background: linear-gradient(to bottom, #ffd700, #c9a600);
  color: #000;
  font-weight: bold;

  box-shadow: 0 4px 0 #8c7600;
  transition: all 0.15s ease;
}

button:hover {
  background: linear-gradient(to bottom, #ffe44d, #ffd700);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #8c7600;
}

button:active {
  transform: translateY(4px);
  box-shadow: none;
}

/* ====== SCOREBOARD ====== */
.scoreboard {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

h2 {
  font-size: clamp(20px, 4vw, 32px);
  margin: 10px 0;
  text-shadow: 2px 2px 0 #000;
}

#score,
#strikes {
  color: #fff;
}

/* ====== STRIKE SHAKE ====== */
.strike {
  animation: shake 0.4s;
  color: red !important;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
  100% { transform: translateX(0); }
}

/* ====== BIG RED X OVERLAY ====== */
#bigX {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: clamp(150px, 30vw, 220px);
  font-family: Impact, Arial Black, sans-serif;
  color: red;
  text-shadow:
    0 0 20px rgba(255, 0, 0, 0.8),
    0 0 40px rgba(255, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
}

#bigX.show {
  animation: showX 0.6s ease-out;
}

@keyframes showX {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ====== ENDGAME OVERLAY ====== */
#endgame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

#endgame.hidden {
  display: none;
}

.endgame-box {
  background: linear-gradient(to bottom, #1a1a1a, #000);
  border: 4px solid #ffd700;
  border-radius: 16px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  text-align: center;

  box-shadow:
    0 0 30px rgba(255, 215, 0, 0.8),
    inset 0 0 15px rgba(0, 0, 0, 0.8);
  
  animation: popIn 0.4s ease;
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.endgame-box h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 20px;
}

.hint-title {
  font-size: clamp(18px, 3vw, 26px);
  margin-bottom: 10px;
}

#passwordHint {
  font-size: clamp(20px, 4vw, 28px);
  color: #fff;
  font-weight: bold;
  margin: 20px 0 30px;
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 8px;
  line-height: 1.4;
}

.endgame-box button {
  font-size: 22px;
  padding: 12px 30px;
}

/* ====== MOBILE ====== */
@media (max-width: 600px) {
  .back-button {
    top: 10px;
    left: 10px;
    padding: 8px 12px;
  }
  
  .back-button span {
    display: none;
  }
  
  .scoreboard {
    gap: 30px;
  }
  
  .endgame-box {
    padding: 25px;
  }
}
