/* Kid Activities — mobile-only single page */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #33272d;
  --ink-soft: #7a6b73;
  --accent: #ff5d8f;
  --accent-dark: #e04477;
  --track: #f0e6ec;
}

html, body {
  height: 100%;
}

body {
  background: #ffffff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.app {
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Age selector ---------- */

.age-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
}

.age-label {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.age-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

#age-slider {
  width: 100%;
  margin-top: 8px;
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  background: transparent;
  touch-action: pan-y;
}

#age-slider:focus { outline: none; }
#age-slider:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 20px; }

#age-slider::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill, 20%), var(--track) var(--fill, 20%), var(--track) 100%);
}
#age-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 34px;
  height: 34px;
  margin-top: -11px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  box-shadow: 0 2px 8px rgba(51, 39, 45, 0.25);
}
#age-slider::-moz-range-track {
  height: 12px;
  border-radius: 6px;
  background: var(--track);
}
#age-slider::-moz-range-progress {
  height: 12px;
  border-radius: 6px;
  background: var(--accent);
}
#age-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  box-shadow: 0 2px 8px rgba(51, 39, 45, 0.25);
}

.age-ends {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- Stage: dice arena + activity card ---------- */

.stage {
  position: relative;
  flex: 1;
  min-height: 340px;
  display: flex;
  align-items: stretch;
}

.arena {
  position: absolute;
  inset: 0;
  perspective: 900px;
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.arena.gone {
  opacity: 0;
  transform: scale(0.88);
  pointer-events: none;
}

.die {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--die-size, 84px);
  height: var(--die-size, 84px);
  will-change: transform;
}

.cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.cube .f {
  position: absolute;
  inset: 0;
  border-radius: 18%;
  border: 3px solid rgba(51, 39, 45, 0.85);
  display: grid;
  place-items: center;
  backface-visibility: hidden;
}

.cube .f svg { width: 78%; height: 78%; display: block; }

/* ---------- Activity card ---------- */

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  overflow-y: auto;
  padding-bottom: 4px;
}

.card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.7s ease 0.15s, transform 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) 0.15s;
}

.card-art { width: 100%; }

.card-art svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
}

.card-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  padding: 0 4px;
}

.card-desc {
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 500;
  padding: 0 6px;
}

/* ---------- Roll button ---------- */

.roll-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 18px 24px;
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 0 var(--accent-dark), 0 10px 18px rgba(224, 68, 119, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.roll-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--accent-dark), 0 4px 10px rgba(224, 68, 119, 0.3);
}

.roll-btn:disabled {
  background: #cdbfc7;
  box-shadow: 0 6px 0 #b3a3ad;
  cursor: default;
  color: #fff;
}

/* ---------- Almond Fun mascot ---------- */

.almond-mark {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.almond-mark svg {
  width: 30px;
  height: 30px;
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .arena, .card, .card.show { transition-duration: 0.2s; }
}
