﻿/* =========================
CSS (an_word.css)
========================= */
@font-face {
  font-family: "QuicksandSemiBold";
  src: url("Quicksand-SemiBold.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root{
  --bg1:#eaf6ff;
  --card:#ffffff;
  --ink:#1f2937;
  --muted:#6b7280;
  --brand:#1f2a66;
  --accent:#6ee7b7;
  --accent2:#22c55e;
  --danger:#ef4444;
  --shadow: 0 18px 40px rgba(0,0,0,.18);
  --r: 22px;
  --purple-1: #b794f4;
  --purple-2: #805ad5;
  --purple-3: #6b46c1;
  --lavender-bg: #f6f3ff;
  --lavender-border: #d6ccff;
  --tile-shadow: 0 8px 20px rgba(128,90,213,0.35);
}

*{box-sizing:border-box}
button, input, select, textarea{
  font: inherit;
}
html,body{height:100%}
body{
  margin:0;
  font-family:"QuicksandSemiBold", sans-serif;
  color:var(--ink);
  background: var(--bg1);
  overflow-x:hidden;
  overflow-y:auto;
}

/* Background video */
.bg-video{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  z-index:-3;
}
.fullscreen-btn{
  position:fixed;
  top:18px;
  right:18px;
  z-index:9999;
  width:56px;
  height:56px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:18px;
  background: rgba(255,255,255,.95);
  color:#4c1d95;
  font-size:28px;
  line-height:1;
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
  cursor:pointer;
}
.fullscreen-btn:hover{
  transform: translateY(-2px) scale(1.03);
}
.bg-overlay{
  position:fixed;
  inset:0;
  background: rgba(255,255,255,.25);
  z-index:-2;
}

/* Screens */
.screen{
  position:absolute;
  inset:0;
  display:none;
  padding:16px;
  overflow:auto;
}
.screen.active{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
}

.topbar{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding-top:8px;
}
.logo{
  height:52px;
  object-fit:contain;
}

.card{
  background:var(--card);
  border-radius:var(--r);
  box-shadow:var(--shadow);
}

.hero{
  width:min(820px, 95vw);
  margin: 0 auto;
  padding:40px 36px;
  text-align:center;
}
.hero h1{
  margin:0;
  font-size: clamp(40px, 6vw, 64px);
  color:var(--brand);
}
.sub{
  margin:16px 0 26px;
  color:var(--muted);
  font-size:30px;
}
.hint{
  margin:14px 0 0;
  color:var(--muted);
  font-size:14px;
}

.pill{
  display:inline-block;
  padding:8px 20px;
  border-radius:999px;
  background:#d1fae5;
  color:#065f46;
}

/* Buttons */
.btn{
  border:none;
  border-radius:999px;
  padding:18px 34px;
  font-size:28px;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 14px 28px rgba(0,0,0,.16);
  transition: transform .12s ease;
}
.btn:active{transform:scale(.96)}
.btn.primary{
  background: linear-gradient(180deg, #a7f3d0, #6ee7b7);
  color:#064e3b;
}

/* Intro */
.introWrap{
  width: 100%;
  max-width: 1120px;        /*  controls both cards */
  margin: 0 auto;

  display: flex;           /*  vertical stack */
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.introCard{
  position: relative;
  padding: 28px;
  border-radius: var(--r);
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow);

  display: flex;
  justify-content: center;
  align-items: center;

  max-width: 1040px;     
  width: 100%;
}
.introImg {
  width: min(560px, 82%);
  max-height: 58vh;
  object-fit: contain;
  display: block;
}
/* Position At text roughly center of circle.
   Adjust these values if your circle position differs. */
.circleText{
  position:absolute;
  left:52%;
  top:48%;
  transform:translate(-50%,-50%);
  font-size: clamp(70px, 12vw, 130px);
  font-weight:900;
  color:#6b21a8;
  text-shadow: 0 6px 0 rgba(0,0,0,.12);
  letter-spacing:2px;
  pointer-events:none;
}
.introCard,
.introText{
  width: 100%;
  max-width: 820px;
}

.introText{
  width: 100%;
  max-width: 800px;   /*  SAME WIDTH */
  background: rgba(255,255,255,.95);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 34px;
  text-align: center;
}
.introText h2{
  margin:0 0 8px;
  color:var(--brand);
  font-size: clamp(30px, 4vw, 44px);
}
.introText p{
  margin:0 0 14px;
  color:var(--muted);
}

/* Animations */
.pop-in{ animation: popIn .55s ease both; }
.slide-up{ animation: slideUp .55s ease .1s both; }
@keyframes popIn{
  from{ transform:scale(.92); opacity:0 }
  to{ transform:scale(1); opacity:1 }
}
@keyframes slideUp{
  from{ transform:translateY(16px); opacity:0 }
  to{ transform:translateY(0); opacity:1 }
}

/* Game */
.gameTop{
  justify-content:space-between;
  padding: 8px 14px 0;
}
.progress{
  background: rgba(255,255,255,.85);
  border-radius:999px;
  padding:8px 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
  font-weight:800;
}

.letterRow{
  width:min(860px, 94vw);
  margin: 24px auto 0;
  display:flex;
  gap:18px;
  justify-content:center;
  flex-wrap:wrap;
  background: var(--lavender-bg);
  border: 2px solid var(--lavender-border);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 10px 26px rgba(140,120,255,0.18);
}

.letterChip {
  width: 102px;
  height: 102px;
  border-radius: 22px;

  background: linear-gradient(
    180deg,
    var(--purple-1),
    var(--purple-2)
  );

  color: #ffffff;
  font-family: "QuicksandSemiBold", sans-serif;
  font-size: 46px;
  font-weight: 800;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: var(--tile-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.letterChip:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(128,90,213,0.45);
}

.letterChip.dragging{
  transform: scale(1.08);
  opacity:.9;
}
.letterChip[style*="opacity: 0.35"] {
  background: linear-gradient(180deg, #e5e7eb, #cbd5f5);
  color: #6b7280;
  box-shadow: none;
}

.mediaCard{
  width:min(820px, 95vw);
  margin: 18px auto 0;
  background: #ffffff;
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:24px;
  display:flex;
  justify-content:center;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.wordVideo, .wordImage{
  width:100%;
  max-height: 52vh;
  border-radius:18px;
  object-fit:contain;
  background: #ffffff;
}

.wordBuild{
  width:min(860px, 95vw);
  margin: 16px auto 0;
  display:flex;
  justify-content:center;
  gap:34px;
  align-items:center;
}
.dropSlot{
  width:196px;
  height:146px;
  border-radius:18px;
  background:#f8fafc;
  border:3px dashed #94a3b8;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:70px;
  font-weight:900;
  color:#64748b;
}
.dropSlot.ready{
  border-color: #8b5cf6;
  background: #f6f3ff;
  color: #6b46c1;
  box-shadow: 0 0 0 6px rgba(139,92,246,0.18);
}

.dropSlot.wrong{
  border-color: var(--danger);
  background:#fee2e2;
  color:#b91c1c;
  animation: shake .25s ease;
}
@keyframes shake{
  0%{transform:translateX(0)}
  25%{transform:translateX(-6px)}
  50%{transform:translateX(6px)}
  75%{transform:translateX(-4px)}
  100%{transform:translateX(0)}
}

.family{
  font-family: "QuicksandSemiBold", sans-serif;
  font-size: 98px;
  letter-spacing: 2px;
  color:#6b21a8;
  text-shadow: 0 4px 0 rgba(0,0,0,.10);
}

.caption{
  width:min(980px, 92vw);
  margin: 10px auto 0;
  text-align:center;
  color: var(--muted);
  font-size:24px;
}

/* Popup */
.popup{
  position:fixed;
  inset:0;
  background: rgba(35, 27, 84, .34);
  backdrop-filter: blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.popupCard{
  width:min(600px, 92vw);
  position: relative;
  overflow: visible;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.92), rgba(255,255,255,0) 35%),
    linear-gradient(180deg, #fff7ed 0%, #fdf2f8 52%, #eef9ff 100%);
  border-radius:34px;
  box-shadow: 0 28px 64px rgba(72, 54, 132, .26);
  border: 2px solid rgba(255,255,255,.7);
  padding:34px;
  text-align:center;
}
.popup:not(.hidden) .popupCard{
  animation: popupEnter .45s ease;
}

.popupGlow{
  position: absolute;
  inset: auto auto -45px -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 221, 87, .45), rgba(255, 221, 87, 0));
  pointer-events: none;
}

.popupFloaters{
  position: absolute;
  inset: -18px;
  pointer-events: none;
  z-index: 2;
}

.popupFloater{
  position: absolute;
  font-size: 26px;
  opacity: .98;
  animation: popupFloat 3.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.12));
}

.popupFloater:nth-child(1){ top: -12px; left: -6px; animation-delay: 0s; }
.popupFloater:nth-child(2){ top: -18px; right: -2px; animation-delay: .35s; }
.popupFloater:nth-child(3){ top: 108px; left: -18px; animation-delay: .75s; }
.popupFloater:nth-child(4){ top: 132px; right: -16px; animation-delay: 1.05s; }
.popupFloater:nth-child(5){ bottom: 82px; right: 14px; animation-delay: 1.35s; }

.popupMascotWrap{
  position: relative;
  z-index: 3;
  margin: 4px auto 10px;
  width: fit-content;
}

.popupMascot{
  width: clamp(92px, 18vw, 132px);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.16));
  animation: mascotBounce 1.9s ease-in-out infinite;
}

