/* Who's Down? — purple night design */
:root {
  --bg: #0b0618;
  --surface: rgba(139, 92, 246, .09);
  --surface-solid: #170f2e;
  --line: rgba(167, 139, 250, .2);
  --line-strong: rgba(192, 132, 252, .75);
  --text: #f5f0ff;
  --muted: rgba(232, 224, 255, .62);
  --accent: #a855f7;
  --accent-2: #7c3aed;
  --accent-soft: #c4b5fd;
  --grad: linear-gradient(135deg, #c084fc 0%, #9333ea 55%, #7c3aed 100%);
  --glow: rgba(168, 85, 247, .55);
  --ok: #4ade80;
  --radius: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  color: var(--text); font: 16px/1.45 Inter, -apple-system, system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100dvh;
  background:
    radial-gradient(70% 45% at 100% 0%, rgba(124, 58, 237, .35), transparent 70%),
    radial-gradient(60% 40% at 0% 100%, rgba(147, 51, 234, .25), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
/* no double-tap zoom; taps feel instant like a real app */
html, body, button, a, input, textarea, label { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }
.app { max-width: 480px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 18px 120px; min-height: 100dvh; }
h1, h2 { margin: 0; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.mt { margin-top: 28px; }
.mt-s { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }

/* icons */
.ico { width: 1em; height: 1em; display: block; }
[data-ico] { display: inline-flex; align-items: center; justify-content: center; }

/* wordmark */
.brandmark { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }
.wordmark { display: flex; flex-direction: column; line-height: .9; }
.wordmark .w1 { font-weight: 900; font-size: 2.6rem; letter-spacing: -1.5px; padding-left: 28px; }
.wordmark .w2 {
  font-weight: 900; font-style: italic; font-size: 3.4rem; letter-spacing: -2px; padding-right: 6px;
  background: linear-gradient(180deg, #e9d5ff 10%, #a855f7 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark.big .w1 { font-size: 2.9rem; }
.wordmark.big .w2 { font-size: 3.8rem; }
.brandmark .arrow { font-size: 5.2rem; color: #d8b4fe; filter: drop-shadow(0 0 18px var(--glow)) drop-shadow(0 10px 18px rgba(124, 58, 237, .6)); margin-top: 18px; }
.tagline { text-align: center; color: var(--muted); font-size: .95rem; margin: 14px auto 18px; max-width: 320px; }

.hero { text-align: center; padding: 48px 0 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero p { max-width: 300px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.iconbtn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-size: 1.3rem; cursor: pointer; position: relative; display: grid; place-items: center;
}
.iconbtn i { position: absolute; top: 9px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: #f472b6; box-shadow: 0 0 8px #f472b6; }

/* friends row */
.friend-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 4px 2px; margin-bottom: 18px; }
.friend-row .row-empty { width: 100%; text-align: center; padding: 18px 8px; border: 1px dashed var(--line); border-radius: var(--radius); }
.tagline { margin-bottom: 22px !important; }
.friend-row .av { width: 56px; height: 56px; font-size: 1.35rem; }
.av {
  --h: 270; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 1.5rem; color: #fff;
  background: linear-gradient(140deg, hsl(var(--h) 80% 62%), hsl(calc(var(--h) + 40) 70% 38%));
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(192, 132, 252, .8), 0 0 18px var(--glow);
}
.av { position: relative; }
.av.live::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 26%; height: 26%; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px var(--bg), 0 0 10px rgba(74, 222, 128, .7);
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.row-empty { text-align: center; color: var(--muted); font-size: .86rem; padding: 6px 0 4px; }
.photo-btn { display: inline-flex; flex-direction: row; margin-top: 8px; color: var(--text); font-size: .85rem; cursor: pointer; }
.me span.muted { display: block; }
.av.sm { width: 30px; height: 30px; font-size: .8rem; box-shadow: 0 0 0 2px var(--surface-solid); }
.av.md { width: 44px; height: 44px; font-size: 1.05rem; box-shadow: none; }
.av.xl { width: 72px; height: 72px; font-size: 1.8rem; }
.av.add { background: var(--surface); color: var(--text); font-size: 1.8rem; border: 1px solid var(--line); box-shadow: none; cursor: pointer; }
.stack-av { display: flex; }
.stack-av .av + .av { margin-left: -10px; }

/* banner */
.banner {
  width: 100%; font: inherit; color: var(--text); cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(124, 58, 237, .45), rgba(76, 29, 149, .25));
  border: 1px solid var(--line-strong); box-shadow: 0 0 26px rgba(124, 58, 237, .35);
  margin-bottom: 8px;
}
.banner strong { display: block; font-size: 1.15rem; }
.banner .bolt { font-size: 2rem; color: #c4b5fd; filter: drop-shadow(0 0 10px var(--glow)); }
.banner-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.banner-line .stack-av:empty { display: none; }
.banner.empty { background: var(--surface); border-color: var(--line); box-shadow: none; cursor: default; }
.banner.empty strong { opacity: .75; }
.banner.empty .bolt { opacity: .5; filter: none; }
.banner.empty .chev { display: none; }

/* sections */
.section { font-size: 1.25rem; font-weight: 800; margin: 26px 0 12px; letter-spacing: -.3px; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; }
.link { font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.lock { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; }
.page-title { font-size: 2rem; font-weight: 900; letter-spacing: -1px; margin: 8px 0 18px; }

/* activity grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile {
  font: inherit; cursor: pointer; color: var(--text); position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 2px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-weight: 600; font-size: .84rem; transition: transform .12s ease, border-color .12s ease;
}
.tile .ti { font-size: 2rem; color: #d8b4fe; filter: drop-shadow(0 0 8px rgba(168, 85, 247, .5)); }
.tile:active { transform: scale(.96); }
.tile:hover { border-color: var(--line-strong); }
.flash { animation: flash 1s ease; }
@keyframes flash { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 3px var(--accent), 0 0 30px var(--glow); } }

/* cards / lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; }
.row > input { flex: 1; min-width: 0; }
.list { display: flex; flex-direction: column; gap: 12px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-size: .9rem; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; font-size: .9rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.item { display: flex; align-items: center; gap: 12px; }
.item strong { display: block; }
.code-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.code { font-size: 2rem; font-weight: 900; letter-spacing: 3px; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #f5ecff, #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.me { display: flex; align-items: center; gap: 16px; }
.me strong { display: block; font-size: 1.2rem; }

/* plan card */
.plan { display: flex; gap: 14px; align-items: stretch; }
.plan .thumb {
  width: 92px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 3.4rem; color: #fff;
  background: radial-gradient(circle at 30% 25%, #c084fc, #6d28d9 60%, #3b0764);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.plan .thumb { position: relative; overflow: hidden; min-height: 92px; }
.plan .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; flex: none; background: var(--surface); }
.opt-img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; flex: none; background: rgba(255, 255, 255, .06); }
.opt:has(.opt-img) { padding: 8px 12px 8px 8px; }
.credit { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 18px; }
.credit a { color: inherit; }
.plan .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.plan .title { font-weight: 800; font-size: 1.1rem; }
.plan .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.plan .meta [data-ico], .plan .meta .ico { font-size: 1rem; }
.plan .who { display: flex; align-items: center; gap: 8px; font-size: .9rem; flex-wrap: wrap; }
.plan .who .stack-av:empty { display: none; }
.photo-btn { margin-top: 0 !important; }
.chat-head span { display: block; }
.plan .actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 4px; flex-wrap: wrap; }
.tag { font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.tag.ok { color: var(--ok); border: 1px solid rgba(74, 222, 128, .6); background: transparent; }

/* inputs + buttons */
label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
input {
  font: inherit; color: var(--text); background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; width: 100%;
}
input::placeholder { color: rgba(232, 224, 255, .35); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 85, 247, .25); }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 11px 18px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text);
}
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 22px rgba(147, 51, 234, .45); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); width: 100%; }
.btn.big { width: 100%; padding: 17px; font-size: 1.1rem; margin-top: 22px; }
.btn.small { padding: 7px 14px; font-size: .86rem; }
.btn.danger {
  background: linear-gradient(135deg, #f43f5e, #be123c); border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, .4);
}
.page-title.flat { margin: 0; }
.search { position: relative; margin: 14px 0 14px; }
.search [data-ico] { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; }
.search input { padding-left: 42px; border-radius: 999px; }
.search input { padding-right: 44px; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .12); color: var(--text); font-size: .85rem; cursor: pointer;
}
.chat-row.no-chat { cursor: default; }
.chat-row .btn { flex: none; }
.crop-card { align-items: center; text-align: center; }
.crop-box {
  width: 280px; height: 280px; max-width: 80vw; max-height: 80vw; position: relative; overflow: hidden;
  border-radius: 20px; background: #000; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.crop-box:active { cursor: grabbing; }
.crop-box img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.crop-box::after { /* round preview of how the photo will look */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 200px rgba(11, 6, 24, .62); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px;
}
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 280px; max-width: 80vw; color: var(--muted); font-weight: 800; }
.crop-zoom input { flex: 1; accent-color: var(--accent); padding: 0; border: 0; background: none; }
.friend-card { align-items: center; text-align: center; }
.friend-card h2 { font-size: 1.6rem; }
.friend-card #fc-contact { width: 100%; }
.contact-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); text-align: left; }
.contact-line a { color: var(--text); text-decoration: none; }
.contact-line .acts { display: flex; gap: 6px; }
.friend-card .row { width: 100%; }
#friends .item { cursor: pointer; }
.chat-row {
  width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 12px; position: relative;
}
.chat-row strong, .chat-row span.muted, .chat-row .preview { display: block; }
.chat-row .preview { color: var(--text); opacity: .85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .dot { width: 11px; height: 11px; border-radius: 50%; background: #f472b6; box-shadow: 0 0 8px #f472b6; flex: none; }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.msg { font-size: .9rem; color: var(--muted); min-height: 1.2em; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255, 255, 255, .06); border-radius: 999px; padding: 4px; }
.seg button { font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 999px; cursor: pointer; }
.seg button.active { background: var(--grad); color: #fff; }

/* activity page */
.pick-head { text-align: center; padding: 0 0 4px; }
.pick-icon { font-size: 3.4rem; color: #d8b4fe; filter: drop-shadow(0 0 16px var(--glow)); display: inline-flex; }
.pick-head h1 { font-size: 2rem; font-weight: 900; letter-spacing: -1px; margin: 6px 0 4px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.opt {
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-align: left; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px;
  display: flex; align-items: center; gap: 10px; position: relative;
}
.opt span { font-size: 1.3rem; }
.opt.open { grid-column: 1 / -1; justify-content: center; padding: 15px; }
.opt.open small { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }
.opt.on, .chip.on {
  border-color: var(--line-strong); background: linear-gradient(120deg, rgba(168, 85, 247, .35), rgba(124, 58, 237, .18));
  box-shadow: 0 0 18px rgba(168, 85, 247, .35);
}
.opt.on::after {
  content: "✓"; position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: .75rem; font-weight: 900; display: grid; place-items: center;
  box-shadow: 0 0 10px var(--glow);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 10px 16px; }

/* tab bar */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px;
  display: grid; grid-template-columns: 1fr 1fr 88px 1fr 1fr; align-items: end;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(23, 15, 46, .7), rgba(23, 15, 46, .96));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); border-radius: 26px 26px 0 0;
}
.tabbar button {
  font: inherit; font-size: .74rem; font-weight: 600; background: none; border: 0; color: var(--muted);
  padding: 12px 0 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative;
}
.tabbar button [data-ico] { font-size: 1.5rem; }
.tabbar button.active { color: var(--accent); }
.tabbar i { position: absolute; top: 9px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: #f472b6; box-shadow: 0 0 8px #f472b6; }
.tabbar .fab {
  width: 72px; height: 72px; border-radius: 50%; margin: -30px auto 4px; padding: 0; color: #fff;
  background: radial-gradient(circle at 35% 30%, #c084fc, #9333ea 55%, #6d28d9);
  box-shadow: 0 0 0 6px var(--bg), 0 0 30px var(--glow), inset 0 2px 0 rgba(255, 255, 255, .3);
  display: grid; place-items: center;
}
.tabbar .fab [data-ico] { font-size: 2.1rem; }

/* chat */
.chat-head strong { display: block; }
#view-chat .topbar { gap: 8px; }
#view-chat .iconbtn { width: 42px; height: 42px; flex: none; font-size: 1.2rem; }
#view-chat .chat-head { white-space: nowrap; overflow: hidden; }
#view-chat .chat-head strong, #view-chat .chat-head span { overflow: hidden; text-overflow: ellipsis; }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 16px 0 84px; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--grad); border-color: transparent; }
.bubble small { display: block; font-size: .72rem; opacity: .7; font-weight: 700; }
.chat-input {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(11, 6, 24, .92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}

/* bottom sheet (cancel with a reason) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(5, 2, 12, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 480px; background: #170f2e; border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: 26px 26px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(124, 58, 237, .35); animation: up .2s ease;
}
.sheet h2 { font-size: 1.35rem; font-weight: 800; }
.sheet .btn.big { margin-top: 4px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
textarea {
  font: inherit; color: var(--text); background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; width: 100%; resize: none;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 85, 247, .25); }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 112px; max-width: 448px; margin: 0 auto;
  padding: 14px 16px; border-radius: 16px; font-size: .92rem; z-index: 10; color: var(--text);
  background: #1d1236; border: 1px solid var(--line-strong); box-shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 0 24px rgba(124, 58, 237, .35);
}

@media (max-width: 360px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .wordmark .w1 { font-size: 2.2rem; } .wordmark .w2 { font-size: 2.9rem; }
  .brandmark .arrow { font-size: 4.2rem; }
}
