/* ============ Gobblr ============ */
:root {
  --bg: #0c0c0e;
  --bg-elev: #161619;
  --bg-elev-2: #1f1f24;
  --line: #2a2a30;
  --txt: #f4f3f1;
  --txt-dim: #a3a2a8;
  --txt-faint: #6f6e76;
  --gold: #f5a623;
  --gold-hi: #ffc04d;
  --wattle: #e23b3b;
  --online: #3fd06a;
  --shadow: 0 10px 40px rgba(0,0,0,.55);
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #1b160c 0%, transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* App shell — phone-like column, centered on desktop */
.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 0 80px rgba(0,0,0,.6);
}
@media (min-width: 600px) {
  body { padding: 0; }
  .app { min-height: 100dvh; }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: rgba(12,12,14,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 7px; font-weight: 800; letter-spacing: -.02em; }
.brand__mark { font-size: 24px; filter: drop-shadow(0 2px 6px rgba(245,166,35,.35)); }
.brand__word {
  font-size: 22px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar__title { font-size: 18px; font-weight: 700; margin: 0; }
.topbar__actions { margin-left: auto; display: flex; gap: 4px; }
.topbar__icon {
  position: relative;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: transparent; border: 0; color: var(--txt); cursor: pointer;
}
.topbar__icon:active { background: var(--bg-elev-2); }
.topbar__dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Search row ---------- */
.searchrow {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.searchrow__icon { color: var(--txt-faint); flex: none; }
.searchrow__input {
  flex: 1; background: var(--bg-elev); border: 1px solid var(--line);
  color: var(--txt); border-radius: 12px; padding: 10px 12px; font-size: 15px; outline: none;
}
.searchrow__input:focus { border-color: var(--gold); }
.searchrow__clear { background: none; border: 0; color: var(--txt-faint); font-size: 16px; cursor: pointer; padding: 6px; }

/* ---------- Screen / scroll ---------- */
.screen { flex: 1; overflow-y: auto; padding-bottom: calc(78px + var(--safe-b)); }

/* ---------- Browse grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
@media (min-width: 600px) { .grid { gap: 4px; } }
.cell {
  position: relative; aspect-ratio: 3/4; overflow: hidden; cursor: pointer;
  background: var(--bg-elev); display: block; border: 0; padding: 0;
}
.cell__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.cell:active .cell__img { transform: scale(1.04); }
.cell__grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, transparent 28%, transparent 55%, rgba(0,0,0,.85) 100%);
  pointer-events: none;
}
.cell__online { position: absolute; top: 8px; left: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 2px rgba(0,0,0,.45), 0 0 8px var(--online); }
.cell__meta { position: absolute; left: 8px; right: 8px; bottom: 7px; }
.cell__name { font-size: 13px; font-weight: 700; line-height: 1.15; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.cell__sub { font-size: 11px; color: #e9e8ec; opacity: .9; display: flex; align-items: center; gap: 4px; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.cell__fresh { position: absolute; top: 7px; right: 7px; background: var(--gold); color: #1a1206; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase; }

/* generated fallback avatar */
.cell__img--fallback, .ph-fallback { background: linear-gradient(150deg, #2a2118, #3a2a14); display: grid; place-items: center; font-size: 42px; }

/* ---------- Section banner ---------- */
.banner {
  margin: 10px; padding: 12px 14px; border-radius: var(--r);
  background: linear-gradient(120deg, rgba(245,166,35,.16), rgba(226,59,59,.12));
  border: 1px solid rgba(245,166,35,.28);
  display: flex; align-items: center; gap: 12px;
}
.banner__emoji { font-size: 26px; }
.banner__t { font-weight: 700; font-size: 14px; }
.banner__s { font-size: 12px; color: var(--txt-dim); margin-top: 1px; }

/* ---------- Profile sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); animation: fade .2s ease; }
.sheet__panel {
  position: relative; margin: auto auto 0; width: 100%; max-width: 480px;
  background: var(--bg); border-radius: 22px 22px 0 0; max-height: 94dvh; overflow-y: auto;
  animation: rise .28s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow);
}
.sheet__panel--bottom { padding: 8px 18px calc(20px + var(--safe-b)); }
.sheet__handle { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 8px auto 6px; }
.sheet__h { font-size: 18px; margin: 6px 2px 14px; }
.sheet__footer { display: flex; gap: 10px; margin-top: 18px; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* profile hero */
.phero { position: relative; }
.phero__img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: var(--bg-elev); }
.phero__close, .phero__nav {
  position: absolute; top: 14px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px); border: 0; color: #fff;
  display: grid; place-items: center; cursor: pointer; z-index: 3;
}
.phero__close { right: 14px; }
.phero__grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(12,12,14,.95) 100%); pointer-events: none; }
.phero__dots { position: absolute; top: 12px; left: 0; right: 0; display: flex; gap: 4px; justify-content: center; padding: 0 60px; z-index: 2; pointer-events: none; }
.phero__dot { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); }
.phero__dot.is-on { background: #fff; }
.phero__tap { position: absolute; top: 0; bottom: 0; width: 40%; cursor: pointer; z-index: 1; }
.phero__tap--l { left: 0; } .phero__tap--r { right: 0; }
.phero__name { position: absolute; left: 18px; right: 18px; bottom: 14px; }
.phero__name h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.phero__status { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-top: 4px; color: #e9e8ec; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot--on { background: var(--online); box-shadow: 0 0 8px var(--online); }
.dot--off { background: var(--txt-faint); }

/* profile body */
.pbody { padding: 16px 18px 24px; }
.pheadline { font-size: 15px; font-weight: 600; color: var(--gold-hi); margin: 0 0 10px; }
.pbio { font-size: 14.5px; line-height: 1.5; color: var(--txt); margin: 0 0 18px; }
.psec { margin-bottom: 18px; }
.psec__h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-faint); margin: 0 0 8px; font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat__k { font-size: 11px; color: var(--txt-faint); }
.stat__v { font-size: 14px; font-weight: 600; margin-top: 2px; }
.vitals { display: flex; flex-wrap: wrap; gap: 8px; }
.vital { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; }
.vital b { color: var(--gold-hi); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--txt);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer; user-select: none;
}
.chip--tribe { border-color: rgba(245,166,35,.4); background: rgba(245,166,35,.1); color: var(--gold-hi); }
.chip.is-on { background: var(--gold); color: #1a1206; border-color: var(--gold); font-weight: 700; }

/* action bar */
.pactions {
  position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 18px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, transparent, var(--bg) 24%);
}
.fab {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-elev-2); color: var(--txt); display: grid; place-items: center; cursor: pointer;
}
.fab svg { width: 24px; height: 24px; }
.fab--gobble { border-color: rgba(245,166,35,.5); }
.fab--gobble.is-on { background: var(--gold); color: #1a1206; border-color: var(--gold); }
.fab--block svg { stroke: var(--wattle); }
.btn {
  border: 0; border-radius: 14px; font-size: 15px; font-weight: 700; cursor: pointer; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn--primary { flex: 1; height: 54px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1206; }
.btn--primary:active { filter: brightness(.95); }
.btn--ghost { height: 48px; background: var(--bg-elev-2); color: var(--txt); border: 1px solid var(--line); }

/* ---------- Lists (gobbles / messages) ---------- */
.list { padding: 6px 0; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; position: relative;
}
.row:active { background: var(--bg-elev); }
.row + .row::before { content: ""; position: absolute; left: 74px; right: 0; top: 0; border-top: 1px solid var(--line); }
.av { position: relative; flex: none; width: 50px; height: 50px; border-radius: 50%; overflow: hidden; background: var(--bg-elev); }
.av--lg { width: 56px; height: 56px; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av__on { position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 2px var(--bg); }
.row__main { flex: 1; min-width: 0; }
.row__top { display: flex; align-items: baseline; gap: 8px; }
.row__name { font-weight: 700; font-size: 15px; }
.row__age { color: var(--txt-faint); font-size: 13px; }
.row__time { margin-left: auto; font-size: 12px; color: var(--txt-faint); flex: none; }
.row__sub { font-size: 13px; color: var(--txt-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row__sub.is-unread { color: var(--txt); font-weight: 600; }
.row__badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #1a1206; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.tribe-tag { font-size: 11px; color: var(--gold-hi); }

/* gobbles grid header pill */
.subnav { display: flex; gap: 8px; padding: 12px 16px 4px; }
.subnav__pill { font-size: 13px; font-weight: 600; color: var(--txt-dim); background: var(--bg-elev); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.subnav__pill.is-on { color: #1a1206; background: var(--gold); border-color: var(--gold); }
.gobgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 16px; }
@media (min-width: 600px) { .gobgrid { grid-template-columns: repeat(3, 1fr); } }
.gobcard { position: relative; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--bg-elev); }
.gobcard img { width: 100%; height: 100%; object-fit: cover; }
.gobcard__grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.85)); }
.gobcard__meta { position: absolute; left: 12px; right: 12px; bottom: 10px; }
.gobcard__n { font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.gobcard__s { font-size: 12px; color: #e7e6ea; }
.gobcard__heart { position: absolute; top: 10px; right: 10px; font-size: 16px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 100%; }
.bubbles { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 76%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.4; word-wrap: break-word; }
.bub--them { align-self: flex-start; background: var(--bg-elev-2); border-bottom-left-radius: 5px; }
.bub--me { align-self: flex-end; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1206; border-bottom-right-radius: 5px; }
.bub__t { font-size: 10px; opacity: .6; margin: 0 4px; }
.bub__t--me { align-self: flex-end; } .bub__t--them { align-self: flex-start; }
.chatbar {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 14px calc(12px + var(--safe-b));
  background: rgba(12,12,14,.9); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.chatbar input { flex: 1; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; color: var(--txt); font-size: 15px; outline: none; }
.chatbar input:focus { border-color: var(--gold); }
.chatbar button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1206; cursor: pointer; display: grid; place-items: center; }

/* ---------- Profile (me) ---------- */
.me { padding-bottom: 10px; }
.me__hero { position: relative; aspect-ratio: 4/5; max-height: 440px; overflow: hidden; }
.me__hero img { width: 100%; height: 100%; object-fit: cover; }
.me__hgrad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(12,12,14,.96)); }
.me__id { position: absolute; left: 18px; right: 18px; bottom: 16px; }
.me__id h2 { margin: 0; font-size: 26px; font-weight: 800; }
.me__id p { margin: 4px 0 0; color: var(--txt-dim); font-size: 13px; }
.me__complete { margin: 16px; padding: 14px; border-radius: var(--r); background: var(--bg-elev); border: 1px solid var(--line); }
.me__bar { height: 8px; border-radius: 99px; background: var(--bg-elev-2); overflow: hidden; margin: 8px 0 6px; }
.me__bar i { display: block; height: 100%; width: 60%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); }
.me__list { margin: 8px 16px 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.me__item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 15px; cursor: pointer; }
.me__item + .me__item { border-top: 1px solid var(--line); }
.me__item svg { color: var(--gold); }
.me__item .chev { margin-left: auto; color: var(--txt-faint); }
.me__upsell { margin: 16px; padding: 18px; border-radius: var(--r); text-align: center; background: linear-gradient(140deg, rgba(245,166,35,.18), rgba(226,59,59,.14)); border: 1px solid rgba(245,166,35,.35); }
.me__upsell h3 { margin: 0 0 4px; font-size: 18px; }
.me__upsell p { margin: 0 0 12px; font-size: 13px; color: var(--txt-dim); }

/* ---------- Bottom tabbar ---------- */
.tabbar {
  position: sticky; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(12,12,14,.92); backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tab {
  position: relative; background: none; border: 0; color: var(--txt-faint); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 7px; font-size: 10.5px; font-weight: 600;
}
.tab svg { width: 23px; height: 23px; }
.tab.is-active { color: var(--gold); }
.tab.is-active svg { fill: rgba(245,166,35,.16); }
.tab__badge {
  position: absolute; top: 4px; left: 50%; margin-left: 6px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--wattle); color: #fff; font-size: 10px; font-weight: 800; font-style: normal;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%);
  z-index: 80; background: var(--bg-elev-2); color: var(--txt); border: 1px solid var(--line);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  animation: toastIn .25s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translateX(-50%); } }

