/* styles.css — BISINDO Fun Trainer (dominant white + bright + kid-friendly) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

:root{
  --bg1:#f7fbff;
  --bg2:#ffffff;
  --ink:#0b1220;
  --muted:#5b6b86;
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 18px 55px rgba(2, 8, 23, 0.10);
  --shadow2: 0 12px 28px rgba(2, 8, 23, 0.08);

  --blue:#3b82f6;
  --cyan:#22d3ee;
  --green:#34d399;
  --pink:#fb7185;
  --amber:#fbbf24;
  --purple:#a78bfa;

  --radius: 22px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg1);
  overflow-x: hidden;
}

/* Background */
.bg-sky{
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(900px 700px at 15% 10%, rgba(34,211,238,0.20), transparent 60%),
    radial-gradient(900px 700px at 85% 20%, rgba(52,211,153,0.16), transparent 60%),
    radial-gradient(900px 700px at 55% 95%, rgba(167,139,250,0.18), transparent 60%),
    linear-gradient(180deg, #f7fbff, #ffffff);
}
.bg-shapes{
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.shape{
  position: absolute;
  border-radius: 999px;
  opacity: 0.80;
  animation: floaty 10s ease-in-out infinite;
}
.shape.s1{ width: 240px; height: 240px; left: -60px; top: 12%; background: rgba(59,130,246,0.16); }
.shape.s2{ width: 180px; height: 180px; right: -40px; top: 8%; background: rgba(251,113,133,0.16); animation-delay: 1.5s; }
.shape.s3{ width: 220px; height: 220px; right: 10%; bottom: -70px; background: rgba(251,191,36,0.16); animation-delay: 2.5s; }
.shape.s4{ width: 160px; height: 160px; left: 18%; bottom: 10%; background: rgba(34,211,238,0.14); animation-delay: 3.5s; }
@keyframes floaty{
  0%,100%{ transform: translateY(0px) translateX(0px); }
  50%{ transform: translateY(-18px) translateX(10px); }
}

/* App layout */
.app{
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.shell{ width: min(1150px, 100%); }

/* Connection pill */
.conn-pill{
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow2);
}
.conn-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148,163,184,1);
  box-shadow: 0 0 0 6px rgba(148,163,184,0.18);
}
.conn-text{ font-size: 12px; color: var(--muted); }

/* Screens */
.screen{ display: none; }
.screen--active{ display: block; }
.hidden{ display: none !important; }
.muted{ color: var(--muted); }
.w-full{ width: 100%; }

