*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --primary: #5088B9;
  --secondary: #7afcff;
  --background: #D3EEE6;
  --text: #2e2e2e;
}

body {
  font-family: 'Verdana', sans-serif;
  background: #D3EEE6;
  color: #2e2e2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(242, 247, 245, 0);
  transition: all 0.3s ease;
  z-index: 1000;
}

.header.scrolled {
  background: rgba(242, 247, 245, 0.96);
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Galindo', sans-serif;
  font-size: 1.8rem;
  color: #5088B9;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  height: 60px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(-120deg, #f8a85f, #F6963C);
  color: white;
  text-decoration: none;
  font-size: 0.8rem;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  background: linear-gradient(-120deg, #F6963C, #F48115);
  color: #294966;
}

.nav-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.container {
  max-width: 650px;
  width: 100%;
  height: auto;
  padding: 2rem;
  background: #F2F7F5;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  margin: 2rem auto;
}

.container-2 {
  max-width: 650px;
  width: 100%;
  padding: 2rem;
  background: #F2F7F5;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  margin: 1.5rem auto;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.tab {
  display: inline-block;
  padding-left: 1.5rem; /* Adjust to control tab size */
}

h1 {
color: #5088B9;
font-size: 2.2rem;
margin-bottom: 2rem;
font-family: 'Galindo', sans-serif;
}

h2 {
color: #C45645;
font-size: 1.6rem;
margin-top: 1.5rem;
margin-bottom: 1.5rem;
font-family: 'Galindo', sans-serif;
}

h3 {
color: #C45645;
font-size: 1.4rem;
margin-top: 1rem;
margin-bottom: 0.8rem;
font-family: 'Galindo', sans-serif;
}

.controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

select, button {
  padding: 1rem 1rem;
  background: #FEF4EC;
  border: 5px solid #F9B577;
  transition: 0.2s;
  border-radius: 20px;
  font-size: 1.2rem;
  cursor: pointer;
  width: 180px;
}

button:hover {
  background: linear-gradient(120deg, #F9B577, #F6963C);
  border: 5px solid #F6963C;
  transition: all 0.4s ease;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-area {
  text-align: center;
}

.question {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 2rem 0;
  color: #5088B9;
}

#answer {
  font-size: 1.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  width: 300px;
  text-align: center;
  border: 5px solid #F9B577;
  border-radius: 20px;
}

.operations-container {
  margin: 1.5rem 0;
}

.op-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.operation-btn {
  padding: 1rem 1.5rem;
  background: #FEF4EC;
  border: 5px solid #F9B577;
  border-radius: 15px;
  font-size: 1.5rem;
  cursor: pointer;
}

.operation-btn:hover {
  background: #F9B577;
  color: white;
}

.feedback {
  margin: 1rem 0;
  font-size: 1.5rem;
}

.score, .timer {
  font-size: 1.4rem;
  margin: 0.5rem 0;
}

.high-score {
  font-size: 1.2rem;
  margin: 2rem 0;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning-numbers {
  position: fixed;
  font-size: 2rem;
  color: #5088B9;
  opacity: 0.3;
  animation: spin 10s linear infinite;
  z-index: -5;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 420px;
  transform: translate(-50%, -50%);
  background: #F0F9F7;
  border: 4px solid #F9B577;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-align: center;
  z-index: 1000;
}

.modal h2 {
  color: #C45645;
  font-family: 'Galindo', sans-serif;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
}

.modal p {
  font-size: 1.5rem;
  margin: 0.7rem 0;
}

.modal button {
  display: inline-block;
  margin-top: 2rem;
  padding: 10px;
  font-size: 1.5rem;
  background: #345E83;
  color: white;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.4s ease;
  border: none;
  margin-bottom: 1.5rem;
}

.modal button:hover {
  color: white;
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  background: linear-gradient(120deg, #345E83, #5088B9);
}

.modal button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.star {
  font-size: 2rem;
  color: gold;
  animation: bounce 2s infinite;
  display: inline-block;
}

footer {
  width: 100%;
  background: #F2F7F5;
  padding: 1rem 0;
  text-align: center;
  border-top: 2px solid #F9B577;
  margin-top: auto;
  position: relative;
  bottom: 0;
}

footer a {
  color: #5088B9;
  text-decoration: none;
  margin: 0 1rem;
  font-size: 0.9rem;
}

footer a:hover {
  text-decoration: underline;
  color: #F48115;
  transition: 0.3s;
}

.page-container {
  max-width: 1000px;
  width: 100%;
  margin: 10rem auto 2rem;
  padding: 2rem;
  flex: 1;
}

.page-container h1 {
  color: #5088B9;
  margin-bottom: 2rem;
}

.page-container p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* unvisited link */
a:link {
  color: #5088B9;
}

/* mouse over link */
a:hover {
  color: #F48115;
}

/* Solid border */
.hr.solid {
  border-top: 1px solid #F48115;
  opacity: 0.5;
}

/* ═════════  DROPDOWN (mobile)  ═════════ */

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  line-height: 1;
  background: none;
  border: none;
  color: #5088B9;
  cursor: pointer;
  padding-left: 0.5rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 15px;
  background: #F2F7F5;
  border: 1px solid #ddd;
  padding: 5rem 2rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 999;
  border-radius: 20px;
}
.dropdown-menu a {
  display: block;
  padding: 0.6rem 1.2rem;
  margin: 0.2rem 0;
  color: #2e2e2e;                  /* readable on light background  */
  text-decoration: none;
}
.dropdown-menu a:hover { background: #EFEFEF; }

/* keep hamburger blue – override generic <button> styles */
.menu-toggle,
.menu-toggle:focus,
.menu-toggle:hover,
.menu-toggle:active {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  color: #5088B9 !important;
}

@media (max-width: 768px) {

  /* 1 — shrink header after scroll (class added by JS) */
  header {
    transition: padding 0.8s ease, height 0.8s ease, background 0.8s ease;
  }
  header.shrink {
    padding: 8px 15px;
  }
  header.shrink .logo       { font-size: 1.4rem; }
  header.shrink .logo-img   { height: 40px; }

  /* 2 — layout: logo ▢ hamburger, hide full nav */
  .header-content {
    justify-content: flex-start;
    gap: 0.6rem;
  }
  .nav-links   { display: none; }   /* never show big nav on mobile */
  .menu-toggle { display: block; margin-left: 0; }

  /* 3 — show dropdown when JS adds .open */
  .dropdown-menu.open { display: block; }
  }

  .logo {
    transition: font-size 0.4s ease, transform 0.6s ease;
  }

  .logo-img {
    transition: height 0.4s ease, transform 0.6s ease;
  }

