/* =============================================================================
   Aett — visual system
   Aurora background · frosted glass · per-person theme colors · light & dark
   Theme colors (--a1..3 aurora, --b1/--b2 buttons, --ink, --accent) are set by
   theme-boot.js. Everything else derives from them.
   ============================================================================= */

@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --a1: #7c5cff; --a2: #22d3ee; --a3: #f472b6;
  --b1: #6d4aff; --b2: #a35cff; --ink: #fff; --accent: #9b8cff;
  --radius: 26px;
  --radius-sm: 16px;
  --tap: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --discord: #5865f2;
  --live-1: #ff3d6e; --live-2: #ff8a3d;
}

/* ---- Dark (default) ---- */
:root, :root[data-mode="dark"] {
  color-scheme: dark;
  --bg: #09080f;
  --surface: rgb(23 20 42 / .62);
  --surface-2: rgb(255 255 255 / .055);
  --surface-3: rgb(255 255 255 / .1);
  --surface-solid: #15132a;
  --text: #f5f3ff;
  --muted: #aaa5cb;
  --faint: #716c93;
  --line: rgb(255 255 255 / .08);
  --line-strong: rgb(255 255 255 / .16);
  --shadow: 0 18px 50px -18px rgb(0 0 0 / .7);
  --accent-text: color-mix(in oklab, var(--accent) 82%, white);
  --aurora-opacity: .58;
  --grain-opacity: .07;
  --danger: #ff6b81;
  --ok: #4ade80;
  --live: #ff4d6d;
}
/* ---- Light ---- */
:root[data-mode="light"] {
  color-scheme: light;
  --bg: #f6f5fb;
  --surface: rgb(255 255 255 / .66);
  --surface-2: rgb(30 15 90 / .045);
  --surface-3: rgb(30 15 90 / .085);
  --surface-solid: #ffffff;
  --text: #15122b;
  --muted: #5a5577;
  --faint: #8c87a6;
  --line: rgb(30 15 90 / .08);
  --line-strong: rgb(30 15 90 / .15);
  --shadow: 0 18px 50px -20px rgb(50 30 140 / .3);
  --accent-text: color-mix(in oklab, var(--accent) 58%, black);
  --aurora-opacity: .34;
  --grain-opacity: .04;
  --danger: #d02848;
  --ok: #128a50;
  --live: #e5244a;
}
@media (prefers-color-scheme: light) {
  :root[data-mode="auto"] {
    color-scheme: light;
    --bg: #f6f5fb;
    --surface: rgb(255 255 255 / .66);
    --surface-2: rgb(30 15 90 / .045);
    --surface-3: rgb(30 15 90 / .085);
    --surface-solid: #ffffff;
    --text: #15122b;
    --muted: #5a5577;
    --faint: #8c87a6;
    --line: rgb(30 15 90 / .08);
    --line-strong: rgb(30 15 90 / .15);
    --shadow: 0 18px 50px -20px rgb(50 30 140 / .3);
    --accent-text: color-mix(in oklab, var(--accent) 58%, black);
    --aurora-opacity: .34;
    --grain-opacity: .04;
    --danger: #d02848;
    --ok: #128a50;
    --live: #e5244a;
  }
}

/* =============================================================================
   Base
   ============================================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  font: 17px/1.5 var(--font);
  color: var(--text);
  background: transparent; /* the page color lives on <html>, so the aurora layer shows through */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .3s;
}
body::before { /* film grain */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { margin: 0 0 .35em; line-height: 1.12; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 820; letter-spacing: -.04em; }
h2 { font-size: 1.35rem; font-weight: 760; }
h3 { font-size: 1.08rem; font-weight: 720; }
p { margin: 0 0 .8em; }
a { color: var(--accent-text); }
strong { font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .9rem; }
.center { text-align: center; }
.noscript { padding: 2rem; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; display: block; }

#app {
  max-width: 720px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(128px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
}
#app.bare { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

/* ---- Aurora ---- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; opacity: var(--aurora-opacity); transition: opacity .6s; }
.aurora i { position: absolute; width: 78vmax; height: 78vmax; border-radius: 50%; will-change: transform; transition: background .8s; }
.aurora i:nth-child(1) { background: radial-gradient(closest-side, var(--a1), transparent); top: -34vmax; left: -26vmax; animation: drift-1 26s var(--ease) infinite alternate; }
.aurora i:nth-child(2) { background: radial-gradient(closest-side, var(--a2), transparent); top: 8vmax; right: -42vmax; animation: drift-2 33s var(--ease) infinite alternate; }
.aurora i:nth-child(3) { background: radial-gradient(closest-side, var(--a3), transparent); bottom: -46vmax; left: -6vmax; animation: drift-3 39s var(--ease) infinite alternate; }
@keyframes drift-1 { to { transform: translate(20vmax, 14vmax) scale(1.18); } }
@keyframes drift-2 { to { transform: translate(-22vmax, 18vmax) scale(.9); } }
@keyframes drift-3 { to { transform: translate(16vmax, -20vmax) scale(1.12); } }

/* ---- Boot ---- */
.boot { min-height: 80dvh; display: grid; place-items: center; }
.boot-mark { width: 64px; height: 64px; border-radius: 23%; background: url(/icons/icon.svg) center / contain no-repeat; animation: breathe 1.4s ease-in-out infinite; box-shadow: 0 0 60px -6px #7654ff; }
@keyframes breathe { 50% { transform: scale(.88); opacity: .7; } }

/* ---- Entrance choreography ---- */
.stagger > * { animation: rise .7s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .24s; }
.stagger > *:nth-child(6) { animation-delay: .3s; }
.stagger > *:nth-child(7) { animation-delay: .36s; }
.stagger > *:nth-child(n+8) { animation-delay: .42s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: var(--ease); }
.tabbar { view-transition-name: tabbar; }

/* =============================================================================
   Brand
   ============================================================================= */
.mark { display: block; flex: none; }
.wordmark {
  font-weight: 860; letter-spacing: -.055em; line-height: .9;
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 30%, var(--accent-text) 50%, var(--text) 70%, var(--text) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 9s linear infinite;
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.grad-text {
  background: linear-gradient(110deg, var(--b1), var(--a2) 55%, var(--b2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-mode="light"] .grad-text { background: linear-gradient(110deg, color-mix(in oklab, var(--b1) 80%, black), color-mix(in oklab, var(--b2) 80%, black)); -webkit-background-clip: text; background-clip: text; }
@media (prefers-color-scheme: light) { :root[data-mode="auto"] .grad-text { background: linear-gradient(110deg, color-mix(in oklab, var(--b1) 80%, black), color-mix(in oklab, var(--b2) 80%, black)); -webkit-background-clip: text; background-clip: text; } }

/* =============================================================================
   Top bar + tab bar
   ============================================================================= */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.topbar .brand .wordmark { font-size: 1.55rem; }
.topbar a { text-decoration: none; }

.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; gap: 4px; padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(26px) saturate(1.7); backdrop-filter: blur(26px) saturate(1.7);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 50px -14px rgb(0 0 0 / .55), inset 0 1px 0 rgb(255 255 255 / .07);
  animation: tabbar-in .6s var(--spring) both .1s;
}
@keyframes tabbar-in { from { opacity: 0; transform: translate(-50%, 30px); } }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 70px; height: 56px; padding: 0 12px; border-radius: 999px;
  border: 0; background: none; color: var(--muted);
  font: 650 .7rem/1 var(--font); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: color .2s, background .3s var(--ease), transform .15s;
}
.tab:active { transform: scale(.94); }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] {
  color: var(--ink);
  background: linear-gradient(135deg, var(--b1), var(--b2));
  box-shadow: 0 8px 22px -8px var(--b1);
}

/* =============================================================================
   Glass cards + sections
   ============================================================================= */
.glass, .card {
  background: var(--surface);
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / .05);
}
.card { border-radius: var(--radius); padding: 22px; margin-bottom: 14px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.card-icon {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--accent-text);
}

.sec { display: flex; align-items: center; gap: 10px; margin: 30px 4px 14px; }
.sec h2 { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sec .count { font-size: .78rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text); }
.sec .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

.greet { margin: 6px 4px 8px; }
.greet h1 { margin-bottom: 8px; }
.greet p { color: var(--muted); font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 8px; }

/* =============================================================================
   Buttons
   ============================================================================= */
.btn {
  -webkit-appearance: none; appearance: none;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: 680 1rem/1 var(--font); letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; overflow: hidden; isolation: isolate;
  transition: transform .18s var(--ease), box-shadow .25s, background .25s, border-color .25s, filter .2s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.965); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-primary {
  border: 0; color: var(--ink);
  background: linear-gradient(135deg, var(--b1), var(--b2));
  box-shadow: 0 10px 26px -10px var(--b1), inset 0 1px 0 rgb(255 255 255 / .28);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--b1), var(--b2)); filter: brightness(1.08) saturate(1.1); box-shadow: 0 14px 32px -10px var(--b1), inset 0 1px 0 rgb(255 255 255 / .3); }
