/* ==========================================================================
   v3.0 — PREMIUM LAYER (glass, aurora, micro-interacciones y dopamina)
   Se carga después de styles.css y lo sobrescribe.
   ========================================================================== */
:root {
  --glass: rgba(22, 26, 34, 0.62);
  --glass-border: rgba(255, 255, 255, 0.09);
  --neon-g: #00ff9d;
  --neon-b: #00a2ff;
  --neon-y: #ffc400;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { scroll-behavior: smooth; }
body.roblox-theme {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 255, 157, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(0, 162, 255, 0.12), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(255, 196, 0, 0.06), transparent 60%),
    #090b10;
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom);
}
body.modal-open { overflow: hidden; }
::selection { background: rgba(0, 255, 157, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--neon-g); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a0c10; }
::-webkit-scrollbar-thumb { background: linear-gradient(#00b06f, #0083c9); border-radius: 10px; border: 2px solid #0a0c10; }

/* ---- Topbar de cristal ---- */
body.roblox-theme .roblox-topbar {
  background: rgba(10, 13, 19, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), inset 0 -1px 0 rgba(0, 255, 157, 0.12);
}
body.roblox-theme .brand-name { letter-spacing: -0.3px; }
body.roblox-theme .brand-name span {
  background: linear-gradient(90deg, var(--neon-g), var(--neon-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
body.roblox-theme .stat-pill {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s, border-color 0.25s;
}
body.roblox-theme .stat-pill:hover { transform: translateY(-2px); border-color: rgba(0, 255, 157, 0.45); box-shadow: 0 6px 20px rgba(0, 255, 157, 0.18); }
body.roblox-theme .robux-pill { box-shadow: 0 0 0 1px rgba(0, 255, 157, 0.25), 0 0 18px rgba(0, 255, 157, 0.15); }
.streak-pill { cursor: pointer; position: relative; }
.streak-pill.ready { border-color: #ff8a00; animation: streakReady 1.4s ease-in-out infinite; }
.streak-pill.ready::after {
  content: "!"; position: absolute; top: -6px; right: -6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #ff3b30; color: #fff; font-size: 0.65rem; font-weight: 900;
  display: grid; place-items: center; box-shadow: 0 0 10px #ff3b30;
}
@keyframes streakReady {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 0, 0.55); transform: scale(1); }
  50% { box-shadow: 0 0 0 9px rgba(255, 138, 0, 0); transform: scale(1.07); }
}
.gem-burst { animation: gemBurst 0.6s var(--ease-spring); }
@keyframes gemBurst {
  0% { transform: scale(1); } 35% { transform: scale(1.22); box-shadow: 0 0 28px rgba(0, 255, 157, 0.8); } 100% { transform: scale(1); }
}

/* ---- Hero ---- */
body.roblox-theme .hero-banner-card {
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 255, 157, 0.08), 0 0 60px rgba(0, 162, 255, 0.10);
}
body.roblox-theme .hero-banner-content h1 { letter-spacing: -0.8px; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); }
body.roblox-theme .hero-banner-content h1 span {
  background: linear-gradient(100deg, #00ff9d, #00d4ff 40%, #ffc400 80%, #00ff9d);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradientFlow 5s linear infinite;
  filter: drop-shadow(0 0 14px rgba(0, 255, 157, 0.45));
}
@keyframes gradientFlow { to { background-position: -250% 0; } }

/* ---- Tarjetas de cristal ---- */
body.roblox-theme .goal-card,
body.roblox-theme .badges-card,
body.roblox-theme .step-card,
body.roblox-theme .order-card,
body.roblox-theme .empty-state {
  background: linear-gradient(160deg, rgba(30, 36, 48, 0.72), rgba(16, 19, 27, 0.72));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
body.roblox-theme .step-card { transition: transform 0.35s var(--ease-spring), border-color 0.3s; }
body.roblox-theme .step-card:hover { transform: translateY(-6px); border-color: rgba(0, 255, 157, 0.4); }
body.roblox-theme .step-num {
  background: linear-gradient(135deg, var(--neon-g), var(--neon-b));
  color: #04120c; box-shadow: 0 0 22px rgba(0, 255, 157, 0.5);
}

/* ---- Barra de progreso viva ---- */
body.roblox-theme .progress-bar-bg { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5); border-radius: 99px; overflow: hidden; }
body.roblox-theme .progress-bar-fill {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0 10px, transparent 10px 20px),
    linear-gradient(90deg, #00b06f, #00ff9d 60%, #00d4ff);
  background-size: 40px 100%, 100% 100%;
  animation: barStripes 1.2s linear infinite;
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.7);
  transition: width 0.9s var(--ease-out);
  border-radius: 99px;
}
@keyframes barStripes { to { background-position: 40px 0, 0 0; } }
body.roblox-theme .goal-percentage { color: var(--neon-g); text-shadow: 0 0 14px rgba(0, 255, 157, 0.6); font-weight: 900; }

/* ---- Pestañas tipo píldora ---- */
body.roblox-theme .section-tabs {
  background: rgba(10, 13, 19, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 5px; gap: 4px;
  backdrop-filter: blur(12px);
  position: sticky; top: 62px; z-index: 40;
}
body.roblox-theme .tab-btn { border-radius: 12px; border: 0; background: transparent; transition: all 0.3s var(--ease-out); }
body.roblox-theme .tab-btn:hover { background: rgba(255, 255, 255, 0.06); }
body.roblox-theme .tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 255, 157, 0.22), rgba(0, 162, 255, 0.22));
  box-shadow: inset 0 0 0 1px rgba(0, 255, 157, 0.5), 0 6px 22px rgba(0, 255, 157, 0.18);
  color: #fff;
}
.tab-pane.active { animation: paneIn 0.45s var(--ease-out); }
@keyframes paneIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

