/* Player Koala, prototype v3: "The Forum / Ziscord"
   A playful parody of a chat-app server: server rail, channel sidebar, chat column, member list. */

:root {
  --rail: #140d22;
  --side: #1e1530;
  --chat: #2a1f40;
  --raise: #3a2b57;
  --embed: #221935;
  --line: rgba(255, 255, 255, 0.07);

  --ink: #f5f0ff;
  --ink-2: #ddd3f2;
  --ink-3: #ab9dcb;
  --ink-4: #9688b8;

  --accent: #7c5cff;
  --accent-2: #a68cff;
  --mint: #3ef0b0;
  --cyan: #2ff3ff;
  --magenta: #ff1ed2;
  --yellow: #ffe600;
  --orange: #ff9a00;
  --night: #0b0618;

  --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --rail-w: 72px;
  --side-w: 248px;
  --mem-w: 252px;
  --logo-ratio: 0.511; /* 1046 / 2047 */
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--chat);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html.splashing { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--sans);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--chat);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2.5px solid var(--cyan); outline-offset: 2px; }
.chat:focus { outline: none; }

.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 10px 14px; border-radius: 10px;
  background: #fff; color: var(--night); font-weight: 800; text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

/* ---------- Tooltips (chat-app style) ---------- */

[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 10px);
  translate: -50% 0;
  padding: 7px 10px; border-radius: 7px;
  background: var(--night); color: #fff;
  font: 700 13px/1 var(--sans); white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: scale(0.94); pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: 700 14.5px/1 var(--sans); color: #fff; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.15s, background-color 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
}
.btn .i { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #d40f97 0%, #7b3cf0 55%, #4458ee 100%);
  box-shadow: 0 10px 28px -10px rgba(255, 30, 210, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -8px rgba(255, 30, 210, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-lg { height: 50px; padding: 0 22px; border-radius: 12px; font-size: 16px; }
.btn-lg .i { width: 20px; height: 20px; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; gap: 6px; }
.btn-sm .i { width: 15px; height: 15px; }
.btn-ghost { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); color: var(--ink-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.11); color: #fff; }

.btn-platform { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.11); }
.btn-platform svg { color: var(--b); transition: color 0.2s; }
.btn-platform:hover { border-color: var(--b); background: color-mix(in srgb, var(--b) 20%, transparent); }
.btn-platform.is-primary { background: #e6002e; border-color: transparent; box-shadow: 0 10px 24px -12px rgba(255, 0, 51, 0.8); }
.btn-platform.is-primary svg { color: #fff; }
.btn-platform.is-primary:hover { background: #f5103d; }

/* Round social icons */
.soc {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.2s, border-radius 0.2s, transform 0.2s, border-color 0.2s;
}
.soc:hover { background: var(--b); border-color: transparent; border-radius: 14px; transform: translateY(-2px); }
.soc-sm { width: 36px; height: 36px; }
.soc-sm:hover { border-radius: 11px; }
.soc-xs { width: 30px; height: 30px; background: rgba(255, 255, 255, 0.06); border-color: transparent; color: var(--ink-2); }
.soc-xs:hover { border-radius: 9px; color: #fff; }
.soc[href*="tiktok"]:hover svg, .rail-social[href*="tiktok"]:hover svg,
.invite[href*="tiktok"] .invite-icon svg {
  filter: drop-shadow(-1.5px -1px 0 #25f4ee) drop-shadow(1.5px 1px 0 #fe2c55);
}

/* ---------- Presence dots and avatars ---------- */

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-on { background: var(--mint); box-shadow: 0 0 8px rgba(62, 240, 176, 0.6); }
.dot-idle { background: #8b80a8; }

.av-wrap { position: relative; display: inline-block; width: 44px; height: 44px; flex: none; vertical-align: top; }
.av {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden; background: var(--raise);
}
.av-crop { background: #d9d9d9; }
.av-crop img {
  position: absolute; max-width: none; height: auto;
  width: calc(var(--k) * 100%);
  left: calc(50% - var(--hx) * var(--k) * 100%);
  top: calc(50% - var(--hy) * var(--k) * 125%);
}
.av-bot { background: linear-gradient(145deg, #8b6cff, #ff1ed2); color: #fff; }
.av-bot .i { width: 54%; height: 54%; stroke-width: 2.2; }
.av-guest { background: #3a2b57; color: #b9abdb; }
.av-guest .i { width: 56%; height: 56%; }
.presence {
  position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 0 3px var(--ring, var(--chat));
}
.presence-idle { background: #8b80a8; }

/* ---------- Splash ---------- */

.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background-color: rgba(12, 7, 22, 0.9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color 0.45s ease, backdrop-filter 0.45s ease, -webkit-backdrop-filter 0.45s ease;
}
.splash::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 45% at 38% 48%, rgba(255, 30, 210, 0.16), transparent 70%),
    radial-gradient(40% 45% at 64% 54%, rgba(47, 243, 255, 0.12), transparent 70%);
  transition: opacity 0.45s ease;
}
.splash[hidden], html.nosplash .splash { display: none; }
.splash.is-out { background-color: rgba(12, 7, 22, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); pointer-events: none; }
.splash.is-out::before, .splash.is-out .splash-tip, .splash.is-out .splash-skip { opacity: 0; }
.splash-stage { position: relative; }
.splash-logo { --lw: min(70vw, 900px); width: var(--lw); height: calc(var(--lw) * var(--logo-ratio)); }
.splash-tip {
  position: absolute; top: calc(100% + clamp(16px, 4vh, 40px)); left: 50%; translate: -50% 0;
  width: max-content; max-width: 86vw; margin: 0; text-align: center;
  font-size: 14.5px; color: var(--ink-3); transition: opacity 0.3s;
}
.splash-tip-k { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); }
.splash-skip {
  position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); translate: -50% 0;
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16); color: var(--ink-2);
  font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background 0.2s, color 0.2s, opacity 0.3s;
}
.splash-skip .i { width: 14px; height: 14px; }
.splash-skip:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* Entrance: chat "loads in" while the logo docks. */
.rise { transition: opacity 0.5s ease, transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1); transition-delay: calc(var(--d, 0) * 70ms + 140ms); }
html.splashing:not(.revealing) .rise { opacity: 0; transform: translateY(14px); transition-delay: 0s; }

/* ---------- App shell ---------- */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) var(--mem-w);
  min-height: 100vh;
}
.rail, .sidebar, .members { position: sticky; top: 0; height: 100vh; height: 100dvh; align-self: start; }

/* Server rail */
.rail {
  z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 0; background: var(--rail);
}
.rail-mark {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  color: #d4c6ff; background: linear-gradient(150deg, #5b3fd0, #2d1d68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.rail-mark .i { width: 26px; height: 26px; stroke-width: 2.2; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.09); margin: 2px 0; }
.rail-socials { display: flex; flex-direction: column; gap: 8px; }
.rail-btn {
  position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: #261b3d; color: #ece6ff; text-decoration: none;
  transition: border-radius 0.2s, background 0.2s, color 0.2s;
}
.rail-btn::before {
  content: ''; position: absolute; left: -12px; top: 50%; width: 4px; height: 20px; margin-top: -10px;
  border-radius: 0 4px 4px 0; background: #fff; transform: scale(0, 0.4); transform-origin: left center;
  transition: transform 0.2s;
}
.rail-btn:hover { border-radius: 16px; }
.rail-btn:hover::before { transform: scale(1, 1); }
.rail-btn.is-active { border-radius: 16px; }
.rail-btn.is-active::before { height: 40px; margin-top: -20px; transform: none; }
.rail-pk { background: linear-gradient(150deg, #ff1ed2 0%, #7a3cff 55%, #19b8ff 100%); }
.rail-pk img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(11, 6, 24, 0.35)); }
.rail-social:hover { background: var(--b); color: #fff; }
.rail [data-tip]::after { left: calc(100% + 14px); top: 50%; bottom: auto; translate: 0 -50%; }

/* Channel sidebar */
.sidebar { z-index: 5; display: flex; flex-direction: column; background: var(--side); }
.side-banner {
  position: relative; display: grid; place-items: center; flex: none; height: 150px;
  text-decoration: none;
  background:
    radial-gradient(60% 70% at 28% 32%, rgba(255, 30, 210, 0.22), transparent 70%),
    radial-gradient(60% 70% at 78% 72%, rgba(47, 243, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #0b0618 0%, #150d26 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}
.side-banner::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.6;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.side-banner:focus-visible { outline-offset: -4px; }
.logo-slot { display: block; position: relative; }
.logo-slot-side { width: 200px; height: calc(200px * var(--logo-ratio)); }
.side-head { padding: 12px 16px 14px; border-bottom: 1px solid rgba(0, 0, 0, 0.3); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03); }
.side-name { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; }
.side-name .i-badge { width: 18px; height: 18px; color: var(--accent-2); }
.side-official {
  margin-left: 2px; padding: 3px 6px 2px; border-radius: 5px; background: rgba(124, 92, 255, 0.28);
  color: #ddd2ff; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1;
}
.side-meta { display: flex; align-items: center; gap: 6px; margin: 5px 0 0; font-size: 12.5px; color: var(--ink-3); }
.side-meta .dot-idle { margin-left: 8px; }

.channels { flex: 1; overflow-y: auto; padding: 16px 8px; scrollbar-width: thin; }
.channels ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.cat {
  display: flex; align-items: center; gap: 3px; margin: 20px 0 6px; padding: 0 6px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-4);
}
.cat:first-child { margin-top: 0; }
.cat .i { width: 13px; height: 13px; stroke-width: 2.6; }
.ch {
  position: relative; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  border-radius: 8px; color: var(--ink-3); text-decoration: none; font-size: 15.5px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.ch .i { width: 19px; height: 19px; color: var(--ink-4); stroke-width: 2.2; transition: color 0.15s; }
.ch:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink-2); }
.ch.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.45), rgba(124, 92, 255, 0.2));
  box-shadow: inset 0 0 0 1px rgba(166, 140, 255, 0.22);
}
.ch.is-active .i { color: var(--c); }
.ch.is-active::before {
  content: ''; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--c); box-shadow: 0 0 10px var(--c);
}
.ch-new {
  margin-left: auto; padding: 3px 7px 2px; border-radius: 99px; background: #d1069e; color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.1;
  box-shadow: 0 0 14px rgba(255, 30, 210, 0.55);
}

.userpanel {
  --ring: #170f28;
  display: flex; align-items: center; gap: 10px; flex: none; padding: 10px 8px 12px 10px;
  background: #170f28; border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.userpanel .av-wrap { width: 36px; height: 36px; }
.userpanel .presence { width: 11px; height: 11px; }
.up-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.up-text strong { font-size: 14px; font-weight: 700; }
.up-text span { font-size: 12px; color: var(--ink-3); }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.icon-btn .i { width: 20px; height: 20px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Chat column */
.col { min-width: 0; display: flex; flex-direction: column; background: var(--chat); }
.chat-head {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 16px 0 22px;
  background: rgba(42, 31, 64, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 20px -14px rgba(0, 0, 0, 0.7);
}
.chat-head-hash { width: 22px; height: 22px; color: var(--ink-4); stroke-width: 2.2; }
.chat-head-name { font-size: 16px; font-weight: 800; }
.chat-head-sep { width: 1px; height: 24px; margin: 0 4px; background: rgba(255, 255, 255, 0.12); }
.chat-head-topic { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Chat / Comic style switch (built by shared/style-switch.js): a segmented control like the
   app's own toolbar toggles. The current style is the raised option with a cyan icon. */
.style-slot { display: flex; flex: none; }
.style-slot:empty { display: none; }
.style-slot .pks {
  display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 2px;
  border-radius: 9px; background: rgba(11, 6, 24, 0.38); border: 1px solid rgba(255, 255, 255, 0.1);
}
.style-slot .pks__opt {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 10px 0 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-3); font: 700 13px/1 var(--sans); white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.style-slot .pks__icon { width: 16px; height: 16px; flex: none; }
.style-slot .pks__opt:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.style-slot .pks__opt.is-on {
  background: var(--raise); color: #fff; cursor: default;
  box-shadow: inset 0 0 0 1px rgba(166, 140, 255, 0.38), 0 2px 8px -2px rgba(0, 0, 0, 0.55);
}
.style-slot .pks__opt.is-on .style-slot .pks__icon { color: var(--cyan); }
.style-slot .pks__opt:focus-visible {
  z-index: 1; outline: 2.5px solid var(--cyan); outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(47, 243, 255, 0.2);
}
.chat-head .style-slot { margin-left: 2px; }

.chat { flex: 1; padding: 10px 28px 24px; }
.chat > .channel { max-width: 1040px; }

/* ---------- Channel sections ---------- */

.channel { scroll-margin-top: 70px; padding-top: 18px; }
.channel + .channel { margin-top: 52px; }

.ch-start {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center;
  padding-bottom: 20px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.ch-badge {
  grid-row: 1 / span 2; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  color: var(--c, var(--accent-2));
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, #33264d);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c, var(--accent)) 45%, transparent), 0 0 40px -12px var(--c, var(--accent));
}
.ch-badge .i { width: 30px; height: 30px; stroke-width: 2.4; }
.ch-start h2 { margin: 0; align-self: end; font-size: 32px; font-weight: 900; line-height: 1.05; letter-spacing: -0.03em; }
.h-hash { color: var(--c); margin-right: 1px; font-weight: 800; }
.ch-start p { margin: 4px 0 0; align-self: start; font-size: 15.5px; color: var(--ink-3); }

.pin-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.pin-note .i { width: 15px; height: 15px; color: var(--magenta); }

/* Hero: pinned server banner */
.banner {
  position: relative; isolation: isolate; container-type: inline-size;
  aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--night);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 34px 70px -34px rgba(0, 0, 0, 0.8), 0 0 90px -40px rgba(255, 30, 210, 0.45);
}
.banner-art { position: absolute; inset: 0; display: block; }
.banner-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 100% 50%; }
.banner-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 6, 24, 0.94) 0%, rgba(11, 6, 24, 0.82) 27%, rgba(11, 6, 24, 0.34) 45%, rgba(11, 6, 24, 0) 60%),
    linear-gradient(0deg, rgba(11, 6, 24, 0.5) 0%, rgba(11, 6, 24, 0) 32%);
}
.banner-copy {
  position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; width: 47%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(22px, 4.4cqi, 48px);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-bottom: clamp(12px, 2.2cqi, 20px);
  padding: 4px 12px 4px 4px; border-radius: 99px; text-decoration: none;
  background: rgba(11, 6, 24, 0.55); border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}
.chip:hover { border-color: rgba(255, 255, 255, 0.34); background: rgba(11, 6, 24, 0.75); }
.chip .i { width: 14px; height: 14px; transition: transform 0.2s; }
.chip:hover .i { transform: translateX(3px); }
.chip-new {
  padding: 4px 8px 3px; border-radius: 99px; background: #d1069e; color: #fff; box-shadow: 0 0 12px rgba(255, 30, 210, 0.5);
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.1;
}
.banner h1 {
  margin: 0; color: #fff; font-size: clamp(28px, 4.9cqi, 60px); font-weight: 900; line-height: 1.02; letter-spacing: -0.035em;
  text-shadow: 0 2px 24px rgba(11, 6, 24, 0.5);
}
.grad {
  background: linear-gradient(92deg, var(--cyan) 0%, #a58bff 48%, var(--magenta) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.lede { margin: clamp(10px, 1.8cqi, 16px) 0 0; max-width: 34ch; font-size: clamp(15px, 1.95cqi, 18px); line-height: 1.5; color: #e7dff7; }
.banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: clamp(16px, 2.8cqi, 26px); }
.banner-socials { display: flex; gap: 8px; }
.banner .soc { background: rgba(11, 6, 24, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* System and chat messages */
.sys { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-items: center; margin: 22px 0 12px; }
.sys-ic { justify-self: center; width: 20px; height: 20px; color: var(--mint); stroke-width: 2.4; }
.sys p { margin: 0; font-size: 15px; color: var(--ink-3); }
.sys strong { color: #fff; font-weight: 700; }
.sys .time { margin-left: 6px; }

.msg {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px;
  margin: 0 -14px; padding: 6px 14px; border-radius: 10px; transition: background 0.15s;
}
.msg + .msg:not(.cont) { margin-top: 10px; }
.msg.cont { padding-top: 1px; }
.msg:has(+ .msg.cont) { padding-bottom: 1px; }
.msg:hover { background: rgba(12, 6, 24, 0.16); }
.msg.cont .msg-gutter { display: flex; justify-content: center; padding-top: 3px; }
.time-side { font-size: 10.5px; color: var(--ink-4); opacity: 0; transition: opacity 0.15s; }
.msg.cont:hover .time-side { opacity: 1; }
.msg.is-mention { background: rgba(255, 214, 10, 0.065); box-shadow: inset 3px 0 0 #f5c542; }
.msg.is-mention:hover { background: rgba(255, 214, 10, 0.09); }
.msg-body { min-width: 0; }
.msg-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 1px; line-height: 1.35; }
.uname { color: var(--u); font-size: 15.5px; font-weight: 700; }
.utag {
  align-self: center; padding: 2px 5px 1px; border-radius: 4px; background: #6343ee; color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.2;
}
.time { font-size: 12px; font-weight: 500; color: var(--ink-4); }
.msg-text { margin: 0; font-size: 16px; line-height: 1.45; color: #ece5fa; overflow-wrap: anywhere; }
.mention { padding: 0 3px; border-radius: 4px; background: rgba(124, 92, 255, 0.34); color: #e6ddff; font-weight: 600; }

.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.react {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.07); color: var(--ink-2);
  font: 700 13.5px/1 var(--sans); cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.react:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.18); }
.react[aria-pressed="true"] { background: rgba(124, 92, 255, 0.26); border-color: #8b6cff; color: #fff; }
.react-e { font-size: 16px; line-height: 1; transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); }
.react[aria-pressed="true"] .react-e { transform: scale(1.18); }

/* Embeds */
.embed {
  position: relative; overflow: hidden; max-width: 640px; margin-top: 8px;
  padding: 14px 18px 16px 22px; border-radius: 10px;
  background: var(--embed); border: 1px solid var(--line);
}
.embed::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--accent)); }
.embed-provider { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.embed-title { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: #fff; }
.embed-desc { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.embed-about { max-width: 760px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; margin: 14px 0 0; }
.fields dt { margin-bottom: 2px; font-size: 12.5px; font-weight: 800; color: #fff; }
.fields dd { margin: 0; font-size: 14px; color: var(--ink-2); }

/* Episodes: one @everyone drop per episode, each a YouTube-style embed with an inline 9:16 player.
   --w is the player width: an embed size on desktop, capped so the whole 9:16 frame fits the viewport. */
.msg-drop { scroll-margin-top: 70px; }
.pin-tag {
  align-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 1px 5px; border-radius: 5px;
  background: rgba(255, 30, 210, 0.18); color: #ffb8ef;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3;
}
.pin-tag .i { width: 12px; height: 12px; stroke-width: 2.4; }

.embed-yt {
  --c: #ff0033;
  --w: min(300px, calc((100vh - 290px) * 9 / 16));  /* the whole card (title + player) fits between the header and composer */
  width: min(100%, calc(var(--w) + 36px));
  max-width: none; padding: 12px 16px 16px 18px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.embed-yt.is-featured {
  --c: linear-gradient(180deg, var(--cyan), var(--magenta));
  --w: min(360px, calc((100vh - 330px) * 9 / 16));
}
.yt-author { margin: 0 0 3px; font-size: 13.5px; font-weight: 700; color: #fff; }
.yt-title { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.is-featured .yt-title { font-size: 21px; letter-spacing: -0.02em; }
.yt-title a { color: #7fe4ff; text-decoration: none; border-radius: 3px; }
.yt-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.yt-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; margin: 5px 0 0;
  font: 500 11.5px/1.35 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.yt-ep { color: #ff86e6; }
.yt-caption { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }

/* Player skin over shared/yt-embed.css (which owns the 9:16 box, so the iframe swap never shifts layout) */
.embed-yt .pkp {
  width: 100%; margin-top: 12px; border-radius: 10px; background: var(--night);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 34px -16px rgba(0, 0, 0, 0.8);
}
.pkp__img { transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pkp__cover:hover .pkp__img { transform: scale(1.04); }
.pkp__cover:focus-visible { outline: 3px solid var(--cyan); outline-offset: -3px; }
/* The play button sits low (80%) so it never covers a face or the cover's baked-in "EPISODE N" lettering. */
.pkp__cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 22% at 50% 80%, rgba(11, 6, 24, 0.38), transparent);
}
.pkp__play {
  top: 80%; z-index: 1; justify-content: center; width: 64px; height: 64px; border-radius: 99px; color: #fff;
  background: rgba(11, 6, 24, 0.5); border: 1.5px solid rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1), background-color 0.2s, border-color 0.2s;
}
.pkp__icon { width: 26px; height: 26px; margin-left: 3px; }
.is-featured .pkp__play { width: 74px; height: 74px; }
.is-featured .pkp__icon { width: 30px; height: 30px; }
.pkp__cover:hover .pkp__play, .pkp__cover:focus-visible .pkp__play {
  transform: translate(-50%, -50%) scale(1.1); background: var(--magenta); border-color: transparent;
}
/* No video link yet: the cover opens YouTube, so the button says so. */
a.pkp__cover .pkp__play { width: auto; height: 48px; padding: 0 18px 0 14px; white-space: nowrap; }
a.pkp__cover .pkp__icon { width: 20px; height: 20px; margin: 0; }
.pkp__label { font-size: 14.5px; font-weight: 800; }
.pkp__time {
  z-index: 1; right: 10px; bottom: 10px; padding: 3px 7px; border-radius: 6px;
  background: rgba(11, 6, 24, 0.8); font: 500 12px/1.4 var(--mono);
}
.msg-drop.is-playing .embed-yt {
  border-color: rgba(255, 30, 210, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 30, 210, 0.2), 0 26px 60px -30px rgba(255, 30, 210, 0.7);
}

.ep-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Discord-style day divider, used for "Earlier episodes" and "Coming up" */
.divider-day {
  display: flex; align-items: center; gap: 12px; margin: 30px 0 14px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4);
}
.divider-day::before, .divider-day::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.09); }

/* The next drop: a scheduled-event card, no title until it is posted */
.next-ep {
  display: flex; align-items: center; gap: 14px; max-width: 520px; margin-left: 58px;
  padding: 14px 14px 14px 16px; border-radius: 12px;
  background: rgba(34, 25, 53, 0.6); border: 1.5px dashed rgba(255, 255, 255, 0.16);
}
.next-ic {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 13px;
  background: rgba(255, 230, 0, 0.12); color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255, 230, 0, 0.25);
}
.next-ic .i { width: 23px; height: 23px; }
.next-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; margin: 0; }
.next-k { font: 500 11px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.next-title { font-size: 17px; font-weight: 800; line-height: 1.25; color: #fff; }

/* New-messages divider */
.divider-new { display: flex; align-items: center; height: 16px; margin: 2px 0 12px; }
.divider-new::before { content: ''; flex: 1; height: 1px; background: #ff4d8d; }
.divider-new span {
  padding: 2px 7px 1px 10px; background: #e0245e; color: #fff; border-radius: 0 4px 4px 0;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.3;
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%);
}

/* Crew: member profiles */
.list-label {
  display: flex; align-items: center; gap: 8px; margin: 30px 0 12px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.list-count { padding: 2px 8px 1px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); color: var(--ink-2); }
.crew-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.profile {
  --ring: var(--embed);
  position: relative; display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 84px;
  border-radius: 16px; background: var(--embed); border: 1px solid var(--line);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.profile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 20px 44px -22px color-mix(in srgb, var(--c) 70%, transparent); }
.profile:target { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.profile-art { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #d9d9d9; }
.profile-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.profile:hover .profile-art img { transform: scale(1.035); }
.profile-art::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c); }
.profile-body { position: relative; flex: 1; display: flex; flex-direction: column; padding: 0 18px 18px; }
.av-lg { width: 66px; height: 66px; margin: -36px 0 8px; }
.av-lg .av { box-shadow: 0 0 0 5px var(--embed); }
.av-lg .presence { width: 17px; height: 17px; right: 0; bottom: 0; box-shadow: 0 0 0 4px var(--embed); }
.profile-name { margin: 0; font-size: 23px; font-weight: 900; line-height: 1.15; letter-spacing: -0.025em; color: #fff; }
.role {
  display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; margin: 6px 0 0;
  padding: 3px 9px 3px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.07);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
.role i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.profile-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.label { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.profile-line { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.profile-status { margin: 0; font-size: 14px; color: var(--ink-2); }

/* Locked crew (content.js `secret: true`): same slot, blurred art and name, a padlock, the plain line.
   The card art is already blurred; the extra blur and tint make it read as deliberate. */
.blur-name {
  display: inline-block; filter: blur(5px); opacity: 0.9;
  -webkit-user-select: none; user-select: none; pointer-events: none;
}
.profile-locked .profile-art img { filter: blur(7px) saturate(0.7) brightness(0.92); transform: scale(1.1); }
.profile-locked:hover .profile-art img { transform: scale(1.13); }
.profile-locked .profile-art::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(30, 21, 48, 0) 0 22%, rgba(30, 21, 48, 0.28) 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 12px);
}
.lock-badge {
  position: absolute; z-index: 2; left: 50%; top: 42%; translate: -50% -50%;
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(20, 13, 34, 0.62); color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px -10px rgba(11, 6, 24, 0.7), 0 0 0 6px rgba(255, 255, 255, 0.08);
}
.lock-badge .i { width: 28px; height: 28px; stroke-width: 2.2; }
.profile-locked .profile-name { color: #e4dcf5; }
.role-locked {
  background: rgba(124, 92, 255, 0.16); color: #d9ccff;
  box-shadow: inset 0 0 0 1px rgba(166, 140, 255, 0.4);
}
.role-locked .i { width: 13px; height: 13px; stroke-width: 2.4; }
.profile-locked .profile-line { color: var(--ink-3); font-style: italic; }
.av-locked img { filter: blur(3px) saturate(0.7); }
.presence-locked { display: grid; place-items: center; background: #6f6390; color: #fff; }
.presence-locked .i { width: 72%; height: 72%; stroke-width: 2.8; }
.member-locked .mem-text strong { color: var(--ink-2); }
.member-locked .mem-text .i { width: 12px; height: 12px; vertical-align: -1px; stroke-width: 2.4; }

.profile-you {
  align-items: center; justify-content: center; gap: 8px; min-height: 300px; padding: 28px 22px;
  text-align: center; text-decoration: none; color: var(--ink-2);
  background: transparent; border: 1.5px dashed rgba(255, 255, 255, 0.17);
}
.profile-you:hover { --c: var(--mint); background: rgba(62, 240, 176, 0.05); }
.you-plus {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%;
  background: rgba(62, 240, 176, 0.12); color: var(--mint); transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.you-plus .i { width: 30px; height: 30px; }
.profile-you:hover .you-plus { transform: rotate(90deg) scale(1.06); }
.you-title { font-size: 21px; font-weight: 900; letter-spacing: -0.02em; color: #fff; }
.you-text { max-width: 24ch; font-size: 14.5px; color: var(--ink-3); }
.you-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 800; color: var(--mint); }
.you-cta .i { width: 16px; height: 16px; transition: transform 0.2s; }
.profile-you:hover .you-cta .i { transform: translateX(3px); }

/* World: forum-style post cards */
.world-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.post {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 14px;
  background: var(--embed); border: 1px solid var(--line); transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.post:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--c) 80%, transparent); }
.post-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #120b20; }
.post-media::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); }
.post-media img, .post-media svg { display: block; width: 100%; height: 100%; }
.post-media img { transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.post:hover .post-media img { transform: scale(1.04); }
.post-media-poster img { object-fit: cover; object-position: 50% 7%; }
.post-media-can { background: #eadfd3; }
.post-media-can img { object-fit: cover; object-position: 50% 44%; }
.post-media-bamboo {
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(90deg, rgba(31, 110, 62, 0.08) 0 3px, transparent 3px 30px),
    radial-gradient(90% 100% at 50% 38%, #fbf6e6 0%, #efe6c8 70%, #e2d6ae 100%);
}
.post-media-bamboo img { width: 80%; height: auto; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(8, 60, 30, 0.18)); }
.post-body { padding: 14px 18px 18px; }
.post-tag {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3);
}
.post-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.post-title { margin: 0 0 4px; font-size: 21px; font-weight: 900; letter-spacing: -0.02em; color: #fff; }
.post-line { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

.attach {
  max-width: 560px; margin: 8px 0 0; overflow: hidden; border-radius: 10px;
  border: 1px solid var(--line); box-shadow: 0 20px 44px -24px rgba(0, 0, 0, 0.8);
}
.attach img { display: block; width: 100%; height: auto; }

/* Follow: invite cards */
.invite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.invite {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px 18px 18px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--embed); border: 1px solid var(--line);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.invite::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--bc) 30%, transparent), transparent 70%);
}
.invite:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--bc) 60%, transparent); box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--bc) 80%, transparent); }
.invite:hover::before { opacity: 1; }
.invite-kicker { position: relative; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.invite-row { position: relative; display: flex; align-items: center; gap: 14px; }
.invite-icon {
  display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 17px;
  background: var(--b); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 22px -12px var(--bc);
}
.invite-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.invite-name { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; color: #fff; line-height: 1.2; }
.invite-handle { font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 13px; color: var(--ink-3); }
.invite-join {
  display: inline-flex; align-items: center; gap: 5px; flex: none; height: 38px; padding: 0 14px; border-radius: 9px;
  background: var(--mint); color: var(--night); font-size: 14px; font-weight: 800; transition: background 0.2s, transform 0.2s;
}
.invite-join .i { width: 15px; height: 15px; stroke-width: 2.8; }
.invite:hover .invite-join { background: #7af8cb; }

/* Footer and composer */
.foot { padding: 30px 28px 28px; }
.foot-end, .foot-row { max-width: 1040px; }
.foot-end { display: flex; align-items: center; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); }
.ch-badge-sm { grid-row: auto; flex: none; width: 46px; height: 46px; --c: var(--accent-2); }
.ch-badge-sm .i { width: 22px; height: 22px; stroke-width: 2.2; }
.foot-end p { margin: 0; font-size: 15px; color: var(--ink-3); }
.foot-end strong { color: #fff; }
.foot-end a { color: #fff; font-weight: 700; text-decoration-color: rgba(255, 30, 210, 0.7); text-decoration-thickness: 2px; text-underline-offset: 3px; border-radius: 3px; }
.foot-end a:hover { text-decoration-color: var(--magenta); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.foot-copy { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.foot-socials, .composer-socials { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.foot-ctrls { display: flex; gap: 8px; margin-left: auto; }

.composer {
  position: sticky; bottom: 0; z-index: 3; padding: 14px 24px 20px;
  background: linear-gradient(180deg, rgba(42, 31, 64, 0), var(--chat) 38%);
}
.composer-box {
  display: flex; align-items: center; gap: 12px; max-width: 1040px; height: 52px; padding: 0 10px 0 16px;
  border-radius: 12px; background: var(--raise); border: 1px solid rgba(255, 255, 255, 0.06); color: var(--ink-3);
}
.composer-box > .i { width: 18px; height: 18px; }
.composer-box p { flex: 1; min-width: 0; margin: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#composer-ch { font-weight: 700; color: var(--ink-2); }

/* Member list */
.members { --ring: var(--side); z-index: 5; padding: 18px 10px 24px; overflow-y: auto; background: var(--side); scrollbar-width: thin; }
.mem-label { margin: 20px 8px 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-4); }
.now .mem-label { margin-top: 0; }
.mem-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.member { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; transition: background 0.15s; }
a.member:hover { background: rgba(255, 255, 255, 0.05); }
.member .av-wrap { width: 36px; height: 36px; }
.member .presence { width: 12px; height: 12px; }
.mem-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mem-text strong { font-size: 15px; font-weight: 700; color: var(--u, #fff); }
.mem-text span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-guest { opacity: 0.75; }
.now-card {
  display: flex; gap: 12px; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none;
  background: linear-gradient(145deg, rgba(255, 30, 210, 0.15), rgba(47, 243, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.08); transition: border-color 0.2s, transform 0.2s;
}
.now-card:hover { border-color: rgba(255, 30, 210, 0.55); transform: translateY(-1px); }
.now-thumb { flex: none; width: 56px; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 8px; background: var(--night); }
.now-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.now-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.now-k { font: 500 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #ff86e6; }
.now-text strong { font-size: 16px; font-weight: 800; line-height: 1.2; color: #fff; }
.now-cta { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; font-weight: 800; color: var(--mint); }
.now-cta .i { width: 13px; height: 13px; }

/* ---------- Phone / tablet header (hidden on desktop) ---------- */

.m-head {
  display: none; position: sticky; top: 0; z-index: 10;
  background: rgba(30, 21, 48, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(0, 0, 0, 0.32); box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.8);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.m-head.is-tucked { transform: translateY(-66px); }
.m-top { display: flex; align-items: center; gap: 12px; height: 66px; padding: 0 12px 0 14px; }
.m-logo { display: block; flex: none; border-radius: 8px; }
.logo-slot-top { width: 120px; height: calc(120px * var(--logo-ratio)); }
.m-online { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.tabs ul {
  position: relative; display: flex; gap: 6px; margin: 0; padding: 0 30px 10px 12px; list-style: none;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 32px), transparent);
}
.tabs ul::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 13px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid transparent; color: var(--ink-3);
  font-size: 14px; font-weight: 700; white-space: nowrap; text-decoration: none; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab > span[aria-hidden] { color: var(--ink-4); font-weight: 600; }
.tab.is-active { color: #fff; background: color-mix(in srgb, var(--c) 18%, #3a2b57); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.tab.is-active > span[aria-hidden] { color: var(--c); }
.tab-new { width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }

/* ---------- Responsive ---------- */

.side-now { display: none; flex: none; padding: 0 8px 12px; }
.side-now .mem-label { margin: 0 6px 8px; }

@media (max-width: 1199px) {
  .app { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); }
  .members { display: none; }
  .side-now { display: block; }
  /* Without the member list the composer runs to the right edge: leave the corner to the
     floating Comic / Chat switch (shared/style-switch.css, ~200px wide at 16px from the edge). */
  .composer { padding-right: 236px; }
}

@media (max-width: 959px) {
  .app { display: block; }
  .rail, .sidebar, .members, .chat-head, .composer { display: none; }
  .m-head { display: block; }
  .chat { padding: 6px 20px 20px; }
  .channel { scroll-margin-top: 112px; }
  .profile, .msg-drop { scroll-margin-top: 112px; }
  .embed-yt { --w: min(300px, calc((100vh - 80px) * 9 / 16)); }
  .embed-yt.is-featured { --w: min(360px, calc((100vh - 80px) * 9 / 16)); }
  .foot { padding: 20px 20px 36px; }
  .foot-ctrls { margin-left: 0; }
}

@media (max-width: 699px) {
  .chat { padding: 4px 14px 16px; }
  .channel { padding-top: 12px; }
  .channel + .channel { margin-top: 40px; }

  .msg { grid-template-columns: 38px minmax(0, 1fr); column-gap: 11px; margin: 0 -10px; padding: 6px 10px; }
  .msg .av-wrap { width: 38px; height: 38px; }
  .msg .presence { width: 12px; height: 12px; }
  .msg-text { font-size: 15.5px; }
  .sys { grid-template-columns: 38px minmax(0, 1fr); column-gap: 11px; margin: 18px 0 10px; }
  .sys p { font-size: 14.5px; }

  .ch-start { column-gap: 14px; padding-bottom: 16px; margin-bottom: 14px; }
  .ch-badge { width: 50px; height: 50px; }
  .ch-badge .i { width: 24px; height: 24px; }
  .ch-start h2 { font-size: 26px; }
  .ch-start p { font-size: 14.5px; }

  /* Hero: 9:16 art with the title in the sky and the CTA over the foreground. */
  .banner { aspect-ratio: auto; display: flex; flex-direction: column; border-radius: 16px; background: var(--embed); }
  .banner-art { position: relative; inset: auto; aspect-ratio: 9 / 16; }
  .banner-art img { object-position: 50% 50%; }
  .banner-art::after {
    background:
      linear-gradient(180deg, rgba(11, 6, 24, 0.9) 0%, rgba(11, 6, 24, 0.6) 20%, rgba(11, 6, 24, 0) 38%),
      linear-gradient(0deg, var(--embed) 0%, rgba(34, 25, 53, 0.86) 10%, rgba(34, 25, 53, 0) 26%);
  }
  .banner-copy, .banner-actions { display: contents; }
  .banner-title { position: absolute; z-index: 2; top: 0; left: 0; right: 0; padding: 18px 18px 0; }
  .chip { margin-bottom: 12px; font-size: 12.5px; }
  .banner h1 { font-size: clamp(28px, 9cqi, 40px); }
  .banner-cta { position: absolute; z-index: 2; left: 16px; right: 16px; top: calc(100cqi * 16 / 9 - 70px); }
  .lede { position: relative; z-index: 2; max-width: none; margin: 0; padding: 12px 18px 0; font-size: 15.5px; }
  .banner-socials { position: relative; z-index: 2; padding: 14px 18px 18px; }

  .embed { padding: 12px 14px 14px 18px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields div:last-child { grid-column: 1 / -1; }

  /* Episodes: the player breaks out of the avatar gutter so it is close to full column width,
     capped so the whole 9:16 frame fits under the channel tabs. */
  .msg-drop .msg-body > .embed-yt, .msg-drop .msg-body > .ep-links { margin-left: -49px; }
  .embed-yt, .embed-yt.is-featured {
    --w: calc((100vh - 64px) * 9 / 16);
    --w: calc((100svh - 64px) * 9 / 16);
    width: min(calc(100% + 49px), calc(var(--w) + 26px)); padding: 10px 10px 12px 14px;
  }
  .embed-yt .pkp { margin-top: 10px; }
  .is-featured .yt-title { font-size: 19px; }
  .ep-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ep-links .btn { padding: 0 8px; gap: 7px; }
  .divider-day { margin: 26px 0 12px; }
  .next-ep { margin-left: 0; max-width: none; padding: 12px; gap: 12px; flex-wrap: wrap; }
  .next-btn { flex: 1 1 100%; height: 40px; }

  .crew-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .profile { display: grid; grid-template-columns: 120px minmax(0, 1fr); border-radius: 14px; }
  .profile:hover { transform: none; }
  .profile-art { aspect-ratio: auto; height: 100%; min-height: 150px; }
  .profile-art img { position: absolute; inset: 0; object-position: 50% 28%; }
  .profile-art::after { left: auto; top: 0; width: 3px; height: auto; }
  .profile-body { padding: 12px 14px 14px; justify-content: center; }
  .av-lg { display: none; }
  .profile-name { font-size: 20px; }
  .role { margin-top: 5px; font-size: 12px; }
  .profile-sec { margin-top: 8px; padding-top: 0; border-top: 0; }
  .profile-sec .label { display: none; }
  .profile-line { font-size: 14px; line-height: 1.45; }
  .profile-sec-status { margin-top: 6px; }
  .profile-status { font-size: 13px; color: var(--ink-3); }
  .lock-badge { top: 50%; width: 46px; height: 46px; box-shadow: 0 10px 24px -10px rgba(11, 6, 24, 0.7), 0 0 0 4px rgba(255, 255, 255, 0.08); }
  .lock-badge .i { width: 21px; height: 21px; }
  .profile-you { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; min-height: 0; padding: 16px; gap: 4px 14px; }
  .you-plus { width: 48px; height: 48px; margin: 0; }
  .you-plus .i { width: 24px; height: 24px; }
  .you-title { font-size: 18px; flex: 1; }
  .you-text { flex-basis: 100%; max-width: none; }
  .you-cta { margin-top: 2px; }

  .world-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .post { display: grid; grid-template-columns: minmax(0, 1fr) 112px; }
  .post-media { grid-column: 2; grid-row: 1; aspect-ratio: auto; height: 100%; min-height: 128px; }
  .post-media::after { left: 0; right: auto; top: 0; width: 3px; height: auto; }
  .post-media-poster img { object-position: 50% 30%; }
  .post-media-can img { object-position: 50% 50%; }
  .post-media-bamboo img { width: 88%; }
  .post-media svg { position: absolute; inset: 0; }
  .post-body { grid-column: 1; grid-row: 1; padding: 13px 14px 14px 16px; }
  .post-title { font-size: 19px; }
  .post-line { font-size: 14px; }
  .attach { max-width: 100%; }

  .invite-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .invite { padding: 14px 14px 16px; gap: 10px; }
  .invite-icon { width: 50px; height: 50px; border-radius: 15px; }
  .invite-name { font-size: 18px; }
  .invite-join { height: 36px; padding: 0 12px; }

  .foot-end { align-items: flex-start; }
  .foot-row { gap: 16px; }
  .foot-copy { flex-basis: 100%; order: 3; }
}

/* Top bar on phones: the "online" count gives way first, then the switch drops its icons (the two
   look alike at this size, the words don't), and only very narrow phones get the icon-only switch. */
@media (max-width: 599px) {
  .m-top { gap: 8px; }
  .m-top .style-slot .pks__icon { display: none; }
  .m-top .style-slot .pks__opt { padding: 0 9px; }
}
@media (max-width: 449px) {
  .m-online { display: none; }
  .m-top .style-slot { margin-left: auto; }
}
@media (max-width: 379px) {
  .m-top { gap: 6px; padding: 0 10px 0 12px; }
  .m-top .style-slot .pks__icon { display: block; }
  .m-top .style-slot .pks__text { display: none; }
  .m-top .style-slot .pks__opt { width: 32px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation-duration: 0.01ms !important; }
}
