/* Kids Rainbow Universe video site. The base (brand, hero, buttons, headings) matches rainbowuniverse.games. */
@font-face {
  font-family: "Nunito";
  src: url(fonts/nunito.woff2) format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Brand colours, taken from the Kids Rainbow Universe logo. */
  --purple: #8663c3;
  --purple-deep: #6a4bab;
  --ink: #4a3a78;
  --ink-soft: #6f639a;
  --lavender: #e4e0fb;
  --lavender-soft: #f3f1ff;
  --paper: #fbfaff;
  --pink: #ef7fa2;
  --orange: #f2a064;
  --yellow: #e6b33b;
  --green: #63bd89;
  --blue: #5ea2df;
  --violet: #9a7bd6;
  --card: #ffffff;
  --radius: 28px;
  --shadow: 0 10px 0 rgba(124, 111, 208, .08), 0 18px 40px rgba(124, 111, 208, .18);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { width: min(1180px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  min-height: min(92svh, 900px);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  padding: calc(env(safe-area-inset-top, 0px) + 48px) var(--gutter) 150px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(ellipse 80% 70% at 50% 42%, #f1eeff 0%, #e4e0fb 55%, #d5d1f6 100%);
}


.hero-inner { max-width: 760px; display: grid; justify-items: center; gap: 18px; }
.brand { display: block; width: min(640px, 92vw); height: auto; overflow: visible; }
.logo {
  width: min(640px, 92vw);
  animation: pop-in 1s cubic-bezier(.3, 1.6, .5, 1) both, bob 5s ease-in-out 1s infinite;
}
.tagline {
  margin: 0;
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--purple);
  -webkit-text-stroke: 8px #fff;
  paint-order: stroke fill;
  text-wrap: balance;
  filter: drop-shadow(0 4px 5px rgba(124, 111, 208, .25));
  animation: rise-in .8s .25s ease-out both;
}
.sub {
  margin: 0;
  max-width: 34em;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 10px 20px;
  border-radius: 999px;
  text-wrap: balance;
  animation: rise-in .8s .4s ease-out both;
}
.sub span { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; animation: rise-in .8s .55s ease-out both; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font: 900 18px/1 var(--font);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-play {
  color: #fff;
  background: var(--purple);
  border: 4px solid #fff;
  box-shadow: 0 6px 0 var(--purple-deep), 0 12px 24px rgba(106, 75, 171, .3);
}
.btn-play:hover { transform: translateY(-2px); }
.btn-play:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--purple-deep), 0 6px 12px rgba(106, 75, 171, .3); }
.btn-play .arrow { font-size: 1.1em; }
.btn-soft { color: var(--purple); background: #fff; border: 4px solid #fff; box-shadow: 0 5px 0 rgba(124, 111, 208, .22); }
.btn-soft:hover { transform: translateY(-2px); }

/* cloud edge between the hero and the page */
.clouds { position: absolute; left: 0; right: 0; bottom: -1px; height: 120px; z-index: 0; }
.clouds svg { width: 100%; height: 100%; display: block; }

/* twinkles */
.twinkle {
  position: absolute;
  width: var(--s);
  height: var(--s);
  left: var(--x);
  top: var(--y);
  z-index: -1;
  background: var(--c);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: twinkle var(--t) ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(20deg); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.4) translateY(-30px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: -1deg; } 50% { translate: 0 -8px; rotate: 1deg; } }

/* ---------------- sections ---------------- */
section { padding-block: clamp(48px, 8vw, 96px); }
.section-head { text-align: center; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--purple);
  -webkit-text-stroke: 10px #fff;
  paint-order: stroke fill;
  filter: drop-shadow(0 5px 6px rgba(124, 111, 208, .25));
}
.section-head h2::after {
  content: "";
  display: block;
  width: 120px;
  height: 8px;
  margin: 14px auto 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #f9b8ce, #fcceb3, #fde6a4, #bfe5cd, #bcd4f3, #d8c8f5);
}
.section-head p { margin: 0 auto; max-width: 36em; color: var(--ink-soft); font-size: clamp(16px, 2vw, 19px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--purple); background: var(--lavender-soft); }

