/* ============================================================
   Hörweite — Home Redesign
   Scope: #state-idle  +  .hw-home-redesign helpers
   Design tokens inherited from nav.css
   ============================================================ */

/* --- Typography base (only inside home) ---------------------- */
#state-idle.state {
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

/* --- 1. Live-stat card (above hero) -------------------------- */
.hw-live-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 14px auto 18px;
  padding: 8px 14px 8px 12px;
  background: rgba(107, 95, 255, 0.08);
  border: 1px solid rgba(107, 95, 255, 0.22);
  border-radius: 999px;
  color: var(--hw-cream, #F3EFE0);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(107, 95, 255, 0.12);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.hw-live-stat__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hw-aurora, #6B5FFF);
  box-shadow: 0 0 0 0 rgba(107, 95, 255, 0.7);
  animation: hw-pulse-aurora 1.8s ease-out infinite;
  flex-shrink: 0;
}
.hw-live-stat__sep {
  opacity: 0.35;
  margin: 0 2px;
}
.hw-live-stat__num {
  color: var(--hw-moon, #8EC5FC);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@keyframes hw-pulse-aurora {
  0%   { box-shadow: 0 0 0 0   rgba(107, 95, 255, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(107, 95, 255, 0); }
  100% { box-shadow: 0 0 0 0   rgba(107, 95, 255, 0); }
}

/* --- 2. Hero refinement -------------------------------------- */
#state-idle .idle-hero {
  padding: 8px 24px 28px !important;
  text-align: center;
  position: relative;
  transition: padding 0.3s ease, transform 0.3s ease;
}
#state-idle .idle-title {
  font-family: 'Satoshi', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(28px, 7.2vw, 40px) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
  color: var(--hw-cream, #F3EFE0) !important;
  margin: 0 auto 10px !important;
  max-width: 18ch;
}
#state-idle .idle-title .hw-accent {
  font-family: 'Fraunces', 'Satoshi', serif;
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(135deg, var(--hw-moon, #8EC5FC) 0%, var(--hw-aurora, #6B5FFF) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 2px;
}
#state-idle .idle-sub,
#state-idle .idle-subtitle {
  color: var(--hw-cream-dim, #B8B5A8) !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  max-width: 32ch;
  margin: 0 auto 22px !important;
}

/* --- 3. Primary CTA (#btnCreate) ----------------------------- */
#state-idle #btnCreate {
  font-family: 'Satoshi', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
  font-size: 16px !important;
  padding: 15px 28px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, var(--hw-aurora, #6B5FFF) 0%, #8A7BFF 100%) !important;
  box-shadow: 0 10px 34px -8px rgba(107, 95, 255, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}
#state-idle #btnCreate:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px -10px rgba(107, 95, 255, 0.7),
              inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
#state-idle #btnCreate:active {
  transform: translateY(0);
}

/* --- 4. Vibe-chip filter row --------------------------------- */
.hw-vibe-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 20px 4px;
  margin: 6px -20px 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.hw-vibe-row::-webkit-scrollbar { display: none; }
.hw-vibe-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-family: 'Satoshi', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--hw-cream, #F3EFE0);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  scroll-snap-align: start;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hw-vibe-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}
.hw-vibe-chip.is-active {
  background: rgba(107, 95, 255, 0.18);
  border-color: rgba(107, 95, 255, 0.45);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(107, 95, 255, 0.15) inset,
              0 4px 16px -4px rgba(107, 95, 255, 0.35);
}
.hw-vibe-chip__emoji {
  font-size: 14px;
  line-height: 1;
}

/* --- 5. Nearby section header -------------------------------- */
#state-idle .nearby-section {
  padding: 0 20px !important;
  margin-top: 6px;
}
.hw-nearby-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 2px 14px;
}
.hw-nearby-head__title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--hw-cream, #F3EFE0);
  margin: 0;
}
.hw-nearby-head__count {
  font-family: 'Satoshi', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--hw-cream-dim, #B8B5A8);
  font-variant-numeric: tabular-nums;
}

