:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1a1a25;
  --border: #2a2a3a;
  --accent: #ff6b4a;
  --accent2: #ff8f73;
  --accent-glow: rgba(255,107,74,0.15);
  --text: #e8e8f0;
  --text2: #8888a0;
  --success: #4ade80;
  --card-radius: 16px;
}

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

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; top: -30%; left: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,107,74,0.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

body::after {
  content: '';
  position: fixed; bottom: -20%; right: -10%;
  width: 50%; height: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.04) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

.app {
  position: relative; z-index: 1; max-width: 480px;
  margin: 0 auto; padding: 16px; min-height: 100vh;
}

.loading-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh; text-align: center;
}

.loading-spinner {
  width: 48px; height: 48px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-bottom: 16px;
}

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

.loading-text { color: var(--text2); font-size: 14px; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}

.header-left { display: flex; align-items: center; gap: 12px; }

.header-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #c44dff);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}

.header h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }

.header-right { display: flex; align-items: center; gap: 10px; }

.live-indicator { display: flex; align-items: center; gap: 5px; }

.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

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

.live-label {
  font-size: 10px; color: var(--success); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 50px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11px; color: var(--text2); cursor: pointer; transition: all 0.2s;
}

.user-pill:hover { border-color: #ff4444; }

.user-avatar {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--accent), #c44dff);
}

.user-avatar-text {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c44dff);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface); border-radius: 14px; margin-bottom: 20px;
}

.tab {
  flex: 1; padding: 10px 12px; border-radius: 11px; border: none;
  background: transparent; color: var(--text2); font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}

.tab.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,74,0.3);
}

.tab .badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  margin-left: 5px; padding: 0 5px;
}

.tab.active .badge { background: rgba(255,255,255,0.3); }

.send-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--card-radius); padding: 20px; margin-bottom: 20px;
}

.send-card h2 {
  font-size: 15px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.capture-area {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--surface2); border: 2px dashed var(--border);
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  cursor: pointer; transition: all 0.25s; margin-bottom: 16px;
}

.capture-area:hover { border-color: var(--accent); background: var(--accent-glow); }
.capture-area.has-photo { border-style: solid; border-color: var(--accent); }
.capture-area img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.capture-icon { font-size: 40px; opacity: 0.6; }
.capture-text { font-size: 13px; color: var(--text2); }

.retake-btn {
  position: absolute; bottom: 12px; right: 12px; padding: 8px 16px;
  border-radius: 50px; background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 12px; font-family: inherit; cursor: pointer; backdrop-filter: blur(8px);
  z-index: 2;
}

.form-row { margin-bottom: 14px; }

.form-label { font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 6px; display: block; }

.form-input {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 14px;
  outline: none; transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text2); opacity: 0.6; }
textarea.form-input { resize: none; height: 60px; }

.send-btn {
  width: 100%; padding: 14px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--accent), #e04520);
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(255,107,74,0.3);
}

.send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(255,107,74,0.4); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.viewfinder { width: 100%; height: 100%; position: absolute; inset: 0; background: #000; }

.cam-controls {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 12px; z-index: 2;
}

.shutter-btn {
  width: 60px; height: 60px; border-radius: 50%; border: 3px solid #fff;
  background: var(--accent); cursor: pointer; transition: all 0.15s;
  box-shadow: 0 4px 20px rgba(255,107,74,0.4);
}

.shutter-btn:hover { transform: scale(1.08); }

.cancel-cam {
  padding: 10px 20px; border-radius: 50px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.6); color: #fff; font-family: inherit; font-size: 12px;
  cursor: pointer; backdrop-filter: blur(8px); align-self: center;
}

.selfie-list { display: flex; flex-direction: column; gap: 12px; }

.selfie-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--card-radius); overflow: hidden;
  transition: all 0.3s; animation: slideUp 0.3s ease-out both;
}

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

.selfie-card:hover { border-color: var(--accent); }

.selfie-img-wrap { position: relative; aspect-ratio: 4/3; background: var(--surface2); overflow: hidden; }
.selfie-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.selfie-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}

.selfie-meta { padding: 14px 16px; }
.selfie-meta-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

.selfie-from { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.selfie-from img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.selfie-time { font-size: 11px; color: var(--text2); font-family: 'Space Mono', monospace; }
.selfie-caption { font-size: 13px; color: var(--text2); margin-top: 6px; line-height: 1.4; }
.selfie-to { font-size: 12px; color: var(--text2); }
.selfie-to em { color: var(--accent2); font-style: normal; }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 20px; padding: 16px 0;
}

.page-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2); font-family: inherit;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}

.page-btn:hover { border-color: var(--accent); color: var(--text); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text2); }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-text { font-size: 14px; line-height: 1.6; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  padding: 12px 24px; border-radius: 50px;
  font-weight: 600; font-size: 13px; font-family: 'Sora', sans-serif;
  z-index: 100; transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; align-items: center; gap: 8px;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); color: #000; box-shadow: 0 8px 32px rgba(74,222,128,0.3); }
.toast.info { background: #818cf8; color: #fff; box-shadow: 0 8px 32px rgba(129,140,248,0.3); }