.popupCard h2{
  position: relative;
  z-index: 3;
  margin:0 0 10px;
  color:#16a34a;
  font-size:42px;
}

.popupCard p{
  position: relative;
  z-index: 3;
  margin:0 0 20px;
  color:var(--muted);
  font-size:24px;
}

.popupActions{
  display:flex;
  justify-content:center;
  gap:18px;
  flex-wrap:nowrap;
}

.popupActions .btn{
  position: relative;
  z-index: 3;
  border-radius: 999px;
  padding: 16px 28px;
  box-shadow: 0 14px 24px rgba(0,0,0,.14);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.popupActions .btn:hover{
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 28px rgba(0,0,0,.16);
  filter: brightness(1.03);
}

.popupActions .btn:active{
  transform: scale(.97);
}

.popupActions .btn.primary{
  background: linear-gradient(180deg, #86efac, #34d399);
  color:#065f46;
}

.next-btn{
  background: linear-gradient(180deg, #f9a8d4, #fb7185);
  color:#7f1d1d;
}
.hidden{ display:none !important; }

@keyframes popupEnter {
  0% { opacity: 0; transform: scale(.82); }
  70% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes popupFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.12); }
}

@keyframes mascotBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
/*  Bigger logo ONLY on first screen */
#screenStart .hero .logo {
  width: 380px;          /* increase size */
  max-width: 100%;
  margin-bottom: 26px;
  height: 160px;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.15));
}
@media (max-width: 480px) {
  #screenStart .logo.inside-card {
    width: 240px;
  }
}
/* Pop-in animation for tiles */
@keyframes popIn {
  from { transform: translateY(10px) scale(0.85); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.letterChip {
  opacity: 0;                 /* start hidden, JS will reveal */
  animation: popIn 420ms ease both;
}
/* Correct / wrong animations */
@keyframes correctPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes wrongShake {
  0%{transform:translateX(0)}
  25%{transform:translateX(-6px)}
  50%{transform:translateX(6px)}
  75%{transform:translateX(-4px)}
  100%{transform:translateX(0)}
}

.dropSlot.correct{
  border-color:#22c55e;
  background:#ecfdf5;
  color:#065f46;
  animation: correctPulse .35s ease;
}

.dropSlot.wrong{
  border-color:#ef4444;
  background:#fee2e2;
  color:#b91c1c;
  animation: wrongShake .25s ease;
}

/* Letter tile feedback */
.letterChip.correct{
  background: linear-gradient(180deg, #86efac, #22c55e);
  box-shadow: 0 10px 22px rgba(34,197,94,0.35);
}
.letterChip.wrong{
  background: linear-gradient(180deg, #fca5a5, #ef4444);
  box-shadow: 0 10px 22px rgba(239,68,68,0.35);
}

.progressWrap{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:18px;
  background: rgba(255,255,255,.85);
  padding:10px 14px;
  border-radius:999px;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

.scoreBadge{
  min-width: 118px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  color: #92400e;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 18px rgba(245,158,11,.2);
  transform-origin: center;
}

.scoreBadge.pop{
  animation: scorePop .35s ease;
}

@keyframes scorePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

#timer-bar{
  width: min(92vw, 480px);
  height: 16px;
  background: rgba(255,255,255,0.42);
  border-radius: 999px;
  margin: 4px auto 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 18px rgba(0,0,0,0.1);
}

#timer-bar::after{
  content:"";
  position:absolute;
  inset:0;
  width: var(--timer-width, 0%);
  background: linear-gradient(90deg, #ff4d4d, #ffcc00);
  transition: var(--timer-transition, width 1s linear);
}

.dots{
  display:flex;
  gap:7px;
}
.dot{
  width:16px;
  height:16px;
  border-radius:999px;
  background:#e5e7eb;
}
.dot.active{
  background: linear-gradient(180deg, #c4b5fd, #8b5cf6);
  box-shadow: 0 6px 14px rgba(139,92,246,0.25);
}
.dot.done{
  background: linear-gradient(180deg, #86efac, #22c55e);
}
  .progressWrap{
    margin-left: auto;
    margin-right: auto;
  }

  .fullscreen-btn{
    top:12px;
    right:12px;
    width:48px;
    height:48px;
    font-size:24px;
    border-radius:14px;
  }

  .gameTop{
    justify-content: center;
    padding: 8px 10px 0;
  }

  .letterRow{
    margin-top: 10px;
    gap:10px;
    padding: 10px 12px;
  }

  .letterChip{
    width:56px;
    height:56px;
    font-size:26px;
    border-radius:14px;
  }

  .mediaCard{
    margin-top: 12px;
    padding: 10px;
  }

  .wordVideo, .wordImage{
    max-height: 32vh;
  }

  .dropSlot{
    width:96px;
    height:76px;
    font-size:36px;
  }

  .family{
    font-size: 46px;
  }

/* Media transition base */
.wordImage,
.wordVideo {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease;
}


/* Fade out */
.media-fade-out {
  opacity: 0;
  transform: scale(0.96);
}

/* Fade in */
.media-fade-in {
  opacity: 1;
  transform: scale(1);
}
.media-fade-in {
  animation: softZoomIn 0.4s ease;
}

@keyframes softZoomIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes slideIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* Media visibility control (animation-safe) */
.media-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position:absolute
}

.media-visible {
  opacity: 1;
  visibility: visible;
}
#screenGame .caption {
  display: none;
}
.fullWord {
  display: inline-block;
  padding: 14px 32px;
  margin-top: 14px;

  font-family: "QuicksandSemiBold", sans-serif;
  font-size: 70px;
  font-weight: 800;
  letter-spacing: 2px;

  color: #6b21a8;
  background: linear-gradient(180deg, #f5f3ff, #ede9fe);
  border: 3px solid #c4b5fd;
  border-radius: 20px;

  box-shadow: 0 16px 30px rgba(139, 92, 246, 0.25);
  text-align: center;

  opacity: 0;
  transform: scale(0.7);
}


/* animation */
.fullWord.show {
  animation: mergeIn 0.4s ease forwards;
  text-shadow: 0 6px 12px rgba(107,33,168,0.25);

}

@keyframes mergeIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.fullWord.show {
  animation: wordPopIn 0.55s ease forwards;
}

@keyframes wordPopIn {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  70% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}





#screenGame{
  gap: 22px;
}

#screenGame .gameTop,
#screenGame #timer-bar,
#screenGame .letterRow,
#screenGame .mediaCard,
#screenGame .wordBuild,
#screenGame .caption{
  margin-left: auto;
  margin-right: auto;
}

#screenGame .letterRow,
#screenGame .mediaCard,
#screenGame .wordBuild,
#screenGame .caption{
  margin-top: 0;
}





@media (max-width: 600px){
  .popupActions{
    gap: 10px;
    flex-wrap: nowrap;
  }

  .popupActions .btn{
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 12px;
    font-size: 15px;
  }
}



#screenGame .letterChip{
  width: clamp(68px, 6.2vw, 102px);
  height: clamp(68px, 6.2vw, 102px);
  font-size: clamp(30px, 3.1vw, 46px);
  border-radius: clamp(14px, 1.6vw, 22px);
}

#screenGame .wordBuild{
  width: min(860px, 95vw);
  gap: clamp(16px, 2.2vw, 34px);
}

