/* ─────────────────────────────────────────────────────────────
   Vekna Child — Pass the Ball Game Stylesheet
   Modern, Claymorphic, Kid-Centric, Responsive (RTL)
   ───────────────────────────────────────────────────────────── */

.page-kid {
  --kg-coral: #ff5b5b;
  --kg-coral-glow: rgba(255, 91, 91, 0.28);
  --kg-pink: #ff6ec7;
  --kg-teal: #00c9a7;
  --kg-purple: #845ec2;
  --kg-sun: #f59e0b;
  --kg-radius-xl: 32px;
  --kg-radius-lg: 24px;
  --kg-radius-md: 18px;
  --kg-radius-sm: 12px;
  --kg-shadow-card: 0 20px 48px -12px rgba(255, 91, 91, 0.16), 0 8px 24px -4px rgba(0, 0, 0, 0.04), inset 0 2px 2px rgba(255, 255, 255, 0.95);
  --kg-shadow-btn: 0 8px 24px -2px rgba(255, 91, 91, 0.38);
}

/* ── Hero Header ── */
.kg-game-head {
  padding: 1.5rem 0 1rem;
  position: relative;
}

.kg-hero-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 245, 245, 0.9) 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--kg-radius-xl);
  box-shadow: 0 12px 32px -8px rgba(255, 91, 91, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  padding: 1.75rem 2rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-sizing: border-box;
}

.kg-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, #ff6ec7, #ff5b5b, #ff9671);
}

.kg-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kg-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  flex-wrap: wrap;
}

.kg-breadcrumb a {
  color: #475569;
  text-decoration: none;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.kg-breadcrumb a:hover {
  color: #ff5b5b;
  border-color: #ffcdd2;
  background: #fff5f5;
  transform: translateY(-1px);
}

.kg-breadcrumb span:last-child {
  color: #ff5b5b;
  font-weight: 800;
}

.kg-hero-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.kg-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.kg-badge--coral {
  background: rgba(255, 91, 91, 0.1);
  color: #e11d48;
  border: 1px solid rgba(255, 91, 91, 0.2);
}

.kg-badge--teal {
  background: rgba(0, 201, 167, 0.1);
  color: #0d9488;
  border: 1px solid rgba(0, 201, 167, 0.2);
}

.kg-badge--sun {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.kg-hero-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.kg-hero-icon-bubble {
  width: 72px;
  height: 72px;
  border-radius: 28px;
  background: linear-gradient(135deg, #ff6ec7 0%, #ff5b5b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 10px 24px -4px rgba(255, 91, 91, 0.4);
  animation: kg-hero-float 3s ease-in-out infinite alternate;
}

@keyframes kg-hero-float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-6px) rotate(3deg); }
}

.kg-hero-titles {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 240px;
}

