/* ══════════════════════════════════════════════════════════
   hub.css — Hub page styles only
   ══════════════════════════════════════════════════════════ */

/* ── Root layout ── */
html, body {
  overflow: hidden;
}

/* ── Stars background ── */
#stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star {
  position: absolute;
  border-radius: 50%;
  animation: twinkle 2.2s infinite alternate;
}
@keyframes twinkle { from { opacity: 0.04; } to { opacity: 0.78; } }

/* ══════════════════════════════════════════════════════════
   AUTH OVERLAY
   ══════════════════════════════════════════════════════════ */
#auth-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  background: linear-gradient(160deg, #0a0a1a, #12122a);
}
#auth-overlay.hidden { display: none; }

.auth-logo-wrap { text-align: center; margin-bottom: clamp(16px, 4vh, 28px); }
.auth-logo {
  font-size: clamp(3rem, 12vw, 4.5rem);
  display: block;
  animation: gs-logo-pop 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.auth-brand {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.2rem, 9vw, 3rem);
  color: #fff;
  margin-top: 4px;
  line-height: 1;
}
.auth-tagline {
  font-size: clamp(0.7rem, 2.8vw, 0.85rem);
  font-weight: 800;
  color: rgba(255,255,255,0.3);
  margin-top: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-box {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  animation: gs-fade-up 0.5s 0.3s both;
}

.auth-btn {
  width: 100%;
  padding: clamp(13px, 3.5vw, 16px);
  border-radius: 14px;
  border: none;
  font-size: clamp(0.9rem, 3.5vw, 1rem);
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s, opacity 0.12s;
  font-family: 'Nunito', sans-serif;
}
.auth-btn:active { transform: scale(0.97); }

.btn-guest {
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: #fff;
  box-shadow: 0 6px 0 rgba(72,52,212,0.5);
  order: -1;
  font-size: clamp(0.95rem, 3.8vw, 1.05rem);
}
.btn-guest:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(72,52,212,0.5); }
.btn-google  { background: #fff; color: #333; }
.btn-phone   { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }

.auth-divider {
  text-align: center;
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
  font-weight: 700;
  margin: 2px 0;
  letter-spacing: 0.5px;
}

/* Phone/OTP steps */
.auth-step { display: none; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.auth-step.active { display: flex; }
.auth-input {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  background: rgba(255,255,255,0.92);
}
.auth-back {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  font-family: 'Nunito', sans-serif;
}
.auth-err {
  font-size: 0.78rem;
  color: #ff6b6b;
  text-align: center;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}
.auth-hint { font-size: 0.72rem; color: rgba(255,255,255,0.25); text-align: center; }

/* ══════════════════════════════════════════════════════════
   KID SELECTOR
   ══════════════════════════════════════════════════════════ */
#screen-kid {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: linear-gradient(160deg, #0a0a1a, #12122a);
  overflow-y: auto;
}
#screen-kid.show { display: flex; }

.kid-sel-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
  animation: gs-logo-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.kid-sel-sub {
  font-size: clamp(0.72rem, 2.8vw, 0.82rem);
  font-weight: 800;
  color: rgba(255,255,255,0.35);
  margin-bottom: clamp(18px, 4vh, 28px);
  text-align: center;
}

.kid-av-big {
  font-size: 5rem;
  line-height: 1;
  text-align: center;
  margin-bottom: 12px;
  animation: gs-owl-bob 2s ease-in-out infinite;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.3));
  cursor: pointer;
}
.av-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 320px;
  margin-bottom: 16px;
}
.av-opt {
  font-size: 1.8rem;
  padding: 6px;
  border-radius: 12px;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: border-color 0.12s, transform 0.12s;
  background: rgba(255,255,255,0.05);
}
.av-opt:active { transform: scale(0.9); }
.av-opt.selected { border-color: var(--gs-primary); background: rgba(108,92,231,0.15); }

.kid-name-input {
  width: 100%;
  max-width: 300px;
  padding: 14px 18px;
  border-radius: 16px;
  border: none;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  background: rgba(255,255,255,0.92);
  color: #222;
  text-align: center;
  margin-bottom: 16px;
  outline: none;
}
.kid-name-input::placeholder { color: #bbb; }

.kid-start-btn {
  width: 100%;
  max-width: 300px;
  padding: 15px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--gs-primary), #a29bfe);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--gs-primary-dk);
  font-family: 'Nunito', sans-serif;
  transition: transform 0.12s, box-shadow 0.12s;
}
.kid-start-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--gs-primary-dk); }
.kid-err {
  font-size: 0.78rem;
  color: #ff6b6b;
  text-align: center;
  min-height: 16px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.3s;
}

.kids-pick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 360px;
  margin-bottom: 20px;
}
.kid-pick-card {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  padding: 16px 18px;
  cursor: pointer;
  text-align: center;
  transition: all 0.14s;
  min-width: 100px;
}
.kid-pick-card:active { transform: scale(0.94); background: rgba(255,255,255,0.16); }
.kid-pick-card.add-new { border-style: dashed; }
.kpc-av  { font-size: 2.6rem; margin-bottom: 5px; }
.kpc-name { font-size: 0.82rem; font-weight: 800; color: #fff; }

/* ══════════════════════════════════════════════════════════
   HUB APP
   ══════════════════════════════════════════════════════════ */
#app {
  display: none;
  position: relative;
  z-index: 1;
  height: 100%;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}
