/* ============================================
   Majlis Al-Alab - Arabic Luxury Theme
   深蓝金 · 阿拉伯几何 · 暖光奢华
   ============================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(201,168,76,0.2); }
  50% { box-shadow: 0 0 30px rgba(201,168,76,0.5); }
}
@keyframes orb-dance {
  0% { transform: translate(0,0) scale(1); opacity: 0.15; }
  25% { transform: translate(30px,-20px) scale(1.1); opacity: 0.2; }
  50% { transform: translate(-20px,30px) scale(0.9); opacity: 0.12; }
  75% { transform: translate(20px,20px) scale(1.05); opacity: 0.18; }
  100% { transform: translate(0,0) scale(1); opacity: 0.15; }
}
@keyframes pattern-drift {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

body {
  font-family: 'Cairo', 'Amiri', 'Noto Naskh Arabic', sans-serif;
  background: #070714;
  color: #ddd5c0;
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- CSS VARIABLES ---------- */
:root {
  --gold: #c9a84c;
  --gold-light: #e2cc7a;
  --gold-dark: #8b6914;
  --gold-glow: rgba(201,168,76,0.25);
  --bg-deep: #070714;
  --bg-panel: #0f0f24;
  --bg-card: #18183a;
  --bg-hover: #222250;
  --text: #ddd5c0;
  --text-bright: #f5e6cc;
  --text-muted: #7a7568;
  --border: #2a2a50;
  --border-gold: rgba(201,168,76,0.3);
  --accent: #c75b3a;
  --success: #3aaf6c;
  --danger: #d9434e;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 4px 20px rgba(201,168,76,0.15);
  --transition: 0.3s ease;
}

/* ---------- GEOMETRIC BACKGROUND ---------- */
.bg-pattern {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
}

.bg-pattern::before {
  content: '';
  position: absolute;
  inset: -50%;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(201,168,76,0.04) 0%, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(201,168,76,0.03) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(58,175,108,0.02) 0%, transparent 30%);
  animation: pattern-drift 120s linear infinite;
}

.bg-pattern::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(201,168,76,0.008) 40px, rgba(201,168,76,0.008) 41px),
    repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(201,168,76,0.005) 40px, rgba(201,168,76,0.005) 41px);
}

/* Floating decorative orbs */
.deco-orb {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  animation: orb-dance 20s ease-in-out infinite;
}
.deco-orb:nth-child(1) {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 70%);
  top: -50px; left: -50px;
  animation-duration: 25s;
}
.deco-orb:nth-child(2) {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,168,76,0.04) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation-duration: 30s; animation-delay: -5s;
}
.deco-orb:nth-child(3) {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(58,175,108,0.04) 0%, transparent 70%);
  top: 40%; left: 60%;
  animation-duration: 20s; animation-delay: -10s;
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ---------- LAYOUT ---------- */
.lobby-container {
  position: relative; z-index: 1;
  display: flex; min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 240px; min-height: 100vh;
  background: linear-gradient(180deg, rgba(15,15,36,0.98) 0%, rgba(7,7,20,0.98) 100%);
  border-left: 1px solid var(--border);
  padding: 20px 0;
  display: flex; flex-direction: column;
  position: fixed; right: 0; top: 0; z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-section {
  padding: 0 16px; margin-bottom: 24px;
}

.sidebar-title {
  font-size: 13px; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-gold);
  display: flex; align-items: center; gap: 8px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--bg-hover); color: var(--text-bright);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(201,168,76,0.15) 0%, rgba(201,168,76,0.05) 100%);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}
.nav-item .nav-icon { font-size: 20px; width: 28px; text-align: center; }
.nav-item .nav-badge {
  font-size: 10px; background: var(--gold-dark); color: white;
  padding: 1px 6px; border-radius: 4px; margin-right: auto;
}

/* Gift shop */
.gift-shop {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
}
.gift-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 6px;
  cursor: pointer; text-align: center; transition: all var(--transition);
  color: var(--text);
}
.gift-item:hover {
  border-color: var(--gold); background: var(--bg-hover);
  transform: translateY(-2px); box-shadow: var(--shadow-gold);
}
.gift-item span { display: block; font-size: 22px; margin-bottom: 2px; }
.gift-item small { font-size: 11px; color: var(--gold); }

