/* ============================================================
   CINNAMOROLL LAND · CAPA VISUAL v29
   Se carga después de styles.css. Solo estilos: centra pantallas,
   rediseña el menú, enmarca los juegos inmersivos y suma animación.
   ============================================================ */

:root {
  --sky-1: #bfe3ff;
  --sky-2: #e8f4ff;
  --blush: #ffe3f0;
  --lilac: #efe6ff;
  --card-radius: 28px;
  --soft-shadow: 0 10px 0 rgba(107, 143, 199, 0.18), 0 22px 40px rgba(75, 95, 143, 0.16);
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 1. CENTRADO DE PANTALLAS (Números, Memorice, Dibujo...) ---------- */
#math-mount, #coloring-mount, #memory-mount, #writing-mount, #puzzle-mount {
  align-items: center;
}
.math-wrap, .memory-wrap, .color-studio-wrap {
  margin-inline: auto;
}
@media (min-width: 1100px) {
  .math-wrap { max-width: 860px; }
  .memory-wrap { max-width: 780px; }
}

/* Fondo de pantallas con lunares suaves en vez de color plano */
#screen-math, #screen-memory, #screen-coloring, #screen-writing, #screen-puzzle {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.7) 2px, transparent 2.5px),
    linear-gradient(180deg, var(--blush) 0%, var(--sky-2) 100%);
  background-size: 28px 28px, 100% 100%;
}
#screen-memory {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.75) 2px, transparent 2.5px),
    linear-gradient(180deg, var(--lilac) 0%, #fff0f7 100%);
}

/* ---------- 2. BARRA SUPERIOR MÁS LIMPIA ---------- */
#globalTopBar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  border-bottom: none;
  box-shadow: 0 6px 18px rgba(107, 143, 199, 0.16);
}
.top-brand {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, #6b8fc7, #e8679f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top-brand-img {
  width: 44px; height: 24px; object-fit: contain;
  animation: v29Float 3s ease-in-out infinite;
}
.top-right-actions { display: flex; align-items: center; gap: 8px; }
.top-nav-btn {
  transition: transform 0.18s var(--pop), box-shadow 0.18s;
}
.top-nav-btn:hover { transform: translateY(-2px); }
.top-nav-btn:active { transform: translateY(2px) scale(0.96); }

/* Botones secundarios solo con ícono: menos texto para una niña que aún aprende a leer.
   El "title" sigue mostrando el nombre al pasar el mouse. */
.top-right-actions .fullscreen-btn .btn-text,
.top-right-actions .gamepad-btn .btn-text,
.top-right-actions .music-btn .btn-text,
.top-right-actions .track-btn .btn-text {
  display: none;
}
.top-right-actions .fullscreen-btn,
.top-right-actions .gamepad-btn,
.top-right-actions .music-btn,
.top-right-actions .track-btn {
  width: 46px; height: 46px; padding: 0; justify-content: center;
}
.top-right-actions .btn-icon { font-size: 22px; line-height: 1; }

