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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #E3F2FD 0%, #F3E5F5 50%, #E8F5E9 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.screen.active { display: block; }

/* ===== HOME SCREEN ===== */
.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  gap: 16px;
}

.mascot {
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
}

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

.main-title {
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #FF7043, #E91E63, #9C27B0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bounce-in 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes bounce-in {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.08); }
  70%  { transform: scale(0.96); }
  100% { transform: scale(1); opacity: 1; }
}

.subtitle {
  font-size: 1.2rem;
  color: #555;
  line-height: 1.5;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, #FF7043, #E91E63);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 18px 48px;
  font-size: 1.4rem;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(233,30,99,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover  { transform: translateY(-3px) scale(1.04); box-shadow: 0 10px 28px rgba(233,30,99,0.5); }
.btn-primary:active { transform: translateY(0) scale(0.97); }
.btn-primary:disabled { background: #CCC; color: #666; cursor: not-allowed; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }

.btn-secondary {
  background: white;
  color: #E91E63;
  border: 3px solid #E91E63;
  border-radius: 50px;
  padding: 15px 36px;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.btn-secondary:hover { background: #fce4ec; transform: translateY(-2px); }

.btn-back {
  background: rgba(255,255,255,0.7);
  border: 2px solid #ddd;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn-back:hover { background: white; transform: translateY(-2px); }

/* ===== SCREEN HEADER ===== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 16px;
}

.screen-header h2 {
  flex: 1;
  text-align: center;
  font-size: 2rem;
  color: #333;
}

/* ===== LEARNING SECTION ===== */
.learn-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stage-label {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  text-align: center;
}

.clock-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.interactive-clock {
  width: clamp(250px, 90vw, 400px);
  height: clamp(250px, 90vw, 400px);
  cursor: pointer;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.interactive-clock line, .interactive-clock circle {
  transition: stroke 0.1s, fill 0.1s;
}

.time-display {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1976D2;
  margin: 16px 0;
}

.examples-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.example-item {
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.example-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.example-clock {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.example-text {
  flex: 1;
}

.example-time {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
}

.example-label {
  font-size: 0.9rem;
  color: #666;
}

.learn-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-continue {
  align-self: center;
  margin-top: 16px;
}

/* ===== HAND SELECTOR ===== */
.clock-with-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hand-selector {
  display: flex;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
}

.hand-btn {
  padding: 12px 24px;
  border-radius: 50px;
  border: 3px solid #DDD;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  background: #F0F0F0;
  color: #888;
  transition: all 0.2s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.hand-btn.hour-btn.active {
  background: #FFAB91;
  border-color: #FF7043;
  color: #BF360C;
}

.hand-btn.minute-btn.active {
  background: #81D4FA;
  border-color: #0288D1;
  color: #01579B;
}

/* ===== QUIZ SECTION ===== */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-info {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

.quiz-scores {
  display: flex;
  gap: 12px;
}

.score-badge, .highscore-badge {
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
}

.score-badge {
  background: #A5D6A7;
  color: #2E7D32;
}

.highscore-badge {
  background: #FFF176;
  color: #F57F17;
}

.quiz-question-area {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.quiz-question {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.quiz-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.quiz-answers {
  display: grid;
  gap: 12px;
}

.answer-option {
  background: #F5F5F5;
  border: 2px solid #DDD;
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.15s;
}
.answer-option:hover { background: #E8F5E9; border-color: #43A047; }
.answer-option.selected { background: #C8E6C9; border-color: #43A047; }
.answer-option.correct { background: #A5D6A7; border-color: #2E7D32; color: white; }
.answer-option.incorrect { background: #FFCDD2; border-color: #C62828; color: white; }

.quiz-feedback {
  background: #F3E5F5;
  padding: 16px;
  border-radius: 12px;
  font-size: 1.1rem;
  border-left: 4px solid #9C27B0;
}
.quiz-feedback.hidden { display: none; }

.quiz-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-hint {
  background: #81D4FA;
  color: #0277BD;
  border: 2px solid #0277BD;
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  flex: 1;
  transition: all 0.15s;
}
.btn-hint:hover { background: #4FC3F7; }
.btn-hint:disabled { background: #CCC; color: #666; cursor: not-allowed; border-color: #CCC; }

.btn-next {
  background: linear-gradient(135deg, #43A047, #2E7D32);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  flex: 1;
  transition: all 0.15s;
}
.btn-next:hover { transform: translateY(-2px); }
.btn-next.hidden { display: none; }

.hint-box {
  background: #E3F2FD;
  padding: 16px;
  border-radius: 12px;
  border-left: 4px solid #1976D2;
  font-size: 1rem;
  color: #0D47A1;
  margin-top: 12px;
}
.hint-box.hidden { display: none; }

.quiz-result {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.quiz-result.hidden { display: none; }

.result-content {
  background: white;
  padding: 32px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.result-mascot {
  font-size: 4rem;
  margin-bottom: 16px;
}

.result-content h2 {
  font-size: 2.2rem;
  color: #333;
  margin-bottom: 16px;
}

.result-score-text, .result-highscore-text {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 8px;
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .screen { padding: 16px; }
  .screen-header { margin-bottom: 20px; }
  .screen-header h2 { font-size: 1.5rem; }
  .quiz-header { flex-direction: column; }
  .quiz-info { order: 2; width: 100%; }
  .btn-back { order: 1; width: 100%; }
  .quiz-scores { order: 3; width: 100%; justify-content: space-around; }
}