#screenGame .dropSlot{
  width: clamp(110px, 13vw, 196px);
  height: clamp(84px, 9.5vw, 146px);
  font-size: clamp(40px, 4.4vw, 70px);
}

#screenGame .family{
  font-size: clamp(52px, 6vw, 98px);
}

@media (max-width: 600px){
  #screenGame .letterChip{
    width: 56px;
    height: 56px;
    font-size: 26px;
    border-radius: 14px;
  }

  #screenGame .wordBuild{
    width: min(100%, 94vw);
    gap: 16px;
  }

  #screenGame .dropSlot{
    width: 96px;
    height: 76px;
    font-size: 36px;
  }

  #screenGame .family{
    font-size: 46px;
  }
}


/* =========================================
   RESPONSIVE FIXES
========================================= */
img,
video {
  max-width: 100%;
  height: auto;
}

.screen {
  padding: clamp(12px, 2vw, 24px);
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 24px);
}

#screenStart,
#screenIntro {
  justify-content: center;
}

#screenGame {
  justify-content: flex-start;
  gap: clamp(14px, 2vw, 24px);
  padding-top: clamp(16px, 3vh, 32px);
  padding-bottom: clamp(20px, 4vh, 40px);
}

.hero,
.introWrap,
.introCard,
.introText,
.letterRow,
.mediaCard,
.wordBuild,
.popupCard {
  width: min(92vw, 900px);
  margin-left: auto;
  margin-right: auto;
}

