/* =========================================
   REUSABLE UI COMPONENTS & HOMEPAGE LAYOUT
   ========================================= */

/* Floating Glass Header */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  background: var(--accent-purple);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 3px 0 #4B32A8;
  transform: rotate(-4deg);
}

.nav-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(56, 229, 157, 0.6);
  animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(56, 229, 157, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(56, 229, 157, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 229, 157, 0); }
}

/* Tactile Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform var(--transition-snappy), background var(--transition-snappy), box-shadow var(--transition-snappy);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: none !important;
}

.btn-primary {
  background: var(--accent-purple);
  color: #FFFFFF;
  box-shadow: var(--shadow-tactile-purple);
}

.btn-primary:hover {
  background: var(--accent-purple-hover);
  transform: translateY(-1px);
}

.btn-orange {
  background: var(--accent-orange);
  color: #171522;
  box-shadow: var(--shadow-tactile-orange);
}

.btn-orange:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.875rem;
  border-radius: 10px;
}

/* Badges / Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-orange {
  background: rgba(255, 138, 69, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 138, 69, 0.3);
}

.tag-blue {
  background: rgba(69, 169, 245, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(69, 169, 245, 0.3);
}

.tag-purple {
  background: rgba(118, 87, 232, 0.18);
  color: #B49FFF;
  border: 1px solid rgba(118, 87, 232, 0.35);
}

/* Homepage Hero Layout */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding: 36px 0 64px;
}

.hero-eyebrow {
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(2.6rem, 5vw, 4.25rem);
  margin-bottom: 20px;
}

.hero-title .highlight-orange {
  color: var(--accent-orange);
}

.hero-title .highlight-blue {
  color: var(--accent-blue);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Featured Live Stage Card (Hero Right) */
.stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  position: relative;
  transform: rotate(1.2deg);
  transition: transform var(--transition-snappy);
}

.stage-card:hover {
  transform: rotate(0deg) translateY(-4px);
}

.stage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.prompt-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

.prompt-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.prompt-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sample-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.reply-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.reply-author {
  font-weight: 700;
  color: var(--accent-blue);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 2px;
}

.vote-pill {
  background: var(--bg-surface-hover);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Section Header & Experience Cards */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.section-title {
  font-size: 1.75rem;
}

.experiences-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.exp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  transition: transform var(--transition-snappy), border-color var(--transition-snappy);
}

.exp-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.exp-card h3 {
  font-size: 1.3rem;
  margin: 12px 0 8px;
}

.exp-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.exp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Responsive Breakpoints */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 16px;
  }

  .stage-card {
    transform: none;
  }

  .experiences-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav-status-pill {
    display: none;
  }
}
/* =========================================
   THE LOBBY HUB, ROOM CARDS & MODALS
   ========================================= */

.lobby-header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.lobby-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Join by Code Input Group */
.code-join-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 4px 4px 4px 14px;
}

.code-join-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 110px;
  outline: none;
}

.code-join-box input::placeholder {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-muted);
}

/* Daily Chaos Spotlight Banner inside Lobby */
.chaos-banner {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 138, 69, 0.35);
  border-left: 5px solid var(--accent-orange);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
}

/* Filter Pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.filter-pill {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-snappy);
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #FFFFFF;
}

/* Active Rooms Grid */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.room-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  transition: transform var(--transition-snappy), border-color var(--transition-snappy);
}

.room-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.room-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.room-code-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-canvas);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.room-title {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.room-meta {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.room-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.player-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 18, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 200;
}

.modal-backdrop.open {
  display: grid;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-card);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-purple);
}

/* Toast Notification */
.toast-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-mint);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-card);
  transform: translateY(120%);
  opacity: 0;
  transition: all 240ms ease;
  z-index: 300;
}

.toast-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-banner.toast-error {
  border-color: var(--accent-orange);
}

@media (max-width: 768px) {
  .rooms-grid {
    grid-template-columns: 1fr;
  }
}
/* =========================================
   DAILY CHAOS STAGE & VOTING CARDS
   ========================================= */

.chaos-stage-layout {
  max-width: 780px;
  margin: 0 auto;
}

.chaos-prompt-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.chaos-prompt-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.chaos-question {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 22px;
}

.chaos-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.chaos-textarea:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.chaos-textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.chaos-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Feed Controls */
.chaos-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

/* Entry Card & Upvote Button */
.chaos-entries-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chaos-entry-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  transition: transform var(--transition-snappy), border-color var(--transition-snappy);
}

.chaos-entry-card:hover {
  border-color: var(--border-strong);
}

.chaos-entry-card.is-voted {
  border-color: rgba(255, 138, 69, 0.45);
}

.chaos-entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.chaos-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-orange);
}

.chaos-entry-text {
  font-size: 1.02rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.vote-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-weight: 800;
  transition: all var(--transition-snappy);
}

.vote-action-btn:hover {
  border-color: var(--accent-orange);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.vote-action-btn.voted {
  background: rgba(255, 138, 69, 0.16);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.vote-arrow {
  font-size: 0.75rem;
  line-height: 1;
  margin-bottom: 3px;
}

.vote-number {
  font-family: var(--font-display);
  font-size: 1rem;
}
/* =========================================
   LIVE ROOM & MULTIPLAYER STAGE STYLES
   ========================================= */

.room-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.room-main-stage {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.spotlight-box {
  background: var(--bg-canvas);
  border: 1px solid rgba(118, 87, 232, 0.4);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin: 20px 0 24px;
}

.spotlight-timer {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-orange);
  margin: 10px 0;
}

.room-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.participant-pill {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.room-chat-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 260px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-message-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  border-radius: 10px;
}

@media (max-width: 920px) {
  .room-layout-grid {
    grid-template-columns: 1fr;
  }
}
/* =========================================
   GLOBAL LEADERBOARD STYLES
   ========================================= */

.leaderboard-layout {
  max-width: 760px;
  margin: 0 auto;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.leaderboard-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform var(--transition-snappy), border-color var(--transition-snappy);
}

.leaderboard-row:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.leaderboard-row.rank-1 {
  border-color: rgba(255, 138, 69, 0.5);
  background: linear-gradient(90deg, var(--bg-surface), rgba(255, 138, 69, 0.08));
}

.leaderboard-rank-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-secondary);
  min-width: 36px;
}

.rank-1 .leaderboard-rank-badge { color: var(--accent-orange); }
.rank-2 .leaderboard-rank-badge { color: #D1D5DB; }
.rank-3 .leaderboard-rank-badge { color: #B45309; }

#invite-link {
  color: var(--accent-blue);
  text-decoration: underline;
  cursor: pointer;
}