/* 
  Theme: Sweet & Playful 
  Colors: Pastels (Pink, Yellow, Blue, Mint)
  Fonts: Rounded sans-serif (Quicksand/Fredoka)
*/

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

:root {
  --color-bg: #fff5f8;      /* Very light pink bg */
  --color-primary: #ff8fa3; /* Darker pink */
  --color-secondary: #ffccd5; /* Light pink */
  --color-accent: #80b918;    /* Green for correct */
  --color-error: #e01e37;     /* Red for wrong */
  --color-text: #4a4e69;
  --color-card: #ffffff;
  --color-gold: #ffb703;
  
  --font-main: 'Fredoka', sans-serif;
  --radius: 20px;
  --shadow: 0 10px 20px rgba(0,0,0,0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0.5em 0;
  color: var(--color-primary);
  text-align: center;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

/* --- Container --- */
.container {
  width: 90%;
  max-width: 600px;
  background: var(--color-card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

/* --- Onboarding --- */
.screen {
  display: none; /* Hidden by default */
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.input-name {
  font-size: 1.5rem;
  padding: 1rem;
  border: 3px solid var(--color-secondary);
  border-radius: var(--radius);
  width: 80%;
  text-align: center;
  color: var(--color-text);
  background: #fff;
}

.input-name:focus {
  border-color: var(--color-primary);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  font-size: 1.5rem;
  padding: 1rem 3rem;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: 0 5px 0 #e07a8e; /* 3D effect */
  transition: transform 0.1s;
}

.btn-primary:active {
  transform: translateY(5px);
  box-shadow: none;
}

/* --- Game HUD --- */
.hud {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.timer {
  background: #f0f0f0;
  padding: 0.5rem 1rem;
  border-radius: 15px;
}

/* --- Progress Cake Tin --- */
.progress-container {
  width: 100%;
  height: 30px;
  background: #eee;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 2px solid #ddd;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffccd5, #ff8fa3);
  transition: width 0.5s ease-out;
  border-radius: 15px;
}

.star-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  z-index: 2;
}

/* --- Question Card --- */
.question-text {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: #444;
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

@media (max-width: 500px) {
  .answers-grid {
    grid-template-columns: 1fr;
  }
}

.btn-answer {
  background: #fff;
  border: 3px solid var(--color-secondary);
  color: var(--color-text);
  font-size: 1.2rem;
  padding: 1rem;
  border-radius: 15px;
  transition: all 0.2s;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-answer:hover {
  background: #fff0f3;
  transform: scale(1.02);
}

.btn-answer.correct {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  animation: pulse 0.5s;
}

.btn-answer.wrong {
  background: var(--color-error);
  border-color: var(--color-error);
  color: white;
  animation: shake 0.4s;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* --- Review / Pause --- */
.review-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  text-align: center;
}

.review-overlay.active {
  display: flex;
}

.review-message {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 2rem;
}

/* --- Certificate --- */
.certificate {
  border: 10px double var(--color-gold);
  padding: 2rem;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.badge {
  font-size: 4rem;
  margin: 1rem 0;
}

.kid-name-display {
  font-size: 3rem;
  color: var(--color-primary);
  font-family: 'cursive', var(--font-main); /* Fallback */
  margin: 1rem 0;
}

.stats {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 2rem;
}

/* --- Admin --- */
.admin-container {
    max-width: 800px;
    margin: 2rem auto;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.form-group {
    margin-bottom: 1rem;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
}
.question-list {
    text-align: left;
}
.question-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