#app.show { display: flex; }

/* ── Hub Header ── */
.hub-header {
  flex-shrink: 0;
  text-align: center;
  padding: clamp(10px, 3vh, 20px) 16px clamp(4px, 1vh, 8px);
}
.hub-logo {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  display: block;
  animation: gs-logo-pop 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.hub-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.5rem, 6.5vw, 2.2rem);
  color: var(--gs-text);
  line-height: 1;
  margin-top: 2px;
}
.hub-sub {
  font-size: clamp(0.6rem, 2.2vw, 0.72rem);
  font-weight: 800;
  color: var(--gs-text-soft);
  margin-top: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Cards scroll area ── */
.cards-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 14px);
  padding: 4px clamp(12px, 4vw, 18px) clamp(12px, 2vh, 20px);
}
.cards-wrap::-webkit-scrollbar { display: none; }

/* ── Game Cards ── */
.game-card {
  flex-shrink: 0;
  height: clamp(190px, 36vw, 240px);
  border-radius: clamp(20px, 5vw, 26px);
  padding: clamp(14px, 3.5vw, 22px);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.15s;
}
.game-card:active { transform: scale(0.96); }

.card-gaanit {
  background: linear-gradient(145deg, #007d78 0%, #00CEC9 55%, #55efc4 100%);
  box-shadow: 0 14px 36px rgba(0,206,201,0.4), 0 0 0 1px rgba(255,255,255,0.07);
  animation: gs-slide-up 0.6s 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.card-brain {
  background: linear-gradient(145deg, #3d1e8a 0%, #6C5CE7 60%, #a29bfe 100%);
  box-shadow: 0 14px 36px rgba(108,92,231,0.45), 0 0 0 1px rgba(255,255,255,0.07);
  animation: gs-slide-up 0.6s 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.card-trace {
  background: linear-gradient(145deg, #9a3a20 0%, #E17055 55%, #fab1a0 100%);
  box-shadow: 0 14px 36px rgba(225,112,85,0.4), 0 0 0 1px rgba(255,255,255,0.07);
  animation: gs-slide-up 0.6s 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.card-word {
  background: linear-gradient(145deg, #0c4f8a 0%, #0984E3 55%, #74b9ff 100%);
  box-shadow: 0 14px 36px rgba(9,132,227,0.4), 0 0 0 1px rgba(255,255,255,0.07);
  animation: gs-slide-up 0.6s 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.card-deco {
  position: absolute;
  right: -4px;
  top: -4px;
  font-size: clamp(4rem, 14vw, 6rem);
  opacity: 0.14;
  line-height: 1;
  pointer-events: none;
  animation: hub-deco-float 4s ease-in-out infinite;
}
.card-brain  .card-deco { animation-delay: 2s; }
.card-trace  .card-deco { animation-delay: 1s; }
.card-word   .card-deco { animation-delay: 1.5s; }
@keyframes hub-deco-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-8px) rotate(5deg); }
}

.card-top    { flex: 1; min-height: 0; overflow: hidden; }
.card-bottom { flex-shrink: 0; }

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.22);
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 50px;
  padding: 3px 11px;
  font-size: clamp(0.6rem, 2.2vw, 0.68rem);
  font-weight: 900;
  color: rgba(255,255,255,0.88);
  margin-bottom: clamp(5px, 1.2vh, 9px);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.card-name {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.5rem, 6.5vw, 2.2rem);
  color: #fff;
  line-height: 1;
  margin-bottom: clamp(3px, 0.8vh, 6px);
}
.card-desc {
  font-size: clamp(0.7rem, 2.5vw, 0.82rem);
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-stats {
  display: flex;
  gap: clamp(4px, 1.5vw, 8px);
  margin: clamp(6px, 1.5vw, 10px) 0;
}
.cst {
  background: rgba(0,0,0,0.22);
  border-radius: 10px;
  padding: clamp(5px, 1.2vw, 8px) clamp(6px, 1.8vw, 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex: 1;
}
.cst-v {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(0.9rem, 3.5vw, 1.15rem);
  color: #fff;
  line-height: 1;
}
.cst-l {
  font-size: clamp(0.48rem, 1.6vw, 0.56rem);
  font-weight: 900;
  color: rgba(255,255,255,0.48);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 50px;
  padding: clamp(7px, 2vw, 10px) clamp(14px, 4vw, 20px);
  font-size: clamp(0.78rem, 2.8vw, 0.9rem);
  font-weight: 900;
  color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.22);
  transition: box-shadow 0.1s, transform 0.1s;
}
.game-card:active .card-cta { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.22); }

/* ── Hub Footer ── */
.hub-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 4vw, 24px);
  padding: clamp(8px, 2vh, 12px) 16px;
  animation: gs-fade-up 0.5s 0.4s both;
}
.tot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.tot-v {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1rem, 4.5vw, 1.35rem);
  color: var(--gs-text);
}
.tot-l {
  font-size: clamp(0.54rem, 2vw, 0.62rem);
  font-weight: 800;
  color: var(--gs-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.hub-divider {
  width: 1px;
  height: 24px;
  background: var(--gs-border);
}
.hub-ver {
  position: fixed;
  bottom: 6px;
  right: 10px;
  font-size: 0.5rem;
  color: var(--gs-text-soft);
  font-weight: 700;
  opacity: 0.4;
}

#recaptcha-container { position: absolute; bottom: 0; }