.hero {
  padding: clamp(18px, 3vw, 36px);
}

.introCard,
.introText,
.mediaCard,
.popupCard {
  padding: clamp(16px, 3vw, 32px);
}

.topbar,
.gameTop {
  width: min(92vw, 900px);
}

.gameTop {
  justify-content: center;
}

.progressWrap {
  width: fit-content;
  max-width: 100%;
  gap: clamp(8px, 1.6vw, 16px);
  padding: clamp(8px, 1.6vw, 14px) clamp(12px, 2vw, 20px);
  justify-content: center;
}

.letterRow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  gap: clamp(10px, 1.8vw, 18px);
  padding: clamp(12px, 2vw, 24px);
}

.letterChip,
#screenGame .letterChip {
  width: clamp(52px, 9vw, 96px);
  height: clamp(52px, 9vw, 96px);
  font-size: clamp(24px, 4vw, 44px);
  border-radius: clamp(14px, 1.8vw, 22px);
}

.mediaCard {
  width: min(92vw, 820px);
}

.wordVideo,
.wordImage {
  width: 100%;
  height: auto;
  max-height: min(40vh, 420px);
  object-fit: contain;
}

.wordBuild,
#screenGame .wordBuild {
  width: min(92vw, 820px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.dropSlot,
#screenGame .dropSlot {
  width: clamp(90px, 14vw, 180px);
  height: clamp(72px, 10vw, 132px);
  font-size: clamp(32px, 5vw, 64px);
}

.family,
#screenGame .family {
  font-size: clamp(42px, 6vw, 92px);
  line-height: 1.05;
}

.fullWord {
  font-size: clamp(36px, 5vw, 70px);
  padding: clamp(10px, 2vw, 18px) clamp(20px, 4vw, 32px);
}

.popupActions {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 18px);
  flex-wrap: nowrap;
}

.popupActions .btn {
  min-width: 0;
}

@media (max-width: 600px) {
  .screen.active {
    justify-content: flex-start;
    padding-top: 20px;
  }

  .hero,
  .introWrap,
  .introCard,
  .introText,
  .letterRow,
  .mediaCard,
  .wordBuild,
  .popupCard,
  .topbar,
  .gameTop {
    width: 100%;
  }

  .hero {
    margin-top: 0;
  }

  .topbar,
  .gameTop {
    justify-content: center;
  }

  .letterRow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px;
  }

  .wordVideo,
  .wordImage {
    max-height: 32vh;
  }

  .wordBuild,
  #screenGame .wordBuild {
    width: min(100%, 94vw);
    gap: 14px;
  }

  .popupCard {
    width: min(94vw, 640px);
  }

  .popupActions .btn {
    flex: 1 1 0;
    padding: 14px 10px;
    font-size: clamp(16px, 3.8vw, 18px);
  }
}

@media (min-width: 600px) and (max-width: 1024px) {
  .hero,
  .introWrap,
  .introCard,
  .introText,
  .letterRow,
  .mediaCard,
  .wordBuild,
  .popupCard,
  .topbar,
  .gameTop {
    width: min(90vw, 860px);
  }

  .wordVideo,
  .wordImage {
    max-height: 38vh;
  }
}

@media (min-width: 1025px) {
  .hero,
  .introWrap,
  .introCard,
  .introText,
  .letterRow,
  .mediaCard,
  .wordBuild,
  .popupCard,
  .topbar,
  .gameTop {
    width: min(88vw, 920px);
  }
}

/* =========================================
   RESPONSIVE LAYOUT SYSTEM
========================================= */
:root{
  --container-max: 760px;
  --container-wide: 800px;
  --screen-pad: clamp(12px, 2vw, 24px);
  --stack-gap: clamp(14px, 2vh, 22px);
}

body{
  overflow-x: hidden;
  overflow-y: auto;
}

.screen{
  padding: var(--screen-pad);
  overflow-x: hidden;
  overflow-y: auto;
}

.screen.active{
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--stack-gap);
}

#screenStart,
#screenIntro{
  justify-content: center;
}

#screenGame{
  justify-content: flex-start;
  padding-top: clamp(16px, 3vh, 32px);
  padding-bottom: clamp(20px, 4vh, 40px);
}

.hero,
.card,
.introWrap,
.introCard,
.introText,
.letterRow,
.mediaCard,
.wordBuild,
.popupCard,
.topbar,
.gameTop{
  width: min(92vw, var(--container-max));
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

.hero,
.card{
  padding: clamp(16px, 3vw, 28px);
}

.hero{
  margin-top: 0;
}

.introWrap{
  gap: clamp(16px, 2.4vh, 28px);
}

.introCard,
.introText,
.mediaCard,
.popupCard{
  padding: clamp(16px, 3vw, 28px);
}

.gameTop,
.topbar{
  display: flex;
  align-items: center;
  justify-content: center;
}

.progressWrap{
  width: fit-content;
  max-width: 100%;
  gap: clamp(8px, 1.6vw, 16px);
  padding: clamp(8px, 1.4vw, 12px) clamp(12px, 2vw, 18px);
  justify-content: center;
}

.finalScoreText,
.finalStarsText{
  margin: 8px 0 0;
  text-align: center;
  font-weight: 800;
}

.finalScoreText{
  font-size: clamp(24px, 3vw, 34px);
  color: var(--brand);
}

.finalStarsText{
  font-size: clamp(22px, 2.6vw, 30px);
  color: #92400e;
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  box-shadow: 0 10px 18px rgba(245, 158, 11, .16);
  animation: starPop 1.2s ease-in-out infinite;
}

@keyframes starPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.letterRow{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  gap: clamp(10px, 1.8vw, 16px);
  padding: clamp(12px, 2vw, 20px);
}

.letterChip,
#screenGame .letterChip{
  width: clamp(52px, 9vw, 85px);
  height: clamp(52px, 9vw, 85px);
  font-size: clamp(28px, 3.4vw, 45px);
  border-radius: clamp(14px, 1.8vw, 18px);
}

