/* Twins AI Learning - Toddler-Friendly Styles */

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

body {
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', 'Nunito', sans-serif;
  background: #f0f4ff;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ==================== TOP BAR ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-avatar-small {
  font-size: 36px;
}

.child-name {
  font-size: 22px;
  font-weight: 700;
  color: #333;
}

.star-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFF3CD, #FFE082);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 24px;
  font-weight: 700;
  color: #F57F17;
  box-shadow: 0 2px 8px rgba(245,166,35,0.3);
}

.star-counter .star-icon {
  font-size: 28px;
  animation: star-pulse 2s ease-in-out infinite;
}

@keyframes star-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ==================== ACTIVITY CARDS ==================== */
.activity-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.activity-card {
  background: white;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 100px;
  border-left: 6px solid;
}

.activity-card:hover, .activity-card:active {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.activity-card:active {
  transform: scale(0.97);
}

.activity-card[data-pillar="core"] { border-left-color: #4A90D9; }
.activity-card[data-pillar="digital"] { border-left-color: #5CB85C; }
.activity-card[data-pillar="life"] { border-left-color: #F5A623; }

.activity-icon {
  font-size: 48px;
  min-width: 60px;
  text-align: center;
}

.activity-info {
  flex: 1;
}

.activity-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.activity-topic {
  font-size: 16px;
  color: #888;
}

.activity-go {
  font-size: 36px;
  color: #5CB85C;
}

/* ==================== ACTIVITY SCREEN ==================== */
.activity-screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  background: #f0f4ff;
}

.activity-screen.active {
  display: flex;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.activity-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
}

.activity-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 24px;
}

.activity-prompt {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  text-align: center;
  padding: 10px 20px;
}

/* ==================== OPTION BUTTONS (for match, count, etc.) ==================== */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 500px;
  padding: 0 20px;
}

.option-btn {
  min-height: 100px;
  border: 4px solid #e0e0e0;
  border-radius: 24px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #333;
  transition: all 0.2s ease;
  padding: 16px;
}

.option-btn:hover {
  border-color: #4A90D9;
  transform: scale(1.05);
}

.option-btn:active {
  transform: scale(0.95);
}

.option-btn.correct {
  border-color: #5CB85C;
  background: #e8f5e9;
  animation: correct-bounce 0.5s ease;
}

.option-btn.wrong {
  border-color: #E74C3C;
  background: #fce4ec;
  animation: wrong-shake 0.4s ease;
}

@keyframes correct-bounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
}

@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ==================== CANVAS (for tracing) ==================== */
.trace-canvas-container {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  background: white;
  border-radius: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  touch-action: none;
}

.trace-canvas-container canvas {
  width: 100%;
  height: 100%;
}

/* ==================== COUNT OBJECTS ==================== */
.count-objects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 400px;
  padding: 20px;
}

.count-object {
  font-size: 52px;
  animation: pop-in 0.3s ease;
}

@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==================== TAP TARGET ==================== */
.tap-target {
  position: absolute;
  font-size: 60px;
  cursor: pointer;
  transition: transform 0.2s;
  animation: float 3s ease-in-out infinite;
}

.tap-target:active {
  transform: scale(0.7);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ==================== COLOR GRID ==================== */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 400px;
  width: 100%;
}

.color-cell {
  aspect-ratio: 1;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 4px solid transparent;
  min-height: 70px;
}

.color-cell:active {
  transform: scale(0.9);
}

.color-cell.selected {
  border-color: #333;
  box-shadow: 0 0 0 3px white, 0 0 0 6px #333;
}

.color-cell.correct-pick {
  border-color: #5CB85C;
  box-shadow: 0 0 15px rgba(92,184,92,0.5);
}

/* ==================== PATTERN ==================== */
.pattern-sequence {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.pattern-item {
  font-size: 48px;
  padding: 8px;
}

.pattern-blank {
  width: 70px;
  height: 70px;
  border: 4px dashed #999;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: #f9f9f9;
}

/* ==================== CELEBRATION SCREEN ==================== */
.celebration {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.celebration.active {
  display: flex;
}

.celebration-title {
  font-size: 48px;
  font-weight: 700;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  animation: celebration-bounce 0.8s ease;
}

.celebration-stars {
  font-size: 64px;
  display: flex;
  gap: 10px;
}

.celebration-star {
  animation: star-fly 0.5s ease forwards;
  opacity: 0;
}

.celebration-star:nth-child(1) { animation-delay: 0.2s; }
.celebration-star:nth-child(2) { animation-delay: 0.5s; }
.celebration-star:nth-child(3) { animation-delay: 0.8s; }

@keyframes star-fly {
  0% { transform: translateY(50px) scale(0); opacity: 0; }
  60% { transform: translateY(-10px) scale(1.3); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes celebration-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.celebration-badge {
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 16px 30px;
  color: white;
  font-size: 24px;
  font-weight: 700;
  animation: badge-pop 0.5s ease 1s forwards;
  opacity: 0;
  transform: scale(0);
}

@keyframes badge-pop {
  0% { opacity: 0; transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

.celebration-btn {
  min-width: 200px;
  min-height: 80px;
  border: none;
  border-radius: 20px;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.2s;
}

.celebration-btn:active {
  transform: scale(0.95);
}

.btn-more {
  background: #5CB85C;
  color: white;
}

.btn-done {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 3px solid rgba(255,255,255,0.5);
}

/* ==================== FALLING STARS ANIMATION ==================== */
.falling-star {
  position: fixed;
  font-size: 30px;
  pointer-events: none;
  z-index: 1001;
  animation: fall linear forwards;
}

@keyframes fall {
  0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ==================== HINT ==================== */
.hint-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(74,144,217,0.95);
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 500;
  border-radius: 20px 20px 0 0;
}

.hint-overlay.show {
  transform: translateY(0);
}

/* ==================== LOADING ==================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-size: 48px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
  .activity-prompt { font-size: 22px; }
  .option-btn { min-height: 80px; font-size: 26px; }
  .options-grid { gap: 12px; }
  .count-object { font-size: 40px; }
  .pattern-item { font-size: 36px; }
  .celebration-title { font-size: 36px; }
  .top-bar { padding: 10px 14px; }
  .child-name { font-size: 18px; }
}

@media (min-width: 1024px) {
  .activity-body {
    max-width: 800px;
    margin: 0 auto;
  }
}
