/* =================================
   BASE STYLES
   ================================= */

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

body {
  font-family: "Courier New", monospace;
  background: #f5f5dc;
  background-image: -webkit-repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  min-height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 20px;
}

/* =================================
   BUTTON STYLES
   ================================= */

button {
  font-size: 1.1rem;
  padding: 15px 40px;
  border: 3px solid #000;
  background: #fff;
  cursor: pointer;
  font-weight: bold;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  -webkit-box-shadow: 4px 4px 0px #000;
  box-shadow: 4px 4px 0px #000;
  -webkit-transition: all 0.1s ease;
  -o-transition: all 0.1s ease;
  transition: all 0.1s ease;
}

button:hover {
  -webkit-box-shadow: 2px 2px 0px #000;
  box-shadow: 2px 2px 0px #000;
  -webkit-transform: translate(2px, 2px);
  -ms-transform: translate(2px, 2px);
  transform: translate(2px, 2px);
}

button:active {
  -webkit-box-shadow: 0px 0px 0px #000;
  box-shadow: 0px 0px 0px #000;
  -webkit-transform: translate(4px, 4px);
  -ms-transform: translate(4px, 4px);
  transform: translate(4px, 4px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =================================
   GAME PAGE STYLES (game.html)
   ================================= */

#meta-panel {
  background: #fff;
  border: 3px solid #000;
  padding: 15px 30px;
  max-width: 600px;
  width: 100%;
  -webkit-box-shadow: 5px 5px 0px #000;
  box-shadow: 5px 5px 0px #000;
  margin-bottom: 20px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.meta-item {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: baseline;
  -ms-flex-align: baseline;
  align-items: baseline;
  gap: 8px;
}

.meta-label {
  font-size: 0.75rem;
  color: #666;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meta-value {
  font-size: 1.2rem;
  color: #000;
  font-weight: bold;
}

#game-container {
  background: #fafaf0;
  border: 3px solid #000;
  padding: 40px;
  text-align: center;
  max-width: 600px;
  width: 100%;
  -webkit-box-shadow: 5px 5px 0px #000;
  box-shadow: 5px 5px 0px #000;
  position: relative;
}

#question {
  font-size: 1.3rem;
  color: #000;
  margin-bottom: 40px;
  line-height: 1.8;
  font-weight: normal;
}

.button-container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 20px;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.sliding-button {
  -webkit-transition: -webkit-transform 0.3s ease;
  transition: -webkit-transform 0.3s ease;
  -o-transition: transform 0.3s ease;
  transition: transform 0.3s ease;
  transition:
    transform 0.3s ease,
    -webkit-transform 0.3s ease;
}

/* =================================
   LANDING PAGE STYLES (index.html)
   ================================= */

.game-over-message {
  background: #ff4444;
  color: #fff;
  padding: 15px 30px;
  margin-bottom: 20px;
  border: 3px solid #000;
  -webkit-box-shadow: 4px 4px 0px #000;
  box-shadow: 4px 4px 0px #000;
  font-weight: bold;
  text-align: center;
  font-size: 1.1rem;
  -webkit-animation: fadeIn 0.3s ease;
  animation: fadeIn 0.3s ease;
}

.victory-message {
  background: #44ff44;
  color: #000;
  padding: 20px 40px;
  margin-bottom: 20px;
  border: 3px solid #000;
  -webkit-box-shadow: 4px 4px 0px #000;
  box-shadow: 4px 4px 0px #000;
  font-weight: bold;
  text-align: center;
  font-size: 1.3rem;
  -webkit-animation: fadeIn 0.3s ease;
  animation: fadeIn 0.3s ease;
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

.initials-input {
  margin-bottom: 20px;
  text-align: center;
}

.initials-input label {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
  color: #000;
}

.initials-input input {
  font-family: "Courier New", monospace;
  font-size: 1.5rem;
  padding: 10px;
  width: 200px;
  text-align: center;
  border: 3px solid #000;
  background: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.initials-input input:focus {
  outline: none;
  -webkit-box-shadow: 0 0 0 2px #000;
  box-shadow: 0 0 0 2px #000;
}

#start-btn {
  font-size: 1.5rem;
  padding: 20px 50px;
  letter-spacing: 2px;
  -webkit-box-shadow: 5px 5px 0px #000;
  box-shadow: 5px 5px 0px #000;
}

#start-btn:hover {
  -webkit-box-shadow: 3px 3px 0px #000;
  box-shadow: 3px 3px 0px #000;
}

