/* ===== Home Lobby, Setup Wizard, Mode Screens, Loading Bar & Crystal FX ===== */

.home-shell {
  position: relative;
  padding: 16px 16px 96px;
  gap: 14px;
  overflow: hidden;
}

/* Concert Stage Illustrated Background + Animated Spotlights */
body.has-custom-bg .home-stage-glow {
  display: none;
}

.home-stage-glow {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 6, 22, 0.12) 0%, rgba(9, 6, 22, 0.45) 42%, rgba(9, 6, 22, 0.92) 78%, #090616 100%),
    url("../assets/stage-bg.jpg") center top / cover no-repeat;
  pointer-events: none;
  z-index: 0;
}

.home-stage-glow::after {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 120vw);
  height: 260px;
  background: radial-gradient(ellipse at 50% 10%, rgba(192, 132, 252, 0.28), transparent 65%);
  animation: stageBreath 5s ease-in-out infinite alternate;
}

@keyframes stageBreath {
  0% { opacity: 0.65; transform: translateX(-50%) scale(0.97); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.home-shell > * {
  position: relative;
  z-index: 1;
}

/* Home Top Bar */
.home-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(192, 132, 252, 0.55);
  background: linear-gradient(135deg, #2d1b54, #140b29);
  color: #fff;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(157, 78, 221, 0.45);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
  padding: 0;
  overflow: hidden;
}

.home-avatar-btn:active {
  transform: scale(0.93);
}

.home-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 12, 42, 0.78);
  border: 1px solid rgba(192, 132, 252, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.home-stat-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.home-stat-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.16);
}

.home-gear-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(25, 16, 52, 0.78);
  border: 1px solid rgba(192, 132, 252, 0.3);
  color: #d8c8ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.home-gear-btn:hover {
  background: rgba(45, 28, 92, 0.9);
}

.home-gear-btn:active {
  transform: rotate(35deg) scale(0.92);
}

.home-gear-btn svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

/* Home Center Stage (Uncluttered Hero + Quick Play) */
.home-center-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px 0 42px;
}

.home-tagline {
  margin: 4px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(233, 213, 255, 0.82);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* Home Hero Logo */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 0 4px;
  gap: 6px;
}

.home-eq-logo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 28px;
}

.home-eq-logo span {
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff79e6 0%, #9d4edd 100%);
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.75);
  animation: homeEqBounce 1.4s ease-in-out infinite alternate;
}

.home-eq-logo span:nth-child(1) { height: 11px; animation-delay: 0s; }
.home-eq-logo span:nth-child(2) { height: 20px; animation-delay: 0.2s; }
.home-eq-logo span:nth-child(3) { height: 28px; animation-delay: 0.4s; }
.home-eq-logo span:nth-child(4) { height: 18px; animation-delay: 0.15s; }
.home-eq-logo span:nth-child(5) { height: 12px; animation-delay: 0.35s; }

@keyframes homeEqBounce {
  0% { transform: scaleY(0.72); opacity: 0.82; }
  100% { transform: scaleY(1.12); opacity: 1; }
}

.home-title {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 10%, #f3d5ff 55%, #e879f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(168, 85, 247, 0.72));
}

/* Quick Play Row with Flanking Neon Soundwaves */
.quickplay-row-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.hero-wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 44px;
  flex-shrink: 0;
}

.hero-wave-bars span {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c084fc 0%, #7c3aed 100%);
  opacity: 0.65;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
  animation: heroWavePulse 1.3s ease-in-out infinite alternate;
}

.hero-wave-bars span:nth-child(1) { height: 10px; animation-delay: 0.1s; }
.hero-wave-bars span:nth-child(2) { height: 22px; animation-delay: 0.3s; }
.hero-wave-bars span:nth-child(3) { height: 34px; animation-delay: 0.05s; }
.hero-wave-bars span:nth-child(4) { height: 20px; animation-delay: 0.4s; }
.hero-wave-bars span:nth-child(5) { height: 12px; animation-delay: 0.2s; }

.hero-wave-bars.flipped span:nth-child(1) { height: 12px; }
.hero-wave-bars.flipped span:nth-child(3) { height: 34px; }
.hero-wave-bars.flipped span:nth-child(5) { height: 10px; }

