/* ============================================
   SKULL CHATS — Luxury Dark Ruby & Gold Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
  --bg-deep: #050507;
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f16;
  --bg-surface: #14141f;
  --bg-elevated: #1a1a28;
  --bg-chat: #08080d;

  --accent-ruby: #c0392b;
  --accent-ruby-light: #e74c3c;
  --accent-gold: #d4a853;
  --accent-gold-light: #f0c87a;
  --accent-rose: #b5365a;

  --gradient-ruby: linear-gradient(135deg, #c0392b, #922B21);
  --gradient-gold: linear-gradient(135deg, #d4a853, #b8860b);
  --gradient-luxury: linear-gradient(135deg, #c0392b, #d4a853);
  --gradient-subtle: linear-gradient(135deg, rgba(192,57,43,0.12), rgba(212,168,83,0.08));

  --sent-bubble: rgba(192,57,43,0.1);
  --sent-bubble-border: rgba(212,168,83,0.1);
  --received-bubble: #101018;
  --received-bubble-border: rgba(255,255,255,0.04);

  --text-primary: #f0ece4;
  --text-secondary: #9a9488;
  --text-muted: #5a5650;

  --border: rgba(212,168,83,0.06);
  --border-accent: rgba(192,57,43,0.25);
  --border-gold: rgba(212,168,83,0.15);

  --shadow-luxury: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-ruby: 0 0 25px rgba(192,57,43,0.2);
  --shadow-glow-gold: 0 0 20px rgba(212,168,83,0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-full: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}


/* --- Reset & Global --- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
  height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { display: block; max-width: 100%; }
button, input, textarea { font-family: inherit; }
a { color: var(--accent-gold); text-decoration: none; }


/* --- Scrollbar --- */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(192, 57, 43, 0.25);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(192, 57, 43, 0.45); }
* { scrollbar-width: thin; scrollbar-color: rgba(192,57,43,0.25) transparent; }


/* --- Selection --- */

::selection {
  background: rgba(192, 57, 43, 0.35);
  color: #fff;
}


/* --- Autofill Fix --- */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px var(--bg-surface) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
}


/* --- Utilities --- */

.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }


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

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 1;
}


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

#login-screen {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(192,57,43,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 70%, rgba(212,168,83,0.04) 0%, transparent 45%),
    radial-gradient(ellipse at 70% 60%, rgba(181,54,90,0.03) 0%, transparent 50%),
    var(--bg-deep);
  overflow: hidden;
}

/* Floating particles */
#login-screen::before,
#login-screen::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.3;
  filter: blur(1px);
}

#login-screen::before {
  width: 5px; height: 5px;
  background: var(--accent-ruby);
  top: 15%; left: 20%;
  animation: floatParticleA 9s ease-in-out infinite;
  box-shadow:
    78vw 25vh 0 2px rgba(212,168,83,0.25),
    22vw 58vh 0 1.5px rgba(192,57,43,0.2),
    55vw 72vh 0 2px rgba(212,168,83,0.15),
    40vw 12vh 0 1px rgba(192,57,43,0.25),
    70vw 50vh 0 1.5px rgba(181,54,90,0.18);
}

#login-screen::after {
  width: 4px; height: 4px;
  background: var(--accent-gold);
  top: 70%; right: 15%;
  animation: floatParticleB 11s ease-in-out infinite;
  box-shadow:
    -45vw -18vh 0 1.5px rgba(192,57,43,0.2),
    -25vw 12vh 0 2px rgba(212,168,83,0.18),
    -65vw -35vh 0 1px rgba(181,54,90,0.15);
}

@keyframes floatParticleA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(12px, -18px) scale(1.15); }
  50%      { transform: translate(-8px, -30px) scale(0.9); }
  75%      { transform: translate(16px, -8px) scale(1.1); }
}

@keyframes floatParticleB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-16px, 12px) scale(1.1); }
  66%      { transform: translate(8px, 20px) scale(0.88); }
}

.login-container {
  max-width: 380px;
  width: 100%;
  padding: 40px 24px;
  text-align: center;
  position: relative;
  z-index: 2;
  animation: slideUp 0.6s ease;
}

.login-logo {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 4s ease-in-out infinite;
}

.login-logo img {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 0 25px rgba(192,57,43,0.3)) drop-shadow(0 0 50px rgba(212,168,83,0.1));
  transition: filter 0.4s ease;
}

.login-logo img:hover {
  filter: drop-shadow(0 0 30px rgba(192,57,43,0.45)) drop-shadow(0 0 60px rgba(212,168,83,0.2));
}

.login-title {
  font-size: 30px;
  font-weight: 800;
  background: var(--gradient-luxury);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 36px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.login-input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

/* Legacy emoji icon support */
.login-input-wrapper .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}

