body,
html {
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

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

a {
  text-decoration: none;
}

/* Header styles */

.top-header-section {
  height: 2rem;
  background: linear-gradient(96deg, #00c8b3 0%, #b0d219 100%);
}

.site-header {
  position: relative;
}

.header-inner {
  height: 4.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  z-index: 2;
  position: relative;
  padding: 0 6.25rem;
}

.header-scallop {
  position: absolute;
  bottom: -2rem;
  left: 0;
  width: 100%;
  display: block;
  z-index: 2;
}

.header-logo {
  width: 7.5rem;
  height: auto;
}

.login-register-links {
  display: flex;
  gap: 0.5rem;
}

.login-link,
#start-game,
#submit-answer,
#next-level {
  display: flex;
  padding: 0.75013rem 1.5rem 0.81238rem 1.5625rem;
  justify-content: center;
  align-items: center;
  background: linear-gradient(96deg, #00c8b3 0%, #b0d219 100%);
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.4);
  color: #fff;
}

.dashboard-link,
.answer-btn {
  display: flex;
  padding: 0.875rem 1.25rem;
  justify-content: center;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid #00c8b3;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.4);
  color: #000;
}

/* Auth pages styles */

.auth-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image:
    linear-gradient(rgba(196, 246, 218, 0.85), rgba(196, 246, 218, 0.85)),
    url("../images/shared/hero-bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  background-position: center;
}

.auth-wrapper > * {
  position: relative;
  z-index: 1;
}

/* Home page styles */

.home-hero {
  background-image:
    linear-gradient(rgba(196, 246, 218, 0.85), rgba(196, 246, 218, 0.85)),
    url("../images/shared/hero-bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  background-position: center;
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  padding-left: 6.25rem;
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero .text-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.home-hero .text-section .play-learn-shine {
  display: flex;
  padding: 0.75rem 1.25rem;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #000;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 2px 2px 0 0 #000;
  backdrop-filter: blur(17px);
}

.home-hero .text-section .play-learn-shine .green-bullet {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: linear-gradient(96deg, #00c8b3 0%, #b0d219 100%);
}

.home-hero .text-section .play-learn-shine p {
  font-size: 0.875rem;
  text-transform: capitalize;
}

.home-hero h1 {
  font-size: 3.875rem;
  font-weight: 700;
  margin-top: 1.5rem;
  text-transform: capitalize;
}

.home-hero h1 span {
  width: 14.1875rem;
  height: 5.0625rem;
  padding: 0.75rem 1rem;
  display: inline-block;
  transform: rotate(-4deg);
  border: 3px solid #00ce37;
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.2);
  color: #00ce37;
  font-size: 2.875rem;
  position: relative;
  top: -0.5rem;
}

.hero-login-register-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.home-hero-image {
  width: 100%;
}

/* Learn page styles */

.learn-page-container {
  min-height: 100%;
  background-color: #f5f7fa;
  display: flex;
  justify-content: center;
  padding: 5rem 2rem;
}

.top-left-circle {
  position: absolute;
  width: 18.75rem;
  height: 18.75rem;
  aspect-ratio: 1/1;
  border-radius: 18.75rem;
  opacity: 0.4;
  background: #00c8b3;
  filter: blur(150px);
  top: 0;
  left: 0;
}

.bottom-right-circle {
  width: 18.75rem;
  height: 18.75rem;
  aspect-ratio: 1/1;
  border-radius: 18.75rem;
  opacity: 0.4;
  background: linear-gradient(96deg, #00c8b3 0%, #b0d219 100%);
  filter: blur(150px);
  position: absolute;
  right: 0;
  bottom: 0;
}

#game-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#game-setup h2 {
  text-align: center;
  font-size: 2.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.green-wiggle {
  width: 22rem;
}

.option-group {
  margin-top: 3.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.option-group h3 {
  font-size: 2rem;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.option {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  border: 1px solid #00c8b3;
  background: #fff;
  box-shadow: 8px 8px 0 0 #34c759;
}

.option button {
  border: 1px solid #00c8b3;
  background: #fff;
  box-shadow: 2px 2px 0 0 rgba(52, 199, 89, 0.2);
  width: 7rem;
  color: #00c8b3;
  font-size: 0.875rem;
  display: inline-block;
  justify-self: flex-end;
}

.option button.selected {
  background: #00c8b3;
  color: #fff;
}

#start-game {
  width: 20rem;
  margin: 2rem 0;
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

#start-game.enabled {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

#game-screen {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

#game-ui {
  margin: 2rem 0;
}

#progress-wrapper {
  width: 100%;
  max-width: 600px;
  height: 14px;
  background: #e6e6e6;
  border-radius: 7px;
  overflow: hidden;
  margin: 1rem auto;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  transition: width 0.4s ease;
}

#path {
  position: relative;
  height: 120px;
  background: linear-gradient(to right, #dff3ff, #fff7cc);
  border-radius: 12px;
  overflow: hidden;
  flex: 1;
}

#question {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.answer-btn,
#submit-answer,
#next-level {
  display: inline-block;
  margin-top: 1rem;
  align-self: center;
}

.answer-btn:first-of-type {
  margin-top: 2rem;
}

#character {
  position: absolute;
  left: 0;
  bottom: 10px;
  width: 60px;
  height: 60px;

  background: url("../images/learn/spelling-person.png") no-repeat center /
    contain;

  /* IMPORTANT FIXES */
  transform: translateX(0); /* define initial state */
  will-change: transform; /* hint for smooth updates */
  transition: transform 0.4s ease; /* smooth movement */
}

#treasure {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 60px;
  height: 60px;
  background: url("../images/learn/maths-person.png") no-repeat center / contain;
}

#feedback {
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  min-height: 2rem;
}

