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

:root {
  /* Pepper & Peach — warm cream background, red wordmark, gold accents. */
  --bg: #fdf6e3;              /* cream */
  --bg-soft: #f6edd6;
  --text: #33291d;           /* warm dark brown */
  --muted: #a99b83;
  --accent: #e23b2e;          /* Pepper & Peach red */
  --accent-dark: #c2281d;     /* darker red — readable on light bg */
  --accent-soft: #fdeae6;     /* chip / tint background */
  --accent-border: #f4c9c1;
  --gold: #cf9f3d;            /* gold accent (tagline, dividers) */
  --on-accent: #ffffff;       /* white text/icons on red surfaces */
  --super: #5b5fe0;           /* blue star */
  --like: #e23b2e;
  --pass: #b9b2ab;
  --card: #ffffff;
  --line: #ece0c8;            /* cream-toned lines */
  --shadow: 0 10px 30px rgba(120, 80, 20, 0.10);
  --shadow-card: 0 18px 50px rgba(120, 80, 20, 0.18);
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; width: 100%; overflow: hidden; }
/* Media never overflows its container on any screen. */
img, canvas, svg, video { max-width: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overscroll-behavior: none;
  /* Fallback first, then Telegram's live height / dynamic vh (iOS Safari 15.4+). */
  height: 100vh;
  height: var(--tg-viewport-stable-height, 100dvh);
}
#app {
  max-width: 480px; width: 100%; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden;
  height: 100vh;                                   /* legacy fallback */
  height: var(--tg-viewport-stable-height, 100dvh);
  /* Respect notches / Dynamic Island / home indicator on iPhone X–17, etc. */
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
#screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; padding: 18px 18px 8px; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { font-family: 'Fredoka', sans-serif; font-weight: 700; margin: 0 0 12px; letter-spacing: -.2px; }
h1 { font-size: 32px; line-height: 1.15; }
.muted { color: var(--muted); }
small.muted { font-size: 12px; }

/* App header (Telegram-style) */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 14px; }
.app-header h2 { font-size: 26px; margin: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--bg-soft);
  display: grid; place-items: center; color: var(--text); }

/* Pepper & Peach brand / logo */
.brand-wordmark { font-family: 'Pacifico', cursive; color: var(--accent); font-size: 24px !important;
  font-weight: 400; line-height: 1; }
.brand { text-align: center; padding: 6px 0 2px; }
.brand .brand-img { max-width: 240px; width: 72%; height: auto; }
.brand .emojis { font-size: 42px; line-height: 1; }
.brand .brand-title { font-family: 'Pacifico', cursive; color: var(--accent); font-size: 38px;
  font-weight: 400; margin: 6px 0 2px;
  text-shadow: 1.5px 1.5px 0 #fff, 2px 2px 0 var(--gold); }
.brand .tag { color: var(--gold); font-weight: 700; letter-spacing: 2px; font-size: 12px; text-transform: uppercase; }

/* Buttons */
.btn { width: 100%; padding: 16px; border: none; border-radius: 30px; font-size: 16px;
  font-weight: 600; color: var(--on-accent); background: var(--accent); margin-top: 10px; box-shadow: 0 8px 20px rgba(220,20,60,.4); }
.btn:active { transform: scale(.99); }
.btn.secondary { background: var(--bg-soft); color: var(--text); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--accent-dark); box-shadow: none; }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.small { width: auto; padding: 9px 18px; font-size: 14px; border-radius: 22px; box-shadow: none; }

/* Inputs */
label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 7px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line);
  background: #ffffff; color: var(--text); font-size: 15px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
input[type=range] { accent-color: var(--accent); padding: 0; border: none; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }

/* Emoji pill chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 11px 18px; border-radius: 26px;
  background: var(--bg); border: 1.5px solid var(--accent-border); color: var(--accent-dark);
  font-size: 14px; font-weight: 500; }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.chip .em { font-size: 16px; }

/* Onboarding wizard */
.progress { height: 5px; background: var(--accent-soft); border-radius: 3px; margin: 6px 0 24px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.lead { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 6px; }
.wiz-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.fab-next { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--text); color: #fff;
  font-size: 22px; display: grid; place-items: center; flex: none; }
.fab-next.accent { background: var(--accent); color: var(--on-accent); }

/* Location permission screen */
.perm-ring { width: 170px; height: 170px; border-radius: 50%; border: 1.5px solid var(--line);
  margin: 40px auto; display: grid; place-items: center; color: var(--accent-dark); }

