  @import url('https://fonts.cdnfonts.com/css/pricedown');

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
  }

  .screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-image: url('fondo.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* leve viñeta para dar profundidad, igual que el estilo del juego */
  .screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
  }

  .character {
    position: absolute;
    left: 50%;
    bottom: -6vh;
    z-index: 1;
    max-height: 92vh;
    max-height: 92dvh;
    width: auto;
    pointer-events: none;
    user-select: none;
    animation: float-updown 4.5s ease-in-out infinite;
  }

  @keyframes float-updown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-18px); }
  }

  .logo-mobile {
    display: none;
    position: absolute;
    left: 50%;
    z-index: 1;
    width: auto;
    pointer-events: none;
    user-select: none;
    transform: translateX(-50%);
  }

  .menu {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(10px, 1.6vh, 18px);
    width: clamp(260px, 22vw, 400px);
  }

  .logo-tiko {
    display: block;
    width: min(100%, 420px);
    height: auto;
    margin: 0 auto clamp(6px, 1.2vh, 14px);
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  }

  .menu-btn {
    all: unset;
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(14px, 2.4vh, 26px) 20px;
    background: rgba(20, 20, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #f2f2f2;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 800;
    font-size: clamp(24px, 3.1vw, 42px);
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  }

  .menu-btn:hover {
    background: rgba(50, 50, 50, 0.85);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  }

  .menu-btn:active {
    transform: scale(0.98);
  }

  .menu-btn.mystery {
    font-weight: 900;
    letter-spacing: 4px;
  }

  /* Botón bloqueado (p.ej. "Pack opening" mientras no está activo todavía) */
  .menu-btn.locked {
    cursor: default;
    background: rgba(12, 12, 12, 0.72);
    color: rgba(255, 255, 255, 0.35);
  }

  .menu-btn.locked:hover {
    background: rgba(12, 12, 12, 0.72);
    transform: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  }

  /* --- Insignia "EN DIRECTO" junto al botón 24 horas --- */
  .menu-item-wrap {
    position: relative;
  }

  .live-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #e01b2e;
    color: #fff;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45), 0 0 0 2px rgba(0,0,0,0.5);
    pointer-events: none;
  }

  .live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: live-pulse 1.4s ease-in-out infinite;
  }

  @keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.75); }
  }

  /* --- Submenús (mismo estilo que el menú principal) --- */
  .submenu {
    position: relative;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(10px, 1.6vh, 18px);
    width: clamp(260px, 22vw, 400px);
  }

  .submenu.active {
    display: flex;
  }

  .back-btn {
    all: unset;
    cursor: pointer;
    position: absolute;
    top: clamp(16px, 3vh, 32px);
    left: clamp(16px, 3vw, 32px);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(20, 20, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #f2f2f2;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    transition: background 0.18s ease;
  }

  .back-btn:hover {
    background: rgba(50, 50, 50, 0.85);
  }

  .back-btn[hidden] {
    display: none;
  }

  /* --- Redes sociales (Instagram, TikTok, YouTube) --- */
  .social-links {
    position: absolute;
    bottom: clamp(16px, 3vh, 32px);
    right: clamp(16px, 3vw, 32px);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
  }

  .social-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 190px;
    padding: 10px 18px;
    background: rgba(20, 20, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #f2f2f2;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    transition: background 0.18s ease, transform 0.18s ease;
  }

  .social-btn:hover {
    background: rgba(50, 50, 50, 0.85);
    transform: scale(1.03);
  }

  .social-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  /* --- Calendario de 12 días (4 filas x 3 columnas) --- */
  .calendar-menu {
    position: relative;
    z-index: 2;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 1.4vw, 18px);
    width: min(50vw, 620px);
  }

  .calendar-menu.active {
    display: grid;
  }

  .day-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    aspect-ratio: 5 / 3;
    background: rgba(20, 20, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #f2f2f2;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 800;
    font-size: clamp(20px, 2.6vw, 36px);
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  }

  .day-btn:hover {
    background: rgba(50, 50, 50, 0.85);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  }

  .day-btn:active {
    transform: scale(0.97);
  }

  .day-btn.locked {
    cursor: default;
    background: rgba(12, 12, 12, 0.72);
    color: rgba(255, 255, 255, 0.28);
    font-size: clamp(18px, 2.4vw, 30px);
  }

  .day-btn.locked:hover {
    background: rgba(12, 12, 12, 0.72);
    transform: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  }

  /* --- Tarjeta modal del reto del día --- */
  .day-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
  }

  .day-modal-overlay.active {
    display: flex;
  }

  .day-modal-card {
    position: relative;
    width: min(90vw, 480px);
    background: rgba(18, 18, 18, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: clamp(28px, 5vh, 44px) clamp(24px, 4vw, 40px);
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    animation: day-modal-in 0.22s ease-out;
  }

  @keyframes day-modal-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
  }

  .day-modal-title {
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    color: #fff;
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: 1px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
    margin-bottom: 14px;
  }

  .day-modal-text {
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    color: #f5c518;
    font-size: clamp(18px, 3vw, 26px);
    line-height: 1.35;
    letter-spacing: 0.3px;
  }

  .day-modal-close {
    all: unset;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 14px;
    color: #f2f2f2;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 28px;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.15s ease;
  }

  .day-modal-close:hover {
    color: #e01b2e;
  }

  /* --- Banner "acceso restringido" al entrar en Pack opening --- */
  .auth-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
  }

  .auth-modal-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    color: #f2f2f2;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: clamp(18px, 2.4vw, 24px);
    letter-spacing: 0.4px;
    transition: background 0.18s ease, transform 0.18s ease;
  }

  .auth-modal-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.02);
  }

  .auth-modal-btn.primary {
    background: #e01b2e;
    border-color: #e01b2e;
  }

  .auth-modal-btn.primary:hover {
    background: #ff2a41;
  }

  /* --- Formularios de registro / inicio de sesión --- */
  .auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
    text-align: left;
  }

  .auth-input {
    all: unset;
    box-sizing: border-box;
    width: 100%;
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 17px;
    letter-spacing: 0.3px;
  }

  .auth-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
  }

  .auth-input:focus {
    border-color: #f5c518;
  }

  .auth-switch {
    margin-top: 16px;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 14px;
    color: #ccc;
    letter-spacing: 0.3px;
  }

  .auth-link {
    all: unset;
    cursor: pointer;
    color: #f5c518;
    text-decoration: underline;
    font-family: inherit;
    font-size: inherit;
  }

  /* --- Insignia del usuario logueado (arriba a la derecha) --- */
  .user-badge {
    all: unset;
    cursor: pointer;
    position: absolute;
    top: clamp(16px, 3vh, 32px);
    right: clamp(16px, 3vw, 32px);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: #fff;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: 0.4px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    transition: color 0.15s ease;
  }

  .user-badge:hover {
    color: #f5c518;
  }

  .user-badge[hidden] {
    display: none;
  }

  .user-badge-points {
    font-size: clamp(18px, 2vw, 24px);
    color: #35672A;
    letter-spacing: 0.6px;
    -webkit-text-stroke: 1.5px #000;
    text-shadow:
      -1.5px -1.5px 0 #000,
       1.5px -1.5px 0 #000,
      -1.5px  1.5px 0 #000,
       1.5px  1.5px 0 #000,
       0 2px 3px rgba(0,0,0,0.6);
  }

  /* Avisa de que hay un sobre disponible para abrir hoy */
  .pack-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0272c;
    color: #fff;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 15px;
    letter-spacing: 0;
    text-shadow: none;
    border: 2px solid #0c0c0e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 1;
  }

  .pack-badge[hidden] {
    display: none;
  }

  /* --- Pack opening: sobres y cartas de streamers --- */
  .subscreen {
    display: none;
    position: relative;
    z-index: 2;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: clamp(18px, 3vh, 32px);
  }

  .subscreen.active {
    display: flex;
  }

  .pack-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 3vh, 32px);
    width: 100%;
  }

  .pack-stage[hidden] {
    display: none;
  }

  .pack-instructions {
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    color: #f5c518;
    font-size: clamp(22px, 3vw, 34px);
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  }

  .envelope-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
    width: clamp(180px, 46vw, 250px);
    height: clamp(216px, 55vw, 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .envelope-btn:hover {
    transform: scale(1.06);
  }

  .envelope-btn:disabled {
    cursor: default;
  }

  /* Modelo 3D del sobre (sobre3d.glb) dentro del botón: no captura gestos,
     así el click/drag lo sigue gestionando el botón/carrusel que lo envuelve */
  .envelope-model {
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
    --poster-color: transparent;
    transition: filter 0.2s ease;
  }

  /* El sobre inicial sí se puede girar a mano (arrastrar), no gira solo */
  .envelope-model-interactive {
    pointer-events: auto;
    cursor: grab;
  }

  .envelope-model-interactive:active {
    cursor: grabbing;
  }

  .envelope-label {
    position: relative;
    z-index: 1;
    color: #fff;
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: clamp(13px, 2vw, 15px);
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.6);
  }

  .envelope-big {
    width: clamp(280px, 70vw, 400px);
    height: clamp(334px, 83vw, 476px);
  }

  .envelope-btn.fade-out {
    opacity: 0 !important;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.6) !important;
    transition: transform 0.4s ease, opacity 0.35s ease;
  }

  /* El sobre elegido ya no crece (se veía como un recuadro plano feo):
     ahora se desliza hacia abajo y se desvanece, y detrás salen las cartas */
  .envelope-btn.selected-grow {
    opacity: 0 !important;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 220px)) scale(0.8) !important;
    transition: transform 0.55s cubic-bezier(0.4, 0, 1, 1), opacity 0.5s ease 0.1s;
  }

  @keyframes envelope-pop-in {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
  }

  .envelope-pop {
    animation: envelope-pop-in 0.35s ease-out both;
  }

  .carousel-outer {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 20px);
    width: 100vw;
  }

  .carousel-wrap {
    flex: 1 1 auto;
    position: relative;
    height: clamp(290px, 66vw, 370px);
    perspective: 900px;
    /* el gesto horizontal lo gestiona el JS por completo: evita que el navegador
       intente hacer scroll/zoom nativo a mitad de deslizamiento (eso hacía que
       a veces "fuera mal" en móvil) */
    touch-action: none;
  }

  .carousel-cylinder {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.22, 0.8, 0.25, 1);
    cursor: grab;
  }

  .carousel-cylinder.dragging,
  .carousel-cylinder.spinning {
    /* sin transición CSS mientras se arrastra o gira solo por inercia:
       la posición la controla el JS fotograma a fotograma */
    transition: none;
    cursor: grabbing;
  }

  .carousel-item {
    position: absolute;
    left: 50%;
    top: 50%;
    backface-visibility: hidden;
  }

  /* Resplandor que sigue la silueta real del sobre 3D (no un recuadro) cuando está centrado */
  .carousel-item.centered .envelope-model {
    filter: drop-shadow(0 0 14px rgba(245, 197, 24, 0.85)) drop-shadow(0 8px 18px rgba(0,0,0,0.6));
    transition: filter 0.2s ease;
  }

  /* --- Apertura del sobre elegido: se rasga y las cartas salen deslizándose --- */
  .tear-wrap {
    position: relative;
    width: clamp(240px, 72vw, 380px);
    height: clamp(340px, 100vw, 540px);
  }

  .pack-big {
    position: absolute;
    inset: 0;
    border-radius: 14px;
  }

  .pack-big-model {
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
    --poster-color: transparent;
  }


  .tear-card {
    position: absolute;
    left: 50%;
    bottom: 14%;
    width: 92%;
    /* proporción 2:3 vía padding-top (150% * 92% de ancho = 138%): más compatible que aspect-ratio */
    height: 0;
    padding-top: 138%;
    border-radius: 12px;
    /* overflow visible: los rayos (legendaria) y las partículas (ultra)
       tienen que poder salirse del marco de la carta. Lo que sí se
       recorta es la imagen, dentro de .tear-card-face */
    overflow: visible;
    box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 26px var(--rarity-color, transparent);
    border: 2px solid var(--rarity-color, rgba(255,255,255,0.18));
    background: #000;
    transform: translate(-50%, 25%) scale(0.8);
    opacity: 0;
    z-index: 2;
    transition: transform 0.55s cubic-bezier(0.25, 0.85, 0.25, 1), opacity 0.5s ease;
  }

  .tear-card-face {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    overflow: hidden;
    z-index: 1;
  }

  .tear-card img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .tear-card.show {
    transform: translate(-50%, -58%) scale(1);
    opacity: 1;
    z-index: 5;
  }

  .tear-card.exit {
    transform: translate(-50%, -130%) scale(0.92);
    opacity: 0;
    z-index: 5;
  }

  /* Al mostrar la primera carta, el sobre se esconde y las cartas pasan a estar centradas */
  .tear-wrap.pack-hidden .pack-big {
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
  }

  .tear-wrap.pack-hidden .tear-card.show {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
  }

  .tear-wrap.pack-hidden .tear-card.exit {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -80%) scale(0.92);
  }

  .tear-progress {
    display: flex;
    gap: 8px;
  }

  .tear-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: background 0.2s ease;
  }

  .tear-dot.active {
    background: #f5c518;
  }

  #stage-reveal {
    cursor: pointer;
  }

  .tear-tap-hint {
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    color: rgba(255, 255, 255, 0.55);
    font-size: clamp(13px, 2.2vw, 16px);
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    animation: tap-hint-pulse 1.8s ease-in-out infinite;
  }

  .tear-tap-hint[hidden] {
    display: none;
  }

  @keyframes tap-hint-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
  }

  /* Color de acento por rareza (se aplica como borde/resplandor a las cartas) */
  .rarity-promesas    { --rarity-color: #b9c4d0; }
  .rarity-especiales  { --rarity-color: #2f8fe0; }
  .rarity-epicas      { --rarity-color: #9b30d9; }
  .rarity-legendarias { --rarity-color: #f5c518; }
  .rarity-utopicas    { --rarity-color: #ff2fb0; }
  .rarity-objetos     { --rarity-color: #c9822f; }

  /* Resplandor especial al REVELAR una carta legendaria (rayos dorados) o ultra (glow + partículas rojas) */
  @keyframes glow-pulse-gold {
    0%, 100% { box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 30px 6px rgba(245, 197, 24, 0.55); }
    50%      { box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 60px 16px rgba(245, 197, 24, 0.95); }
  }
  @keyframes glow-pulse-red {
    0%, 100% { box-shadow: 0 14px 40px rgba(0,0,0,0.6), 0 0 40px 10px rgba(255, 30, 30, 0.7); }
    50%      { box-shadow: 0 14px 40px rgba(0,0,0,0.6), 0 0 85px 26px rgba(255, 30, 30, 1); }
  }
  /* Épica: un glow discreto, bastante más suave que el de legendaria/ultra */
  @keyframes glow-pulse-purple-mini {
    0%, 100% { box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 22px 4px rgba(155, 48, 217, 0.55); }
    50%      { box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 42px 11px rgba(155, 48, 217, 0.9); }
  }

  .tear-card.rarity-legendarias.show {
    animation: glow-pulse-gold 1.6s ease-in-out infinite;
  }

  .tear-card.rarity-utopicas.show {
    animation: glow-pulse-red 1.1s ease-in-out infinite;
  }

  .tear-card.rarity-epicas.show {
    animation: glow-pulse-purple-mini 1.8s ease-in-out infinite;
  }

  /* --- Legendaria y Ultra: rayos de luz cortos y difuminados girando detrás de la carta --- */
  @keyframes rays-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
  }

  .tear-card.rarity-legendarias.show::before,
  .tear-card.rarity-utopicas.show::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 170%;
    height: 170%;
    /* se desvanecen hacia fuera para que los rayos se vean cortos, no una rueda entera */
    -webkit-mask-image: radial-gradient(circle, #000 0%, #000 30%, transparent 68%);
            mask-image: radial-gradient(circle, #000 0%, #000 30%, transparent 68%);
    mix-blend-mode: screen;
    opacity: 0.85;
    filter: blur(6px);
    transform: translate(-50%, -50%);
    animation: rays-spin 7s linear infinite;
    pointer-events: none;
    z-index: 0;
  }

  .tear-card.rarity-legendarias.show::before {
    background: repeating-conic-gradient(
      from 0deg,
      rgba(245, 197, 24, 0.6) 0deg 6deg,
      transparent 6deg 24deg
    );
  }

  .tear-card.rarity-utopicas.show::before {
    background: repeating-conic-gradient(
      from 0deg,
      rgba(255, 40, 40, 0.6) 0deg 6deg,
      transparent 6deg 24deg
    );
  }

  /* --- Ultra: chispas + destellos rojos · Épica: unas pocas chispas moradas --- */
  .tear-card-particles {
    position: absolute;
    inset: -22%;
    z-index: 2;
    pointer-events: none;
  }

  .tear-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--particle-color, #ff4040) 45%, transparent 72%);
    filter: drop-shadow(0 0 5px var(--particle-glow, rgba(255, 40, 40, 0.95)));
    opacity: 0;
    animation: particle-twinkle var(--dur) ease-in-out var(--delay) infinite;
  }

  @keyframes particle-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.3) translateY(0); }
    50%      { opacity: 1; transform: scale(1) translateY(-10px); }
  }

  /* Destellos grandes en forma de estrella: más potencia visual que las chispas pequeñas */
  .tear-flare {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: radial-gradient(circle, #fff 0%, #ffb0b0 22%, #ff2020 55%, transparent 75%);
    clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
    filter: drop-shadow(0 0 10px rgba(255, 30, 30, 1));
    opacity: 0;
    animation: flare-twinkle var(--dur) ease-in-out var(--delay) infinite;
  }

  @keyframes flare-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.15) rotate(0deg); }
    50%      { opacity: 1; transform: scale(1) rotate(50deg); }
  }

  .streamers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: clamp(10px, 1.6vw, 16px);
    width: min(90vw, 780px);
    min-width: 0;
    max-height: 58vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
  }

  /* Proporción 2:3 mediante padding-top (compatible con cualquier navegador,
     a diferencia de aspect-ratio que algunos móviles no soportan y colapsa las tarjetas a 0 de alto) */
  .streamer-card {
    position: relative;
    min-width: 0;
    width: 100%;
    height: 0;
    padding-top: 150%;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    border: 2px solid var(--rarity-color, rgba(255,255,255,0.12));
    color: #fff;
    background: #111;
  }

  .streamer-card img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
  }

  .streamer-card.locked {
    background: rgba(20, 20, 20, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.35);
    font-size: clamp(26px, 6vw, 36px);
  }

  .streamer-card.locked::after {
    content: "❓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .streamer-card .card-count {
    position: absolute;
    bottom: -8px;
    right: -8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    background: #fff;
    color: #1a1a1a;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-family: 'Pricedown Bl', 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 12px;
  }

  /* Escritorio: menú principal abajo a la izquierda */
  @media (min-width: 901px) {
    #main-menu {
      position: absolute;
      left: clamp(32px, 6vw, 110px);
      bottom: clamp(32px, 8vh, 110px);
      width: clamp(340px, 28vw, 480px);
    }
    .submenu {
      width: clamp(340px, 28vw, 480px);
    }
    #main-menu .menu-btn,
    .submenu .menu-btn {
      font-size: clamp(30px, 3.8vw, 50px);
      padding: clamp(18px, 3vh, 32px) 24px;
    }
    .character {
      left: 58%;
    }
  }

  /* Tablets */
  @media (max-width: 900px) {
    .menu,
    .submenu {
      width: clamp(240px, 40vw, 360px);
    }
    .calendar-menu {
      grid-template-columns: repeat(3, 1fr);
      width: min(60vw, 520px);
    }
  }

  /* Móvil: pantalla en vertical */
  @media (max-width: 700px) {
    .screen {
      align-items: center;
      justify-content: center;
      background-position: 38% center;
    }
    .character {
      display: none;
    }
    .menu,
    .submenu {
      width: 100%;
      max-width: 420px;
      padding: 0 20px;
      gap: 12px;
    }
    .calendar-menu {
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      width: 100%;
      max-width: 380px;
      padding: 0 20px;
    }
    .day-btn {
      font-size: 24px;
      aspect-ratio: 5 / 3;
    }
    .menu-btn {
      font-size: 28px;
      padding: 30px 16px;
      border-radius: 8px;
    }
    .menu-btn.mystery {
      letter-spacing: 3px;
    }
    .live-badge {
      top: -8px;
      right: -6px;
      font-size: 10px;
      padding: 4px 8px;
    }
    .back-btn {
      font-size: 17px;
      padding: 8px 12px;
    }
    .user-badge {
      font-size: 18px;
    }
    .social-links {
      left: 50%;
      right: auto;
      transform: translateX(-50%);
      bottom: clamp(14px, 2.6vh, 26px);
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: auto;
    }
    .social-btn {
      width: auto;
      padding: 10px;
      border-radius: 8px;
    }
    .social-label {
      display: none;
    }
    .social-btn svg {
      width: 20px;
      height: 20px;
    }
    .logo-tiko {
      display: none;
    }
    .logo-mobile {
      display: block;
      max-height: 60vh;
      max-height: 60dvh;
      max-width: 78vw;
      top: 5vh;
      top: 5dvh;
      bottom: auto;
    }
    #main-menu {
      transform: translateY(18vh);
      transform: translateY(18dvh);
    }

    /* Mis Streamers: 6 categorías no caben con el tamaño de botón normal */
    #streamers-menu {
      gap: 8px;
      max-height: 78vh;
      max-height: 78dvh;
      overflow-y: auto;
      padding-bottom: 4px;
    }
    #streamers-menu .menu-btn {
      font-size: 20px;
      padding: 14px 16px;
    }
    .streamers-grid {
      grid-template-columns: repeat(3, 1fr);
      width: 100%;
      max-width: 420px;
      gap: 10px;
      padding: 0 20px 8px;
      max-height: 56vh;
      max-height: 56dvh;
    }
    .streamer-card.locked {
      font-size: 22px;
    }
    #streamers-grid-title {
      font-size: 20px;
      padding: 0 12px;
    }
  }

  @media (max-width: 380px) {
    .menu-btn {
      font-size: 21px;
      padding: 14px 12px;
    }
  }

  /* Móvil en horizontal */
  @media (max-width: 900px) and (orientation: landscape) {
    .screen {
      align-items: center;
      justify-content: center;
      background-position: center;
    }
    .logo-tiko {
      display: none;
    }
    .menu,
    .submenu {
      padding: 0;
      width: clamp(220px, 30vw, 320px);
      gap: 8px;
    }
    .calendar-menu {
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      width: min(46vw, 420px);
    }
    .day-btn {
      font-size: 16px;
      aspect-ratio: 5 / 3;
    }
    .menu-btn {
      font-size: 22px;
      padding: 10px 14px;
    }
    .character {
      display: none;
    }
    .logo-mobile {
      display: block;
      max-height: 68vh;
      max-height: 68dvh;
      max-width: 38vw;
      bottom: 0;
    }
    .social-links {
      left: 50%;
      right: auto;
      transform: translateX(-50%);
      bottom: 12px;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: auto;
    }
    .social-btn {
      padding: 8px;
      border-radius: 8px;
    }
    .social-label {
      display: none;
    }
    .social-btn svg {
      width: 18px;
      height: 18px;
    }

    /* Mis Streamers: filas en vez de columna larga, no cabe en alto */
    #streamers-menu {
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: center;
      width: min(92vw, 620px);
      max-width: none;
      gap: 8px;
      max-height: 85vh;
      max-height: 85dvh;
      overflow-y: auto;
    }
    #streamers-menu .menu-btn {
      flex: 0 1 calc(33.333% - 8px);
      font-size: 15px;
      padding: 10px 6px;
    }
    .streamers-grid {
      grid-template-columns: repeat(5, 1fr);
      width: min(92vw, 640px);
      gap: 8px;
      padding: 0 12px 8px;
      max-height: 62vh;
      max-height: 62dvh;
    }
    .streamer-card.locked {
      font-size: 16px;
    }
    #streamers-grid-title {
      font-size: 16px;
    }
  }