@keyframes heroWavePulse {
  0% { transform: scaleY(0.55); opacity: 0.45; }
  100% { transform: scaleY(1.15); opacity: 0.9; }
}

/* Primary Quick Play Hero Button */
.home-quickplay-btn {
  position: relative;
  overflow: hidden;
  flex: 1;
  border: 1.5px solid rgba(216, 180, 254, 0.68);
  border-radius: 26px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 48%, #9333ea 100%);
  box-shadow:
    0 12px 34px rgba(124, 58, 237, 0.58),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.home-quickplay-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.26) 50%, transparent 80%);
  animation: heroShimmer 3.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes heroShimmer {
  0%, 60% { left: -120%; }
  100% { left: 160%; }
}

.home-quickplay-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 40px rgba(147, 51, 234, 0.7);
}

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

.quickplay-play-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quickplay-play-icon svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.quickplay-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.quickplay-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.quickplay-sub {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

/* 2-Column Mode Cards Grid */
.home-modes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.mode-card {
  position: relative;
  border-radius: 20px;
  padding: 16px 14px 14px;
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  overflow: hidden;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.28);
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.mode-card:active {
  transform: scale(0.96);
}

.mode-card-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.5));
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-card:hover .mode-card-svg {
  transform: scale(1.1) translateY(-1px);
}

.mode-card-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.mode-card-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
}

.mode-card-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

.mode-card-arrow {
  position: absolute;
  left: 11px;
  bottom: 10px;
  font-size: 16px;
  opacity: 0.75;
  font-weight: 700;
}

.mode-card.theme-blue {
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.92) 0%, rgba(30, 27, 75, 0.92) 100%);
  border-color: rgba(129, 140, 248, 0.55);
}

.mode-card.theme-gold {
  background: linear-gradient(145deg, rgba(217, 119, 6, 0.92) 0%, rgba(92, 41, 8, 0.92) 100%);
  border-color: rgba(251, 191, 36, 0.55);
}

.mode-card.theme-pink {
  background: linear-gradient(145deg, rgba(219, 39, 119, 0.9) 0%, rgba(88, 18, 66, 0.94) 100%);
  border-color: rgba(244, 114, 182, 0.55);
}

.mode-card.theme-green {
  background: linear-gradient(145deg, rgba(22, 163, 74, 0.9) 0%, rgba(12, 66, 36, 0.94) 100%);
  border-color: rgba(74, 222, 128, 0.55);
}

.mode-card.theme-cyan {
  background: linear-gradient(145deg, rgba(8, 145, 178, 0.92) 0%, rgba(12, 46, 74, 0.94) 100%);
  border-color: rgba(56, 217, 255, 0.55);
}

.mode-card.theme-violet {
  background: linear-gradient(145deg, rgba(126, 34, 206, 0.88) 0%, rgba(44, 14, 78, 0.94) 100%);
  border-color: rgba(192, 132, 252, 0.52);
}

/* Weekly Featured Song Banner */
.home-weekly-banner {
  width: 100%;
  border-radius: 20px;
  padding: 13px 16px;
  border: 1px solid rgba(192, 132, 252, 0.45);
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.72) 0%, rgba(30, 14, 62, 0.88) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.18s ease, border-color 0.2s ease;
}

.home-weekly-banner:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 180, 254, 0.78);
}

.weekly-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ec4899, #7c3aed, #06b6d4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}

.weekly-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.weekly-title {
  font-size: 16px;
  font-weight: 800;
}

.weekly-sub {
  font-size: 11.5px;
  color: var(--text-sub);
}

/* ===== Quick Play Setup Screens (Genres -> Decades) & Mode Screens ===== */
.setup-shell {
  padding: 20px 16px 36px;
  gap: 16px;
}

.setup-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setup-back-btn {
  background: rgba(31, 21, 62, 0.85);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s ease, transform 0.15s ease;
}

.setup-back-btn:hover {
  background: rgba(58, 36, 110, 0.92);
}

.setup-back-btn:active {
  transform: scale(0.95);
}

.setup-step-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #e9d5ff;
  background: rgba(147, 51, 234, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.45);
  padding: 5px 12px;
  border-radius: 999px;
}

.setup-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}

.setup-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
}

.setup-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  flex: 1;
  align-content: start;
}