.login-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.login-input:focus {
  border-color: var(--accent-ruby);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1), var(--shadow-glow-ruby);
}

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

.login-btn {
  width: 100%;
  padding: 16px 24px;
  background: var(--gradient-luxury);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn .btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(192,57,43,0.35), var(--shadow-glow-gold);
}

.login-btn:hover .btn-arrow { transform: translateX(3px); }

.login-btn:active {
  transform: translateY(0) scale(0.98);
}

.login-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-100%);
  animation: shimmer 4s ease-in-out infinite;
}

.login-error {
  color: var(--accent-ruby-light);
  font-size: 13px;
  margin-top: 14px;
  min-height: 20px;
  font-weight: 500;
}


/* ==========================================
   SETUP SCREEN
   ========================================== */

#setup-screen {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(192,57,43,0.05) 0%, transparent 55%),
    var(--bg-deep);
}


/* ==========================================
   CHAT SCREEN
   ========================================== */

#chat-screen {
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
}

/* --- Chat Header --- */

.chat-header {
  height: 64px;
  min-height: 64px;
  background: rgba(15,15,22,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 10px;
}

.header-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.header-logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(192,57,43,0.2));
  opacity: 0.7;
}

.partner-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  background: var(--gradient-luxury);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(212,168,83,0.2), 0 2px 12px rgba(192,57,43,0.2);
}

.partner-info {
  flex: 1;
  min-width: 0;
}

.partner-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.partner-status {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

.partner-status.online { color: var(--accent-gold); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  transition: all 0.3s ease;
}

.status-dot.online {
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(212,168,83,0.5);
}

.status-dot.offline { background: var(--text-muted); }


/* --- Messages Container --- */

#messages-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  background:
    radial-gradient(circle at 15% 45%, rgba(192,57,43,0.015) 0%, transparent 50%),
    radial-gradient(circle at 85% 20%, rgba(212,168,83,0.01) 0%, transparent 40%),
    var(--bg-chat);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}


/* --- Messages --- */

.message {
  display: flex;
  margin-bottom: 2px;
  animation: messageIn 0.15s ease;
}

.message--sent { justify-content: flex-end; }
.message--received { justify-content: flex-start; }

.message__bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  font-size: 15px;
}

.message--sent .message__bubble {
  background: var(--sent-bubble);
  border: 1px solid var(--sent-bubble-border);
  border-bottom-right-radius: 4px;
}

.message--received .message__bubble {
  background: var(--received-bubble);
  border: 1px solid var(--received-bubble-border);
  border-bottom-left-radius: 4px;
}

.message__text { white-space: pre-wrap; }

.message__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.message__time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.message__status { font-size: 12px; line-height: 1; }
.read-receipt { color: var(--text-muted); font-size: 12px; }
.read-receipt.read { color: var(--accent-gold); }


/* --- Image Messages --- */

.message__image {
  max-width: 280px;
  overflow: hidden;
  border-radius: 12px;
}

.message__image img {
  max-width: 280px;
  max-height: 300px;
  border-radius: 12px;
  cursor: pointer;
  object-fit: cover;
  width: 100%;
  transition: filter 0.2s ease;
  display: block;
}

.message__image img:hover { filter: brightness(1.12); }


/* --- Audio Messages --- */

.message__audio {
  width: 250px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.message__audio audio {
  width: 100%;
  height: 36px;
  border-radius: 18px;
  outline: none;
}

.audio-play-btn {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-luxury);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.audio-play-btn:hover { transform: scale(1.08); }
.audio-play-btn:active { transform: scale(0.95); }

.audio-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.audio-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-luxury);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.audio-time {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* --- File Card Messages --- */

.message__file-card {
  background: rgba(212,168,83,0.04);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  border: 1px solid var(--border-gold);
}

.message__file-card:hover { background: rgba(212,168,83,0.08); }
.message__file-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }

.message__file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.message__file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message__file-size { font-size: 12px; color: var(--text-muted); }


/* --- Date Separator --- */

.date-separator {
  text-align: center;
  margin: 16px 0;
  font-size: 11px;
  color: var(--text-muted);
  position: relative;
}

.date-separator::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border);
}

.date-separator span {
  background: var(--bg-chat);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-gold);
  position: relative;
  z-index: 1;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 10px;
}


/* --- Typing Indicator --- */

#typing-indicator { padding: 4px 16px; display: none; }
#typing-indicator.active { display: flex; }

.typing-bubble {
  background: var(--received-bubble);
  border: 1px solid var(--received-bubble-border);
  padding: 12px 16px;
  border-radius: 18px;
  display: flex;
  gap: 5px;
  align-items: center;
  border-bottom-left-radius: 4px;
}

