/* VendYou — design system */

:root {
  --bg0: #140d1f;
  --bg1: #1c1128;
  --card: rgba(255, 255, 255, .06);
  --card-solid: #241633;
  --line: rgba(255, 255, 255, .10);
  --text: #f4ecff;
  --muted: #b7aacd;
  --pink: #ff5c87;
  --purple: #a24bff;
  --grad: linear-gradient(135deg, var(--pink), var(--purple));
  --danger: #ff6b6b;
  --ok: #7ddb8a;
  --radius: 22px;
  --mid: 2px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(162, 75, 255, .22), transparent 60%),
    radial-gradient(900px 400px at -10% 15%, rgba(255, 92, 135, .18), transparent 55%),
    var(--bg0);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--pink); text-decoration: none; }

/* ---------- shell ---------- */
#app { min-height: 100vh; }

.boot {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
}
.boot-heart { font-size: 44px; animation: beat 1.1s ease-in-out infinite; }
.boot-line { width: 120px; height: 3px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.boot-line::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: var(--grad); animation: slide 1.1s ease-in-out infinite;
}
@keyframes beat { 0%,100% { transform: scale(1);} 25% { transform: scale(1.25);} 40% { transform: scale(1.05);} }
@keyframes slide { to { transform: translateX(100%); } }

.screen {
  min-height: 100vh;
  padding-bottom: 86px;        /* room for bottom nav */
}

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  background: linear-gradient(rgba(20,13,31,.92), rgba(20,13,31,.55) 70%, transparent);
  backdrop-filter: blur(8px);
}
.topbar .logo { font-weight: 800; font-size: 20px; letter-spacing: .3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .title { font-weight: 700; font-size: 19px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); font-size: 18px;
}
.icon-btn:active { transform: scale(.92); }