.mediaCard{
  width: min(92vw, var(--container-wide));
  max-width: var(--container-wide);
}

img,
video,
.wordImage,
.wordVideo{
  width: 100%;
  height: auto;
  max-height: min(40vh, 420px);
  object-fit: contain;
}

.wordBuild,
#screenGame .wordBuild{
  width: min(92vw, var(--container-wide));
  max-width: var(--container-wide);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.dropSlot,
#screenGame .dropSlot{
  width: clamp(90px, 14vw, 140px);
  height: clamp(72px, 10vw, 108px);
  font-size: clamp(32px, 5vw, 48px);
}

.family,
#screenGame .family{
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.05;
}

.fullWord{
  font-size: clamp(36px, 5vw, 60px);
  padding: clamp(10px, 2vw, 16px) clamp(18px, 4vw, 28px);
}

.popupActions{
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 16px);
  flex-wrap: nowrap;
}

.popupActions .btn{
  min-width: 0;
}

@media (max-height: 700px){
  .screen.active{
    justify-content: flex-start;
    padding-top: 20px;
  }

  #screenGame{
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 20px;
  }

  img,
  video,
  .wordImage,
  .wordVideo{
    max-height: min(34vh, 320px);
  }
}

@media (max-width: 600px){
  .screen.active{
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
  }

  .hero,
  .card,
  .introWrap,
  .introCard,
  .introText,
  .letterRow,
  .mediaCard,
  .wordBuild,
  .popupCard,
  .topbar,
  .gameTop{
    width: 100%;
    max-width: 100%;
  }

  .topbar,
  .gameTop{
    justify-content: center;
  }

  .letterRow{
    gap: 10px;
    padding: 10px 12px;
  }

  .wordBuild,
  #screenGame .wordBuild{
    width: min(100%, 94vw);
    gap: 14px;
  }

  .dropSlot,
  #screenGame .dropSlot{
    width: 96px;
    height: 76px;
    font-size: 36px;
  }

  .family,
  #screenGame .family{
    font-size: 46px;
  }

  .popupCard{
    width: min(94vw, 640px);
  }

  .popupActions .btn{
    flex: 1 1 0;
    padding: 14px 10px;
    font-size: clamp(12px, 3.8vw, 15px);
  }
}

@media (min-width: 600px) and (max-width: 1024px){
  :root{
    --container-max: 740px;
    --container-wide: 780px;
  }

  img,
  video,
  .wordImage,
  .wordVideo{
    max-height: min(38vh, 380px);
  }
}

@media (min-width: 1025px){
  :root{
    --container-max: 720px;
    --container-wide: 780px;
  }
}

@media (min-width: 1200px){
  :root{
    --container-max: 700px;
    --container-wide: 760px;
  }
}

@media (min-width: 1025px){
  #screenGame:not(.round1-layout) #timer-bar{
    width: min(92vw, 480px);
    max-width: 480px;
    margin: 4px auto 0;
  }

  #screenGame:not(.round1-layout) .letterRow,
  #screenGame:not(.round1-layout) .mediaCard{
    width: min(88vw, 700px);
    max-width: 700px;
  }

  #screenGame:not(.round1-layout) .letterRow{
    gap: 12px;
    padding: 14px 18px;
  }

  #screenGame:not(.round1-layout) .mediaCard{
    padding: 20px 22px;
  }

  #screenGame:not(.round1-layout) .wordVideo,
  #screenGame:not(.round1-layout) .wordImage{
    max-height: min(36vh, 320px);
  }

  #screenGame.round2-layout .letterRow,
  #screenGame.round2-layout .mediaCard{
    width: min(86vw, 660px);
    max-width: 660px;
  }

  #screenGame.round2-layout .letterRow{
    gap: 12px;
    padding: 12px 16px;
  }

  #screenGame.round2-layout .listen-btn{
    min-width: clamp(140px, 20vw, 190px);
    padding: 12px 22px;
    font-size: clamp(18px, 2.2vw, 22px);
  }
}

/* Keep the page background video full-screen after generic media responsive rules */
.bg-video,
#bgVideo{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  z-index: -3;
}


/* =========================================
   MULTI-ROUND GAME EXTENSIONS
========================================= */
#screenGame .caption{
  display: block;
  width: min(92vw, var(--container-wide, 760px));
  max-width: var(--container-wide, 760px);
  text-align: center;
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--brand);
  margin: 0 auto;
}

#screenGame #timer-bar{
  width: min(92vw, 480px);
  max-width: 480px;
}

#screenGame .caption.success-text{
  color: #0f9f57;
}