/* soft clouds drifting slowly across the hero sky */
.drift-cloud { position: absolute; z-index: -1; width: var(--w); top: var(--y); left: -30%; opacity: .75; animation: float-by var(--t) linear infinite; animation-delay: var(--d); }
.drift-cloud path { fill: #fff; }
@keyframes float-by { to { transform: translateX(160vw); } }
.btn-yt { color: #fff; background: var(--pink); border: 4px solid #fff; box-shadow: 0 6px 0 #c95a7e, 0 12px 24px rgba(201, 90, 126, .28); }
.btn-yt:hover { transform: translateY(-2px); }
.btn-yt:active { transform: translateY(4px); box-shadow: 0 2px 0 #c95a7e; }
.btn-yt svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------------- breathe with me ---------------- */
.breathe { background: var(--paper); padding-top: clamp(24px, 4vw, 48px); }
.breathe-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(24px, 4vw, 48px);
  border-radius: calc(var(--radius) + 8px);
  background: radial-gradient(ellipse 90% 90% at 30% 50%, #f1eeff, #e4e0fb);
  box-shadow: var(--shadow);
}
@media (max-width: 720px) { .breathe-card { grid-template-columns: 1fr; text-align: center; } }
.breathe-card h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--purple);
  -webkit-text-stroke: 9px #fff;
  paint-order: stroke fill;
}
.breathe-card p { margin: 0 0 16px; color: var(--ink-soft); font-size: clamp(16px, 2vw, 18.5px); }
.bubble-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: min(340px, 100%);
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bubble {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 6px solid #fff;
  background: conic-gradient(from 200deg, #f9b8ce, #fcceb3, #fde6a4, #bfe5cd, #bcd4f3, #d8c8f5, #f9b8ce);
  box-shadow: 0 10px 30px rgba(124, 111, 208, .3), inset 0 -10px 30px rgba(255, 255, 255, .5);
  transform: scale(.6);
  transition: transform 1s cubic-bezier(.45, 0, .55, 1);
}
.bubble-stage[data-phase="idle"] .bubble { animation: breathe-idle 5s ease-in-out infinite; }
.bubble-stage[data-phase="in"] .bubble { transform: scale(1); transition-duration: 4s; }
.bubble-stage[data-phase="hold"] .bubble { transform: scale(1); }
.bubble-stage[data-phase="out"] .bubble { transform: scale(.6); transition-duration: 6s; }
@keyframes breathe-idle { 0%, 100% { transform: scale(.6); } 50% { transform: scale(.68); } }
.bubble-stage:focus-visible { outline: none; }
.bubble-stage:focus-visible .bubble { outline: 5px solid var(--blue); outline-offset: 6px; }
.bubble-word {
  position: relative;
  z-index: 1;
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 900;
  color: var(--purple);
  -webkit-text-stroke: 8px #fff;
  paint-order: stroke fill;
  text-align: center;
  line-height: 1.1;
}
.breath-count { color: var(--ink-soft); font-size: 15px; margin: 0 !important; min-height: 1.5em; }

/* ---------------- videos ---------------- */
.videos { background: var(--paper); }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -12px 0 28px; }
.filter {
  padding: 9px 18px;
  border-radius: 999px;
  border: 3px solid #fff;
  font: 800 15px/1 var(--font);
  color: var(--purple);
  background: var(--lavender-soft);
  box-shadow: 0 3px 0 rgba(124, 111, 208, .18);
  cursor: pointer;
}
.filter[aria-pressed="true"] { color: #fff; background: var(--purple); }
.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(18px, 3vw, 30px);
}
.video {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.video:hover { transform: translateY(-5px) rotate(-.3deg); }
.thumb { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; aspect-ratio: 16 / 9; overflow: hidden; background: #e4e0fb; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.video:hover .thumb img { transform: scale(1.04); }
.play-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  translate: -50% -50%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 18px rgba(59, 35, 82, .25);
  transition: scale .2s;
}
.play-dot::after { content: ""; position: absolute; inset: 0; margin: auto; translate: 3px 0; width: 0; height: 0; border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent var(--pink); }
.thumb:hover .play-dot, .thumb:focus-visible .play-dot { scale: 1.12; }
.thumb:focus-visible { outline: 5px solid var(--blue); outline-offset: -5px; }
.video .body { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 20px; flex: 1; }
.video h3 { margin: 0; font-size: 21px; font-weight: 900; line-height: 1.2; color: var(--purple); }
.video p { margin: 0; color: var(--ink-soft); font-size: 15.5px; flex: 1; }
.chip.soft { color: var(--ink-soft); background: #f4f2fa; font-weight: 700; }
.ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: var(--purple);
  background: rgba(255, 255, 255, .95);
}
.ribbon.new { color: #fff; background: var(--pink); border: 3px solid #fff; }
@media (min-width: 820px) {
  .video.latest { grid-column: 1 / -1; display: grid; grid-template-columns: 1.5fr 1fr; }
  .video.latest .body { padding: clamp(24px, 3vw, 40px); justify-content: center; gap: 12px; }
  .video.latest h3 { font-size: clamp(26px, 3vw, 36px); }
  .video.latest p { flex: 0; font-size: 17px; }
  .video.latest .play-dot { width: 88px; height: 88px; }
}
.more { display: flex; justify-content: center; margin-top: clamp(28px, 4vw, 40px); }

/* the "first videos are coming" card, shown while the channel has no public videos */
.coming {
  display: none;
  justify-items: center;
  gap: 14px;
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 44px);
  text-align: center;
  border-radius: calc(var(--radius) + 8px);
  background: #fff;
  box-shadow: var(--shadow);
}
.videos[data-count="0"] .coming { display: grid; }
.videos[data-count="0"] .more, .videos[data-count="0"] .filters, .videos[data-count="0"] .video-list { display: none; }
.coming img { width: 120px; height: 120px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 8px 20px rgba(124, 111, 208, .3); }
.coming h3 { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 900; color: var(--purple); }
.coming p { margin: 0; color: var(--ink-soft); font-size: 17px; }

/* ---------------- calm moments ---------------- */
.moments { background: radial-gradient(ellipse 80% 90% at 50% 40%, #f1eeff, #e4e0fb); }
.moment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: clamp(14px, 2vw, 22px); }
.moment { background: rgba(255, 255, 255, .88); border-radius: var(--radius); padding: 26px 22px 24px; text-align: center; box-shadow: 0 8px 0 rgba(59, 35, 82, .05); }
.moment svg { width: 96px; height: 96px; margin: 0 auto 10px; display: block; overflow: visible; filter: drop-shadow(0 6px 6px rgba(124, 111, 208, .22)); }
.moment h3 { margin: 0 0 6px; font-size: 21px; font-weight: 900; color: var(--purple); }
.moment p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* ---------------- for grown-ups ---------------- */
.grownups .list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 18px; }
.point { position: relative; background: #fff; border-radius: 22px; padding: 22px 22px 22px 70px; box-shadow: 0 8px 0 rgba(59, 35, 82, .05), 0 12px 30px rgba(124, 111, 208, .1); }
.point::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--c, var(--purple)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 3px 0 rgba(124, 111, 208, .25);
}
.point:nth-child(4n+1)::before { --c: var(--pink); }
.point:nth-child(4n+2)::before { --c: var(--blue); }
.point:nth-child(4n+3)::before { --c: var(--green); }
.point:nth-child(4n+4)::before { --c: var(--orange); }
.point h3 { margin: 0 0 4px; font-size: 19px; font-weight: 900; color: var(--purple); }
.point p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* ---------------- our games ---------------- */
.games-promo { padding-top: 0; }
.promo {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  border-radius: calc(var(--radius) + 8px);
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.promo:hover { transform: translateY(-5px); }
.promo img { width: 100%; height: 100%; object-fit: cover; }
.promo .body { display: grid; align-content: center; gap: 12px; padding: clamp(24px, 4vw, 44px); }
.promo .kicker { margin: 0; font-size: 14px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--pink); }
.promo h2 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); font-weight: 900; line-height: 1.1; color: var(--purple); }
.promo p { margin: 0; color: var(--ink-soft); font-size: 17px; }
.promo .btn { justify-self: start; }
@media (max-width: 720px) { .promo { grid-template-columns: 1fr; } .promo img { aspect-ratio: 4 / 3; } }