.btn-live { border: 0; color: #fff; background: linear-gradient(135deg, var(--live-1), var(--live-2)); box-shadow: 0 10px 26px -10px var(--live-1), inset 0 1px 0 rgb(255 255 255 / .28); }
.btn-live:hover { background: linear-gradient(135deg, var(--live-1), var(--live-2)); filter: brightness(1.08); }
.btn-discord { border: 0; color: #fff; background: var(--discord); box-shadow: 0 10px 26px -12px var(--discord); }
.btn-discord:hover { background: var(--discord); filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, transparent); }
.btn-danger:hover { background: color-mix(in oklab, var(--danger) 12%, transparent); }
.btn-big { min-height: 64px; padding: 0 30px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: .92rem; gap: 7px; }
.btn-icon { width: 48px; min-height: 48px; padding: 0; flex: none; }
.btn-icon.btn-sm { width: 40px; min-height: 40px; }
.btn-shine::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .35) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 4.5s var(--ease) infinite 1.2s;
}
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.linklike { background: none; border: 0; padding: 6px 2px; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.btn:focus-visible, .tab:focus-visible { border-radius: 999px; }

/* =============================================================================
   Forms
   ============================================================================= */
.field { margin-bottom: 18px; }
.label { display: block; font-size: .88rem; font-weight: 700; color: var(--muted); margin: 0 0 8px 4px; }
.hint { font-size: .88rem; color: var(--muted); margin: 8px 4px 0; }
.input, textarea.input, select.input {
  width: 100%; min-height: var(--tap); padding: 0 18px; border-radius: 18px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: 500 1rem/1.4 var(--font);
  transition: border-color .2s, box-shadow .25s, background .2s;
}
textarea.input { padding: 14px 18px; min-height: 140px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); background: var(--surface-3); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 24%, transparent); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .input { flex: 1; min-width: 0; }

/* Segmented control */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 0; background: none; color: var(--muted); font: 650 .92rem/1 var(--font); cursor: pointer;
  transition: background .25s var(--ease), color .2s, box-shadow .25s;
}
.seg button[aria-checked="true"] { background: var(--surface-solid); color: var(--text); box-shadow: 0 3px 12px -3px rgb(0 0 0 / .35); }
.seg.block { display: flex; }
.seg.block button { flex: 1; justify-content: center; }

/* Switch */
.switch {
  position: relative; flex: none; width: 58px; height: 34px; border-radius: 999px; padding: 0;
  border: 0; background: var(--surface-3); cursor: pointer; transition: background .3s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .3); transition: transform .35s var(--spring);
}
.switch[aria-checked="true"] { background: linear-gradient(135deg, var(--b1), var(--b2)); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }

/* =============================================================================
   Avatars + circle
   ============================================================================= */
.avatar {
  --size: 48px;
  position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center;
  font: 820 calc(var(--size) * .42)/1 var(--font); color: var(--avink, #fff);
  background: linear-gradient(140deg, var(--av1), var(--av2));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 8px 20px -10px var(--av1);
}
.avatar.live::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; padding: 2.5px;
  background: conic-gradient(var(--av1), var(--av3), var(--live), var(--av2), var(--av1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  animation: spin 3s linear infinite;
}

.circle { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 8px 18px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.circle::-webkit-scrollbar { display: none; }
.circle-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 76px; flex: none; scroll-snap-align: start;
  padding: 6px 0; border: 0; background: none; color: var(--muted); font: 600 .78rem/1.2 var(--font); text-align: center; border-radius: 18px;
}
button.circle-item { cursor: pointer; color: var(--text); }
button.circle-item:active { transform: scale(.95); }
.circle-item .nm { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circle-item.offline .avatar { filter: saturate(.35) brightness(.85); opacity: .75; }

/* =============================================================================
   Live chip
   ============================================================================= */
.chip-live {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border-radius: 999px;
  font: 850 .7rem/1 var(--font); letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, var(--live-1), var(--live-2));
  box-shadow: 0 4px 14px -4px var(--live-1);
}
.chip-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font: 750 .75rem/1.2 var(--font); background: var(--surface-3); color: var(--text); }
.chip.accent { background: color-mix(in oklab, var(--accent) 18%, transparent); color: var(--accent-text); }

/* =============================================================================
   Live stream cards
   ============================================================================= */
.live-card {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 30px; padding: 22px; margin-bottom: 14px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: var(--shadow), 0 30px 70px -40px var(--av1);
}
.live-card::before { /* colored glow */
  content: ""; position: absolute; z-index: -1; inset: -50% -30% auto auto; width: 90%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--av1) 55%, transparent), transparent);
  opacity: .55; animation: breathe 7s ease-in-out infinite;
}
.live-card::after { /* animated gradient border */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.6px; pointer-events: none;
  background: conic-gradient(from var(--angle), var(--av1), transparent 25%, var(--av2) 50%, transparent 75%, var(--av1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  animation: orbit 6s linear infinite;
}
@keyframes orbit { to { --angle: 360deg; } }
.live-card.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 30% { transform: scale(1.02); box-shadow: 0 0 0 4px var(--av1), var(--shadow); } }
.lc-head { display: flex; align-items: center; gap: 16px; }
.lc-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.lc-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.lc-note {
  margin: 16px 0 0; padding: 13px 16px; border-radius: 18px; font-size: 1.05rem; line-height: 1.45;
  background: var(--surface-2); border: 1px solid var(--line); position: relative; padding-left: 20px;
}
.lc-note::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--av1), var(--av2)); }
.lc-actions { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 520px) { .lc-actions.two { grid-template-columns: 1.7fr 1fr; } }
.btn-watch { border: 0; color: var(--avink, #fff); background: linear-gradient(135deg, var(--av1), var(--av2)); box-shadow: 0 12px 30px -12px var(--av1), inset 0 1px 0 rgb(255 255 255 / .3); }
.btn-watch:hover { background: linear-gradient(135deg, var(--av1), var(--av2)); filter: brightness(1.08) saturate(1.1); }

/* Your stream */
.golive {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 20px; text-align: left;
  border-radius: 30px; border: 1.5px dashed var(--line-strong); background: var(--surface);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .25s, transform .2s var(--ease), background .25s;
}
.golive:hover { border-color: var(--live-1); background: var(--surface-3); }
.golive:active { transform: scale(.985); }
.golive .gl-icon { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--live-1), var(--live-2)); box-shadow: 0 12px 28px -10px var(--live-1); }
.golive .gl-icon svg { animation: broadcast 2.4s ease-in-out infinite; }
@keyframes broadcast { 50% { transform: scale(1.1); } }
.golive .gl-text { flex: 1; min-width: 0; }
.golive .gl-text strong { display: block; font-size: 1.15rem; letter-spacing: -.02em; }
.golive .gl-text span { color: var(--muted); font-size: .95rem; }
.golive .chev { color: var(--faint); }

