/* A shelf of little toys. */
.games-search, #games-reload { display: none; }
.site-header { border: 2px solid #fff; box-shadow: 0 4px 0 #dbb7c9, 0 12px 24px #6d426426; }
.site-nav svg { display: inline-block; vertical-align: middle; width: 21px; height: 21px; margin-right: 6px; }
.site-header[data-section="juegos"] .games-search { display: flex; }
#music { font: 800 25px Baloo, sans-serif; }
#music[aria-pressed="true"] { background: #ffe68e; }
#replay { display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px; min-height: 48px; border: 2px solid #cf9db6; border-radius: 22px; color: #713c61; background: #fff5ea; font-weight: 700; }
#replay svg { width: 21px; height: 21px; }
.games-search #games-reload { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: #7f4c70; }
.games-search #games-reload svg { width: 19px; height: 19px; }
.site-header[data-section="juegos"] #games-reload { display: grid; place-items: center; }
.games-search {
  flex: 1; min-width: 110px; max-width: 195px; height: 46px; gap: 8px; padding: 0 12px;
  align-items: center; border: 2px solid #cfb9cc; border-radius: 24px; background: #fff;
}
.games-search > svg { width: 20px; height: 20px; flex: none; }
.games-search input { min-width: 0; width: 100%; border: 0; background: transparent; font: 600 16px Baloo, sans-serif; color: #52354e; }
.games-search input:focus { outline: 0; }
.games-search:focus-within { outline: 3px solid #74346b; }

.games-section { position: relative; isolation: isolate; padding: clamp(54px, 6vw, 86px) max(24px, calc((100% - 1190px) / 2)) clamp(66px, 7vw, 108px); background: #fbefd9; }
.games-sky { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 15% 8%, #fff9df, transparent 55%), linear-gradient(#ffe3c7, #f5d4d7 95%); }
.games-sky .cloud { position: absolute; width: 190px; height: 87px; opacity: .69; background: url('/assets/games-sky/cloud.svg') center / contain no-repeat; animation: drift 14s ease-in-out infinite alternate; }
.cloud--one { top: 5%; left: 5%; }
.cloud--two { right: 8%; top: 4%; }
.cloud--three { left: -70px; top: 48%; }
.cloud--four { right: -65px; top: 59%; }
.cloud--five { bottom: -45px; left: 35%; }
.games-heading { position: relative; margin: 0 auto clamp(28px, 4vw, 55px); text-align: center; }
.games-heading h2 { margin: 0; font-size: clamp(36px, 5.2vw, 71px); color: #71364f; line-height: 1.1; text-shadow: 0 4px #fff5db; }
.capsule-shelf { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(14px, 2.2vw, 30px); }
.game-card {
  --shell: #fff4df; --rim: #c59994; --top: #ffe9c5; --base: #f5bca0;
  display: block; min-width: 0; padding: 7px 7px 0; border-radius: 28px; border: 2px solid #fff7e8;
  background: var(--shell); box-shadow: 0 5px 0 var(--rim), 0 13px 17px -5px #7e486f45, inset 0 2px 2px #ffffff;
  transform-origin: 50% 85%; text-decoration: none; color: #583747; font-family: Baloo, sans-serif;
}
.game-card[hidden] { display: none; }
.game-card:focus-visible { outline: 4px solid #632768; outline-offset: 5px; }
.modas { --top: #fff0cc; --base: #f2c294; }
.squishy { --top: #ecf1cf; --base: #bcd9ae; }
.butter-squishy { --top: #fff1bb; --base: #f6be9d; }
.slime { --top: #e3f5d3; --base: #aad8c1; --rim: #83a898; }
.salon { --top: #ffead8; --base: #f0bab9; }
.helados { --top: #fff1c0; --base: #f1be95; --rim: #c79982; }
.pizarra { --top: #e7e7ff; --base: #b9b6e0; }
.letras { --top: #dff5f8; --base: #a9d4e1; }
.mascota { --top: #ffe3e4; --base: #e7b5cc; }
.capsule-shelf .game-card > img { object-fit: cover; }
.capsule-shelf .game-card > img, canvas[data-preview] {
  display: block; width: 100%; height: auto; aspect-ratio: 1.84; border-radius: 20px;
  background: radial-gradient(ellipse at 42% 12%, #fff8, transparent 63%), linear-gradient(150deg, var(--top), var(--base));
  box-shadow: inset 0 2px 4px #8c64852e; pointer-events: none;
}
.capsule-label { display: flex; justify-content: space-between; gap: 6px; align-items: center; min-height: 58px; padding: 5px 7px; }
.capsule-title { text-align: left; font-size: clamp(17px, 1.7vw, 25px); font-weight: 800; line-height: 1.03; }
.capsule-label b { display: grid; place-items: center; width: 33px; height: 32px; border-radius: 50%; background: #fff; color: #965170; font-size: 22px; box-shadow: 0 2px 0 #d6bca9; flex: none; }
.game-card:disabled { opacity: .55; }
.games-empty { text-align: center; margin: 30px auto 50px; }
.games-empty button { padding: 8px 22px; min-height: 48px; border: 2px solid #b6858c; border-radius: 28px; color: #5e354e; background: #fff9df; font-weight: 700; }
.game-bubble { position: fixed; width: 96px; height: 96px; z-index: 10050; border-radius: 50%; transform: translate(-50%,-50%) scale(.01); background: radial-gradient(circle at 32% 21%, #fff7dc, #ffd8de 52%, #d4baf4 90%); will-change: transform; }

.theater { min-height: min(730px, 100svh); }
.world { inset: -16px; will-change: transform; }
.world::after { animation: sky-light 17s ease-in-out infinite alternate; background: linear-gradient(180deg, #ffe0e34d, transparent 62%, #fff0e440); }
@keyframes sky-light { from { opacity: .42; } to { opacity: .95; } }
.sky-near { position: absolute; inset: -25px; z-index: -2; pointer-events: none; will-change: transform; }
.sky-near i { position: absolute; width: clamp(100px, 17vw, 235px); height: 22%; background: url('/assets/games-sky/cloud.svg') center / contain no-repeat; opacity: .82; animation: drift 15s ease-in-out infinite alternate; }
.sky-near i:nth-child(1) { top: 15%; left: -4%; }
.sky-near i:nth-child(2) { top: 24%; right: 3%; animation-delay: -9s; scale: .66; }
.sky-near i:nth-child(3) { top: 37%; left: 21%; animation-delay: -5s; scale: .47; opacity: .68; }
@keyframes drift { to { transform: translate(30px,-8px); } }
.stage-header { top: clamp(104px, 13.7svh, 136px); }
.stage-sparks { position: absolute; z-index: 8; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.theater .puppet { filter: none; will-change: transform; }
.theater .face { inset: 23.763% auto auto 37.109%; width: 28.32%; height: 12.37%; overflow: hidden; contain: paint; }
.theater .eyelids { animation: none; }
.theater .cube { transition: none; }
@media(max-width:930px) {
  .capsule-shelf { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .site-nav a { padding-inline: 9px; }
}
@media(max-width:720px) {
  .site-nav svg { width: 17px; margin-right: 3px; }
  .capsule-shelf { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .site-header[data-section="juegos"] { flex-wrap: wrap; gap: 5px; }
  .site-header[data-section="juegos"] .games-search { order: 3; height: 42px; flex: 1 0 100%; max-width: none; }
  #juegos { scroll-margin-top: 50px; }
}
@media (min-width: 601px) and (max-width: 900px) and (min-height: 800px) {
  .character-zone { bottom: max(315px, 32%); height: min(45svh, calc(100% - 540px)); }
  body:has(.site-header[data-section="theater"]) #pet-launch { width: 76px; }
}
@media(max-width:600px) {
  .theater { min-height: 560px; }
  .stage-header { top: 88px; }
  .character-zone { bottom: max(292px, 35%); height: min(41svh, 340px, calc(100% - 472px)); }
  .stage-platform { bottom: max(260px, 32%); }
  .speech { top: 13%; right: 65%; max-width: 102px; }

  body:has(.site-header[data-section="theater"]) #pet-launch {
    width: clamp(76px, 20vw, 92px);
  }
  body:has(.site-header[data-section="theater"]) #pet-launch span { font-size: 12px; padding-inline: 4px; }
  .capsule-label { min-height: 49px; padding: 4px 1px; }
  .capsule-label b { width: 23px; height: 24px; font-size: 16px; }
  .game-card { padding: 4px 4px 0; border-radius: 19px; }
  .capsule-shelf .game-card > img, .game-card canvas { border-radius: 14px; }
  .games-section { padding-inline: 15px; }
  .site-nav svg { display: none; }
  .sky-near i { height: 13%; }
}
@media (max-width: 600px) and (max-height: 680px) {
  .video-toy--wide, .video-toy--tall { bottom: 82px; }
  .stage-subscribe { bottom: 14px; min-height: 48px; }
  .character-zone { bottom: 255px; height: calc(100% - 425px); }
  .stage-platform { bottom: 235px; }
  .cube-button { bottom: 255px; }
}
@media(max-width:365px) {
  .site-controls .round-button, .site-controls .motion-toggle { width: 44px; height: 44px; min-height: 44px; }
  .site-nav a { min-width: 44px; }
}
@media (max-height: 650px) and (min-width: 601px) {
  .theater { min-height: 360px; }
  .site-header { top: 6px; min-height: 60px; padding-block: 6px; }
  .site-nav a { display: flex; align-items: center; justify-content: center; }
  .stage-header { top: 77px; }
  .stage-header h1 { font-size: 44px; }
  .character-zone { bottom: 19%; height: min(45%, calc(100% - 225px)); }
  .video-toy--wide { top: 37%; width: clamp(116px, 18vw, 180px); }
  .video-toy--tall { top: 32%; width: clamp(82px, 12vw, 120px); }
  .video-toy--tall .toy-display { aspect-ratio: 4/5; }
  .cube-button { left: 4%; bottom: 12px; }
  body:has(.site-header[data-section="theater"]) #pet-launch { width: 65px; }
  .stage-subscribe { bottom: 10px; min-height: 48px; padding: 4px 18px; font-size: 18px; }
}
@media (max-height: 450px) and (min-width: 601px) {
  .stage-header .brand-kicker { display: none; }
  .play-hint { clip-path: inset(50%); }
}
:root[data-motion="reduced"] .world::after, :root[data-motion="reduced"] .sky-near *, :root[data-motion="reduced"] .games-sky *, .is-paused .sky-near *, .is-paused .games-sky * { animation-play-state: paused; }