/* --- 6. Room cards (override) -------------------------------- */
#state-idle .nearby-card,
#state-idle .room-card {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px !important;
  margin-bottom: 10px !important;
  background: linear-gradient(135deg,
              rgba(255, 255, 255, 0.04) 0%,
              rgba(255, 255, 255, 0.02) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 18px !important;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
#state-idle .nearby-card:hover,
#state-idle .room-card:hover {
  background: linear-gradient(135deg,
              rgba(255, 255, 255, 0.06) 0%,
              rgba(255, 255, 255, 0.03) 100%) !important;
  border-color: rgba(107, 95, 255, 0.3) !important;
  transform: translateY(-1px);
}

/* Avatar circle with host initial */
.hw-room-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Satoshi', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--hw-aurora, #6B5FFF), var(--hw-moon, #8EC5FC));
  position: relative;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
              0 3px 10px -2px rgba(107, 95, 255, 0.35);
}
.hw-room-avatar[data-vibe="gaming"]  { background: linear-gradient(135deg, #FF6B6B, #FFA94D); }
.hw-room-avatar[data-vibe="chill"]   { background: linear-gradient(135deg, #8EC5FC, #A6D8B0); }
.hw-room-avatar[data-vibe="tief"]    { background: linear-gradient(135deg, #6B5FFF, #3D3B8A); }
.hw-room-avatar[data-vibe="skurril"] { background: linear-gradient(135deg, #FFB86B, #FF6BB8); }
.hw-room-avatar[data-vibe="late"]    { background: linear-gradient(135deg, #131A3C, #6B5FFF); }
.hw-room-avatar[data-vibe="alltag"]  { background: linear-gradient(135deg, #B8B5A8, #F3EFE0); color: #0B1026; }

.hw-room-avatar__vibe {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: var(--hw-night-1, #131A3C);
  border: 2px solid var(--hw-night-0, #0B1026);
  line-height: 1;
}

.hw-room-body {
  flex: 1 1 auto;
  min-width: 0;
}
.hw-room-title {
  font-family: 'Satoshi', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--hw-cream, #F3EFE0);
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.hw-room-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Satoshi', sans-serif;
  font-size: 12px;
  color: var(--hw-cream-dim, #B8B5A8);
  font-weight: 500;
}
.hw-room-meta__host {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hw-room-meta__dot {
  opacity: 0.4;
}
.hw-room-meta__listeners {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--hw-moon, #8EC5FC);
}
.hw-room-meta__listeners::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ED598;
  box-shadow: 0 0 6px rgba(62, 213, 152, 0.6);
  animation: hw-pulse-live 2s ease-in-out infinite;
}
@keyframes hw-pulse-live {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.hw-room-distance {
  flex-shrink: 0;
  font-family: 'Satoshi', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--hw-cream, #F3EFE0);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 5px 10px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* --- 7. Empty-state refresh --------------------------------- */
#state-idle .nearby-empty,
.hw-nearby-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--hw-cream-dim, #B8B5A8);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.hw-nearby-empty__icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.7;
}
.hw-nearby-empty strong {
  display: block;
  color: var(--hw-cream, #F3EFE0);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

/* --- 8. Sticky mini-hero on scroll --------------------------- */
#state-idle.hw-scrolled .idle-hero {
  padding-top: 4px !important;
  padding-bottom: 14px !important;
}
#state-idle.hw-scrolled .idle-title {
  font-size: clamp(20px, 5vw, 24px) !important;
  margin-bottom: 4px !important;
}
#state-idle.hw-scrolled .idle-sub,
#state-idle.hw-scrolled .idle-subtitle {
  opacity: 0;
  max-height: 0;
  margin: 0 !important;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.25s ease;
}
#state-idle.hw-scrolled .hw-live-stat {
  transform: scale(0.94);
  opacity: 0.9;
}

/* --- 9. Responsive tweaks ------------------------------------ */
@media (max-width: 380px) {
  #state-idle .idle-title { font-size: 26px !important; }
  .hw-room-avatar { width: 44px; height: 44px; font-size: 16px; }
  .hw-vibe-chip { padding: 8px 12px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-live-stat__dot,
  .hw-room-meta__listeners::before {
    animation: none;
  }
  #state-idle .nearby-card,
  #state-idle .room-card,
  #state-idle #btnCreate {
    transition: none !important;
  }
}
