/* Tiros Perfectos: its own look on top of the shared Pop menu and HUD. */
:root {
  --tp-navy: #1b2257;
  --tp-blue: #2a4fae;
}
html,
body {
  background:
    radial-gradient(120% 55% at 50% 0%, #ffcf4a 0%, rgba(255, 160, 40, 0) 60%),
    linear-gradient(180deg, #ff9a2e 0%, #ff6a2a 38%, #f2433b 72%, #e02a4a 100%);
}

/* ---------- Menu ---------- */
.pop-menu {
  padding-top: 8px;
}
.pop-menu > * {
  position: relative;
  z-index: 1;
}
/* this game brings its own background dressing */
.pop-menu > .pop-deco {
  display: none;
}
.pop-menu > .tp-deco {
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  min-height: 640px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.tp-deco svg {
  position: absolute;
}
.tp-rays {
  position: absolute;
  left: 50%;
  top: 76px;
  width: 760px;
  height: 760px;
  margin: -380px 0 0 -380px;
  background: repeating-conic-gradient(rgba(255, 250, 200, 0.16) 0 9deg, rgba(255, 250, 200, 0) 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0, #000 18%, transparent 60%);
  mask: radial-gradient(circle, #000 0, #000 18%, transparent 60%);
  animation: tp-spin 60s linear infinite;
}
.tp-hoop-l {
  left: -34px;
  top: 18px;
  width: 150px;
  transform: rotate(-8deg);
  opacity: 0.32;
}
.tp-hoop-r {
  right: -40px;
  top: 70px;
  width: 140px;
  transform: scaleX(-1) rotate(-10deg);
  opacity: 0.28;
}
.tp-bigball {
  right: -90px;
  bottom: -40px;
  width: 300px;
  opacity: 0.16;
}
.tp-bigball2 {
  left: -120px;
  bottom: 120px;
  width: 260px;
  opacity: 0.1;
}
.tp-spark {
  color: #fff3b0;
  width: 22px;
  animation: tp-twinkle 2.2s ease-in-out infinite;
}

.pop-logo {
  width: 150px;
  height: 128px;
  margin-top: 2px;
  font-size: 0;
  filter: drop-shadow(0 10px 14px rgba(120, 20, 10, 0.35));
}
.pop-logo svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pop-title {
  margin-top: -6px;
  font-size: clamp(42px, 12.5vw, 64px);
  letter-spacing: -0.5px;
  color: #fffaf0;
  text-shadow:
    3px 0 0 #5a1330,
    -3px 0 0 #5a1330,
    0 3px 0 #5a1330,
    0 -3px 0 #5a1330,
    2px 2px 0 #5a1330,
    -2px 2px 0 #5a1330,
    2px -2px 0 #5a1330,
    -2px -2px 0 #5a1330,
    0 7px 0 #5a1330,
    3px 7px 0 #5a1330,
    -3px 7px 0 #5a1330,
    0 12px 16px rgba(80, 10, 20, 0.35);
}
.pop-how {
  max-width: 440px;
  margin-top: 10px;
  font-size: 17px;
  text-shadow: 0 1px 2px rgba(110, 20, 10, 0.35);
}

.pop-reto-row {
  width: 100%;
  max-width: 460px;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 14px;
}
.pop-reto-row .pop-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 58px;
  padding: 8px 14px;
  font-size: 21px;
  white-space: nowrap;
  color: var(--tp-navy);
}
.pop-btn.pop-reto {
  flex-grow: 1.25;
  background: linear-gradient(180deg, #fff27a 0%, #ffd23a 45%, #ffb300 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 5px 0 #c97800,
    0 8px 16px rgba(120, 30, 0, 0.3);
  font-size: 22px;
}
.pop-btn.ghost {
  background: linear-gradient(180deg, #ffffff, #fff1e6);
  box-shadow:
    0 5px 0 rgba(150, 40, 40, 0.35),
    0 8px 16px rgba(120, 30, 0, 0.2);
}
.pop-btn:active {
  transform: translateY(3px);
}
.pop-reto-how {
  font-size: 15px;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(110, 20, 10, 0.35);
}
.pop-total {
  margin: 2px 0 14px;
  padding: 4px 22px;
  background: rgba(110, 15, 25, 0.32);
  font-size: 20px;
}
.pop-levels {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 460px;
}
.pop-level {
  min-height: 92px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fff6ee 60%, #f6e3d8 100%);
  box-shadow:
    inset 0 -3px 0 rgba(220, 150, 140, 0.35),
    0 5px 0 rgba(150, 30, 40, 0.35),
    0 8px 14px rgba(100, 10, 10, 0.18);
  color: var(--tp-navy);
  font-size: 38px;
  line-height: 1;
}
.pop-level small {
  margin-top: 2px;
  color: var(--tp-blue);
  font-size: 12.5px;
  /* the whole name on up to two lines instead of "Desde to…" */
  white-space: normal;
  text-overflow: clip;
  line-height: 1.1;
  text-align: center;
}
.pop-level .pop-s {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}
.pop-level .pop-s i {
  width: 20px;
  height: 20px;
  font-size: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3 6.4 7 .8-5.2 4.8 1.4 6.9L12 17.3l-6.2 3.4 1.4-6.9L2 9l7-.8z' fill='%23ffc61a' stroke='%23e89400' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M12 4.5l2.1 4.6 4.6.5' fill='none' stroke='%23fff6b0' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.pop-level .pop-s i.off {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3 6.4 7 .8-5.2 4.8 1.4 6.9L12 17.3l-6.2 3.4 1.4-6.9L2 9l7-.8z' fill='%23c9c3cf' stroke='%23a59fae' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.pop-level[disabled] {
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2);
  font-size: 32px;
}
.pop-level[disabled] small {
  color: #fff;
  font-size: 13px;
}
.pop-level.next {
  animation: tp-glow 1.6s ease-in-out infinite;
}
.pop-menu > .pop-row:not(.pop-reto-row) {
  margin-top: 22px;
}
.pop-menu > .pop-row:not(.pop-reto-row) .pop-btn {
  min-width: 190px;
  min-height: 54px;
  font-size: 22px;
}
.pop-foot {
  margin-top: 18px;
  padding: 3px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #c02a52;
  font-weight: 800;
  font-size: 16px;
}

/* ---------- Play ---------- */
.pop-play {
  background: linear-gradient(180deg, #16205a 0, #1f3f9e 80px, #2a6fe0 140px);
}
.pop-hud {
  margin: 6px 6px 0;
  padding: 7px 8px;
  padding-top: calc(7px + env(safe-area-inset-top, 0px));
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe680 0%, #ffcc33 55%, #ffaa1f 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    0 4px 0 #d07e00,
    0 8px 18px rgba(0, 0, 30, 0.35);
}
.pop-icon {
  width: 44px;
  height: 44px;
  color: var(--tp-navy);
  background: #fff;
  box-shadow: 0 3px 0 rgba(150, 80, 0, 0.35);
}
.pop-icon svg {
  width: 22px;
  height: 22px;
}
.pop-hud .pop-icon:last-child {
  background: linear-gradient(180deg, #4d9bff, #1f5fe0);
  color: #fff;
  box-shadow:
    inset 0 0 0 3px #fff,
    0 3px 0 rgba(150, 80, 0, 0.35);
}
.pop-lvl {
  color: var(--tp-navy);
  font-size: 19px;
  text-shadow: none;
}
.pop-lvl {
  flex: 0 1 auto;
  min-width: 58px;
}
.pop-lvl small {
  max-width: 100%;
  font-size: 14px;
  opacity: 0.85;
}
.pop-chips {
  flex-shrink: 0;
  max-width: calc(100% - 170px);
  gap: 5px;
}
.pop-chip {
  padding: 3px 10px;
  font-size: 15px;
  background: #fff8ec;
  color: var(--tp-navy);
  box-shadow: 0 2px 0 rgba(150, 80, 0, 0.3);
}
.pop-overlay {
  background: rgba(14, 22, 70, 0.5);
}

@keyframes tp-glow {
  50% {
    box-shadow:
      0 0 0 4px #ffe14d,
      0 0 22px 6px rgba(255, 230, 80, 0.9),
      0 5px 0 rgba(150, 30, 40, 0.35);
  }
}
@keyframes tp-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes tp-twinkle {
  50% {
    transform: scale(0.6) rotate(20deg);
    opacity: 0.6;
  }
}
@media (max-width: 360px) {
  .pop-reto-row .pop-btn {
    font-size: 18px;
    padding: 8px 10px;
  }
  .pop-level {
    font-size: 32px;
  }
  .pop-level small {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tp-spark,
  .tp-rays {
    animation: none;
  }
}
