* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #000050;
  color: #222;
}

.page-wrap {
  min-height: 100vh;
  padding: 10px 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.game-card {
  width: 100%;
  max-width: 900px;
  background: #fff8e8;
  border-radius: 18px;
  padding: 16px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.home-link {
  display: inline-block;
  margin-bottom: 18px;
  color: #000050;
  font-weight: bold;
  text-decoration: none;
}

.home-link:hover {
  text-decoration: underline;
}

.bottom-home-link {
  margin-left: auto;
  align-self: center;
}

.program-label {
  margin: 0 0 8px;
  color: #b45f06;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h1 {
  margin: 0 0 12px;
  color: #000050;
  font-size: 2rem;
}

.instructions {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 22px;
}

.loading-message {
  padding: 16px;
  background: #fff;
  border: 1px solid #e0d2aa;
  border-radius: 10px;
}

.matching-form {
  display: grid;
  gap: 5px;
}

.matching-row {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  background: #ffffff;
  border: 2px solid #e4d4aa;
  border-radius: 9px;
}

.question-text {
  font-size: 1.05rem;
  font-weight: bold;
}

.answer-select {
  width: 100%;
  padding: 5px;
  font-size: .90rem;
  border: 2px solid #999;
  border-radius: 8px;
  background: #fff;
}

.feedback {
  grid-column: 1 / -1;
  font-weight: bold;
  min-height: 1em;
  font-size: .9rem;
}

.matching-row.correct {
  border-color: #2e7d32;
  background: #edf8ee;
}

.matching-row.correct .feedback {
  color: #2e7d32;
}

.matching-row.incorrect {
  border-color: #b00020;
  background: #fff0f0;
}

.matching-row.incorrect .feedback {
  color: #b00020;
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

button {
  padding: 12px 22px;
  font-size: 1.05rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

#grade-button {
  background: #ffb000;
  color: #000050;
}

#grade-button:hover {
  background: #ffd45a;
}

#reset-button {
  background: #000050;
  color: white;
}

#reset-button:hover {
  background: #1c1c88;
}

.results-box {
  margin-top: 22px;
  font-size: 1.15rem;
  font-weight: bold;
  color: #000050;
}

@media (max-width: 700px) {
  .game-card {
    padding: 20px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .matching-row {
    grid-template-columns: 1fr;
  }
}