body.roblox-theme .section-heading h2 {
  background: linear-gradient(90deg, #fff, #9fe9ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- Combo diario ---- */
.combo-bar {
  margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 196, 0, 0.12), rgba(255, 85, 0, 0.08));
  border: 1px solid rgba(255, 196, 0, 0.35);
}
.combo-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.74rem; margin-bottom: 8px; }
.combo-title { font-weight: 900; color: var(--neon-y); letter-spacing: 0.6px; }
.combo-text { color: #e2e8f0; font-weight: 600; }
.combo-track { height: 9px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
.combo-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #ffc400, #ff5500);
  box-shadow: 0 0 14px rgba(255, 140, 0, 0.8);
  transition: width 0.8s var(--ease-out);
}

/* ---- Tareas ---- */
body.roblox-theme .task-card {
  background: linear-gradient(160deg, rgba(32, 38, 50, 0.8), rgba(18, 22, 30, 0.8));
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  position: relative; overflow: hidden;
  animation: cardIn 0.5s var(--ease-out) both;
}
body.roblox-theme .task-card:nth-child(2) { animation-delay: 0.06s; }
body.roblox-theme .task-card:nth-child(3) { animation-delay: 0.12s; }
body.roblox-theme .task-card:nth-child(4) { animation-delay: 0.18s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
body.roblox-theme .task-card:hover { border-color: rgba(0, 255, 157, 0.45); box-shadow: 0 14px 36px rgba(0, 255, 157, 0.12); }
body.roblox-theme .task-card.completed { opacity: 0.6; filter: saturate(0.6); }
body.roblox-theme .task-reward-pill {
  background: rgba(0, 255, 157, 0.12); border: 1px solid rgba(0, 255, 157, 0.4);
  color: var(--neon-g); font-weight: 900; text-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

/* ---- Botones con brillo ---- */
body.roblox-theme .roblox-btn-green,
body.roblox-theme .btn-task:not(:disabled),
body.roblox-theme .btn-redeem.ready {
  background: linear-gradient(135deg, #00d583, #00a863);
  box-shadow: 0 6px 20px rgba(0, 200, 120, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative; overflow: hidden;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.25s;
}
body.roblox-theme .roblox-btn-green::after,
body.roblox-theme .btn-task:not(:disabled)::after,
body.roblox-theme .btn-redeem.ready::after {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg); animation: btnShine 3.2s ease-in-out infinite; pointer-events: none;
}
@keyframes btnShine { 0%, 60% { left: -80%; } 100% { left: 140%; } }
body.roblox-theme .roblox-btn-green:hover,
body.roblox-theme .btn-task:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 30px rgba(0, 220, 130, 0.55); }
body.roblox-theme .roblox-btn-green:active,
body.roblox-theme .btn-task:active:not(:disabled) { transform: scale(0.97); }
.btn-task { min-height: 38px; }
body.roblox-theme .btn-task.verifying {
  background: linear-gradient(90deg, #00a2ff var(--verify-progress, 0%), rgba(255, 255, 255, 0.08) var(--verify-progress, 0%));
  color: #fff; box-shadow: none;
}
.btn-task.verifying::after { display: none; }
.btn-task:disabled { cursor: not-allowed; }

/* ---- Tienda de tarjetas ---- */
body.roblox-theme .reward-item {
  background: linear-gradient(160deg, rgba(32, 38, 50, 0.8), rgba(16, 20, 28, 0.85));
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
body.roblox-theme .reward-item.selected-goal {
  border-color: var(--neon-g);
  box-shadow: 0 0 0 1px var(--neon-g), 0 0 38px rgba(0, 255, 157, 0.25), 0 16px 40px rgba(0, 0, 0, 0.4);
}
body.roblox-theme .reward-item:hover .rc-img { transform: scale(1.06) rotate(-1.5deg); }

/* ---- Insignias ---- */
body.roblox-theme .badge-item { background: rgba(255, 255, 255, 0.035); border: 1px solid var(--glass-border); }
body.roblox-theme .badge-item.unlocked { border-color: var(--neon-y); animation: badgeGlow 1.6s ease-in-out infinite; }
@keyframes badgeGlow { 0%, 100% { box-shadow: 0 0 0 rgba(255, 196, 0, 0); } 50% { box-shadow: 0 0 26px rgba(255, 196, 0, 0.55); } }

/* ---- Modales ---- */
body.roblox-theme .modal-backdrop {
  background: rgba(3, 5, 9, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.roblox-theme .modal-backdrop.show .roblox-modal { animation: modalPop 0.45s var(--ease-spring); }
@keyframes modalPop { from { opacity: 0; transform: translateY(30px) scale(0.92); } to { opacity: 1; transform: none; } }
body.roblox-theme .roblox-modal {
  background: linear-gradient(160deg, rgba(30, 36, 48, 0.96), rgba(14, 17, 24, 0.98));
  border: 1px solid var(--glass-border);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 60px rgba(0, 255, 157, 0.1);
}
.streak-reward-amount .bonus-num { text-shadow: 0 0 30px rgba(255, 196, 0, 0.8); animation: bonusPulse 1.6s ease-in-out infinite; display: inline-block; }
@keyframes bonusPulse { 50% { transform: scale(1.12); } }
.modal-fire { animation: fireDance 1.1s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(255, 120, 0, 0.8)); }
@keyframes fireDance { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }

/* Semana de racha */
.streak-week { display: flex; justify-content: center; gap: 7px; margin: 4px 0 14px; }
.streak-day {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border);
  font-weight: 800; font-size: 0.8rem; color: #64748b;
}
.streak-day.done { background: linear-gradient(135deg, #ff9d00, #ff5500); color: #fff; border-color: #ffb347; box-shadow: 0 0 14px rgba(255, 130, 0, 0.55); }
.streak-day.big { width: 44px; }

/* ---- PIN entregado ---- */
.pin-box { margin-top: 10px; background: rgba(0, 0, 0, 0.4); padding: 12px 14px; border-radius: 12px; border: 1px solid #00b06f; box-shadow: 0 0 22px rgba(0, 176, 111, 0.25); }
.pin-label { font-size: 0.72rem; color: #8b929a; margin-bottom: 4px; }
.pin-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pin-value { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; font-weight: 800; color: #00e692; letter-spacing: 1px; word-break: break-all; }
.pin-copy-btn { background: #232527; border: 1px solid #4e5256; color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 0.75rem; cursor: pointer; font-weight: 700; transition: all 0.2s; }
.pin-copy-btn:hover { background: #00b06f; border-color: #00b06f; }
.pin-note { font-size: 0.68rem; color: #64748b; margin-top: 6px; }
body.roblox-theme .status-delivered { background: rgba(0, 176, 111, 0.15); color: #00e692; border: 1px solid #00b06f; }

/* ---- Éxito pedido manta ---- */
.blanket-success {
  text-align: center; padding: 26px 18px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(0, 176, 111, 0.18), rgba(0, 162, 255, 0.12));
  border: 1px solid rgba(0, 255, 157, 0.45);
  animation: modalPop 0.5s var(--ease-spring);
}
.blanket-success h3 { margin: 6px 0 10px; font-size: 1.15rem; }
.blanket-success p { color: #cbd5e1; font-size: 0.85rem; margin: 6px 0; }
.success-emoji { font-size: 2.6rem; display: inline-block; animation: fireDance 1.1s ease-in-out infinite; }

/* ---- Gema flotante ---- */
.gem-pop {
  position: fixed; z-index: 9999; pointer-events: none;
  transform: translate(-50%, 0); font-weight: 900; font-size: 1.25rem; color: var(--neon-g);
  text-shadow: 0 0 14px rgba(0, 255, 157, 0.9), 0 2px 0 #04120c;
  display: flex; align-items: center; gap: 4px;
  animation: gemPop 1.3s var(--ease-out) forwards;
}
.gem-pop svg { width: 20px; height: 20px; }
@keyframes gemPop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(1); }
}

/* ---- Toast ---- */
body.roblox-theme .live-toast {
  background: rgba(14, 18, 26, 0.92); backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 255, 157, 0.4);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 255, 157, 0.15);
}

/* ---- Footer ---- */
.footer-admin-link { color: #475569; text-decoration: none; font-size: 0.66rem; opacity: 0.5; }
.footer-admin-link:hover { opacity: 1; }

/* ---- Móvil ---- */
@media (max-width: 520px) {
  body.roblox-theme .section-tabs { top: 56px; }
  .streak-day { width: 30px; height: 30px; }
  .combo-head { font-size: 0.68rem; }
}

/* ---- Accesibilidad: respeta reducir movimiento ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 430px) {
  body.roblox-theme .user-stats { gap: 5px; }
  body.roblox-theme .stat-pill { padding-left: 8px; padding-right: 8px; }
  body.roblox-theme .brand { gap: 6px; min-width: 0; }
  body.roblox-theme .brand-name { font-size: 0.95rem; }
  body.roblox-theme .sound-toggle-btn { width: 30px; height: 30px; }
}