/* El indicador Touch/Mando queda como un puntito con ícono */
.input-mode-badge {
  font-size: 0 !important;
  width: 34px; height: 34px; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.input-mode-badge #inputModeIcon { font-size: 16px; }

/* Avisos de sticker: abajo al centro para no tapar los botones del juego */
body .coop-banner-toast {
  top: auto;
  bottom: 22px;
  transform: translateX(-50%) translateY(30px) scale(0.9);
}
body .coop-banner-toast.visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ---------- 3. MENÚ PRINCIPAL ---------- */
#screen-hub {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 255, 255, 0.85), transparent 60%),
    linear-gradient(180deg, #a9d8ff 0%, #d7ecff 45%, #ffe6f2 100%);
}
.hub-sky {
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 0;
}
.hub-header, .game-cards-grid { position: relative; z-index: 1; }

.sky-cloud {
  position: absolute; display: block;
  width: 180px; height: 56px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(0.5px);
  animation: v29Drift linear infinite;
}
.sky-cloud::before, .sky-cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.sky-cloud::before { width: 80px; height: 80px; left: 26px; top: -40px; }
.sky-cloud::after { width: 104px; height: 104px; left: 70px; top: -58px; }
.sky-cloud.c1 { top: 70px; animation-duration: 70s; animation-delay: -10s; }
.sky-cloud.c2 { top: 260px; transform: scale(0.7); opacity: 0.7; animation-duration: 95s; animation-delay: -60s; }
.sky-cloud.c3 { top: 520px; transform: scale(1.2); opacity: 0.6; animation-duration: 120s; animation-delay: -30s; }
.sky-cloud.c4 { top: 820px; transform: scale(0.85); opacity: 0.7; animation-duration: 85s; animation-delay: -45s; }

.sky-spark {
  position: absolute; color: #fff; font-size: 18px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
  animation: v29Twinkle 2.8s ease-in-out infinite;
}
.sky-spark.s1 { top: 40px; left: 12%; }
.sky-spark.s2 { top: 150px; right: 14%; animation-delay: -0.8s; font-size: 22px; }
.sky-spark.s3 { top: 360px; left: 6%; animation-delay: -1.6s; }
.sky-spark.s4 { top: 600px; right: 6%; animation-delay: -0.4s; font-size: 14px; }
.sky-spark.s5 { top: 110px; left: 46%; animation-delay: -2.1s; font-size: 12px; }

.hub-header h1 {
  background: linear-gradient(90deg, #47689e 0%, #6b8fc7 40%, #e8679f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.9));
}
.cinna-mascot-box { width: 190px; height: 104px; }

.game-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
  max-width: 1120px;
  padding: 0 4px 10px;
}

.game-card {
  border-radius: var(--card-radius);
  padding: 12px 12px 16px;
  box-shadow: var(--soft-shadow);
  transition: transform 0.25s var(--pop), box-shadow 0.25s;
  animation: v29CardIn 0.55s var(--pop) backwards;
  overflow: hidden;
}
.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.07s; }
.game-card:nth-child(3) { animation-delay: 0.12s; }
.game-card:nth-child(4) { animation-delay: 0.17s; }
.game-card:nth-child(5) { animation-delay: 0.22s; }
.game-card:nth-child(6) { animation-delay: 0.27s; }
.game-card:nth-child(7) { animation-delay: 0.32s; }
.game-card:nth-child(8) { animation-delay: 0.37s; }
.game-card:nth-child(9) { animation-delay: 0.42s; }

.game-card:hover, .game-card:focus-visible {
  transform: translateY(-6px) rotate(-0.6deg);
  box-shadow: 0 14px 0 rgba(107, 143, 199, 0.2), 0 28px 46px rgba(75, 95, 143, 0.22);
}
.game-card:active { transform: translateY(3px) scale(0.98); }

