/* RoomDate Club - Elegant Nightclub Aesthetic */

:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(15, 15, 25, 0.9);
  --primary: #c9a55c;
  --primary-glow: rgba(201, 165, 92, 0.4);
  --accent: #e84393;
  --accent-blue: #00d4ff;
  --accent-purple: #9b59b6;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --border: rgba(201, 165, 92, 0.3);
  --success: #00b894;
  --error: #e74c3c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

#login-screen {
  position: relative;
  min-height: 100vh;
  height: auto;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 0;
}

.login-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(232, 67, 147, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(155, 89, 182, 0.1) 0%, transparent 60%),
    var(--bg-dark);
  animation: bgPulse 8s ease-in-out infinite;
  z-index: 0;
}

/* City Skyline - hidden for now */
.city-skyline {
  display: none;
}

.city-skyline::before {
  display: none;
}

.city-skyline::before {
  content: '';
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 100%;
  height: 140px;
  background: 
    /* Tall building left */
    linear-gradient(to bottom, #0a0a12 0%, #0a0a12 100%) 5% 100% / 40px 120px no-repeat,
    /* Windows */
    radial-gradient(2px 2px at 15px 20px, rgba(255,220,100,0.8), transparent) 5% 100% / 40px 120px no-repeat,
    radial-gradient(2px 2px at 25px 40px, rgba(255,220,100,0.6), transparent) 5% 100% / 40px 120px no-repeat,
    radial-gradient(2px 2px at 15px 60px, rgba(255,220,100,0.7), transparent) 5% 100% / 40px 120px no-repeat,
    radial-gradient(2px 2px at 30px 80px, rgba(255,220,100,0.5), transparent) 5% 100% / 40px 120px no-repeat,
    
    /* Medium building */
    linear-gradient(to bottom, #08080f 0%, #08080f 100%) 15% 100% / 50px 90px no-repeat,
    radial-gradient(2px 2px at 10px 15px, rgba(255,220,100,0.7), transparent) 15% 100% / 50px 90px no-repeat,
    radial-gradient(2px 2px at 30px 35px, rgba(255,220,100,0.5), transparent) 15% 100% / 50px 90px no-repeat,
    radial-gradient(2px 2px at 20px 55px, rgba(255,220,100,0.8), transparent) 15% 100% / 50px 90px no-repeat,
    
    /* Short building */
    linear-gradient(to bottom, #0c0c15 0%, #0c0c15 100%) 28% 100% / 35px 60px no-repeat,
    radial-gradient(2px 2px at 10px 15px, rgba(255,220,100,0.6), transparent) 28% 100% / 35px 60px no-repeat,
    radial-gradient(2px 2px at 25px 35px, rgba(255,220,100,0.7), transparent) 28% 100% / 35px 60px no-repeat,
    
    /* Tall building right side */
    linear-gradient(to bottom, #0a0a12 0%, #0a0a12 100%) 85% 100% / 45px 130px no-repeat,
    radial-gradient(2px 2px at 15px 20px, rgba(255,220,100,0.7), transparent) 85% 100% / 45px 130px no-repeat,
    radial-gradient(2px 2px at 30px 50px, rgba(255,220,100,0.5), transparent) 85% 100% / 45px 130px no-repeat,
    radial-gradient(2px 2px at 15px 80px, rgba(255,220,100,0.8), transparent) 85% 100% / 45px 130px no-repeat,
    radial-gradient(2px 2px at 30px 110px, rgba(255,220,100,0.6), transparent) 85% 100% / 45px 130px no-repeat,
    
    /* Medium building right */
    linear-gradient(to bottom, #08080f 0%, #08080f 100%) 72% 100% / 40px 80px no-repeat,
    radial-gradient(2px 2px at 12px 20px, rgba(255,220,100,0.6), transparent) 72% 100% / 40px 80px no-repeat,
    radial-gradient(2px 2px at 28px 45px, rgba(255,220,100,0.7), transparent) 72% 100% / 40px 80px no-repeat;
}

/* Crowd Silhouettes - hidden for now */
.crowd-silhouettes {
  display: none;
}

.person {
  display: none;
}

.person {
  width: 20px;
  height: 45px;
  background: #0a0a0f;
  border-radius: 10px 10px 0 0;
  position: relative;
  opacity: 0.9;
}

.person::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  background: #0a0a0f;
  border-radius: 50%;
}

.person:nth-child(odd) {
  height: 50px;
}

.person:nth-child(3n) {
  height: 40px;
}

.person:nth-child(2) {
  height: 55px;
}

.person:nth-child(5) {
  height: 48px;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.login-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 60px 30px 40px 30px;
  max-width: 380px;
  width: 90%;
}

.spotlight {
  display: none;
}

.bulb {
  display: none;
}

.beam {
  display: none;
}

.club-logo {
  margin-bottom: 30px;
}

.logo-icon {
  font-size: 40px;
  margin-bottom: 10px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.club-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 4px;
  text-shadow: 0 0 30px var(--primary-glow);
}

.club-logo h2 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 10px;
  margin-top: 5px;
  opacity: 0.9;
}

.club-status {
  display: inline-block;
  padding: 10px 25px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  margin-bottom: 30px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.club-status span:first-child {
  color: var(--accent-blue);
  font-weight: 600;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.input-group input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.3s ease;
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(201, 165, 92, 0.05);
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-enter {
  margin-top: 10px;
  padding: 18px 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #b8944d 100%);
  border: none;
  border-radius: 12px;
  color: #0a0a0f;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.btn-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--primary-glow);
}

.btn-enter:active {
  transform: scale(0.98);
}

.login-note {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.error-msg {
  margin-top: 15px;
  padding: 12px;
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.9rem;
  display: none;
}

.error-msg.show {
  display: block;
}

.login-instructions {
  margin-top: 20px;
  text-align: center;
}

.login-instructions p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 5px 0;
}

.login-instructions p.small {
  font-size: 0.8rem;
  opacity: 0.7;
}

.login-instructions strong {
  color: var(--primary);
}

.app-store-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.store-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.store-btn svg {
  opacity: 0.9;
}

/* ============================================
   QUEUE SCREEN
   ============================================ */

#queue-screen {
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
}

.queue-content {
  text-align: center;
  padding: 40px;
}

.queue-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

.queue-content h2 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 15px;
}

.full-message {
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 1rem;
}

.btn-try-again {
  padding: 14px 30px;
  background: linear-gradient(135deg, var(--primary) 0%, #b8944d 100%);
  border: none;
  border-radius: 10px;
  color: #0a0a0f;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.btn-try-again:hover {
  box-shadow: 0 5px 20px var(--primary-glow);
}

.btn-leave {
  padding: 14px 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-leave:hover {
  border-color: var(--error);
  color: var(--error);
}

/* ============================================
   CLUB SCREEN
   ============================================ */

#club-screen {
  display: none;
}

#club-screen.active {
  display: block;
}

#club-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#club-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.club-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  padding-top: max(15px, env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  pointer-events: auto;
}

.club-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: 2px;
}

.user-count {
  padding: 8px 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
}

.user-count span {
  color: var(--accent-blue);
  font-weight: 600;
}

.now-playing {
  position: absolute;
  bottom: 100px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.now-playing.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.np-icon {
  font-size: 1.2rem;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.np-track {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-exit {
  position: absolute;
  bottom: 30px;
  right: 20px;
  padding: 12px 25px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.btn-exit:hover {
  border-color: var(--error);
  color: var(--error);
}

/* ============================================
   JOYSTICK
   ============================================ */

.joystick {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  z-index: 20;
}

.joystick.active {
  background: rgba(201, 165, 92, 0.2);
  border-color: var(--primary);
}

.joystick-knob {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--primary) 0%, #b8944d 100%);
  border-radius: 50%;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: transform 0.05s ease-out;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .joystick {
    bottom: 30px;
    width: 90px;
    height: 90px;
  }
  
  .joystick-knob {
    width: 40px;
    height: 40px;
  }
  
  .avatar-photo, .avatar-img, .avatar-initials {
    width: 60px;
    height: 60px;
  }
  
  .avatar-initials {
    font-size: 1.2rem;
  }
  
  .btn-exit {
    bottom: 20px;
    right: 15px;
    padding: 10px 20px;
    font-size: 0.8rem;
  }
}

/* ============================================
   AVATARS CONTAINER
   ============================================ */

#avatars-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.avatar {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
}

.avatar.me {
  z-index: 10;
}

.avatar-photo {
  position: relative;
  width: 70px;
  height: 70px;
}

.avatar-img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  object-fit: cover;
  box-shadow: 0 0 20px var(--primary-glow);
  background: var(--bg-card);
  position: relative;
  z-index: 2;
}

.avatar-initials {
  position: absolute;
  top: 0;
  left: 0;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  z-index: 1;
}

.avatar-name {
  margin-top: 5px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-tap {
  margin-top: 3px;
  font-size: 0.65rem;
  color: var(--accent-blue);
  opacity: 1;
}

.avatar.me .avatar-tap {
  display: none;
}

/* ============================================
   CHAT REQUEST MODAL
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  transform: scale(1);
  transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
  transform: scale(0.9);
}

.modal-content img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  object-fit: cover;
  margin-bottom: 15px;
}

.modal-content h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text);
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 25px;
}

.modal-content p span {
  color: var(--primary);
  font-weight: 600;
}

.modal-buttons {
  display: flex;
  gap: 15px;
}

.btn-decline, .btn-accept {
  flex: 1;
  padding: 14px 20px;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-decline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-decline:hover {
  border-color: var(--error);
  color: var(--error);
}

.btn-accept {
  background: linear-gradient(135deg, var(--primary) 0%, #b8944d 100%);
  border: none;
  color: #0a0a0f;
}

.btn-accept:hover {
  box-shadow: 0 5px 20px var(--primary-glow);
}

/* ============================================
   CHAT WINDOW
   ============================================ */

.chat-window {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.chat-window.hidden {
  transform: translateY(100%);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.chat-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

.chat-header span {
  flex: 1;
  font-weight: 500;
}

.btn-close-chat {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-close-chat:hover {
  border-color: var(--error);
  color: var(--error);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.chat-msg.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary) 0%, #b8944d 100%);
  color: #0a0a0f;
  border-bottom-right-radius: 4px;
}

.chat-msg.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  padding-bottom: max(15px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.chat-input-area input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 25px;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
}

.chat-input-area input::placeholder {
  color: var(--text-muted);
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-send {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, #b8944d 100%);
  border: none;
  border-radius: 50%;
  color: #0a0a0f;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-send:hover {
  box-shadow: 0 5px 20px var(--primary-glow);
}

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

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 25px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

/* ============================================
   CLUB LIGHTS ANIMATION
   ============================================ */

.club-lights {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.light-beam {
  position: absolute;
  width: 200px;
  height: 800px;
  background: linear-gradient(to bottom, 
    rgba(232, 67, 147, 0.3) 0%, 
    transparent 100%
  );
  transform-origin: top center;
  animation: sweep 4s ease-in-out infinite;
}

.light-beam:nth-child(1) {
  left: 20%;
  animation-delay: 0s;
}

.light-beam:nth-child(2) {
  left: 50%;
  background: linear-gradient(to bottom, 
    rgba(0, 212, 255, 0.3) 0%, 
    transparent 100%
  );
  animation-delay: -1s;
  animation-duration: 5s;
}

.light-beam:nth-child(3) {
  left: 80%;
  background: linear-gradient(to bottom, 
    rgba(155, 89, 182, 0.3) 0%, 
    transparent 100%
  );
  animation-delay: -2s;
  animation-duration: 4.5s;
}

@keyframes sweep {
  0%, 100% { transform: rotate(-30deg); }
  50% { transform: rotate(30deg); }
}