:root {
  --bg-color: #FAFAF7;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  --radius: 24px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --transition: all 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Prevent text selection and double-tap zoom on iOS */
  -webkit-user-select: none;
  user-select: none;
  /* Prevent double-tap zoom - allows single taps and panning */
  touch-action: manipulation;
  /* Remove tap highlight */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  /* Additional iOS zoom prevention */
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.parent-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.parent-link:hover {
  background: var(--border-color);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.card-emoji {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.card-desc {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 1rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

footer {
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-bottom: 2rem;
}

/* Allow text selection and input in form fields */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
}

/* Allow text selection in contenteditable areas */
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

/* Specific Mood Accents */
.mood-bored { background-color: #E0F2FE; }
.mood-sad { background-color: #F3E8FF; }
.mood-worried { background-color: #CCFBF1; }
.mood-frustrated { background-color: #FFEDD5; }
.mood-happy { background-color: #FEF9C3; }
.mood-curious { background-color: #DCFCE7; }

/* Coming Soon Style */
.card.coming-soon {
  opacity: 0.6;
  cursor: default;
}
.card.coming-soon:hover {
  transform: none;
}
.coming-soon-badge {
  font-size: 0.75rem;
  background: #E5E7EB;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

/* Primary & secondary buttons (games and modules) */
.btn-primary {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid #2563EB;
  background: #3B82F6;
  color: white;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover {
  background: #2563EB;
  transform: scale(1.02);
}

.btn-secondary {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
  transform: scale(1.02);
}

/* Interactive Modules Base */
.module-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
}

.module-header {
  text-align: center;
  margin-bottom: 2rem;
}