.letterRow.option-grid{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.letterRow.family-grid{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.round-choice{
  width: 100%;
  min-height: clamp(56px, 8vw, 74px);
  border: 2px solid rgba(139, 92, 246, 0.18);
  border-radius: 20px;
  background: rgba(255,255,255,0.96);
  color: #5b21b6;
  font-family: "QuicksandSemiBold", sans-serif;
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(76, 29, 149, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.round-choice:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(76, 29, 149, 0.16);
}

.round-choice.correct,
.family-word.correct{
  transform: scale(1.1);
  box-shadow: 0 0 15px #6ee7b7;
  border-color: #22c55e;
  background: #ecfdf5;
  color: #166534;
}

.round-choice.wrong,
.family-word.wrong{
  animation: shake 0.3s;
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}

.family-word[disabled],
.round-choice[disabled]{
  pointer-events: none;
}

@media (max-width: 600px){
  .letterRow.option-grid,
  .letterRow.family-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .round-choice{
    font-size: clamp(18px, 4vw, 22px);
    min-height: 56px;
  }
}

#screenGame.round1-layout .caption{
  order: 2;
  margin-top: 0;
  margin-bottom: clamp(10px, 1.8vw, 18px);
}

#screenGame.round1-layout .letterRow{
  order: 3;
  margin-top: 0;
}

#screenGame.round2-layout .caption{
  order: 2;
  margin-top: 0;
  margin-bottom: 4px;
}

#screenGame.round2-layout .mediaCard{
  order: 3;
}

#screenGame.round2-layout .letterRow{
  order: 4;
  margin-top: 10px;
}

.listen-btn{
  margin-top: clamp(8px, 1.2vw, 12px);
  min-width: clamp(118px, 16vw, 160px);
  align-self: center;
  letter-spacing: 0.04em;
  padding: 9px 16px;
  font-size: clamp(15px, 1.7vw, 18px);
  box-shadow: 0 8px 16px rgba(0,0,0,.12);
}

#screenGame.round2-layout .mediaCard{
  flex-direction: column;
}

#screenGame.round2-layout .listen-btn{
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

#screenGame:not(.round1-layout):not(.round2-layout) .letterRow{
  grid-template-columns: repeat(6, minmax(0, auto));
  justify-content: center;
}

#screenGame:not(.round1-layout) #timer-bar{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: min(72vw, 360px);
  max-width: 360px;
  margin: 2px auto 0;
}

#screenGame:not(.round1-layout) .letterRow,
#screenGame:not(.round1-layout) .mediaCard{
  width: min(82vw, 620px);
  max-width: 620px;
}

#screenGame:not(.round1-layout) .letterRow{
  gap: 10px;
  padding: 10px 14px;
}

#screenGame:not(.round1-layout) .mediaCard{
  padding: 14px 16px;
}

#screenGame:not(.round1-layout) .wordVideo,
#screenGame:not(.round1-layout) .wordImage{
  max-height: min(29vh, 250px);
}

#screenGame.round2-layout .letterRow,
#screenGame.round2-layout .mediaCard{
  width: min(80vw, 590px);
  max-width: 590px;
}

#screenGame.round2-layout .letterRow{
  gap: 10px;
  padding: 8px 12px;
}


/* Round 3 Teddy Cards */
.letterRow.family-grid{
  width: min(95vw, 860px);
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  align-content: center;
  gap: clamp(18px, 2.6vw, 28px);
}

.family-word.teddy-card{
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: auto;
  border: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 10px 24px rgba(125, 95, 211, 0.14);
  padding: clamp(14px, 2vw, 20px);
  overflow: visible;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.family-word.teddy-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 16px 28px rgba(125, 95, 211, 0.2);
}

.teddy-small{
  display: block;
  width: 100%;
  max-width: 168px;
  border-radius: 25px;
  margin: 0 auto;
  filter: drop-shadow(0 12px 18px rgba(76, 29, 149, 0.18));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.teddy-word{
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: 74%;
  text-align: center;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  color: #6b3f13;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.55);
  border: solid 2px rgb(141, 116, 211);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.family-word.collected{
  opacity: 1;
  transform: translateY(-2px) scale(1.03);
}

.family-word.teddy-card.correct{
  background: rgba(234, 255, 244, 0.75);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.42), 0 0 26px rgba(110, 231, 183, 0.65);
}

.family-word.teddy-card.correct .teddy-small{
  filter: drop-shadow(0 0 18px rgba(110, 231, 183, 0.95));
}

.family-word.teddy-card.correct .teddy-word{
  color: #0f766e;
  background: rgba(236, 253, 245, 0.95);
  box-shadow: 0 8px 18px rgba(110, 231, 183, 0.35);
}

.family-word.teddy-card.card-bounce{
  animation: teddy-card-bounce 0.6s ease;
}

.card-hearts{
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.card-heart{
  position: absolute;
  font-size: clamp(18px, 2vw, 26px);
  opacity: 0;
  transform: translate(-50%, 0) scale(0.75);
  animation: card-heart-float 0.95s ease forwards;
  filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.55));
}

.family-word.wrong{
  background: rgba(255, 255, 255, 0.32);
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.28);
}

.teddyOverlay{
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(4px);
}

.teddyOverlayInner{
  position: relative;
  width: min(88vw, 360px);
}

.bigTeddy{
  display: block;
  width: 100%;
  animation: teddy-bounce 0.7s ease;
  filter: drop-shadow(0 20px 26px rgba(76, 29, 149, 0.16));
}

.bigWord{
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: 66%;
  text-align: center;
  font-size: clamp(28px, 4vw, 42px);
  color: #6b3f13;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.55);
}

.bigWord .ad-highlight{
  color: #6d28d9;
}