.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }


/* --- Chat Input Bar --- */

.chat-input-bar {
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  gap: 8px;
  background: rgba(15,15,22,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-gold);
}

#message-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 22px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  line-height: 1.4;
  transition: border-color 0.2s ease;
}

#message-input:focus { border-color: var(--accent-ruby); }
#message-input::placeholder { color: var(--text-muted); }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(192,57,43,0.1);
  color: var(--accent-ruby-light);
}

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

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.send-btn {
  background: var(--gradient-luxury);
  color: #fff;
  border: none;
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(192,57,43,0.2);
}

.send-btn svg {
  width: 20px;
  height: 20px;
}

.send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 20px rgba(192,57,43,0.35), var(--shadow-glow-gold);
}

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

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


/* ==========================================
   FILE PREVIEW OVERLAY
   ========================================== */

#file-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,7,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

#file-preview-overlay:not(.hidden) { display: flex; }

.file-preview-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.file-preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90%;
  max-height: 70vh;
  overflow: hidden;
}

.file-preview-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.file-preview-icon { font-size: 64px; margin-bottom: 16px; text-align: center; }
.file-preview-filename { font-size: 16px; font-weight: 500; text-align: center; margin-bottom: 4px; }
.file-preview-filesize { font-size: 13px; color: var(--text-muted); text-align: center; }

.file-preview-footer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.file-preview-caption {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: 22px;
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s ease;
}

.file-preview-caption:focus { border-color: var(--accent-ruby); }
.file-preview-caption::placeholder { color: var(--text-muted); }


/* ==========================================
   IMAGE VIEWER OVERLAY
   ========================================== */

#image-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,7,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#image-viewer-overlay:not(.hidden) {
  display: flex;
  animation: fadeIn 0.2s ease;
}

#image-viewer-overlay .image-viewer-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 111;
  color: #fff;
  font-size: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}

#image-viewer-overlay .image-viewer-close:hover { background: rgba(255,255,255,0.15); }

#image-viewer-img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  animation: imageViewerIn 0.25s ease;
  cursor: default;
}

@keyframes imageViewerIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}


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

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-luxury);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-weight: 500;
}

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


/* ==========================================
   LOADING OVERLAY
   ========================================== */

#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,7,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.loader-spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(212,168,83,0.1);
  border-top-color: var(--accent-ruby);
  border-right-color: var(--accent-gold);
  animation: spin 0.75s linear infinite;
}


/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  animation: fadeIn 0.6s ease;
}

.empty-state__icon {
  margin-bottom: 20px;
  animation: float 5s ease-in-out infinite;
}

.empty-state__icon img {
  width: 64px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(192,57,43,0.15));
  opacity: 0.4;
}

.empty-state__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.empty-state__text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 240px;
  line-height: 1.5;
}


/* ==========================================
   ANIMATIONS
   ========================================== */

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

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(212,168,83,0.06), 0 20px 60px rgba(0,0,0,0.5), 0 0 60px rgba(192,57,43,0.04); }
  50%      { box-shadow: 0 0 0 1px rgba(212,168,83,0.1), 0 20px 60px rgba(0,0,0,0.5), 0 0 80px rgba(192,57,43,0.08); }
}


/* ==========================================
   RESPONSIVE — Desktop Phone Frame
   ========================================== */

@media (min-width: 768px) {
  body {
    background:
      radial-gradient(ellipse at 25% 15%, rgba(192,57,43,0.04) 0%, transparent 50%),
      radial-gradient(ellipse at 75% 85%, rgba(212,168,83,0.03) 0%, transparent 50%),
      radial-gradient(circle, rgba(212,168,83,0.008) 1px, transparent 1px),
      var(--bg-deep);
    background-size: 100%, 100%, 28px 28px, 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .screen {
    position: relative;
    max-width: 420px;
    width: 100%;
    height: 90vh;
    max-height: 860px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(212,168,83,0.08);
    animation: glowPulse 8s ease-in-out infinite;
  }

  #chat-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--gradient-luxury);
    border-radius: 0 0 3px 3px;
    opacity: 0.5;
    z-index: 20;
  }
}

@media (min-width: 768px) and (min-height: 700px) {
  .screen { height: 92vh; }
}


/* ==========================================
   SMALL SCREEN TWEAKS
   ========================================== */

@media (max-width: 360px) {
  .login-container { padding: 28px 16px; }
  .login-logo img { width: 64px; }
  .login-title { font-size: 26px; }
  .message__bubble { max-width: 88%; }
  .message__image, .message__image img { max-width: 240px; }
  .message__audio { width: 200px; }
}


/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