/* ---------------- player ---------------- */
.player {
  width: min(1100px, calc(100vw - 24px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
}
.player::backdrop { background: rgba(58, 42, 110, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.player .frame { position: relative; aspect-ratio: 16 / 9; max-height: calc(100svh - 110px); margin-inline: auto; border-radius: 24px; overflow: hidden; background: #2a2150; border: 5px solid #fff; box-shadow: 0 20px 60px rgba(20, 10, 60, .45); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.player .now { margin: 0; color: #fff; font-size: clamp(17px, 2.2vw, 22px); font-weight: 900; text-shadow: 0 2px 6px rgba(20, 10, 60, .5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .close {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--pink);
  color: #fff;
  font: 900 26px/1 var(--font);
  cursor: pointer;
  box-shadow: 0 4px 0 #c95a7e;
}

/* ---------------- footer ---------------- */
footer {
  padding: 40px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 40px);
  text-align: center;
  color: var(--ink-soft);
  background: radial-gradient(ellipse 80% 120% at 50% 0%, #f1eeff, #e4e0fb);
}
footer .brand { width: 220px; margin: 0 auto 12px; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 8px; font-weight: 700; }
footer p { margin: 0; font-size: 14px; }

/* ---------------- plain pages (privacy) ---------------- */
.page-top {
  position: relative;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) var(--gutter) 90px;
  text-align: center;
  background: radial-gradient(ellipse 80% 90% at 50% 40%, #f1eeff, #d9d5f7);
  overflow: hidden;
}
.page-top .brand { width: min(340px, 72vw); margin: 0 auto; }
.prose { max-width: 720px; margin: 0 auto; padding: 40px var(--gutter) 64px; font-size: 17px; }
.prose h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 900; color: var(--purple); line-height: 1.1; margin: 0 0 8px; }
.prose h2 { font-size: 23px; font-weight: 900; color: var(--purple); margin: 32px 0 6px; }
.prose p, .prose li { color: var(--ink); font-weight: 500; }
.prose .updated { color: var(--ink-soft); margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .drift-cloud { display: none; }
  html { scroll-behavior: auto; }
  /* the breathing bubble is slow and started by the child, so it keeps its motion */
  .bubble-stage[data-phase="in"] .bubble { transition: transform 4s cubic-bezier(.45, 0, .55, 1) !important; }
  .bubble-stage[data-phase="out"] .bubble { transition: transform 6s cubic-bezier(.45, 0, .55, 1) !important; }
}