.overlayHearts{
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.float-heart{
  position: absolute;
  bottom: 22%;
  font-size: clamp(18px, 2.6vw, 28px);
  opacity: 0;
  animation: float-heart 1s ease forwards;
}

@keyframes teddy-bounce{
  0%,100%{ transform: translateY(0) scale(1); }
  30%{ transform: translateY(-16px) scale(1.04); }
  65%{ transform: translateY(0) scale(0.98); }
}

@keyframes teddy-card-bounce{
  0%,100%{ transform: translateY(-2px) scale(1.03); }
  35%{ transform: translateY(-14px) scale(1.08); }
  65%{ transform: translateY(-3px) scale(1.02); }
}

@keyframes card-heart-float{
  0%{ transform: translate(-50%, 10px) scale(0.7); opacity: 0; }
  25%{ opacity: 1; }
  100%{ transform: translate(-50%, -78px) scale(1.15); opacity: 0; }
}

@keyframes float-heart{
  0%{ transform: translateY(0) scale(0.8); opacity: 0; }
  20%{ opacity: 1; }
  100%{ transform: translateY(-110px) scale(1.2); opacity: 0; }
}

@media (max-width: 900px){
  .letterRow.family-grid{
    width: min(95vw, 760px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px){
  .letterRow.family-grid{
    width: min(95vw, 430px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teddy-small{
    max-width: 140px;
  }
}

@media (max-width: 480px) and (min-height: 820px){
  #screenGame{
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  #screenGame .gameTop{
    width: min(94vw, 420px);
  }

  #screenGame .progressWrap{
    gap: 8px;
    padding: 8px 12px;
  }

  #screenGame #progressText,
  #screenGame .scoreBadge{
    font-size: 16px;
  }

  #screenGame.round1-layout .caption{
    width: min(94vw, 410px);
    margin-bottom: 2px;
    font-size: clamp(15px, 4.2vw, 22px);
  }

  #screenGame.round1-layout .letterRow.family-grid{
    width: min(94vw, 410px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 6px 10px;
  }

  #screenGame.round1-layout .family-word.teddy-card{
    border-radius: 16px;
    padding: 4px;
  }

  #screenGame.round1-layout .teddy-small{
    max-width: 86px;
  }

  #screenGame.round1-layout .teddy-word{
    width: 84%;
    top: 60%;
    padding: 3px 5px;
    border-radius: 10px;
    font-size: clamp(12px, 3.4vw, 17px);
    border-width: 1.5px;
  }
}

@media (max-width: 480px) and (min-height: 820px){
  #screenGame.round1-layout{
    justify-content: center !important;
    align-items: center;
    overflow-y: hidden !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
}

#screenStart,
#screenIntro,
#screenGame,
.screen.active,
#screenGame.round1-layout,
#screenGame.round2-layout{
  justify-content: center !important;
}

@media (min-width: 1025px){
  #screenGame:not(.round1-layout) #timer-bar{
    width: min(92vw, 480px) !important;
    max-width: 480px !important;
    margin: 4px auto 0 !important;
  }

  #screenGame:not(.round1-layout) .letterRow,
  #screenGame:not(.round1-layout) .mediaCard{
    width: min(88vw, 700px) !important;
    max-width: 700px !important;
  }

  #screenGame:not(.round1-layout) .letterRow{
    gap: 12px !important;
    padding: 14px 18px !important;
  }

  #screenGame:not(.round1-layout) .mediaCard{
    padding: 20px 22px !important;
  }

  #screenGame:not(.round1-layout) .wordVideo,
  #screenGame:not(.round1-layout) .wordImage{
    max-height: min(36vh, 320px) !important;
  }

  #screenGame.round2-layout .letterRow,
  #screenGame.round2-layout .mediaCard{
    width: min(86vw, 660px) !important;
    max-width: 660px !important;
  }

  #screenGame.round2-layout .letterRow{
    gap: 12px !important;
    padding: 12px 16px !important;
  }

  #screenGame.round2-layout .listen-btn{
    min-width: clamp(140px, 20vw, 190px) !important;
    padding: 12px 22px !important;
    font-size: clamp(18px, 2.2vw, 22px) !important;
  }
}

@media (min-width: 1024px){
  #screenGame.round1-layout{
    justify-content: center;
    gap: clamp(16px, 2vh, 28px);
    padding-top: 24px;
    padding-bottom: 24px;
  }

  #screenGame.round1-layout .caption{
    width: min(90vw, 980px);
    max-width: 980px;
    font-size: clamp(28px, 2vw, 36px);
    margin-bottom: 20px;
  }

  #screenGame.round1-layout #timer-bar{
    width: min(90vw, 520px);
    max-width: 520px;
  }

  #screenGame.round1-layout .letterRow.family-grid{
    width: min(90vw, 980px);
    max-width: 980px;
    gap: 26px;
    padding: 24px;
  }

  #screenGame.round1-layout .family-word.teddy-card{
    border-radius: 32px;
    padding: 18px;
  }

  #screenGame.round1-layout .teddy-small{
    max-width: 190px;
  }

  #screenGame.round1-layout .teddy-word{
    width: 72%;
    font-size: clamp(26px, 1.9vw, 34px);
  }
}

@media (min-width: 1024px) and (max-height: 700px){
  #screenGame.round2-layout .caption{
    display: none;
  }

  #screenIntro{
    justify-content: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  #screenIntro .introWrap{
    gap: 14px;
    max-width: 860px;
  }

  #screenIntro .introCard,
  #screenIntro .introText{
    max-width: 720px;
  }

  #screenIntro .introCard{
    padding: 14px;
  }

  #screenIntro .introImg{
    width: min(420px, 70%);
    max-height: 38vh;
  }

  #screenIntro .circleText{
    font-size: clamp(54px, 7vw, 88px);
  }

  #screenIntro .introText{
    padding: 18px 22px;
  }

  #screenIntro .introText h2{
    font-size: clamp(22px, 2.5vw, 34px);
    margin-bottom: 6px;
  }

  #screenIntro .introText p{
    font-size: 16px;
    margin-bottom: 10px;
  }

  #screenIntro .introText .btn{
    padding: 12px 24px;
    font-size: clamp(20px, 2vw, 26px);
  }

  #screenGame.round1-layout{
    justify-content: flex-start;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 12px;
    overflow-y: auto;
  }

  #screenGame.round1-layout .caption{
    width: min(92vw, 980px);
    margin-bottom: 8px;
    font-size: clamp(22px, 1.8vw, 28px);
  }

  #screenGame.round1-layout .letterRow.family-grid{
    width: min(92vw, 980px);
    max-width: 980px;
    gap: 14px;
    padding: 10px 12px 18px;
  }

  #screenGame.round1-layout .family-word.teddy-card{
    border-radius: 24px;
    padding: 10px;
  }

  #screenGame.round1-layout .teddy-small{
    max-width: 134px;
  }

  #screenGame.round1-layout .teddy-word{
    width: 76%;
    top: 60%;
    padding: 6px 8px;
    border-radius: 14px;
    font-size: clamp(18px, 1.45vw, 24px);
  }
}

