:root {
  --red: #ff4d4d;
  --orange: #ff9a1f;
  --yellow: #ffd60a;
  --green: #2ec45a;
  --blue: #2f8cff;
  --indigo: #5a4cff;
  --violet: #b14cff;
  --ink: #3a1d5c;
  --ink-soft: #5e4580;
  --line: #3a1d5c;
  --white: #ffffff;
  --shadow: 0 8px 0 var(--line);
  --font: "Chalkboard SE", "Comic Sans MS", "Marker Felt", "Trebuchet MS", "Segoe Print", sans-serif;
}

* { box-sizing: border-box; }

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.35;
  background: linear-gradient(180deg, #bfe9ff 0%, #e3f5ff 38%, #fff4fb 72%, #ffe9f4 100%);
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

body.home {
  position: relative;
  overflow-x: hidden;
}

button, a {
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

/* ---------- Sky with a big rainbow ---------- */
.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rainbow {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 1100px;
  height: 550px;
  transform: translateX(-50%);
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.band {
  position: absolute;
  left: 50%;
  bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border: 30px solid transparent;
  border-bottom: 0;
  transform: translateX(-50%);
}
.b1 { width: 1100px; height: 550px; border-color: var(--red); }
.b2 { width: 1040px; height: 520px; border-color: var(--orange); }
.b3 { width: 980px;  height: 490px; border-color: var(--yellow); }
.b4 { width: 920px;  height: 460px; border-color: var(--green); }
.b5 { width: 860px;  height: 430px; border-color: var(--blue); }
.b6 { width: 800px;  height: 400px; border-color: var(--indigo); }
.b7 { width: 740px;  height: 370px; border-color: var(--violet); }

.cloud {
  position: absolute;
  height: 46px;
  background: #fff;
  border-radius: 40px;
  opacity: 0.95;
}
.cloud:before, .cloud:after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud-a { width: 150px; top: 430px; left: 4%; }
.cloud-a:before { width: 60px; height: 60px; top: -30px; left: 24px; }
.cloud-a:after { width: 46px; height: 46px; top: -20px; left: 72px; }
.cloud-b { width: 150px; top: 430px; right: 4%; }
.cloud-b:before { width: 60px; height: 60px; top: -30px; left: 30px; }
.cloud-b:after { width: 46px; height: 46px; top: -20px; left: 80px; }
.cloud-c { width: 120px; top: 60px; left: 12%; opacity: 0.7; }
.cloud-c:before { width: 48px; height: 48px; top: -24px; left: 20px; }

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 40px 22px 16px;
}

.hero {
  text-align: center;
  margin-bottom: 26px;
}

.hello {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 20px;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 4px solid var(--line);
  border-radius: 999px;
}

.title {
  margin: 0;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.title .line {
  display: block;
  font-size: clamp(56px, 10vw, 96px);
  -webkit-text-stroke: 3px var(--line);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--line);
}

.title .line.big {
  margin-top: 6px;
  font-size: clamp(48px, 8.5vw, 84px);
  color: #fff;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--indigo), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  text-shadow: none;
  filter: drop-shadow(0 5px 0 var(--line));
}

.c1 { color: var(--red); }
.c2 { color: var(--orange); }
.c3 { color: var(--yellow); }
.c4 { color: var(--green); }
.c5 { color: var(--blue); }
.c6 { color: var(--indigo); }
.c7 { color: var(--violet); }

.tag {
  margin: 14px 0 0;
  font-size: 28px;
  font-weight: 700;
}

/* ---------- Game cards ---------- */
.game-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

.color-red    { --accent: var(--red); }
.color-orange { --accent: var(--orange); }
.color-yellow { --accent: var(--yellow); }
.color-green  { --accent: var(--green); }
.color-blue   { --accent: var(--blue); }
.color-indigo { --accent: var(--indigo); }
.color-violet { --accent: var(--violet); }

.game-card {
  flex: 1 1 340px;
  max-width: 560px;
  min-height: 200px;
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-template-areas:
    "emoji title"
    "emoji about"
    "emoji play";
  gap: 6px 18px;
  align-items: center;
  padding: 20px 22px 20px 18px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  border: 5px solid var(--line);
  border-top: 16px solid var(--accent, var(--violet));
  border-radius: 34px;
  box-shadow: var(--shadow);
}

a.game-card:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 var(--line);
}

.game-emoji {
  grid-area: emoji;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent, var(--violet));
  border: 5px solid var(--line);
  font-size: 64px;
  line-height: 1;
}

.game-title {
  grid-area: title;
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.05;
}

.game-about {
  grid-area: about;
  font-size: 22px;
  color: var(--ink-soft);
}

.play-pill {
  grid-area: play;
  justify-self: start;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  background: var(--accent, var(--violet));
  color: #fff;
  border: 4px solid var(--line);
  border-radius: 999px;
  padding: 6px 26px;
  font-size: 26px;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 0 var(--line);
}

/* "Games coming soon!" placeholder */
.soon-card {
  flex-basis: 100%;
  max-width: 640px;
  border-top: 5px solid var(--line);
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--indigo), var(--violet)) border-box;
  border: 12px solid transparent;
  box-shadow: 0 8px 0 var(--line), 0 0 0 4px var(--line);
}

.soon-card .game-emoji {
  background: conic-gradient(var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--indigo), var(--violet), var(--red));
  animation: bob 2.4s ease-in-out infinite;
}

.soon-stars {
  grid-area: play;
  font-size: 30px;
  letter-spacing: 0.1em;
}

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

/* ---------- Parade and footer ---------- */
.parade {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 34px 0 8px;
  padding: 0;
  font-size: 48px;
}

.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--ink);
  font-size: 20px;
  /* room at the bottom so the floating chat bubble never covers the footer */
  padding: 8px 12px 120px;
}

.foot p { margin: 0; }

.parent-note {
  margin: 10px auto 0;
  max-width: 640px;
  text-align: left;
}

.parent-note summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

.parent-note p {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .rainbow { transform: translateX(-50%) scale(0.6); transform-origin: top center; }
  .cloud-a, .cloud-b { top: 280px; }
  .game-card { grid-template-columns: 96px 1fr; }
  .game-emoji { width: 92px; height: 92px; font-size: 52px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .title .line { font-size: 52px; }
  .title .line.big { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  a.game-card:active { transform: none; }
  .soon-card .game-emoji { animation: none; }
}

/* White text is hard to read on yellow, so yellow cards get dark text. */
.color-yellow .play-pill {
  color: var(--ink);
  text-shadow: none;
}