/* empty states */
.empty { text-align: center; padding: 60px 30px; color: var(--txt-dim); }
.empty__emoji { font-size: 46px; }
.empty h3 { margin: 12px 0 4px; color: var(--txt); }
.empty p { margin: 0; font-size: 14px; }

/* range + switch */
.range { -webkit-appearance: none; width: 100%; height: 5px; border-radius: 99px; background: var(--bg-elev-2); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.switch { -webkit-appearance: none; appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--bg-elev-2); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--gold); }
.switch:checked::after { transform: translateX(18px); }
.filter__row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 15px; }
.filter__block { padding: 12px 0; border-top: 1px solid var(--line); }
.filter__label { font-size: 13px; color: var(--txt-dim); margin-bottom: 10px; display: flex; justify-content: space-between; }
.filter__label em { color: var(--gold-hi); font-style: normal; font-weight: 700; }

/* chat typing indicator */
.bub--typing { display: inline-flex; gap: 4px; align-items: center; }
.bub--typing span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; animation: bubblink 1s infinite; }
.bub--typing span:nth-child(2) { animation-delay: .15s; }
.bub--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bubblink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-2px); } }

/* tappable chat header → opens the turkey's profile */
.chathead {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 14px; border: 0; cursor: pointer;
  background: rgba(12,12,14,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); color: var(--txt); text-align: left;
}
.chathead:active { background: var(--bg-elev); }
.av--sm { width: 38px; height: 38px; }
.chathead__main { flex: 1; min-width: 0; }
.chathead__name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.chathead__sub { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }
.chathead__chev { width: 20px; height: 20px; color: var(--txt-faint); flex: none; }

/* let horizontal swipes reach JS (profile nav) while vertical still scrolls */
#profilePanel { touch-action: pan-y; }
