/**
 * Overnight meta expansion — Daily Hub, Quest RPG, Auth Portal, game polish.
 */

/* ===== Auth welcome portal ===== */
.auth-portal-overlay {
  z-index: 14000;
}

.auth-portal-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 20%, rgba(168, 85, 247, 0.25), rgba(4, 3, 12, 0.92));
  backdrop-filter: blur(10px);
}

.auth-portal-card,
.auth-portal-actions button,
.auth-portal-close {
  pointer-events: auto;
}

.auth-portal-card {
  position: relative;
  width: min(480px, 100%);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(165deg, #241a38 0%, #100c18 55%, #0a0812 100%);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  animation: auth-portal-in 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes auth-portal-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.auth-portal-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 60%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18), transparent 70%);
  pointer-events: none;
}

.auth-portal-pets {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 2rem;
}

.auth-portal-pet {
  animation: auth-pet-float 3s ease-in-out infinite;
}

.auth-portal-pet--2 { animation-delay: 0.4s; }
.auth-portal-pet--3 { animation-delay: 0.8s; }

@keyframes auth-pet-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.auth-portal-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}

.auth-portal-header h1 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.65rem;
  background: linear-gradient(90deg, #fde68a, #f472b6, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-portal-header p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 230, 245, 0.72);
}

.auth-portal-features {
  margin: 1.1rem 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.auth-portal-features li {
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}

.auth-portal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-portal-cta {
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
}

.auth-portal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  cursor: pointer;
}

/* ===== Topbar daily button ===== */
.beta-ui-btn--daily {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  border: none;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
  animation: daily-pulse 2.5s ease-in-out infinite;
}

@keyframes daily-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 22px rgba(239, 68, 68, 0.55); }
}

.cat-room-daily-btn {
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fde68a !important;
}

/* ===== Daily Hub ===== */
.daily-hub-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(14, 12, 24, 0.95));
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.daily-hub-streak {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.daily-hub-streak-flame {
  font-size: 2rem;
  animation: streak-flame 1.2s ease-in-out infinite;
}

@keyframes streak-flame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.daily-hub-streak span:first-of-type {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

.daily-hub-streak strong {
  font-size: 1.4rem;
  color: #fde68a;
}

.daily-hub-stats {
  display: flex;
  gap: 1.25rem;
}

.daily-hub-stats div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.daily-hub-stats span {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.daily-hub-stats strong {
  font-size: 1.1rem;
  color: #7dd3fc;
}

.daily-hub-challenge {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: rgba(12, 10, 22, 0.92);
}

.daily-hub-challenge-icon {
  font-size: 1.75rem;
  text-align: center;
}

.daily-hub-progress {
  height: 6px;
  margin: 0.4rem 0 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.daily-hub-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #f472b6);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.daily-hub-progress-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}

.daily-hub-actions {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.daily-hub-arcade-preview h4 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
}

.daily-hub-arcade-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Quest RPG ===== */
.rpg-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(10, 8, 18, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.rpg-panel-level strong {
  font-size: 1.35rem;
  color: #c4b5fd;
}

.rpg-panel-xp {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}

.rpg-skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.rpg-skill-btn {
  font-size: 0.75rem;
  text-transform: capitalize;
}

.rpg-boss-card {
  margin-bottom: 0.65rem;
}

.rpg-defeated-list {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.rpg-battle-arena {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.rpg-fighter {
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rpg-fighter--boss {
  border-color: color-mix(in srgb, var(--boss-accent) 50%, transparent);
}

.rpg-boss-sprite {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.35rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  animation: boss-idle 2s ease-in-out infinite;
}

@keyframes boss-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.rpg-hp-bar {
  height: 8px;
  margin: 0.35rem 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.rpg-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width 0.25s ease;
}

.rpg-hp-bar--boss .rpg-hp-fill {
  background: linear-gradient(90deg, var(--boss-accent), #ef4444);
}

.rpg-hp-text {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
}

.rpg-battle-log {
  min-height: 2.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.82rem;
  text-align: center;
  color: #fde68a;
}

.rpg-battle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

/* ===== Snake & Block Stack ===== */
.snake-rush-wrap,
.block-stack-wrap {
  text-align: center;
}

.snake-rush-canvas,
.block-stack-canvas {
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.block-stack-controls {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.snake-rush-hint,
.block-stack-hint {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Companion pet breathe ===== */
.cat-room-scene-pet .cat-room-pet-sprite-img,
.cat-room-mini-scene-pet img {
  animation: companion-breathe 3.5s ease-in-out infinite;
}

@keyframes companion-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ===== Shop tabs scroll ===== */
.cat-room-shop-tabs {
  flex-wrap: wrap;
  gap: 0.25rem;
}

.cat-room-shop-tabs button[data-cat-shop-tab="daily"] {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.45);
}

.cat-room-shop-tabs button[data-cat-shop-tab="quest"] {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.45);
}

/* ===== Enhanced auth cards ===== */
.beta-auth-card {
  background: linear-gradient(165deg, #1e1630 0%, #0f0b18 100%) !important;
  border: 1px solid rgba(251, 191, 36, 0.2) !important;
}

.beta-auth-header h2 {
  background: linear-gradient(90deg, #fde68a, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
