/* ============ EXACT LIVE GK-EXPLORER 3D THEME ============ */
:root{
  --blue:#2F6DF4; --blue-d:#1749B8; --blue-l:#EAF2FF; --sky:#D9ECFF;
  --ink:#172554; --muted:#64748B;
  --green:#24B968; --green-l:#DCFCE7; --red:#EF476F; --red-l:#FFE5ED;
  --gold:#F5C842; --line:#D6E1F2; --bg:#EDF6FF;
  --gk-purple:#7432D5; --gk-purple-dark:#4C1D95;
  --gk-blue:#2F6DF4; --gk-blue-dark:#1749B8; --gk-cyan:#22B8DC;
  --gk-panel:#FFFFFF; --gk-shadow:#C9D4EA;
}
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{min-height:100%;background:#BEE8F8}
body{
  font-family:'Nunito','Outfit',sans-serif;color:var(--ink);
  min-height:100vh;min-height:100dvh;overflow-x:hidden;position:relative;
  background: linear-gradient(115deg,#82D9F6 0%,#D9ECFB 46%,#F9CFE8 100%);
  background-attachment:fixed;
}

/* Real 3D Floating Spheres background styling */
.bg-spheres {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bg-sphere {
  position: absolute;
  border-radius: 50%;
}
.sphere-blue-1 {
  width: 170px;
  height: 170px;
  left: -80px;
  top: 35%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #a5caff 15%, #3b82f6 55%, #1d4ed8 85%, #0f172a 100%);
  box-shadow: 0 15px 35px rgba(29, 78, 216, 0.22);
  animation: floatSphere1 8s ease-in-out infinite alternate;
}
.sphere-pink-1 {
  width: 120px;
  height: 120px;
  right: -55px;
  top: 18%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #ffd0e5 15%, #ec4899 55%, #be185d 85%, #470c24 100%);
  box-shadow: 0 12px 28px rgba(190, 24, 93, 0.22);
  animation: floatSphere2 7s ease-in-out infinite alternate;
}
.sphere-blue-2 {
  width: 110px;
  height: 110px;
  left: -40px;
  bottom: 8%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #a5caff 15%, #3b82f6 55%, #1d4ed8 85%, #0f172a 100%);
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.18);
  animation: floatSphere3 9s ease-in-out infinite alternate;
}
.sphere-pink-2 {
  width: 220px;
  height: 220px;
  right: -100px;
  bottom: 12%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #ffd0e5 15%, #ec4899 55%, #be185d 85%, #470c24 100%);
  box-shadow: 0 20px 45px rgba(190, 24, 93, 0.25);
  animation: floatSphere4 10s ease-in-out infinite alternate;
}

@keyframes floatSphere1 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-12px) rotate(5deg); }
}
@keyframes floatSphere2 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(10px) rotate(-8deg); }
}
@keyframes floatSphere3 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(6deg); }
}
@keyframes floatSphere4 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(15px) rotate(-4deg); }
}
/* launcher screens use the exact GK 3D launcher background image */
body.launcher{
  background-image:url('../assets/ui/chapter-menu-bg.jpg');
  background-size:cover;background-position:center center;background-repeat:no-repeat;
}
body.launcher::before{content:none}
img{-webkit-user-drag:none;user-select:none}
button{font-family:inherit;cursor:pointer}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* ---------- screens ---------- */
.scr{display:none;min-height:100vh;min-height:100dvh;position:relative;z-index:1}
.scr.on{display:block}

/* ---------- COVER (GK style \u2014 defined at end of file) ---------- */

/* ---------- CHAPTERS / LIST ---------- */
.hub{max-width:980px;margin:0 auto;padding:12px 16px 40px}
.hubhead{display:none} /* Deprecated in favor of .app-header */

/* App header with level badge & settings */
.app-header {
  background: linear-gradient(180deg, #5C77FA, #4359EC);
  border-bottom: 5px solid #ffffff;
  padding: 12px clamp(16px, 6vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(71, 92, 227, 0.15), inset 0 2px 3px rgba(255, 255, 255, 0.25);
}
.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lvl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  background: linear-gradient(180deg, #9254E8, #6C2CCB);
  border: 2.5px solid #ffffff;
  border-bottom: 5px solid #ffffff;
  border-radius: 20px;
  padding: 6px 16px 8px;
  box-shadow: 0 4px 10px rgba(76, 29, 149, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.25);
  text-shadow: 0 2px 0 rgba(54,19,111,.45);
}
.header-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #fff;
  border-bottom: 5px solid #C7D4EA;
  color: #4168B7;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s;
  cursor: pointer;
}
.header-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}
.header-btn:active {
  transform: translateY(1px);
  border-bottom-width: 2.5px;
}
.settings-wrapper-outer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.lang-dropdown-container {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  align-items: center;
  width: 0;
  opacity: 0;
  overflow: visible; /* Need overflow visible so dropdown list can render outside the container! */
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, transform 0.25s ease;
  transform: translateY(-5px);
  pointer-events: none;
  z-index: 999;
}
.lang-dropdown-container.open {
  width: 145px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.lang-select-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  border-bottom: 5px solid #ffffff;
  border-radius: 24px;
  padding: 6px 14px 8px;
  color: #1e293b;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05), inset 0 2px 2px #fff;
  transition: transform 0.1s, background 0.12s;
  user-select: none;
}
.lang-select-pill:hover {
  background: #e2e8f0;
}
.lang-select-pill:active {
  transform: translateY(2px);
  border-bottom-width: 2.5px;
}
.lang-select-pill .arrow {
  font-size: 12px;
  color: #64748b;
}
.flag-holder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Custom Dropdown List overlay */
.custom-dropdown-list {
  position: absolute;
  top: calc(100% + 8px);
  left: -20px;
  right: 0;
  background: #ffffff;
  border: 2.5px solid #cbd5e1;
  border-radius: 18px;
  max-height: 285px;
  overflow-y: auto;
  z-index: 999;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  display: none;
  padding: 6px 0;
}
.custom-dropdown-list.show {
  display: block;
  animation: dropdownFadeIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Scrollbar styles */
.custom-dropdown-list::-webkit-scrollbar {
  width: 8px;
}
.custom-dropdown-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0 18px 18px 0;
}
.custom-dropdown-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}
.custom-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Custom Dropdown Items */
.custom-dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  padding: 9px 16px;
  text-align: left;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.custom-dropdown-item:hover {
  background: #f1f5f9;
}
.custom-dropdown-item.selected {
  background: #eff6ff;
  color: #2F6DF4;
}
.custom-dropdown-item .flag-img, .lang-select-pill .flag-img {
  width: 20px !important;
  height: 14px !important;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Beautiful Hub Title Section */
.hub-title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
  width: 100%;
}
.gk-logo-text, .hub-logo-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(2px, 0.6vw, 8px);
}
.gk-logo-text {
  font-size: clamp(38px, 9vw, 68px);
  margin-bottom: 2px;
}
.hub-logo-text {
  font-size: clamp(32px, 7vw, 54px);
  margin-bottom: 6px;
}

.gk-logo-text span, .hub-logo-text span {
  display: inline-block;
  font-weight: 900;
  -webkit-text-stroke: 2px #ffffff;
  paint-order: stroke fill;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
  animation: letterFloat 3s ease-in-out infinite alternate;
}
.gk-logo-text span:nth-child(even), .hub-logo-text span:nth-child(even) {
  animation-delay: 0.5s;
}

@keyframes letterFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.gk-logo-text span:nth-child(7n+1), .hub-logo-text span:nth-child(7n+1) { 
  color: #3B82F6; 
  text-shadow: 0 2px 0 #2563EB, 0 4px 0 #1D4ED8, 0 6px 0 #172554, 0 8px 12px rgba(0,0,0,0.3);
}
.gk-logo-text span:nth-child(7n+2), .hub-logo-text span:nth-child(7n+2) { 
  color: #F59E0B; 
  text-shadow: 0 2px 0 #D97706, 0 4px 0 #B45309, 0 6px 0 #78350F, 0 8px 12px rgba(0,0,0,0.3);
}
.gk-logo-text span:nth-child(7n+3), .hub-logo-text span:nth-child(7n+3) { 
  color: #EF4444; 
  text-shadow: 0 2px 0 #DC2626, 0 4px 0 #B91C1C, 0 6px 0 #7F1D1D, 0 8px 12px rgba(0,0,0,0.3);
}
.gk-logo-text span:nth-child(7n+4), .hub-logo-text span:nth-child(7n+4) { 
  color: #10B981; 
  text-shadow: 0 2px 0 #059669, 0 4px 0 #047857, 0 6px 0 #064E3B, 0 8px 12px rgba(0,0,0,0.3);
}
.gk-logo-text span:nth-child(7n+5), .hub-logo-text span:nth-child(7n+5) { 
  color: #8B5CF6; 
  text-shadow: 0 2px 0 #7C3AED, 0 4px 0 #5B21B6, 0 6px 0 #4C1D95, 0 8px 12px rgba(0,0,0,0.3);
}
.gk-logo-text span:nth-child(7n+6), .hub-logo-text span:nth-child(7n+6) { 
  color: #EC4899; 
  text-shadow: 0 2px 0 #DB2777, 0 4px 0 #BE185D, 0 6px 0 #831843, 0 8px 12px rgba(0,0,0,0.3);
}
.gk-logo-text span:nth-child(7n+7), .hub-logo-text span:nth-child(7n+7) { 
  color: #06B6D4; 
  text-shadow: 0 2px 0 #0891B2, 0 4px 0 #0E7490, 0 6px 0 #155E75, 0 8px 12px rgba(0,0,0,0.3);
}

.hub-logo-emoji {
  font-size: clamp(38px, 8vw, 58px);
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  animation: letterFloat 3.5s ease-in-out infinite alternate;
}