/* Ilustración: banda ancha con el personaje del juego */
.card-illustration {
  width: 100%; height: 138px;
  border-radius: 22px;
  margin: 0 0 12px;
  overflow: hidden;
  isolation: isolate;
}
.card-illustration::before {
  /* lunares y brillo superior */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(rgba(255, 255, 255, 0.45) 2px, transparent 2.5px) 0 0 / 18px 18px,
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 60%);
}
.card-illustration::after {
  /* nube-suelo donde se para el personaje */
  content: ''; position: absolute; left: 50%; bottom: -34px;
  width: 78%; height: 62px; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.75); border-radius: 50%;
  z-index: -1;
}
.card-avatar .card-illustration { background: linear-gradient(135deg, #ffe4f1, #e9d5ff); }
.card-flight .card-illustration { background: linear-gradient(135deg, #d6ecff, #8ec2ff); }
.card-math .card-illustration { background: linear-gradient(135deg, #ffe9f2, #ffb8d6); }
.card-coloring .card-illustration { background: linear-gradient(135deg, #fff6d1, #ffd76a); }
.card-memory .card-illustration { background: linear-gradient(135deg, #ece4ff, #bfa9ff); }
.card-platformer .card-illustration { background: linear-gradient(135deg, #e0fbe9, #8be6ae); }
.card-doom .card-illustration { background: linear-gradient(135deg, #ffe7d1, #ffb27a); }
.card-writing .card-illustration { background: linear-gradient(135deg, #ffe0ef, #f79ac8); }
.card-puzzle .card-illustration { background: linear-gradient(135deg, #dcf2ff, #7fcdf5); }

.card-hero-img {
  height: 112px; width: auto; max-width: 82%;
  object-fit: contain;
  margin-top: 14px;
  filter: drop-shadow(0 8px 10px rgba(75, 95, 143, 0.22));
  transition: transform 0.3s var(--pop);
  animation: v29Float 3.2s ease-in-out infinite;
}
.game-card:nth-child(even) .card-hero-img { animation-delay: -1.4s; }
.game-card:hover .card-hero-img { transform: scale(1.1) rotate(-3deg); }

/* El emoji pasa a ser una "pegatina" del tema del juego */
.card-hero-emoji {
  position: absolute; right: 12px; bottom: 10px;
  width: 44px; height: 44px; border-radius: 50%;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
  transform: rotate(8deg);
}
.card-deco { font-size: 22px; z-index: 1; }
.card-illustration .deco-star, .card-illustration .deco-cookie, .card-illustration .deco-sparkle { top: 12px; right: 14px; left: auto; bottom: auto; }
.card-illustration .deco-cloud, .card-illustration .deco-milk, .card-illustration .deco-flower { top: 12px; left: 14px; right: auto; bottom: auto; }
.card-illustration .card-deco { animation: v29Twinkle 2.6s ease-in-out infinite; }

.card-badge {
  z-index: 2; top: 20px; left: 22px;
  background: rgba(255, 255, 255, 0.92); border-color: #ffffff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06);
}
.card-avatar .card-badge { left: 22px; }
.game-card h2 { font-size: 22px; }
.game-card p { margin: 6px 6px 14px; min-height: 54px; }
.card-play-tag {
  margin-top: auto;
  position: relative; overflow: hidden;
}
.card-play-tag::after {
  /* destello que recorre el botón */
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: v29Shine 3.6s ease-in-out infinite;
}
.game-card:nth-child(3n+2) .card-play-tag::after { animation-delay: -1.2s; }
.game-card:nth-child(3n) .card-play-tag::after { animation-delay: -2.4s; }

/* Tarjeta destacada: ocupa dos columnas en pantallas anchas */
@media (min-width: 900px) {
  .game-card.card-avatar { grid-column: span 2; }
  .card-avatar .card-illustration { height: 160px; }
  .card-avatar .card-hero-img { height: 132px; }
}

/* ---------- 4. MEMORICE ---------- */
.memory-card-slot { transition: transform 0.2s var(--pop); }
.memory-card-slot:not(.flipped):not(.matched):hover { transform: translateY(-4px) rotate(-1deg); }
.card-inner { transition: transform 0.6s var(--pop); }

.card-back {
  background:
    radial-gradient(rgba(255, 255, 255, 0.55) 3px, transparent 3.5px) 0 0 / 20px 20px,
    radial-gradient(rgba(255, 255, 255, 0.35) 3px, transparent 3.5px) 10px 10px / 20px 20px,
    linear-gradient(145deg, #ffc2dc 0%, #c9b5ff 55%, #9fd0ff 100%);
  overflow: hidden;
}
.card-back::before {
  /* medallón con Cinnamoroll */
  content: '';
  width: 64%; aspect-ratio: 1; border-radius: 50%;
  background: #ffffff url('cinnamoroll_sprite.png') center 58% / 88% auto no-repeat;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.55), 0 6px 12px rgba(107, 80, 160, 0.25);
}
.card-back::after {
  /* brillo diagonal */
  content: ''; position: absolute; inset: -40%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.45) 50%, transparent 58%);
  animation: v29CardGleam 4.5s ease-in-out infinite;
}
.card-back-pattern { display: none; }
.card-back-sparkle { z-index: 1; animation: v29Twinkle 2s ease-in-out infinite; }

.memory-card-slot.matched .card-inner { animation: v29MatchHop 0.6s var(--pop) 0.55s both; }
@keyframes v29MatchHop {
  0% { transform: rotateY(180deg) scale(1); }
  45% { transform: rotateY(180deg) scale(1.12) translateY(-6px); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* ---------- 5. JUEGOS INMERSIVOS: lienzo grande y enmarcado ---------- */
#screen-platformer, #screen-doom {
  background:
    radial-gradient(rgba(255, 255, 255, 0.55) 2px, transparent 2.5px) 0 0 / 30px 30px,
    linear-gradient(180deg, #a9d8ff 0%, #ffe3f0 100%);
}
.platformer-wrapper, .doom-wrapper {
  container-type: size;
  padding: 0;
}
#platformerCanvas {
  width: min(100cqw - 16px, (100cqh - 16px) * 16 / 9);
  height: auto;
  max-width: none; max-height: none;
  border-radius: 22px;
  box-shadow: 0 0 0 5px #ffffff, 0 18px 40px rgba(75, 95, 143, 0.28);
}
#doomCanvas {
  width: min(100cqw - 16px, (100cqh - 16px) * 16 / 9);
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: none; max-height: none;
  border-radius: 22px;
  box-shadow: 0 0 0 5px #ffffff, 0 18px 40px rgba(75, 95, 143, 0.28);
}
/* Fallback para navegadores sin container queries */
@supports not (width: 1cqw) {
  #platformerCanvas, #doomCanvas { width: 100%; max-height: 100%; }
}

#screen-flight canvas#game { cursor: pointer; }

#screen-avatar {
  background:
    radial-gradient(rgba(255, 255, 255, 0.55) 2px, transparent 2.5px) 0 0 / 30px 30px,
    linear-gradient(180deg, #bfe3ff 0%, #ffe6f2 100%);
}
.avatar-world-shell canvas {
  border-radius: 22px;
}

/* ---------- 6. CAPA DE CONFETI (js/fx.js) ---------- */
.cinna-fx-layer {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 20000;
}

/* ---------- Botones y píldoras con rebote al tocar ---------- */
.diff-btn, .btn-change-hero, .modal-close-btn, .plat-btn, .doom-touch-btn, .doom-launch-big-btn {
  transition: transform 0.15s var(--pop);
}
.diff-btn:active, .btn-change-hero:active, .plat-btn:active, .doom-touch-btn:active, .doom-launch-big-btn:active {
  transform: scale(0.92);
}

/* ---------- ANIMACIONES ---------- */
@keyframes v29Float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes v29Drift {
  from { left: -260px; }
  to { left: 110%; }
}
@keyframes v29Twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.12); }
}
@keyframes v29CardIn {
  from { opacity: 0; transform: translateY(26px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes v29Shine {
  0%, 60% { left: -60%; }
  100% { left: 130%; }
}
@keyframes v29CardGleam {
  0%, 70% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 768px) {
  .top-brand { font-size: 0; }
  .top-brand-img { width: 40px; height: 22px; }
  .top-right-actions { gap: 5px; }
  .top-right-actions .fullscreen-btn,
  .top-right-actions .gamepad-btn,
  .top-right-actions .music-btn,
  .top-right-actions .track-btn { width: 40px; height: 40px; }
  .game-cards-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .card-illustration { height: 120px; }
  .card-hero-img { height: 96px; }
}
@media (max-width: 480px) {
  .input-mode-badge { display: none !important; }
  .game-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-card { padding: 8px 8px 12px; }
  .card-illustration { height: 96px; border-radius: 18px; }
  .card-hero-img { height: 76px; margin-top: 10px; }
  .card-hero-emoji { width: 32px; height: 32px; font-size: 17px; right: 8px; bottom: 6px; }
  .card-badge { display: none; }
  .game-card h2 { font-size: 16px; }
  .game-card p { display: none; }
  .card-play-tag { font-size: 14px; padding: 5px 14px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .top-right-actions .fullscreen-btn,
  .top-right-actions .gamepad-btn,
  .top-right-actions .music-btn,
  .top-right-actions .track-btn { width: 36px; height: 36px; }
}

/* Movimiento reducido: sin animaciones decorativas */
@media (prefers-reduced-motion: reduce) {
  .sky-cloud, .sky-spark, .card-hero-img, .card-deco, .top-brand-img,
  .card-play-tag::after, .card-back::after, .card-back-sparkle,
  .game-card, .memory-card-slot.matched .card-inner {
    animation: none !important;
  }
}

/* Marcador del Super Run en una sola línea también en celular horizontal */
.plat-score-pill { white-space: nowrap; }

/* Contraste legible en las tarjetas (AA) y foco visible para teclado o mando */
.game-card p { color: #4a5a80; }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible {
  outline: 3px solid #f472b6; outline-offset: 3px;
}
@media (max-width: 480px) {
  .top-right-actions .passport-btn { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .wobble-friendly, .dance-bounce, .party-jump, .pop-counted, .math-level-up {
    animation: none !important;
  }
}

/* ============================================================
   v35 · ÍCONOS PROPIOS Y ESCENAS DIBUJADAS (sin emojis de relleno)
   ============================================================ */
.preloader-mascot { width: 150px; height: auto; font-size: 0; }

/* Barra superior: íconos vectoriales con color por botón */
.top-nav-btn .btn-icon.ci { font-size: 22px; }
#globalBtnHome .btn-icon { color: #6b8fc7; }
.passport-btn .btn-icon { color: #b7791f; font-size: 24px; }
.fullscreen-btn .btn-icon { color: #8b5cf6; }
.gamepad-btn .btn-icon { color: #3b82f6; font-size: 26px; }
.music-btn .btn-icon, .track-btn .btn-icon { color: #e8679f; }
.music-btn:not(.playing) .btn-icon { color: #94a3b8; }
.input-mode-badge #inputModeIcon.ci { font-size: 18px; color: #e8679f; }
.input-mode-badge.mode-remote #inputModeIcon.ci { color: #3b82f6; }
.modal-icon.ci { font-size: 40px; color: #3b82f6; }

.sky-spark.ci { color: transparent; text-shadow: none; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)); }
.sky-spark.ci .ci-svg { stroke: rgba(255, 255, 255, 0.6); }

/* Tarjetas del menú: escena ilustrada detrás del personaje */
.card-illustration { height: 150px; }
.card-illustration::before { z-index: 0; }
.card-illustration::after { z-index: 0; }
.hub-scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.card-hero-img, .card-hero-canvas, .card-puzzle-frame { position: relative; z-index: 1; }
.hs-twinkle { transform-box: fill-box; transform-origin: center; animation: v29Twinkle 2.8s ease-in-out infinite; }
.hs-twinkle:nth-of-type(2n) { animation-delay: -1.3s; }
.hs-bob { animation: none; }

.card-hero-canvas {
  height: 132px; width: auto; max-width: 92%;
  margin-top: 10px;
  filter: drop-shadow(0 8px 10px rgba(75, 95, 143, 0.2));
  animation: v29Float 3.2s ease-in-out infinite;
}

/* Puzzle: foto enmarcada con líneas de piezas y una pieza "levantada" */
.card-puzzle-frame {
  width: 150px; height: 104px; margin-top: 12px;
  border-radius: 14px; overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 8px 14px rgba(75, 95, 143, 0.25);
  transform: rotate(-4deg);
  animation: v29Float 3.2s ease-in-out infinite;
  background: #fff;
}
.card-puzzle-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-puzzle-frame::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent calc(33.3% - 1px), rgba(255, 255, 255, 0.85) calc(33.3% - 1px), rgba(255, 255, 255, 0.85) calc(33.3% + 1px), transparent calc(33.3% + 1px), transparent calc(66.6% - 1px), rgba(255, 255, 255, 0.85) calc(66.6% - 1px), rgba(255, 255, 255, 0.85) calc(66.6% + 1px), transparent calc(66.6% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.85) calc(50% - 1px), rgba(255, 255, 255, 0.85) calc(50% + 1px), transparent calc(50% + 1px));
}
.card-puzzle-gap {
  position: absolute; z-index: 1; right: 0; top: 0;
  width: 33.4%; height: 50%;
  background: repeating-linear-gradient(45deg, #dcf2ff 0 6px, #c7e9ff 6px 12px);
  box-shadow: inset 0 0 0 2px rgba(92, 61, 46, 0.15);
}

.card-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; padding: 3px 11px 3px 7px;
}
.card-badge .ci { font-size: 18px; color: #5c3d2e; }
.card-play-tag { display: inline-flex; align-items: center; gap: 8px; padding: 9px 24px 9px 18px; font-size: 18px; }
.card-play-tag .ci { font-size: 18px; color: #fff; }
.card-play-tag .ci .ci-svg .f { fill: #fff; }

.flight-btn-icon.ci { font-size: 28px; color: #0284c7; }
.btn-flight-spin .flight-btn-icon.ci { color: #db2777; }
.btn-flight-hello .flight-btn-icon.ci { color: #ea580c; }

@media (min-width: 900px) {
  .card-avatar .card-illustration { height: 170px; }
  .card-avatar .card-hero-canvas { height: 156px; }
}
@media (max-width: 768px) {
  .card-illustration { height: 128px; }
  .card-hero-canvas { height: 112px; }
  .card-puzzle-frame { width: 128px; height: 88px; }
}
@media (max-width: 480px) {
  .card-illustration { height: 104px; }
  .card-hero-canvas { height: 88px; }
  .card-puzzle-frame { width: 104px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-twinkle, .card-hero-canvas, .card-puzzle-frame { animation: none; }
}

/* ============================================================
   v35 · CINNAMOROLL WORLD: lienzo grande, flechas de cuarto y 2 botones
   ============================================================ */
#avatar-mount { padding: 10px; }
.aw-shell {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  container-type: size;
}
.aw-stage {
  position: relative;
  width: min(100cqw, 100cqh * 1000 / 560);
  aspect-ratio: 1000 / 560;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 0 0 5px #ffffff, 0 18px 40px rgba(75, 95, 143, 0.28);
  background: #fff5f7;
  user-select: none; -webkit-user-select: none;
}
@supports not (width: 1cqw) { .aw-stage { width: 100%; } }
#avatarWorldCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none; cursor: pointer;
  border-radius: 0;
}

/* Flechas grandes a los lados: cambian de cuarto */
.aw-door {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 2px;
  height: clamp(64px, 16cqh, 96px);
  padding: 0 10px;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  color: #6b8fc7;
  box-shadow: 0 6px 14px rgba(75, 95, 143, 0.18);
  transition: transform 0.18s var(--pop), background 0.2s;
  z-index: 3;
}
.aw-door-left { left: 0; border-radius: 0 999px 999px 0; padding-left: 4px; }
.aw-door-right { right: 0; border-radius: 999px 0 0 999px; padding-right: 4px; }
.aw-door:active { transform: translateY(-50%) scale(0.92); }
.aw-door-arrow { display: flex; font-size: clamp(30px, 6cqh, 44px); }
.aw-door-arrow .ci-svg { stroke-width: 3; }
.aw-door-room { display: flex; font-size: clamp(24px, 5cqh, 34px); color: #5c3d2e; }
.aw-door-left .aw-door-arrow { animation: awNudgeL 2.4s ease-in-out infinite; }
.aw-door-right .aw-door-arrow { animation: awNudgeR 2.4s ease-in-out infinite; }

/* Puntitos que muestran en qué cuarto estamos */
.aw-room-dots {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; padding: 6px 10px;
  background: rgba(255, 255, 255, 0.78); border-radius: 999px;
  box-shadow: 0 4px 10px rgba(75, 95, 143, 0.14);
  z-index: 3; pointer-events: none;
}
.aw-dot {
  display: flex; font-size: 20px; color: #94a3b8; opacity: 0.55;
  transition: transform 0.25s var(--pop), opacity 0.2s;
}
.aw-dot .ci-svg .f { fill: #e2e8f0; }
.aw-dot.active { opacity: 1; color: #5c3d2e; transform: scale(1.3); }
.aw-dot.active .ci-svg .f { fill: var(--ic-fill); }

/* Dos botones redondos: Juguetes (izq.) y Ropa (der.) */
.aw-fab {
  position: absolute; bottom: 14px;
  width: clamp(68px, 17cqh, 100px); height: clamp(68px, 17cqh, 100px);
  border-radius: 50%;
  border: 5px solid #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(36px, 9cqh, 54px);
  color: #5c3d2e; cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12), 0 12px 22px rgba(75, 95, 143, 0.25);
  transition: transform 0.18s var(--pop);
  z-index: 4;
}
.aw-fab-toys { left: 14px; background: radial-gradient(circle at 35% 30%, #fff7cc, #ffd66b); }
.aw-fab-closet { right: 14px; background: radial-gradient(circle at 35% 30%, #ffe4f1, #ff9ec4); }
.aw-fab:active { transform: scale(0.9); }
.aw-fab.active { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(236, 72, 153, 0.35), 0 12px 22px rgba(75, 95, 143, 0.25); }
.aw-fab .ci-svg { stroke-width: 1.8; }

/* Papelera que aparece al arrastrar un juguete */
.aw-trash {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #64748b;
  background: rgba(255, 255, 255, 0.92);
  border: 4px dashed #cbd5e1;
  z-index: 5; pointer-events: none;
  transition: transform 0.2s var(--pop), background 0.2s;
}
.aw-trash .ci-svg { width: 1em; height: 1em; }
.aw-trash.hot { transform: translateX(-50%) scale(1.2); background: #fee2e2; border-color: #f87171; color: #dc2626; }
.aw-trash.hidden { display: none; }

/* Hoja inferior (vestidor y baúl) */
.aw-sheet {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  max-height: 64%;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 26px;
  box-shadow: 0 -4px 30px rgba(75, 95, 143, 0.25);
  z-index: 6;
  animation: awSheetIn 0.32s var(--pop);
}
.aw-sheet.hidden { display: none; }
.aw-sheet-row { display: flex; align-items: center; gap: 10px; }
.aw-sheet-top { justify-content: space-between; flex-wrap: wrap; }
.aw-sheet-done {
  margin-left: auto; flex-shrink: 0;
  width: 60px; height: 60px; border-radius: 50%;
  border: 4px solid #fff; cursor: pointer;
  background: linear-gradient(135deg, #86efac, #22c55e);
  color: #fff; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 0 #15803d;
}
.aw-sheet-done .ci-svg { stroke-width: 3.2; }
.aw-sheet-done:active { transform: translateY(3px); box-shadow: 0 2px 0 #15803d; }

.aw-friends { display: flex; gap: 8px; }
.aw-friend {
  position: relative; width: 70px; height: 70px; padding: 0;
  border-radius: 50%; border: 4px solid #e2e8f0; background: #f8fafc;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: transform 0.18s var(--pop);
}
.aw-friend.active { border-color: var(--slot); box-shadow: 0 0 0 4px color-mix(in srgb, var(--slot) 30%, transparent); transform: scale(1.06); }
.aw-friend.off canvas { opacity: 0.35; filter: grayscale(0.6); }
.aw-friend-plus {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--slot);
}
.aw-friend-plus .ci-svg { stroke-width: 3.2; }

.aw-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.aw-cat {
  width: 58px; height: 58px; padding: 0; border-radius: 18px;
  border: 3px solid #f1f5f9; background: #ffffff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 #e2e8f0;
  transition: transform 0.15s var(--pop);
}
.aw-cat.active { background: #fdf2f8; border-color: #f472b6; box-shadow: 0 3px 0 #f9a8d4; transform: translateY(-2px); }

.aw-tiles {
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.aw-tiles-toys { flex: 1; }
.aw-tile {
  flex: 0 0 auto; scroll-snap-align: start;
  width: 112px; height: 112px; padding: 0;
  border-radius: 24px; border: 4px solid #ffffff;
  background: linear-gradient(160deg, #fdf2f8, #e0f2fe);
  box-shadow: 0 4px 0 #e2e8f0, 0 6px 14px rgba(75, 95, 143, 0.12);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s var(--pop);
}
.aw-sheet-toys .aw-tile { width: 104px; height: 104px; background: linear-gradient(160deg, #fffbeb, #fef3c7); }
.aw-tile:active { transform: scale(0.92); }
.aw-tile.active { border-color: #f472b6; box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.3), 0 4px 0 #f9a8d4; }
.aw-tile.pop { animation: awPop 0.35s var(--pop); }

@keyframes awSheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes awPop { 50% { transform: scale(1.12); } }
@keyframes awNudgeL { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
@keyframes awNudgeR { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

@media (max-height: 560px) {
  .aw-friend { width: 54px; height: 54px; }
  .aw-cat { width: 46px; height: 46px; }
  .aw-tile { width: 88px; height: 88px; }
  .aw-sheet-done { width: 50px; height: 50px; font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .aw-door-arrow { animation: none !important; }
}
.aw-tile canvas, .aw-cat canvas, .aw-friend canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
.aw-closet { display: flex; gap: 10px; min-height: 0; }
.aw-closet-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.aw-preview {
  flex: 0 0 auto; width: 132px; border-radius: 22px;
  background: radial-gradient(circle at 50% 70%, #ffffff, color-mix(in srgb, var(--slot) 18%, #ffffff));
  border: 4px solid color-mix(in srgb, var(--slot) 45%, #ffffff);
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
@media (max-width: 760px), (max-height: 560px) { .aw-preview { display: none; } }
.pn-chip-ic { font-size: 18px; color: #e8679f; vertical-align: -3px; }
/* Tablet vertical: el lienzo arriba y el vestidor/baúl debajo, sin tapar a los amigos */
@media (orientation: portrait) and (min-height: 700px) {
  .aw-shell { align-items: flex-start; padding-top: 2vh; }
  .aw-stage { overflow: visible; }
  #avatarWorldCanvas { border-radius: 26px; }
  .aw-sheet {
    top: calc(100% + 18px); bottom: auto; left: 0; right: 0;
    max-height: none;
    box-shadow: 0 0 0 5px #ffffff, 0 14px 30px rgba(75, 95, 143, 0.2);
  }
  .aw-closet { flex-direction: column; }
  .aw-preview { display: none; }
  .aw-tiles { flex-wrap: wrap; overflow: visible; justify-content: center; }
  .aw-tile { width: 124px; height: 124px; }
  .aw-sheet-toys .aw-tile { width: 124px; height: 124px; }
  .aw-sheet-toys .aw-sheet-row { flex-direction: column-reverse; align-items: stretch; }
  .aw-sheet-toys .aw-sheet-done { align-self: flex-end; }
}


/* ============================================================
   v38 · CINNAMOROLL WORLD HD (Estilo Pazu Avatar World + Mapa Ciudad)
   ============================================================ */
.aw-map-btn {
  position: absolute;
  top: 12px;
  left: 14px;
  height: clamp(46px, 11cqh, 62px);
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 4px solid #ffffff;
  background: linear-gradient(145deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
  color: #0c4a6e;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: clamp(14px, 3.2cqh, 19px);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 5px 0 #0284c7, 0 10px 20px rgba(2, 132, 199, 0.28);
  transition: transform 0.18s var(--pop), box-shadow 0.18s, background 0.2s;
  z-index: 4;
}
.aw-map-btn .ci {
  font-size: clamp(22px, 5.2cqh, 30px);
  color: #0369a1;
}
.aw-map-btn:hover {
  transform: translateY(-2px) scale(1.03);
}
.aw-map-btn:active {
  transform: translateY(3px) scale(0.95);
  box-shadow: 0 2px 0 #0284c7, 0 5px 12px rgba(2, 132, 199, 0.25);
}
.aw-map-btn.active {
  background: linear-gradient(145deg, #fef08a 0%, #facc15 55%, #eab308 100%);
  color: #713f12;
  box-shadow: 0 5px 0 #ca8a04, 0 0 0 4px rgba(250, 204, 21, 0.4), 0 10px 22px rgba(202, 138, 4, 0.32);
}
.aw-map-btn.active .ci {
  color: #854d0e;
}
.aw-room-dots {
  pointer-events: auto;
  padding: 6px 14px;
  border: 3px solid #ffffff;
  background: rgba(255, 255, 255, 0.9);
}
.aw-dot {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 8px;
}
.aw-dot:hover {
  opacity: 0.9;
  transform: scale(1.18);
}

/* Botón flotante para soltar el objeto que el avatar tiene en la mano */
.aw-drop-btn {
  position: absolute;
  bottom: 22px;
  right: clamp(92px, 21cqh, 126px);
  height: clamp(44px, 10.5cqh, 58px);
  padding: 0 15px 0 12px;
  border-radius: 999px;
  border: 4px solid #ffffff;
  background: linear-gradient(145deg, #fff1f2 0%, #fecdd3 55%, #fda4af 100%);
  color: #881337;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito', sans-serif;
  font-size: clamp(13px, 3cqh, 17px);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 5px 0 #e11d48, 0 10px 20px rgba(225, 29, 72, 0.26);
  transition: transform 0.18s var(--pop), opacity 0.2s, box-shadow 0.18s;
  z-index: 4;
}
.aw-drop-btn:hover {
  transform: translateY(-2px) scale(1.04);
}
.aw-drop-btn:active {
  transform: translateY(3px) scale(0.95);
  box-shadow: 0 2px 0 #e11d48;
}
.aw-drop-btn.hidden {
  display: none !important;
}
.aw-drop-ico {
  font-size: clamp(17px, 4cqh, 22px);
  line-height: 1;
}
