/* ==============================================
 * FONT DEFINITIONS
 * ============================================== */
@font-face {
  font-family: 'Distant Galaxy';
  src: url("fonts/SF%20Distant%20Galaxy.ttf") format("truetype");
}

@font-face {
  font-family: 'Distant Galaxy Outline';
  src: url("fonts/SF%20Distant%20Galaxy%20Outline.ttf") format("truetype");
}

/* ==============================================
 * BASE STYLES AND BACKGROUND EFFECTS
 * ============================================== */
body {
  font-family: 'Distant Galaxy', sans-serif;
  margin: 0;
  padding: 2em;
  background-color: #1a1a1a;
  color: #ff0000;
  background: linear-gradient(135deg, #000000, #1a1a1a 40%, #000000);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  perspective: 1000px;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 0, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 0, 0.05) 0%, transparent 50%),
    repeating-linear-gradient(45deg,
      transparent,
      transparent 10px,
      rgba(255, 0, 0, 0.03) 10px,
      rgba(255, 0, 0, 0.03) 20px);
  z-index: 1;
  pointer-events: none;
}

/* ==============================================
 * TYPOGRAPHY AND HEADING STYLES
 * ============================================== */
h1 {
  font-family: 'Distant Galaxy Outline', sans-serif;
  text-transform: uppercase;
  letter-spacing: 5px;
  text-align: center;
  color: #ff1a1a;
  text-shadow:
    0 0 10px rgba(255, 0, 0, 0.7),
    0 0 20px rgba(255, 0, 0, 0.5),
    0 0 30px rgba(255, 0, 0, 0.3),
    2px 2px 2px rgba(0, 0, 0, 0.5);
  margin-bottom: 1em;
  position: relative;
  z-index: 2;
  transform: translateZ(50px);
  transition: transform 0.3s ease;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 2px;
  background: linear-gradient(90deg,
      transparent,
      #ff0000,
      transparent);
  box-shadow: 0 0 15px #ff0000;
}

p {
  text-align: center;
  color: #a3a3a3;
  margin-bottom: 2em;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9em;
  position: relative;
  z-index: 2;
}

/* ==============================================
 * BUTTON AND INTERACTIVE ELEMENTS
 * ============================================== */
button {
  font-family: 'Distant Galaxy';
  padding: 15px 30px;
  border: 2px solid #ff0000;
  background-color: rgba(26, 26, 26, 0.9);
  color: #ff0000;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  clip-path: polygon(10px 0,
      calc(100% - 10px) 0,
      100% 10px,
      100% calc(100% - 10px),
      calc(100% - 10px) 100%,
      10px 100%,
      0 calc(100% - 10px),
      0 10px);
}

button:hover {
  background-color: rgba(255, 0, 0, 0.1);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.5),
    inset 0 0 15px rgba(255, 0, 0, 0.5);
  transform: scale(1.02);
}

/* ==============================================
 * GAME BUTTON AREA AND CONTROLS
 * ============================================== */
#startBtn,
#stopBtn {
  display: block;
  margin: 0 auto 2em auto;
  min-width: 200px;
  background: linear-gradient(45deg,
      rgba(26, 26, 26, 0.9),
      rgba(40, 40, 40, 0.9));
}

#gameButtonArea {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

#gameButtonArea>button {
  height: 200px;
  width: 200px;
  border: 3px solid rgba(255, 0, 0, 0.5);
  transition: all 0.3s ease;
  background: linear-gradient(135deg,
      rgba(26, 26, 26, 0.9),
      rgba(40, 40, 40, 0.9));
  position: relative;
}

#gameButtonArea>button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      transparent 30%,
      rgba(255, 0, 0, 0.1) 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

#gameButtonArea>button:hover::after {
  opacity: 1;
}

[id^="button"]:active,
[id^="button"].lit {
  background: radial-gradient(circle,
      #ff0000 0%,
      #cc0000 100%) !important;
  box-shadow: 0 0 30px #ff0000,
    inset 0 0 20px rgba(255, 255, 255, 0.5);
  border-color: #ff3333;
  transform: scale(0.95);
}

/* ==============================================
 * PROGRESS BAR STYLES
 * ============================================== */
#progressContainer {
  width: 80%;
  max-width: 600px;
  margin: 0 auto 2em auto;
  text-align: center;
}

#progressBar {
  width: 100%;
  height: 20px;
  background: rgba(255, 0, 0, 0.1);
  border: 2px solid #ff0000;
  margin: 10px auto;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: #ff0000;
  transition: width 0.3s ease;
  box-shadow: 0 0 15px #ff0000;
}

#progressText {
  color: #ff0000;
  font-size: 0.9em;
  text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* ==============================================
 * MODAL AND OVERLAY STYLES
 * ============================================== */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.game-modal.visible {
  opacity: 1;
}

.modal-content {
  background: #1a1a1a;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
  border: 1px solid rgba(255, 0, 0, 0.2);
}

.game-modal.visible .modal-content {
  transform: translateY(0);
}

.modal-content h2 {
  font-family: 'Distant Galaxy', sans-serif;
  color: #ff1a1a;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.3;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.modal-content button {
  background: #1a1a1a;
  color: #ff1a1a;
  border: 1px solid #ff1a1a;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9em;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

.modal-content button:hover {
  background: #ff1a1a;
  color: #1a1a1a;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

.game-modal.win .modal-content {
  background: #1a1a1a;
  border-color: rgba(255, 0, 0, 0.4);
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
}

.game-modal.lose .modal-content {
  background: #1a1a1a;
  border-color: rgba(255, 0, 0, 0.2);
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}

/* ==============================================
 * DIFFICULTY SELECTOR STYLES
 * ============================================== */
.difficulty-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 1em auto;
  justify-content: center;
}

.difficulty-section h2 {
  margin: 0;
  font-size: 0.8em;
  font-family: 'Distant Galaxy', sans-serif;
  color: #ff1a1a;
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
}

.select-container {
  position: relative;
  width: 200px;
}

#difficultySelect {
  width: 100%;
  font-family: 'Distant Galaxy', sans-serif;
  padding: 12px 35px 12px 15px;
  background-color: rgba(26, 26, 26, 0.9);
  color: #ff0000;
  border: 2px solid #ff0000;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.3s ease;
  clip-path: polygon(10px 0,
      calc(100% - 10px) 0,
      100% 10px,
      100% calc(100% - 10px),
      calc(100% - 10px) 100%,
      10px 100%,
      0 calc(100% - 10px),
      0 10px);
}

#difficultySelect:hover {
  background-color: rgba(255, 0, 0, 0.1);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.5),
    inset 0 0 15px rgba(255, 0, 0, 0.5);
  transform: scale(1.02);
}

#difficultySelect:focus {
  outline: none;
  background-color: rgba(255, 0, 0, 0.15);
}

.select-arrow {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #ff0000;
  font-size: 0.7em;
  pointer-events: none;
  text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* ==============================================
 * UTILITY CLASSES
 * ============================================== */
.hidden {
  display: none !important;
}