/* Quiet / empty */
.quiet { text-align: center; padding: 34px 20px 30px; border-radius: 30px; }
.orbit { position: relative; width: 120px; height: 120px; margin: 0 auto 22px; display: grid; place-items: center; }
.orbit span { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid color-mix(in oklab, var(--accent) 45%, transparent); animation: ripple 4.5s var(--ease) infinite; opacity: 0; }
.orbit span:nth-child(2) { animation-delay: 1.5s; }
.orbit span:nth-child(3) { animation-delay: 3s; }
@keyframes ripple { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1.15); opacity: 0; } }
.orbit .core { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: linear-gradient(135deg, var(--b1), var(--b2)); box-shadow: 0 0 40px -4px var(--b1); }

/* Skeleton */
.skel { position: relative; overflow: hidden; border-radius: 30px; background: var(--surface-2); border: 1px solid var(--line); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(100deg, transparent, rgb(255 255 255 / .07), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* =============================================================================
   Rows / lists
   ============================================================================= */
.rows { list-style: none; margin: 0; padding: 0; }
.ri { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.ri:first-child { border-top: 0; padding-top: 4px; }
.ri-main { flex: 1; min-width: 0; }
.ri-title { font-weight: 680; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ri-sub { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.ri-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.end { justify-content: flex-end; }
.actions.stack { display: grid; }

/* Profile hero (You tab) */
.profile { display: flex; align-items: center; gap: 18px; padding: 8px 4px 22px; }
.profile h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 6vw, 2.4rem); }

/* Feedback / help tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 20px; text-align: left;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
  transition: background .2s, transform .15s var(--ease), border-color .2s;
}
.tile:hover { background: var(--surface-3); border-color: var(--line-strong); }
.tile:active { transform: scale(.97); }
.tile strong { font-size: 1rem; }
.tile span { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.tile .card-icon { width: 38px; height: 38px; border-radius: 12px; }

/* Feedback inbox */
.fb { padding: 14px 0; border-top: 1px solid var(--line); }
.fb:first-child { border-top: 0; }
.fb-msg { white-space: pre-wrap; margin: 8px 0; word-break: break-word; }

/* =============================================================================
   Hero (signed out / join / setup / install)
   ============================================================================= */
.hero { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 4px; }
.hero-mark { filter: drop-shadow(0 24px 50px color-mix(in oklab, var(--b1) 70%, transparent)); animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-2deg); } }
.hero-word { font-size: clamp(4.4rem, 22vw, 7.5rem); margin: 18px 0 2px; }
.hero-meaning { font-size: .85rem; color: var(--faint); letter-spacing: .04em; margin-bottom: 22px; }
.hero-meaning em { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-size: 1.05rem; color: var(--muted); }
.hero-tag { font-size: 1.22rem; font-weight: 700; letter-spacing: -.015em; max-width: 26ch; margin: 0 auto 8px; }
.hero-slogan { font-style: italic; color: var(--accent-text); max-width: 32ch; margin: 0 auto 34px; font-size: 1.05rem; }
.hero-actions { display: grid; gap: 12px; width: min(100%, 380px); }
.hero .fine { color: var(--muted); font-size: .92rem; max-width: 34ch; margin: 18px auto 0; }
.trust { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 34px; color: var(--faint); font-size: .82rem; font-weight: 650; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.panel { width: min(100%, 460px); text-align: left; padding: 24px; border-radius: 28px; margin-top: 8px; }

/* Install steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.steps li::before {
  content: counter(step); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: .9rem; color: var(--ink); background: linear-gradient(135deg, var(--b1), var(--b2));
}
.steps li .k { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 8px; background: var(--surface-3); font-weight: 700; white-space: nowrap; vertical-align: middle; }
.ok-badge { display: inline-flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 18px; background: color-mix(in oklab, var(--ok) 14%, transparent); color: var(--ok); font-weight: 700; }

/* Plain help list */
ol.plain { padding-left: 1.3em; margin: 6px 0 10px; }
ol.plain li { margin-bottom: 6px; }
details.help { margin-top: 12px; }
details.help summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--accent-text); font-weight: 650; font-size: .95rem; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary .icon { transition: transform .25s var(--ease); }
details.help[open] summary .icon { transform: rotate(90deg); }
details.help > :not(summary) { animation: rise .35s var(--ease) both; }

.linkbox { display: block; width: 100%; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px dashed var(--line-strong); font: 500 .9rem/1.45 var(--mono); word-break: break-all; user-select: all; margin: 4px 0 16px; }

/* =============================================================================
   Theme picker
   ============================================================================= */
.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .themes { grid-template-columns: repeat(4, 1fr); } }
.themes.compact { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-tile {
  position: relative; aspect-ratio: 1 / 1.08; border-radius: 22px; overflow: hidden; padding: 0; cursor: pointer;
  display: flex; align-items: flex-end; text-align: left; color: #fff;
  border: 2px solid var(--line); background: #0c0b18;
  transition: transform .25s var(--spring), border-color .2s, box-shadow .3s;
}
.theme-tile:hover { transform: translateY(-3px); }
.theme-tile:active { transform: scale(.96); }
.theme-tile .sw {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 22%, var(--t1), transparent 58%),
    radial-gradient(circle at 88% 30%, var(--t2), transparent 55%),
    radial-gradient(circle at 45% 105%, var(--t3), transparent 62%),
    #0c0b18;
  transition: transform .6s var(--ease);
}
.theme-tile:hover .sw { transform: scale(1.12) rotate(4deg); }
.theme-tile .tl { position: relative; width: 100%; padding: 12px; background: linear-gradient(transparent, rgb(0 0 0 / .6)); }
.theme-tile .tl strong { display: block; font-size: .98rem; }
.theme-tile .tl small { display: block; font-size: .74rem; opacity: .85; line-height: 1.25; }
.themes.compact .theme-tile { aspect-ratio: 1; border-radius: 18px; }
.themes.compact .tl { padding: 8px; }
.themes.compact .tl small { display: none; }
.theme-tile[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--t1), 0 14px 30px -10px var(--t1); }
.theme-tile .tick { position: absolute; top: 9px; right: 9px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; animation: pop .35s var(--spring); }
@keyframes pop { from { transform: scale(0); } }

.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0; }

/* =============================================================================
   Sheets (dialogs)
   ============================================================================= */
dialog.sheet {
  width: min(560px, calc(100vw - 32px)); max-height: min(88dvh, 820px);
  border: 1px solid var(--line-strong); border-radius: 30px; padding: 28px 26px 24px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface-solid) 94%, var(--b1)), var(--surface-solid));
  color: var(--text); box-shadow: 0 40px 100px -20px rgb(0 0 0 / .7);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet-pop .38s var(--spring); }
dialog.sheet:focus { outline: none; }
@keyframes sheet-pop { from { opacity: 0; transform: translateY(16px) scale(.96); } }
dialog.sheet::backdrop { background: rgb(6 4 20 / .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .25s; }
dialog.sheet h2 { font-size: 1.6rem; padding-right: 44px; }
.sheet-close { position: absolute; top: 16px; right: 16px; }
.grabber { display: none; }
@media (max-width: 640px) {
  dialog.sheet {
    margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 30px 30px 0 0; border-bottom: 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  dialog.sheet[open] { animation: sheet-up .42s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .grabber { display: block; width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: -14px auto 18px; }
}

/* =============================================================================
   Toasts, update bar, offline
   ============================================================================= */
#toasts {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(520px, calc(100vw - 24px)); pointer-events: none;
}
#app.bare ~ #toasts { bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 13px 18px 13px 14px; border-radius: 18px;
  background: color-mix(in oklab, var(--surface-solid) 90%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong); box-shadow: 0 16px 40px -12px rgb(0 0 0 / .5);
  font-weight: 650; font-size: .96rem; animation: toast-in .45s var(--spring);
}
.toast .icon { color: var(--ok); }
.toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--accent-text); }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }

