/* =====================================================================
   Zuno design system — premium dark, cinematic, minimal
   Brand colours are injected as CSS variables from admin settings.
   ===================================================================== */
:root {
  --z-primary: #FF2E7E; --z-accent: #FF6A4D; --z-purple: #8B3DFF;
  --z-bg: #09060F; --z-surface: #151022;
  --z-primary-rgb: 255,46,126; --z-accent-rgb: 255,106,77; --z-purple-rgb: 139,61,255;
  --z-grad-angle: 120deg; --z-radius: 18px;

  --surface-2: color-mix(in srgb, var(--z-surface) 80%, #fff 6%);
  --surface-3: color-mix(in srgb, var(--z-surface) 70%, #fff 10%);
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --text: #F7F2FB;
  --muted: #A99FBA;
  --dim: #6F6681;
  --ok: #22C55E; --warn: #F5A524; --danger: #FF4D5E; --blue: #2F8CFF;
  --grad: linear-gradient(var(--z-grad-angle), var(--z-primary), var(--z-accent));
  --grad-soft: linear-gradient(var(--z-grad-angle), rgba(var(--z-primary-rgb),.18), rgba(var(--z-accent-rgb),.12));
  --r-sm: calc(var(--z-radius) * .55); --r: var(--z-radius); --r-lg: calc(var(--z-radius) * 1.35); --r-pill: 999px;
  --shadow: 0 18px 50px -18px rgba(0,0,0,.65);
  --glow: 0 10px 34px -10px rgba(var(--z-primary-rgb),.65);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}
*,*::before,*::after { box-sizing: border-box; }
html,body { margin: 0; height: 100%; }
body {
  background: var(--z-bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
img,video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input,textarea,select { font: inherit; color: inherit; }
h1,h2,h3,h4 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--z-primary); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ico { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; } .ico.lg { width: 28px; height: 28px; } .ico.fill { fill: currentColor; stroke: none; }

/* ---------- app frame ---------- */
#app { min-height: 100%; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 24px); animation: fadeUp .35s var(--ease); }
.page.wide { max-width: 1080px; }
.page.flush { padding-left: 0; padding-right: 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; margin: 0 -16px; background: linear-gradient(var(--z-bg) 60%, transparent); backdrop-filter: blur(6px); }
.topbar .grow { flex: 1; min-width: 0; }
.topbar h1 { font-size: 22px; font-weight: 800; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative; background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: background .2s, transform .15s; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.plain { background: none; border: 0; }
.dot-badge { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--z-primary); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--z-bg); }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo img { width: 40px; height: 40px; }
.logo .word { font-weight: 900; font-size: 30px; letter-spacing: -.03em; line-height: 1; }
.logo .word b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .logo .slogan { white-space: nowrap; font-size: 11.5px; }
.logo .slogan { display: block; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .01em; margin-top: 3px; }
.logo.xl img { width: 92px; height: 92px; }
.logo.xl .word { font-size: 64px; }
.logo.xl { flex-direction: column; gap: 6px; text-align: center; }
.logo.xl .slogan { font-size: 18px; color: #EEDDEA; margin-top: 8px; }
.logo.custom img { width: auto; height: 44px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 26px; border-radius: var(--r-pill); font-weight: 700; font-size: 16px; position: relative; transition: transform .15s var(--ease), box-shadow .2s, opacity .2s; white-space: nowrap; user-select: none; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { box-shadow: 0 14px 40px -10px rgba(var(--z-primary-rgb),.85); }
.btn.ghost { background: rgba(255,255,255,.02); color: var(--text); border: 1.5px solid transparent; background-image: linear-gradient(var(--z-bg),var(--z-bg)), var(--grad); background-origin: border-box; background-clip: padding-box, border-box; }
.btn.soft { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: rgba(255,77,94,.12); color: #FF8A95; border: 1px solid rgba(255,77,94,.35); }
.btn.sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn.xs { height: 32px; padding: 0 12px; font-size: 13px; }
.btn .arrow { position: absolute; right: 24px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.link { color: var(--z-primary); font-weight: 600; }
.link.u { text-decoration: underline; text-underline-offset: 3px; }

.premium-pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid rgba(255,196,0,.45); color: #FFD15C; font-weight: 700; font-size: 14px; background: rgba(255,196,0,.06); }
.premium-pill svg { color: #FFC21A; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--muted); font-weight: 600; padding-left: 4px; }
.input { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; border-radius: var(--r); background: rgba(22,16,34,.72); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s; backdrop-filter: blur(8px); }
.input:focus-within { border-color: rgba(var(--z-primary-rgb),.75); box-shadow: 0 0 0 4px rgba(var(--z-primary-rgb),.12); }
.input .ico { color: var(--muted); }
.input input, .input select, .input textarea { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-size: 16px; }
.input select { appearance: none; cursor: pointer; }
.input select option { background: var(--z-surface); }
.input input::placeholder, .input textarea::placeholder { color: var(--dim); }
.input input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); opacity: .7; }
.input.area { height: auto; align-items: flex-start; padding: 14px 18px; }
.input.area textarea { resize: vertical; min-height: 96px; }
.input .suffix { color: var(--muted); font-size: 14px; }
.input .flag { display: inline-flex; align-items: center; gap: 6px; padding-right: 10px; border-right: 1px solid var(--line-2); font-weight: 600; color: var(--muted); }
.field.err .input { border-color: rgba(255,77,94,.75); }
.field .error { color: #FF8A95; font-size: 12.5px; padding-left: 4px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.form { display: flex; flex-direction: column; gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #E7DEEF; cursor: pointer; }
.check input { appearance: none; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; margin: 0; transition: .2s; }
.check input:checked { background: var(--grad); border-color: transparent; }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px,-1px); }
.seg { display: flex; gap: 12px; }
.seg button { flex: 1; height: 54px; border-radius: var(--r); border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; background: rgba(22,16,34,.6); transition: .2s; }
.seg button.on { border-color: var(--z-primary); background: rgba(var(--z-primary-rgb),.12); }
.seg button .ico { color: var(--z-primary); }
.otp { display: flex; gap: 10px; justify-content: center; }
.otp input { width: 48px; height: 58px; text-align: center; font-size: 24px; font-weight: 700; border-radius: 14px; background: rgba(22,16,34,.75); border: 1.5px solid var(--line-2); outline: 0; }
.otp input:focus { border-color: var(--z-primary); box-shadow: 0 0 0 4px rgba(var(--z-primary-rgb),.14); }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; margin: 6px 0; }
.divider::before,.divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.social { display: flex; justify-content: center; gap: 16px; }
.social a { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); transition: .2s; }
.social a:hover { background: rgba(255,255,255,.09); transform: translateY(-2px); }
.social.wide a { width: auto; flex: 1; max-width: 120px; border-radius: var(--r); height: 60px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { appearance: none; width: 100%; height: 100%; margin: 0; border-radius: 20px; background: var(--surface-3); cursor: pointer; transition: .2s; }
.switch input:checked { background: var(--grad); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); pointer-events: none; }
.switch:has(input:checked)::after { transform: translateX(20px); }
input[type=range] { width: 100%; accent-color: var(--z-primary); }

/* ---------- chips / tabs ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 42px; padding: 0 20px; border-radius: var(--r-pill); background: var(--z-surface); border: 1px solid var(--line); color: #DCD3E6; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: .2s; }
.chip.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); font-weight: 700; }
.chip.icon { width: 46px; padding: 0; justify-content: center; }
.chip.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r-pill); background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 13.5px; }
.tag.sel { background: rgba(var(--z-primary-rgb),.15); border-color: rgba(var(--z-primary-rgb),.6); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 10px; }
.tabs .chip { flex: 1 1 0; min-width: 0; padding: 0 10px; justify-content: center; position: relative; font-size: 14.5px; }
.tabs .chip .dot-badge { top: -6px; right: 8px; }

/* ---------- cards ---------- */
.card { background: var(--z-surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card.glass { background: rgba(21,16,34,.6); backdrop-filter: blur(16px); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); min-height: 60px; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { color: var(--muted); font-size: 13.5px; }
button.list-item { width: 100%; text-align: left; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; font-size: 17px; font-weight: 700; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty .ico { width: 56px; height: 56px; color: var(--z-primary); opacity: .9; stroke-width: 1.4; }
.empty h3 { color: var(--text); font-size: 19px; }

/* ---------- avatars & story ring ---------- */
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; position: relative; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; } .avatar.lg { width: 64px; height: 64px; } .avatar.xl { width: 112px; height: 112px; }
.av-wrap { position: relative; flex: none; }
.online-dot { position: absolute; right: 2px; bottom: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ok); border: 2.5px solid var(--z-bg); }
.ring { padding: 3px; border-radius: 50%; background: var(--grad); }
.ring.seen { background: var(--surface-3); }
.ring > .inner { padding: 3px; border-radius: 50%; background: var(--z-bg); }
.stories { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: #E7DEEF; text-align: center; }
.story .avatar { width: 66px; height: 66px; }
.story .name { width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story .add { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--z-primary); background: radial-gradient(circle, rgba(var(--z-primary-rgb),.18), transparent 70%); }
.story .add .ico { width: 30px; height: 30px; }

/* ---------- banner carousel ---------- */
.banners { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 2.4 / 1; background: var(--z-surface); box-shadow: var(--shadow); }
.banners .track { display: flex; height: 100%; transition: transform .6s var(--ease); }
.banner { flex: none; width: 100%; height: 100%; position: relative; display: flex; flex-direction: column; justify-content: center; padding: 18px 22px; overflow: hidden; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,6,15,.82) 0%, rgba(9,6,15,.35) 55%, transparent 100%); z-index: 1; }
.banner > * { position: relative; z-index: 2; }
.banner h2 { font-size: clamp(19px, 5vw, 26px); font-weight: 800; max-width: 62%; }
.banner p { color: #E6DCEB; font-size: 13.5px; margin-top: 8px; max-width: 55%; }
.banner .ad-tag { position: absolute; top: 10px; right: 12px; font-size: 11px; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.45); color: #ddd; z-index: 3; }
.banner.art { background: radial-gradient(120% 140% at 85% 30%, rgba(var(--z-accent-rgb),.85), transparent 55%), radial-gradient(90% 120% at 60% 90%, rgba(var(--z-primary-rgb),.75), transparent 60%), linear-gradient(120deg, #1A0B24, #3A0F2E); }
.dots { position: absolute; bottom: 12px; left: 22px; display: flex; gap: 6px; z-index: 3; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.4); transition: .3s; }
.dots i.on { width: 20px; background: #fff; }

/* ---------- profile grid cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pcard { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: var(--card-aspect, 3/4); background: var(--surface-2); isolation: isolate; box-shadow: var(--shadow); transition: transform .25s var(--ease); }
.pcard:hover { transform: translateY(-3px); }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.pcard:hover img { transform: scale(1.04); }
.pcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(5,3,9,.88)); z-index: 1; pointer-events: none; }
.pcard .meta { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; }
.pcard .nm { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pcard .loc { font-size: 13px; color: #E2D8EA; display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.pcard .dist { position: absolute; top: 10px; left: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); font-size: 12px; font-weight: 600; }
.pcard .dist i { width: 8px; height: 8px; border-radius: 50%; background: #CFC7D8; }
.pcard .dist i.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.pcard .like { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.4); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); transition: .2s; }
.pcard .like.on { background: var(--grad); border-color: transparent; }
.pcard .like.on .ico { fill: #fff; }
.pcard .new { position: absolute; top: 44px; left: 10px; z-index: 2; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--grad); }
.verified { width: 18px; height: 18px; flex: none; }
.ph-empty { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, rgba(var(--z-purple-rgb),.35), transparent 60%), var(--surface-2); color: rgba(255,255,255,.4); font-size: 48px; font-weight: 800; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- bottom nav ---------- */
.bottom-nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; align-items: center; justify-content: space-around; background: rgba(12,8,19,.86); backdrop-filter: blur(22px) saturate(1.4); border-top: 1px solid var(--line); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); position: relative; padding: 8px 0; }
.bottom-nav a.on { color: var(--z-primary); font-weight: 600; }
.bottom-nav a.on::after { content: ""; position: absolute; bottom: -2px; width: 28px; height: 3px; border-radius: 2px; background: var(--grad); }
.bottom-nav a .ico { width: 26px; height: 26px; }
.bottom-nav a.on .ico.fillable { fill: currentColor; stroke: none; }
.bottom-nav .plus { flex: none; width: 62px; height: 62px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; box-shadow: var(--glow); transform: translateY(-14px); color: #fff; }
.bottom-nav .plus .ico { width: 30px; height: 30px; stroke-width: 2.4; }
.bottom-nav .nav-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; }
.bottom-nav a.on .nav-av { border-color: var(--z-primary); }
.bottom-nav .dot-badge { top: 0; right: calc(50% - 22px); }

/* ---------- desktop sidebar ---------- */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .with-nav { padding-left: 280px; }
  .bottom-nav { display: none; }
  .page { padding-bottom: 48px; }
  .sidebar { display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0; width: 280px; padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(12,8,19,.7); backdrop-filter: blur(20px); z-index: 30; }
  .sidebar .logo { margin: 0 10px 26px; }
  .sidebar a.nav { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 16px; border-radius: 16px; color: #DCD3E6; font-weight: 600; position: relative; transition: background .2s; }
  .sidebar a.nav:hover { background: rgba(255,255,255,.05); }
  .sidebar a.nav.on { background: var(--grad-soft); color: #fff; }
  .sidebar a.nav.on .ico { color: var(--z-primary); }
  .sidebar a.nav .dot-badge { position: static; margin-left: auto; border: 0; }
  .sidebar .create { margin-top: 18px; }
  .sidebar .promo { margin-top: auto; padding: 18px; border-radius: 20px; background: radial-gradient(circle at 80% 0, rgba(var(--z-accent-rgb),.35), transparent 60%), var(--z-surface); border: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .topbar .mobile-only { display: none; }
  .banners { aspect-ratio: auto; height: 260px; }
}
.no-bottom .bottom-nav { display: none; }
@media (min-width: 640px) and (max-width: 1023px) { .grid { grid-template-columns: repeat(3, 1fr); } .page { max-width: 760px; } }
@media (min-width: 1400px) { .grid { grid-template-columns: repeat(4, 1fr); } .page.wide { max-width: 1200px; } }

/* ---------- swipe deck ---------- */
.deck-wrap { position: relative; height: calc(100dvh - 296px - var(--safe-b)); min-height: 380px; max-height: 760px; margin-top: 4px; }
@media (min-width: 1024px) { .deck-wrap { height: calc(100dvh - 190px); max-width: 480px; margin: 0 auto; } }
.swipe-card { position: absolute; inset: 0; border-radius: 28px; overflow: hidden; background: var(--surface-2); box-shadow: 0 30px 80px -30px rgba(0,0,0,.9); touch-action: pan-y; user-select: none; will-change: transform; cursor: grab; }
.swipe-card.dragging { cursor: grabbing; transition: none; }
.swipe-card.anim { transition: transform .45s var(--ease), opacity .45s; }
.swipe-card .photo { position: absolute; inset: 0; }
.swipe-card .photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.swipe-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(5,3,9,.95)); pointer-events: none; }
.swipe-card .bars { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; gap: 5px; z-index: 3; }
.swipe-card .bars i { flex: 1; height: 3.5px; border-radius: 2px; background: rgba(255,255,255,.35); }
.swipe-card .bars i.on { background: #fff; }
.swipe-card .tap { position: absolute; top: 0; bottom: 40%; width: 50%; z-index: 2; }
.swipe-card .tap.l { left: 0; } .swipe-card .tap.r { right: 0; }
.swipe-card .info { position: absolute; left: 20px; right: 92px; bottom: 22px; z-index: 3; }
.swipe-card .info h2 { font-size: 30px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.swipe-card .info .verified { width: 26px; height: 26px; }
.swipe-card .info .ln { display: flex; align-items: flex-start; gap: 10px; color: #EAE0F0; margin-top: 8px; font-size: 15px; }
.swipe-card .info .ln .ico { width: 20px; height: 20px; color: #fff; margin-top: 1px; }
.swipe-card .side { position: absolute; right: 14px; bottom: 26px; z-index: 3; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.swipe-card .side button { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; color: #EAE0F0; }
.swipe-card .side .c { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.22); }
.swipe-card .side .c.boost { border-color: rgba(var(--z-purple-rgb),.8); color: #C9A6FF; }
.stamp { position: absolute; top: 60px; z-index: 4; font-size: 34px; font-weight: 900; padding: 6px 16px; border: 4px solid; border-radius: 12px; opacity: 0; text-transform: uppercase; letter-spacing: .04em; }
.stamp.like { left: 22px; color: #3DDC84; border-color: #3DDC84; transform: rotate(-14deg); }
.stamp.nope { right: 22px; color: #FF4D5E; border-color: #FF4D5E; transform: rotate(14deg); }
.stamp.super { left: 50%; top: auto; bottom: 40%; transform: translateX(-50%); color: #4DA3FF; border-color: #4DA3FF; }
.actions { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 18px 0 6px; }
.act { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; transition: transform .15s var(--ease), box-shadow .2s; border: 2px solid; background: rgba(255,255,255,.03); }
.act:active { transform: scale(.9); }
.act .ico { width: 28px; height: 28px; stroke-width: 2.5; }
.act.undo { width: 50px; height: 50px; border-color: var(--surface-3); color: #CFC7D8; }
.act.undo .ico { width: 22px; height: 22px; }
.act.nope { border-color: rgba(255,77,94,.75); color: #FF4D5E; width: 66px; height: 66px; }
.act.super { border-color: rgba(47,140,255,.6); color: #4DA3FF; background: rgba(47,140,255,.1); }
.act.super .ico { fill: currentColor; stroke: none; }
.act.like { width: 74px; height: 74px; border: 0; background: var(--grad); color: #fff; box-shadow: var(--glow); }
.act.like .ico { width: 34px; height: 34px; fill: #fff; stroke: none; }
.act.boost { border-color: rgba(var(--z-purple-rgb),.6); color: #B987FF; background: rgba(var(--z-purple-rgb),.1); }
.act.boost .ico { fill: currentColor; stroke: none; }
.usage { text-align: center; font-size: 12.5px; color: var(--dim); }

/* ---------- match modal ---------- */
.match-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, rgba(var(--z-primary-rgb),.45), rgba(9,6,15,.94) 60%); backdrop-filter: blur(10px); animation: fadeUp .3s; padding: 24px; text-align: center; }
.match-modal h2 { font-size: 40px; font-weight: 900; animation: pop .6s var(--ease); }
.match-modal .pair { display: flex; justify-content: center; margin: 30px 0; }
.match-modal .pair .avatar { width: 128px; height: 128px; border: 4px solid #fff; box-shadow: var(--shadow); }
.match-modal .pair .avatar:first-child { transform: rotate(-8deg) translateX(14px); }
.match-modal .pair .avatar:last-child { transform: rotate(8deg) translateX(-14px); }

/* ---------- sheets, dialogs, toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(4,2,8,.6); backdrop-filter: blur(6px); animation: fade .2s; display: flex; align-items: flex-end; justify-content: center; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--z-surface); border: 1px solid var(--line); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + var(--safe-b)); animation: sheetUp .35s var(--ease); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 4px auto 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet h3 { font-size: 20px; margin-bottom: 14px; }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 28px; } }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 14px 18px; border-radius: 16px; background: rgba(32,24,48,.95); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14.5px; animation: fadeUp .3s; pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.toast.err { border-color: rgba(255,77,94,.6); }
.toast.ok { border-color: rgba(34,197,94,.5); }
.toast img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* ---------- welcome / auth ---------- */
.hero-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--z-bg); }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg.art { background:
  radial-gradient(60% 40% at 70% 18%, rgba(var(--z-accent-rgb),.55), transparent 70%),
  radial-gradient(70% 45% at 20% 25%, rgba(var(--z-primary-rgb),.5), transparent 70%),
  radial-gradient(80% 60% at 50% 60%, rgba(var(--z-purple-rgb),.25), transparent 70%),
  linear-gradient(180deg, #2A0F2A 0%, #160A1F 45%, var(--z-bg) 75%); }
.hero-bg .bokeh { position: absolute; inset: 0; background-image:
  radial-gradient(circle at 12% 44%, rgba(255,190,120,.55) 0 5px, transparent 7px),
  radial-gradient(circle at 26% 50%, rgba(255,160,110,.4) 0 7px, transparent 10px),
  radial-gradient(circle at 62% 47%, rgba(255,200,140,.45) 0 6px, transparent 9px),
  radial-gradient(circle at 78% 52%, rgba(255,120,150,.4) 0 9px, transparent 12px),
  radial-gradient(circle at 88% 45%, rgba(255,210,150,.35) 0 4px, transparent 6px),
  radial-gradient(circle at 44% 55%, rgba(255,150,120,.35) 0 10px, transparent 14px);
  filter: blur(1.5px); opacity: .9; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,6,15,.05) 0%, rgba(9,6,15,.2) 35%, rgba(9,6,15,.92) 68%, var(--z-bg) 100%); }
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 24px 22px calc(28px + var(--safe-b)); max-width: 520px; margin: 0 auto; gap: 18px; text-align: center; }
.slides { width: 100%; overflow: hidden; }
.slides .track { display: flex; transition: transform .5s var(--ease); }
.slides .slide { flex: none; width: 100%; padding: 0 6px; }
.slides .slide h2 { font-size: 22px; font-weight: 800; }
.slides .slide p { color: var(--muted); margin-top: 6px; }
.pager { display: flex; gap: 10px; justify-content: center; }
.pager i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.25); transition: .3s; cursor: pointer; }
.pager i.on { background: var(--z-primary); box-shadow: 0 0 0 4px rgba(var(--z-primary-rgb),.2); }
.features { display: flex; width: 100%; margin: 6px 0; }
.features div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13.5px; color: #E7DEEF; padding: 0 6px; }
.features div + div { border-left: 1px solid var(--line-2); }
.features .ico { width: 30px; height: 30px; color: var(--z-primary); stroke-width: 1.7; }
.legal { font-size: 12px; color: var(--dim); }
.legal a { color: var(--muted); text-decoration: underline; }
.auth { min-height: 100dvh; padding: 16px 22px calc(26px + var(--safe-b)); max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.auth .head { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 6px; }
.auth .head h1 { font-size: 32px; font-weight: 800; }
.auth .head p { color: #E3D9EA; font-size: 16px; }
.auth .foot { text-align: center; color: #E3D9EA; margin-top: 4px; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps i.on { background: var(--grad); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-slot { position: relative; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; background: rgba(22,16,34,.75); border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 2; }
.photo-slot .main { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--grad); z-index: 2; }
.photo-slot.filled { border-style: solid; border-color: transparent; }

/* ---------- profile ---------- */
.prof-hero { position: relative; margin: 0 -16px; aspect-ratio: 4/5; max-height: 70dvh; overflow: hidden; }
.prof-hero img { width: 100%; height: 100%; object-fit: cover; }
.prof-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, var(--z-bg)); }
.prof-hero .bars { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; gap: 5px; z-index: 3; }
.prof-hero .bars i { flex: 1; height: 3.5px; border-radius: 2px; background: rgba(255,255,255,.35); } .prof-hero .bars i.on { background: #fff; }
.prof-hero .back { position: absolute; top: 26px; left: 14px; z-index: 4; }
.prof-hero .more { position: absolute; top: 26px; right: 14px; z-index: 4; }
.prof-hero .tap { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2; } .prof-hero .tap.l { left: 0; } .prof-hero .tap.r { right: 0; }
.prof-head { margin-top: -86px; position: relative; z-index: 3; }
.prof-head h1 { font-size: 32px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.prof-facts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; color: #E7DEEF; }
.prof-facts div { display: flex; gap: 10px; align-items: center; }
.prof-facts .ico { color: var(--z-primary); }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); display: flex; justify-content: center; gap: 16px; padding: 14px 0; z-index: 5; }
@media (min-width: 1024px) { .sticky-actions { bottom: 18px; } }
.me-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 10px 0 6px; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 4px; }
.stat-row { display: flex; gap: 10px; }
.stat-row > * { flex: 1; text-align: center; padding: 14px 6px; border-radius: 16px; background: var(--z-surface); border: 1px solid var(--line); }
.stat-row b { display: block; font-size: 20px; }
.stat-row span { font-size: 12.5px; color: var(--muted); }
.pr-banner { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: radial-gradient(circle at 100% 0, rgba(255,196,0,.22), transparent 60%), linear-gradient(120deg, rgba(var(--z-primary-rgb),.18), rgba(var(--z-purple-rgb),.18)); border: 1px solid rgba(255,196,0,.25); }

/* ---------- messages ---------- */
.conv { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.conv .avatar { width: 58px; height: 58px; }
.conv .grow { flex: 1; min-width: 0; }
.conv .nm { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 5px; }
.conv .last { color: var(--muted); font-size: 14.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 2px; }
.conv .last.unread { color: #F1E8F7; font-weight: 600; }
.conv .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 12.5px; color: var(--muted); }
.conv .count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--z-primary); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.newm-heart { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--z-primary-rgb),.14); border: 2px solid rgba(var(--z-primary-rgb),.6); }
.chat { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; }
@media (min-width: 1024px) { .chat { height: 100dvh; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(12,8,19,.85); backdrop-filter: blur(16px); }
.chat-head .grow { flex: 1; min-width: 0; }
.chat-head .nm { font-weight: 700; display: flex; align-items: center; gap: 5px; }
.chat-head .st { font-size: 12.5px; color: var(--muted); }
.chat-head .st.on { color: var(--ok); }
.msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 20px; font-size: 15.5px; line-height: 1.38; word-wrap: break-word; white-space: pre-wrap; position: relative; animation: fadeUp .2s; }
.msg.in { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.out { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg .t { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; opacity: .7; margin-top: 3px; }
.msg .t .ico { width: 15px; height: 15px; }
.msg.img { padding: 4px; background: none; }
.msg.img img { border-radius: 16px; max-height: 340px; cursor: zoom-in; }
.msg .story-ref { font-size: 12px; opacity: .8; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.day-sep { align-self: center; font-size: 12px; color: var(--dim); margin: 10px 0; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; border-radius: 20px; background: var(--surface-2); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(12,8,19,.9); }
.composer .box { flex: 1; display: flex; align-items: flex-end; min-height: 46px; border-radius: 23px; background: var(--z-surface); border: 1px solid var(--line-2); padding: 0 6px 0 16px; }
.composer textarea { flex: 1; resize: none; background: none; border: 0; outline: 0; padding: 12px 0; max-height: 120px; font-size: 16px; line-height: 1.35; }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; flex: none; color: #fff; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.voice button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); flex: none; }
.voice .wave { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; }
.voice .wave i { flex: 1; background: currentColor; opacity: .55; border-radius: 2px; }
.voice .wave i.p { opacity: 1; }
.rec { display: flex; align-items: center; gap: 10px; flex: 1; height: 46px; padding: 0 16px; border-radius: 23px; background: rgba(255,77,94,.12); color: #FF8A95; font-weight: 600; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
.chat-closed { text-align: center; padding: 14px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

/* ---------- story viewer ---------- */
.sv { position: fixed; inset: 0; z-index: 95; background: #000; display: flex; justify-content: center; }
.sv .stage { position: relative; width: 100%; max-width: 480px; height: 100%; overflow: hidden; }
@media (min-width: 640px) { .sv .stage { height: 94dvh; margin-top: 3dvh; border-radius: 22px; } }
.sv .media { position: absolute; inset: 0; display: grid; place-items: center; background: #111; }
.sv .media img, .sv .media video { width: 100%; height: 100%; object-fit: cover; }
.sv .bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 4; }
.sv .bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.sv .bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv .bars i.done b { width: 100%; }
.sv .hdr { position: absolute; top: 22px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 4; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.sv .hdr .grow { flex: 1; } .sv .hdr .t { font-size: 12px; opacity: .8; margin-left: 6px; }
.sv .nav { position: absolute; top: 70px; bottom: 120px; width: 35%; z-index: 3; } .sv .nav.l { left: 0; } .sv .nav.r { right: 0; width: 65%; }
.sv .overlay-text { position: absolute; left: 16px; right: 16px; text-align: center; z-index: 3; font-size: 24px; font-weight: 800; transform: translateY(-50%); pointer-events: none; }
.sv .overlay-text span { display: inline; padding: 4px 12px; border-radius: 12px; -webkit-box-decoration-break: clone; box-decoration-break: clone; line-height: 1.6; }
.sv .overlay-text.pill span { background: rgba(0,0,0,.55); }
.sv .overlay-text.neon span { text-shadow: 0 0 12px currentColor, 0 0 30px currentColor; }
.sv .foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 12px calc(16px + var(--safe-b)); z-index: 4; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.sv .reacts { display: flex; justify-content: center; gap: 10px; }
.sv .reacts button { font-size: 26px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); transition: transform .15s; }
.sv .reacts button:active, .sv .reacts button.on { transform: scale(1.25); }
.sv .reply { display: flex; gap: 8px; }
.sv .reply input { flex: 1; height: 46px; border-radius: 23px; padding: 0 18px; background: rgba(0,0,0,.3); border: 1.5px solid rgba(255,255,255,.5); color: #fff; outline: 0; }
.composer-story { position: fixed; inset: 0; z-index: 96; background: #000; display: flex; flex-direction: column; }
.composer-story .canvas { position: relative; flex: 1; overflow: hidden; max-width: 480px; width: 100%; margin: 0 auto; }
.composer-story .canvas img, .composer-story .canvas video { width: 100%; height: 100%; object-fit: cover; }
.composer-story .tools { display: flex; gap: 10px; padding: 12px; max-width: 480px; width: 100%; margin: 0 auto; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }

/* ---------- premium ---------- */
.plans { display: flex; flex-direction: column; gap: 12px; }
.plan { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; background: var(--z-surface); border: 2px solid var(--line); cursor: pointer; transition: .2s; text-align: left; width: 100%; }
.plan.on { border-color: var(--z-primary); background: linear-gradient(var(--z-surface), var(--z-surface)) padding-box, var(--grad) border-box; border-color: transparent; box-shadow: var(--glow); }
.plan .price { margin-left: auto; text-align: right; font-weight: 800; font-size: 20px; }
.plan .price small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.plan .badge { position: absolute; top: -11px; right: 18px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: var(--grad); }
.perk { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.perk .ico { color: #FFC21A; }
.crown-hero { text-align: center; padding: 18px 0 8px; }
.crown-hero .c { width: 86px; height: 86px; margin: 0 auto 12px; border-radius: 28px; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #FFE08A, #FF9F1C 60%, #FF5E3A); box-shadow: 0 18px 50px -14px rgba(255,159,28,.7); }

/* ---------- static page ---------- */
.prose { color: #E3D9EA; line-height: 1.7; }
.prose h2,.prose h3 { color: var(--text); margin: 22px 0 8px; }
.prose p { margin: 10px 0; }
.prose a { color: var(--z-primary); text-decoration: underline; }
.footer { text-align: center; color: var(--dim); font-size: 13px; padding: 26px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.footer a:hover { color: var(--text); }

/* ---------- misc ---------- */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--z-primary); animation: spin .8s linear infinite; margin: 30px auto; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--z-bg); z-index: 200; transition: opacity .4s; }
.boot img { width: 72px; height: 72px; animation: pulse 1.4s infinite; }
.preview-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 150; text-align: center; font-size: 12.5px; font-weight: 600; padding: 5px; background: repeating-linear-gradient(45deg, #5b2bd6, #5b2bd6 10px, #6d3bf0 10px, #6d3bf0 20px); }
.notice { padding: 12px 14px; border-radius: 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; background: rgba(245,165,36,.1); border: 1px solid rgba(245,165,36,.35); color: #FFD08A; }
.notice.err { background: rgba(255,77,94,.1); border-color: rgba(255,77,94,.4); color: #FF9BA4; }
.notice.info { background: rgba(var(--z-purple-rgb),.12); border-color: rgba(var(--z-purple-rgb),.4); color: #D7C2FF; }
.locked-blur { filter: blur(14px) saturate(.6); }
.lightbox { position: fixed; inset: 0; z-index: 99; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-height: 92dvh; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =====================================================================
   Games
   ===================================================================== */
.g-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .g-tiles { grid-template-columns: repeat(3, 1fr); } }
.g-tile { position: relative; border-radius: var(--r-lg); padding: 16px; min-height: 128px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; isolation: isolate; box-shadow: var(--shadow); transition: transform .2s var(--ease); }
.g-tile:active { transform: scale(.97); }
.g-tile .art { position: absolute; right: -6px; top: -4px; font-size: 64px; line-height: 1; opacity: .95; filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); z-index: -1; transform: rotate(-8deg); }
.g-tile b { font-size: 17px; } .g-tile small { color: rgba(255,255,255,.8); font-size: 12.5px; }
.g-tile .lock { position: absolute; top: 10px; left: 12px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.35); }
.g-ludo { background: linear-gradient(140deg, #FF3B5C, #8B3DFF); }
.g-domino { background: linear-gradient(140deg, #232035, #4B3A7A); }
.g-xox { background: linear-gradient(140deg, #FF6A4D, #FF2E7E); }
.g-rps { background: linear-gradient(140deg, #2F8CFF, #8B3DFF); }
.g-truth_dare { background: linear-gradient(140deg, #FF2E7E, #B4186A); }
.g-questions { background: linear-gradient(140deg, #22C55E, #0E7C6B); }
.g-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.g-row::-webkit-scrollbar { display: none; }
.g-row .g-tile { flex: 0 0 132px; min-height: 104px; padding: 12px; }
.g-row .g-tile .art { font-size: 48px; }
.g-row .g-tile b { font-size: 14.5px; }
.g-stat { display: flex; gap: 10px; }
.g-stat div { flex: 1; text-align: center; padding: 12px 6px; border-radius: 16px; background: var(--z-surface); border: 1px solid var(--line); }
.g-stat b { display: block; font-size: 20px; }
.g-stat span { font-size: 12px; color: var(--muted); }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.lb-row .rk { width: 28px; text-align: center; font-weight: 800; color: var(--muted); }
.lb-row .rk.top { color: #FFD15C; }
.room-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--z-surface); border: 1px solid var(--line); margin-bottom: 10px; }
.av-stack { display: flex; }
.av-stack .avatar { width: 30px; height: 30px; border: 2px solid var(--z-surface); margin-left: -8px; font-size: 12px; }
.av-stack .avatar:first-child { margin-left: 0; }

/* room */
.game { display: flex; flex-direction: column; min-height: 100dvh; max-width: 640px; margin: 0 auto; padding: 0 12px calc(16px + var(--safe-b)); }
.game-head { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.game-head h1 { flex: 1; font-size: 19px; font-weight: 800; }
.timer { position: relative; width: 44px; height: 44px; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.timer .bg { stroke: var(--surface-3); } .timer .fg { stroke: var(--z-primary); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer.low .fg { stroke: var(--danger); }
.seats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.seat { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 22px; background: var(--z-surface); border: 2px solid transparent; font-size: 13.5px; font-weight: 600; position: relative; }
.seat.turn { border-color: var(--seat, var(--z-primary)); box-shadow: 0 0 18px -4px var(--seat, var(--z-primary)); }
.seat.left { opacity: .45; text-decoration: line-through; }
.seat .avatar { width: 30px; height: 30px; font-size: 12px; }
.seat .dotc { width: 10px; height: 10px; border-radius: 50%; background: var(--seat); }
.seat .cnt { font-size: 11px; color: var(--muted); font-weight: 500; }
.g-status { text-align: center; font-weight: 700; margin: 6px 0 12px; min-height: 22px; }
.g-status.me { color: var(--z-primary); }
.react-bar { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: auto; padding-top: 14px; }
.react-bar button { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.06); font-size: 20px; }
.float-emoji { position: fixed; z-index: 70; font-size: 42px; pointer-events: none; animation: floatUp 1.8s ease-out forwards; }
.float-emoji small { display: block; font-size: 12px; text-align: center; background: rgba(0,0,0,.5); border-radius: 8px; padding: 1px 6px; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-220px) scale(1); opacity: 0; } }
.waiting-box { text-align: center; padding: 22px 16px; border-radius: 22px; background: var(--z-surface); border: 1px solid var(--line); }
.code-big { font-size: 34px; font-weight: 900; letter-spacing: .25em; margin: 10px 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result { text-align: center; padding: 24px 16px; border-radius: 22px; background: radial-gradient(circle at 50% 0, rgba(var(--z-primary-rgb),.3), transparent 70%), var(--z-surface); border: 1px solid var(--line); margin-top: 12px; animation: pop .5s var(--ease); }
.result h2 { font-size: 28px; font-weight: 900; }

/* ludo */
.ludo { --cell: min(calc((100vw - 24px) / 15), 40px); display: grid; grid-template-columns: repeat(15, var(--cell)); grid-template-rows: repeat(15, var(--cell)); margin: 0 auto; border-radius: 16px; overflow: hidden; background: #0F0A18; border: 2px solid var(--line-2); position: relative; }
.ludo .c { border: 1px solid rgba(255,255,255,.07); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; position: relative; background: #1A1427; }
.ludo .c.safe::after { content: "★"; position: absolute; font-size: calc(var(--cell) * .5); color: rgba(255,255,255,.22); }
.ludo .c.col0 { background: #FF3B5C; } .ludo .c.col1 { background: #22C55E; } .ludo .c.col2 { background: #FACC15; } .ludo .c.col3 { background: #3B82F6; }
.ludo .base { display: grid; grid-template-columns: 1fr 1fr; gap: 12%; padding: 16%; border-radius: 0; }
.ludo .base .slot { border-radius: 50%; background: rgba(255,255,255,.88); display: grid; place-items: center; }
.ludo .home { grid-area: 7 / 7 / 10 / 10; background: conic-gradient(from -45deg, #22C55E 0 25%, #FACC15 0 50%, #3B82F6 0 75%, #FF3B5C 0); display: grid; place-items: center; position: relative; }
.ludo .home .fin { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; max-width: 90%; }
.tok { width: calc(var(--cell) * .7); height: calc(var(--cell) * .7); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5); flex: none; transition: transform .25s; }
.c .tok + .tok { margin-left: calc(var(--cell) * -.45); }
.tok.t0 { background: radial-gradient(circle at 35% 30%, #ff8aa0, #E11D48); } .tok.t1 { background: radial-gradient(circle at 35% 30%, #86efac, #16A34A); }
.tok.t2 { background: radial-gradient(circle at 35% 30%, #fde68a, #EAB308); } .tok.t3 { background: radial-gradient(circle at 35% 30%, #93c5fd, #2563EB); }
.tok.can { animation: tokPulse .8s infinite; cursor: pointer; outline: 3px solid #fff; outline-offset: 1px; }
@keyframes tokPulse { 50% { transform: scale(1.18); } }
.dice-area { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 14px 0 4px; }
.dice { width: 64px; height: 64px; border-radius: 16px; background: #fff; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.4); }
.dice i { width: 10px; height: 10px; border-radius: 50%; background: #1A1427; place-self: center; visibility: hidden; }
.dice i.on { visibility: visible; }
.dice.roll { animation: diceRoll .5s; }
@keyframes diceRoll { 0% { transform: rotate(0) scale(.8); } 50% { transform: rotate(200deg) scale(1.1); } 100% { transform: rotate(360deg) scale(1); } }

/* domino */
.dline { display: flex; align-items: center; gap: 3px; overflow-x: auto; padding: 14px 6px; min-height: 110px; background: radial-gradient(circle, #13402E, #0B2A1F); border-radius: 18px; border: 2px solid #1E5A42; scrollbar-width: thin; }
.dtile { flex: none; display: flex; background: #F8F5EE; border-radius: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.45); border: 1px solid #d8d2c4; }
.dtile.h { flex-direction: row; width: 64px; height: 32px; } .dtile.v { flex-direction: column; width: 32px; height: 64px; }
.dtile .half { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 3px; }
.dtile.h .half + .half { border-left: 1.5px solid #9C9384; } .dtile.v .half + .half { border-top: 1.5px solid #9C9384; }
.dtile .half i { width: 5px; height: 5px; border-radius: 50%; background: #1A1427; place-self: center; visibility: hidden; }
.dtile .half i.on { visibility: visible; }
.dhand { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0 6px; }
.dhand .dtile.v { width: 40px; height: 80px; cursor: default; }
.dhand .dtile .half i { width: 6px; height: 6px; }
.dhand .dtile.ok { cursor: pointer; outline: 3px solid var(--z-primary); outline-offset: 2px; transform: translateY(-6px); }
.dhand .dtile.dim { opacity: .55; }
.dbtns { display: flex; justify-content: center; gap: 10px; }

/* xox */
.xox { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(90vw, 360px); margin: 10px auto; }
.xox button { aspect-ratio: 1; border-radius: 20px; background: var(--z-surface); border: 1px solid var(--line-2); font-size: 56px; font-weight: 900; display: grid; place-items: center; transition: .15s; }
.xox button.x { color: var(--z-primary); } .xox button.o { color: #A78BFA; }
.xox button.win { background: rgba(var(--z-primary-rgb),.18); border-color: var(--z-primary); }
.xox button:not(:disabled):hover { background: var(--surface-2); }

/* rps */
.rps-choices { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.rps-choices button { width: 92px; height: 92px; border-radius: 28px; background: var(--z-surface); border: 2px solid var(--line-2); font-size: 46px; transition: .15s; }
.rps-choices button.sel { border-color: var(--z-primary); background: rgba(var(--z-primary-rgb),.15); transform: scale(1.06); }
.rps-score { display: flex; justify-content: center; align-items: center; gap: 22px; font-size: 40px; font-weight: 900; }
.rps-hist { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rps-hist div { display: flex; justify-content: center; gap: 14px; font-size: 22px; padding: 6px; border-radius: 12px; background: rgba(255,255,255,.03); }

/* party games */
.pcardq { padding: 22px; border-radius: 24px; text-align: center; font-size: 19px; font-weight: 700; line-height: 1.4; background: linear-gradient(140deg, rgba(var(--z-primary-rgb),.22), rgba(var(--z-purple-rgb),.22)); border: 1px solid rgba(var(--z-primary-rgb),.35); margin: 10px 0; }
.pcardq small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.td-choice { display: flex; gap: 12px; }
.td-choice button { flex: 1; height: 96px; border-radius: 22px; font-size: 18px; font-weight: 800; color: #fff; }
.td-choice .truth { background: linear-gradient(140deg, #2F8CFF, #8B3DFF); } .td-choice .dare { background: linear-gradient(140deg, #FF6A4D, #FF2E7E); }
.qa { padding: 12px 14px; border-radius: 16px; background: var(--z-surface); border: 1px solid var(--line); margin-bottom: 8px; }
.qa .q { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.qa .a { display: flex; gap: 8px; margin-top: 4px; font-size: 14.5px; }
.qa .a b { flex: none; color: var(--z-primary); }
.msg.gamecard { background: linear-gradient(140deg, rgba(var(--z-primary-rgb),.25), rgba(var(--z-purple-rgb),.25)); border: 1px solid rgba(var(--z-primary-rgb),.4); color: #fff; }
.msg.gamecard .gt { font-weight: 800; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.ludo .base { grid-template-rows: 1fr 1fr; }
.ludo .base .slot { width: 78%; aspect-ratio: 1; place-self: center; }
[data-code] input::placeholder { text-transform: none; }
.dline { justify-content: safe center; }