/* ---------- MAIN CONTENT ---------- */
.main-content {
  flex: 1; margin-right: 240px;
  padding: 24px 32px; min-height: 100vh;
  position: relative; z-index: 1;
}

/* ---------- HEADER ---------- */
.lobby-header {
  display: none; /* Hidden in desktop, shown in mobile override */
}

/* ---------- HERO / BANNER SECTION ---------- */
.hero-section {
  text-align: center; padding: 30px 20px 20px;
  margin-bottom: 28px;
  position: relative;
}
.hero-section::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-ornament {
  font-size: 28px; color: var(--gold); opacity: 0.6;
  letter-spacing: 8px; margin-bottom: 8px;
}

.hero-title {
  font-family: 'Amiri', serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; color: var(--text-bright);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.hero-subtitle {
  font-size: clamp(14px, 1.5vw, 18px); color: var(--text-muted);
  max-width: 500px; margin: 0 auto 16px;
}

.hero-stats {
  display: flex; justify-content: center; gap: 40px; margin-top: 16px;
}
.hero-stat {
  text-align: center;
}
.hero-stat-value {
  font-size: 28px; font-weight: 700; color: var(--gold-light);
  display: block;
}
.hero-stat-label {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px;
}
.hero-stat-dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--success); border-radius: 50%;
  margin-left: 6px; animation: pulse-dot 2s ease-in-out infinite;
}

/* ---------- CREATE ROOM CARD ---------- */
.create-room-card {
  background: linear-gradient(135deg, rgba(24,24,58,0.9) 0%, rgba(15,15,36,0.9) 100%);
  border: 1px solid var(--border-gold); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 28px;
  box-shadow: var(--shadow-gold);
  position: relative; overflow: hidden;
}
.create-room-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.card-ornament {
  font-size: 20px; color: var(--gold); opacity: 0.5;
  margin-bottom: 4px; display: block;
}

.create-room-card h3 {
  font-size: 20px; font-weight: 700; color: var(--gold-light);
  margin-bottom: 16px;
}

.create-room-form {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}

.room-input, .room-select {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-bright); font-family: 'Cairo', sans-serif;
  font-size: 14px; transition: border-color var(--transition);
  flex: 1; min-width: 150px;
}
.room-input:focus, .room-select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}
.room-input::placeholder { color: var(--text-muted); }

.room-options {
  display: flex; gap: 16px; align-items: center;
  width: 100%; padding-top: 4px;
}

.checkbox-label {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 14px; color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--gold);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: #1a1a2e; font-weight: 700; font-family: 'Cairo', sans-serif;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 24px; cursor: pointer;
  transition: all var(--transition); font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--gold-glow);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-arrow { font-size: 12px; }

/* ---------- ROOMS SECTION ---------- */
.rooms-section { margin-bottom: 32px; }

.section-header { margin-bottom: 16px; }

.section-title {
  font-size: 20px; font-weight: 700; color: var(--text-bright);
  margin-bottom: 10px;
}

.room-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.filter-chip {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px; cursor: pointer;
  font-size: 13px; font-family: 'Cairo', sans-serif;
  color: var(--text); transition: all var(--transition);
}
.filter-chip:hover { border-color: var(--gold); color: var(--gold-light); }
.filter-chip.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #1a1a2e; border-color: var(--gold); font-weight: 700;
}

.rooms-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.room-card {
  background: linear-gradient(135deg, rgba(24,24,58,0.9) 0%, rgba(15,15,36,0.8) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer;
  transition: all var(--transition); position: relative;
  overflow: hidden; animation: fadeInUp 0.4s ease both;
}
.room-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 20px var(--gold-glow);
}
.room-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.room-card:hover::after { opacity: 1; }

.room-card-status {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  font-weight: 600;
}
.status-waiting { background: rgba(58,175,108,0.2); color: var(--success); }
.status-playing { background: rgba(201,168,76,0.2); color: var(--gold); }
.status-full { background: rgba(217,67,78,0.2); color: var(--danger); }

.room-card-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.room-card-icon {
  font-size: 32px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep); border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
}
.room-card-name {
  font-size: 15px; font-weight: 700; color: var(--text-bright);
  margin-bottom: 2px; line-height: 1.3;
}
.room-card-game { font-size: 12px; color: var(--gold); }

.room-card-meta {
  display: flex; gap: 12px; font-size: 12px; color: var(--text-muted);
}
.room-card-meta span { display: flex; align-items: center; gap: 4px; }

