:root {
  --oxford-primary: #1E4488;
  --oxford-shade:   #1B365F;
  --crown-gold:     #FFCF00;
  --crown-gold-dk:  #EAAB00;
  --white: #ffffff;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--oxford-shade);
  color: var(--crown-gold);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Navigation Bar */
.top-nav {
  background-color: var(--oxford-primary);
  color: var(--white);
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: auto;
}

.nav-logo img {
  height: 75px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: var(--crown-gold);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--white);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background-color: var(--oxford-primary);
    position: absolute;
    top: 60px;
    right: 0;
    width: 220px;
    padding: 1rem;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.35);
  }

  .nav-links.show {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

/* Game Box */
.game-box {
  max-width: 640px;
  margin: 2rem auto;
  background: var(--oxford-primary);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(0,0,0,0.25), 0 0 0 2px var(--crown-gold-dk) inset;
  text-align: center;
  position: relative;
  color: var(--crown-gold);
}

h1 {
  color: var(--crown-gold);
  margin: 0 0 1rem 0;
}

p {
  margin: 0.5rem 0;
}

input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 1rem;
  background: var(--white);
  color: var(--oxford-shade);
  border: 2px solid var(--crown-gold-dk);
  border-radius: 8px;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

input::placeholder {
  color: #7a8aa6;
}

input:focus {
  border-color: var(--crown-gold);
  box-shadow: 0 0 0 3px rgba(255,207,0,0.25);
}

button {
  margin: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  background-color: var(--crown-gold);
  color: var(--oxford-shade);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.05s ease;
}

button:hover {
  background-color: var(--crown-gold-dk);
}

button:active {
  transform: translateY(1px);
}

button:focus {
  outline: 3px solid rgba(255,207,0,0.6);
  outline-offset: 2px;
}

#feedback {
  margin-top: 1rem;
  font-weight: 700;
}

#progress {
  margin-top: 0.5rem;
  color: var(--crown-gold);
  font-weight: 600;
}

.badge {
  display: inline-block;
  background: var(--oxford-shade);
  color: var(--crown-gold);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin-top: 1rem;
  font-weight: 800;
  border: 2px solid var(--crown-gold-dk);
  letter-spacing: 0.3px;
}

.badge.animated {
  animation: badgePop 0.6s ease-out;
}

@keyframes badgePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1.1); opacity: 1; }
}

#hint {
  margin-top: 0.5rem;
  font-style: italic;
  color: var(--crown-gold);
  opacity: 0.85;
}

#congratsMessage {
  display: none;
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--crown-gold);
  margin-top: 2rem;
  text-shadow: 0 0 10px rgba(255,207,0,0.35);
  animation: pop 0.6s ease-out;
}

#restartBtn {
  display: none;
  margin-top: 1rem;
}

@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* XP Progress Bar */
#xpBarContainer {
  width: 100%;
  background-color: var(--oxford-shade);
  border-radius: 8px;
  margin-top: 1rem;
  height: 14px;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
}

#xpBar {
  height: 100%;
  background-color: var(--crown-gold);
  width: 0%;
  border-radius: 8px;
  transition: width 0.4s ease;
}

/* Confetti */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--crown-gold);
  animation: fall 3s linear infinite;
  opacity: 0.9;
  border-radius: 2px;
}

.confetti:nth-child(odd) {
  width: 12px;
  height: 12px;
  border-radius: 0;
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(600px) rotate(360deg); }
}