@media (min-width: 600px) and (max-width: 1024px) and (max-height: 520px){
  #screenStart,
  #screenIntro{
    justify-content: flex-start;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  #screenStart .hero{
    width: min(94vw, 640px);
    padding: 16px 18px;
    border-radius: 22px;
  }

  #screenStart .hero .logo{
    width: min(220px, 34vw);
    height: auto;
    margin-bottom: 10px;
  }

  #screenStart .hero h1{
    font-size: clamp(28px, 4.2vw, 42px);
  }

  #screenStart .sub{
    margin: 10px 0 16px;
    font-size: clamp(20px, 2.8vw, 30px);
  }

  #screenStart .hero .btn{
    padding: 10px 24px;
    font-size: clamp(20px, 2.8vw, 28px);
  }

  #screenIntro .introWrap{
    gap: 10px;
    max-width: 640px;
  }

  #screenIntro .introCard,
  #screenIntro .introText{
    width: min(94vw, 640px);
    max-width: 640px;
  }

  #screenIntro .introCard{
    padding: 10px;
  }

  #screenIntro .introImg{
    width: min(300px, 52%);
    max-height: 34vh;
  }

  #screenIntro .circleText{
    font-size: clamp(42px, 6vw, 64px);
  }

  #screenIntro .introText{
    padding: 12px 16px;
  }

  #screenIntro .introText h2{
    font-size: clamp(22px, 3.2vw, 34px);
    margin-bottom: 4px;
  }

  #screenIntro .introText p{
    font-size: clamp(14px, 1.8vw, 18px);
    margin-bottom: 8px;
  }

  #screenIntro .introText .btn{
    padding: 9px 20px;
    font-size: clamp(18px, 2.4vw, 24px);
  }

  #screenGame{
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 10px;
  }

  #screenGame .gameTop{
    width: min(96vw, 760px);
    padding-top: 0;
  }

  #screenGame .progressWrap{
    gap: 10px;
    padding: 6px 12px;
  }

  #screenGame #progressText,
  #screenGame .scoreBadge{
    font-size: 15px;
  }

  #screenGame #progressDots .dot{
    width: 13px;
    height: 13px;
  }

  #screenGame.round1-layout{
    justify-content: flex-start;
    overflow-y: auto;
  }

  #screenGame.round1-layout .caption{
    width: min(94vw, 700px);
    margin-bottom: 4px;
    font-size: clamp(16px, 2vw, 22px);
  }

  #screenGame.round1-layout .letterRow.family-grid{
    width: min(94vw, 700px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 6px;
  }

  #screenGame.round1-layout .family-word.teddy-card{
    border-radius: 18px;
    padding: 6px;
  }

  #screenGame.round1-layout .teddy-small{
    max-width: 96px;
  }

  #screenGame.round1-layout .teddy-word{
    width: 80%;
    top: 61%;
    padding: 4px 6px;
    border-radius: 10px;
    font-size: clamp(14px, 1.9vw, 18px);
  }

  #screenGame:not(.round1-layout) #timer-bar{
    width: min(58vw, 240px);
    max-width: 240px;
    margin-top: 0;
  }

  #screenGame:not(.round1-layout) .letterRow,
  #screenGame:not(.round1-layout) .mediaCard{
    width: min(76vw, 500px);
    max-width: 500px;
  }

  #screenGame:not(.round1-layout) .letterRow{
    gap: 8px;
    padding: 8px 10px;
  }

  #screenGame:not(.round1-layout) .mediaCard{
    padding: 10px 12px;
  }

  #screenGame:not(.round1-layout) .wordVideo,
  #screenGame:not(.round1-layout) .wordImage{
    max-height: min(23vh, 150px);
  }

  #screenGame.round2-layout .caption{
    display: none;
  }

  #screenGame.round2-layout .listen-btn{
    min-width: 108px;
    padding: 7px 14px;
    font-size: 14px;
  }

  #screenGame.round2-layout .round-choice{
    min-height: 46px;
    font-size: clamp(16px, 2.4vw, 20px);
  }

  #finalPopup{
    padding: 10px;
  }

  #finalPopup .popupCard{
    width: min(94vw, 640px);
    padding: 14px 16px 16px;
    border-radius: 24px;
  }

  #finalPopup .popupMascot{
    width: clamp(74px, 11vw, 92px);
  }

  #finalPopup .popupFloaters{
    inset: -8px;
  }

  #finalPopup .popupFloater{
    font-size: 20px;
  }

  #finalPopup .popupCard h2{
    margin-bottom: 6px;
    font-size: clamp(26px, 3.4vw, 38px);
  }

  #finalPopup .popupCard p{
    margin-bottom: 10px;
    font-size: clamp(16px, 2.2vw, 22px);
  }

  #finalPopup .finalScoreText{
    font-size: clamp(20px, 2.8vw, 28px);
  }

  #finalPopup .finalStarsText{
    font-size: clamp(18px, 2.4vw, 24px);
    padding: 6px 14px;
  }

  #finalPopup .popupActions{
    gap: 10px;
  }

  #finalPopup .popupActions .btn{
    padding: 10px 18px;
    font-size: clamp(16px, 2.3vw, 22px);
  }
}

/* Fullscreen CSS fixes */
#game-root.fake-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: var(--bg1) !important;
}

body.no-scroll {
  overflow: hidden !important;
}