.no-rooms {
  text-align: center; padding: 40px;
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.no-rooms p { font-size: 16px; color: var(--text-muted); }

/* ---------- ROOM VIEW ---------- */
.room-view-container { animation: fadeInUp 0.3s ease; }

.room-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(24,24,58,0.9) 0%, rgba(15,15,36,0.9) 100%);
  border: 1px solid var(--border-gold); border-radius: var(--radius);
  margin-bottom: 20px;
}

.btn-back {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 16px;
  color: var(--text); font-family: 'Cairo', sans-serif; cursor: pointer;
  font-size: 14px; transition: all var(--transition);
}
.btn-back:hover { border-color: var(--gold); color: var(--gold-light); }

.btn-share {
  background: var(--gold-dark); color: white; border: none;
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-family: 'Cairo', sans-serif; cursor: pointer; font-size: 14px;
  margin-right: auto; transition: all var(--transition);
}
.btn-share:hover { background: var(--gold); }

.room-info { display: flex; align-items: center; gap: 12px; }
.room-game-icon { font-size: 28px; }
.room-info h3 { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.room-code { font-size: 13px; color: var(--text-muted); }
.room-code strong { color: var(--gold); font-family: monospace; letter-spacing: 2px; }

.room-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 20px;
  align-items: start;
}

.room-players {
  background: linear-gradient(135deg, rgba(24,24,58,0.9) 0%, rgba(15,15,36,0.9) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px;
}
.room-players h4 {
  font-size: 15px; color: var(--gold-light); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.players-grid {
  display: flex; flex-direction: column; gap: 8px;
}

.player-slot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-deep); border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: all var(--transition);
}
.player-slot:hover { border-color: var(--gold); }
.player-slot.empty { opacity: 0.4; }

.player-avatar { font-size: 24px; }
.player-name { font-size: 14px; font-weight: 600; color: var(--text-bright); flex: 1; }
.player-status {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); display: inline-block;
}
.player-status.muted { background: var(--danger); }

.room-actions-bottom { margin-top: 16px; }
.btn-start { width: 100%; justify-content: center; }

/* ---------- ROOM GAME AREA ---------- */
.room-game-area { display: flex; flex-direction: column; gap: 16px; }

.game-frame {
  background: linear-gradient(135deg, rgba(24,24,58,0.9) 0%, rgba(15,15,36,0.9) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 300px; display: flex; align-items: center; justify-content: center;
}
.game-placeholder { text-align: center; }
.game-placeholder-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.game-placeholder p { font-size: 16px; color: var(--text-muted); }
.game-placeholder-hint { font-size: 13px; color: var(--text-muted); opacity: 0.6; margin-top: 4px; }

/* ---------- VOICE BAR ---------- */
.voice-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(24,24,58,0.9) 0%, rgba(15,15,36,0.9) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.voice-users { display: flex; gap: 6px; font-size: 13px; color: var(--text-muted); }
.voice-controls { display: flex; gap: 8px; }
.voice-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-deep);
  cursor: pointer; font-size: 16px;
  transition: all var(--transition); display: flex;
  align-items: center; justify-content: center;
}
.voice-btn:hover { border-color: var(--gold); }
.voice-btn.active { border-color: var(--success); }
.voice-btn.muted { border-color: var(--danger); opacity: 0.6; }

/* ---------- CHAT ---------- */
.chat-panel {
  background: linear-gradient(135deg, rgba(24,24,58,0.9) 0%, rgba(15,15,36,0.9) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: 250px;
}

.chat-messages {
  flex: 1; padding: 12px 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}

.chat-msg {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text);
  padding: 4px 8px; border-radius: 4px;
}
.chat-msg.system { color: var(--gold); }
.msg-sender { font-weight: 700; color: var(--gold-light); white-space: nowrap; }

.chat-input-row {
  display: flex; border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1; border: none; background: var(--bg-deep);
  padding: 10px 14px; color: var(--text-bright);
  font-family: 'Cairo', sans-serif; font-size: 13px;
}
.chat-input:focus { outline: none; }
.chat-input::placeholder { color: var(--text-muted); }
.btn-send {
  background: var(--gold-dark); border: none; color: white;
  padding: 0 16px; cursor: pointer; font-size: 16px;
  transition: background var(--transition);
}
.btn-send:hover { background: var(--gold); }