.kg-hero-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kg-hero-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.kg-hero-en {
  margin: 0;
  font-family: var(--font-latin, 'DM Sans', system-ui, sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ff5b5b;
  direction: ltr;
  background: rgba(255, 91, 91, 0.08);
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
}

.kg-hero-lead {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
}

/* ── Game Section & Engine ── */
.kg-section--play {
  padding-block: 0.5rem 3rem;
}

.kid-play-wrap {
  max-width: 44rem;
  margin: 0 auto;
}

.kg-engine {
  position: relative;
  background: linear-gradient(175deg, #ffffff 0%, #fffbfb 50%, #fff7f7 100%);
  border-radius: var(--kg-radius-xl);
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  box-shadow: var(--kg-shadow-card);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-sizing: border-box;
  overflow: hidden;
  scroll-margin-top: 100px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Mascot Pulse in Start Panel */
.kg-engine__mascot--ball {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 110, 199, 0.15) 0%, rgba(255, 91, 91, 0.2) 100%);
  color: #ff5b5b;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 1.25rem;
  box-shadow: 0 10px 24px rgba(255, 91, 91, 0.2);
  animation: kg-mascot-pulse 2.2s ease-in-out infinite;
}

@keyframes kg-mascot-pulse {
  0% { transform: scale(1); box-shadow: 0 10px 24px rgba(255, 91, 91, 0.2); }
  50% { transform: scale(1.08); box-shadow: 0 16px 32px rgba(255, 91, 91, 0.35); }
  100% { transform: scale(1); box-shadow: 0 10px 24px rgba(255, 91, 91, 0.2); }
}

/* Mode Switcher */
.kg-ball-mode {
  direction: ltr !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  background: #f1f5f9;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  margin: 1.25rem auto 1.5rem;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.kg-ball-mode__label {
  font-family: var(--font-latin, 'DM Sans', sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
  padding-inline: 0.5rem;
}

.kg-ball-mode__btn {
  background: transparent;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kg-ball-mode__btn.is-active {
  background: #ffffff;
  color: #ff5b5b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 4-Step Cards */
.kg-ball-intro {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}

.kg-ball-intro__steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.kg-ball-intro__step {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  background: #ffffff;
  border-radius: var(--kg-radius-md);
  border: 1.5px solid #f1f5f9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  text-align: start;
  transition: all 0.2s ease;
}

.kg-ball-intro__step:hover {
  border-color: #ffd6d6;
  box-shadow: 0 8px 24px rgba(255, 91, 91, 0.08);
  transform: translateY(-2px);
}

.kg-ball-intro__num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6ec7, #ff5b5b);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(255, 91, 91, 0.3);
}

.kg-s__icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff5b5b;
  flex-shrink: 0;
}

.kg-ball-intro__copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

.kg-ball-intro__copy strong {
  font-family: var(--font-latin, 'DM Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.kg-ball-intro__copy span {
  font-family: var(--font-latin, 'DM Sans', sans-serif);
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.kg-ball-intro__tip {
  margin: 0 auto 1.25rem;
  max-width: 34rem;
  font-size: 0.85rem;
  color: #854d0e;
  line-height: 1.65;
  text-align: center;
  padding: 0.85rem 1.25rem;
  background: #fefce8;
  border-radius: var(--kg-radius-md);
  border: 1px dashed #fde047;
}

/* Start Button */
.kg-btn--coral {
  background: linear-gradient(135deg, #ff6ec7 0%, #ff5b5b 100%) !important;
  color: #ffffff !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  padding: 0.95rem 2.5rem !important;
  border-radius: 999px !important;
  box-shadow: var(--kg-shadow-btn) !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
}

.kg-btn--coral:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 14px 32px rgba(255, 91, 91, 0.5) !important;
}

.kg-btn--coral:active {
  transform: translateY(0) scale(0.99) !important;
}

/* ── Active Gameplay Board ── */
.kg-engine__board {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.kg-ball__progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}

.kg-ball__progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kg-ball__round {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
}

.kg-ball__score {
  font-size: 0.9rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kg-ball__bar {
  height: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.kg-ball__bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff6ec7, #ff5b5b);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.kg-ball__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.kg-ball__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: all 0.2s ease;
}

.kg-ball__dot.is-done {
  background: #10b981;
}

.kg-ball__dot.is-current {
  background: #ff5b5b;
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(255, 91, 91, 0.25);
}

/* Question Card */
.kg-ball-card {
  background: #ffffff;
  border-radius: var(--kg-radius-lg);
  border: 2px solid #f1f5f9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
  text-align: center;
  box-sizing: border-box;
}

.kg-ball__cat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.kg-ball__cat--coral {
  background: rgba(255, 91, 91, 0.1);
  color: #e11d48;
}

.kg-ball__cat--teal {
  background: rgba(0, 201, 167, 0.1);
  color: #0d9488;
}

.kg-ball__cat--purple {
  background: rgba(132, 94, 194, 0.1);
  color: #7c3aed;
}

.kg-ball__cat--sun {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.kg-ball-q__en {
  font-family: var(--font-latin, 'DM Sans', sans-serif);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  color: #0f172a;
  margin: 0.5rem 0;
  line-height: 1.4;
  direction: ltr;
}

.kg-ball-q__fa {
  font-size: 1rem;
  color: #64748b;
  margin: 0.35rem 0 0.75rem;
}

.kg-ball-q__speak {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-inline-start: 0.5rem;
}

.kg-ball-q__speak:hover {
  background: #dbeafe;
  transform: scale(1.1);
}

/* Action Buttons LTR Exclamation Fix */
.kg-btn--ball-go,
.kg-btn--ball-pass,
.kg-engine__actions button {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  font-family: var(--font-latin, 'DM Sans', system-ui, sans-serif) !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  padding: 0.85rem 2.2rem !important;
  border-radius: 999px !important;
}

/* ── Related Games Grid ── */
.kg-related-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px dashed #e2e8f0;
}

.kg-related-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.kg-related-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

.kg-related-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.kg-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}

.kg-game-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border-radius: var(--kg-radius-md);
  border: 1.5px solid #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kg-game-card:hover {
  border-color: #ffcdd2;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(255, 91, 91, 0.12);
}

.kg-game-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 91, 91, 0.08);
  color: #ff5b5b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kg-game-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.kg-game-card__title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kg-game-card__sub {
  font-family: var(--font-latin, 'DM Sans', sans-serif);
  font-size: 0.72rem;
  color: #94a3b8;
  direction: ltr;
  text-align: right;
}

/* ── Floating Overlap Fix on Kids Play Pages ── */
.page-kid .vk-call-fab {
  inset-inline-start: max(1rem, env(safe-area-inset-left, 0px)) !important;
  inset-inline-end: auto !important;
  right: auto !important;
  left: auto !important;
}

@media (max-width: 768px) {
  .page-kid .vk-call-fab {
    bottom: 1.25rem !important;
    inset-inline-start: 1rem !important;
    inset-inline-end: auto !important;
    z-index: 99 !important;
  }

  .page-kid .viki-sidekick {
    bottom: 1.25rem !important;
    inset-inline-end: 1rem !important;
    z-index: 98 !important;
  }
}