.update-bar {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: color-mix(in oklab, var(--surface-solid) 88%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong); box-shadow: 0 16px 40px -12px rgb(0 0 0 / .5), 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent);
  font-weight: 650; font-size: .92rem; white-space: nowrap; animation: drop-in .5s var(--spring);
}
@keyframes drop-in { from { opacity: 0; transform: translate(-50%, -20px); } }

.offline-bar {
  position: fixed; z-index: 90; inset: 0 0 auto; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; text-align: center;
  background: var(--danger); color: #fff; font-weight: 700; font-size: .9rem;
  transform: translateY(-100%); transition: transform .35s var(--ease);
}
body.offline .offline-bar { transform: none; }

/* Confetti */
.burst { position: fixed; z-index: 95; pointer-events: none; width: 0; height: 0; }
.burst i { position: absolute; width: 9px; height: 9px; border-radius: 2px; background: var(--c); animation: burst 1s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes burst { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* What's new */
.release { position: relative; padding-left: 26px; padding-bottom: 6px; }
.release::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: -14px; width: 2px; background: var(--line-strong); }
.release:last-child::before { display: none; }
.release .dot { position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--line-strong); }
.release.current .dot { background: linear-gradient(135deg, var(--b1), var(--b2)); border-color: transparent; box-shadow: 0 0 0 5px color-mix(in oklab, var(--b1) 25%, transparent); }
.release ul { margin: 10px 0 0; padding-left: 1.1em; }
.release li { margin-bottom: 6px; color: var(--muted); }
.release li::marker { color: var(--accent-text); }

.footer { text-align: center; margin: 34px 0 8px; color: var(--faint); font-size: .82rem; }
.footer .mark { margin: 0 auto 10px; }

/* =============================================================================
   Photos (avatars with a picture)
   ============================================================================= */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.has-img { background: var(--surface-3); }
.av-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; color: inherit; }
.av-btn:active { transform: scale(.96); }
.av-badge {
  position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(135deg, var(--b1), var(--b2)); border: 3px solid var(--bg);
  box-shadow: 0 6px 16px -6px var(--b1);
}
.center > .mark, .center > .avatar { margin-inline: auto; }
.av-stack { display: flex; align-items: center; }
.av-stack > .avatar { margin-left: -9px; box-shadow: 0 0 0 2.5px var(--surface-solid); }
.av-stack > .avatar:first-child { margin-left: 0; }

/* Photo cropper */
.crop {
  position: relative; width: min(270px, 70vw); aspect-ratio: 1; margin: 8px auto 18px; border-radius: 50%; overflow: hidden;
  touch-action: none; cursor: grab; background: #000;
  box-shadow: 0 0 0 5px var(--surface-3), 0 0 0 6px var(--line-strong), 0 24px 60px -22px rgb(0 0 0 / .7);
}
.crop:active { cursor: grabbing; }
.crop canvas { display: block; width: 100%; height: 100%; }
.zoom-row { display: flex; align-items: center; gap: 12px; margin: 0 4px 20px; color: var(--muted); }
.zoom-row input { flex: 1; accent-color: var(--accent); }

/* =============================================================================
   The name: hover/focus "Aett" to learn what it stands for
   ============================================================================= */
.brand, .lore-host { position: relative; }
/* z-index lifts the tooltip above later (animated, so separately stacked) siblings */
.lore-host { display: inline-block; z-index: 5; outline: none; cursor: help; -webkit-tap-highlight-color: transparent; }
.lore {
  position: absolute; z-index: 60; top: calc(100% + 12px); left: 0;
  width: max-content; max-width: min(86vw, 340px); padding: 14px 16px 13px; border-radius: 18px;
  text-align: left; white-space: normal; font-size: 1rem; line-height: 1.3; letter-spacing: 0;
  background: color-mix(in oklab, var(--surface-solid) 93%, var(--b1));
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 50px -16px rgb(0 0 0 / .6), 0 0 44px -12px color-mix(in oklab, var(--accent) 45%, transparent);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: 26px 0; pointer-events: none;
  transition: opacity .22s var(--ease), transform .32s var(--spring), visibility 0s linear .32s;
}
.lore::before {
  content: ""; position: absolute; top: -7px; left: 22px; width: 12px; height: 12px; rotate: 45deg;
  background: inherit; border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong);
  border-radius: 3px 0 0 0;
}
.brand:hover .lore, .brand:focus-visible .lore,
.lore-host:hover .lore, .lore-host:focus-visible .lore, .lore-host.show .lore {
  opacity: 1; visibility: visible; transform: none; transition-delay: .12s, .12s, 0s;
}
.lore-acro { display: flex; flex-wrap: wrap; gap: 0 .3em; font-weight: 720; color: var(--text); }
.lore-acro b {
  font-weight: 900; font-size: 1.14em;
  background: linear-gradient(135deg, var(--b1), var(--a2), var(--b2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lore-norse { display: block; margin-top: 7px; font-size: .84rem; color: var(--muted); }
.lore-norse em { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-size: 1.12rem; color: var(--accent-text); margin-right: 3px; }
.hero .lore { left: 50%; transform: translate(-50%, -6px) scale(.97); transform-origin: 50% 0; }
.hero .lore::before { left: calc(50% - 6px); }
.hero .lore-host:hover .lore, .hero .lore-host:focus-visible .lore, .hero .lore-host.show .lore { transform: translate(-50%, 0); }
.hero .lore-host .wordmark { margin-bottom: 0; }

/* =============================================================================
   Nine seats
   ============================================================================= */
.seat {
  --size: 58px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; color: var(--faint);
  border: 1.5px dashed var(--line-strong); background: transparent;
}
button.circle-item .seat { transition: border-color .2s, color .2s; }
button.circle-item:hover .seat { border-color: var(--accent); color: var(--accent-text); }
.circle-item.empty .nm { color: var(--faint); }
.seat.saved { border-style: solid; border-color: color-mix(in oklab, var(--accent) 60%, transparent); color: var(--accent-text); }

/* Family page: nine seats drawn as a ring around the fire */
.nine-card { display: grid; gap: 4px; text-align: center; }
.nine-card h3 { margin: 4px 0 6px; }
.nine-card p { margin: 0 auto; max-width: 46ch; }
.nine-card .seats-note { margin-top: 12px; }
@media (min-width: 600px) {
  .nine-card { grid-template-columns: auto 1fr; align-items: center; gap: 26px; text-align: left; }
  .nine-card p { margin: 0; }
}
.ring { --r: 92px; position: relative; width: calc(var(--r) * 2 + 52px); aspect-ratio: 1; margin: 2px auto 6px; }
.ring::before { /* the circle they sit on */
  content: ""; position: absolute; inset: 26px; border-radius: 50%;
  border: 1px dashed var(--line-strong);
}
.ring .core {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 96px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
}
.ring .core::before { /* the fire in the middle; only the glow flickers, never the number */
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--b1) 38%, transparent), color-mix(in oklab, var(--b2) 14%, transparent) 62%, transparent);
  animation: flicker 3.8s ease-in-out infinite;
}
.ring .num {
  position: relative; filter: drop-shadow(0 0 14px color-mix(in oklab, var(--b1) 55%, transparent));
  font: 900 3.6rem/1 var(--font); letter-spacing: -.06em;
  background: linear-gradient(135deg, var(--b1), var(--a2), var(--b2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ring .slot {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center;
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 40deg - 90deg)) translate(var(--r)) rotate(calc(var(--i) * -40deg + 90deg));
}
.ring .slot > .seat { --size: 44px; background: var(--surface-solid); }
.ring .slot > .avatar { box-shadow: 0 0 0 3px var(--surface-solid), 0 8px 20px -10px var(--av1); }
.ring .slot { animation: pop-in .5s var(--spring) both; animation-delay: calc(var(--i) * 45ms); }

/* Desktop: all nine seats fit in one row */
@media (min-width: 720px) {
  .circle { justify-content: space-between; gap: 2px; }
  .circle-item { width: 72px; }
}
/* Sitting in someone's room right now */
.avatar > .by-fire { position: absolute; z-index: 1; right: -4px; bottom: -4px; font-size: 1.05rem; line-height: 1; filter: drop-shadow(0 2px 4px rgb(0 0 0 / .55)); }
.vow { font-style: italic; color: var(--accent-text); }

/* =============================================================================
   Waves ("thinking of you")
   ============================================================================= */
/* Phone: who waved on top, "Wave back" + dismiss below. Wider: one row. */
.wave-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 12px; }
.wave-card > .ri-main { grid-column: 2 / -1; }
.wave-card > .btn-primary { grid-column: 1 / 3; grid-row: 2; min-height: 46px; }
.wave-card > .btn-icon { grid-column: 3; grid-row: 2; }
.wave-card .ri-title { flex-wrap: nowrap; align-items: center; line-height: 1.3; }
.wave-card .wave-hand { font-size: 1.35rem; }
@media (min-width: 560px) {
  .wave-card { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .wave-card > .ri-main { grid-column: 2; }
  .wave-card > .btn-primary { grid-column: 3; grid-row: 1; }
  .wave-card > .btn-icon { grid-column: 4; grid-row: 1; }
}
.wave-hand { display: inline-block; font-size: 1.7rem; transform-origin: 70% 80%; animation: wave-hand 2.4s ease-in-out infinite; }
@keyframes wave-hand { 0%, 55%, 100% { rotate: 0deg; } 8%, 24% { rotate: 18deg; } 16%, 32% { rotate: -9deg; } }
.person { text-align: center; }
.person .avatar { margin: 4px auto 14px; }
.person h2 { padding: 0 !important; margin-bottom: 4px; }

/* Who's in a live room, on the Home card */
.lc-present { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: .92rem; }
.lc-present .glow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--av1); box-shadow: 0 0 10px var(--av1); animation: blink 2s ease-in-out infinite; }
.lc-call { margin-left: auto; align-self: flex-start; }
.btn-room { border: 1px solid color-mix(in oklab, var(--av1) 45%, var(--line-strong)); background: color-mix(in oklab, var(--av1) 14%, var(--surface-2)); }
.btn-room:hover { background: color-mix(in oklab, var(--av1) 22%, var(--surface-2)); }
@media (min-width: 520px) { .lc-actions.room { grid-template-columns: 1.3fr 1fr; } }