/* Hero (landing) */
.hero-card{
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.hero-brand{
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
}
@media (max-width: 520px){
  .hero-brand{ grid-template-columns: 1fr; text-align: center; }
}
.hero-logo{
  width: 84px; height: 84px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(34,211,238,0.14));
  border: 1px solid rgba(59,130,246,0.16);
  box-shadow: var(--shadow2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero-logo__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-logo__fallback{
  display: none;
  width: 64px; height: 64px;
  border-radius: 20px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  place-items: center;
  font-weight: 800;
  font-size: 30px;
  color: #1f2937;
}
.hero-logo--fallback .hero-logo__fallback{ display: grid; }
.hero-logo--fallback .hero-logo__img{ display: none; }

.hero-title{
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hero-menu{
  margin-top: 18px;
  display: grid;
  gap: 10px;
  max-width: 520px;
}
@media (max-width: 520px){
  .hero-menu{ max-width: 100%; }
}

.small-note{
  margin-top: 14px;
  font-size: 12px;
  color: rgba(91,107,134,0.95);
}

/* How box */
.how-box{
  margin-top: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(59,130,246,0.25);
  background: rgba(59,130,246,0.06);
}
.how-list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Topbar */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.topbar-title{
  font-weight: 800;
  font-size: 16px;
  color: #0b1220;
}
.topbar-right{
  min-width: 90px;
  display: flex;
  justify-content: flex-end;
}

/* Cards grid */
.grid-cards{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.card{
  grid-column: span 6;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 16px;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease;
}
.card:hover{ transform: translateY(-2px); filter: brightness(1.02); }
.card:active{ transform: translateY(0px) scale(0.99); }
@media (max-width: 900px){
  .card{ grid-column: span 12; }
}
.card-title{
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-desc{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.card-badge{
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.92);
  font-size: 12px;
}

/* Buttons */
.btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.10);
  padding: 12px 14px;
  background: rgba(255,255,255,0.92);
  color: #0b1220;
  box-shadow: var(--shadow2);
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, filter .15s ease;
  font-weight: 800;
}
.btn:active{ transform: scale(0.98); }
.btn-big{ padding: 16px 16px; font-size: 16px; border-radius: 20px; }
.btn-primary{
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
  color: #ffffff;
  border-color: rgba(59,130,246,0.18);
}
.btn-secondary{
  background: linear-gradient(90deg, rgba(255,255,255,0.92), rgba(255,255,255,0.92));
  border-color: rgba(15,23,42,0.12);
}
.btn-ghost{
  background: rgba(255,255,255,0.65);
  color: #0b1220;
}
.btn-link{
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 6px 10px;
  color: var(--blue);
  font-weight: 800;
}
.btn-link:hover{ text-decoration: underline; }
.btn-sm{ padding: 9px 12px; border-radius: 14px; font-size: 13px; }

.btn-spark{
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(150px 60px at 30% 20%, rgba(255,255,255,0.35), transparent 70%);
  opacity: 0.9;
}

/* Panels */
.panel{
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.panel-title{
  font-weight: 800;
  font-size: 14px;
  color: #0b1220;
  margin-bottom: 10px;
}

/* Game layout */
.game-layout{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}
@media (max-width: 980px){
  .game-layout{ grid-template-columns: 1fr; }
}

/* Video */
.video-frame{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(15,23,42,0.10);
}
.video-layer{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tag-live{
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--shadow2);
}

/* Countdown overlay (di kamera) */
.countdown-wrap{
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  z-index: 10;
}
.countdown-bubble{
  min-width: 120px;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop 0.35s ease;
}
.countdown-label{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(91,107,134,0.95);
}
.countdown-text{
  margin-top: 2px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
  color: #0b1220;
}
@keyframes pop{
  from{ transform: scale(0.95); opacity: 0.75; }
  to{ transform: scale(1); opacity: 1; }
}

/* Loading overlay */
.loading-overlay{
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.loading-text{ margin: 0; font-weight: 900; color: #0b1220; }
.loading-hint{ margin: 0; font-size: 12px; color: var(--muted); }

/* Spinner */
.loader{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 4px solid rgba(59,130,246,0.18);
  border-top: 4px solid rgba(59,130,246,0.95);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { 0%{ transform: rotate(0deg);} 100%{ transform: rotate(360deg);} }

/* Progress */
.progress-wrap{ margin-top: 12px; }
.progress-meta{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}
.progress-shell{
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15,23,42,0.06);
  border: 1px solid rgba(15,23,42,0.08);
}
.progress-bar{
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
  transition: width 120ms linear;
}

/* Challenge */
.challenge-card{
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.94);
  padding: 14px;
}
.challenge-top{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.challenge-label{
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}
.challenge-round{
  font-size: 12px;
  color: var(--muted);
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.14);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.target-word{
  margin-top: 12px;
  font-size: 40px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0b1220;
  background: linear-gradient(90deg, rgba(59,130,246,0.12), rgba(34,211,238,0.10), rgba(52,211,153,0.10));
  border: 1px solid rgba(59,130,246,0.14);
  border-radius: 18px;
  padding: 14px 12px;
  text-align: center;
}
@media (max-width: 420px){
  .target-word{ font-size: 32px; }
}

.timer-row{
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.streak-chip{
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow2);
  color: var(--muted);
}

.cta-row{ margin-top: 12px; }

.feedback-box{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(15,23,42,0.12);
}
.feedback-title{
  font-weight: 900;
  font-size: 13px;
  color: #0b1220;
  margin-bottom: 8px;
}
.result-mini{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(247,251,255,0.94);
  padding: 10px 12px;
}
.result-mini__pred{
  font-weight: 900;
  font-size: 22px;
  color: #0b1220;
}
.result-mini__meta{
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* Verify badge */
.verify-badge{
  margin-top: 10px;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,0.10);
  font-weight: 900;
  font-size: 13px;
  text-align: center;
}
.verify-badge--idle{
  background: rgba(148,163,184,0.10);
  color: #475569;
}
.verify-badge--good{
  background: rgba(52,211,153,0.18);
  border-color: rgba(52,211,153,0.26);
  color: #065f46;
}
.verify-badge--bad{
  background: rgba(251,113,133,0.18);
  border-color: rgba(251,113,133,0.26);
  color: #9f1239;
}

/* Score */
.score-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--shadow2);
  font-size: 13px;
  font-weight: 900;
}

/* Hints */
.panel-hint{
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.72);
}
.hint-title{ font-weight: 900; font-size: 13px; margin-bottom: 6px; }
.hint-list{
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
}

/* Materi */
.materi-layout{
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
}
@media (max-width: 980px){
  .materi-layout{ grid-template-columns: 1fr; }
}
.materi-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
.materi-item{
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow2);
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease;
}
.materi-item:hover{ transform: translateY(-2px); filter: brightness(1.02); }
.materi-item:active{ transform: scale(0.99); }
.materi-item__title{
  font-weight: 900;
  font-size: 14px;
}
.materi-item__desc{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.materi-player{
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,0.10);
  background: #0b1220;
}
.materi-video{
  width: 100%;
  display: block;
}
.materi-meta{
  margin-top: 10px;
}
.materi-meta__title{
  font-weight: 900;
  font-size: 14px;
}
.materi-meta__desc{
  margin-top: 4px;
  font-size: 12px;
}
.materi-cta{ margin-top: 12px; }

/* Utilities required by existing script.js */
.mirrored { transform: scaleX(-1); }
.accelerated { will-change: transform; transform: translateZ(0); }

/* Celebration */
.celebrate{
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.confetti{
  position: absolute;
  left: 50%;
  top: -20px;
  width: 12px;
  height: 18px;
  border-radius: 4px;
  background: var(--amber);
  animation: confetti 1.1s ease-in forwards;
  opacity: 0.9;
}
.confetti:nth-child(2){ background: var(--pink); animation-delay: 0.05s; left: 38%; }
.confetti:nth-child(3){ background: var(--cyan); animation-delay: 0.08s; left: 62%; }
.confetti:nth-child(4){ background: var(--green); animation-delay: 0.12s; left: 48%; }
@keyframes confetti{
  0%{ transform: translateY(0) rotate(0deg); }
  100%{ transform: translateY(120vh) rotate(420deg); }
}

/* ===== PATCH LANDING DESKTOP CENTER ===== */

/* Landing: selalu center, tidak "grid kiri-kanan" di desktop */
.hero-brand{
  grid-template-columns: 1fr !important;
  text-align: center !important;
  justify-items: center !important;
}

.hero-head{
  text-align: center !important;
}

/* Supaya tombol tidak terlihat "nempel kiri" pada layar besar */
.hero-menu{
  margin-left: auto !important;
  margin-right: auto !important;
  justify-items: center !important;
}

/* Optional: buat kartu landing lebih "hero" di desktop */
.hero-card{
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* Optional: rapikan spacing di desktop */
@media (min-width: 900px){
  .hero-title{ font-size: 40px; }
  .hero-subtitle{ font-size: 15px; }
}

.hero-badges{
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.badge{
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--shadow2);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.btn-bouncy{
  animation: bouncy 2.2s ease-in-out infinite;
}
@keyframes bouncy{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-3px); }
}
