/* Kid Zone: a sunny Caribbean sky full of bouncy, colourful game cards. */
.kz {
  position: relative; isolation: isolate; overflow: hidden;
  width: min(1080px, calc(100vw - 24px)); margin: 6px 0 24px calc(50% - min(540px, calc(50vw - 12px)));
  border-radius: 32px; padding: clamp(18px, 4vw, 40px) clamp(14px, 3vw, 32px) 96px;
  background: linear-gradient(180deg, #3EC1F3 0%, #8FDCFA 45%, #FFF3A6 100%);
  box-shadow: 0 0 0 6px #fff, 0 18px 40px rgba(20, 60, 120, 0.25);
  font-family: 'Baloo 2', 'Work Sans', system-ui, sans-serif; color: #10305A;
}

/* ---------- Sky ---------- */
.kz-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.kz-sun { position: absolute; top: -40px; right: -30px; width: 200px; height: 200px; }
.kz-sun::before { content: ""; position: absolute; inset: 45px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #FFF6B0, #FFC400 60%, #FF9F00);
  box-shadow: 0 0 40px 10px rgba(255, 200, 0, 0.55); }
.kz-sun i { position: absolute; inset: 0; border-radius: 50%; animation: kz-spin 18s linear infinite;
  background: repeating-conic-gradient(rgba(255, 214, 0, 0.55) 0 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 52px, #000 53px, #000 98px, transparent 100px);
          mask: radial-gradient(circle, transparent 52px, #000 53px, #000 98px, transparent 100px); }
.kz-cloud { position: absolute; width: 150px; height: 46px; background: #fff; border-radius: 46px; opacity: .92; animation: kz-drift linear infinite; }
.kz-cloud::before, .kz-cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.kz-cloud::before { width: 64px; height: 64px; left: 22px; top: -30px; }
.kz-cloud::after { width: 82px; height: 82px; left: 62px; top: -42px; }
.kz-cloud-1 { top: 70px; animation-duration: 46s; animation-delay: -10s; }
.kz-cloud-2 { top: 210px; transform: scale(.7); animation-duration: 60s; animation-delay: -35s; opacity: .8; }
.kz-cloud-3 { top: 140px; transform: scale(.55); animation-duration: 38s; animation-delay: -22s; opacity: .7; }
.kz-balloon { position: absolute; left: var(--x); bottom: -120px; width: 46px; height: 58px; border-radius: 50% 50% 48% 48%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.8) 0 8%, var(--c) 30%); opacity: .85;
  animation: kz-rise var(--d) linear var(--delay) infinite; }
.kz-balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 46px; background: rgba(16, 48, 90, 0.35); }
.kz-twinkle { position: absolute; left: var(--x); top: var(--y); font-size: 24px; animation: kz-twinkle 2.4s ease-in-out var(--delay) infinite; }
.kz-grass { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; z-index: -1;
  background:
    radial-gradient(60px 40px at 10% 100%, #3FBF4F 98%, transparent) ,
    radial-gradient(80px 46px at 32% 100%, #34B048 98%, transparent),
    radial-gradient(70px 44px at 55% 100%, #3FBF4F 98%, transparent),
    radial-gradient(90px 50px at 78% 100%, #34B048 98%, transparent),
    radial-gradient(60px 40px at 96% 100%, #3FBF4F 98%, transparent),
    linear-gradient(#3FBF4F, #2E9E3F) bottom / 100% 30px no-repeat; }

/* ---------- Header ---------- */
.kz-head { position: relative; text-align: center; margin-bottom: 22px; }
.kz-back { position: absolute; left: 0; top: 0; text-decoration: none; font-weight: 800; color: #10305A; background: #fff; padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(16, 48, 90, 0.15); }
.kz-title { margin: 34px 0 4px; font-size: clamp(54px, 13vw, 104px); font-weight: 800; line-height: 1; letter-spacing: .02em; }
.kz-letter { display: inline-block; color: #fff; animation: kz-bob 1.8s ease-in-out calc(var(--i) * .12s) infinite;
  -webkit-text-stroke: 3px #10305A; paint-order: stroke fill; text-shadow: 0 6px 0 #10305A; }
.kz-letter:nth-child(6n+1) { color: #FF5FA2; } .kz-letter:nth-child(6n+2) { color: #FFB800; } .kz-letter:nth-child(6n+3) { color: #2EC27E; }
.kz-letter:nth-child(6n+4) { color: #00B8D9; } .kz-letter:nth-child(6n+5) { color: #7C4DFF; } .kz-letter:nth-child(6n) { color: #FF8A00; }
.kz-gap { width: .35em; }
.kz-sub { margin: 10px auto 12px; max-width: 520px; font-size: clamp(18px, 4.4vw, 22px); font-weight: 700; color: #10305A; }
.kz-sound { font: inherit; font-weight: 800; font-size: 16px; padding: 8px 18px; border-radius: 999px; border: 3px solid #10305A; background: #fff; color: #10305A; cursor: pointer;
  box-shadow: 0 4px 0 #10305A; min-height: 44px; }
.kz-sound:active { transform: translateY(3px); box-shadow: 0 1px 0 #10305A; }

/* ---------- Cards ---------- */
.kz-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.kz-grid li { animation: kz-pop .6s cubic-bezier(.2, 1.6, .4, 1) calc(.08s * var(--i)) both; }
.kz-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; height: 100%;
  padding: 20px 14px 18px; border-radius: 28px; text-decoration: none; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 78%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000) 100%);
  border: 4px solid #fff; box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 60%, #000), 0 14px 24px rgba(16, 48, 90, 0.25);
  transition: transform .18s cubic-bezier(.2, 1.6, .4, 1), box-shadow .18s ease;
}
.kz-card::before { content: ""; position: absolute; left: -20%; right: -20%; top: -40%; height: 70%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.45), rgba(255,255,255,0) 70%); pointer-events: none; }
.kz-emoji { font-size: 64px; line-height: 1.1; filter: drop-shadow(0 4px 0 rgba(0,0,0,0.18)); animation: kz-wiggle 3s ease-in-out calc(.3s * var(--i)) infinite; }
.kz-name { font-size: 26px; font-weight: 800; line-height: 1.05; text-shadow: 0 3px 0 rgba(0,0,0,0.22); }
.kz-line { font-size: 16px; font-weight: 600; line-height: 1.25; opacity: .95; }
.kz-play { margin-top: 8px; font-weight: 800; font-size: 17px; color: var(--c); background: #fff; padding: 6px 18px; border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.18); filter: saturate(1.2) brightness(.85); }
@media (hover: hover) {
  .kz-card:hover { transform: translateY(-6px) rotate(-1.5deg) scale(1.03); }
  .kz-card:hover .kz-emoji { animation: kz-jelly .7s ease; }
}
.kz-card:active, .kz-card.kz-go { transform: translateY(6px) scale(.97); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 60%, #000), 0 6px 12px rgba(16, 48, 90, 0.25); }
.kz-card:focus-visible { outline: 5px solid #FFE600; outline-offset: 4px; }

/* Tap burst (kidzone.js) */
.kz-burst { position: fixed; z-index: 9999; font-size: 24px; pointer-events: none; animation: kz-burst .8s ease-out forwards; }

/* ---------- Motion ---------- */
@keyframes kz-spin { to { transform: rotate(360deg); } }
@keyframes kz-drift { from { left: -200px; } to { left: 110%; } }
@keyframes kz-rise { 0% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-55vh) rotate(4deg); } 100% { transform: translateY(-115vh) rotate(-4deg); } }
@keyframes kz-twinkle { 0%, 100% { transform: scale(.6) rotate(0); opacity: .3; } 50% { transform: scale(1.2) rotate(20deg); opacity: 1; } }
@keyframes kz-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@keyframes kz-pop { from { opacity: 0; transform: scale(.4) translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes kz-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg) scale(1.08); } 90% { transform: rotate(9deg) scale(1.08); } 95% { transform: rotate(-5deg); } }
@keyframes kz-jelly { 0% { transform: scale(1); } 30% { transform: scale(1.25, .8); } 50% { transform: scale(.85, 1.15); } 70% { transform: scale(1.08, .95); } 100% { transform: scale(1); } }
@keyframes kz-burst { from { opacity: 1; transform: translate(0, 0) scale(.6) rotate(0); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.3) rotate(var(--r)); } }

@media (max-width: 560px) {
  .kz { border-radius: 24px; padding-bottom: 84px; }
  .kz-back { position: static; display: inline-block; margin-bottom: 4px; }
  .kz-title { margin-top: 10px; }
  .kz-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kz-card { padding: 14px 8px; border-radius: 22px; border-width: 3px; }
  .kz-emoji { font-size: 48px; }
  .kz-name { font-size: 20px; }
  .kz-line { font-size: 14px; }
  .kz-sun { transform: scale(.7); transform-origin: top right; }
}
@media (prefers-reduced-motion: reduce) {
  .kz *, .kz *::before, .kz *::after { animation: none !important; transition: none !important; }
  .kz-balloon { display: none; }
}
