/* ============================================================
   SIBIGO — UI v5 (Full-viewport, desktop-first, responsive)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ---- TOKENS (Calibrated Kid-Friendly Palette) ---- */
:root {
  --teal:    #19b4c8;
  --teal2:   #0d9db6;
  --teal-l:  #e4f8fb;
  --green:   #4ade80;
  --green2:  #22c55e;
  --blue-bg: #c8eef6;
  --sky:     #ddf3fb;
  --white:   #ffffff;
  --ink:     #1e3a4a;
  --muted:   #64899a;
  
  /* Feedback colors */
  --warn-bg: #fff3cd;
  --warn:    #b45309;
  --good-bg: #d1fae5;
  --good:    #065f46;
  
  /* Fun Pastels for blobs */
  --pastel-pink:   rgba(251, 113, 133, 0.4);
  --pastel-yellow: rgba(250, 204, 21, 0.45);
  --pastel-blue:   rgba(100, 200, 240, 0.55);
  --pastel-green:  rgba(134, 239, 172, 0.5);
  
  --radius: 20px;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --hdr-h:  68px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Critical: html & body must be exactly 100vh, no overflow */
html {
  height: 100%;
  overflow: hidden;
}
body {
  height: 100%;
  overflow: hidden;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #c5ecf7 0%, #e0f7ff 45%, #d6f5e8 100%);
  background-attachment: fixed;
}

/* ---- SCREEN SYSTEM ---- */
/* .app is the root flex container — fills entire viewport */
.app {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* .shell wraps the screens, must fill .app height */
.shell {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* Every screen is hidden by default */
.screen {
  display: none;
  width: 100%; height: 100%;
  overflow-y: auto; /* Allow screen-level scroll as safety */
}
/* Only the active screen is shown and fills 100% */
.screen--active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden; /* Inner content will handle its own scrolling */
}

/* ---- CONNECTION PILL ---- */
.conn-pill {
  position: fixed; bottom: 14px; right: 14px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.92); border: 1px solid rgba(0,0,0,0.10);
  border-radius: 999px; padding: 7px 14px;
  font-size: 12px; color: var(--muted);
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  pointer-events: none;
}
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.conn-dot.ok  { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
.conn-dot.err { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.25); }

/* ---- CELEBRATE ---- */
.celebrate { 
  position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; 
  background: rgba(255,255,255,0);
  opacity: 0; visibility: hidden;
  transition: all 0.5s ease;
  display: flex; align-items: center; justify-content: center;
}
.celebrate.is-visible {
  opacity: 1; visibility: visible;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
}
.confetti {
  position: absolute; width: clamp(8px, 1vw, 16px); height: clamp(8px, 1vw, 16px); 
  border-radius: 3px; opacity: 0; pointer-events: none;
}
.celebrate.is-visible .confetti {
  animation: confetti-fall 4s linear forwards;
}
.celebrate.is-visible .confetti:nth-child(even) {
  animation-duration: 5s;
}
.celebrate.is-visible .confetti:nth-child(3n) {
  animation-duration: 3.5s;
}
.confetti:nth-child(5n+1) { background: #f59e0b; }
.confetti:nth-child(5n+2) { background: #ec4899; }
.confetti:nth-child(5n+3) { background: #3b82f6; }
.confetti:nth-child(5n+4) { background: #10b981; }
.confetti:nth-child(5n+5) { background: #8b5cf6; }

.confetti:nth-child(1) { left: 5%; animation-delay: 0.1s; }
.confetti:nth-child(2) { left: 10%; animation-delay: 0.3s; }
.confetti:nth-child(3) { left: 15%; animation-delay: 0.05s; }
.confetti:nth-child(4) { left: 20%; animation-delay: 0.4s; }
.confetti:nth-child(5) { left: 25%; animation-delay: 0.2s; }
.confetti:nth-child(6) { left: 30%; animation-delay: 0.15s; }
.confetti:nth-child(7) { left: 35%; animation-delay: 0.35s; }
.confetti:nth-child(8) { left: 40%; animation-delay: 0.1s; }
.confetti:nth-child(9) { left: 45%; animation-delay: 0.25s; }
.confetti:nth-child(10) { left: 50%; animation-delay: 0.05s; }
.confetti:nth-child(11) { left: 55%; animation-delay: 0.45s; }
.confetti:nth-child(12) { left: 60%; animation-delay: 0.1s; }
.confetti:nth-child(13) { left: 65%; animation-delay: 0.3s; }
.confetti:nth-child(14) { left: 70%; animation-delay: 0.2s; }
.confetti:nth-child(15) { left: 75%; animation-delay: 0.15s; }
.confetti:nth-child(16) { left: 80%; animation-delay: 0.4s; }
.confetti:nth-child(17) { left: 85%; animation-delay: 0.05s; }
.confetti:nth-child(18) { left: 90%; animation-delay: 0.35s; }
.confetti:nth-child(19) { left: 95%; animation-delay: 0.1s; }
.confetti:nth-child(20) { left: 98%; animation-delay: 0.25s; }
@keyframes confetti-fall { 
  0% { transform: translateY(-100px) translateX(0) rotate(0deg); opacity:1; } 
  25% { transform: translateY(25vh) translateX(15px) rotate(180deg); }
  50% { transform: translateY(50vh) translateX(-15px) rotate(360deg); }
  75% { transform: translateY(75vh) translateX(15px) rotate(540deg); }
  100% { transform: translateY(110vh) translateX(0) rotate(720deg); opacity:0; } 
}

/* ============================================================
   SHARED INNER-PAGE SCENE
   Each scene = full-height flex column: header (fixed) + content (flex:1 overflow-y:auto)
   ============================================================ */
.landing-scene,
.learn-list-scene,
.learn-detail-scene,
.main-select-scene,
.tutorial-list-scene,
.tutorial-play-scene,
.real-game-scene {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;        /* fills the .screen--active which is 100vh */
  overflow: hidden;    /* prevent scene itself from scrolling */
  position: relative;
}

/* ---- DECORATIVE BLOBS (shared pattern) ---- */
.landing-bg-deco,
.learn-bg-deco, .learn-detail-bg-deco,
.main-select-bg-deco, .tutorial-bg-deco,
.tutorial-play-bg-deco, .real-game-bg-deco {
  position: absolute; border-radius: 50%;
  pointer-events: none; z-index: 0;
}
/* Blue blob: top-left */
.landing-bg-deco--blue,
.learn-bg-deco--blue, .learn-detail-bg-deco--blue,
.main-select-bg-deco--blue, .tutorial-bg-deco--blue,
.tutorial-play-bg-deco--blue, .real-game-bg-deco--blue {
  background: var(--pastel-blue);
  width: clamp(140px,18vw,600px); height: clamp(140px,18vw,600px);
  left: -5vw; top: 4vh;
}
/* Yellow/Green blob: top-right */
.landing-bg-deco--yellow,
.learn-bg-deco--yellow, .learn-detail-bg-deco--yellow,
.main-select-bg-deco--yellow, .tutorial-bg-deco--yellow,
.tutorial-play-bg-deco--yellow, .real-game-bg-deco--yellow {
  background: var(--pastel-green);
  width: clamp(120px,15vw,500px); height: clamp(120px,15vw,500px);
  right: -4vw; top: 4vh;
}
/* Green blob: bottom-right */
.landing-bg-deco--green,
.learn-bg-deco--green, .learn-detail-bg-deco--green,
.main-select-bg-deco--green, .tutorial-bg-deco--green,
.tutorial-play-bg-deco--green, .real-game-bg-deco--green {
  background: var(--pastel-yellow);
  width: clamp(120px,14vw,450px); height: clamp(120px,14vw,450px);
  right: 6vw; bottom: -3vh;
}
/* Pink blob: bottom-left (landing only) */
.landing-bg-deco--pink {
  background: var(--pastel-pink);
  width: clamp(120px,14vw,450px); height: clamp(120px,14vw,450px);
  left: -2vw; bottom: -3vh;
}

/* Stars */
.landing-star,
.learn-star, .learn-detail-star,
.main-select-star, .tutorial-star,
.tutorial-play-star, .real-game-star {
  position: absolute; z-index: 1;
  font-size: clamp(18px,2vw,28px); color: var(--teal); opacity: 0.55;
  animation: star-pulse 3s ease-in-out infinite;
}
.landing-star--right, .learn-star--right, .learn-detail-star--right,
.main-select-star--right, .tutorial-star--right,
.tutorial-play-star--right, .real-game-star--right {
  right: clamp(20px,3vw,48px); top: clamp(60px,9vh,100px);
}
.landing-star--left { left: clamp(20px,3vw,48px); bottom: 38%; }
@keyframes star-pulse { 0%,100%{ transform:scale(1) rotate(0deg); opacity:.55; } 50%{ transform:scale(1.2) rotate(15deg); opacity:.85; } }

/* ============================================================
   SHARED PAGE HEADER  (Kembali | LOGO | separator line)
   Fixed height so content below can flex to fill rest
   ============================================================ */
.learn-header, .learn-detail-header,
.main-select-header, .tutorial-header,
.tutorial-play-header, .real-game-header {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(14px, 2.5vh, 28px) clamp(16px, 3vw, 48px) 0;
  position: relative; z-index: 10;
}

.learn-logo, .learn-detail-logo,
.main-select-logo, .tutorial-logo,
.tutorial-play-logo, .real-game-logo {
  height: clamp(80px, 11vh, 180px); width: auto; object-fit: contain;
  display: block; transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.app-logo-clickable { cursor: pointer; }
.app-logo-clickable:hover { transform: scale(1.08) rotate(-2deg); filter: brightness(1.1); }

/* Separator line below header */
.learn-header-line, .learn-detail-header-line,
.main-select-line, .tutorial-header-line,
.tutorial-play-header-line, .real-game-header-line {
  flex-shrink: 0;
  width: 100%; height: clamp(2px, 0.2vh, 4px);
  margin: clamp(8px, 1.2vh, 32px) clamp(16px, 3vw, 96px) 0;
  background: linear-gradient(90deg, var(--teal), rgba(25,180,200,0.08));
  position: relative; z-index: 10;
}

/* Back buttons: Absolute positioned to the left of the header container */
.learn-back-btn, .learn-detail-back-btn,
.main-back-btn, .tutorial-back-btn,
.tutorial-play-back-btn, .real-game-back-btn {
  position: absolute; left: clamp(16px, 3vw, 48px);
  flex-shrink: 0;
  padding: clamp(8px, 1.2vh, 14px) clamp(16px, 2vw, 32px);
  border: 2.5px solid var(--teal); border-radius: 14px;
  background: var(--white); color: var(--teal);
  font-family: inherit; font-size: clamp(14px, 1.2vw, 16px); font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap; z-index: 20;
}
.learn-back-btn:hover, .learn-detail-back-btn:hover,
.main-back-btn:hover, .tutorial-back-btn:hover,
.tutorial-play-back-btn:hover, .real-game-back-btn:hover {
  background: var(--teal); color: var(--white); transform: translateY(-1px);
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-scene {
  justify-content: center;
  align-items: center;
}

.landing-content {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(40px, 6vw, 120px);
  width: 100%; max-width: 2000px;
  flex: 1; padding: clamp(32px, 5vh, 120px) clamp(24px, 5vw, 160px);
  position: relative; z-index: 2;
  overflow-y: auto;
}
.landing-left { flex: 1.2; min-width: 0; max-width: 900px; }
.landing-logo-wrap { margin-bottom: clamp(20px, 4vh, 48px); display: flex; justify-content: flex-start; }
.landing-logo-img  { height: clamp(100px, 15vh, 220px); width: auto; object-fit: contain; }

.landing-title {
  font-size: clamp(32px, 4vw, 84px); font-weight: 800; line-height: 1.15;
  color: var(--ink); margin-bottom: clamp(12px, 2vh, 32px);
}
.landing-subtitle {
  font-size: clamp(14px, 1.1vw, 24px); color: var(--muted);
  margin-bottom: clamp(24px, 4vh, 56px); max-width: 720px;
}
.landing-actions { display: flex; gap: clamp(12px, 1.5vw, 48px); flex-wrap: wrap; margin-bottom: 12px; }
.landing-btn {
  flex: 1; min-width: 160px;
  padding: clamp(16px, 2.2vh, 32px) clamp(28px, 2.5vw, 64px);
  border-radius: clamp(14px, 1.2vh, 24px); font-family: inherit;
  font-size: clamp(16px, 1.4vw, 28px); font-weight: 800; cursor: pointer; transition: all .25s;
}
.landing-btn--primary {
  background: var(--teal); color: var(--white); border: none;
  box-shadow: 0 6px 20px rgba(25,180,200,0.4);
}
.landing-btn--primary:hover { background: var(--teal2); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(25,180,200,0.5); }
.landing-btn--secondary {
  background: var(--white); color: var(--teal);
  border: 2.5px solid var(--teal);
}
.landing-btn--secondary:hover { background: var(--teal-l); transform: translateY(-3px); }

.how-box { background: var(--white); border-radius: 16px; padding: 18px 22px; box-shadow: var(--card-shadow); }
.landing-how-box { margin-top: 0; }
.how-list { padding-left: 18px; display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: var(--muted); }

.landing-right { flex-shrink: 0; }
.landing-blob {
  width: clamp(240px, 32vw, 550px); height: clamp(240px, 32vw, 550px);
  border-radius: 50%;
  background: linear-gradient(135deg,rgba(100,200,240,.5),rgba(134,239,172,.4));
  display: flex; align-items: center; justify-content: center;
}
.landing-image-card {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.landing-child-img {
  width: 115%; height: 115%;
  object-fit: contain;
  filter: drop-shadow(0 15px 35px rgba(0,0,0,0.12));
  animation: float-child 5s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.landing-child-img:hover {
  transform: scale(1.08) rotate(1deg);
}
@keyframes float-child {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
.landing-image-card--empty { background: rgba(255,255,255,0.4); border-radius: 50%; }
.landing-info-btn {
  position: absolute; bottom: clamp(16px, 2.5vh, 40px); left: clamp(16px, 2.5vw, 40px);
  width: clamp(34px, 3.2vw, 50px); height: clamp(34px, 3.2vw, 50px);
  border-radius: 50%; background: var(--white); border: 2.2px solid var(--teal);
  color: var(--teal); font-size: clamp(16px, 1.4vw, 22px); font-weight: 800;
  cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(25,180,200,0.15);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.landing-info-btn:hover {
  transform: scale(1.1) rotate(15deg);
  background: var(--teal); color: var(--white);
  box-shadow: 0 8px 25px rgba(25,180,200,0.3);
}

/* ============================================================
   BELAJAR LIST  (screenLearnList)
   ============================================================ */
.learn-list-content {
  flex: 1;                     /* fills remaining height */
  display: flex; flex-direction: column;
  overflow: hidden;            /* child will scroll */
  padding: clamp(12px,2vh,24px) clamp(16px,3vw,52px) clamp(16px,2vh,28px);
  position: relative; z-index: 2;
}
.learn-page-title {
  flex-shrink:0; font-size: clamp(28px, 3.5vw, 112px); font-weight: 800;
  color: var(--teal); text-align: center;
  margin-bottom: clamp(16px, 2vh, 48px);
  text-transform: uppercase; letter-spacing: 2px;
  position: relative; width: fit-content; margin-left: auto; margin-right: auto;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
}
.learn-page-title::after {
  content: ""; position: absolute; bottom: -8px; left: 10%; right: 10%;
  height: clamp(4px, 0.6vh, 12px); background: var(--teal);
  border-radius: 99px; opacity: 0.2;
  transition: all 0.5s ease;
}
.learn-page-title:hover {
  background: linear-gradient(135deg, var(--teal), #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: titleBounce 0.6s infinite alternate ease-in-out, 
             letterSpread 1.5s infinite alternate ease-in-out;
}
.learn-page-title:hover::after {
  background: #f59e0b;
  opacity: 0.4;
  left: -5%; right: -5%;
}
.learn-tabs {
  flex-shrink: 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin: clamp(12px,1.8vh,80px) 0 clamp(10px,1.5vh,48px);
}
.learn-tab {
  padding: clamp(7px,1vh,33px) clamp(20px,2.5vw,108px);
  border-radius: 999px; font-family: inherit;
  font-size: clamp(13px,1.1vw,45px); font-weight: 600; cursor: pointer; transition: all .2s;
  border: 2px solid var(--teal); background: var(--white); color: var(--teal);
}
.learn-tab.is-active { background: var(--teal); color: var(--white); box-shadow: 0 4px 14px rgba(25,180,200,.35); }
.learn-tab:not(.is-active):hover { background: var(--teal-l); }

.learn-toolbar {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: clamp(10px,1.5vh,48px);
}
.learn-list-info { font-size: 13px; color: var(--muted); }
.learn-search-input {
  padding: 8px 14px; border-radius: 10px;
  border: 1.5px solid rgba(25,180,200,.4);
  background: var(--white); font-family: inherit; font-size: 14px; outline: none;
  width: clamp(160px,16vw,720px); transition: border-color .2s;
}
.learn-search-input:focus { border-color: var(--teal); }

/* THE LIST — this is the only thing that scrolls */
.learn-video-list {
  flex: 1;          /* takes remaining height inside .learn-list-content */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  contain: content;
  display: flex; flex-direction: column; gap: clamp(10px, 1.3vh, 42px);
  padding-right: 8px;
  padding-bottom: 60px; /* give some room at the bottom */
}
.learn-video-list::-webkit-scrollbar { width: 5px; }
.learn-video-list::-webkit-scrollbar-thumb { background: rgba(25,180,200,.3); border-radius: 99px; }

/* Cards */
.learn-video-card {
  flex-shrink: 0;
  content-visibility: auto;
  contain-intrinsic-size: 86px;
  display: flex; align-items: center; gap: clamp(12px,1.5vw,60px);
  background: var(--white); border-radius: clamp(12px,1.2vw,54px);
  padding: clamp(10px,1.3vh,48px) clamp(14px,1.6vw,66px);
  box-shadow: var(--card-shadow); transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.learn-video-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.13); }

.learn-thumb-wrap {
  width: 70px; height: 70px;
  flex-shrink: 0; position: relative; border-radius: 12px; overflow: hidden;
}
.learn-thumb-inner {
  width:100%; height:100%;
  background: transparent;
  border-radius:10px; display:flex; align-items:center; justify-content:center;
  font-size:11px; color:var(--teal); font-weight:600; position:relative; overflow:hidden;
}
.learn-thumb-fallback { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:11px; color:var(--teal); font-weight:600; }
.learn-thumb-fallback--static {
  display: none;
}
.learn-thumb-label-fallback {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  font-size: clamp(14px, 1.2vw, 18px); font-weight: 800; color: var(--teal);
  background: #d6f5e8; border-radius: 12px;
}
.has-no-img .learn-thumb-label-fallback {
  display: flex;
}
.learn-thumb-img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 0.3s ease;
}
.learn-thumb-label {
  max-width:92%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:clamp(16px,1.7vw,58px);
  font-weight:800;
  line-height:1;
  color:var(--teal);
}
.learn-thumb-caption {
  font-size:10px;
  font-weight:700;
  color:rgba(17,24,39,.58);
  letter-spacing:.04em;
  text-transform:uppercase;
}
.learn-play-bubble { display: none; }
.learn-video-text { flex:1; min-width:0; }
.learn-video-title { font-size:clamp(13px,1.2vw,48px); font-weight:700; color:var(--ink); margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.learn-video-category { font-size:12px; color:var(--muted); }
.learn-video-action {
  flex-shrink:0; padding: clamp(7px,.9vh,33px) clamp(16px,1.6vw,72px);
  border:1.5px solid var(--teal); border-radius:10px; background:var(--white);
  color:var(--teal); font-family:inherit; font-size:clamp(12px,1vw,42px); font-weight:600;
  cursor:pointer; transition:all .2s; white-space:nowrap;
}
.learn-video-action:hover { background:var(--teal); color:var(--white); }
.learn-empty-state { text-align:center; color:var(--muted); padding:36px; font-size:15px; }

/* ============================================================
   BELAJAR DETAIL  (screenLearnDetail)
   ============================================================ */
.learn-detail-content {
  flex: 1; display: flex; gap: clamp(16px,2.5vw,96px);
  align-items: stretch;               /* both cards same height */
  overflow: hidden;
  padding: clamp(12px,1.8vh,72px) clamp(16px,3vw,156px) clamp(16px,2vh,84px);
  position: relative; z-index: 2;
}

/* LEFT: video card */
.learn-detail-video-card {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--white); border-radius: clamp(14px,1.4vw,66px);
  padding: clamp(14px, 2vh, 72px); box-shadow: var(--card-shadow);
  overflow: hidden;
  height: 100%;
}
.learn-detail-video-title {
  flex-shrink: 0; text-align:center;
  font-size: clamp(15px,1.4vw,60px); font-weight: 700; color: var(--teal);
  margin-bottom: clamp(10px,1.4vh,54px);
}
.learn-detail-video-box {
  flex: 1; min-height: 0;
  background: linear-gradient(135deg,#daf3fa,#e6fbf0);
  border-radius: 14px; overflow: hidden; padding: 6px; display: flex;
}
.learn-detail-video-frame {
  flex: 1; border-radius: 10px; overflow: hidden; position: relative;
  background: var(--sky);
}
.learn-detail-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; border-radius: 10px; display: block;
}
.learn-detail-video-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: var(--sky); color: var(--teal); font-size: 14px;
}
.learn-detail-video-fallback::before { content:'▶'; font-size:36px; }

/* RIGHT: info card */
.learn-detail-side-card {
  width: clamp(240px, 25vw, 1020px); flex-shrink: 0;
  display: flex; flex-direction: column; gap: clamp(12px, 1.8vh, 66px);
  background: var(--white); border-radius: clamp(14px, 1.4vw, 66px);
  padding: clamp(20px, 2.5vh, 96px) clamp(16px, 1.8vw, 84px);
  box-shadow: var(--card-shadow); overflow-y: auto;
}
.learn-detail-mode-name { text-align:center; font-size:clamp(15px,1.4vw,24px); font-weight:700; color:var(--teal); margin-bottom: 8px; }
.learn-detail-target-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.2vh, 20px);
  background: var(--sky);
  padding: clamp(16px, 2vh, 32px) 15px;
  border-radius: 20px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.03);
  margin-bottom: 12px;
}
.learn-detail-target-img {
  max-width: 85%;
  max-height: clamp(100px, 12vh, 160px);
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(25, 180, 200, 0.2));
  transition: transform 0.3s ease;
}
.learn-detail-target-img:hover { transform: scale(1.05); }
.learn-detail-target-name { 
  text-align:center; 
  font-size:clamp(18px, 2.2vw, 32px); 
  font-weight:800; 
  color:var(--ink); 
  line-height:1; 
  text-transform: uppercase;
  letter-spacing: 1px;
}
.learn-detail-section-title { font-size:13px; font-weight:700; color:var(--ink); }
.learn-detail-tips { display:flex; flex-direction:column; gap:8px; }
.learn-detail-tip { background:var(--sky); border-radius:10px; padding:10px 12px; font-size:clamp(11px,1vw,39px); color:var(--ink); line-height:1.5; }
.learn-detail-nav-row { display:flex; gap:10px; }
.learn-detail-nav-btn {
  flex:1; padding:clamp(8px,1vh,36px);
  border:1.5px solid var(--teal); border-radius:12px; background:var(--white); color:var(--teal);
  font-family:inherit; font-size:clamp(11px,1vw,39px); font-weight:600; cursor:pointer; transition:all .2s;
}
.learn-detail-nav-btn:hover { background:var(--teal); color:var(--white); }
.learn-detail-practice-btn {
  flex-shrink:0; background:var(--teal2); color:var(--white); border:none;
  border-radius:13px; padding:clamp(10px,1.4vh,45px); width:100%;
  font-family:inherit; font-size:clamp(13px,1.2vw,48px); font-weight:700; cursor:pointer; transition:all .2s;
}
.learn-detail-practice-btn:hover { background:#0b8ba0; transform:translateY(-2px); box-shadow:0 6px 18px rgba(25,180,200,.4); }

/* ============================================================
   AYO MAIN — PILIH MODEL  (screenCategory)
   ============================================================ */
.main-select-content {
  flex: 1; display: flex; gap: clamp(16px,2.5vw,108px);
  align-items: stretch; overflow-y: auto;
  padding: clamp(12px, 2vh, 144px) clamp(16px, 3vw, 288px) clamp(80px, 10vh, 200px);
  position: relative; z-index: 2;
}
.main-select-left { flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; }
.main-select-title {
  flex-shrink:0; font-size: clamp(28px, 3.5vw, 112px); font-weight: 800;
  color: var(--teal); text-align: center;
  margin-bottom: clamp(24px, 3vh, 84px);
  text-transform: uppercase; letter-spacing: 2px;
  position: relative; width: fit-content; margin-left: auto; margin-right: auto;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
}
.main-select-title::after {
  content: ""; position: absolute; bottom: -8px; left: 10%; right: 10%;
  height: clamp(4px, 0.6vh, 12px); background: var(--teal);
  border-radius: 99px; opacity: 0.2;
  transition: all 0.5s ease;
}
.main-select-title:hover {
  background: linear-gradient(135deg, var(--teal), #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: titleBounce 0.6s infinite alternate ease-in-out, 
             letterSpread 1.5s infinite alternate ease-in-out;
}
.main-select-title:hover::after {
  background: #f59e0b;
  opacity: 0.4;
  left: -5%; right: -5%;
}

@keyframes titleBounce {
  0% { transform: translateY(0) scale(1.05); }
  100% { transform: translateY(-12px) scale(1.1); }
}

@keyframes letterSpread {
  0% { letter-spacing: 2px; }
  100% { letter-spacing: clamp(6px, 1.2vw, 16px); }
}
.model-choice-list {
  flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:clamp(10px,1.4vh,48px);
  padding-right:4px;
}
.model-choice-list::-webkit-scrollbar { width:5px; }
.model-choice-list::-webkit-scrollbar-thumb { background:rgba(25,180,200,.3); border-radius:99px; }
.model-choice-loading { color:var(--muted); font-size:14px; padding:20px; }

.model-choice-card {
  flex-shrink:0; display:flex; align-items:center; gap:clamp(12px,1.4vw,60px);
  background:var(--white); border-radius:clamp(12px,1.2vw,54px);
  padding:clamp(12px,1.6vh,60px) clamp(14px,1.6vw,72px);
  box-shadow:var(--card-shadow); border:2px solid transparent;
  cursor:pointer; transition:all .22s; width:100%; text-align:left; font-family:inherit;
}
.model-choice-card:hover { border-color:var(--teal); transform:translateY(-2px); box-shadow:0 8px 28px rgba(25,180,200,.2); }
.model-choice-card.is-selected { border-color:var(--teal); background:linear-gradient(135deg,#f0fbfd,#e8fbf2); }
.model-choice-icon {
  width: 70px; height: 70px;
  background: transparent;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.model-choice-icon img { width:100%; height:100%; object-fit:contain; }
.model-choice-text { flex:1; min-width:0; }
.model-choice-name { font-size:clamp(14px,1.4vw,54px); font-weight:700; color:var(--ink); }
.model-choice-desc { font-size:clamp(11px,1vw,39px); color:var(--muted); margin-top:3px; }

/* Right: how-to card */
.main-select-right { width: clamp(300px, 28vw, 540px); flex-shrink: 0; display: flex; flex-direction: column; }
.how-play-card {
  flex:1; display:flex; flex-direction:column;
  background:var(--white); border-radius:clamp(14px,1.4vw,22px);
  padding: clamp(16px, 2.2vh, 28px) clamp(14px, 1.6vw, 24px) 24px;
  box-shadow:var(--card-shadow); overflow-y:auto;
}
.how-play-title { font-size:clamp(15px,1.4vw,60px); font-weight:700; color:var(--ink); margin-bottom:clamp(12px,1.8vh,60px); }
.how-play-steps { display:flex; flex-direction:column; gap:clamp(12px,1.8vh,18px); margin-bottom:clamp(16px,2.4vh,26px); flex:1; }
.how-play-step { display:flex; align-items:flex-start; gap:12px; }
.how-play-number {
  width:clamp(26px,2.4vw,34px); height:clamp(26px,2.4vw,34px);
  border-radius:50%; flex-shrink:0;
  background:var(--teal); color:var(--white);
  display:flex; align-items:center; justify-content:center;
  font-size:clamp(12px,1.1vw,16px); font-weight:700;
}
.how-play-step-title { font-size:clamp(12px,1.1vw,45px); font-weight:700; color:var(--ink); margin-bottom:3px; }
.how-play-step p { font-size:clamp(11px,1vw,39px); color:var(--muted); line-height:1.5; }

.how-play-slider-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 12px;
  background: #f1f5f9;
  cursor: pointer;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}

.how-play-slider {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.how-play-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px 40px 10px; /* room for dots at bottom */
}

.guide-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--teal);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  z-index: 5;
  transition: all 0.3s ease;
}

.slider-arrow:hover { 
  background: var(--white); 
  transform: translateY(-50%) scale(1.15);
  color: var(--green2);
}

.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }

.slider-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
  padding: 4px 10px;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(4px);
  border-radius: 20px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(25, 180, 200, 0.25);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dot.active {
  background: var(--teal);
  width: 14px;
  border-radius: 4px;
}

/* Image Modal Styles */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.image-modal.is-active { display: flex; }

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
}

.image-modal-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-modal-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  background: white;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.image-modal-content img.fade-out {
  opacity: 0;
  transform: scale(0.96) translateY(5px);
}

.image-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.image-modal-close:hover { 
  background: var(--white);
  color: var(--ink);
  transform: rotate(90deg);
}

.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  color: white;
  z-index: 10;
  transition: all 0.3s ease;
}

.modal-arrow:hover {
  background: rgba(255,255,255,0.3);
  scale: 1.1;
}

.modal-arrow.prev { left: -80px; }
.modal-arrow.next { right: -80px; }

@media (max-width: 1400px) {
  .modal-arrow.prev { left: 20px; background: rgba(0,0,0,0.4); }
  .modal-arrow.next { right: 20px; background: rgba(0,0,0,0.4); }
}

.main-select-actions { 
  display:flex; gap:14px; margin-bottom:12px; 
  margin-top: auto; 
}
.main-mode-btn {
  flex: 1; padding: clamp(10px, 1.4vh, 54px);
  border-radius: 13px; font-family: inherit;
  font-size: clamp(14px, 1.2vw, 54px); font-weight: 700; cursor: pointer; transition: all 0.2s;
  position: relative; z-index: 10;
}
.main-mode-btn--outline { background:var(--white); color:var(--teal); border:2px solid var(--teal); }
.main-mode-btn--outline:hover:not(:disabled) { background:var(--teal-l); }
.main-mode-btn--solid { background:var(--teal); color:var(--white); border:none; box-shadow:0 4px 14px rgba(25,180,200,.35); }
.main-mode-btn--solid:hover:not(:disabled) { background:var(--teal2); transform:translateY(-2px); }
.main-mode-btn:disabled { opacity:.4; cursor:not-allowed; }
.selected-model-hint { font-size:13px; color:var(--muted); text-align:center; }

/* ============================================================
   TUTORIAL LIST (screenLevel)
   ============================================================ */
.tutorial-list-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  padding: clamp(12px, 2vh, 24px) clamp(16px, 3vw, 52px) clamp(16px, 2vh, 28px);
  position: relative; z-index: 2;
}
.tutorial-page-title {
  flex-shrink:0; font-size: clamp(28px, 3.5vw, 112px); font-weight: 800;
  color: var(--teal); text-align: center;
  margin-bottom: clamp(16px, 2vh, 48px);
  text-transform: uppercase; letter-spacing: 2px;
  position: relative; width: fit-content; margin-left: auto; margin-right: auto;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
}
.tutorial-page-title::after {
  content: ""; position: absolute; bottom: -8px; left: 10%; right: 10%;
  height: clamp(4px, 0.6vh, 12px); background: var(--teal);
  border-radius: 99px; opacity: 0.2;
  transition: all 0.5s ease;
}
.tutorial-page-title:hover {
  background: linear-gradient(135deg, var(--teal), #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: titleBounce 0.6s infinite alternate ease-in-out, 
             letterSpread 1.5s infinite alternate ease-in-out;
}
.tutorial-page-title:hover::after {
  background: #f59e0b;
  opacity: 0.4;
  left: -5%; right: -5%;
}
.tutorial-search-row {
  flex-shrink: 0; display: flex; align-items: center; gap: 16px; 
  margin: clamp(12px, 1.8vh, 20px) 0 clamp(12px, 1.8vh, 18px);
}
.tutorial-search-input {
  flex: 1; max-width: 1000px;
  padding: clamp(10px, 1.4vh, 40px) clamp(16px, 1.8vw, 48px); border-radius: 12px;
  border: 1.5px solid rgba(25, 180, 200, 0.4);
  background: var(--white); font-family: inherit; font-size: clamp(14px, 1.2vw, 42px); outline: none;
  transition: border-color 0.2s;
}
.tutorial-search-input:focus { border-color: var(--teal); }
.tutorial-search-info { font-size: 13px; color: var(--muted); }

.tutorial-target-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; 
  gap: clamp(10px, 1.4vh, 16px); padding-right: 8px;
  padding-bottom: 60px;
}
.tutorial-target-list::-webkit-scrollbar { width: 5px; }
.tutorial-target-list::-webkit-scrollbar-thumb { background: rgba(25,180,200,.3); border-radius: 99px; }

/* Tutorial Target Card (rendered by JS as .tutorial-target-card) */
.tutorial-target-card {
  flex-shrink: 0; display: flex; align-items: center; gap: clamp(14px, 1.8vw, 72px);
  background: var(--white); border-radius: clamp(12px, 1.2vw, 54px);
  padding: clamp(12px, 1.6vh, 54px) clamp(16px, 1.8vw, 78px);
  box-shadow: var(--card-shadow); transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.tutorial-target-card:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(0,0,0,0.12); }

.tutorial-target-logo-wrap { flex-shrink: 0; }
.tutorial-target-logo-inner {
  width: 70px; height: 70px;
  border-radius: 14px; background: transparent;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  position: relative;
}
.tutorial-target-logo-img { width: 100%; height: 100%; object-fit: contain; }
.tutorial-target-logo-fallback {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  font-size: clamp(14px, 1.2vw, 18px); font-weight: 800; color: var(--teal);
  background: #d6f5e8; border-radius: 12px;
}

.tutorial-target-title { flex: 1; font-size: clamp(14px, 1.2vw, 18px); font-weight: 700; color: var(--ink); }
.tutorial-target-start {
  flex-shrink: 0; padding: 10px 24px; border: 1.5px solid var(--teal);
  border-radius: 10px; background: var(--white); color: var(--teal);
  font-family: inherit; font-size: clamp(12px, 1vw, 14px); font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.tutorial-target-start:hover { background: var(--teal); color: var(--white); }

/* ============================================================
   TUTORIAL PLAY & REAL GAME  (Camera + Side Panels)
   ============================================================ */
.tutorial-play-content,
.real-game-content {
  flex: 1; display: flex; gap: clamp(16px, 2.5vw, 96px);
  align-items: stretch; overflow: hidden;
  padding: clamp(10px, 1.5vh, 60px) clamp(16px, 3vw, 156px) clamp(16px, 2.2vh, 96px);
  position: relative; z-index: 2;
}

/* LEFT: Camera Column */
.tutorial-camera-card,
.real-camera-card {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--white); border-radius: clamp(16px, 1.6vw, 24px);
  padding: clamp(14px, 1.8vh, 22px); box-shadow: var(--card-shadow);
  overflow: hidden;
}

.tutorial-camera-head, .real-camera-head {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  margin-bottom: clamp(16px, 2vh, 24px);
  position: relative;
}
.tutorial-camera-title, .real-camera-title {
  font-size: clamp(18px, 1.5vw, 54px); font-weight: 800; color: var(--teal); 
  letter-spacing: 0.8px; text-align: center; position: relative;
}
.tutorial-camera-title::after, .real-camera-title::after {
  content: ""; position: absolute; bottom: -5px; left: 15%; right: 15%;
  height: 4px; background: var(--teal); border-radius: 99px; opacity: 0.25;
}

.tutorial-status-pill, .real-status-pill {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  padding: 6px 14px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #e0f2fe; color: #0369a1; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.real-status-pill--recording { background: #d1fae5; color: #065f46; }
.real-status-pill--checking  { background: #fef3c7; color: #92400e; }
.real-status-pill--error     { background: #fee2e2; color: #991b1b; }

.tutorial-camera-box, .real-camera-box {
  flex: 1; min-height: 0; background: linear-gradient(135deg, #daf3fa, #e6fbf0);
  border-radius: 14px; padding: 6px; display: flex; overflow: hidden;
}
.tutorial-camera-frame, .real-camera-frame {
  flex: 1; position: relative; border-radius: 10px; overflow: hidden;
  background: #000; display: flex; align-items: center; justify-content: center;
}

/* Loading Overlays inside camera card */
.tutorial-loading-overlay, .real-loading-overlay {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(4px);
  display: none; place-items: center; align-content: center; gap: 16px;
  color: var(--white); text-align: center; padding: 20px;
}
.tutorial-loading-hint, .real-loading-hint { font-size: 14px; font-weight: 600; margin-top: 12px; }

/* Simple Loader Spinner */
.loader {
  width: 48px; height: 48px; border: 5px solid rgba(255,255,255,0.2);
  border-top-color: var(--teal); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tutorial-camera-feed, .real-camera-feed {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

.accelerated {
  backface-visibility: hidden;
  transform: translateZ(0);
}

body.is-camera-active .tutorial-play-bg-deco,
body.is-camera-active .real-game-bg-deco,
body.is-camera-active .tutorial-play-star,
body.is-camera-active .real-game-star {
  display: none;
  animation: none !important;
}

body.is-camera-active .tutorial-camera-card,
body.is-camera-active .real-camera-card,
body.is-camera-active .tutorial-progress-bar,
body.is-camera-active .real-progress-bar,
body.is-camera-active .tutorial-feedback-card,
body.is-camera-active .real-feedback-card {
  transition: none !important;
}

body.is-mediapipe-active .is-recording {
  animation: none !important;
  box-shadow: 0 0 0 4px #22c55e !important;
}

/* Progress bar at bottom of camera card */
.tutorial-progress-shell, .real-progress-shell {
  flex-shrink: 0; height: 8px; background: var(--sky); border-radius: 999px;
  margin-top: 12px; overflow: hidden;
}
.tutorial-progress-bar, .real-progress-bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--green2));
  border-radius: 999px; transition: width 0.3s ease;
}

/* RIGHT: Side Card Column */
.tutorial-side-card, .real-side-card {
  width: clamp(240px, 25vw, 1000px); flex-shrink: 0;
  display: flex; flex-direction: column; gap: clamp(10px, 1.4vh, 24px);
  background: var(--white); border-radius: clamp(16px, 1.6vw, 40px);
  padding: clamp(16px, 2vh, 48px) clamp(12px, 1.8vw, 40px);
  box-shadow: var(--card-shadow); overflow-y: auto;
}

.tutorial-side-model, .real-side-model {
  text-align: center; font-size: clamp(16px, 1.4vw, 20px); font-weight: 800; color: var(--teal);
}

.tutorial-target-panel, .real-target-panel {
  flex-shrink: 0; background: var(--sky); border-radius: 20px; 
  padding: clamp(16px, 2vh, 32px) 15px; text-align: center;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.03);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: clamp(140px, 15vh, 280px);
}
.tutorial-target-label, .real-target-label { 
  font-size: 13px; font-weight: 600; color: var(--muted); 
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px;
}
.tutorial-target-image-wrap, .real-target-image-wrap {
  width: 100%; display: flex; align-items: center; justify-content: center;
}
.tutorial-target-img, .real-target-img {
  max-width: 90%; max-height: clamp(120px, 12vh, 180px);
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(25, 180, 200, 0.2));
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tutorial-target-img:hover, .real-target-img:hover {
  transform: scale(1.1);
}
.tutorial-play-target-word, .real-target-word {
  font-size: clamp(48px, 6vw, 160px); font-weight: 900; color: var(--ink); line-height: 1;
  text-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Tutorial Video Guide inside side-card */
.tutorial-video-box {
  flex-shrink: 0;
  background: linear-gradient(135deg, #daf3fa, #e6fbf0);
  border-radius: 16px;
  padding: 6px;
  display: flex;
  margin: 10px 0;
  aspect-ratio: 16/10; /* Match standard guide/video ratio */
  overflow: hidden;
}
.tutorial-video-frame {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--sky);
}
.tutorial-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.tutorial-feedback-card, .real-feedback-card {
  flex-shrink: 0; border-radius: 14px; padding: clamp(10px, 1.2vh, 20px); 
  background: var(--sky); text-align: center; transition: all 0.3s ease;
}
.real-score-panel {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.real-score-item {
  border-radius: 16px;
  padding: 12px 10px;
  background: linear-gradient(135deg, #ecfeff, #fef9c3);
  text-align: center;
  box-shadow: inset 0 0 0 2px rgba(14, 165, 166, 0.12);
}
.real-score-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.real-score-item strong {
  display: block;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1;
  color: var(--teal);
}
.real-feedback-card--good { background: #bbf7d0; }
.real-feedback-card--warn,
.tutorial-feedback-card--warn { background: #fef3c7; }
.tutorial-feedback-card--good { background: #bbf7d0; }

.tutorial-feedback-title, .real-feedback-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.tutorial-feedback-desc, .real-feedback-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

.tutorial-calibration-wrap,
.real-calibration-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-calibration {
  border: 0;
  border-radius: 14px;
  padding: 11px 12px;
  background: #fee2e2;
  color: #991b1b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-calibration:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.btn-calibration--on {
  background: #bbf7d0;
  color: #065f46;
}

.calibration-hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.real-game-actions { flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.real-next-btn {
  padding: 12px; border-radius: 12px; border: 2px solid var(--teal);
  background: var(--white); color: var(--teal); font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.real-next-btn:hover { background: var(--teal-l); }

.tutorial-exit-btn, .real-exit-btn {
  margin-top: auto;
  padding: 12px; border-radius: 12px; border: 1.5px solid #cbd5e1;
  background: var(--white); color: #64748b; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.tutorial-exit-btn:hover, .real-exit-btn:hover { background: #f8fafc; border-color: #94a3b8; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
  background: var(--white); border-radius: 24px;
  padding: clamp(24px, 4vh, 144px) clamp(24px, 3vw, 120px);
  max-width: 1200px; width: 100%; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-icon { font-size: clamp(48px, 4.5vh, 144px); margin-bottom: 16px; }
.modal-title { font-size: clamp(22px, 2.5vw, 88px); font-weight: 800; color: var(--ink); margin-bottom: 10px; }
.modal-desc { font-size: clamp(14px, 1.2vw, 42px); color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; flex-direction: column; gap: clamp(10px, 1.2vh, 30px); }

.btn { width: 100%; padding: clamp(14px, 1.5vh, 42px); border-radius: 12px; font-family: inherit; font-size: clamp(15px, 1.2vw, 45px); font-weight: 700; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal2); transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }

/* ============================================================
   UTILITIES & RESPONSIVE
   ============================================================ */
.hidden { display: none !important; }

@media (max-width: 960px) {
  .tutorial-play-content, .real-game-content, 
  .learn-detail-content, .main-select-content {
    flex-direction: column; overflow-y: auto; align-items: center;
  }
  .tutorial-side-card, .real-side-card, 
  .learn-detail-side-card, .main-select-right {
    width: 100%; max-width: 600px; flex-shrink: 0; overflow: visible;
  }
  .landing-content { flex-direction: column; text-align: center; }
  .landing-left { max-width: 100%; }
  .landing-actions { justify-content: center; }
  .landing-right { display: none; }
}

@media (max-width: 640px) {
  .learn-header, .main-select-header, .tutorial-header { padding: 12px 16px 0; }
  .learn-list-content, .tutorial-list-content { padding: 16px; }
  .learn-tabs { flex-wrap: wrap; }
  .learn-tab { padding: 8px 16px; font-size: 12px; }
}

/* About App Modal Custom Styling */
.about-card {
  background: #e9f8fb !important; /* Very light cyan from image */
  border-radius: 48px !important;
  padding: clamp(32px, 5vh, 80px) clamp(24px, 4vw, 64px) !important;
  max-width: 720px !important;
  position: relative;
  border: none !important;
}

.about-close-btn {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); border: none;
  color: var(--ink); font-size: 20px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.2s;
  z-index: 10;
}
.about-close-btn:hover { transform: scale(1.1); background: #f8fafc; }

.about-content {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.about-title {
  font-size: clamp(24px, 2.5vw, 42px); font-weight: 800; color: var(--ink);
  margin-bottom: 8px;
}
.about-line {
  width: 240px; height: 3px; background: var(--teal);
  margin-bottom: 24px; border-radius: 99px;
}
.about-main { margin-bottom: 32px; }
.about-name {
  font-size: clamp(22px, 2.2vw, 36px); font-weight: 700; color: var(--ink);
  margin-bottom: 4px;
}
.about-year { font-size: 18px; color: var(--muted); margin-bottom: 4px; }
.about-uni {
  font-size: clamp(20px, 2vw, 32px); font-weight: 700; color: #2096bd;
}
.about-quote {
  font-size: clamp(15px, 1.4vw, 22px); color: var(--ink);
  line-height: 1.5; font-weight: 500; font-style: normal;
  max-width: 580px; margin: 0 auto;
}

@media (max-width: 640px) {
  .about-card { border-radius: 32px !important; padding: 40px 20px !important; }
  .about-line { width: 160px; }
}

/* Correct Popup - Premium Design */
.correct-popup {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
  background: white; 
  border: 4px solid #c9f4dc; 
  border-radius: 70px; 
  padding: 50px 80px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.15);
  opacity: 0; pointer-events: none; z-index: 1000;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebrate.is-visible .correct-popup {
  opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.correct-icon-box {
  width: 180px; height: 110px; 
  background: #c9f4dc; /* Light green box from image */
  border-radius: 35px; 
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease;
}

.celebrate.is-visible .correct-icon-box {
  animation: star-bounce 0.8s infinite alternate ease-in-out;
}

@keyframes star-bounce {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.correct-star {
  font-size: 72px; color: #5cc28c; /* Green star color */
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  line-height: 1;
}

.correct-title {
  font-size: 38px; font-weight: 800; color: #000; margin: 0;
  font-family: inherit; letter-spacing: -0.5px;
}

@media (max-width: 640px) {
  .correct-popup { padding: 30px 40px; border-radius: 40px; gap: 20px; }
  .correct-icon-box { width: 120px; height: 80px; }
  .correct-star { font-size: 48px; }
  .correct-title { font-size: 24px; }
}

/* Recording Ambient Effect */
.is-recording {
  box-shadow: 0 0 0 4px #22c55e, 0 0 25px rgba(34, 197, 94, 0.4) !important;
  animation: pulse-recording 1.5s infinite ease-in-out;
  transition: box-shadow 0.3s ease;
}

@keyframes pulse-recording {
  0% { box-shadow: 0 0 0 4px #22c55e, 0 0 10px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 0 6px #22c55e, 0 0 30px rgba(34, 197, 94, 0.6); }
  100% { box-shadow: 0 0 0 4px #22c55e, 0 0 10px rgba(34, 197, 94, 0.3); }
}

.tutorial-camera-card, .real-camera-card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Drag to Scroll Utilities */
.model-choice-list, .learn-video-list, .tutorial-target-list {
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.model-choice-list:active, .learn-video-list:active, .tutorial-target-list:active {
  cursor: grabbing;
}

.is-dragging {
  scroll-behavior: auto !important;
  cursor: grabbing !important;
}

/* Easter Egg Pop Effects */
.landing-logo-img, .landing-child-img {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.landing-logo-img:active, .landing-child-img:active {
  transform: scale(0.92) rotate(-2deg);
}

/* Localized Easter Egg Confetti - Impactful & Graceful */
.local-confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 99999;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.6));
  animation: localBurst 1.5s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

/* Shape variants for local confetti */
.local-confetti.circle { border-radius: 50%; }
.local-confetti.star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.local-confetti.square { border-radius: 2px; }

@keyframes localBurst {
  0% { 
    transform: translate(-50%, -50%) scale(1) rotate(0deg); 
    opacity: 1; 
  }
  80% {
    opacity: 1;
  }
  100% { 
    /* Add gravity by moving them slightly down (ty + 100px) and fade out */
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty) + 120px)) scale(0) rotate(var(--tr)); 
    opacity: 0; 
  }
}

/* Calibration Memory Badge */
.calibration-memory-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--teal2);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(25, 180, 200, 0.3);
  margin-left: 10px;
  animation: badgeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.calibration-memory-badge .badge-label {
  opacity: 0.8;
  font-weight: 500;
}

@keyframes badgeIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; }
