/* =========================
   BASE & IMPORTS
   ========================= */
 
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/pacifico-latin.woff2') format('woff2');
}
 
/* =========================
   CONTAINER
   ========================= */
 
.container {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
 
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
 
.home-active.container {
  background: linear-gradient(160deg, #ede7fa 0%, #ddd0f7 50%, #e4dcf7 100%);
  margin: 0 auto;
  width: 100%;
  max-width: 420px;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 24px) 16px;
  box-sizing: border-box;
  overflow-y: auto;
  scroll-behavior: auto;
}
 
.container.game-active {
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}
 
/* =========================
   HOME TOP SECTION
   ========================= */
 
.home-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: 48px;
  padding-bottom: 24px;
  flex-shrink: 0;
}

.title-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
  padding: 0 16px;
  box-sizing: border-box;
}

/* =========================
   HOME BOTTOM SECTION
   ========================= */
 
.home-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 40px;
  padding-bottom: 8px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.score-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 20px;
  margin-top: 24px;
}

/* =========================
   TYPOGRAPHY
   ========================= */
 
h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  font-family: 'Pacifico', cursive;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: 1.5px;
  color: var(--color-primary);
  margin: 0 auto 24px;
  padding: 0 12px;
  width: 100%;
  box-sizing: border-box;

}
 
.home-active.container h1 {
  padding-top: 0;
}
.title-note {
    font-size: 1.1rem;
    color: var(--color-primary);
    text-align: center;
    margin: 2px auto;
}
 
.subtitle {
  font-size: 1rem;
  color: #6a53a7;
  margin: 0 auto 20px;
  text-align: center;
  font-style: italic;
  letter-spacing: 0.02em;
  padding: 0 8px;
}
 
/* =========================
   SCORE DISPLAYS
   ========================= */
 
#highScoreDisplay,
#highestLevelDisplay {
    font-size: 1.05rem;
    font-weight: 700;
    color: #6959e0;
    text-align: center;
    padding: 12px 20px;
    margin: 2px auto; /* reduced gap */
    width: 75%;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(108, 92, 231, 0.2);
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(108, 92, 231, 0.1);
    backdrop-filter: blur(4px);
    box-sizing: border-box;
}
 
#highestLevelDisplay {
  color: #854ec4;
  background: rgba(255, 240, 255, 0.6);
  border-color: rgba(156, 92, 231, 0.2);
}
 
/* =========================
   MENU
   ========================= */
 
.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
 
/* =========================
   BUTTONS
   ========================= */
 
#playBtn,
#howToPlayBtn,
#continueBtn,
#restartGameBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  width: 100%;
  max-width: 360px;
  padding: 16px 24px;
  margin: 0 auto;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(90deg, var(--color-primary) 0%, #7e68bc 100%);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.3);
  transition: background 0.25s, transform 0.12s, box-shadow 0.2s;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  letter-spacing: 0.02em;
}
 
/* Primary CTA buttons */
#playBtn,
#continueBtn {
  font-size: 1.2rem;
  padding: 18px 32px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.35);
  background: linear-gradient(90deg, #8656f0 0%, var(--color-primary) 100%);
}
 
/* Icons */
#playBtn .menu-icon,
#howToPlayBtn .menu-icon,
#restartGameBtn .menu-icon {
  font-size: 1.3em;
}
 
#continueBtn .continue-icon {
  font-size: 1.4em;
}
 
/* Hover */
#playBtn:hover,
#howToPlayBtn:hover,
#continueBtn:hover,
#restartGameBtn:hover {
  background: linear-gradient(90deg, #5c4cd6 0%, #8f72dd 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
}
 
/* Active */
#playBtn:active,
#howToPlayBtn:active,
#continueBtn:active,
#restartGameBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}
 
/* =========================
   RESPONSIVE — MOBILE SMALL
   max-width: 400px
   ========================= */
 
@media (max-width: 400px) {
  .home-active.container {
    padding-left: 12px;
    padding-right: 12px;
  }
 
  h1 {
    font-size: clamp(1.8rem, 9vw, 2.4rem);
    margin-bottom: 4px;
  }
 
  .subtitle {
    font-size: 0.8em;
    line-height: 1;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 2px !important;
    box-shadow: none !important;
    display: inline;
  }
 
  #highScoreDisplay,
  #highestLevelDisplay {
    font-size: 0.9rem;
    padding: 10px 14px;
    margin: 4px auto;
    width: 85%;
    border-radius: 14px;
  }
 
  #playBtn,
  #howToPlayBtn,
  #continueBtn,
  #restartGameBtn {
    font-size: 0.95rem;
    padding: 14px 16px;
    border-radius: 12px;
  }
 
  .menu {
    gap: 10px;
  }
 
  .home-bottom {
    gap: 8px;
  }
}
 