/* bottom nav */
.bottomnav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 14px; z-index: 40;
  display: flex; gap: 6px; padding: 7px;
  background: rgba(28,17,40,.82); border: 1px solid var(--line);
  border-radius: 999px; backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.bottomnav button {
  min-width: 82px; padding: 10px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 700; font-size: 14px;
  display: flex; gap: 7px; align-items: center; justify-content: center;
}
.bottomnav button.active { color: #fff; background: var(--grad); box-shadow: 0 6px 18px rgba(162,75,255,.35); }
.bottomnav button:active { transform: scale(.95); }

/* ---------- generic ---------- */
.wrap { padding: 0 16px; }
.center { display: flex; align-items: center; justify-content: center; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.btn {
  width: 100%; padding: 15px 18px; border-radius: 16px;
  font-weight: 800; font-size: 16px; letter-spacing: .2px;
  background: var(--grad); color: #fff;
  box-shadow: 0 10px 24px rgba(255,92,135,.30);
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.ghost { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: none; }
.btn.small { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 12px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 4px 7px; }
.input, input.field-in, select.field-in, textarea.field-in {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--card-solid); border: 1px solid var(--line);
  outline: none; transition: border-color .15s;
}
.input:focus, .field-in:focus { border-color: var(--purple); }
textarea.field-in { min-height: 96px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.pill.on { background: var(--grad); color: #fff; border-color: transparent; }
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }

.muted { color: var(--muted); }
.center-x { text-align: center; }
.h1 { font-size: 26px; font-weight: 800; margin: 12px 0 6px; }
.h2 { font-size: 19px; font-weight: 800; margin: 18px 0 10px; }

.err-banner {
  display: none; margin: 10px 0; padding: 12px 14px;
  border-radius: 12px; background: rgba(255,107,107,.12);
  border: 1px solid rgba(255,107,107,.35); color: #ffb3b3; font-size: 14px;
}
.err-banner.show { display: block; white-space: pre-wrap; }

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty .big { font-size: 44px; margin-bottom: 10px; }

/* ---------- auth screens ---------- */
.auth-hero { text-align: center; padding: 9vh 24px 24px; }
.auth-hero .heart { font-size: 64px; display: block; margin-bottom: 10px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero h1 { font-size: 34px; margin: 0 0 8px; font-weight: 800; }
.auth-hero p { color: var(--muted); margin: 0 auto 10px; max-width: 300px; }

/* ---------- swipe deck ---------- */
.deck-area { position: relative; height: 68vh; max-height: 560px; margin-top: 8px; }
.swipe-card {
  position: absolute; inset: 0; margin: 0 16px;
  border-radius: 26px; overflow: hidden;
  background: var(--card-solid); border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  touch-action: pan-y; user-select: none;
  display: flex; will-change: transform;
}
.swipe-card img {
  width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  background: linear-gradient(160deg, #3a2a52, #241633);
}
.swipe-card .no-photo {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 80px; opacity: .5;
}
.swipe-card .scrim {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 90px 18px 18px;
  background: linear-gradient(transparent, rgba(12,7,20,.92) 60%);
}
.swipe-card .name { font-size: 26px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.swipe-card .meta { color: #e6dcf7; opacity: .9; margin-top: 4px; font-size: 15px; }
.swipe-card .bio {
  margin-top: 8px; font-size: 14px; color: #cfc0e6; line-height: 1.45;
  max-height: 60px; overflow: hidden;
}
.chip {
  display: inline-block; padding: 5px 10px; margin: 4px 4px 0 0;
  border-radius: 999px; background: rgba(255,255,255,.14); font-size: 12px; font-weight: 700;
}
.sticker {
  position: absolute; top: 22px; z-index: 5; padding: 8px 14px;
  border-radius: 12px; font-size: 22px; font-weight: 900; letter-spacing: 1px;
  opacity: 0; transition: opacity .12s; pointer-events: none;
}
.sticker.like { left: 20px; border: 3px solid var(--ok); color: var(--ok); transform: rotate(-14deg); }
.sticker.nope { right: 20px; border: 3px solid var(--danger); color: var(--danger); transform: rotate(14deg); }

.deck-actions {
  display: flex; justify-content: center; gap: 18px; margin-top: 16px;
}
.deck-actions button {
  width: 62px; height: 62px; border-radius: 999px; font-size: 26px;
  background: var(--card); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .08s;
}
.deck-actions button:active { transform: scale(.88); }
.deck-actions .like { color: var(--pink); font-size: 30px; }
.deck-actions .nope { color: var(--muted); }
.deck-actions .super { color: var(--purple); font-size: 30px; }

/* match modal */
.modal-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10,6,16,.72); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.match-card {
  width: 100%; max-width: 360px; padding: 26px 22px; border-radius: 30px;
  background: linear-gradient(160deg, #2a1740, #1c1128);
  border: 1px solid var(--line); text-align: center;
  animation: pop .25s ease;
}
.match-card .big { font-size: 34px; }
.match-card h2 { margin: 8px 0 14px; font-size: 26px; }
.match-avatars { display: flex; justify-content: center; }
.match-avatars img {
  width: 96px; height: 96px; border-radius: 999px; object-fit: cover;
  border: 3px solid var(--pink); margin: 0 -12px;
}
.match-avatars img:first-child { z-index: 1; transform: rotate(-6deg); border-color: var(--purple); }
.match-avatars .ph { display: inline-flex; align-items: center; justify-content: center;
  background: #37224d; font-size: 40px; }
@keyframes pop { from { transform: scale(.8); opacity: 0;} to { transform: scale(1); opacity: 1;} }

/* ---------- matches list ---------- */
.match-row {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  margin-bottom: 10px;
}
.match-row img, .match-row .ph { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; background: #37224d; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.match-row .who { flex: 1; min-width: 0; }
.match-row .who b { display: block; }
.match-row .who span { color: var(--muted); font-size: 13px; }
.match-row .go { color: var(--muted); font-size: 20px; }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 10px 14px 8px; }
.msg { display: flex; margin: 6px 0; }
.msg.me { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line);
  word-break: break-word; font-size: 15px; line-height: 1.4;
}
.msg.me .bubble { background: var(--grad); border-color: transparent; color: #fff; border-bottom-right-radius: 6px; }
.msg .bubble .t { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.msg .bubble img { display: block; max-width: 100%; border-radius: 12px; margin-top: 6px; }
.chat-input-bar {
  position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 12px 16px;
  background: linear-gradient(transparent, var(--bg0) 30%);
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.chat-input-bar input {
  flex: 1; padding: 13px 16px; border-radius: 999px;
  background: var(--card-solid); border: 1px solid var(--line); outline: none;
}
.chat-input-bar button {
  width: 48px; height: 48px; border-radius: 999px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
}

/* ---------- profile ---------- */
.profile-hero { position: relative; margin: 4px 16px 0; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); }
.profile-hero img { width: 100%; height: 40vh; max-height: 420px; object-fit: cover; display: block; background: #37224d; }
.profile-hero .empty-ph { display: flex; align-items: center; justify-content: center; height: 240px; font-size: 70px; background: #37224d; }
.profile-hero .shade { position: absolute; inset: auto 0 0 0; padding: 70px 18px 16px;
  background: linear-gradient(transparent, rgba(12,7,20,.94)); }
.profile-hero .name { font-size: 28px; font-weight: 800; }
.profile-hero .actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }

.list-item {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px;
  border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  margin-bottom: 10px; font-weight: 600; width: 100%; text-align: left;
}
.list-item:active { transform: scale(.985); }
.list-item .ic { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-solid); border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(20px);
  background: #2c1b3f; border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: all .2s; z-index: 80; pointer-events: none; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spin { display: inline-block; width: 22px; height: 22px; border-radius: 999px;
  border: 3px solid rgba(255,255,255,.25); border-top-color: var(--pink);
  animation: rot 0.8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg);} }

.loading-bar { display: flex; justify-content: center; padding: 26px; }