.hub-main-badge {
  display: inline-block;
  padding: 10px 32px 14px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 4vw, 26px);
  color: #ffffff;
  background: linear-gradient(180deg, #a855e7 0%, #7a31c8 48%, #5d209d 100%);
  border: 3.5px solid #c865ff;
  border-bottom: 8px solid #3f147b;
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(53, 18, 107, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.27);
  text-shadow: 0 3px 0 rgba(43, 12, 83, 0.4);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.hub-sub-badge {
  display: inline-block;
  padding: 8px 24px 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(13px, 2.5vw, 15px);
  color: #ffffff;
  background: linear-gradient(180deg, #259dff, #0877dd);
  border: 2px solid #75c5ff;
  border-bottom: 5px solid #126bbb;
  border-radius: 15px;
  box-shadow: 0 6px 12px rgba(12, 75, 154, 0.2), inset 0 2px 3px rgba(255, 255, 255, 0.25);
  text-shadow: 0 1.5px 0 rgba(0, 66, 145, 0.5);
}

.langpill{
  display:inline-flex;align-items:center;gap:8px;font-family:'Fredoka',sans-serif;font-weight:700;font-size:14px;
  color:#fff;border:2.5px solid #fff;border-bottom:5px solid #ffffff;border-radius:24px;padding:7px 18px 8px;
  background:linear-gradient(180deg,#9254E8,#6C2CCB);
  box-shadow:0 6px 12px rgba(75,31,146,.22),inset 0 2px 3px rgba(255,255,255,.25);text-shadow:0 2px 0 rgba(54,19,111,.45)}
.langpill:active{transform:translateY(2px);border-bottom-width:2.5px}

.pcards{display:grid;grid-template-columns:1fr 1fr;gap:18px;max-width:860px;margin:0 auto}
@media(max-width:640px){.pcards{grid-template-columns:1fr}}

.pcard{
  --theme-c1: #3B82F6;
  --theme-c2: #1D4ED8;
  display:flex;gap:14px;align-items:center;border-radius:24px;padding:12px 16px;color:#1e293b;text-align:left;
  background:linear-gradient(180deg, #ffffff 55%, var(--theme-light, rgba(255,255,255,0)) 100%), #ffffff;
  border:3px solid var(--theme-c1);border-bottom:9px solid var(--theme-c2);
  box-shadow:0 10px 20px rgba(57,74,125,.08),inset 0 2px 4px #ffffff;transition:transform .12s, border-bottom-width .12s, box-shadow .12s;
  position:relative;cursor:pointer;width:100%}
.pcard:hover{transform:translateY(-4px);box-shadow:0 14px 24px rgba(57,74,125,.12),inset 0 2px 4px #ffffff}
.pcard:active{transform:scale(.98) translateY(2px);border-bottom-width:3.5px}
.pcard .ic{
  flex:0 0 54px;height:54px;background:linear-gradient(135deg,var(--theme-c1),var(--theme-c2));color:#ffffff;
  border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:26px;
  box-shadow:0 4px 8px rgba(0,0,0,.1),inset 0 2px 4px rgba(255,255,255,.25)}
.pcard .tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.pcard .tt{font-family:'Fredoka',sans-serif;font-weight:700;font-size:clamp(16px,3.5vw,19px);line-height:1.15;color:#1e293b}
.pcard .dd{display:block;font-family:'Outfit',sans-serif;font-size:13px;font-weight:600;color:#64748b;line-height:1.25}
.pcard .pill{
  display:inline-block;margin-top:4px;align-self:flex-start;background:#f1f5f9;color:var(--theme-c1);
  border-radius:12px;font-family:'Outfit',sans-serif;font-size:11px;font-weight:800;padding:2px 10px;border:1.5px solid var(--theme-c1)}
.pcard .arrow-circle{
  flex:0 0 34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--theme-c1),var(--theme-c2));color:#ffffff;
  display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:bold;
  box-shadow:0 3px 0 var(--theme-c2),inset 0 1px 2px rgba(255,255,255,.35)}
.backpill{
  display:inline-flex;align-items:center;gap:8px;font-family:'Fredoka',sans-serif;font-weight:700;font-size:15px;color:#4168B7;
  border:3px solid #fff;border-bottom:6px solid #C7D4EA;border-radius:22px;padding:9px 20px;margin-bottom:14px;
  background:linear-gradient(180deg,#FFFFFF,#EEF4FF);box-shadow:0 7px 14px rgba(55,75,127,.18),inset 0 2px 4px #fff}
.backpill:active{transform:translateY(2px);border-bottom-width:3px}

/* ---------- CHAPTER SELECT: FUN ALPHABET SCENE ---------- */





/* ---------- GAME SHELL (glass) ---------- */
#gameScr{padding:clamp(8px,1.7vw,18px)}
.card-shell{
  position:relative;overflow:hidden;isolation:isolate;max-width:900px;margin:0 auto;
  display:flex;flex-direction:column;min-height:calc(100vh - 40px);min-height:calc(100dvh - 40px);
  border:3px solid rgba(255,255,255,.96);border-radius:clamp(24px,3vw,34px);
  background:linear-gradient(145deg,rgba(255,255,255,.82),rgba(239,244,255,.72));
  box-shadow:0 28px 64px rgba(77,65,145,.22),inset 0 2px 5px rgba(255,255,255,.92);
  backdrop-filter:blur(13px) saturate(1.12);
}
.card-shell::before{
  content:"";position:absolute;inset:78px 0 0;z-index:-1;pointer-events:none;
  background:
    radial-gradient(circle at 4% 82%,rgba(93,198,255,.28) 0 9%,transparent 9.2%),
    radial-gradient(circle at 98% 28%,rgba(232,144,226,.22) 0 8%,transparent 8.2%),
    linear-gradient(135deg,rgba(217,244,255,.5),rgba(255,235,248,.42));
}
/* white glossy toolbar */
.topbar{
  min-height:76px;padding:10px clamp(12px,2vw,22px) 13px;display:flex;align-items:center;gap:clamp(8px,1.4vw,14px);flex-wrap:wrap;
  border-bottom:8px solid rgba(146,157,203,.14);border-radius:30px 30px 0 0;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(244,248,255,.92));
  box-shadow:0 8px 22px rgba(75,73,133,.09),inset 0 2px 4px #fff;
}
.topbar .iconbtn{
  width:46px;height:46px;border-radius:50%;font-size:19px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;
  border:3px solid #fff;border-bottom:6px solid #C7D4EA;color:#4168B7;
  background:linear-gradient(180deg,#FFFFFF,#EEF4FF);
  box-shadow:0 7px 14px rgba(55,75,127,.18),inset 0 2px 4px #fff;transition:.12s}
.topbar .iconbtn:hover{transform:translateY(-2px);filter:brightness(1.03)}
.topbar .iconbtn:active{transform:translateY(2px);border-bottom-width:3px}
.topbar .gname{
  display:none !important;
}
.topbar .lvl{
  padding:7px clamp(14px,2vw,22px) 9px;border:3px solid #fff;border-bottom:6px solid var(--gk-purple-dark);border-radius:24px;
  background:linear-gradient(180deg,#9254E8,#6C2CCB);color:#fff;font-family:'Fredoka',sans-serif;font-weight:600;font-size:12.5px;white-space:nowrap;
  box-shadow:0 8px 15px rgba(75,31,146,.28),inset 0 3px 4px rgba(255,255,255,.25);text-shadow:0 2px 0 rgba(54,19,111,.45)}
.topbar .stat{
  min-width:72px;min-height:48px;padding:5px 12px 7px;display:flex;align-items:center;justify-content:center;gap:5px;
  border:2px solid #fff;border-bottom:5px solid #C7D4EA;border-radius:16px;
  background:linear-gradient(180deg,#fff,#F3F7FF);color:#6B7895;font-family:'Fredoka',sans-serif;font-weight:600;font-size:14px;
  box-shadow:0 6px 13px rgba(55,75,127,.16),inset 0 2px 3px #fff}
.topbar .stat b{color:var(--ink);font-size:16px}
.topbar .langbtn{position:relative}
.topbar .langbtn small{position:absolute;bottom:-4px;right:-5px;background:linear-gradient(180deg,#9254E8,#6C2CCB);color:#fff;font-size:9px;font-weight:800;border-radius:8px;padding:1px 5px;border:2px solid #fff}
.topbar .dots{flex:1;justify-content:center;padding:0;min-width:60px}
.dots{display:flex;gap:4px;flex-wrap:wrap;padding:9px 16px 0}
.dots .dot{width:10px;height:18px;border:2px solid #C4D2EE;border-radius:8px;background:#F6F8FF;box-shadow:inset 0 -2px 0 rgba(77,87,139,.1)}
.dots .dot.done{border-color:#7A45DB;background:#8D55EA}
.dots .dot.cur{border-color:#fff;background:#6B38D3;box-shadow:0 0 0 3px #DCCBFF}

/* white 3D content stage */
.gbody{
  flex:1;margin:clamp(12px,2.6vh,26px) clamp(12px,3.5vw,44px);padding:clamp(14px,3vw,28px);
  display:flex;flex-direction:column;align-items:center;gap:13px;
  border:4px solid rgba(255,255,255,.98);border-bottom:12px solid #C7D2E8;border-radius:clamp(22px,3vw,32px);
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(248,250,255,.92));
  box-shadow:0 24px 46px rgba(66,67,124,.18),inset 0 3px 8px rgba(255,255,255,.98);
}
.qpill{
  display:table;margin:0 auto;padding:9px 22px 11px;max-width:720px;
  border:2px solid #fff;border-bottom:5px solid #C8D5EA;border-radius:20px;
  background:linear-gradient(180deg,#fff,#F0F5FF);color:#3A4C78;
  font-family:'Baloo 2',cursive;font-weight:700;font-size:clamp(16px,3.4vw,21px);text-align:center;
  box-shadow:0 7px 15px rgba(62,77,128,.13)}
.qimg{max-width:min(400px,86%);max-height:30vh;border-radius:22px;border:4px solid #fff;box-shadow:0 14px 25px rgba(57,74,125,.16);background:#fff}
.hintline{font-family:'Fredoka',sans-serif;color:#3A4C78;font-weight:600;font-size:14.5px;text-align:center}

/* answer tiles \u2014 exact four-color rhythm */
.cards3{display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(12px,2vw,20px);width:100%;max-width:760px}
.cards3:has(.opt:nth-child(4):last-child){grid-template-columns:repeat(4,minmax(0,1fr))}
.opt{
  --tile-bg:#F3FCF4;--tile-bg2:#E4F8EA;--tile-edge:#2FA85C;
  position:relative;overflow:hidden;aspect-ratio:1/1.12;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;
  cursor:pointer;border:3px solid #fff;border-bottom:10px solid var(--tile-edge);border-radius:clamp(20px,2.4vw,26px);
  background:linear-gradient(170deg,#fff 0%,var(--tile-bg) 40%,var(--tile-bg2) 100%);
  box-shadow:0 14px 26px rgba(57,74,125,.14),inset 0 2px 6px rgba(255,255,255,.9);transition:.15s;padding:14px 10px 46px;
  animation:optPop .22s cubic-bezier(.34,1.56,.64,1) both}
.opt:nth-child(2){animation-delay:.03s}
.opt:nth-child(3){animation-delay:.06s}
.opt:nth-child(4){animation-delay:.09s}
@keyframes optPop{0%{opacity:0;transform:scale(.6) translateY(26px)}100%{opacity:1;transform:scale(1) translateY(0)}}
.opt:nth-child(4n+2){--tile-bg:#FFF7E8;--tile-bg2:#FDEECF;--tile-edge:#F0932B}
.opt:nth-child(4n+3){--tile-bg:#F7F0FE;--tile-bg2:#EFE2FC;--tile-edge:#8E4FD0}
.opt:nth-child(4n+4){--tile-bg:#EDF5FF;--tile-bg2:#DEEBFC;--tile-edge:#3E8BF3}
.opt.txt{aspect-ratio:auto;min-height:132px;height:auto;justify-content:center;padding:16px 12px 54px}
.opt .otext{overflow-wrap:break-word;word-break:break-word}
.radio{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);width:32px;height:32px;border-radius:50%;
  background:linear-gradient(180deg,#F4F7FD,#E6ECF7);box-shadow:inset 0 2px 5px rgba(80,95,140,.22),0 2px 3px #fff;
  display:flex;align-items:center;justify-content:center;font-weight:900;color:#fff;font-size:17px}
.opt.correct .radio{background:linear-gradient(180deg,#3ED27E,#17A657);box-shadow:0 4px 10px rgba(23,166,87,.4)}
.opt.correct .radio::after{content:'\2713'}
.opt.wrong .radio{background:linear-gradient(180deg,#FF7A97,#E8355F);box-shadow:0 4px 10px rgba(232,53,95,.4)}
.opt.wrong .radio::after{content:'\2715'}
.opt img{width:88%;height:64%;object-fit:contain;filter:drop-shadow(0 6px 10px rgba(0,0,0,.12))}
.opt:hover:not(.locked){transform:translateY(-6px);filter:saturate(1.06);box-shadow:0 20px 32px rgba(48,66,122,.22),inset 0 3px 8px rgba(255,255,255,.9)}
.opt:active{transform:scale(.96)}
.opt img{width:94%;height:62%;object-fit:contain}
.opt .otext{font-family:'Baloo 2',cursive;font-weight:800;font-size:clamp(15.5px,3.2vw,20px);color:#33415F;text-align:center;padding:4px 10px;line-height:1.26;width:100%}
.opt img + .otext{font-size:clamp(12.5px,2.6vw,15.5px);padding:0 6px 6px}
.opt.correct{--tile-bg:#E5FBEC;--tile-bg2:#C9F5DA;--tile-edge:#17A657;animation:winBounce .55s;box-shadow:0 0 0 4px rgba(23,166,87,.35),0 14px 26px rgba(23,166,87,.25)}
@keyframes winBounce{0%{transform:scale(1)}35%{transform:scale(1.12) rotate(-2deg)}70%{transform:scale(.97)}100%{transform:scale(1)}}
.opt.wrong{--tile-bg:#FFEDF1;--tile-bg2:#FDD5DE;--tile-edge:#E8355F;animation:shake .45s}
.opt.locked:not(.correct):not(.wrong){filter:grayscale(.55) opacity(.6)}
.opt.locked{pointer-events:none}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-7px)}75%{transform:translateX(7px)}}
@media(max-width:560px){
  .bottombar{gap:6px;padding:9px 10px 12px;min-height:62px}
  .bbtn{font-size:13px;padding:8px 12px 9px;border-radius:12px;border-bottom-width:5px}
  .bbtn.next{padding:8px 14px 10px;border-bottom-width:5px}
  .bbtn.hint{padding:8px 12px 9px}
  .navgrp{gap:6px}
  .progpill{font-size:12.5px;padding:6px 12px;border-bottom-width:4px}
}
@media(max-width:720px){
  .topbar .dots {
    display: none !important;
  }
  .cards3{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:12px;max-width:440px}
  .cards3:has(.opt:nth-child(4):last-child){grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .cards3 .opt:nth-child(3):last-child{grid-column:1/-1;width:calc(50% - 6px);justify-self:center}
  .opt{border-bottom-width:8px}
}

/* purple word chips + fill lines */
.bank{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;max-width:680px}
.chip{
  border:3px solid #fff;border-bottom:7px solid #6E3DC0;border-radius:16px;
  background:linear-gradient(180deg,#9B64E8,#7335CD);color:#fff;
  font-family:'Baloo 2',cursive;font-weight:800;font-size:16.5px;padding:9px 20px;
  box-shadow:0 8px 15px rgba(68,35,131,.2),inset 0 2px 3px rgba(255,255,255,.25);transition:.12s}
.chip:hover{transform:translateY(-4px);filter:brightness(1.05)}
.chip:active{transform:translateY(2px);border-bottom-width:3px}
.chip.used{opacity:.35;pointer-events:none}
.chip.wrong{animation:shake .4s;background:linear-gradient(180deg,#F87BA0,#E63D68);border-bottom-color:#B91C4B}
.lines{display:flex;flex-direction:column;gap:10px;width:100%;max-width:680px}
.line{
  border:3px solid #fff;border-bottom:6px solid #C7D4EA;border-radius:18px;padding:11px 15px;
  background:linear-gradient(145deg,#fff,#F5F8FF);box-shadow:0 8px 16px rgba(54,72,125,.10),inset 0 2px 4px #fff;
  font-family:'Fredoka',sans-serif;font-weight:600;font-size:clamp(15px,3.4vw,18.5px);line-height:1.6;color:#3A4C78}
.line.cur{border-bottom-color:#6E3DC0;background:linear-gradient(145deg,#FCF8FF,#F0E5FF)}
.line .blank{display:inline-block;min-width:86px;border-bottom:3px dashed #8B5ACD;color:#7432D5;font-family:'Baloo 2',cursive;font-weight:800;text-align:center;padding:0 6px}
.line .blank.fill{border-bottom-style:solid;border-bottom-color:var(--green);color:#1B8A50}
.line .spk{border:2px solid #fff;background:linear-gradient(180deg,#fff,#ECF4FF);color:var(--gk-blue);border-bottom:4px solid #C8D5EA;border-radius:50%;width:32px;height:32px;font-size:14px;margin-left:8px;vertical-align:middle;box-shadow:0 4px 8px rgba(51,74,129,.16)}

/* match tiles: blue left / purple right */
.mwrap{display:flex;flex-direction:column;gap:11px;width:100%;max-width:720px;margin:0 auto}
.mrow{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:stretch}
.mcol{display:flex;flex-direction:column;gap:11px;flex:1;max-width:320px}
.mitem{
  display:flex;align-items:center;justify-content:center;gap:8px;height:100%;min-height:clamp(88px,13vh,112px);padding:9px;text-align:center;cursor:pointer;
  border:4px solid #fff;border-bottom:9px solid #4D8EDB;border-radius:22px;
  background:linear-gradient(145deg,#F5FAFF,#D9EBFF);
  box-shadow:0 12px 22px rgba(59,74,127,.16),inset 0 2px 4px #fff;
  font-family:'Baloo 2',cursive;font-weight:800;font-size:clamp(13.5px,3vw,17px);color:var(--ink);transition:.12s}
.mitem-r{border-bottom-color:#8B5ACD;background:linear-gradient(145deg,#FCF8FF,#EBD5FF)}
.mcol:nth-child(2) .mitem{border-bottom-color:#8B5ACD;background:linear-gradient(145deg,#FCF8FF,#EBD5FF)}
.mitem img{max-height:92%;max-width:100%;object-fit:contain;border-radius:12px}
.mitem:hover{transform:translateY(-3px)}
.mitem.sel{border-bottom-color:#1AA8D2;background:linear-gradient(145deg,#F0FCFF,#C9F0FA);transform:scale(1.03)}
.mitem.done{border-bottom-color:#21A55B;background:linear-gradient(145deg,#F4FFF7,#D9FBE5);pointer-events:none}
.mitem.wrong{animation:shake .4s}

/* pickset white 3D cards */
.pgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;width:100%;max-width:720px}
@media(max-width:560px){
  .bottombar{gap:6px;padding:9px 10px 12px;min-height:62px}
  .bbtn{font-size:13px;padding:8px 12px 9px;border-radius:12px;border-bottom-width:5px}
  .bbtn.next{padding:8px 14px 10px;border-bottom-width:5px}
  .bbtn.hint{padding:8px 12px 9px}
  .navgrp{gap:6px}
  .progpill{font-size:12.5px;padding:6px 12px;border-bottom-width:4px}
}
@media(max-width:720px){.pgrid{grid-template-columns:repeat(2,1fr)}}
.pick{
  display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px;overflow:hidden;
  border:4px solid #fff;border-bottom:9px solid #C7D4EA;border-radius:24px;
  background:linear-gradient(145deg,#fff,#EAF3FF);
  box-shadow:0 14px 25px rgba(54,72,125,.16),inset 0 3px 5px #fff;transition:.12s}
.pick img{width:100%;height:clamp(72px,14vw,110px);object-fit:contain}
.pick .pt{font-family:'Baloo 2',cursive;font-weight:800;font-size:14.5px;color:var(--ink);padding-bottom:3px;text-align:center}
.pick:hover{transform:translateY(-4px)}
.pick:active{transform:scale(.95)}
.pick.good{border-bottom-color:#21A55B;background:linear-gradient(145deg,#F4FFF7,#D9FBE5);pointer-events:none}
.pick.bad{animation:shake .4s;border-bottom-color:#E63D68;background:linear-gradient(145deg,#FFF6F9,#FFE3EC)}

/* order cards */
.ogrid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;width:100%;max-width:780px}
@media(max-width:560px){
  .bottombar{gap:6px;padding:9px 10px 12px;min-height:62px}
  .bbtn{font-size:13px;padding:8px 12px 9px;border-radius:12px;border-bottom-width:5px}
  .bbtn.next{padding:8px 14px 10px;border-bottom-width:5px}
  .bbtn.hint{padding:8px 12px 9px}
  .navgrp{gap:6px}
  .progpill{font-size:12.5px;padding:6px 12px;border-bottom-width:4px}
}
@media(max-width:720px){.ogrid{grid-template-columns:repeat(3,1fr)}}
.ocard{
  position:relative;padding:6px;
  border:4px solid #fff;border-bottom:9px solid #C7D4EA;border-radius:22px;
  background:linear-gradient(145deg,#fff,#EAF3FF);
  box-shadow:0 12px 22px rgba(54,72,125,.15),inset 0 2px 4px #fff;transition:.12s}
.ocard img{width:100%;height:clamp(72px,18vw,112px);object-fit:contain}
.ocard .ot{font-family:'Fredoka',sans-serif;font-weight:600;font-size:12px;text-align:center;color:#3A4C78}
.ocard:hover{transform:translateY(-4px)}
.ocard:active{transform:scale(.95)}
.ocard.done{border-bottom-color:#21A55B;background:linear-gradient(145deg,#F4FFF7,#D9FBE5);pointer-events:none}
.ocard.bad{animation:shake .4s}
.ocard .num{position:absolute;top:-9px;left:-9px;width:31px;height:31px;border-radius:50%;background:linear-gradient(180deg,#9B64E8,#7335CD);border:3px solid #fff;color:#fff;font-family:'Baloo 2',cursive;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 9px rgba(68,35,131,.3);z-index:2}

/* sort bins (dashed purple photobox style) */
.bins{display:flex;gap:14px;width:100%;max-width:680px;justify-content:center}
.bin{
  flex:1;max-width:290px;padding:12px;text-align:center;min-height:158px;transition:.12s;
  border:4px dashed #B78AEF;border-bottom:8px solid #8B5ACD;border-radius:22px;
  background:linear-gradient(145deg,#FFF8FE,#F1E4FF);
  box-shadow:0 12px 24px rgba(84,51,134,.14),inset 0 2px 5px #fff}
.bin.sel{border-color:#1AA8D2;background:linear-gradient(145deg,#F0FCFF,#D8F3FB)}
.bin h4{font-family:'Baloo 2',cursive;font-weight:800;font-size:18px;color:#7432D5;margin-bottom:6px}
.bin img{height:62px;object-fit:contain;margin-bottom:4px;border-radius:14px}
.bin .got{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.bin .got span{background:#DCFCE7;border:2px solid #fff;border-bottom:4px solid #21A55B;color:#166534;border-radius:14px;font-family:'Baloo 2',cursive;font-weight:800;font-size:13.5px;padding:3px 12px;box-shadow:0 4px 8px rgba(33,165,91,.16)}

/* story / poem panels */
.panelimg{max-width:min(560px,94%);max-height:38vh;border-radius:24px;border:4px solid #fff;box-shadow:0 14px 25px rgba(57,74,125,.16);object-fit:contain;background:#fff}
.ptext{
  border:3px solid #fff;border-bottom:8px solid #C7D4EA;border-radius:24px;padding:14px 18px;max-width:700px;
  background:linear-gradient(145deg,#fff,#F5F8FF);box-shadow:0 13px 24px rgba(54,72,125,.13),inset 0 2px 4px #fff;
  font-family:'Fredoka',sans-serif;font-weight:500;font-size:clamp(15.5px,3.6vw,19px);line-height:1.68;color:#3A4C78;text-align:left}
.spkline{
  border:3px solid #fff;border-bottom:6px solid #C8D5EA;border-radius:18px;padding:7px 18px;margin-top:10px;
  background:linear-gradient(180deg,#fff,#ECF4FF);color:var(--gk-blue);
  font-family:'Baloo 2',cursive;font-weight:700;font-size:14px;box-shadow:0 8px 16px rgba(51,74,129,.16)}
.spkline:active{transform:translateY(2px);border-bottom-width:3px}
.poemline{
  width:100%;max-width:680px;padding:11px 16px;text-align:left;cursor:pointer;
  border:3px solid #fff;border-bottom:7px solid #C7D4EA;border-left:9px solid #8B5ACD;border-radius:20px;
  background:linear-gradient(145deg,#fff,#F5F8FF);box-shadow:0 10px 18px rgba(54,72,125,.11),inset 0 2px 4px #fff;
  font-family:'Fredoka',sans-serif;font-weight:600;font-size:clamp(15px,3.5vw,18.5px);line-height:1.62;color:#3A4C78;transition:.12s}
.poemline:hover{transform:translateY(-2px)}
.poemline.playing{border-bottom-color:#6E3DC0;background:linear-gradient(145deg,#FCF8FF,#F0E5FF)}
.poet{font-family:'Baloo 2',cursive;color:#E11D62;font-weight:700;font-size:15px;align-self:flex-end;max-width:680px}
.meanwrap{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;max-width:700px}
.mean{
  border:3px solid #fff;border-bottom:5px solid #21A55B;border-radius:16px;padding:7px 14px;cursor:pointer;
  background:linear-gradient(145deg,#F4FFF7,#DCFCE7);box-shadow:0 6px 12px rgba(33,165,91,.14);
  font-family:'Outfit',sans-serif;font-size:13.5px;font-weight:600;color:#14532D}
.mean b{color:#E11D62}

/* reference-style stat pills, round buttons, progress pill */
.statpill{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:64px;padding:5px 10px;
  background:#fff;border-radius:14px;box-shadow:0 4px 10px rgba(57,74,125,.12);border:2px solid #F0F3FA}
.statpill b{font-family:'Baloo 2',cursive;font-size:15px;color:#27324F;display:flex;align-items:center;gap:3px}
.statpill small{font-family:'Outfit',sans-serif;font-size:10.5px;font-weight:600;color:#8A93AC;margin-top:-2px}
.iconbtn.round{width:44px;height:44px;border-radius:50%!important;display:flex;align-items:center;justify-content:center}
#sndBtn.round{background:linear-gradient(180deg,#3ECBF0,#12A5D8);color:#fff;border-color:#fff}
.progpill{font-family:'Baloo 2',cursive;font-weight:800;font-size:16px;color:#7434C9;background:#fff;white-space:nowrap;
  padding:8px 22px;border-radius:999px;border:3px solid #F0E9FC;border-bottom:5px solid #C9B2EE;
  box-shadow:0 6px 14px rgba(116,52,201,.14)}
.qbig{
  font-family:'Baloo 2',cursive,sans-serif;
  font-weight:900;
  font-size: clamp(24px,3.2vw,30px);
  line-height:1.2;
  color:#3B82F6;
  text-align:center;
  text-shadow:0 3px 0 rgba(37,99,235,.18),0 6px 14px rgba(59,130,246,.22);
  padding:2px 12px;
  width:100%;
  max-width:920px;
  margin:0 auto;
  text-wrap:balance;
  box-sizing:border-box;
}
.qbig.long{
  font-size: clamp(21px,2.5vw,26px) !important;
  line-height:1.24 !important;
}
.qbig.vlong{
  font-size: clamp(19px,2.1vw,23px) !important;
  line-height:1.26 !important;
}
.qsub{font-family:'Fredoka',sans-serif;font-weight:600;font-size:clamp(12.5px,2.4vw,15.5px);color:#3A4C78;
  background:#fff;border-radius:999px;padding:6px 18px;border:2px solid #EEF2FA;border-bottom:3px solid #DDE5F2;
  box-shadow:0 4px 10px rgba(57,74,125,.08);margin:2px auto 6px}

/* footer nav \u2014 white glossy */
.bottombar{
  min-height:74px;display:flex;gap:10px;justify-content:space-between;align-items:center;
  /* hint | progress | nav */
  padding:11px clamp(16px,2vw,28px) 14px;border-top:3px solid #fff;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(246,249,255,.94));
  box-shadow:0 -8px 22px rgba(67,70,126,.1),inset 0 2px 4px #fff}
.bbtn{
  font-family:'Fredoka',sans-serif;font-weight:700;font-size:16px;transition:.12s;
  padding:9px clamp(16px,2.4vw,24px) 11px;border:3px solid #fff;border-bottom:6px solid #C5D2E8;border-radius:15px;
  background:linear-gradient(180deg,#fff,#EEF4FF);color:#354A76;
  box-shadow:0 7px 14px rgba(52,72,124,.16),inset 0 2px 3px #fff}
.bbtn.next{
  padding:10px clamp(18px,2.7vw,29px) 12px;border-bottom:7px solid var(--gk-blue-dark);
  background:linear-gradient(180deg,#4388FF,#2363E5);color:#fff;
  box-shadow:0 8px 16px rgba(31,83,187,.25),inset 0 2px 4px rgba(255,255,255,.28);text-shadow:0 2px 0 rgba(21,64,153,.45)}
.bbtn:hover{transform:translateY(-2px);filter:brightness(1.04)}
.bbtn:active{transform:translateY(2px);border-bottom-width:3px}
.bbtn:disabled{opacity:.45;pointer-events:none}
.navgrp{display:flex;gap:10px;align-items:center}
.bbtn.hint{
  padding:10px clamp(16px,2.4vw,26px) 12px;border-bottom:6px solid #C5D2E8;
  background:linear-gradient(180deg,#fff,#F2F6FF);color:#354A76;
  box-shadow:0 7px 14px rgba(52,72,124,.16),inset 0 2px 3px #fff}
@keyframes hintPulse{0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(245,168,0,.7)}50%{transform:scale(1.07);box-shadow:0 0 0 14px rgba(245,168,0,0)}}
.hintglow{animation:hintPulse .7s ease-in-out 3;outline:4px solid #F5A800;outline-offset:2px;border-radius:16px;z-index:5}

.poemline.odone{background:linear-gradient(160deg,#5FE595,#17A657)!important;color:#fff!important;pointer-events:none}
.poemline .onum{display:inline-flex;width:26px;height:26px;border-radius:50%;background:#fff;color:#0C7A3D;
  align-items:center;justify-content:center;font-weight:900;margin-right:6px;border:2px solid #0C7A3D}
.poemline.shake{animation:shake .45s;background:linear-gradient(160deg,#FF8FA9,#E8355F)!important;color:#fff!important}
@keyframes shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}}

.blank.fill.bad{color:#E8355F!important;border-bottom-color:#E8355F!important}
.blank.fill.bad::after{content:' \2715';font-weight:900}
.mitem.done.bad{border-bottom-color:#E8355F!important;background:linear-gradient(145deg,#FFF5F8,#FDD5DE)!important}
.ocard.done.bad{border-bottom-color:#E8355F!important;background:linear-gradient(145deg,#FFF5F8,#FDD5DE)!important}
.ocard.done.bad .num{background:#E8355F!important;border-color:#B01B41!important}
.poemline.odone.obad{background:linear-gradient(160deg,#FF8FA9,#E8355F)!important}
.poemline.odone.obad .onum{color:#B01B41;border-color:#B01B41}
.bin .got .sbad{background:#FDD5DE!important;color:#B01B41!important;border-color:#E8355F!important}

.builtline{min-height:46px;width:100%;max-width:660px;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px;
  font-family:'Baloo 2',cursive;font-weight:800;font-size:clamp(16px,3.4vw,21px);color:#0C7A3D;text-align:center;
  background:linear-gradient(145deg,#F4FFF7,#DCFCE7);border:3px solid #fff;border-bottom:6px solid #21A55B;border-radius:18px;padding:9px 16px;
  box-shadow:0 8px 16px rgba(33,165,91,.14)}
.bbtn,.opt,.chip,.mitem,.pick,.ocard,.poemline,.iconbtn{touch-action:manipulation}

/* toast */
#toast{
  position:fixed;left:50%;bottom:92px;transform:translateX(-50%) translateY(20px);z-index:60;opacity:0;pointer-events:none;transition:.25s;
  border:3px solid #fff;border-bottom:6px solid #C7D2E8;border-radius:18px;padding:10px 24px;
  background:linear-gradient(180deg,#fff,#F0F5FF);color:#3A4C78;
  font-family:'Baloo 2',cursive;font-weight:700;font-size:16px;box-shadow:0 12px 25px rgba(52,69,119,.2)}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
#toast.good{background:linear-gradient(180deg,#E9FFF2,#C9F7DC);border-bottom-color:#21A55B;color:#14532D}
#toast.bad{background:linear-gradient(180deg,#FFF0F4,#FFDBE6);border-bottom-color:#E63D68;color:#9F1239}

/* end overlay \u2014 sky/pink glass */
#endOv{
  position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:70;padding:18px;
  background:linear-gradient(125deg,rgba(130,217,246,.94),rgba(249,207,232,.94));backdrop-filter:blur(8px)}
#endOv.on{display:flex}
.endcard{
  text-align:center;max-width:430px;width:100%;padding:clamp(22px,4vw,34px);
  border:4px solid #fff;border-bottom:11px solid #C7D2E8;border-radius:30px;
  background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(246,249,255,.96));
  box-shadow:0 24px 50px rgba(61,61,117,.22),inset 0 3px 6px #fff}
.endcard .stars{font-size:46px;letter-spacing:6px;filter:drop-shadow(0 4px 6px rgba(180,130,20,.35))}
.endcard h2{font-family:'Baloo 2',cursive;font-weight:800;font-size:27px;color:var(--gk-blue);text-shadow:0 3px 0 #CEDCF5;margin:6px 0 2px}
.endcard p{font-family:'Fredoka',sans-serif;font-weight:600;color:#6B7895;margin-bottom:16px}
.endcard .row{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}

/* language + settings overlays */
#langMenu,#setScreen{
  position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:80;padding:16px;
  background:linear-gradient(125deg,rgba(130,217,246,.9),rgba(249,207,232,.9));backdrop-filter:blur(6px)}
#langMenu.on,#setScreen.on{display:flex}
.langcard{
  max-width:740px;width:100%;max-height:86vh;display:flex;flex-direction:column;overflow:hidden;
  border:4px solid #fff;border-bottom:11px solid #C7D2E8;border-radius:30px;
  background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(246,249,255,.96));
  box-shadow:0 24px 50px rgba(61,61,117,.22),inset 0 3px 6px #fff}
.langhead{padding:15px 18px 11px;display:flex;align-items:center;gap:10px;border-bottom:3px solid #EDF2FC}
.langhead h3{font-family:'Baloo 2',cursive;font-weight:800;font-size:20px;color:var(--gk-blue);text-shadow:0 2px 0 #DCE7F8;flex:1}
.langhead button{
  width:38px;height:38px;border-radius:50%;font-size:16px;font-weight:800;color:#4168B7;
  border:3px solid #fff;border-bottom:5px solid #C7D4EA;background:linear-gradient(180deg,#fff,#EEF4FF);
  box-shadow:0 5px 10px rgba(55,75,127,.16)}
#langSearch{
  margin:12px 16px 6px;padding:11px 16px;outline:none;
  border:3px solid #D6E1F2;border-bottom-width:5px;border-radius:16px;background:#fff;color:var(--ink);
  font-family:'Fredoka',sans-serif;font-weight:600;font-size:15px}
#langSearch:focus{border-color:#8B5ACD}
#langList{overflow:auto;padding:12px 16px 18px;display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:9px}
.lang-item{
  display:flex;flex-direction:column;gap:1px;text-align:left;padding:8px 12px;min-height:48px;justify-content:center;transition:.1s;
  border:3px solid #fff;border-bottom:5px solid #C7D2E8;border-radius:14px;
  background:linear-gradient(180deg,#fff,#F0F5FF);box-shadow:0 5px 10px rgba(52,71,122,.1)}
.lang-item:hover{transform:translateY(-2px)}
.lang-item .ln-native{font-family:'Fredoka',sans-serif;font-weight:700;font-size:15px;color:var(--ink);line-height:1.15}
.lang-item .ln-eng{font-family:'Outfit',sans-serif;font-size:11.5px;color:#90A4BE;font-weight:500;line-height:1.1}
.lang-item.sel{border-bottom-color:#4C1D95;background:linear-gradient(180deg,#9254E8,#6C2CCB)}
.lang-item.sel .ln-native{color:#fff}.lang-item.sel .ln-eng{color:rgba(255,255,255,.85)}
.transnote{margin:0 16px 10px;font-family:'Outfit',sans-serif;font-size:12.5px;color:#7432D5;font-weight:600;text-align:center}
/* voice settings */
.setbody{padding:16px 20px 22px;display:flex;flex-direction:column;gap:12px}
.setbody label{font-family:'Fredoka',sans-serif;font-weight:700;color:#3A4C78;font-size:15px}
#voiceSel{
  padding:11px 14px;font-family:'Outfit',sans-serif;font-weight:600;font-size:14px;width:100%;
  border:3px solid #D6E1F2;border-bottom-width:5px;border-radius:14px;background:#fff;color:var(--ink)}
#voiceHint{font-family:'Outfit',sans-serif;font-size:13px;color:#64748B;font-weight:500}
#testVoice{align-self:flex-start}

/* confetti canvas */
#confetti{position:fixed;inset:0;pointer-events:none;z-index:75}
@media(max-width:560px){
  .bottombar{gap:6px;padding:9px 10px 12px;min-height:62px}
  .bbtn{font-size:13px;padding:8px 12px 9px;border-radius:12px;border-bottom-width:5px}
  .bbtn.next{padding:8px 14px 10px;border-bottom-width:5px}
  .bbtn.hint{padding:8px 12px 9px}
  .navgrp{gap:6px}
  .progpill{font-size:12.5px;padding:6px 12px;border-bottom-width:4px}
}
@media(max-width:720px){
  .card-shell{border-radius:22px}
  .topbar{min-height:64px;padding:8px 9px 10px;border-radius:20px 20px 0 0}
  .topbar .stat{min-width:54px;padding-inline:6px}
  .gbody{margin:10px;padding:12px;border-bottom-width:8px}
  .bottombar{min-height:62px;padding:8px 9px 10px}
  .bbtn{padding-inline:13px}
  .cover-left{flex:0 0 auto}
}
@media(max-width:460px){
  .topbar .lvl{padding-inline:10px}
  .topbar .stat{display:none}
  .mwrap{gap:8px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}


/* ============ GK Explorer style cover ============ */
#coverScr{display:none;flex-direction:column;align-items:stretch;padding:0;position:relative}
#coverScr.on{display:flex}
.gk-clouds{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.gkcloud{position:absolute;color:rgba(255,255,255,.8);font-size:6rem;filter:drop-shadow(0 8px 15px rgba(255,255,255,.5));animation:gkDrift 60s linear infinite;left:-220px}
.gkc1{top:10%;animation-duration:48s}
.gkc2{top:38%;font-size:8.5rem;animation-duration:72s;animation-delay:-20s}
.gkc3{top:72%;font-size:5rem;animation-duration:58s;animation-delay:-36s}
@keyframes gkDrift{0%{transform:translateX(0)}100%{transform:translateX(calc(100vw + 440px))}}
.gk-header-outer{background:linear-gradient(180deg, #5C77FA, #4359EC);border-bottom:5px solid #ffffff;padding:12px clamp(16px, 6vw, 48px);position:relative;z-index:5;box-shadow:0 8px 20px rgba(71, 92, 227, 0.15),inset 0 2px 3px rgba(255, 255, 255, 0.25)}
.gk-header{max-width:1180px;margin:0 auto;background:transparent;border:none;border-radius:0;padding:0;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:none}
.gk-hl,.gk-hr{display:flex;align-items:center;gap:11px}
.gk-title{font-family:'Fredoka',sans-serif;font-weight:700;font-size:clamp(17px,3.4vw,23px);color:#fff;text-shadow:0 2px 0 rgba(60,15,120,.4)}
.gk-circle{width:46px;height:46px;border-radius:50%;border:2.5px solid rgba(255,255,255,0.9);border-bottom:5px solid rgba(0,0,0,0.25);cursor:pointer;font-size:20px;display:flex;align-items:center;justify-content:center;color:#fff;transition:transform 0.12s, border-bottom-width 0.12s;box-shadow:0 6px 14px rgba(0,0,0,0.15),inset 0 2px 3px rgba(255,255,255,.3)}
.gk-circle:hover{transform:translateY(-3px) scale(1.05)}
.gk-circle:active{transform:translateY(1.5px);border-bottom-width:2.5px}
.gk-blue{background:linear-gradient(180deg,#4DA3FF,#1D6FE0)}
.gk-purple{background:linear-gradient(180deg,#C069F5,#8E2DE2)}
.gk-cyan{background:linear-gradient(180deg,#3ECBF0,#12A5D8)}
.gk-badge{background:linear-gradient(180deg,#ff659e,#df1f68);color:#fff;font-family:'Fredoka',sans-serif;font-weight:700;font-size:12.5px;letter-spacing:1px;padding:7px 16px 8px;border-radius:18px;border:2.5px solid rgba(255,255,255,.9);border-bottom:5px solid #a5114e;box-shadow:0 6px 14px rgba(85,22,92,.22);text-shadow:0 2px 0 rgba(126,15,59,.5)}
.gk-cover{flex:1;min-height:calc(100dvh - 79px);display:flex;align-items:center;justify-content:center;padding:clamp(18px,4vw,46px) 18px;position:relative;z-index:1}
.gk-txtcol{display:flex;flex-direction:column;align-items:center;gap:14px;max-width:760px;text-align:center;margin-bottom:clamp(10px,6vh,60px)}
.gk-ukg{padding:8px 24px 11px;border:2.5px solid rgba(255,255,255,.95);border-bottom:6px solid #a5114e;border-radius:24px;background:linear-gradient(180deg,#ff659e,#df1f68);box-shadow:0 8px 18px rgba(85,22,92,.35),inset 0 2px 3px rgba(255,255,255,.3);color:#fff;font-family:'Fredoka',sans-serif;font-weight:700;font-size:14px;letter-spacing:1px;text-transform:uppercase;text-shadow:0 2px 0 rgba(126,15,59,0.5);animation:letterFloat 3.5s ease-in-out infinite alternate}

.gk-ctitle {
  display: inline-block;
  padding: 10px 48px 14px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 5vw, 36px);
  color: #ffffff;
  background: linear-gradient(180deg, #a855e7 0%, #7a31c8 48%, #5d209d 100%);
  border: 3.5px solid #c865ff;
  border-bottom: 9px solid #3f147b;
  border-radius: 999px; /* Capsule shape matching 2nd image */
  box-shadow: 0 12px 24px rgba(53, 18, 107, 0.28), inset 0 2px 4px rgba(255, 255, 255, 0.27);
  text-shadow: 0 3px 0 rgba(43, 12, 83, 0.4);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}
.gk-desc {
  max-width: 580px;
  padding: 12px 32px 14px;
  margin: 2px 0 8px;
  border: 3px solid #75c5ff;
  border-bottom: 7px solid #1165b3;
  border-radius: 40px; /* Highly-rounded capsule for multi-line description */
  background: linear-gradient(180deg, #259dff, #0877dd);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(13px, 2vw, 16px);
  line-height: 1.35;
  text-shadow: 0 2.5px 0 rgba(0, 66, 145, 0.5);
  box-shadow: 0 10px 20px rgba(12, 75, 154, 0.22), inset 0 2px 3px rgba(255, 255, 255, 0.25);
}
.gk-btn {
  margin-top: 10px;
  padding: 14px 44px 18px;
  border: 3.5px solid #fff3a5;
  border-bottom: 9px solid #bd3f0e;
  border-radius: 999px; /* Capsule shaped play button matching 2nd image */
  background: linear-gradient(180deg, #ffbf30, #ff6b19);
  color: #fff;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 4.5vw, 26px);
  box-shadow: 0 14px 28px rgba(122, 40, 13, 0.35), inset 0 3px 5px rgba(255, 255, 255, 0.4);
  text-shadow: 0 3px 0 rgba(144, 48, 9, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  animation: gkPulse 1.6s ease-in-out infinite alternate;
  transition: transform 0.15s, border-bottom-width 0.15s;
}
.gk-btn:hover{transform:translateY(-3px) scale(1.03);filter:brightness(1.06)}
.gk-btn:active{transform:translateY(3px);border-bottom-width:4px}
@keyframes gkPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.045)}}

/* ============ RESPONSIVE POLISH \u2014 mobile / tablet / desktop (v20260724l) ============ */
/* global wrap + overflow safety */
.gname,.qpill,.line,.mitem,.opt .otext,.pick .pt{overflow-wrap:break-word;word-break:break-word}
#gbody img{max-width:100%}

/* -- BIG DESKTOP: roomier card + hub -- */
@media(min-width:1200px){
  .card-shell{max-width:1060px}
  .hub{max-width:1060px}
  .gbody{gap:16px}
}

/* -- MOBILE / SMALL TABLET game topbar: clean rows, game name ALWAYS visible -- */
@media(max-width:720px){
  .topbar{row-gap:7px;padding:8px 10px 10px}
  .topbar .gname{order:5;flex:1 1 100%;text-align:center;font-size:15.5px;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar .dots{order:6;flex:1 1 100%;min-width:0}
  .topbar .lvl{flex:1 1 auto;min-width:0;max-width:46vw;overflow:hidden;text-overflow:ellipsis;text-align:center}
  .statpill{min-width:54px;padding:4px 8px}
  .statpill small{display:none}
  .statpill b{font-size:14px}
  .bbtn{min-height:44px}
  .bbtn.next{min-height:46px}
}

/* -- SMALL PHONES -- */
@media(max-width:460px){
  .topbar .iconbtn{width:40px;height:40px;font-size:17px;border-bottom-width:5px}
  .topbar .lvl{font-size:11.5px;padding:6px 10px 8px;max-width:40vw}
  .statpill{min-width:46px;padding:3px 6px}
  .qpill{font-size:15.5px;padding:8px 14px 10px}
  .chip{font-size:15px;padding:8px 15px}
  .bank{gap:8px}
  .panelimg{max-height:34dvh}
  .mitem{height:auto;min-height:clamp(74px,11.5vh,96px);border-bottom-width:7px;border-radius:18px}
  .opt.txt{min-height:110px;padding:12px 8px 48px}
  .endcard{border-radius:24px}
  .endcard .stars{font-size:38px}
  .endcard h2{font-size:23px}
  .hub{padding:14px 12px 32px}
  .pcard{padding:13px 14px;border-bottom-width:7px;border-radius:20px}
}

/* very narrow: order cards 2-up so labels stay readable */
@media(max-width:400px){
  .ogrid{grid-template-columns:repeat(2,1fr)}
  .pgrid{gap:9px}
}

/* -- LANDSCAPE PHONES / SHORT SCREENS: compress vertical chrome -- */
@media(max-height:520px) and (orientation:landscape){
  .gk-cover{min-height:calc(100dvh - 56px);padding:10px 14px}
  .gk-txtcol{gap:8px;margin-bottom:8px}
  .gk-ctitle{padding:8px 26px 12px;border-bottom-width:7px;font-size:clamp(20px,4.5vw,34px)}
  .gk-desc{padding:6px 14px 8px;font-size:12.5px}
  .gk-btn{padding:9px 26px 12px;border-bottom-width:6px;font-size:16px}
  .topbar{min-height:52px;padding:6px 10px 8px;row-gap:4px}
  .topbar .iconbtn{width:38px;height:38px;font-size:16px}
  .statpill{display:none}
  .gbody{margin:8px 10px;padding:10px 12px;border-bottom-width:7px}
  .bottombar{min-height:52px;padding:6px 8px 8px}
  .panelimg{max-height:52dvh}
  .langcard{max-height:92dvh}
}

/* language pill button in topbar (replaces Time pill) \u2014 v20260724m */
.langstat{cursor:pointer;font-family:inherit;transition:.12s;
  border:2px solid #E4D6FB;background:linear-gradient(180deg,#FDFBFF,#F3EBFE)}
.langstat b{color:#6C2CCB}
.langstat small{color:#8E6BC8}
.langstat:hover{transform:translateY(-2px);box-shadow:0 7px 14px rgba(94,53,177,.2)}
.langstat:active{transform:translateY(1px)}
/* compact first row on very narrow phones so all controls fit one line */
@media(max-width:400px){
  .topbar{gap:5px}
  .topbar .lvl{max-width:31vw;font-size:11px;padding:6px 8px 8px}
  .statpill{min-width:42px;padding:3px 5px}
  .statpill b{font-size:13px}
  .topbar .iconbtn{width:38px;height:38px;font-size:16px}
}

/* ============ GK EXPLORER 2 \u2014 responsive pass (append-only; engine CSS above untouched) ============ */
/* 1) Game shell = the viewport: toolbar + Back/Next pinned, only the white stage scrolls */
body:not(.launcher){overflow:hidden}
#gameScr.on{position:fixed;inset:0;overflow:hidden;padding:clamp(8px,1.6vh,20px) clamp(6px,1.6vw,20px)}
#gameScr .card-shell{height:100%;min-height:0;max-height:100%}
#gameScr .topbar,#gameScr .bottombar{flex:0 0 auto}
#gameScr .gbody{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;justify-content:flex-start}
#gameScr .gbody > *{flex-shrink:0}
@media(max-width:560px){#gameScr.on{padding:6px 5px}}

/* 2) Chapter hub: 1 / 2 / 3 columns by width (list screen shares .pcards) */
.pcards{grid-template-columns:repeat(3,minmax(0,1fr));max-width:100%}
@media(max-width:1023px){.pcards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.pcards{grid-template-columns:1fr}}
.pcard .tx{min-width:0}
.pcard .tt{overflow-wrap:anywhere}

/* 3) Answer boxes: clean, perfectly square-proportioned boxes exactly matching reference project (EVS Class 3) */
.cards3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 24px);
  width: 100%;
  max-width: 760px;
  margin: 14px auto 20px;
  align-items: stretch;
  justify-content: center;
}
.cards3:has(.opt:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
}
.cards3:has(.opt:nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 820px;
}
.cards3 .opt {
  width: 100%;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}
.cards3 .opt.txt {
  height: 160px;
  min-height: 160px;
  max-height: 160px;
  padding: 16px 12px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: clamp(20px, 2.4vw, 26px);
  border: 3px solid #fff;
  border-bottom: 10px solid var(--tile-edge);
}
.cards3 .opt.txt .otext {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: clamp(17px, 2.5vw, 22px);
  line-height: 1.22;
  color: #33415F;
  text-align: center;
  padding: 0 4px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.cards3 .opt.txt .otext.long {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(13.5px, 2vw, 16.5px);
  font-weight: 700;
  line-height: 1.25;
}
.cards3 .opt:not(.txt) {
  height: 160px;
  min-height: 160px;
  max-height: 160px;
  padding: 10px 8px 44px;
}
.cards3 .radio {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 17px;
}
@media(max-width:720px) {
  .cards3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    max-width: 440px !important;
    margin: 10px auto 14px !important;
  }
  .cards3:has(.opt:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 440px !important;
  }
  .cards3:has(.opt:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 440px !important;
  }
  .cards3 .opt:nth-child(3):last-child {
    grid-column: 1 / -1 !important;
    width: calc(50% - 6px) !important;
    justify-self: center !important;
  }
  .cards3 .opt.txt {
    height: 135px !important;
    min-height: 135px !important;
    max-height: 135px !important;
    padding: 12px 8px 40px !important;
    border-radius: 20px !important;
    border-bottom-width: 8px !important;
  }
  .cards3 .opt.txt .otext {
    font-size: clamp(15px, 4vw, 19px) !important;
    line-height: 1.2 !important;
    padding: 0 4px !important;
  }
  .cards3 .opt.txt .otext.long {
    font-size: clamp(12.5px, 3.2vw, 15px) !important;
    line-height: 1.2 !important;
  }
  .cards3 .radio {
    width: 26px !important;
    height: 26px !important;
    font-size: 13px !important;
    bottom: 8px !important;
  }
  .qimg {
    max-width: 95%;
    max-height: 24vh;
  }
}
@media(max-width:380px) {
  .cards3 {
    max-width: 320px !important;
    gap: 8px !important;
  }
  .cards3 .opt:nth-child(3):last-child {
    width: calc(50% - 4px) !important;
  }
  .cards3 .opt.txt {
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    padding: 10px 6px 36px !important;
    border-radius: 16px !important;
  }
  .cards3 .opt.txt .otext {
    font-size: 14.5px !important;
  }
  .cards3 .radio {
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
    bottom: 6px !important;
  }
}
/* pickset / match tiles edge to edge on phones */
@media(max-width:560px){
  .pgrid{width:100%;max-width:100%;gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
  .pick:not(:has(img)) .pt{font-size:16px;padding:8px 4px}
  .mwrap{gap:8px}
  .mcol{max-width:none}
  .mitem{padding:6px}
  .mitem span{font-size:13.5px}
}

/* 4) Wide screens: picture sits beside word-bank / match lists instead of pushing them down */
@media(min-width:700px){
  #gbody:has(.lines) .qimg{max-width:280px;max-height:36vh}
  #gbody:has(.mwrap) .qimg{max-width:280px;max-height:32vh}
}
@media(min-width:700px){
  .opt img{width:90%;height:66%}
  .mitem:has(img){min-height:112px;height:auto}
}
.mitem:has(img){height:auto;min-height:clamp(96px,14vh,124px);padding:8px 10px}
.mitem img{max-height:clamp(64px,10vw,90px)}
.pick:not(:has(img)){justify-content:center;min-height:74px}
/* launcher screens: decorative spheres never create a sideways scroll */
body.launcher{overflow-x:hidden}
/* phone match tiles with a picture: picture above the word, whole words never split */
@media(max-width:560px){
  .mitem:has(img){flex-direction:column;gap:3px;min-height:0;padding:6px 6px 8px}
  .mitem:has(img) img{max-height:58px;width:auto}
  .mitem span{overflow-wrap:normal;word-break:normal;hyphens:none;line-height:1.15}
}
/* closed language dropdown: keep its 0-width box from spilling off the right edge (was making launcher pages scroll sideways) */
.lang-dropdown-container:not(.open){overflow:hidden;visibility:hidden}

/* ===== Sequence (order) game with sentence cards: readable text, equal boxes ===== */
.ogrid:not(:has(img)){grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;max-width:900px;align-items:stretch}
.ogrid:not(:has(img)) .ocard{height:150px;min-height:150px;display:flex;align-items:center;justify-content:center;padding:14px 12px;box-sizing:border-box}
.ogrid:not(:has(img)) .ocard .ot{font-family:'Baloo 2',cursive;font-weight:800;font-size:clamp(14px,1.3vw,17px);line-height:1.3;color:#33415F;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
@media(min-width:900px){.ogrid:not(:has(img)){grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(min-width:561px) and (max-width:899px){.ogrid:not(:has(img)){grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.ogrid:not(:has(img)){grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ogrid:not(:has(img)) .ocard{height:130px;min-height:130px}.ogrid:not(:has(img)) .ocard .ot{font-size:14px}}

/* ===== Two-option questions: same box size as three-option ones, not giant ===== */
@media(min-width:700px){.cards3:has(.opt:nth-child(2):last-child){max-width:540px;margin-left:auto;margin-right:auto}}
@media(min-width:561px) and (max-width:699px){.cards3:has(.opt:nth-child(2):last-child){max-width:460px;margin-left:auto;margin-right:auto}}

/* ===== Sequence cards: same coloured tiles as the answer boxes ===== */
.ogrid:not(:has(img)) .ocard{--tile-bg:#F3FCF4;--tile-bg2:#E4F8EA;--tile-edge:#2FA85C;border:3px solid #fff;border-bottom:10px solid var(--tile-edge);border-radius:clamp(20px,2.4vw,26px);background:linear-gradient(170deg,#fff 0%,var(--tile-bg) 40%,var(--tile-bg2) 100%);box-shadow:0 14px 26px rgba(57,74,125,.14),inset 0 2px 6px rgba(255,255,255,.9)}
.ogrid:not(:has(img)) .ocard:nth-child(4n+2){--tile-bg:#FFF7E8;--tile-bg2:#FDEECF;--tile-edge:#F0932B}
.ogrid:not(:has(img)) .ocard:nth-child(4n+3){--tile-bg:#F7F0FE;--tile-bg2:#EFE2FC;--tile-edge:#8E4FD0}
.ogrid:not(:has(img)) .ocard:nth-child(4n+4){--tile-bg:#EDF5FF;--tile-bg2:#DEEBFC;--tile-edge:#3E8BF3}
.ogrid:not(:has(img)) .ocard.done{border-bottom-color:#21A55B;background:linear-gradient(145deg,#F4FFF7,#D9FBE5)}

/* ===== Math Number Ordering Tiles (Class 1) ===== */
.ogrid.num-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 16px clamp(12px, 2vw, 20px) !important;
  width: 100% !important;
  max-width: 680px !important;
  margin: 16px auto 24px !important;
}

.ogrid.num-grid .ocard.num-tile {
  flex: 0 0 calc(25% - 16px) !important;
  width: auto !important;
  min-width: 82px !important;
  max-width: 130px !important;
  height: 88px !important;
  min-height: 88px !important;
  max-height: 88px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 20px !important;
  border: 3.5px solid #fff !important;
  border-bottom: 8px solid var(--nt-edge, #3B82F6) !important;
  background: linear-gradient(160deg, #FFFFFF 0%, var(--nt-bg, #EFF6FF) 100%) !important;
  box-shadow: 0 10px 20px rgba(57, 74, 125, 0.13), inset 0 2px 4px #fff !important;
  cursor: pointer !important;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.ogrid.num-grid .ocard.num-tile .ot {
  font-family: 'Fredoka', 'Baloo 2', cursive, sans-serif !important;
  font-size: clamp(28px, 4vw, 38px) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -0.5px !important;
  display: block !important;
  text-align: center !important;
  color: var(--nt-text, #1E3A8A) !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

.ogrid.num-grid .ocard.num-tile:hover {
  transform: translateY(-4px) scale(1.04) !important;
  box-shadow: 0 14px 24px rgba(57, 74, 125, 0.2), inset 0 2px 4px #fff !important;
}

.ogrid.num-grid .ocard.num-tile:active {
  transform: translateY(2px) scale(0.96) !important;
  border-bottom-width: 4px !important;
}

/* 4 alternating playful vibrant themes */
.ogrid.num-grid .ocard.num-tile:nth-child(4n+1) {
  --nt-edge: #3B82F6;
  --nt-bg: #EFF6FF;
  --nt-text: #1D4ED8;
}
.ogrid.num-grid .ocard.num-tile:nth-child(4n+2) {
  --nt-edge: #10B981;
  --nt-bg: #ECFDF5;
  --nt-text: #047857;
}
.ogrid.num-grid .ocard.num-tile:nth-child(4n+3) {
  --nt-edge: #F59E0B;
  --nt-bg: #FFFBEB;
  --nt-text: #B45309;
}
.ogrid.num-grid .ocard.num-tile:nth-child(4n+4) {
  --nt-edge: #8B5CF6;
  --nt-bg: #F5F3FF;
  --nt-text: #6D28D9;
}

/* When tapped in correct sequence (done) */
.ogrid.num-grid .ocard.num-tile.done {
  --nt-edge: #10B981 !important;
  border-bottom-color: #10B981 !important;
  background: linear-gradient(160deg, #F0FDF4 0%, #DCFCE7 100%) !important;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.16) !important;
  transform: none !important;
  pointer-events: none !important;
  opacity: 0.96 !important;
}
.ogrid.num-grid .ocard.num-tile.done .ot {
  color: #15803D !important;
}

.ogrid.num-grid .ocard.num-tile .num {
  position: absolute !important;
  top: -7px !important;
  right: -7px !important;
  left: auto !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #10B981, #059669) !important;
  border: 2.5px solid #fff !important;
  color: #fff !important;
  font-family: 'Fredoka', 'Baloo 2', cursive !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.35) !important;
  z-index: 4 !important;
}

@media (max-width: 560px) {
  .ogrid.num-grid {
    gap: 10px 10px !important;
  }
  .ogrid.num-grid .ocard.num-tile {
    flex: 0 0 calc(25% - 8px) !important;
    min-width: 62px !important;
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    border-radius: 16px !important;
    border-bottom-width: 6px !important;
  }
  .ogrid.num-grid .ocard.num-tile .ot {
    font-size: 24px !important;
  }
}
@media (max-width: 380px) {
  .ogrid.num-grid .ocard.num-tile {
    flex: 0 0 calc(33.333% - 8px) !important;
    height: 66px !important;
    min-height: 66px !important;
  }
}


/* ===== Pick-all (pickset) cards: same fixed size as the sequence cards ===== */
.pgrid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;align-items:stretch}
.pgrid .pcard,.pgrid .pick{height:110px;min-height:110px;max-height:110px;display:flex;align-items:center;justify-content:center;text-align:center;box-sizing:border-box}
@media(min-width:900px){.pgrid{grid-template-columns:repeat(4,minmax(0,1fr));max-width:900px}}
@media(max-width:560px){.pgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pgrid .pcard,.pgrid .pick{height:96px;min-height:96px;max-height:96px}}

/* ===== Topbar: settings \u2699 + sound + score always stay at the right end of the first row (never jump/wrap) ===== */
.topbar .statpill,.topbar .header-btn,.topbar .iconbtn,.settings-wrapper-outer{flex:0 0 auto}
.settings-wrapper-outer{margin-left:auto}
.topbar .header-btn+.settings-wrapper-outer{margin-left:0}
.topbar #sndBtn{margin-left:auto}
@media(min-width:721px){
  .topbar{flex-wrap:nowrap}
  .topbar .gname{flex:1 1 auto;min-width:60px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar .dots{flex:0 1 auto;max-width:34%}
}
@media(max-width:720px){
  .topbar .lvl{flex:1 1 0;min-width:44px;max-width:46vw}
  .topbar .gname,.topbar .dots{order:5}
}
@media(max-width:360px){
  .topbar .lvl{max-width:36vw;padding:6px 8px 8px}
  .statpill{display:none}
}
@media(min-width:721px){
  .topbar .dots{flex:0 0 auto;max-width:none;flex-wrap:nowrap}
  .topbar .lvl{flex:0 1 auto;min-width:56px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* EVS-3: single chapter card sits centred under the badges (like English Explorer 1) */
.pcards:has(.pcard:only-child){grid-template-columns:minmax(0,460px);justify-content:center}

/* chapter card picture icon (screenshot pattern) */
.pcard .ic.icimg{background:#fff;border:2px solid rgba(255,255,255,.9);overflow:hidden;padding:0}
.pcard .ic.icimg img{width:100%;height:100%;object-fit:cover;border-radius:inherit}

/* match game: this engine uses two .mcol columns (not .mrow) \u2014 lay them side by side */
.mwrap:has(> .mcol){flex-direction:row;justify-content:center;gap:14px;align-items:stretch}
.mwrap:has(> .mcol) .mcol{flex:1 1 0;max-width:320px;min-width:0}
.mwrap:has(> .mcol) .mitem{height:auto;min-height:clamp(88px,13vh,112px)}
@media(max-width:560px){.mwrap:has(> .mcol){gap:8px}.mwrap:has(> .mcol) .mcol{max-width:none}.mwrap:has(> .mcol) .mitem img{max-height:56px}}
.mwrap:has(> .mcol) .mitem{height:clamp(96px,14vh,116px);min-height:0}
.mwrap:has(> .mcol) .mitem img{max-width:52%;max-height:80px;object-fit:contain}
.mwrap:has(> .mcol) .mitem span{white-space:normal;overflow-wrap:normal;word-break:normal;hyphens:none}
@media(max-width:560px){.mwrap:has(> .mcol) .mitem{height:auto;min-height:100px}.mwrap:has(> .mcol) .mitem img{max-width:100%}}


/* =========================================================================
   COMPREHENSIVE MOBILE & DESKTOP RESPONSIVENESS ENHANCEMENTS
   ========================================================================= */

@media (min-width: 768px) {
  .card-shell {
    max-width: 880px;
    margin: 8px auto;
    min-height: calc(100vh - 20px);
  }
  .topbar {
    min-height: 64px !important;
    padding: 8px 18px 10px !important;
  }
  .gbody {
    margin: 8px 20px 10px !important;
    padding: 10px 16px 14px !important;
    gap: 8px !important;
  }
  .qbig {
    font-size: clamp(24px, 3vw, 29px) !important;
    line-height: 1.2 !important;
    padding: 2px 10px !important;
    max-width: 900px !important;
    width: 100% !important;
    text-wrap: balance !important;
  }
  .qbig.long {
    font-size: clamp(21px, 2.4vw, 25.5px) !important;
    line-height: 1.24 !important;
  }
  .qbig.vlong {
    font-size: clamp(19px, 2.1vw, 23px) !important;
    line-height: 1.26 !important;
  }
  .qsub {
    margin: 1px auto 4px !important;
    padding: 4px 16px !important;
    font-size: 13px !important;
  }
  .qimg, #gbody .qimg {
    max-height: clamp(140px, 23vh, 180px) !important;
    width: auto;
    object-fit: contain;
    margin: 2px auto 6px !important;
  }
  .cards3 {
    max-width: 760px;
    gap: 16px;
    margin: 12px auto 16px;
  }
  .cards3:has(.opt:nth-child(2):last-child) {
    max-width: 520px;
  }
  .cards3 .opt.txt {
    min-height: 150px !important;
    height: auto !important;
    max-height: none !important;
    padding: 16px 12px 48px !important;
  }
  .bottombar {
    min-height: 60px !important;
    padding: 8px 20px 10px !important;
  }
}



@media (max-width: 560px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }
  
  #gameScr.on {
    padding: 4px 4px !important;
  }
  
  .card-shell {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 18px !important;
    border-width: 2px !important;
    min-height: calc(100dvh - 8px) !important;
  }
  
  .topbar {
    min-height: 50px !important;
    padding: 6px 8px 8px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    border-radius: 18px 18px 0 0 !important;
    border-bottom-width: 5px !important;
    justify-content: space-between !important;
  }
  
  .topbar .lvl {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 12px 6px !important;
    font-size: 11.5px !important;
    border-radius: 16px !important;
    border: 2px solid #fff !important;
    border-bottom: 4px solid var(--gk-purple-dark) !important;
    background: linear-gradient(180deg, #9254E8, #6C2CCB) !important;
    color: #fff !important;
    font-family: 'Fredoka', sans-serif !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  .topbar .dots {
    display: none !important;
  }
  
  .topbar .gname {
    display: none !important;
  }
  
  .topbar .statpill {
    padding: 3px 7px !important;
    font-size: 11.5px !important;
    min-width: auto !important;
    border-radius: 10px !important;
    border-bottom-width: 3px !important;
  }
  .topbar .statpill small {
    display: none !important;
  }
  
  .topbar .iconbtn, .topbar .header-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    font-size: 14px !important;
    border-bottom-width: 3px !important;
  }
  
  .lang-select-pill {
    padding: 3px 6px !important;
    font-size: 11px !important;
    height: 32px !important;
  }
  .lang-select-pill .flag-holder {
    width: 16px !important;
    height: 16px !important;
  }
  
  .gbody {
    margin: 4px 4px 8px !important;
    padding: 8px 6px 12px !important;
    border-radius: 16px !important;
    border-bottom-width: 5px !important;
    gap: 6px !important;
  }
  
  .qbig {
    font-size: clamp(18px, 4.6vw, 23px) !important;
    line-height: 1.22 !important;
    padding: 2px 6px !important;
    width: 100% !important;
    text-wrap: balance !important;
  }
  .qbig.long {
    font-size: clamp(16px, 3.8vw, 19.5px) !important;
    line-height: 1.24 !important;
  }
  .qbig.vlong {
    font-size: clamp(14.5px, 3.4vw, 17.5px) !important;
    line-height: 1.26 !important;
  }
  
  .qsub {
    font-size: 11.5px !important;
    padding: 3px 12px !important;
    margin: 1px auto 3px !important;
  }
  
  .qpill {
    font-size: 13px !important;
    line-height: 1.3 !important;
    padding: 6px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }
  
  .qimg, #gbody .qimg {
    max-height: clamp(88px, 17vh, 128px) !important;
    max-width: 96% !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 2px auto 4px !important;
    border-radius: 12px !important;
    border-width: 2px !important;
  }
  
  .cards3 {
    width: 100% !important;
    max-width: 440px !important;
    margin: 8px auto 12px !important;
    gap: 12px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .cards3:has(.opt:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 440px !important;
  }
  
  .cards3:has(.opt:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 440px !important;
  }
  
  .cards3 .opt:nth-child(3):last-child {
    grid-column: 1 / -1 !important;
    width: calc(50% - 6px) !important;
    justify-self: center !important;
  }
  
  .cards3 .opt {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    box-sizing: border-box !important;
  }
  
  .cards3 .opt.txt {
    min-height: 130px !important;
    height: auto !important;
    max-height: none !important;
    padding: 12px 8px 40px !important;
    border-radius: 18px !important;
    border-bottom-width: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .cards3 .opt.txt .otext {
    font-family: 'Baloo 2', cursive !important;
    font-size: clamp(15px, 4.2vw, 19px) !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    color: #33415F !important;
    padding: 0 4px !important;
    text-align: center !important;
  }
  .cards3 .opt.txt .otext.long {
    font-family: 'Fredoka', sans-serif !important;
    font-size: clamp(12.5px, 3.2vw, 15px) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
  }
  
  .cards3 .radio {
    width: 26px !important;
    height: 26px !important;
    font-size: 13px !important;
    bottom: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
  
  .mwrap {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    gap: 8px !important;
    margin-top: 4px !important;
  }
  .mcol {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }
  .mitem {
    min-height: 44px !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 6px !important;
    border-radius: 12px !important;
    border-bottom-width: 4px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    justify-content: center !important;
    text-align: center !important;
  }
  
  .ogrid.num-grid {
    gap: 8px !important;
    margin: 8px auto 14px !important;
  }
  .ogrid.num-grid .ocard.num-tile {
    flex: 0 0 calc(33.333% - 6px) !important;
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    border-radius: 14px !important;
    border-bottom-width: 5px !important;
  }
  .ogrid.num-grid .ocard.num-tile .ot {
    font-size: 24px !important;
  }
  
  .bottombar {
    padding: 6px 10px 10px !important;
    min-height: 52px !important;
    border-radius: 0 0 18px 18px !important;
  }
  .bbtn {
    padding: 7px 12px !important;
    font-size: 12.5px !important;
    border-radius: 12px !important;
    border-bottom-width: 4px !important;
  }
  .progpill {
    font-size: 11.5px !important;
    padding: 4px 10px !important;
  }
}