@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body.basateen-kids-body {
  background: radial-gradient(circle at 50% 20%, #064e3b 0%, #022c22 65%, #01140e 100%);
  color: #ffffff;
  font-family: 'Cairo', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.kids-container {
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* الرأس والمعلومات */
.kids-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: rgba(6, 78, 59, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 8px 12px;
  border-radius: 20px;
}

.kid-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-kid {
  font-size: 26px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 50%;
  padding: 4px;
}

.kid-info {
  display: flex;
  flex-direction: column;
}

.kid-greeting {
  font-size: 13px;
  color: #fef08a;
}

.kid-rank {
  font-size: 11px;
  font-weight: 800;
  color: #34d399;
}

.top-actions {
  display: flex;
  gap: 6px;
}

.btn-top-pill {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

/* بطاقة المرحلة */
.stage-card {
  background: rgba(4, 120, 87, 0.4);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 18px;
  padding: 10px 14px;
  margin: 10px 0;
}

.stage-info-bar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #a7f3d0;
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 12px;
  background: rgba(2, 44, 34, 0.7);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  border-radius: 10px;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-mini-stats {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #d1fae5;
  margin-top: 5px;
}

/* الشجرة والعداد */
.tree-display-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.canvas-tree-box {
  width: 100%;
  max-width: 280px;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
}

.counter-trigger-orb {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, #059669 0%, #022c22 80%);
  border: 3px solid #f59e0b;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.4), inset 0 0 20px rgba(52, 211, 153, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: -30px;
  transition: transform 0.08s ease;
  z-index: 5;
}

.counter-trigger-orb:active {
  transform: scale(0.92);
}

.count-big-number {
  font-size: 48px;
  font-weight: 900;
  color: #ffffff;
  font-family: Arial, sans-serif;
  line-height: 1;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.orb-sub-text {
  font-size: 11px;
  font-weight: 800;
  color: #fef08a;
  margin-top: 4px;
}

.voice-status-badge {
  margin-top: 10px;
  background: rgba(2, 44, 34, 0.7);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-pulsing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* بطاقة التوجيه بصوت ناصح */
.mentor-guidance-card {
  background: rgba(6, 78, 59, 0.5);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 10px 12px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mentor-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mentor-avatar {
  font-size: 24px;
}

.mentor-title {
  font-size: 11px;
  font-weight: 800;
  color: #f59e0b;
}

.mentor-quote {
  font-size: 12px;
  color: #ecfdf5;
  margin: 2px 0 0;
  line-height: 1.4;
}

.mentor-audio-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 12px;
  color: #022c22;
  font-weight: 800;
  font-size: 12px;
  padding: 8px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* التحكم السفلي والميكروفون */
.kids-footer-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kids-mic-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 18px;
  padding: 12px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
  font-family: 'Cairo', sans-serif;
  transition: all 0.15s ease;
}

.kids-mic-btn.active-listening {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.7);
  animation: pulseKidMic 1.4s infinite;
}

@keyframes pulseKidMic {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.mic-emoji {
  font-size: 22px;
}

.mic-labels {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.mic-main-label {
  font-size: 14px;
  font-weight: 800;
}

.mic-sub-label {
  font-size: 10px;
  opacity: 0.85;
}

.kids-tool-row {
  display: flex;
  gap: 8px;
}

.mini-tool-btn {
  flex: 1;
  background: rgba(2, 44, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #d1fae5;
  padding: 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

/* النوافذ المنبثقة (Modals) */
.kids-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 20, 14, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.kids-modal-box {
  background: #064e3b;
  border: 2px solid #f59e0b;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.wide-box {
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-badge-kid {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header-row h3 {
  margin: 0;
  font-size: 16px;
  color: #fef08a;
}

.close-modal-x {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.name-input-group {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

#kid-name-input, #kid-dua-text {
  width: 100%;
  background: #022c22;
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  direction: rtl;
}

.icon-voice-input {
  background: #f59e0b;
  border: none;
  border-radius: 14px;
  font-size: 18px;
  padding: 0 14px;
  cursor: pointer;
}

.kids-primary-btn {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 14px;
  padding: 12px;
  color: #022c22;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

.kids-secondary-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  font-family: 'Cairo', sans-serif;
}

/* بطاقات سلم الرتب */
.ranks-list-scroll {
  overflow-y: auto;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  padding-left: 4px;
}

.rank-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(2, 44, 34, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px 12px;
  text-align: right;
}

.rank-item-card.rank-active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.rank-item-card.rank-highest {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(16, 185, 129, 0.25));
}

.rank-icon-col {
  font-size: 24px;
}

.rank-info-col {
  flex: 1;
}

.rank-info-col h4 {
  margin: 0;
  font-size: 13px;
  color: #fef08a;
}

.rank-info-col p {
  margin: 2px 0 0;
  font-size: 10px;
  color: #a7f3d0;
}

.rank-req-col {
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  font-family: Arial, sans-serif;
}

/* شبكة بستان الجنة */
.garden-trees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin: 10px 0;
  padding: 4px;
}

.garden-tree-leaf {
  background: rgba(2, 44, 34, 0.8);
  border: 1px solid #10b981;
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
}

.garden-tree-leaf span.icon {
  font-size: 22px;
}
