/* QuickTalk — minimal, mobile-first styles */
:root {
  --bg: #0f1220;
  --bg-2: #171a2e;
  --panel: #1c2140;
  --panel-2: #232a52;
  --text: #eef1ff;
  --muted: #9aa3c7;
  --accent: #6c8cff;
  --accent-2: #4c6bff;
  --danger: #ff5c7a;
  --ok: #3ddc97;
  --gold: #ffd166;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% -10%, #2a2f66 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 10%, #3a2166 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
}

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

.maintenance {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  padding: 10px 16px; background: linear-gradient(90deg, #ffb14e, #ff8c42);
  color: #2b1e00; text-align: center; font-weight: 600;
}

/* ---------- Landing ---------- */
.landing {
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
}
.brand { text-align: center; }
.brand h1 { margin: 8px 0 4px; font-size: 34px; letter-spacing: .5px; }
.brand .tagline { color: var(--muted); margin: 0; }
.logo {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; font-weight: 800; display: grid; place-items: center;
  font-size: 20px; letter-spacing: 1px; margin: 0 auto;
  box-shadow: var(--shadow);
}
.logo.small { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }

.card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--muted); font-size: 13px; }
.field input, .field select {
  background: #0f1330;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,140,255,.25);
}
.mode-toggle { display: flex; gap: 12px; color: var(--muted); flex-wrap: wrap; }
.mode-toggle label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.premium-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.premium-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.premium-btn {
  background: linear-gradient(135deg, #ffd166, #ff9d5c);
  color: #2b1e00; font-weight: 700;
}
.premium-btn.active { outline: 3px solid rgba(255,209,102,.45); }
.premium-btn.unlocked { background: linear-gradient(135deg, #3ddc97, #1eb37a); color: #08211a; }

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: #2a3160;
  transition: transform .05s ease, background .15s ease, opacity .15s ease;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; }

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}
.ghost { background: rgba(255,255,255,.08); }
.danger { background: linear-gradient(135deg, #ff5c7a, #d63a5d); color: white; }
.pill { border-radius: 999px; padding: 10px 16px; background: rgba(255,255,255,.08); }

.fineprint { color: var(--muted); font-size: 12px; text-align: center; margin: 2px 0 0; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.premium { background: linear-gradient(135deg, var(--gold), #ff9d5c); color: #2b1e00; }

/* ---------- Chat ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  gap: 10px;
}
.brand-mini { display: flex; align-items: center; gap: 8px; }
.status { font-size: 13px; color: var(--muted); flex: 1; text-align: center; }
.status.matched { color: var(--ok); }
.status.searching { color: #ffd166; }
.status.ended { color: var(--danger); }
.topbar-actions { display: flex; gap: 8px; }
.topbar-actions button { padding: 8px 12px; font-size: 13px; }

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.videos {
  position: relative;
  background: #05070f;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 220px;
}
.video-wrap { position: absolute; inset: 0; }
.video-wrap video {
  width: 100%; height: 100%; object-fit: cover; background: #05070f;
  display: block;
}
.video-wrap.local {
  inset: auto 12px 12px auto;
  width: 30%; max-width: 220px; aspect-ratio: 3/4;
  border-radius: 12px; overflow: hidden;
  border: 2px solid rgba(255,255,255,.15);
  box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.tag {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(0,0,0,.5); color: white; font-size: 12px;
  padding: 4px 8px; border-radius: 8px;
}
.video-wrap.local .tag { left: 6px; bottom: 6px; font-size: 11px; }

.chatbox {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  min-height: 220px;
  overflow: hidden;
}
.messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 14px;
  line-height: 1.35;
  word-wrap: break-word;
  font-size: 14px;
}
.msg.me { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: #0f1330; border: 1px solid rgba(255,255,255,.06); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: 12px; font-style: italic; }

.typing { padding: 0 12px 6px; color: var(--muted); font-size: 12px; min-height: 18px; }

.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(255,255,255,.06); background: rgba(0,0,0,.15); }
.composer input {
  flex: 1;
  background: #0f1330;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
}
.composer input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,140,255,.25); }

.controls {
  display: flex; gap: 10px; justify-content: center;
  padding: 10px; border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.2);
}
.pill.off { background: rgba(255,92,122,.2); color: #ffb6c2; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0,0,0,.6);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.modal-card h2 { margin: 0; font-size: 22px; }
.modal-sub { color: var(--muted); margin: 0; }
.price {
  font-size: 34px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), #ff9d5c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.perks { padding-left: 0; list-style: none; margin: 0; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: minmax(220px, 42vh) 1fr; }
  .video-wrap.local { width: 35%; max-width: 160px; }
  .status { display: none; }
}

/* When video mode is off, hide the video panel and let chat fill the stage */
.stage.text-only { grid-template-columns: 1fr; }
.stage.text-only .videos { display: none; }
.chat.text-only .controls { display: none; }