/* Swipe deck */
.deck { position: relative; margin-top: 4px;
  height: calc(100vh - 250px);
  height: calc(var(--tg-viewport-stable-height, 100dvh) - 250px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.card {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow-card); user-select: none;
  display: flex; flex-direction: column; justify-content: flex-end;
  background-size: cover; background-position: center;
}
.card .overlay { background: linear-gradient(transparent, rgba(0,0,0,.65) 78%); padding: 20px 18px 22px; color: #fff; }
.card h2 { color: #fff; font-size: 27px; margin: 0; }
.card .loc { display: flex; align-items: center; gap: 5px; font-size: 14px; opacity: .92; margin: 6px 0 12px; }
.card .verified { color: #fff; background: var(--super); font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.35); color: #fff;
  padding: 8px 14px; border-radius: 22px; font-size: 13px; font-weight: 500; margin: 0 6px 6px 0; }
.card-meta { font-size: 13px; opacity: .95; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.card-bio { font-size: 14px; line-height: 1.35; margin: 8px 0 10px; opacity: .95;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reasons { font-size: 12px; color: #ffe3d9; margin-top: 8px; }
.stamp { position: absolute; top: 30px; font-size: 30px; font-weight: 800; padding: 6px 16px;
  border: 4px solid; border-radius: 12px; opacity: 0; transition: opacity .08s; font-family: 'Fredoka'; }
.stamp.like { left: 22px; color: var(--like); border-color: var(--like); transform: rotate(-14deg); }
.stamp.nope { right: 22px; color: #ff5a5a; border-color: #ff5a5a; transform: rotate(14deg); }
.tap-hint { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,.35); color:#fff;
  font-size: 11px; padding: 5px 11px; border-radius: 16px; }

/* Floating super-like + action buttons */
.super-fab { position: absolute; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%;
  border: none; background: var(--super); color: #fff; font-size: 24px; display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(91,95,224,.4); z-index: 3; }
.swipe-actions { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 18px; }
/* Uniform action buttons — same size & style, distinguished only by icon colour. */
.round { width: 62px; height: 62px; font-size: 25px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  background: #fff; box-shadow: var(--shadow); }
.round.pass { color: var(--pass); }
.round.like { color: var(--accent); }
.round.super { color: var(--super); }
.round.rewind { color: #f0a93c; }

/* Profile-first discover: actions sit at the natural END of the profile, so
   the user scrolls through the whole profile before reaching them. */
.suggestion { padding-bottom: 4px; }
.suggest-actions { display: flex; justify-content: center; align-items: center; gap: 16px;
  margin-top: 18px; padding: 16px 0 calc(14px + env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--line); }
.reasons-list { font-size: 14px; color: var(--accent-dark); line-height: 1.4; }

/* Detail (expanded profile) */
.detail-hero { height: 320px; border-radius: var(--radius); background-size: cover; background-position: center;
  position: relative; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.detail-hero .overlay { background: linear-gradient(transparent, rgba(0,0,0,.6)); width: 100%; padding: 18px; border-radius: 0 0 var(--radius) var(--radius); color:#fff; }
.section-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 14px; }
.section-card h4 { font-family: 'Poppins'; text-transform: uppercase; letter-spacing: .5px; font-size: 12px;
  color: var(--accent-dark); margin: 0 0 12px; font-weight: 600; }
.life-row { margin-bottom: 12px; }
.life-row:last-child { margin-bottom: 0; }
.life-row .k { font-size: 12px; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.life-row .v { font-size: 16px; color: var(--text); margin-top: 2px; }

/* Lists (chats / liked you) */
.row { display: flex; align-items: center; gap: 13px; padding: 12px; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 18px; margin-bottom: 11px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bg-soft); flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { font-weight: 600; }
.row .grow p { margin: 2px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { background: var(--accent); color: var(--on-accent); border-radius: 12px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.blur { filter: blur(8px); }

/* Chat */
.chat { display: flex; flex-direction: column;
  height: calc(100vh - 36px);
  height: calc(var(--tg-viewport-stable-height, 100dvh) - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 6px 2px 12px; border-bottom: 1.5px solid var(--line); }
.chat-head b { font-family: 'Fredoka'; font-size: 18px; }
.messages { flex: 1; overflow-y: auto; padding: 14px 2px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 76%; padding: 11px 15px; border-radius: 20px; font-size: 15px; word-wrap: break-word; line-height: 1.35; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--bg-soft); color: var(--text); border-bottom-left-radius: 6px; }
.msg .meta { font-size: 10px; opacity: .7; margin-top: 4px; text-align: right; }
.composer { display: flex; gap: 10px; padding: 10px 0 4px; }
.composer input { flex: 1; border-radius: 26px; }
.composer button { width: 50px; flex: none; border-radius: 50%; border: none; font-size: 18px; background: var(--accent); color: var(--on-accent); }
.typing { font-size: 12px; color: var(--muted); padding: 0 4px; height: 16px; }

/* Bottom tab bar */
.tabbar { display: flex; border-top: 1.5px solid var(--line); background: var(--bg); padding: 8px 4px max(8px, env(safe-area-inset-bottom)); }
.tab { flex: 1; background: none; border: none; color: var(--muted); padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; position: relative; }
.tab .ico { width: 28px; height: 28px; display: grid; place-items: center; transition: all .15s; }
.tab .ico svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent-dark); }
.tab[data-tab="discovery"].active .ico { background: var(--accent); color: var(--on-accent); border-radius: 50%; }
.tab .badge-dot { position: absolute; top: -1px; right: 50%; margin-right: -14px; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%; border: 2px solid var(--bg); }

/* Panels / plans */
.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.plan { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.plan.featured { border-color: var(--accent); background: var(--accent-soft); }
.price { font-family: 'Fredoka'; font-size: 28px; font-weight: 700; }
.flag-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1.5px solid var(--line); }
.flag-row:last-child { border-bottom: none; }
.flag-row select { width: auto; padding: 8px 12px; border-radius: 12px; }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(40,30,25,.55); display: grid; place-items: center; z-index: 50; padding: 28px; }
.modal-card { background: var(--bg); border-radius: 26px; padding: 28px 22px; text-align: center; max-width: 340px; width: 100%; box-shadow: var(--shadow-card); }
.modal-card h1 { font-size: 34px; background: linear-gradient(120deg, var(--accent-dark), #ff4d6d);
  -webkit-background-clip: text; background-clip: text; color: transparent; }

.center { text-align: center; padding: 50px 16px; color: var(--muted); line-height: 1.6; }
.toast { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); background: var(--text);
  color: #fff; padding: 12px 20px; border-radius: 24px; font-size: 14px; z-index: 100; max-width: 90%; box-shadow: var(--shadow); }
.completeness { font-size: 12px; color: var(--muted); margin-top: 4px; }
.meter { font-family: 'Fredoka'; font-weight: 600; }

/* Events */
.event-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.event-card .topic { display: inline-block; background: var(--accent-soft); color: var(--accent-dark);
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; margin-bottom: 10px; }
.event-card h3 { font-size: 19px; margin: 0 0 8px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.event-meta span { display: inline-flex; align-items: center; gap: 5px; }
.event-host { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1.5px solid var(--line); margin-top: 4px; }
.event-host .avatar { width: 40px; height: 40px; }
.event-host .grow { flex: 1; min-width: 0; }
.cap-bar { height: 7px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.cap-bar > span { display: block; height: 100%; background: var(--accent); }
.stack-avatars { display: flex; }
.stack-avatars img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); margin-left: -10px; }
.stack-avatars img:first-child { margin-left: 0; }
.status-tag { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 16px; }
.status-tag.pending { background: #fff3e0; color: #c97a00; }
.status-tag.approved { background: #e7f7ed; color: #1f9d55; }
.status-tag.rejected { background: #fdecec; color: #d14343; }
.seg { display: flex; gap: 8px; background: var(--bg-soft); padding: 5px; border-radius: 16px; margin-bottom: 16px; }
.seg button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 12px; font-weight: 600; color: var(--muted); font-family: inherit; }
.seg button.active { background: var(--bg); color: var(--accent-dark); box-shadow: var(--shadow); }

/* Image cropper */
.modal-card.cropper { max-width: min(92vw, 380px); }
.crop-frame { position: relative; overflow: hidden; border-radius: 16px; margin: 0 auto;
  background: #000; touch-action: none; cursor: grab; max-width: 100%; }
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; user-select: none; -webkit-user-drag: none; pointer-events: none; }
input[type=range]#crop-zoom { width: 100%; }

/* Bitcoin payments */
.btc-banner { background: #f7931a; color: #fff; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 14px; margin: 0 0 14px; text-align: center; box-shadow: 0 6px 16px rgba(247,147,26,.3); }
.qr-wrap { display: inline-block; padding: 12px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 18px; margin-top: 12px; box-shadow: var(--shadow); }
.qr-wrap img { display: block; border-radius: 8px; }

/* Upload tile (gallery picker) */
.upload-tile { height: 180px; border-radius: 16px; border: 1.5px dashed var(--accent-border);
  background: var(--accent-soft); background-size: cover; background-position: center;
  display: grid; place-items: center; color: var(--accent-dark); font-weight: 600;
  cursor: pointer; margin-top: 4px; }
.upload-tile.has-image { border-style: solid; border-color: var(--line); }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-grid .ph { position: relative; aspect-ratio: 3/4; border-radius: 16px; background-size: cover;
  background-position: center; background-color: var(--bg-soft); display: flex; align-items: flex-end; justify-content: space-between; padding: 6px; }
.photo-grid .ph button { border: none; border-radius: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 8px; }
.photo-grid .add { border: 1.5px dashed var(--accent-border); display: grid; place-items: center; font-size: 30px; color: var(--accent-dark); }