/* =================================
   HIGH SCORES TABLE
   ================================= */

.high-scores {
  margin-top: 40px;
  max-width: 600px;
  width: 100%;
}

.high-scores h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  background: #fafaf0;
  border: 3px solid #000;
  -webkit-box-shadow: 5px 5px 0px #000;
  box-shadow: 5px 5px 0px #000;
}

.score-table th {
  border-bottom: 3px solid #000;
  padding: 12px 10px;
  text-align: left;
  background: #fff;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.score-table tbody tr:last-child td {
  border-bottom: none;
}

.score-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

.score-rank {
  text-align: center;
  width: 50px;
  font-weight: bold;
}

.no-scores {
  text-align: center;
  padding: 20px;
  font-style: italic;
  opacity: 0.5;
}

/* =================================
   DEBUG PANEL STYLES
   ================================= */

.debug-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #f0f0f0;
  border: 3px solid #000;
  -webkit-box-shadow: 5px 5px 0px #000;
  box-shadow: 5px 5px 0px #000;
  z-index: 1000;
  width: 300px;
  max-height: 450px;
  overflow-y: auto;
}

.debug-header {
  background: #000;
  color: #fff;
  padding: 8px 12px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.debug-header h3 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
}

.debug-content {
  padding: 12px;
}

.debug-section {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #ccc;
}

.debug-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.debug-section h4 {
  margin: 0 0 8px 0;
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.debug-controls {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.debug-controls:last-child {
  margin-bottom: 0;
}

.debug-controls label {
  font-size: 0.75rem;
  color: #333;
  width: 100%;
  margin-bottom: 2px;
}

.debug-btn,
.debug-btn-small {
  background: #fff;
  color: #000;
  border: 2px solid #000;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: bold;
  cursor: pointer;
  -webkit-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

.debug-btn-small {
  padding: 5px 8px;
  font-size: 0.65rem;
  -webkit-box-flex: 0;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

.debug-btn:hover,
.debug-btn-small:hover {
  background: #000;
  color: #fff;
  -webkit-transform: translate(-2px, -2px);
  -ms-transform: translate(-2px, -2px);
  transform: translate(-2px, -2px);
  -webkit-box-shadow: 2px 2px 0px #000;
  box-shadow: 2px 2px 0px #000;
}

.debug-btn-danger {
  background: #ff4444;
  color: #fff;
}

.debug-btn-danger:hover {
  background: #cc0000;
  color: #fff;
}

.debug-select {
  background: #fff;
  border: 2px solid #000;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

.debug-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ffeb3b;
  border: 2px solid #000;
  padding: 10px 14px;
  font-size: 1.2rem;
  cursor: pointer;
  -webkit-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
  z-index: 999;
  -webkit-box-shadow: 3px 3px 0px #000;
  box-shadow: 3px 3px 0px #000;
}

.debug-toggle:hover {
  background: #ffc107;
  -webkit-transform: scale(1.1);
  -ms-transform: scale(1.1);
  transform: scale(1.1);
}

/* =================================
   MOBILE RESPONSIVE
   ================================= */

@media (max-width: 600px) {
  #meta-panel {
    padding: 12px 20px;
  }

  .meta-label {
    font-size: 0.65rem;
  }

  .meta-value {
    font-size: 1rem;
  }

  #game-container {
    padding: 30px 20px;
  }

  #question {
    font-size: 1.1rem;
  }

  button {
    font-size: 0.9rem;
    padding: 12px 30px;
  }

  #start-btn {
    font-size: 1.2rem;
    padding: 15px 40px;
  }

  .initials-input input {
    font-size: 1.2rem;
    width: 180px;
  }

  .high-scores h2 {
    font-size: 1.2rem;
  }

  .score-table th,
  .score-table td {
    padding: 8px 5px;
    font-size: 0.9rem;
  }
}
