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

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

body {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  background-color: #000022;
  /* CRT scanline overlay */
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  color: #FFD700;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ============================================================
   HOST PANEL  (left ~35%)
   ============================================================ */
.leaderboard-panel {
  flex: 0 0 35%;
  background: #001133;
  border-right: 6px solid #FFD700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 1.25rem;
  position: relative;
  overflow: hidden;
}

/* Pixel-border inner glow */
.leaderboard-panel::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 3px solid rgba(255, 215, 0, 0.2);
  pointer-events: none;
}

.leaderboard-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: #FFD700;
  text-shadow: 0 0 10px #FFD700, 2px 2px 0 #994400;
  letter-spacing: 4px;
}

.leaderboard-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 0;
  background: #000077;
  border: 2px solid #003399;
  border-bottom: 3px solid #001166;
  border-right: 3px solid #001166;
  padding: 0.4rem 0.5rem;
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  color: #CCE0FF;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

/* Top 3 get gold / silver / bronze tints */
.leaderboard-list li:nth-child(1) { color: #FFD700; border-color: #FFD700; border-bottom-color: #AA9000; border-right-color: #AA9000; }
.leaderboard-list li:nth-child(2) { color: #C0C0C0; border-color: #C0C0C0; border-bottom-color: #707070; border-right-color: #707070; }
.leaderboard-list li:nth-child(3) { color: #CD7F32; border-color: #CD7F32; border-bottom-color: #7A4A1A; border-right-color: #7A4A1A; }

/* Player's inserted row */
.leaderboard-list li.player-entry {
  color: #00FF66;
  border-color: #00FF66;
  border-bottom-color: #007733;
  border-right-color: #007733;
  background: #003300;
  animation: lb-flash 0.6s steps(1) 3;
}

@keyframes lb-flash {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.lb-rank  { flex: 0 0 2ch;  text-align: right; margin-right: 0.6rem; opacity: 0.7; }
.lb-name  { flex: 1;        text-align: left;  letter-spacing: 2px; }
.lb-score { flex: 0 0 4ch;  text-align: right; }

/* ============================================================
   GAME PANEL  (right ~65%)
   ============================================================ */
.game-panel {
  flex: 1;
  background: #00008B;   /* Jeopardy board blue */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  gap: 0;
  text-align: center;
}

/* ---- Title ---- */
h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.3rem;
  color: #FFD700;
  text-shadow: 3px 3px 0 #994400, 0 0 20px #FFD700;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

h1 .subtitle {
  font-size: 0.75rem;
  color: #FFFFFF;
  text-shadow: 2px 2px 0 #003380;
  letter-spacing: 4px;
}

/* ---- Start / End screens ---- */
#start-screen,
#end-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.intro {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: #FFFFFF;
  text-shadow: 1px 1px 0 #003380;
  line-height: 2;
  letter-spacing: 1px;
}

#end-screen h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1rem;
  color: #FFD700;
  text-shadow: 3px 3px 0 #994400;
  line-height: 1.8;
}

#final-score {
  font-size: 2rem;
  color: #FFFFFF;
  text-shadow: 2px 2px 0 #003380;
}

/* ---- Progress bar ---- */
.progress {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 1rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: #FFD700;
  text-shadow: 1px 1px 0 #994400;
  letter-spacing: 1px;
}

/* ---- Question card (Jeopardy clue tile) ---- */
.question-card {
  width: 100%;
  background: #0000AA;
  border: 4px solid #FFD700;
  /* pixelated double-border effect */
  box-shadow:
    0 0 0 2px #003399,
    0 0 0 6px #FFD700,
    0 0 30px rgba(255, 215, 0, 0.25),
    inset 0 0 40px rgba(0, 0, 80, 0.5);
  padding: 1.75rem;
}

#question-text {
  font-size: 1.6rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: #FFFFFF;
  text-shadow: 1px 1px 0 rgba(0,0,100,0.8);
  text-transform: uppercase;
}

/* ---- Answer buttons ---- */
#answers-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.answer-btn {
  background: #000077;
  color: #FFD700;
  border: 3px solid #FFD700;
  border-bottom: 5px solid #AA9000;  /* pressed-key bevel */
  border-right: 5px solid #AA9000;
  padding: 0.75rem 0.75rem;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  text-transform: uppercase;
  transition: filter 0.12s, transform 0.1s;
  image-rendering: pixelated;
}

.answer-btn:hover:not(:disabled) {
  background: #0000AA;
  color: #FFFFFF;
  border-color: #FFFFFF;
  border-bottom-color: #AAAAAA;
  border-right-color: #AAAAAA;
  filter: brightness(1.2);
  transform: translateY(-2px);
}

.answer-btn:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 3px;
  border-right-width: 3px;
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.correct {
  background: #004400;
  color: #00FF66;
  border-color: #00FF66;
  border-bottom-color: #007700;
  border-right-color: #007700;
  text-shadow: 0 0 8px #00FF66;
}

.answer-btn.incorrect {
  background: #440000;
  color: #FF4444;
  border-color: #FF4444;
  border-bottom-color: #880000;
  border-right-color: #880000;
  text-shadow: 0 0 8px #FF4444;
}

/* ---- Feedback ---- */
#feedback {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  min-height: 1.5rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
  line-height: 2;
  text-transform: uppercase;
}

.feedback-correct   { color: #00FF66; text-shadow: 0 0 10px #00FF66; }
.feedback-incorrect { color: #FF4444; text-shadow: 0 0 10px #FF4444; }

/* ---- Shared action buttons ---- */
#start-button,
#next-button,
#restart-button {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  background: #FFD700;
  color: #000033;
  border: 4px solid #FFFFAA;
  border-bottom: 6px solid #AA9000;
  border-right: 6px solid #AA9000;
  padding: 0.9rem 1.8rem;
  cursor: pointer;
  letter-spacing: 1px;
  line-height: 1.6;
  text-transform: uppercase;
  transition: filter 0.12s, transform 0.1s;
}

#start-button:hover:not(:disabled),
#next-button:hover,
#restart-button:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

#start-button:active,
#next-button:active,
#restart-button:active {
  transform: translateY(3px);
  border-bottom-width: 3px;
  border-right-width: 3px;
}

#start-button:disabled {
  background: #555533;
  color: #888866;
  border-color: #666644;
  cursor: default;
  transform: none;
  filter: none;
}

/* ============================================================
   RESPONSIVE  (narrow screens stack panels vertically)
   ============================================================ */
@media (max-width: 700px) {
  .layout {
    flex-direction: column;
  }
  .leaderboard-panel {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 6px solid #FFD700;
    padding: 1rem;
  }
  .leaderboard-list li {
    font-size: 1rem;
    padding: 0.3rem 0.4rem;
  }
  h1 {
    font-size: 0.9rem;
  }
}