/* Friend Says guest pages. Tokens mirror PLAN.md §6 and the iOS Theme.swift. */
:root {
  --bg: #F6F4FF;
  --card: #FFFFFF;
  --ink: #15112B;
  --ink-2: #5A5675;
  --soft: #F1EDFF;
  --line: #E3DDF7;
  --host: #FFD23F;
  --brand: linear-gradient(135deg, #6C3BFF, #C9216F);
  --brand-hot: linear-gradient(135deg, #6C3BFF, #FF3D8B);
  --hero: linear-gradient(150deg, #5B2EF0, #B42BC8 50%, #FF3D8B 80%, #FF8A3D);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: Inter, -apple-system, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); -webkit-font-smoothing: antialiased; }
body.dark { background: #15112B; color: #fff; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: #6C3BFF; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.center { margin: auto; text-align: center; padding: 32px; }
.muted { color: var(--ink-2); }
body.dark .muted { color: #C9C4E8; }
h1, h2, .display { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 36px; line-height: 1.02; }
h2 { font-size: 20px; }
.grad-text { background: linear-gradient(90deg, #FFD23F, #FF8A3D); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn { height: 58px; border-radius: 29px; border: 0; padding: 0 24px; font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; width: 100%; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 12px 28px rgba(108, 59, 255, .38); }
.btn.hot { background: var(--brand-hot); color: #fff; box-shadow: 0 12px 30px rgba(255, 61, 139, .4); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; color: inherit; height: 44px; font-weight: 600; font-size: 15px; }
.btn:disabled { opacity: .5; }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--host); color: var(--ink); font: 800 15px/34px var(--display); text-align: center; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who .avatar { color: var(--ink) !important; font-size: 15px; }
.ring { padding: 3px; border-radius: 50%; background: linear-gradient(135deg, #6C3BFF, #FF3D8B 55%, #FFB020); display: flex; flex: none; }
.who .ring .avatar { border: 3px solid #15112B; width: 58px; height: 58px; line-height: 52px; font-size: 24px; }

/* Welcome */
.welcome { flex: 1; display: flex; flex-direction: column; }
.mosaic-wrap { height: 300px; overflow: hidden; position: relative; flex: none; }
.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 120px; gap: 4px; transform: rotate(-6deg) scale(1.2); transform-origin: center top; margin-top: -20px; }
.mosaic div { border-radius: 14px; }
.welcome .fade { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; background: linear-gradient(180deg, rgba(21,17,43,0), #15112B 90%); }
.welcome .body { padding: 0 24px; display: flex; flex-direction: column; gap: 14px; position: relative; margin-top: -24px; }
.who { display: flex; align-items: center; gap: 12px; }
.who b { display: block; font-size: 16px; }
.who span { font-size: 13px; color: #C9C4E8; }
.welcome p { margin: 0; font-size: 16px; line-height: 1.45; color: #DCD8F2; }
.welcome form { margin-top: auto; padding: 24px 24px calc(28px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
label.field { font-weight: 700; font-size: 13px; color: #C9C4E8; }
input.text { height: 56px; border-radius: 18px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); padding: 0 16px; font: 700 18px var(--text); color: #fff; outline: none; width: 100%; }
input.text:focus { border-color: #FF3D8B; }

/* Voting */
.vote { flex: 1; display: flex; flex-direction: column; padding: calc(16px + var(--safe-t)) 16px calc(22px + var(--safe-b)); gap: 14px; min-height: 100dvh; }
.progress { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; }
.bar i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6C3BFF, #FF3D8B, #FFB020); transition: width .25s; }
.progress small { font-weight: 700; font-size: 14px; color: #DCD8F2; min-width: 52px; text-align: right; }
.stack { flex: 1; position: relative; min-height: 420px; }
.stack .behind { position: absolute; left: 14px; right: 14px; top: 10px; bottom: -10px; border-radius: 30px; background: rgba(255,255,255,.08); }
.pcard { position: absolute; inset: 0; border-radius: 30px; overflow: hidden; background: #fff; color: var(--ink); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.4); touch-action: pan-y; user-select: none; transition: transform .25s ease, opacity .25s ease; }
.pcard.dragging { transition: none; }
.pcard .hero { flex: 1; min-height: 240px; position: relative; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; color: #fff; }
.pcard .hero img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard .hero .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55)); }
.pcard .hero svg.big { position: absolute; right: -30px; top: 10px; width: 220px; height: 220px; }
.pcard .hero > *:not(img):not(.shade):not(svg) { position: relative; }
.badge { align-self: flex-start; height: 26px; padding: 0 10px; border-radius: 13px; background: rgba(255,255,255,.25); font: 700 12px/26px var(--text); backdrop-filter: blur(6px); }
.pcard .name { margin-top: 8px; font: 800 34px/1 var(--display); letter-spacing: -0.02em; }
.pcard .dist { margin-top: 4px; font-weight: 600; font-size: 14px; opacity: .92; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 16px; }
.tip p { margin: 0; background: var(--soft); border-radius: 18px 18px 18px 5px; padding: 11px 14px; font-weight: 600; font-size: 16px; line-height: 1.4; color: #2A2450; }
.stamp { position: absolute; top: 24px; padding: 6px 14px; border-radius: 12px; font: 800 22px var(--display); border: 3px solid; opacity: 0; transform: rotate(-12deg); }
.stamp.want { left: 20px; color: #fff; border-color: #fff; background: rgba(255,61,139,.6); }
.stamp.skip { right: 20px; color: #fff; border-color: #fff; background: rgba(21,17,43,.5); transform: rotate(12deg); }
.stamp.maybe { left: 50%; transform: translateX(-50%); color: var(--ink); border-color: var(--ink); background: rgba(255,210,63,.9); }
.actions { display: flex; justify-content: center; align-items: center; gap: 22px; }
.act { border: 0; display: flex; align-items: center; justify-content: center; }
.act.skip { width: 64px; height: 64px; border-radius: 32px; background: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.act.maybe { height: 56px; padding: 0 22px; border-radius: 28px; background: var(--host); color: var(--ink); font-weight: 800; font-size: 16px; box-shadow: 0 8px 20px rgba(255,210,63,.35); }
.act.want { width: 76px; height: 76px; border-radius: 38px; background: var(--brand-hot); box-shadow: 0 12px 30px rgba(255,61,139,.5); }
.act:active { transform: scale(.94); }
.undo { align-self: center; background: none; border: 0; color: #C9C4E8; font-weight: 600; font-size: 14px; height: 36px; }

/* Done */
.done-hero { padding: calc(40px + var(--safe-t)) 24px 24px; background: linear-gradient(150deg, #13875A, #18B87A 40%, #16C2F3); color: #fff; border-radius: 0 0 32px 32px; display: flex; flex-direction: column; gap: 10px; }
.done-hero .check { width: 52px; height: 52px; border-radius: 26px; background: #fff; display: flex; align-items: center; justify-content: center; }
.done-hero p { margin: 0; font-weight: 500; font-size: 16px; line-height: 1.45; }
.me { padding: 20px 24px 0; display: flex; align-items: center; gap: 12px; }
.me .avatar { width: 56px; height: 56px; line-height: 56px; font-size: 22px; background: linear-gradient(135deg, #FFC93D, #FF7A1A); box-shadow: 0 0 0 3px #fff, 0 0 0 5px #FF9A2A; }
.me div { flex: 1; }
.me b { font: 800 18px var(--display); display: block; }
.me span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.me button { background: none; border: 0; color: #6C3BFF; font-weight: 700; font-size: 14px; height: 44px; }
.grid3 { padding: 14px 24px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile { height: 104px; border-radius: 16px; padding: 8px; display: flex; align-items: flex-end; color: #fff; font: 700 12px/1.15 var(--display); position: relative; overflow: hidden; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile span { position: relative; text-shadow: 0 1px 6px rgba(0,0,0,.3); }
.foot { margin-top: auto; padding: 20px 24px calc(28px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.promo { background: var(--soft); border-radius: 20px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.promo span { flex: 1; font-weight: 600; font-size: 14px; line-height: 1.4; color: #2A2450; }
.promo a { height: 40px; padding: 0 14px; border-radius: 20px; background: var(--brand); color: #fff; font: 700 13px/40px var(--text); text-decoration: none; white-space: nowrap; }

/* Plan */
.plan-head { padding: calc(20px + var(--safe-t)) 20px 16px; background: #15112B; color: #fff; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; z-index: 2; }
.plan-head .who span { color: #C9C4E8; font-weight: 600; font-size: 13px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 40px; padding: 0 14px; border-radius: 20px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; flex: none; }
.tab[aria-selected="true"] { background: var(--brand-hot); }
.a2hs { margin: 14px 16px 0; background: linear-gradient(135deg, #FFD23F, #FF8A3D); border-radius: 18px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px; line-height: 1.35; }
.a2hs button { background: none; border: 0; font-size: 20px; line-height: 1; width: 32px; height: 32px; color: var(--ink); }
.day { padding: 14px 16px calc(30px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.day-title { font: 800 26px/1.05 var(--display); margin: 4px 4px 2px; }
.slot { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 8px 4px 0; }
.stop { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 6px 18px rgba(76,52,170,.08); }
.stop .cover { min-height: 92px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; position: relative; overflow: hidden; }
.stop .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stop .cover .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.5)); }
.stop .cover svg { position: absolute; right: -14px; top: -6px; width: 110px; height: 110px; }
.stop .cover b, .stop .cover small { position: relative; }
.stop .cover b { font: 800 20px/1.05 var(--display); }
.stop .cover small { font-weight: 600; font-size: 12px; opacity: .92; }
.stop .inner { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.stop .inner p { margin: 0; font-weight: 600; font-size: 14px; line-height: 1.4; color: #2A2450; }
.stop .inner p b { color: #6C3BFF; }
.dirs { display: flex; gap: 8px; flex-wrap: wrap; }
.dirs a { height: 38px; padding: 0 14px; border-radius: 19px; font: 700 13px/38px var(--text); text-decoration: none; white-space: nowrap; }
.dirs a.apple { background: var(--ink); color: #fff; }
.dirs a.google { background: var(--soft); color: var(--ink); }
.meals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.meal { background: #fff; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 4px 14px rgba(76,52,170,.06); text-decoration: none; color: var(--ink); }
.meal i { width: 28px; height: 28px; border-radius: 9px; display: block; }
.meal b { font-size: 15px; }
.meal small { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.meal p { margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: #2A2450; font-weight: 500; }

/* Landing */
.landing { flex: 1; background: var(--hero); color: #fff; padding: calc(64px + var(--safe-t)) 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.landing p { font-size: 17px; line-height: 1.45; margin: 0; opacity: .92; }

@media (prefers-reduced-motion: reduce) { .pcard, .bar i { transition: none; } }
