:root {
  --panel: rgba(15, 14, 30, 0.72); --panel-solid: #15142a; --panel2: rgba(255,255,255,0.07); --line: rgba(255,255,255,0.12);
  --text: #f5f3ff; --muted: #b9b5d6; --dim: #8b87ab; --accent: #8b5cf6; --accent2: #a78bfa;
  --in: #22c55e; --maybe: #f59e0b; --out: #ef4444; --radius: 18px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: #0b0a1a; }
body { color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif; min-height: 100vh; }
body[class*='bg-'] { background-attachment: fixed; }
#bglayer { position: fixed; inset: 0; z-index: -1; transition: background .3s; }
a { color: var(--accent2); }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 90px; }
.hidden { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(10, 9, 22, 0.55); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 10px; height: 58px; padding-bottom: 0; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 6px; }
.logo span { color: var(--accent2); }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 12px; font-weight: 600; font-size: 14px; position: relative; }
.nav a.on { color: var(--text); background: var(--panel2); }
.badge { position: absolute; top: 2px; right: 2px; background: var(--out); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 0 5px; line-height: 16px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
h1 { font-size: 28px; margin: 22px 0 4px; letter-spacing: -0.02em; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 2px 14px rgba(0,0,0,.35); }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 18px 0 8px; }
.sub { color: rgba(255,255,255,.92); margin: 0 0 8px; text-shadow: 0 1px 3px rgba(0,0,0,.6), 0 0 12px rgba(0,0,0,.35); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .dim { color: var(--dim); font-size: 13px; }

/* buttons & inputs */
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); } .btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #b91c1c; } .btn.small { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; }
input, textarea, select { width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; outline: none; }
input:focus, textarea:focus { border-color: var(--accent2); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-weight: 600; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.err { color: #fca5a5; font-size: 14px; min-height: 20px; margin-top: 8px; }

/* avatars */
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; flex: none; border: 2px solid rgba(255,255,255,.25); }
.av.sm { width: 28px; height: 28px; font-size: 15px; border-width: 1.5px; } .av.lg { width: 76px; height: 76px; font-size: 40px; border-width: 3px; }
.c-violet { background: #7c3aed; } .c-blue { background: #2563eb; } .c-teal { background: #0d9488; } .c-green { background: #16a34a; } .c-yellow { background: #ca8a04; }
.c-orange { background: #ea580c; } .c-red { background: #dc2626; } .c-pink { background: #db2777; } .c-gray { background: #52525b; }
.stack { display: flex; } .stack .av { margin-left: -8px; } .stack .av:first-child { margin-left: 0; }

/* groups & plans */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gtile { border-radius: var(--radius); padding: 14px; min-height: 110px; text-decoration: none; color: #fff; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); box-shadow: inset 0 -60px 60px -30px rgba(0,0,0,.45); }
.gtile .e { font-size: 30px; } .gtile b { font-size: 16px; text-shadow: 0 1px 6px rgba(0,0,0,.5); } .gtile small { opacity: .85; }
.gtile.new { background: var(--panel2); border-style: dashed; align-items: center; justify-content: center; gap: 4px; color: var(--muted); cursor: pointer; }
.plan { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--panel2); text-decoration: none; color: var(--text); margin-bottom: 8px; border: 1px solid transparent; }
.plan:hover { border-color: var(--line); }
.plan .pe { font-size: 26px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.plan b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan .meta { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.p-in { background: #22c55e2e; color: #86efac; } .p-maybe { background: #f59e0b2e; color: #fcd34d; } .p-out { background: #ef44442e; color: #fca5a5; } .p-none { background: var(--panel2); color: var(--muted); }
.p-cancel { background: #ef444433; color: #fecaca; }

/* hero header (group / plan / profile) */
.hero { border-radius: 0 0 26px 26px; padding: 28px 0 22px; margin-bottom: 4px; box-shadow: inset 0 -90px 80px -40px rgba(0,0,0,.55); }
.hero .wrap { padding-bottom: 0; }
.hero h1 { margin-top: 6px; }
.hero .big { font-size: 46px; line-height: 1; }

/* RSVP */
.rsvp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rsvp button { border: 2px solid var(--line); background: var(--panel2); border-radius: 14px; padding: 12px 6px; font-weight: 800; cursor: pointer; font-size: 15px; }
.rsvp button.on-in { border-color: var(--in); background: #22c55e33; } .rsvp button.on-maybe { border-color: var(--maybe); background: #f59e0b33; } .rsvp button.on-out { border-color: var(--out); background: #ef444433; }
.who { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border-radius: 99px; padding: 3px 10px 3px 3px; font-size: 13px; text-decoration: none; color: var(--text); }

/* find a time & polls */
.opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); margin-bottom: 6px; position: relative; overflow: hidden; }
.opt .fill { position: absolute; inset: 0 auto 0 0; background: rgba(139,92,246,.25); z-index: 0; transition: width .3s; }
.opt > *:not(.fill) { position: relative; z-index: 1; }
.opt.best { outline: 2px solid var(--in); }
.tick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: transparent; cursor: pointer; flex: none; font-weight: 900; }
.tick.on { background: var(--in); border-color: var(--in); color: #052e16; }

/* chat */
.chat { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 8px; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg .bubble { background: var(--panel2); border-radius: 4px 14px 14px 14px; padding: 7px 11px; max-width: 80%; word-wrap: break-word; white-space: pre-wrap; }
.msg.mine { flex-direction: row-reverse; } .msg.mine .bubble { background: #7c3aed; border-radius: 14px 4px 14px 14px; }
.msg .name { font-size: 12px; color: var(--dim); margin-bottom: 1px; } .msg.mine .name { text-align: right; }
.msg .x { opacity: 0; border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 12px; } .msg:hover .x { opacity: 1; }
.composer { display: flex; gap: 8px; margin-top: 8px; } .composer textarea { min-height: 44px; height: 44px; }

/* background picker */
.bgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.bgs button { height: 58px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px #000; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.bgs button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; } .colors button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; } .colors button.on { border-color: #fff; }
.emojis { display: flex; gap: 6px; flex-wrap: wrap; } .emojis button { font-size: 22px; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; } .emojis button.on { border-color: var(--accent2); background: #8b5cf633; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal .box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 20px; padding: 20px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f1d3a; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 60; max-width: calc(100% - 32px); }
.tabs { display: flex; gap: 6px; background: var(--panel2); border-radius: 12px; padding: 4px; margin-bottom: 8px; } .tabs button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px; font-weight: 700; color: var(--muted); cursor: pointer; } .tabs button.on { background: var(--accent); color: #fff; }
.menu { position: relative; } .menu .dd { position: absolute; right: 0; top: 110%; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 190px; z-index: 30; }
.menu .dd button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; cursor: pointer; } .menu .dd button:hover { background: var(--panel2); }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); } .empty .e { font-size: 38px; }
.auth { max-width: 420px; margin: 7vh auto 0; }
.auth .logo { font-size: 38px; justify-content: center; margin-bottom: 4px; }
footer { text-align: center; color: var(--muted); font-size: 13px; width: fit-content; margin: 10px auto 40px; padding: 8px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(12px); } footer a { color: var(--text); }
@media (max-width: 520px) { h1 { font-size: 24px; } .nav a { padding: 8px 9px; } .nav .lbl { display: none; } }

/* ---------- profile customization ---------- */
.av.xl { width: 96px; height: 96px; font-size: 50px; border-width: 4px; }
.ring-gold { box-shadow: 0 0 0 3px #fbbf24, 0 0 12px #fbbf2499; border-color: #fde68a; }
.ring-rainbow { box-shadow: 0 0 0 2px #f43f5e, 0 0 0 4px #eab308, 0 0 0 6px #22c55e, 0 0 0 8px #3b82f6; }
.ring-neon { box-shadow: 0 0 0 2px #22d3ee, 0 0 16px #22d3ee, 0 0 28px #a855f7aa; border-color: #a5f3fc; }
.av.sm.ring-rainbow { box-shadow: 0 0 0 1px #f43f5e, 0 0 0 2px #eab308, 0 0 0 3px #3b82f6; }
/* name fonts (built into phones/computers, nothing extra to download) */
.nm { font-weight: 800; }
.f-rounded { font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Arial Rounded MT Bold', system-ui, sans-serif; }
.f-mono { font-family: ui-monospace, 'SF Mono', Consolas, 'Courier New', monospace; letter-spacing: -0.02em; }
.f-serif { font-family: Georgia, 'Times New Roman', serif; font-style: italic; }
.f-bold { font-family: Impact, 'Arial Black', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .03em; font-weight: 400; }
/* name colours */
.n-white { color: #fff; } .n-gold { color: #fbbf24; } .n-pink { color: #f472b6; } .n-cyan { color: #22d3ee; } .n-lime { color: #a3e635; }
.n-rainbow, .n-fire, .n-ocean { -webkit-background-clip: text; background-clip: text; color: transparent; }
.n-rainbow { background-image: linear-gradient(90deg, #f43f5e, #f97316, #eab308, #22c55e, #06b6d4, #8b5cf6); }
.n-fire { background-image: linear-gradient(90deg, #fde047, #f97316, #ef4444); }
.n-ocean { background-image: linear-gradient(90deg, #67e8f9, #3b82f6, #6366f1); }
/* the profile card */
.pcard { border-radius: 22px; overflow: hidden; margin: 14px 0; border: 1px solid var(--line); }
.pc-top { height: 110px; }
.pc-body { padding: 0 20px 20px; text-align: center; margin-top: -52px; }
.pc-av { display: flex; justify-content: center; } .pc-av .av { box-sizing: content-box; }
.pc-name { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pc-name h2 { font-size: 26px; margin: 0; line-height: 1.2; }
.pron { font-size: 13px; color: var(--muted); background: var(--panel2); padding: 1px 8px; border-radius: 99px; }
.pc-bio { max-width: 460px; margin: 10px auto 0; white-space: pre-wrap; }
.status { display: inline-block; font-size: 13px; color: var(--muted); background: var(--panel2); border-radius: 99px; padding: 2px 10px; margin-top: 2px; }
.pc-body .status { font-size: 14px; color: var(--text); }
.tags, .badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.tag { background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 13px; }
.bdg { background: linear-gradient(135deg, #fbbf2433, #a855f733); border: 1px solid #fbbf2466; border-radius: 10px; padding: 4px 10px; font-size: 13px; font-weight: 700; cursor: help; }
.faves { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; text-align: left; }
.fave { background: var(--panel2); border-radius: 12px; padding: 8px 12px; } .fave span { display: block; font-size: 12px; } .fave b { word-wrap: break-word; }
.pcard .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.pcard .stats div { background: var(--panel2); border-radius: 12px; padding: 8px 4px; } .pcard .stats b { display: block; font-size: 20px; } .pcard .stats span { font-size: 11px; color: var(--dim); }
.pcard h3 { text-align: left; }
.card-glass .pc-body { background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding-top: 0; }
.card-glass .pc-body, .card-solid .pc-body, .card-neon .pc-body, .card-outline .pc-body { padding-top: 0; }
.card-glass { background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.card-solid { background: var(--panel-solid); }
.card-outline { background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.55); }
.card-neon { background: rgba(8,6,24,.85); border: 2px solid var(--glow, #a855f7); box-shadow: 0 0 18px var(--glow, #a855f7), inset 0 0 18px rgba(168,85,247,.15); }
.c-glow-violet { --glow: #8b5cf6; } .c-glow-blue { --glow: #3b82f6; } .c-glow-teal { --glow: #14b8a6; } .c-glow-green { --glow: #22c55e; } .c-glow-yellow { --glow: #eab308; }
.c-glow-orange { --glow: #f97316; } .c-glow-red { --glow: #ef4444; } .c-glow-pink { --glow: #ec4899; } .c-glow-gray { --glow: #a1a1aa; }
/* option chips in the editor */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { border: 1px solid var(--line); background: var(--panel2); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 700; font-size: 14px; }
.chipbtn.on { border-color: var(--accent2); background: #8b5cf633; box-shadow: 0 0 0 1px var(--accent2); }
@media (max-width: 520px) { .pcard .stats { grid-template-columns: repeat(2, 1fr); } }