/* =========================
   RESPONSIVE — MOBILE
   max-width: 600px
   ========================= */
 
@media (max-width: 600px) {
  .container {
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    max-width: 100vw;
    overflow: hidden;
  }
 
  .home-active.container {
    max-width: 100vw;
    justify-content: flex-start;
  }
 
  .container.game-active {
    margin: 0;
    padding: 0;
    overflow-y: auto;
  }
 
  h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    padding: 0 8vw;
  }
 
  .subtitle {
    font-size: 0.95em;
    margin-bottom: 16px;
  }
 
  #highScoreDisplay,
  #highestLevelDisplay {
    width: 80%;
    font-size: 0.95rem;
    padding: 11px 16px;
  }
 
  #playBtn,
  #howToPlayBtn,
  #continueBtn,
  #restartGameBtn {
    max-width: 100%;
    width: 100%;
    font-size: 1rem;
    padding: 16px 0;
    border-radius: 12px;
  }
 
  #playBtn,
  #continueBtn {
    font-size: 1.15rem;
    padding: 18px 0;
  }
 
  .menu {
    gap: 10px;
    width: 100%;
  }
 
  .home-bottom {
    gap: 10px;
    padding-bottom: 16px;
  }
 
  .home-top {
    padding-top: 16px;
  }
}
 
/* =========================
   RESPONSIVE — TABLET
   min-width: 601px, max-width: 1024px
   ========================= */
 
@media (min-width: 601px) and (max-width: 1024px) {
  .container.home-active {
    max-width: 480px;
    padding: 32px 32px 40px;
    min-height: auto;
    height: auto;
    margin: 40px auto;
    box-shadow: 0 8px 40px rgba(108, 92, 231, 0.15);
  }
 
  h1 {
    font-size: clamp(2.4rem, 5vw, 3rem);
    margin-bottom: 10px;
  }
 
  .subtitle {
    font-size: 1.1em;
    margin-bottom: 24px;
  }
 
  #highScoreDisplay,
  #highestLevelDisplay {
    width: 70%;
    font-size: 1.05rem;
    padding: 14px 24px;
    margin: 8px auto;
  }
 
  #playBtn,
  #howToPlayBtn,
  #continueBtn,
  #restartGameBtn {
    max-width: 340px;
    font-size: 1.05rem;
    padding: 16px 32px;
    border-radius: 14px;
  }
 
  #playBtn,
  #continueBtn {
    font-size: 1.25rem;
    padding: 20px 40px;
  }
 
  .menu {
    gap: 14px;
    margin-top: 8px;
  }
 
  .home-bottom {
    gap: 14px;
  }
 
  .home-top {
    padding-top: 8px;
  }
}
 
/* =========================
   RESPONSIVE — DESKTOP
   min-width: 1025px
   ========================= */
 
@media (min-width: 1025px) {
  .home-active.container {
    max-width: 480px;
    padding: 48px 48px 56px;
    border-radius: 28px;
    min-height: auto;
    height: auto;
    margin: 60px auto;
    box-shadow: 0 12px 56px rgba(108, 92, 231, 0.18);
    justify-content: center;
    gap: 24px;
  }
 
  h1 {
    font-size: 3.2rem;
    margin-bottom: 12px;
  }
 
  .subtitle {
    font-size: 1.2em;
    margin-bottom: 28px;
  }
 
  #highScoreDisplay,
  #highestLevelDisplay {
    width: 65%;
    font-size: 1.1rem;
    padding: 16px 28px;
    margin: 8px auto;
  }
 
  #playBtn,
  #howToPlayBtn,
  #continueBtn,
  #restartGameBtn {
    max-width: 360px;
    font-size: 1.1rem;
    padding: 18px 40px;
    border-radius: 16px;
  }
 
  #playBtn,
  #continueBtn {
    font-size: 1.3rem;
    padding: 22px 48px;
    border-radius: 18px;
  }
 
  .menu {
    gap: 16px;
    margin-top: 8px;
  }
 
  .home-bottom {
    gap: 16px;
  }
 
  .home-top {
    padding-top: 0;
  }
 
  /* Subtle hover lift on desktop */
  #playBtn:hover,
  #howToPlayBtn:hover,
  #continueBtn:hover,
  #restartGameBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(108, 92, 231, 0.45);
  }
}
 
/* =========================
   DESKTOP BACKGROUND
   Full page bg when container
   is centered on large screens
   ========================= */
 
@media (min-width: 601px) {
  body {
    background: linear-gradient(160deg, #ede7fa 0%, #ddd0f7 50%, #e4dcf7 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-height: 100vh;
    overflow: hidden;
  }
}