.setup-choice-card {
  background: var(--surface-elevated);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  gap: 4px;
  transition: all 0.18s ease;
}

.setup-choice-card.full-span {
  grid-column: span 2;
  align-items: center;
  text-align: center;
}

.setup-choice-card.selected {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.35), rgba(76, 29, 149, 0.55));
  border-color: #c084fc;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
}

.setup-choice-title {
  font-size: 14px;
  font-weight: 800;
}

.setup-choice-desc {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.3;
}

.setup-confirm-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.45);
  transition: transform 0.16s ease, filter 0.18s ease;
  margin-top: auto;
}

.setup-confirm-btn:hover {
  filter: brightness(1.08);
}

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

/* Mode Detail Screen */
.settings-page-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-detail-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  margin: auto 0;
}

.mode-detail-icon {
  font-size: 54px;
  line-height: 1;
}

.mode-detail-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.mode-detail-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.5;
  max-width: 310px;
}

.mode-detail-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(192, 132, 252, 0.16);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

/* ===== Song Loading Progress Bar ===== */
.song-loading-wrap {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.song-loading-wrap.visible {
  display: flex;
  animation: fadeUp 0.2s ease-out;
}

.song-loading-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  border: 1px solid rgba(192, 132, 252, 0.25);
}

.song-loading-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9d4edd 0%, #ec4899 50%, #38d9ff 100%);
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.75);
  transition: width 0.24s ease-out;
}

.song-loading-text {
  font-size: 11.5px;
  font-weight: 700;
  color: #d8c8ff;
}

/* ===== Crystal Reward Flying Animation ===== */
.crystal-fly-particle {
  position: fixed;
  z-index: 450;
  pointer-events: none;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(56, 217, 255, 0.95));
  will-change: transform, opacity;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.85s ease;
}

.crystal-float-text {
  position: fixed;
  z-index: 455;
  pointer-events: none;
  font-size: 20px;
  font-weight: 800;
  color: #8bf0ff;
  text-shadow: 0 2px 14px rgba(56, 217, 255, 0.9);
  animation: crystalFloatUp 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes crystalFloatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.7);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.12);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -62px) scale(0.95);
  }
}

/* Hide bottom nav while inside active game or setup screens */
body.hide-bottom-nav .bottom-nav {
  display: none;
}

/* In-Game Lobby Exit Button (Top-Right in RTL, icon only) */
.lobby-exit-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 21, 62, 0.88);
  border: 1px solid rgba(192, 132, 252, 0.42);
  color: #ffffff;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: background 0.18s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.lobby-exit-btn:hover {
  background: rgba(66, 36, 124, 0.94);
}

.lobby-exit-btn:active {
  transform: scale(0.92);
}

/* מסתיר תפריטי קריסטלים, ז'אנרים ועשורים בזמן שנמצאים בתוך המשחק */
#screen-game #points-badge,
#screen-game #menu-toggle-btn,
#screen-game .filter-pills-group {
  display: none;
}

#screen-game .filter-summary-row {
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Timed Mode 60s HUD Bar */
.timed-hud-bar {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 2px;
}

.timed-hud-bar.visible {
  display: flex;
}

.timed-hud-pill {
  background: rgba(24, 15, 52, 0.88);
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timed-hud-pill.clock strong {
  color: #4ade80;
  direction: ltr;
}

.timed-hud-pill.clock strong.is-low {
  color: #ff4d5e;
  animation: shake 0.4s ease infinite;
}

.timed-delta-flash {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.timed-delta-flash.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.timed-delta-flash.bonus { color: #4ade80; }
.timed-delta-flash.penalty { color: #ff5c6c; }

/* Global Leaderboard Table */
.leaderboard-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 290px;
  overflow-y: auto;
  margin-top: 6px;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 9, 34, 0.8);
  border: 1px solid rgba(192, 132, 252, 0.22);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
}

.lb-row.is-me {
  border-color: var(--spotify-green);
  background: rgba(29, 185, 84, 0.14);
}

.lb-rank {
  min-width: 28px;
  font-weight: 800;
  text-align: center;
}

.lb-name {
  flex: 1;
  font-weight: 800;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  direction: ltr;
  white-space: nowrap;
}

.lb-empty {
  font-size: 12px;
  color: var(--text-sub);
  padding: 14px;
  text-align: center;
}