/* =============================================================================
   Live room
   ============================================================================= */
[hidden] { display: none !important; }
.room { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.feed-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.feed-wrap .room-feed { flex: 1; }
a.circle-item { text-decoration: none; cursor: pointer; }
a.circle-item:hover .seat { border-color: var(--accent); color: var(--accent-text); }
a.circle-item:active { transform: scale(.95); }
#app.room-mode { max-width: 860px; height: 100dvh; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
body:has(#app.room-mode) { overflow: hidden; }
.room-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left));
}
.room-head .who { flex: 1; min-width: 0; }
.room-head .who strong { display: block; font-size: 1.12rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-head .who > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; }
.room-note { margin: 0 16px 4px; padding: 9px 14px; border-radius: 16px; font-size: .92rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.room-status { margin: 0 auto; font-size: .78rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }

/* The hearth: everyone in the room gathered around the streamer's fire */
.hearth { position: relative; flex: none; display: flex; justify-content: center; align-items: flex-end; gap: 12px; padding: 12px 16px 16px; min-height: 104px; overflow-x: auto; scrollbar-width: none; }
.hearth::-webkit-scrollbar { display: none; }
.hearth::before {
  content: ""; position: absolute; left: 50%; bottom: 0; width: min(76%, 460px); height: 54px; translate: -50% 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--av1) 60%, transparent), color-mix(in oklab, var(--av2) 26%, transparent) 55%, transparent);
  filter: blur(7px); animation: flicker 3.4s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: .7; transform: scaleX(1); }
  22% { opacity: 1; transform: scaleX(1.05); }
  48% { opacity: .62; transform: scaleX(.97); }
  70% { opacity: .92; transform: scaleX(1.02); }
}
.hearth-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: .72rem; font-weight: 650; color: var(--muted); animation: pop-in .55s var(--spring) both; flex: none; }
.hearth-seat .avatar { animation: bob 4.2s ease-in-out infinite; }
.hearth-seat:nth-child(2n) .avatar { animation-delay: -1.4s; }
.hearth-seat:nth-child(3n) .avatar { animation-delay: -2.6s; }
.hearth-seat.host .nm { color: var(--text); }
.hearth-seat.host .nm::before { content: "🔥 "; }
.hearth-empty { position: relative; color: var(--faint); font-size: .9rem; padding-bottom: 18px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.6); } }
@keyframes bob { 50% { transform: translateY(-4px); } }

.room-feed {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px calc(14px + env(safe-area-inset-right)) 14px calc(14px + env(safe-area-inset-left));
  /* messages fade out softly under the hearth instead of being cut off */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px);
}
.feed-start { text-align: center; color: var(--faint); font-size: .86rem; margin: 18px auto 10px; max-width: 34ch; }
.feed-start strong { display: block; color: var(--muted); font-size: .95rem; margin-bottom: 2px; }

