:root {
  --font: 'Comic Sans MS', 'Trebuchet MS', 'Baloo 2', sans-serif;
  --bg-1: #a1e9ff;
  --bg-2: #ffd6f5;
  --accent: #ff6f61;
  --accent-dark: #e0503f;
  --card-bg: #ffffff;
  --text: #2c2c54;
  --radius: 24px;
}

body.child-jolien {
  --bg-1: #d6b3ff;
  --bg-2: #ffb3ec;
  --accent: #9b5de5;
  --accent-dark: #7a3fc0;
}

body.child-karlijn {
  --bg-1: #ffe08a;
  --bg-2: #ffb56b;
  --accent: #ff9500;
  --accent-dark: #d97c00;
}

body.child-suzan {
  --bg-1: #a8f0d1;
  --bg-2: #8fd9ff;
  --accent: #16a97c;
  --accent-dark: #0f8562;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  position: relative;
  display: flex;
  flex-direction: column;
}

body.scrollable {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-shape {
  position: absolute;
  opacity: 0.55;
  animation: floaty 14s ease-in-out infinite;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,0.08));
}

.bg-shape.s1 { top: 8%; left: 5%; font-size: 4.5rem; animation-duration: 12s; }
.bg-shape.s2 { top: 60%; left: 85%; font-size: 5.5rem; animation-duration: 16s; animation-delay: 1s; }
.bg-shape.s3 { top: 78%; left: 12%; font-size: 3.5rem; animation-duration: 10s; animation-delay: 2s; }
.bg-shape.s4 { top: 15%; left: 80%; font-size: 4rem; animation-duration: 15s; animation-delay: 0.5s; }
.bg-shape.s5 { top: 40%; left: 45%; font-size: 3rem; animation-duration: 18s; animation-delay: 3s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-28px) rotate(6deg); }
}

.app {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  height: 100%;
}

h1, h2, h3 { margin: 0; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  outline: none;
}

.btn {
  background: var(--accent);
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 14px 22px;
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--accent-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--accent-dark);
}

.btn.secondary {
  background: white;
  color: var(--accent-dark);
  box-shadow: 0 6px 0 #d6d6e6;
}
.btn.secondary:active { box-shadow: 0 2px 0 #d6d6e6; }

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 10px 0 rgba(0,0,0,0.08);
}

/* --- Topbar used inside games --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  flex-shrink: 0;
  z-index: 2;
}

.topbar .child-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  font-weight: bold;
  font-size: 1rem;
}

.child-badge .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: white;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.1); }

/* --- Help button --- */
.help-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffd23f;
  color: #6b4a00;
  font-size: 2rem;
  font-weight: bold;
  box-shadow: 0 6px 0 #cf9f00;
  z-index: 50;
  animation: pulse 2.2s ease-in-out infinite;
}
.help-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #cf9f00; }

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 50, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: white;
  border-radius: 28px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 14px 0 rgba(0,0,0,0.12);
  max-height: 80vh;
  overflow-y: auto;
}

.modal-box h2 { font-size: 1.6rem; margin-bottom: 10px; }
.modal-box p { font-size: 1.2rem; line-height: 1.5; }
.modal-box .emoji-big { font-size: 3.2rem; margin-bottom: 6px; }

/* Confetti */
.confetti-piece {
  position: fixed;
  top: -20px;
  width: 12px;
  height: 12px;
  z-index: 200;
  border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.9; }
}