/* ---------- TOAST ---------- */
#toastContainer {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif; font-size: 14px;
  animation: fadeInUp 0.3s ease;
  text-align: center; min-width: 200px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ---------- GIFT ANIMATION ---------- */
#giftAnimationLayer {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
}
.gift-fly {
  position: absolute; top: 40%; left: 50%;
  font-size: 48px; animation: float 1.5s ease-in-out forwards;
  transform: translate(-50%, -50%);
}

/* ---------- VIEW SYSTEM ---------- */
.view { display: none; }
.view.active { display: block; }

/* ---------- AUTH MODAL ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.modal-overlay[style*="display: block"],
.modal-overlay.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.auth-modal {
  background: linear-gradient(135deg, #14142e 0%, #0d0d20 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius); padding: 32px;
  width: 90%; max-width: 400px;
  box-shadow: 0 0 60px rgba(201,168,76,0.1);
  position: relative; overflow: hidden;
  animation: fadeInUp 0.3s ease;
}
.auth-modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.auth-logo { font-size: 40px; text-align: center; margin-bottom: 8px; }
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-header h2 {
  font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-header p { font-size: 14px; color: var(--text-muted); }

.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; }
.auth-tab {
  flex: 1; padding: 8px; text-align: center;
  background: var(--bg-deep); border: 1px solid var(--border);
  color: var(--text); font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all var(--transition); font-size: 14px;
}
.auth-tab:first-child { border-radius: 0 var(--radius-sm) 0 0; }
.auth-tab:last-child { border-radius: var(--radius-sm) 0 0 0; }
.auth-tab.active {
  background: var(--gold-dark); color: white; border-color: var(--gold);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
  font-size: 13px; color: var(--text-muted);
}
.form-group input, .auth-select {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-bright); font-family: 'Cairo', sans-serif;
  font-size: 14px;
}
.form-group input:focus, .auth-select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.auth-error { font-size: 13px; color: var(--danger); text-align: center; min-height: 20px; }
.auth-link {
  font-size: 13px; color: var(--gold); text-align: center;
  cursor: pointer; margin-top: 4px;
}
.auth-link:hover { text-decoration: underline; }

.btn-guest {
  width: 100%; padding: 10px; margin-top: 8px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'Cairo', sans-serif; cursor: pointer;
  transition: all var(--transition); font-size: 14px;
}
.btn-guest:hover { border-color: var(--gold); color: var(--gold-light); }

/* ---------- FORGOT MODAL ---------- */
#forgotModal .auth-modal { max-width: 420px; }
#forgotModal .form-group input { direction: ltr; text-align: left; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(240px);
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-right: 0; padding: 16px; }

  .lobby-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(15,15,36,0.98), rgba(7,7,20,0.98));
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    margin: -16px -16px 16px;
  }

  .icon-btn {
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: var(--text); padding: 6px;
  }

  .brand {
    display: flex; align-items: center; gap: 8px;
  }
  .brand-icon { font-size: 22px; }
  .brand-text { font-size: 16px; font-weight: 700; color: var(--text-bright); }
  .brand-accent { color: var(--gold); }

  .header-center { display: flex; align-items: center; gap: 6px; }
  .online-indicator { font-size: 13px; color: var(--text-muted); }
  .pulse-dot {
    width: 6px; height: 6px; background: var(--success);
    border-radius: 50%; display: inline-block;
    animation: pulse-dot 2s infinite;
  }

  .header-right { display: flex; align-items: center; gap: 4px; }
  .user-avatar { font-size: 22px; cursor: pointer; }

  .create-room-form { flex-direction: column; }
  .room-input, .room-select { width: 100%; }
  .room-options { flex-direction: column; align-items: flex-start; }

  .rooms-grid { grid-template-columns: 1fr; }

  .room-layout { grid-template-columns: 1fr; }

  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .section-header { flex-direction: column; }
  .room-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
}

/* ---------- LIGHT MODE ---------- */
body.light-mode {
  --bg-deep: #f5ecd6;
  --bg-panel: #faf6ec;
  --bg-card: #ffffff;
  --bg-hover: #f0e8d0;
  --text: #3d3520;
  --text-bright: #1a1508;
  --text-muted: #8a8068;
  --border: #d4c8a8;
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-gold: 0 4px 20px rgba(201,168,76,0.2);
}

/* ---------- UTILITY ---------- */
[style*="display: none"] { display: none !important; }