.msg { display: flex; align-items: flex-end; gap: 9px; margin-top: 3px; animation: msg-in .34s var(--ease) both; }
.msg.first { margin-top: 14px; }
.msg > .avatar, .msg > .av-space { flex: none; width: 34px; }
.msg-body { min-width: 0; max-width: min(80%, 540px); display: flex; flex-direction: column; align-items: flex-start; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-name { font-size: .78rem; font-weight: 780; margin: 0 0 3px 12px; color: var(--nm, var(--muted)); }
.msg-name .host-tag { color: var(--faint); font-weight: 600; }
.bubble {
  position: relative; padding: 9px 14px; border-radius: 20px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  cursor: pointer; user-select: text; -webkit-user-select: text;
}
.msg:not(.mine) .bubble { border-bottom-left-radius: 7px; }
.msg.mine .bubble { border-bottom-right-radius: 7px; color: var(--avink, #fff); border: 0; background: linear-gradient(135deg, var(--av1), var(--av2)); box-shadow: 0 8px 22px -14px var(--av1); }
.bubble.emoji { background: none !important; border: 0; box-shadow: none !important; font-size: 2.6rem; line-height: 1.12; padding: 0 2px; -webkit-backdrop-filter: none; backdrop-filter: none; }
.msg.pending .bubble { opacity: .55; }
.msg.failed .bubble { outline: 2px solid var(--danger); }
.msg.mentions-me:not(.mine) .bubble { box-shadow: 0 0 0 2px var(--accent), 0 0 24px -6px var(--accent); }
.mention { font-weight: 780; padding: 0 3px; border-radius: 6px; background: color-mix(in oklab, var(--accent) 22%, transparent); }
.msg.mine .mention { background: rgb(255 255 255 / .22); }
.msg.mine .bubble a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.quote { display: block; font-size: .8rem; line-height: 1.3; opacity: .82; margin: 1px 0 6px; padding: 3px 9px; border-left: 3px solid currentColor; border-radius: 3px 8px 8px 3px; background: rgb(127 127 127 / .12); }
.quote b { display: block; font-size: .74rem; }
.msg-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; animation: msg-in .2s var(--ease); }
/* Hearts on messages (double-tap), like a tapback */
.bubble { touch-action: manipulation; }
.hearts-pill {
  position: relative; z-index: 1; margin-top: -9px; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px 2px 6px; border-radius: 999px; font: 780 .74rem/1.35 var(--font); color: var(--text); cursor: pointer;
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: 0 4px 12px -5px rgb(0 0 0 / .55);
  animation: pop-in .38s var(--spring);
}
.hearts-pill:active { transform: scale(.9); }
.msg:not(.mine) .hearts-pill { align-self: flex-end; margin-right: 10px; }
.msg.mine .hearts-pill { align-self: flex-start; margin-left: 10px; }
.hearts-pill.me { border-color: color-mix(in oklab, var(--live) 55%, transparent); background: color-mix(in oklab, var(--live) 16%, var(--surface-solid)); }
.heart-pop {
  position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%; font-size: 2.6rem; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 6px 14px rgb(255 40 90 / .45)); animation: heart-pop .85s var(--spring) forwards;
}
@keyframes heart-pop { 0% { opacity: 0; scale: .2; } 28% { opacity: 1; scale: 1.3; } 55% { scale: 1; } 100% { opacity: 0; scale: 1.05; translate: -50% -110%; } }
@media (prefers-reduced-motion: reduce) { .heart-pop, .hearts-pill { animation: none; } }
.msg-tools .btn { min-height: 34px; padding: 0 12px; font-size: .84rem; }
.msg-meta { flex-basis: 100%; padding: 0 4px; font-size: .74rem; color: var(--faint); }
.msg.mine .msg-meta { text-align: right; }
.quote { cursor: pointer; }
/* Tapping a reply's quote: the original glows for a moment */
.msg.flash .bubble { animation: msg-flash 1.7s var(--ease); }
@keyframes msg-flash { 0%, 35% { box-shadow: 0 0 0 3px var(--accent), 0 0 34px -4px var(--accent); } }
.msg.flash .bubble.emoji { animation: msg-flash-emoji 1.7s var(--ease); }
@keyframes msg-flash-emoji { 0%, 35% { transform: scale(1.12); filter: drop-shadow(0 0 14px var(--accent)); } }
.bubble:focus-visible { outline-offset: 3px; }
.feed-start .tip { display: grid; gap: 2px; margin-top: 10px; font-size: .76rem; }
/* @mentions: while you type a name, the people take the reaction row's place */
.mention-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.mention-row::-webkit-scrollbar { display: none; }
.mention-opt {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px 0 8px; border-radius: 15px; cursor: pointer;
  font: 750 .9rem var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  transition: background .2s, border-color .2s; animation: pop-in .3s var(--spring) both;
}
.mention-opt small { font-size: .72rem; font-weight: 650; color: var(--faint); }
.mention-opt:hover { background: var(--surface-3); }
.mention-opt.sel { border-color: color-mix(in oklab, var(--accent) 62%, transparent); background: color-mix(in oklab, var(--accent) 18%, var(--surface-2)); }
/* "Hug back", right in the line that says you got one */
.hug-back {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  font: 780 .8rem var(--font); color: var(--text); border: 1px solid color-mix(in oklab, var(--live-1) 45%, transparent);
  background: linear-gradient(135deg, color-mix(in oklab, var(--live-1) 24%, transparent), color-mix(in oklab, var(--b2) 24%, transparent));
  animation: pop-in .4s var(--spring) both; transition: transform .18s var(--spring);
}
.hug-back:active { transform: scale(.9); }
.hug-back.done { padding: 0; border: 0; background: none; font-size: 1rem; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.sys { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px auto 6px; font-size: .82rem; color: var(--faint); text-align: center; animation: msg-in .4s var(--ease) both; }
.sys.warm { color: var(--accent-text); font-weight: 650; }
.jump {
  position: absolute; z-index: 5; left: 50%; translate: -50% 0; bottom: 8px;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 0; cursor: pointer;
  font: 750 .86rem var(--font); color: var(--ink); background: linear-gradient(135deg, var(--b1), var(--b2));
  box-shadow: 0 10px 26px -8px var(--b1); animation: pop-in .4s var(--spring);
}

.compose {
  flex: none; display: grid; gap: 8px;
  padding: 8px calc(12px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
}
.typing { min-height: 1.15em; padding: 0 8px; font-size: .8rem; color: var(--faint); }
.typing i { display: inline-block; width: 4px; height: 4px; margin: 0 1px; border-radius: 50%; background: currentColor; vertical-align: middle; animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
.react-bar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.react-bar::-webkit-scrollbar { display: none; }
.react-bar button {
  flex: none; width: 44px; height: 44px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 1.3rem; line-height: 1; cursor: pointer; transition: transform .18s var(--spring), background .2s;
}
.react-bar button:hover { background: var(--surface-3); transform: translateY(-2px); }
.react-bar button:active { transform: scale(.82); }
.react-bar .hug {
  width: auto; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--text); font: 780 .9rem var(--font);
  border-color: color-mix(in oklab, var(--live-1) 40%, transparent);
  background: linear-gradient(135deg, color-mix(in oklab, var(--live-1) 22%, transparent), color-mix(in oklab, var(--b2) 22%, transparent));
}
.replying { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 14px; font-size: .85rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.replying span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-row textarea { flex: 1; resize: none; min-height: 50px; max-height: 150px; border-radius: 24px; padding: 13px 18px; line-height: 1.35; font: inherit; }
.send { width: 50px; min-height: 50px; height: 50px; border-radius: 50%; padding: 0; flex: none; }
/* Wide screens: the composer is a panel, not a band with hard edges */
@media (min-width: 900px) {
  .compose { border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; }
}

/* Floating reactions, hugs, combos */
.floaters { position: fixed; inset: 0; z-index: 45; pointer-events: none; overflow: hidden; }
.floater {
  position: absolute; bottom: 130px; left: var(--x); display: flex; flex-direction: column; align-items: center;
  font-size: var(--fs, 2.1rem); line-height: 1; will-change: transform, opacity;
  animation: float-up var(--d, 3.4s) cubic-bezier(.2, .6, .3, 1) forwards;
}
.floater small { margin-top: 2px; padding: 1px 7px; border-radius: 999px; font: 800 .62rem/1.4 var(--font); color: var(--avink, #fff); background: linear-gradient(135deg, var(--av1), var(--av2)); }
@keyframes float-up {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  10% { opacity: 1; transform: translate(calc(var(--sway) * .25), -6vh) scale(1.15); }
  55% { transform: translate(calc(var(--sway) * -.4), -36vh) scale(1); }
  100% { opacity: 0; transform: translate(var(--sway), -72vh) scale(.9); }
}
.combo {
  position: fixed; z-index: 46; left: 50%; top: 38%; translate: -50% -50%; pointer-events: none; text-align: center;
  font: 900 clamp(2.4rem, 11vw, 4.2rem)/1 var(--font); letter-spacing: -.04em; color: #fff;
  text-shadow: 0 0 30px var(--av1, var(--b1)), 0 4px 30px rgb(0 0 0 / .5);
  animation: combo 1.5s var(--spring) forwards;
}
.combo small { display: block; margin-top: 6px; font-size: .9rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
@keyframes combo { 0% { opacity: 0; scale: .4; } 18% { opacity: 1; scale: 1.12; } 30% { scale: 1; } 78% { opacity: 1; } 100% { opacity: 0; scale: 1.05; translate: -50% -60%; } }
.hug-burst { position: fixed; z-index: 47; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; }
.hug-burst i { position: absolute; font-style: normal; font-size: 1.7rem; translate: -50% -50%; animation: hug-out 1.5s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes hug-out { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.2) rotate(var(--r)); } }
.hug-note {
  position: fixed; z-index: 48; left: 50%; top: 45%; translate: -50% -50%; pointer-events: none; white-space: nowrap;
  padding: 12px 20px; border-radius: 999px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--av1), var(--av2)); box-shadow: 0 0 0 6px color-mix(in oklab, var(--av1) 25%, transparent), 0 20px 50px -10px var(--av1);
  animation: hug-note 2.4s var(--spring) forwards;
}
@keyframes hug-note { 0% { opacity: 0; scale: .5; } 14% { opacity: 1; scale: 1.08; } 24% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; scale: .96; } }

/* The gathering: what stays after a stream ends */
.gathering { text-align: center; }
.gathering .av-stack { justify-content: center; margin: 14px 0 10px; }
.gathering .av-stack > .avatar { box-shadow: 0 0 0 3px var(--surface-solid); }
.gathering .tally { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 16px 0 6px; }
.gathering .tally div { display: flex; flex-direction: column; align-items: center; }
.gathering .tally b { font-size: 1.5rem; font-weight: 850; letter-spacing: -.03em; }
.gathering .tally span { font-size: .78rem; color: var(--muted); }
.gathering .vow { margin-top: 18px; }

/* Footer rune seal: Freyr's ætt, the first family of eight runes */
.runes { display: flex; justify-content: center; gap: 10px; margin: 12px auto 4px; color: var(--faint); }
.runes svg { width: 11px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }

/* =============================================================================
   Ward light: a pale, gentle glow keeping watch over the window.
   On by default in the installed app. Always dark.
   ============================================================================= */
:root[data-ward][data-mode] {
  color-scheme: dark;
  --ward: color-mix(in oklab, var(--accent) 20%, #d3eee2);
  --bg: #030504;
  --surface: rgb(9 13 12 / .64);
  --surface-2: rgb(211 238 226 / .04);
  --surface-3: rgb(211 238 226 / .085);
  --surface-solid: #0a0f0d;
  --text: #e7f1ec;
  --muted: #95a8a0;
  --faint: #5f716a;
  --line: color-mix(in oklab, var(--ward) 10%, transparent);
  --line-strong: color-mix(in oklab, var(--ward) 20%, transparent);
  --shadow: 0 18px 50px -18px rgb(0 0 0 / .9);
  --accent-text: color-mix(in oklab, var(--accent) 52%, #e4f4ec);
  --aurora-opacity: .3;
  --grain-opacity: .08;
  --danger: #ff7b8e;
  --ok: #8ee6b4;
  --live: #ff4d6d;
}
:root[data-ward][data-mode] .grad-text {
  background: linear-gradient(110deg, color-mix(in oklab, var(--b1) 70%, var(--ward)), var(--ward) 55%, color-mix(in oklab, var(--b2) 70%, var(--ward)));
  -webkit-background-clip: text; background-clip: text;
}
:root[data-ward] .aurora i:nth-child(1) { background: radial-gradient(closest-side, color-mix(in oklab, var(--a1) 45%, #7d958b), transparent); }
:root[data-ward] .aurora i:nth-child(2) { background: radial-gradient(closest-side, color-mix(in oklab, var(--a2) 40%, #6f877d), transparent); }
:root[data-ward] .aurora i:nth-child(3) { background: radial-gradient(closest-side, color-mix(in oklab, var(--a3) 40%, #8aa398), transparent); }

/* The ward itself: a pale line of light around the whole window, slowly breathing */
:root[data-ward] body::after {
  content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none;
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, var(--ward) 34%, transparent),
    inset 0 0 6px 1px color-mix(in oklab, var(--ward) 26%, transparent),
    inset 0 0 38px color-mix(in oklab, var(--ward) 17%, transparent),
    inset 0 0 160px -12px color-mix(in oklab, var(--ward) 20%, transparent);
  animation: ward-breathe 9s ease-in-out infinite;
}
@keyframes ward-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ...and a slow light that walks the ward line, like a sentry on the walls.
   The turning layer is masked to a soft band along the window edges; only a
   transform animates, so it costs the phone almost nothing. */
.ward-frame { display: none; }
:root[data-ward] .ward-frame {
  display: block; position: fixed; inset: 0; z-index: 31; pointer-events: none; overflow: hidden;
  -webkit-mask:
    linear-gradient(to bottom, #000, transparent 18px) top / 100% 18px no-repeat,
    linear-gradient(to top, #000, transparent 18px) bottom / 100% 18px no-repeat,
    linear-gradient(to right, #000, transparent 18px) left / 18px 100% no-repeat,
    linear-gradient(to left, #000, transparent 18px) right / 18px 100% no-repeat;
  mask:
    linear-gradient(to bottom, #000, transparent 18px) top / 100% 18px no-repeat,
    linear-gradient(to top, #000, transparent 18px) bottom / 100% 18px no-repeat,
    linear-gradient(to right, #000, transparent 18px) left / 18px 100% no-repeat,
    linear-gradient(to left, #000, transparent 18px) right / 18px 100% no-repeat;
}
:root[data-ward] .ward-frame i {
  position: absolute; left: 50%; top: 50%; width: 260vmax; height: 260vmax; margin: -130vmax 0 0 -130vmax;
  background: conic-gradient(
    transparent 0deg, color-mix(in oklab, var(--ward) 62%, transparent) 22deg, transparent 52deg,
    transparent 180deg, color-mix(in oklab, var(--ward) 44%, transparent) 204deg, transparent 236deg, transparent 360deg);
  animation: ward-walk 46s linear infinite;
}
@keyframes ward-walk { to { transform: rotate(1turn); } }

/* Mist and drifting motes of dead light */
.motes { display: none; }
:root[data-ward] .motes { display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
:root[data-ward] .motes::before, :root[data-ward] .motes::after { content: ""; position: absolute; left: -25%; right: -25%; pointer-events: none; }
:root[data-ward] .motes::before {
  bottom: -14vh; height: 58vh;
  background:
    radial-gradient(45% 55% at 25% 100%, color-mix(in oklab, var(--ward) 19%, transparent), transparent 72%),
    radial-gradient(40% 50% at 72% 100%, color-mix(in oklab, var(--ward) 15%, transparent), transparent 70%);
  animation: mist 34s ease-in-out infinite alternate;
}
:root[data-ward] .motes::after {
  top: -18vh; height: 44vh;
  background: radial-gradient(50% 50% at 62% 0%, color-mix(in oklab, var(--ward) 11%, transparent), transparent 70%);
  animation: mist 46s ease-in-out infinite alternate-reverse;
}
@keyframes mist { from { transform: translateX(-4%); } to { transform: translateX(5%) scaleY(1.14); } }
.motes b {
  position: absolute; bottom: -4vh; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; opacity: 0;
  background: var(--ward);
  box-shadow: 0 0 8px 1px color-mix(in oklab, var(--ward) 75%, transparent), 0 0 24px 5px color-mix(in oklab, var(--ward) 22%, transparent);
  animation: mote var(--d) linear var(--dl) infinite;
}
.motes b:nth-child(1)  { --x: 5%;  --s: 3px; --d: 27s; --dl: -2s;  --sw: 34px; }
.motes b:nth-child(2)  { --x: 14%; --s: 2px; --d: 33s; --dl: -19s; --sw: -22px; }
.motes b:nth-child(3)  { --x: 23%; --s: 4px; --d: 38s; --dl: -9s;  --sw: 40px; }
.motes b:nth-child(4)  { --x: 31%; --s: 2px; --d: 29s; --dl: -25s; --sw: -30px; }
.motes b:nth-child(5)  { --x: 42%; --s: 3px; --d: 35s; --dl: -14s; --sw: 26px; }
.motes b:nth-child(6)  { --x: 51%; --s: 2px; --d: 31s; --dl: -4s;  --sw: -38px; }
.motes b:nth-child(7)  { --x: 60%; --s: 3px; --d: 41s; --dl: -30s; --sw: 30px; }
.motes b:nth-child(8)  { --x: 68%; --s: 2px; --d: 28s; --dl: -12s; --sw: -24px; }
.motes b:nth-child(9)  { --x: 76%; --s: 4px; --d: 36s; --dl: -21s; --sw: 36px; }
.motes b:nth-child(10) { --x: 84%; --s: 2px; --d: 30s; --dl: -7s;  --sw: -28px; }
.motes b:nth-child(11) { --x: 91%; --s: 3px; --d: 39s; --dl: -27s; --sw: 22px; }
.motes b:nth-child(12) { --x: 97%; --s: 2px; --d: 32s; --dl: -16s; --sw: -34px; }
@keyframes mote {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: .8; }
  50% { transform: translate3d(var(--sw), -52vh, 0); opacity: .55; }
  85% { opacity: .45; }
  100% { transform: translate3d(calc(var(--sw) * -.6), -108vh, 0); opacity: 0; }
}

/* Everything that matters gets a faint halo */
:root[data-ward] .card, :root[data-ward] .glass, :root[data-ward] .golive, :root[data-ward] .tabbar, :root[data-ward] .lore {
  border-color: color-mix(in oklab, var(--ward) 17%, transparent);
  box-shadow: var(--shadow), 0 0 38px -10px color-mix(in oklab, var(--ward) 32%, transparent), inset 0 1px 0 color-mix(in oklab, var(--ward) 12%, transparent);
}
:root[data-ward] .live-card { box-shadow: var(--shadow), 0 30px 70px -40px var(--av1), 0 0 46px -12px color-mix(in oklab, var(--ward) 34%, transparent); }
:root[data-ward] .btn-primary, :root[data-ward] .btn-watch, :root[data-ward] .tab[aria-current="page"], :root[data-ward] .jump {
  box-shadow: 0 10px 26px -12px var(--b1), 0 0 26px -6px color-mix(in oklab, var(--ward) 50%, transparent), inset 0 1px 0 rgb(255 255 255 / .2);
}
:root[data-ward] .avatar { box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 0 18px -3px color-mix(in oklab, var(--ward) 50%, transparent); }
:root[data-ward] .av-stack > .avatar { box-shadow: 0 0 0 2.5px var(--surface-solid), 0 0 16px -3px color-mix(in oklab, var(--ward) 50%, transparent); }
:root[data-ward] .wordmark, :root[data-ward] .mark { filter: drop-shadow(0 0 10px color-mix(in oklab, var(--ward) 42%, transparent)); }
:root[data-ward] h1 { text-shadow: 0 0 30px color-mix(in oklab, var(--ward) 26%, transparent); }
:root[data-ward] .grad-text, :root[data-ward] .wordmark { text-shadow: none; }
:root[data-ward] .bubble { border-color: color-mix(in oklab, var(--ward) 13%, transparent); }
:root[data-ward] .msg:not(.mine) .bubble { box-shadow: 0 0 22px -10px color-mix(in oklab, var(--ward) 40%, transparent); }
:root[data-ward] .hearth::before { background: radial-gradient(closest-side, color-mix(in oklab, var(--av1) 45%, var(--ward)), color-mix(in oklab, var(--ward) 22%, transparent) 55%, transparent); }
:root[data-ward] dialog.sheet {
  border-color: color-mix(in oklab, var(--ward) 22%, transparent);
  box-shadow: 0 40px 100px -20px rgb(0 0 0 / .85), 0 0 60px -14px color-mix(in oklab, var(--ward) 32%, transparent);
}
:root[data-ward] dialog.sheet::backdrop { background: rgb(2 4 3 / .62); }
:root[data-ward] .runes svg { stroke: var(--ward); opacity: .18; filter: drop-shadow(0 0 4px var(--ward)); animation: rune 9.6s ease-in-out infinite; }
.runes svg:nth-child(2) { animation-delay: 1.2s; }
.runes svg:nth-child(3) { animation-delay: 2.4s; }
.runes svg:nth-child(4) { animation-delay: 3.6s; }
.runes svg:nth-child(5) { animation-delay: 4.8s; }
.runes svg:nth-child(6) { animation-delay: 6s; }
.runes svg:nth-child(7) { animation-delay: 7.2s; }
.runes svg:nth-child(8) { animation-delay: 8.4s; }
@keyframes rune { 0%, 100% { opacity: .18; } 7% { opacity: 1; } 22% { opacity: .18; } }

/* The moment the ward rises */
.ward-rise {
  position: fixed; inset: 0; z-index: 99; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, color-mix(in oklab, var(--ward, #d3eee2) 26%, transparent), transparent 62%);
  box-shadow: inset 0 0 180px 30px color-mix(in oklab, var(--ward, #d3eee2) 42%, transparent);
  animation: ward-rise 1.8s var(--ease) forwards;
}
@keyframes ward-rise { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }

/* New pieces under High Contrast, reduced motion and reduced transparency */
@media (forced-colors: active) {
  .motes, .floaters, .combo, .hug-burst, .ward-rise, .hearth::before, .ward-frame, :root[data-ward] body::after { display: none !important; }
  .bubble, .lore, .seat, .react-bar button, .compose-row textarea, .replying { border: 1px solid CanvasText; }
  .msg.mine .bubble { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .lore-acro b, .nine .num { color: CanvasText; background: none; }
  .hug-note { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .mention-opt, .hug-back { border: 1px solid ButtonText; }
  .mention-opt.sel { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
@media (prefers-reduced-motion: reduce) {
  .motes, .floaters, .hug-burst, .ward-rise, .ward-frame { display: none !important; }
  :root[data-ward] body::after, .ring .core::before, .ring .slot { animation: none !important; }
  .hearth-seat .avatar, .wave-hand { animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .bubble, .compose, .lore { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .bubble { background: var(--surface-solid); }
  .compose { background: var(--bg); }
}

/* =============================================================================
   Accessibility: motion + transparency
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .aurora i { animation: none !important; }
}
/* Windows High Contrast / forced colors: drop decoration, keep everything outlined and legible. */
@media (forced-colors: active) {
  .aurora, body::before, .live-card::before, .live-card::after, .avatar.live::before, .btn-shine::after { display: none; }
  .btn, .tab, .seg button, .switch, .golive, .tile, .input { border: 1px solid ButtonText; }
  .card, .live-card, .tabbar, dialog.sheet, .toast, .update-bar { border: 1px solid CanvasText; }
  .tab[aria-current="page"], .seg button[aria-checked="true"], .switch[aria-checked="true"] {
    forced-color-adjust: none; background: Highlight; color: HighlightText;
  }
  .switch::after { forced-color-adjust: none; background: CanvasText; }
  .avatar { border: 2px solid CanvasText; }
  .avatar.live { outline: 3px solid Highlight; outline-offset: 2px; }
  .chip-live, .chip { border: 1px solid CanvasText; }
  .chip-live::before { background: CanvasText; }
  .theme-tile { forced-color-adjust: none; } /* the swatch colors ARE the content */
  .wordmark, .grad-text { color: CanvasText; background: none; }
  .steps li::before { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

@media (prefers-reduced-transparency: reduce) {
  .glass, .card, .live-card, .tabbar, .golive, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-solid); }
}

/* =============================================================================
   Time together: the only number Aett counts
   ============================================================================= */
.together .tg-big { font: 900 clamp(2.1rem, 9vw, 2.7rem)/1.05 var(--font); letter-spacing: -.045em; }
.together > .muted { margin: 6px 0 4px; }
.together .rows { margin-top: 8px; }
.together .ri .av-stack > .avatar { margin-left: -7px; }
.together .ri .av-stack > .avatar:first-child { margin-left: 0; }
.together .vow { margin: 14px 0 0; text-align: center; }
.together.empty { display: flex; gap: 16px; align-items: center; }
.together.empty p { margin: 0; color: var(--muted); }
.together.empty strong { display: block; color: var(--text); margin-bottom: 2px; }
.tg-ico { font-size: 2.1rem; line-height: 1; flex: none; animation: flicker 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .tg-ico { animation: none; } }
