/* Lumi y lo que se arma · motor Construir */
.co {
  --co-noche: #1B2A5C;
  --co-noche-2: #121c40;
  --co-oro: #F5C542;
  --co-crema: #fff8e8;
  --co-tinta: #2b2140;
  --co-mal: #ff7a6b;
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0;
  background: radial-gradient(120% 80% at 50% 0%, #26397a 0%, var(--co-noche-2) 70%); color: #fff;
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.co * { box-sizing: border-box; }
.co button { font-family: inherit; }
.co [hidden] { display: none !important; }
.co button:focus-visible { outline: 3px solid var(--co-oro); outline-offset: 2px; }

/* Arriba */
.co-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--co-noche); border-bottom: 1px solid rgba(245,197,66,.25); min-height: 76px; z-index: 3; }
.co-lumi { width: 58px; height: 58px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 0 10px rgba(245,197,66,.55)); }
.co-lumi.rebota { animation: co-rebote .6s ease; }
.co-globo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--co-crema); color: var(--co-tinta); border-radius: 18px; padding: 6px 12px; min-height: 56px; box-shadow: 0 4px 0 rgba(0,0,0,.18); position: relative; }
.co-globo::before { content: ""; position: absolute; left: -7px; top: 50%; translate: 0 -50%; border: 8px solid transparent; border-right-color: var(--co-crema); border-left: 0; }
.co-globo-chico { font-size: 13px; font-weight: 700; opacity: .7; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-globo-grande { font-size: clamp(18px, 5vw, 26px); font-weight: 800; line-height: 1.1; }
.co-globo.nueva { animation: co-pop .4s ease; }
.co-redondo { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; display: grid; place-items: center; cursor: pointer; }
.co-contador { flex: 0 0 auto; font-weight: 800; color: var(--co-oro); min-width: 36px; text-align: center; }

/* La mesa: dibujo, lo que se arma y los huecos */
.co-medio { flex: 1; min-height: 0; overflow-y: auto; padding: 14px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.co-escena { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.co-dibujo { width: clamp(110px, 32vw, 180px); height: clamp(110px, 32vw, 180px); object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.co-objetivo { font-size: clamp(22px, 6vw, 32px); font-weight: 800; color: var(--co-oro); text-align: center; line-height: 1.1; text-wrap: balance; }
.co-oir-grande { border: 0; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 800; font-size: 18px; padding: 10px 18px; cursor: pointer; }

.co-fila { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 900px; }
.co-hueco { position: relative; min-width: 80px; min-height: 80px; padding: 4px; border-radius: 18px; border: 2px dashed rgba(255,255,255,.32); background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center; transition: border-color .2s, background .2s, box-shadow .2s, transform .2s; }
.co-fila.palabras .co-hueco { min-width: 64px; min-height: 60px; }
.co-hueco.siguiente { border-color: var(--co-oro); border-style: solid; box-shadow: 0 0 16px rgba(245,197,66,.35); }
.co-hueco.encima { background: rgba(245,197,66,.25); transform: scale(1.06); border-style: solid; border-color: var(--co-oro); }
.co-hueco.bien { border: 2px solid var(--co-oro); background: rgba(245,197,66,.14); box-shadow: 0 0 18px rgba(245,197,66,.45); }
.co-hueco.marcado { border-color: var(--co-mal); border-style: solid; }
.co-hueco.leyendo { animation: co-lee .8s ease; }
.co-hueco.fija { border: 0; background: transparent; min-width: 44px; font-size: clamp(30px, 8vw, 44px); font-weight: 800; color: var(--co-oro); }
.co-hueco.fija.total { min-width: 64px; border-radius: 18px; background: rgba(245,197,66,.16); border: 2px solid rgba(245,197,66,.5); }
.co-guia { font-size: clamp(26px, 7vw, 36px); font-weight: 800; color: rgba(255,255,255,.18); pointer-events: none; }
.co-etiqueta { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 800; color: rgba(255,255,255,.6); letter-spacing: .08em; }
.co-fila.con-etiquetas { margin-top: 18px; }

/* Pieza */
.co-pieza {
  min-width: 72px; min-height: 72px; padding: 6px 16px; border: 0; border-radius: 16px; cursor: grab;
  background: var(--co-crema); color: var(--co-tinta); box-shadow: 0 4px 0 rgba(0,0,0,.22);
  font-size: clamp(30px, 8.5vw, 42px); font-weight: 800; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  touch-action: none; position: relative;
}
.co-pieza.chica { font-size: clamp(20px, 5.4vw, 26px); min-height: 56px; min-width: 56px; padding: 6px 12px; }
.co-hueco .co-pieza { box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.co-hueco.bien .co-pieza { cursor: default; background: #fff3c4; }
.co-pieza.mal { animation: co-tiembla .45s ease; box-shadow: 0 0 0 3px var(--co-mal), 0 4px 0 rgba(0,0,0,.22); }
.co-pieza.pulso { animation: co-pulso 1s ease-in-out infinite; }
.co-pieza.levantada { opacity: .25; }
.co-pieza:active { translate: 0 2px; }
.co-fantasma { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -60%) scale(1.08); box-shadow: 0 12px 24px rgba(0,0,0,.4); cursor: grabbing; }

/* Bandeja */
.co-bandeja-caja { background: rgba(12,20,48,.75); border-top: 1px solid rgba(245,197,66,.25); padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 10px; z-index: 3; }
.co-bandeja { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 900px; width: 100%; margin: 0 auto; min-height: 68px; }
.co-acciones { display: flex; gap: 8px; justify-content: space-between; align-items: center; max-width: 900px; width: 100%; margin: 0 auto; }
.co-boton { height: 48px; border-radius: 16px; border: 0; padding: 0 16px; cursor: pointer; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); color: #fff; }
.co-boton.oro { background: var(--co-oro); color: var(--co-tinta); box-shadow: 0 4px 0 #b88a00; }
.co-boton:disabled { opacity: .45; cursor: default; box-shadow: none; }
.co-boton.llama { animation: co-llama 1.2s ease-in-out infinite; }
.co-ayuda { font-size: 14px; font-weight: 600; opacity: .75; flex: 1; text-align: center; }

/* Fin */
.co-fin { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(10,16,40,.72); backdrop-filter: blur(3px); animation: co-aparece .4s ease; }
.co-fin-tarjeta { width: min(420px, 100%); background: var(--co-crema); color: var(--co-tinta); border-radius: 24px; padding: 20px 18px 18px; text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.25); }
.co-fin-tarjeta > img { width: 120px; height: 120px; object-fit: contain; margin-top: -70px; filter: drop-shadow(0 0 16px rgba(245,197,66,.7)); }
.co-fin h2 { margin: 4px 0 2px; font-size: 26px; line-height: 1.1; text-wrap: balance; }
.co-fin p { margin: 0 0 10px; opacity: .8; font-weight: 600; }
.co-estrellas { font-size: 34px; letter-spacing: 6px; margin: 4px 0 8px; }
.co-estrellas .off { opacity: .2; filter: grayscale(1); }
.co-datos { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.co-dato { background: #fff; border-radius: 14px; padding: 6px 12px; min-width: 84px; }
.co-dato b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.co-dato span { font-size: 12px; font-weight: 700; opacity: .7; }
.co-fin-botones { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.co-fin-botones .co-boton { background: #ece3cf; color: var(--co-tinta); }
.co-fin-botones .co-boton.oro { background: var(--co-oro); }

.co-chispa { position: fixed; z-index: 50; width: 10px; height: 10px; border-radius: 50%; background: var(--co-oro); box-shadow: 0 0 10px 3px rgba(245,197,66,.8); pointer-events: none; }

@keyframes co-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes co-rebote { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-10px) scale(1.08); } }
@keyframes co-tiembla { 0%,100% { translate: 0 0; } 20% { translate: -6px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
@keyframes co-pulso { 0%,100% { box-shadow: 0 4px 0 rgba(0,0,0,.22), 0 0 0 0 rgba(245,197,66,.9); } 50% { box-shadow: 0 4px 0 rgba(0,0,0,.22), 0 0 0 8px rgba(245,197,66,0); } }
@keyframes co-lee { 0% { transform: scale(1); } 40% { transform: scale(1.1); box-shadow: 0 0 26px rgba(245,197,66,.8); } 100% { transform: scale(1); } }
@keyframes co-llama { 0%,100% { box-shadow: 0 4px 0 #b88a00, 0 0 0 0 rgba(245,197,66,.6); } 50% { box-shadow: 0 4px 0 #b88a00, 0 0 0 10px rgba(245,197,66,0); } }
@keyframes co-aparece { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .co *, .co *::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.co-emoji { display: flex; align-items: center; justify-content: center; font-size: clamp(76px, 22vw, 130px); line-height: 1; }   /* JUEGOS MOTORES */
@media (max-height: 640px) { .co-emoji { font-size: 70px; } }