.feedback-correct {
  color: #2e7d32;
}

.feedback-wrong {
  color: #c62828;
}

@keyframes jump {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0);
  }
}

.character-jump {
  animation: jump 0.4s ease;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 0px gold;
  }
  50% {
    box-shadow: 0 0 20px gold;
  }
  100% {
    box-shadow: 0 0 0px gold;
  }
}

.treasure-glow {
  animation: glow 1s ease infinite;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}

.input-shake {
  animation: shake 0.3s;
  border-color: #e74c3c;
}

.feedback-hint {
  color: #2c3e50;
  font-style: italic;
}

.feedback-streak {
  color: #e67e22;
  font-weight: bold;
}

.level-summary {
  text-align: center;
}

.level-summary h2 {
  margin-bottom: 0.5rem;
}

.tts-btn {
  margin: 2rem 0 1.5rem;
}

/* Dashboard page styles */

.game-dashboard {
  max-width: 800px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
}

.game-dashboard h2 {
  margin: 1.5rem 0 1rem;
}

.subject-card {
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.badge-list li,
.activity-list li {
  margin-bottom: 0.5rem;
  margin-left: 1rem;
}

@media (max-width: 1024px) {
  .header-inner {
    padding: 0 3rem;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .home-hero-image {
    max-width: 480px;
    margin: 2rem auto 0;
  }

  .home-hero h1 {
    font-size: 3rem;
  }

  .home-hero h1 span {
    font-size: 2.25rem;
    width: auto;
    height: auto;
  }

  .options {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  #progress-wrapper {
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  /* Header */
  .header-inner {
    padding: 0 1.25rem;
    height: auto;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-logo {
    width: 6rem;
  }

  .login-register-links {
    width: 100%;
    justify-content: center;
  }

  /* Home Hero */
  .home-hero {
    padding: 2rem 1.25rem;
    text-align: center;
  }

  .home-hero .text-section {
    align-items: center;
  }

  .home-hero h1 {
    font-size: 2.25rem;
  }

  .home-hero h1 span {
    font-size: 1.75rem;
    transform: rotate(-2deg);
    margin-top: 0.5rem;
  }

  .hero-login-register-links {
    flex-direction: column;
    width: 100%;
  }

  .hero-login-register-links a {
    width: 100%;
  }

  /* Learn / Game Setup */
  .learn-page-container {
    padding: 3rem 1rem;
  }

  #game-setup h2 {
    font-size: 2rem;
  }

  .green-wiggle {
    width: 14rem;
  }

  .option {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 1rem;
  }

  .option button {
    width: 100%;
  }

  #start-game {
    width: 100%;
  }

  /* Game UI */
  #path {
    height: 90px;
  }

  #character,
  #treasure {
    width: 48px;
    height: 48px;
  }

  #feedback {
    font-size: 1.2rem;
  }

  input#typed-answer {
    width: 100%;
    max-width: 280px;
  }

  /* Dashboard */
  .game-dashboard {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .home-hero h1 {
    font-size: 1.9rem;
  }

  .home-hero h1 span {
    font-size: 1.4rem;
  }

  #feedback {
    font-size: 1.1rem;
  }

  .answer-btn,
  #submit-answer,
  #next-level {
    width: 100%;
  }

  .tts-btn {
    width: 100%;
  }
}
