/* ============================================
   FRIXION — style.css
   Discord-style client, theme-driven via CSS vars
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Discord's UI chrome isn't selectable — dragging across buttons, names,
   and labels shouldn't highlight text. Message content, bios, notes, and
   anything you'd actually type into stay selectable. */
* { user-select: none; -webkit-user-select: none; -moz-user-select: none; }
input, textarea,
.msg-text, .native-emoji, .pinned-row .pr-text, .code-display,
.profile-section, .profile-username, .mfc-name,
.ue-notes li, .help-row, .toast,
/* more of what people read can be selected and copied (v4.62): names on messages, replies, system lines, topics,
   profile details, and the text in Settings */
.msg-meta .author, .mrr-user, .mrr-text, .sys-text, .chat-topic, .profile-handle, .profile-pronouns,
.settings-pane p, .settings-pane li, .setting-row-desc, .sic-desc {
  user-select: text; -webkit-user-select: text; -moz-user-select: text;
}

:root {
  /* ---- default "Frixion Dark" theme ---- */
  --bg-deepest: #1e1f22;      /* server rail */
  --bg-secondary: #2b2d31;    /* channel/dm sidebar */
  --bg-primary: #313338;      /* chat / main content */
  --bg-floating: #1e1f22;     /* modals, popouts */
  --bg-tertiary: #232428;     /* user controls / settings navigation */
  --bg-input: #383a40;
  --bg-modifier-hover: rgba(78,80,88,.35);
  --bg-modifier-selected: rgba(78,80,88,.6);
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-soft: rgba(88,101,242,.15);
  --premium-grad: linear-gradient(135deg,#f4a4ff,#5865f2);
  --text-normal: #f2f3f5;
  --text-muted: #949ba4;
  --text-faint: #6d6f78;
  --text-link: #00a8fc;
  --online: #23a55a;
  --idle: #f0b232;
  --dnd: #f23f42;
  --offline: #80848e;
  --danger: #da373c;
  --danger-hover: #a12828;
  --divider: rgba(255,255,255,.06);
  --scrollbar-thumb: #1a1b1e;
  --message-hover: rgba(0,0,0,.08);
  --shadow-color: rgba(0,0,0,.48);
  --font: 'Inter', 'gg sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ---- Shop Themes (ported from Toblox) — a separate, independent layer on
   top of whichever Settings > Themes class is active. Applying one sets
   --shop-theme-bg plus overrides for the core bg/accent variables directly
   via inline styles on <body> itself (see applyShopTheme in script.js) —
   these used to live on <html> instead, which looked right ("inline
   beats a class selector") but wasn't: those same variables are also set
   by body.theme-light/ash/onyx below, and for custom properties, the
   element CLOSEST to whatever's reading the value wins the inheritance
   regardless of inline vs. class. Body is closer than html is, so with
   any Settings theme other than Dark active, body's own class-based
   value was silently shadowing the override before it ever reached
   anything — shop themes only ever worked while Dark (which adds no
   class to body at all) was the active Settings theme. Putting the
   override on body itself, the same element the class rules are on,
   makes inline-beats-class actually apply.
   The animated gradient itself lives on a fixed ::before layer (not
   <body> directly) so hue-rotating it never turns fixed sidebars/topbars
   into scrolling elements.
   That gradient layer only shows up at all because applyShopTheme sets
   the panel bg variables to translucent rgba() rather than flat opaque
   hex — #server-rail/#side-panel/#main-col tile the full viewport with
   no gaps, so with fully opaque panels (as this used to be) the gradient
   was rendered but permanently hidden behind them regardless of z-index;
   confirmed by literally sampling rendered pixels, which showed zero
   trace of the gradient's third color stop. */
body.shop-theme-active::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--shop-theme-bg);
}
body.shop-anim-hue::before, body.shop-anim-holo::before, body.shop-anim-aurora::before {
  animation: shopThemeHueRot 6s linear infinite;
}
body.shop-anim-holo::before { animation-duration: 5s; filter: saturate(1.4); }
body.shop-anim-aurora::before { animation-duration: 9s; }
@keyframes shopThemeHueRot { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

/* ---- Other Discord appearance themes, applied as a class on <body> ---- */
/* Light: white background, dark grey text */
body.theme-light {
  --bg-deepest: #e3e5e8; --bg-secondary: #f2f3f5; --bg-primary: #ffffff;
  --bg-floating: #ffffff; --bg-tertiary: #e3e5e8; --bg-input: #ebedef;
  --bg-modifier-hover: rgba(0,0,0,.04); --bg-modifier-selected: rgba(0,0,0,.07);
  --accent-soft: rgba(88,101,242,.12);
  --text-normal: #060607; --text-muted: #5c5e66; --text-faint: #87898c; --text-link: #006ce7;
  --divider: rgba(0,0,0,.09); --scrollbar-thumb: rgba(0,0,0,.22);
  --message-hover: rgba(6,6,7,.045); --shadow-color: rgba(0,0,0,.16);
}
/* Ash: mid-gray background, white text (Premium) */
body.theme-ash {
  --bg-deepest: #3f4147; --bg-secondary: #44474e; --bg-primary: #4a4d55; --bg-input: #54575f;
  --bg-floating: #3a3c42; --bg-tertiary: #3a3c42;
}
/* Onyx: gray and black background, white text (Premium) */
body.theme-onyx {
  --bg-deepest: #0a0a0b; --bg-secondary: #111113; --bg-primary: #18181a; --bg-input: #202023;
  --bg-floating: #0a0a0b; --bg-tertiary: #0a0a0b;
}

html, body {
  /* Mobile/tablet browsers don't always resize the layout viewport for the
     software keyboard — script.js keeps --mobile-viewport-height in sync
     with the actual visible viewport on touch devices (see
     syncMobileViewport), so the composer stays docked right above the
     keyboard instead of being covered by it or leaving a gap. On desktop
     the variable is never set, so this just falls back to 100dvh. */
  height: var(--mobile-viewport-height, 100dvh);
  min-height: var(--mobile-viewport-height, 100dvh);
  font-family: var(--font);
  background: var(--bg-deepest);
  color: var(--text-normal);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Block pinch-zoom and double-tap-zoom on touch devices. Panning (scroll
     lists, drag-to-reorder, etc.) stays allowed — only the zoom gestures
     are excluded. The viewport meta tag's user-scalable=no covers older
     browsers; this covers modern ones that ignore that. */
  touch-action: pan-x pan-y;
}
body { display: flex; flex-direction: column; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
a { color: var(--text-link); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* ============ TITLE BAR (desktop-app style, matches the app's window chrome) ============ */
#title-bar {
  height: 32px; flex-shrink: 0; display: flex; align-items: center;
  background: var(--bg-deepest); border-bottom: 1px solid var(--divider);
  padding: 0 8px 0 12px; -webkit-app-region: drag; user-select: none; position: relative; z-index: 60;
}
.tb-left { display: flex; align-items: center; gap: 6px; }
.tb-brand-mark { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tb-brand-word { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .2px; }
.tb-drag { flex: 1; height: 100%; }
.tb-right { display: flex; align-items: center; gap: 2px; -webkit-app-region: no-drag; }
.tb-icon-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--text-muted); }
.tb-icon-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.tb-sep { width: 1px; height: 16px; background: var(--divider); margin: 0 6px; }
.tb-win-btn { width: 30px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); border-radius: 3px; }
.tb-win-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.tb-win-btn.tb-close:hover { background: var(--danger); color: #fff; }

/* inbox / help popovers anchored under the title bar */
#inbox-popover, #help-popover {
  position: fixed; top: 36px; right: 8px; width: 300px; background: var(--bg-floating);
  border-radius: 8px; box-shadow: 0 8px 30px var(--shadow-color); z-index: 70; padding: 16px;
}
.ip-head { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.ip-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 8px 8px; color: var(--text-muted); }
.ip-empty svg { color: var(--online); margin-bottom: 4px; }
.ip-empty-t { color: var(--text-normal); font-weight: 600; font-size: 14px; }
.ip-empty-d { font-size: 12.5px; }
.help-rows { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.help-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.help-row kbd { background: var(--bg-input); border: 1px solid var(--divider); border-radius: 4px; padding: 2px 6px; font-size: 11px; font-family: inherit; color: var(--text-normal); }
.help-foot { font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--divider); padding-top: 10px; }

#page-body { flex: 1; min-height: 0; position: relative; }

/* ============ BOOT SPLASH ============ */
#boot-screen {
  position: fixed; inset: 0; z-index: 500; background: var(--bg-deepest);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.boot-mark {
  width: 56px; height: 56px; border-radius: 16px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
/* after 12 seconds on the boot screen (v4.70) */
.boot-slow { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 280px; text-align: center; color: var(--text-muted); font-size: 14px; }
.boot-slow.hidden { display: none; }
.boot-slow button { padding: 8px 18px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--bg-input); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
.spinner.small { width: 16px; height: 16px; border-width: 2px; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

#loading-view {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.msg-loading { flex: 1; display: flex; align-items: center; justify-content: center; }

/* ============ AUTH SCREEN ============ */
#auth-screen {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, var(--accent-soft), transparent 42%),
    radial-gradient(circle at 82% 78%, var(--accent-soft), transparent 42%),
    var(--bg-deepest);
}
.auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-mark svg { display: block; }
.brand-word { font-size: 20px; font-weight: 800; letter-spacing: .1px; color: var(--text-normal); }
.auth-card h1 { font-size: 21px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-card p.sub { color: var(--text-muted); text-align: center; font-size: 14px; margin-bottom: 20px; line-height: 1.4; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-row.compact { margin: 10px 0; }
.setting-row-text { flex: 1; }
.setting-row-title { font-size: 15px; font-weight: 500; color: var(--text-normal); margin-bottom: 2px; }
.setting-row-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
/* Quick Text list in Settings → Keyboard */
#quicktext-list { display: flex; flex-direction: column; gap: 8px; }
.quicktext-row { display: flex; align-items: center; gap: 8px; }
.quicktext-row .quicktext-input {
  flex: 1; padding: 9px 11px; border-radius: 4px; border: none;
  background: var(--bg-input); color: var(--text-normal); font-size: 14px; outline: none; font-family: inherit;
}
.quicktext-row .quicktext-input:focus { box-shadow: 0 0 0 2px var(--accent); }
.quicktext-remove {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 4px; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.quicktext-remove:hover { background: var(--bg-modifier-selected); color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 4px; border: none;
  background: var(--bg-input); color: var(--text-normal); font-size: 15px; outline: none;
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: 0 0 0 2px var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.btn-primary {
  width: 100%; background: var(--accent); color: #fff; padding: 11px; border-radius: 4px;
  font-weight: 600; font-size: 15px; transition: background .12s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.auth-switch { margin-top: 14px; font-size: 14px; color: var(--text-muted); text-align: center; }
.auth-switch a { cursor: pointer; }
.auth-error { color: #f87171; font-size: 13px; margin-bottom: 12px; min-height: 16px; }
.auth-hint { margin: -4px 0 14px; font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
/* App Check uses reCAPTCHA: Google allows hiding its corner badge when this line is shown where people sign in */
.recaptcha-note { display: none; margin: 16px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--text-muted); text-align: center; }
.recaptcha-note a { color: inherit; text-decoration: underline; }
.has-recaptcha .recaptcha-note { display: block; }
.grecaptcha-badge { visibility: hidden !important; }
/* Settings > My Account: how you sign in */
.account-signin { margin: 4px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.account-signin .as-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; background: var(--bg-secondary); }
.account-signin .as-row svg { width: 18px; height: 18px; flex: none; }
.account-signin .as-warn { background: rgba(240, 178, 50, .14); box-shadow: inset 3px 0 0 var(--idle); }   /* only had Google: set a password */
.account-signin .as-text { flex: 1; min-width: 0; font-size: 14px; }
.account-signin .as-text small { display: block; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.account-signin .as-form { display: flex; gap: 8px; flex-wrap: wrap; }
.account-signin .as-form input { flex: 1; min-width: 160px; }
.account-signin .as-msg { font-size: 13px; color: var(--text-muted); min-height: 16px; }

/* ============ APP LAYOUT ============ */
#app {
  height: 100%;
  display: grid;
  grid-template-columns: 72px 240px 1fr;
  grid-template-rows: 100%;
}
#app.member-list-open { grid-template-columns: 72px 240px 1fr 240px; }

/* ---- server rail ---- */
#server-rail {
  background: var(--bg-deepest);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 8px; overflow-y: auto;
}
/* the servers get the same 8px gap as everything else in the rail (they were touching) */
#server-rail-list { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-item {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px;
  position: relative; transition: border-radius .15s ease, background .15s ease; flex-shrink: 0;
}
.rail-item::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text-normal); opacity: 0;
  transition: height .15s ease, opacity .15s ease;
}
.rail-item:hover::before { height: 20px; opacity: 1; }
.rail-item.active::before, .rail-item.dm-item.active::before { height: 40px; opacity: 1; }
.rail-item:hover, .rail-item.active { border-radius: 16px; background: var(--accent); color: #fff; }
.rail-divider { width: 32px; height: 2px; background: var(--divider); border-radius: 1px; margin: 4px 0; }
.rail-item.action { color: var(--online); }
.rail-item.action:hover { color: #fff; background: var(--online); }
.rail-item.explore-btn { color: var(--text-muted); }
.rail-item.explore-btn:hover { color: #fff; background: var(--accent); }

/* ---- second column: channel/dm sidebar ---- */
#side-panel { background: var(--bg-secondary); display: flex; flex-direction: column; min-width: 0; }
#side-header {
  height: 48px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; box-shadow: 0 1px 0 var(--divider); flex-shrink: 0; font-weight: 700; font-size: 15px;
  cursor: pointer;
}
#side-header:hover { background: var(--bg-modifier-hover); }
#channel-list, #dm-list { flex: 1; overflow-y: auto; padding: 8px; }
.side-section-label {
  font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  padding: 12px 8px 4px; letter-spacing: .3px; display: flex; justify-content: space-between; align-items: center;
}
.channel-row, .dm-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px; margin-bottom: 2px;
  color: var(--text-muted); font-size: 15px; font-weight: 500; cursor: pointer; position: relative;
}
.channel-row:hover, .dm-row:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.channel-row.active, .dm-row.active { background: var(--bg-modifier-selected); color: var(--text-normal); }
.channel-row .hash { opacity: .7; font-size: 18px; font-weight: 400; }
.channel-row .channel-lock-icon { color: var(--text-faint); flex-shrink: 0; display: flex; }
.channel-row .channel-lock-icon svg { width: 12px; height: 12px; }
.channel-row .channel-perms-btn { margin-left: auto; opacity: 0; font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.channel-row:hover .channel-perms-btn { opacity: 1; }
.channel-row .channel-perms-btn:hover { color: var(--text-normal); }
.channel-row .del-channel { opacity: 0; font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.channel-row:hover .del-channel { opacity: 1; }
.channel-row .del-channel:hover { color: var(--danger); }

/* ---- role list drag-and-drop ---- */
.role-list-row.dragging { opacity: .4; }
.role-list-row.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; }

.dm-row { padding: 9px 8px; margin-bottom: 6px; gap: 10px; }
.dm-row.has-nameplate { overflow: hidden; }
.dm-row-nameplate-bg { position: absolute; inset: 0; z-index: 0; }
.dm-row.has-nameplate .avatar, .dm-row.has-nameplate .dm-copy { position: relative; z-index: 1; }
.dm-row.has-nameplate .dm-name { color: #fff; }
.dm-row.has-nameplate .dm-preview { color: rgba(255,255,255,.7); }
.dm-row .avatar { width: 32px; height: 32px; }
.dm-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dm-row .dm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-preview { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-faint); font-size: 12px; line-height: 1.25; }

/* user panel (bottom-left) */
#user-panel {
  height: 54px; background: var(--bg-tertiary); display: flex; align-items: center; gap: 8px;
  padding: 0 8px; flex-shrink: 0;
}
#user-panel .avatar { width: 32px; height: 32px; }
#user-panel .who { flex: 1; min-width: 0; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
#user-panel .who:hover { background: var(--bg-modifier-hover); }
#user-panel .uname { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display:flex; align-items:center; gap:4px;}
#user-panel .utag { font-size: 12px; color: var(--text-muted); }
#user-panel .icon-btn { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
#user-panel .icon-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }

/* ---- avatars ---- */
.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0; position: relative; user-select: none;
  /* No overflow:hidden here on purpose: the img below clips itself (it has its
     own border-radius), and keeping this box unclipped means the status dot
     (positioned right at the corner) renders as a full circle instead of
     getting sliced by this element's own circular clip path. */
}
.avatar.has-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar .status-dot {
  /* Size and position are set inline per-avatar (see avatarHTML in script.js) so
     they scale correctly with whatever size that avatar is rendered at. The
     avatar itself gets a mask cutout so this dot always sits on a clean punched
     hole instead of a border trying to guess the background color.
     z-index higher than .avatar-decoration below — presence should always
     stay visible no matter what decoration is equipped, not get buried
     under one that happens to extend into that corner. */
  position: absolute; border-radius: 50%; z-index: 3;
}
.status-dot.online { background: var(--online); }
.status-dot.idle { background: var(--idle); }
.status-dot.dnd { background: var(--dnd); }
/* Do Not Disturb (v4.60): the red dot gets its white bar across the middle */
.status-dot.dnd:not(.mobile)::after { content: ''; position: absolute; left: 22%; right: 22%; top: 50%; height: 26%; min-height: 2px;
  transform: translateY(-50%); background: #fff; border-radius: 2px; }
.status-dot.offline { background: var(--offline); }
/* Typing (v4.62): in the DM list, the status dot becomes a pill of three bouncing dots while that person types to you,
   like Discord. Size and spot are set inline (avatarHTML); a group's picture gets a smaller fixed one. */
.status-dot.typing { border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 9%; padding: 0 13%; }
.status-dot.typing i { display: block; flex: 0 0 auto; width: 24%; aspect-ratio: 1; border-radius: 50%; background: #fff; animation: statusTyping 1.2s ease-in-out infinite; }
.status-dot.typing i:nth-child(2) { animation-delay: .18s; }
.status-dot.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes statusTyping { 0%, 60%, 100% { opacity: .45; transform: translateY(0) scale(.85); } 30% { opacity: 1; transform: translateY(-18%) scale(1); } }
.group-avatar { position: relative; }
.group-avatar.has-image { background: transparent; }
.group-avatar.has-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.status-dot.group-typing { position: absolute; right: -4px; bottom: -3px; width: 22px; height: 11px; z-index: 3;
  box-shadow: 0 0 0 2.5px var(--bg-secondary); }
.edit-group-pic-row { display: flex; align-items: center; gap: 16px; margin: 6px 0 16px; }
.edit-group-pic-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
#edit-group-pic .group-avatar .i { width: 30px; height: 30px; }
.avatar-decoration {
  /* Sized/positioned inline per-avatar (see decorationOverlayHTML in
     script.js) so it scales and centers correctly at whatever size that
     avatar renders at — deliberately oversized relative to the avatar
     itself and allowed to extend past its circle. */
  position: absolute; pointer-events: none; z-index: 2;
}
.avatar-decoration svg, .avatar-decoration img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* ---- main chat column ---- */
#main-col { display: flex; flex-direction: column; min-width: 0; background: var(--bg-primary); }
#chat-header {
  height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  box-shadow: 0 1px 0 var(--divider); flex-shrink: 0;
}
#chat-header .hash { font-size: 22px; color: var(--text-muted); }
#chat-header .title { font-weight: 700; font-size: 15px; }
.mobile-back-btn { display: none; align-items: center; justify-content: center; width: 28px; height: 28px; color: var(--text-muted); border-radius: 4px; flex-shrink: 0; cursor: pointer; }
.mobile-back-btn:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
.chat-header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.hdr-icon-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 4px; color: var(--text-muted); cursor: pointer; }
.hdr-icon-btn:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
.hdr-icon-btn.on { color: var(--text-normal); }
#chat-header .members-toggle { color: var(--text-muted); display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; }
#chat-header .members-toggle:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }

#search-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--bg-input);
  margin: 10px 16px 0; border-radius: 4px; color: var(--text-muted); flex-shrink: 0;
}
#search-bar input { flex: 1; background: none; border: none; outline: none; color: var(--text-normal); font-size: 14px; }
#search-bar input::placeholder { color: var(--text-faint); }
#search-count { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
#search-bar .hdr-icon-btn { width: 22px; height: 22px; font-size: 13px; }

#welcome-view {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted); gap: 10px; text-align: center; padding: 20px;
}
.welcome-icon {
  width: 76px; height: 76px; border-radius: 50%; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 6px;
}
#welcome-view h2 { color: var(--text-normal); font-size: 20px; font-weight: 700; }
#welcome-view p { font-size: 14px; max-width: 320px; }

#messages {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 0 8px;
  display: flex; flex-direction: column;
}
.msg-group { padding: 2px 16px; display: flex; gap: 16px; position: relative; }
.msg-group:hover { background: var(--message-hover); }
.msg-group .avatar { width: 40px; height: 40px; margin-top: 2px; cursor: pointer; }
.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-meta .author { font-weight: 600; font-size: 15px; cursor: pointer; }
.msg-meta .author:hover { text-decoration: underline; }
.msg-meta .author.own { color: var(--accent); }
.msg-meta .time { font-size: 11px; color: var(--text-faint); }
.msg-text { font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.edited-tag { font-size: 10px; color: var(--text-faint); margin-left: 4px; }
/* Reply reference — its own block sibling above .msg-row-wrap (not nested
   inside it), so it never shares row-wrap's flex-wrap context or competes
   with the hover toolbar. Everything here — icon included — stays inside
   the row's own normal bounds rather than reaching left into the avatar
   column: #messages scrolls vertically (overflow-y: auto) with no
   overflow-x set, and per spec that silently forces overflow-x to "auto"
   too, which clips off anything positioned to the left of a row's own
   edge. A negatively-positioned connector rendered there, but invisibly. */
.msg-reply-ref {
  display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-muted);
  margin: 0 0 3px 0; cursor: pointer; min-width: 0;
}
.msg-reply-ref .reply-corner-icon { display: inline-flex; flex-shrink: 0; color: var(--text-faint); }
.msg-reply-ref .reply-corner-icon svg { display: block; }
.msg-reply-ref:hover { color: var(--text-normal); }
.msg-reply-ref:hover .reply-corner-icon { color: var(--text-muted); }
.msg-reply-ref .reply-avatar { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.msg-reply-ref .mrr-user { font-weight: 600; color: var(--text-normal); flex-shrink: 0; font-size: 13px; }
.msg-reply-ref:hover .mrr-user { text-decoration: underline; }
.msg-reply-ref .mrr-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; min-width: 0; }
.msg-reply-ref:hover .mrr-text { opacity: 1; }
/* While editing, the row takes the whole width of the chat (the rows normally shrink to fit their content, which left the
   edit box only as wide as the old text, and made it jump around while the window was resized). v4.58 */
.msg-row-wrap.is-editing { display: flex; width: 100%; }
.msg-edit-box { width: 100%; flex: 1 1 100%; min-width: 0; }
.msg-edit-input {
  box-sizing: border-box; display: block; width: 100%; background: var(--bg-input); border: 1px solid var(--accent);
  border-radius: 6px; color: var(--text-normal); font-size: 15px; line-height: 1.4;
  padding: 8px 10px; resize: none; outline: none; font-family: inherit;
}
.msg-edit-hint { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.msg-edit-hint a { color: var(--accent); cursor: pointer; }
.msg-edit-hint a:hover { text-decoration: underline; }
@keyframes msgFlash { from { background: var(--accent-soft); } to { background: transparent; } }
.flash-highlight { animation: msgFlash 1.2s ease; border-radius: 6px; }
.msg-line { position: relative; }
/* Reserves room for the hover toolbar so it can never land on top of the
   message's own text — previously the toolbar was purely absolutely
   positioned with nothing accounting for its footprint, so a first line of
   text running close to the right edge would end up hidden underneath it
   while hovering. The toolbar's own position is unchanged (still flush with
   the row's top-right corner); this just stops content from ever reaching
   that corner in the first place. Costs a bit of wrap width on every
   message, which is the trade-off for the toolbar never covering anything. */
.msg-row-wrap { padding-right: 138px; }
/* Row content shrinks to fit (image, text, whatever it is) instead of
   stretching across the whole message column — that's what lets the
   hover toolbar below sit right next to the actual content instead of
   drifting off to the far right of a mostly-empty row. min-width keeps
   very short messages (a single short word, say) wide enough that the
   toolbar still has room to sit within the row instead of overhanging
   off its left edge into the username line above. */
.msg-row-wrap { position: relative; display: inline-flex; max-width: 100%; min-width: 138px; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
/* Pinned highlight: treat text vs. media differently. Plain text turns
   gold rather than getting boxed in, and media (images/GIFs/stickers/
   files) gets a border that hugs its own exact edges via a negative
   outline-offset, so the highlight can never bleed upward into the
   username line sitting above the message. */
.msg-line.is-pinned .msg-text { color: #f0b132; }
.msg-line.is-pinned .msg-attachment img,
.msg-line.is-pinned .msg-sticker {
  outline: 2px solid #f0b132;
  outline-offset: -2px;
  border-radius: 8px;
}
.msg-line.is-pinned .msg-file-card {
  outline: 2px solid #f0b132;
  outline-offset: -2px;
  background: rgba(240, 177, 50, .07);
}
/* top: 0 keeps the toolbar's top edge flush with its own row's top edge
   instead of floating above it — reaching upward (even a little) was
   what let it land on top of the username line for the first message in
   a group, or the previous message's text for a grouped one directly
   below it. This way it only ever overlaps its own row, never a
   different line. */
.msg-hover-actions {
  display: none; position: absolute; top: 0; right: 0; align-items: center; gap: 1px;
  background: var(--bg-primary); border: 1px solid var(--divider); border-radius: 8px;
  padding: 3px; box-shadow: 0 2px 10px var(--shadow-color); z-index: 6;
}
.msg-line:hover .msg-hover-actions { display: inline-flex; }
.hover-icon-btn { display: inline-flex; cursor: pointer; color: var(--text-muted); padding: 5px; border-radius: 4px; }
.hover-icon-btn:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
.hover-icon-btn.del-msg:hover { color: var(--danger); }
.hover-icon-btn.pin-msg.on { color: var(--accent); }
.custom-emoji { height: 1.375em; width: auto; vertical-align: -0.4em; margin: 0 1px; }
.native-emoji { font-size: 1.1em; }

.reaction-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.reaction-pill {
  display: inline-flex; align-items: center; gap: 5px; background: var(--bg-input);
  border: 1px solid transparent; border-radius: 10px; padding: 2px 8px; font-size: 13px; cursor: pointer;
}
.reaction-pill:hover { border-color: var(--text-faint); }
.reaction-pill.mine { background: var(--accent-soft); border-color: var(--accent); }
.reaction-pill span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.reaction-emoji-img { width: 16px; height: 16px; object-fit: contain; }

.react-popover {
  position: fixed; z-index: 200; background: var(--bg-floating); border-radius: 8px;
  padding: 6px; display: flex; gap: 2px; box-shadow: 0 4px 20px var(--shadow-color);
}
.react-pick { font-size: 20px; padding: 5px; border-radius: 6px; line-height: 1; }
.react-pick:hover { background: var(--bg-modifier-hover); }
.full-react-popover {
  flex-direction: column; gap: 0; padding: 10px 10px 0; overflow: hidden;
}
.full-react-popover .ep-search input { margin-bottom: 8px; }
.full-react-popover .ep-scroll { max-height: none; flex: 1; overflow-y: auto; padding-bottom: 10px; }

/* ---- mobile long-press message action sheet ---- */
.action-sheet-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: sheetFadeIn .15s ease;
}
@keyframes sheetFadeIn { from { opacity: 0; } to { opacity: 1; } }
.action-sheet {
  width: 100%; max-width: 480px; background: var(--bg-floating); border-radius: 14px 14px 0 0;
  padding: 14px 8px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 24px var(--shadow-color); animation: sheetSlideUp .18s ease;
}
@keyframes sheetSlideUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.as-quick-react {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  background: var(--bg-input); border-radius: 24px; padding: 6px 10px; margin: 0 6px 12px;
}
.as-quick-emoji {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  font-size: 20px; border-radius: 50%; line-height: 1; color: var(--text-muted);
}
.as-quick-emoji:hover, .as-quick-emoji:active { background: var(--bg-modifier-hover); }
.as-quick-emoji.as-more-react .i svg { width: 16px; height: 16px; }
.as-actions { display: flex; flex-direction: column; }
.as-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 8px; font-size: 15px; color: var(--text-normal);
}
.as-item:hover, .as-item:active { background: var(--bg-modifier-hover); }
.as-item .i svg { width: 18px; height: 18px; }
.as-item.as-danger { color: var(--danger); }
body.action-sheet-open { overflow: hidden; }

.day-divider { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 12px; font-weight: 600; margin: 16px 16px 8px; }
.day-divider::before, .day-divider::after { content: ''; flex: 1; height: 1px; background: var(--divider); }

#composer-wrap { padding: 0 16px 24px; flex-shrink: 0; position: relative; }
/* :empty + visibility:hidden (not display:none) reserves the row's height
   always, so it never shifts the composer up when someone starts/stops
   typing. */
.typing-indicator {
  min-height: 20px; padding: 0 16px; margin-bottom: 4px;
  font-size: 13px; color: var(--text-muted); font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.typing-indicator:empty { visibility: hidden; }
.typing-dots { display: inline-flex; gap: 2px; }
.typing-dots span {
  width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
#reply-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg-input); border-radius: 8px 8px 0 0; padding: 8px 12px;
  font-size: 13px; color: var(--text-muted); margin-bottom: -1px;
}
#reply-bar.hidden { display: none; }
#reply-bar .rb-text b { color: var(--text-normal); }
#reply-bar .rb-close { cursor: pointer; color: var(--text-muted); font-size: 14px; padding: 2px 4px; border-radius: 4px; }
#reply-bar .rb-close:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
#composer {
  background: var(--bg-input); border-radius: 8px; display: flex; align-items: center;
  padding: 0 12px; gap: 4px; min-height: 44px; position: relative;
}
#composer textarea {
  flex: 1; background: none; border: none; outline: none; resize: none; max-height: 200px;
  font-size: 15px; line-height: 1.4; color: var(--text-normal); padding: 11px 4px;
}
#composer textarea::placeholder { color: var(--text-faint); }
/* Absolutely positioned so it never changes #composer's own height/layout
   when it appears or disappears — that height-jump was the original bug. */
.composer-char-count {
  position: absolute; right: 10px; bottom: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-faint);
  background: var(--bg-input); padding: 1px 6px; border-radius: 8px;
  pointer-events: none; line-height: 1.6;
}
.composer-char-count.over-limit { color: #fff; background: #da373c; }
.composer-right-icons { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
/* The field wrapper only takes shape on a phone; here its parts sit in the bar as before, the gift button with the icons on the right. */
.composer-field { display: contents; }
#composer > #gift-btn { order: 1; margin-right: -2px; }
#composer .composer-right-icons { order: 2; }
.composer-send-btn { display: none; }
.composer-icon-btn {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  color: var(--text-muted); border-radius: 6px; flex-shrink: 0; font-size: 11px; font-weight: 800;
}
.composer-icon-btn:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
.composer-icon-btn svg { display: block; }
#gift-btn.hidden { display: none; }

/* ---- custom on-screen keyboard (mobile composer, edit box, and any wired search field) ---- */
#custom-keyboard {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  margin-top: 8px; background: var(--bg-deepest); border-radius: 10px;
  user-select: none; -webkit-user-select: none;
}
#custom-keyboard.hidden { display: none; }
.ck-row { display: flex; gap: 5px; }
.ck-tool-row { gap: 6px; padding: 0 2px 2px; }
.ck-key.ck-tool {
  flex: 1; height: 30px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-input); border-radius: 5px; box-shadow: none;
}
.ck-key.ck-tool:active { background: var(--bg-modifier-hover); color: var(--text-normal); }
.ck-key {
  flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); color: var(--text-normal); border-radius: 6px;
  font-size: 16px; font-weight: 500; box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.ck-key:active { background: var(--bg-modifier-hover); transform: translateY(1px); }
.ck-key.ck-wide { flex: 1.6; font-size: 13px; }
.ck-key .i svg { width: 18px; height: 18px; display: block; }
.ck-shift.on, .ck-shift.caps { color: var(--accent); }
.ck-shift.caps { background: var(--accent-soft, rgba(88,101,242,.18)); }
.ck-bottom-row { align-items: stretch; }
.ck-key.ck-tag { flex: 1; font-size: 13px; font-weight: 700; }
.ck-key.ck-tag.on { color: var(--accent); background: var(--accent-soft, rgba(88,101,242,.18)); }
.ck-key.ck-space { flex: 4; font-size: 13px; color: var(--text-muted); }
.ck-key.ck-enter { flex: 1.4; background: var(--accent); color: #fff; }
.ck-key.ck-enter:active { background: var(--accent-hover); }
.ck-key.ck-enter .i svg { width: 17px; height: 17px; }
/* the keyboard's own emoji page (tapping the smiley key swaps in these
   rows in place, same shell as letters/symbols, instead of hiding the
   keyboard and popping the separate floating emoji-picker-panel open) */
.ck-emoji-scroll { max-height: 148px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.ck-emoji-key { font-size: 20px; }
.ck-emoji-key img { width: 22px; height: 22px; object-fit: contain; display: block; }
/* the popover the keyboard's own "Quick Text" tool-row button opens */
.ck-quicktext-popover {
  position: fixed; z-index: 250; background: var(--bg-floating); border-radius: 8px; padding: 6px;
  box-shadow: 0 8px 30px var(--shadow-color); display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow-y: auto;
}
.ck-qt-item {
  text-align: left; padding: 9px 10px; border-radius: 4px; font-size: 14px; color: var(--text-normal);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ck-qt-item:hover { background: var(--bg-modifier-hover); }
.ck-qt-empty { padding: 10px; font-size: 13px; color: var(--text-muted); max-width: 240px; }
/* the tap-feedback / long-press-for-alternates bubble above a key */
.ck-press-bubble {
  position: fixed; z-index: 260; display: flex; background: var(--bg-floating);
  border-radius: 8px; box-shadow: 0 4px 14px var(--shadow-color); padding: 4px; pointer-events: none;
}
.ck-press-char {
  min-width: 30px; height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; color: var(--text-normal); border-radius: 6px; padding: 0 4px;
}
.ck-press-char.active { background: var(--accent); color: #fff; }

/* Custom blinking cursor — readOnly fields don't reliably show a
   native caret, so this is drawn separately and positioned via JS
   (measureCaretOffset/positionCkCursor) to track wherever the
   selection currently is in whichever field is active. */
#ck-cursor {
  position: fixed; display: none; width: 2px; background: var(--accent);
  z-index: 250; pointer-events: none; border-radius: 1px;
}
#ck-cursor.ck-blink { animation: ckCursorBlink 1s step-end infinite; }
@keyframes ckCursorBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
/* "Select All" visual feedback on whichever field is targeted */
.ck-all-selected { background: var(--accent-soft, rgba(88,101,242,.25)) !important; }

/* ---- "+" button menu: upload a file / create a poll ---- */
/* Anchored to the left, matching where the attach button sits. */
.composer-action-menu {
  position: absolute; bottom: 74px; left: 16px; width: 300px;
  background: var(--bg-floating); border-radius: 8px; padding: 6px; box-shadow: 0 8px 30px var(--shadow-color); z-index: 50;
  display: flex; flex-direction: column; gap: 2px;
}
.composer-action-menu button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 6px;
  color: var(--text-normal); font-size: 16px; font-weight: 500; text-align: left;
}
.composer-action-menu button span:first-child {
  width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 17px;
}
.composer-action-menu button:hover:not(:disabled) { background: var(--bg-modifier-hover); }
.composer-action-menu button:hover:not(:disabled) span:first-child { color: var(--text-normal); }
.composer-action-menu button:disabled { color: var(--text-faint); cursor: default; }
.composer-action-menu button small {
  margin-left: auto; background: var(--bg-modifier-selected); color: var(--text-muted); font-size: 10px;
  font-weight: 700; text-transform: uppercase; padding: 2px 5px; border-radius: 3px;
}

/* ---- emoji picker popover above composer ---- */
/* Anchored to the right, matching where the emoji/GIF/sticker buttons
   actually sit in the composer, instead of popping up over on the left. */
#emoji-picker-panel {
  position: absolute; bottom: 74px; right: 16px; width: 340px; max-width: calc(100% - 32px);
  background: var(--bg-floating); border-radius: 8px; padding: 12px 12px 0; box-shadow: 0 8px 30px var(--shadow-color); z-index: 50;
  display: flex; flex-direction: column;
}
/* Reused for picking a poll answer's emoji — floats near the answer row's
   emoji button, above the poll modal, instead of its usual composer spot. */
#emoji-picker-panel.ep-anchored { position: fixed; bottom: auto; right: auto; z-index: 220; }
.ep-poll-clear { margin-bottom: 8px; }
.ep-poll-clear button {
  width: 100%; text-align: left; font-size: 12px; color: var(--text-muted); padding: 6px 8px;
  border-radius: 4px; background: var(--bg-input);
}
.ep-poll-clear button:hover { color: var(--danger); }
.ep-search input {
  width: 100%; padding: 8px 10px; border-radius: 4px; border: none; background: var(--bg-input);
  color: var(--text-normal); font-size: 14px; outline: none; margin-bottom: 10px;
}
.ep-cats { display: flex; gap: 2px; border-bottom: 1px solid var(--divider); padding-bottom: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ep-cat-btn { font-size: 16px; padding: 4px 6px; border-radius: 6px; line-height: 1; }
.ep-cat-btn:hover { background: var(--bg-modifier-hover); }
.ep-scroll { max-height: 240px; overflow-y: auto; padding-bottom: 10px; }
.ep-section-label { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin: 8px 0 6px; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ep-grid button { display: flex; align-items: center; justify-content: center; font-size: 20px; height: 32px; padding: 0; border-radius: 6px; text-align: center; line-height: 1; }
.ep-grid button:hover { background: var(--bg-modifier-hover); }
.ep-grid img { width: 22px; height: 22px; object-fit: contain; }
.ep-empty { grid-column: 1 / -1; font-size: 12px; color: var(--text-faint); padding: 6px 2px; }

/* ---- member sidebar (3rd/4th col) ---- */
#member-panel { background: var(--bg-secondary); overflow-y: auto; padding: 16px 8px; display: none; }
#app.member-list-open #member-panel { display: block; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.member-row:hover { background: var(--bg-modifier-hover); }
.member-row .avatar { width: 32px; height: 32px; }
.member-row .mname { font-size: 15px; color: var(--text-muted); font-weight: 500; }
.member-row .mname.online-name { color: var(--text-normal); }
.member-row .premium-badge { font-size: 12px; }
.member-manage-btn {
  margin-left: auto; opacity: 0; width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.member-manage-btn svg { width: 14px; height: 14px; }
.member-row:hover .member-manage-btn { opacity: 1; }
.member-manage-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }

/* ---- role chips (member panel, message author line via inline color, role lists) ---- */
.role-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.role-chip .role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--role-color, #99aab5); flex-shrink: 0; }

/* ---- Server Settings: tabs ---- */
.ss-pane.hidden { display: none; }

/* ---- Server Settings: roles tab ---- */
.roles-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; min-height: 340px; }
.role-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.role-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 8px; border-radius: 4px; cursor: pointer;
}
.role-list-row:hover { background: var(--bg-modifier-hover); }
.role-list-row.on { background: var(--bg-modifier-selected); }
.role-reorder-btns { display: flex; flex-direction: column; gap: 0; flex-shrink: 0; }
.role-move-btn { font-size: 9px; line-height: 9px; color: var(--text-faint); cursor: pointer; padding: 1px 3px; }
.role-move-btn:hover { color: var(--text-normal); }
.role-editor-col { border-left: 1px solid var(--divider); padding-left: 20px; }
.role-editor-locked {
  background: var(--accent-soft, rgba(88,101,242,.12)); color: var(--text-normal);
  font-size: 13px; padding: 10px 12px; border-radius: 4px; margin-bottom: 14px;
}
.role-perm-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.role-perm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.role-perm-row:last-child { border-bottom: none; }
.role-perm-row input { flex-shrink: 0; }
.role-perm-row b { display: block; font-size: 13.5px; color: var(--text-normal); }
.role-perm-row small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.role-perm-row.locked { opacity: .5; cursor: default; }
label.role-perm-row { cursor: pointer; }

.role-list-row .role-list-count { font-size: 11px; color: var(--text-faint); margin-left: auto; flex-shrink: 0; }
.role-list-row .role-reorder-btns { margin-left: 6px; }

.role-editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.role-editor-swatch { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.role-editor-name-input {
  flex: 1; background: transparent; border: none; border-bottom: 1px solid var(--divider);
  font-size: 18px; font-weight: 700; color: var(--text-normal); padding: 4px 0; min-width: 0;
}
.role-editor-name-input:focus { outline: none; border-bottom-color: var(--accent); }
.role-editor-name-input:disabled { color: var(--text-muted); }

.re-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); margin-bottom: 16px; }
.re-tab { padding: 8px 2px; margin-right: 18px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; }
.re-tab.on { color: var(--text-normal); border-bottom-color: var(--accent); }
.re-pane.hidden { display: none; }

.role-color-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); margin-bottom: 8px; }
.role-color-palette { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; margin-bottom: 14px; }
.role-color-swatch { width: 100%; aspect-ratio: 1; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); transition: transform .1s ease; }
.role-color-swatch:hover { transform: scale(1.12); }
.role-color-swatch.on { box-shadow: 0 0 0 2px var(--bg-floating), 0 0 0 4px #fff; }

/* In normal document flow rather than pinned/sticky to the modal edge —
   a floating bar with negative-margin edge-bleed is fragile against
   layout changes elsewhere in this nested grid, and a plain bordered bar
   that appears right where the changes were made is just as clear. */
.re-unsaved-bar {
  margin-top: 20px; padding: 12px 16px; border-radius: 6px;
  background: #17181a; border: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; font-weight: 600; color: var(--text-normal);
}
.re-unsaved-bar.hidden { display: none; }
.re-unsaved-actions { display: flex; gap: 8px; flex-shrink: 0; }
.re-unsaved-actions button { border: none; border-radius: 4px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
#re-reset-btn { background: transparent; color: var(--text-muted); }
#re-reset-btn:hover { color: var(--text-normal); text-decoration: underline; }
#re-save-btn { background: #3ba55d; color: #fff; }
#re-save-btn:hover { background: #359151; }

.re-member-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; }
.re-member-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; font-size: 13.5px; color: var(--text-normal); }
.re-member-row:hover { background: var(--bg-modifier-hover); }
.re-member-row .avatar { flex-shrink: 0; }
.re-member-remove { margin-left: auto; color: var(--text-faint); cursor: pointer; flex-shrink: 0; display: flex; }
.re-member-remove:hover { color: var(--danger); }
.re-member-remove svg { width: 13px; height: 13px; }
label.re-member-addable { cursor: pointer; }
label.re-member-addable input[type="checkbox"] { margin-left: auto; }
.role-assign-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; max-height: 280px; overflow-y: auto; }

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center;
  justify-content: center; z-index: 100;
}
.modal-box {
  background: var(--bg-floating); border-radius: 10px; width: 580px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto; padding: 32px;
}
.modal-box.wide { width: 900px; }
.modal-box h2 { font-size: 24px; margin-bottom: 6px; }
.modal-box p.desc { color: var(--text-muted); font-size: 16px; line-height: 1.45; margin-bottom: 22px; }
.modal-close { position: absolute; }
.modal-header-row { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-header-row .x { color: var(--text-muted); font-size: 22px; cursor: pointer; }
.modal-header-row .x:hover { color: var(--text-normal); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-secondary { background: var(--bg-input); color: var(--text-normal); padding: 10px 18px; border-radius: 4px; font-weight: 600; }
.btn-secondary:hover { background: var(--bg-modifier-selected); }
.btn-danger { background: var(--danger); color: #fff; padding: 10px 18px; border-radius: 4px; font-weight: 600; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-accent-inline { background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 4px; font-weight: 600; }
.btn-accent-inline:hover { background: var(--accent-hover); }

/* (Gift Premium used to sit over on the right, by the composer's gift button. Since v4.66 it's in the middle like every
   other window: opened from a profile it looked lost off to the side, request 38.) */

/* ---- explore servers ---- */
.explore-server-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.explore-server-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg-secondary);
}
.explore-server-row .explore-server-icon {
  width: 44px; height: 44px; flex-shrink: 0; font-size: 16px; background: var(--bg-tertiary);
}
.explore-server-info { flex: 1; min-width: 0; }
.explore-server-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explore-server-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.explore-server-join { flex-shrink: 0; }
.explore-server-join.joined { background: transparent; border: 1px solid var(--bg-modifier-selected); }
.explore-server-join.joined:hover { background: var(--bg-modifier-hover); }
.explore-loading, .explore-empty { padding: 40px 0; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ---- create-a-poll modal ---- */
.poll-modal-box { width: 480px; }
.poll-modal-title { display: flex; align-items: center; gap: 10px; }
.poll-modal-icon { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.poll-char-count { text-align: right; font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.poll-answer-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.poll-answer-row { display: flex; align-items: center; gap: 8px; }
.poll-answer-row .poll-answer-input {
  flex: 1; padding: 10px 12px; border-radius: 6px; border: 1px solid transparent;
  background: var(--bg-input); color: var(--text-normal); font-size: 14px; outline: none; font-family: inherit;
  transition: border-color .1s ease;
}
.poll-answer-row .poll-answer-input:focus { border-color: var(--accent); }
.poll-answer-row .poll-answer-input::placeholder { color: var(--text-faint); }
.poll-answer-emoji-btn, .poll-answer-remove {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 16px; overflow: hidden;
  transition: background .1s ease, color .1s ease;
}
.poll-answer-emoji-btn img.custom-emoji { width: 18px; height: 18px; }
.poll-answer-emoji-btn:hover { background: var(--bg-modifier-selected); color: var(--text-normal); }
.poll-answer-remove:hover { background: var(--bg-modifier-selected); color: var(--danger); }
.poll-answer-remove.hidden { visibility: hidden; }
.poll-add-answer { width: 100%; text-align: center; }
.poll-multiple-row { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--divider); }

/* ---- poll message card (in the chat itself) ---- */
.poll-card {
  border: 1px solid var(--divider); border-radius: 8px; padding: 12px 14px; margin-top: 4px;
  max-width: 440px; background: var(--bg-secondary);
}
.poll-card-question {
  display: flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 15px;
  color: var(--text-normal); margin-bottom: 12px; line-height: 1.3;
}
.poll-card-question .i { flex-shrink: 0; margin-top: 1px; color: var(--text-muted); }
.poll-card-question .i svg { width: 17px; height: 17px; }
.poll-options { display: flex; flex-direction: column; gap: 6px; }
.poll-option {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 6px; border: 1px solid var(--bg-modifier-selected); overflow: hidden;
  background: var(--bg-primary); color: var(--text-normal); font-size: 14px; cursor: pointer;
}
.poll-option:hover:not(.locked) { border-color: var(--accent); }
.poll-option.voted { border-color: var(--accent); }
.poll-option.locked { cursor: default; }
.poll-option.winning { border-color: var(--online); }
.poll-option-fill {
  position: absolute; inset: 0; width: 0; background: var(--bg-modifier-selected);
  transition: width .25s ease; z-index: 0;
}
.poll-option.voted .poll-option-fill { background: var(--accent-soft, rgba(88,101,242,.25)); }
.poll-option.winning .poll-option-fill { background: rgba(35,165,90,.22); }
.poll-option-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.poll-option-check {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--text-muted);
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.poll-option.voted .poll-option-check { border-color: var(--accent); background: var(--accent); }
.poll-option-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-option-emoji { margin-right: 2px; }
.poll-option-emoji img.custom-emoji { width: 16px; height: 16px; vertical-align: -3px; }
.poll-option-pct { position: relative; z-index: 1; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.poll-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px;
  font-size: 12px; color: var(--text-muted);
}
.poll-multi-tag { font-style: italic; }

/* settings modal layout */
#settings-modal .modal-box { display: flex; padding: 0; width: min(1200px, 94vw); height: min(840px, 90vh); max-height: 90vh; }
#settings-nav { width: 290px; background: var(--bg-tertiary); padding: 32px 16px; flex-shrink: 0; overflow-y: auto; }
#settings-nav .nav-item { padding: 11px 14px; border-radius: 6px; color: var(--text-muted); font-weight: 600; font-size: 17px; cursor: pointer; margin-bottom: 2px; }
#settings-nav .nav-item:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
#settings-nav .nav-item.active { background: var(--bg-modifier-selected); color: var(--text-normal); }
#settings-nav .nav-label { font-size: 13px; text-transform: uppercase; color: var(--text-faint); font-weight: 700; padding: 18px 14px 6px; }
#settings-content { flex: 1; padding: 44px 60px; overflow-y: auto; position: relative; }
#settings-content h2 { font-size: 28px; margin-bottom: 24px; text-transform: uppercase; letter-spacing: .3px; }
.settings-close { position: absolute; top: 24px; right: 24px; }

/* ---- update log ---- */
.update-entry { padding: 16px 0; border-bottom: 1px solid var(--divider); }
.update-entry:last-child { border-bottom: none; }
.ue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ue-ver { background: var(--bg-input); color: var(--text-muted); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.ue-title { font-weight: 700; font-size: 15px; }
.ue-date { color: var(--text-faint); font-size: 12px; margin-left: auto; }
.ue-latest { background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; letter-spacing: .3px; }
.ue-notes { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ue-notes li { position: relative; padding-left: 16px; font-size: 14px; color: var(--text-muted); line-height: 1.45; }
.ue-notes li::before { content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }

/* ---- quests ---- */
.quest-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.quest-row:last-child { border-bottom: none; }
.quest-info { flex: 1; min-width: 0; }
.quest-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.quest-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.quest-bar { height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; margin-bottom: 4px; }
.quest-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s ease; }
.quest-progress { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.quest-reward { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.quest-claimed { font-size: 12px; color: var(--online); font-weight: 700; }
.quest-locked { font-size: 12px; color: var(--text-faint); }

.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; position: relative; }
.swatch.locked-swatch { filter: saturate(.35) brightness(.65); display: flex; align-items: center; justify-content: center; }
.swatch-lock { color: #fff; width: 13px; height: 13px; }
.swatch.selected { border-color: #fff; }
/* Premium (v4.56): mixing your own banner gradient, and a name in two colors */
.swatch-mix { display: flex; align-items: center; justify-content: center; }
.swatch-plus { color: #fff; font-weight: 800; font-size: 18px; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.grad-mix { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.grad-mix input[type="color"] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--border, rgba(255,255,255,.15)); border-radius: 6px; background: none; cursor: pointer; }
.grad-mix-note { font-size: 12px; opacity: .7; }
/* the name gradient's color boxes (2 to 8, v4.66) and its one-more / one-fewer buttons */
.grad-colors { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.grad-colors input[type="color"] { width: 30px !important; }
.grad-count-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border, rgba(255,255,255,.15)); background: var(--bg-tertiary); color: var(--text-primary); font: inherit; font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; }
.grad-count-btn:disabled { opacity: .35; cursor: default; }
.grad-name-preview { font-weight: 700; font-size: 15px; -webkit-background-clip: text; background-clip: text; color: transparent; }

.status-picker { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.status-opt { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 4px; cursor: pointer; }
.status-opt:hover { background: var(--bg-modifier-hover); }
.status-opt.selected { background: var(--bg-modifier-selected); }
.status-opt .dot { width: 10px; height: 10px; border-radius: 50%; }

/* premium modal */
.orb-balance-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.orb-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg-input); color: var(--text-normal);
  font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 20px;
}
.orb-chip svg, .orb-chip .i { color: #f0b232; width: 16px; height: 16px; }
.orb-chip.small { padding: 3px 9px; font-size: 12px; }
.orb-chip.small svg { width: 13px; height: 13px; }
.orb-hint { font-size: 12.5px; color: var(--text-muted); }

/* ============ SHOP ============ */
.shop-topbar {
  display: flex; align-items: center; gap: 18px; padding: 14px 20px;
  background: linear-gradient(180deg, #2b1418, #1a0d10);
  border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.35); position: relative; z-index: 2;
}
.shop-home-icon { color: #fff; opacity: .9; flex-shrink: 0; display: inline-flex; }
.shop-tabs { display: flex; align-items: center; gap: 4px; flex-shrink: 0; position: relative; }
.shop-tab {
  background: none; border: none; color: rgba(255,255,255,.6); font-size: 15px; font-weight: 600;
  padding: 8px 12px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.shop-tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.shop-tab.on { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 0 -2px 0 var(--accent); }
.shop-tab .caret { font-size: 11px; }
.shop-browse-wrap { position: relative; }
.shop-browse-menu {
  position: absolute; top: calc(100% + 4px); left: 0; background: var(--bg-floating);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.4); padding: 8px; min-width: 240px; z-index: 5;
}
.shop-browse-opt { padding: 11px 14px; border-radius: 6px; font-size: 16px; color: var(--text-normal); cursor: pointer; font-weight: 600; }
.shop-browse-opt:hover { background: var(--bg-modifier-hover); }
.shop-topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.shop-search {
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.08); color: #fff;
  font-size: 13px; padding: 7px 12px; border-radius: 20px; width: 180px; outline: none;
}
.shop-search::placeholder { color: rgba(255,255,255,.4); }
.shop-search:focus { border-color: var(--accent); }
.shop-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(0,0,0,.35); color: rgba(255,255,255,.75); cursor: pointer; flex-shrink: 0;
}
.shop-icon-btn:hover { color: #fff; background: rgba(0,0,0,.5); }
.shop-orb-chip { background: rgba(0,0,0,.35); color: #fff; flex-shrink: 0; }
.shop-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.shop-section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  color: var(--text-muted); margin: 22px 0 10px;
}
.shop-section-label:first-child { margin-top: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.theme-shop-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.shop-item-card {
  background: linear-gradient(160deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid rgba(255,255,255,.05); border-radius: 10px; padding: 16px 12px 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  height: 100%; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.shop-item-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.35); border-color: rgba(255,255,255,.12); }
/* Grid rows stretch every card in a row to the tallest one by default —
   pushing the button down with margin-top:auto instead of a fixed gap
   means it always lands on the same line across a row regardless of how
   many lines a given description wraps to. */
.sic-preview { pointer-events: none; width: 100%; }
.sic-name { font-size: 13.5px; font-weight: 600; color: var(--text-normal); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sic-desc { font-size: 11.5px; color: var(--text-muted); text-align: center; line-height: 1.3; margin: 2px 0 4px; }
.sic-animated-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 3px;
}
.sic-btn {
  width: 100%; margin-top: auto; border: none; border-radius: 6px; padding: 7px 0; cursor: pointer;
  font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--accent); color: #fff; flex-shrink: 0;
}
.sic-btn:hover { background: var(--accent-hover); }
.sic-btn.is-owned { background: var(--bg-modifier-hover); color: var(--text-normal); }
.sic-btn.is-owned:hover { background: var(--accent); color: #fff; }
.sic-btn.is-equipped { background: var(--bg-modifier-hover); color: var(--text-normal); }
.sic-btn.is-equipped:hover { background: rgba(237,66,69,.2); color: #ed4245; }
.sic-btn svg { color: #f0b232; width: 13px; height: 13px; }
.sic-btn.is-owned svg, .sic-btn.is-equipped svg { color: inherit; }
.premium-hero {
  border-radius: 8px; padding: 28px; text-align: center; margin-bottom: 20px;
  background: var(--premium-grad); color: #fff;
}
.premium-hero h2 { font-size: 24px; margin-bottom: 6px; }
.premium-hero p { opacity: .9; font-size: 14px; }
.perk-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.perk { display: flex; gap: 12px; align-items: flex-start; }
.perk .icon { font-size: 20px; }
.perk .t { font-weight: 600; font-size: 14px; }
.perk .d { font-size: 13px; color: var(--text-muted); }
.premium-active-badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--premium-grad);
  color: #fff; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700;
}

/* theme grid (premium perk) */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; }
.theme-card {
  border-radius: 8px; height: 90px; cursor: pointer; position: relative; overflow: hidden;
  border: 2px solid transparent; padding: 10px; font-weight: 700; font-size: 13px; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.55);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.theme-card.selected { border-color: var(--accent); }
.theme-card.locked { filter: saturate(.4) brightness(.6); }
.theme-card .lock-badge { position: absolute; top: 8px; right: 8px; color: #fff; }
.theme-swatch-dark { background: linear-gradient(135deg,#313338,#1e1f22); }
.theme-swatch-light { background: linear-gradient(135deg,#ffffff,#c9cdd2); }
.theme-swatch-sync { background: linear-gradient(135deg,#ffffff 49%,#1e1f22 51%); }
.theme-swatch-ash { background: linear-gradient(135deg,#54575f,#3a3c42); }
.theme-swatch-onyx { background: linear-gradient(135deg,#232326,#000000); }

/* create/join server modal choices */
.big-choice-row { display: flex; flex-direction: column; gap: 12px; }
.big-choice {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 8px;
  background: var(--bg-input); cursor: pointer;
}
.big-choice:hover { background: var(--bg-modifier-selected); }
.big-choice .em { font-size: 26px; }
.big-choice .t { font-weight: 700; font-size: 15px; }
.big-choice .d { font-size: 13px; color: var(--text-muted); }
.back-link { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; cursor: pointer; display: inline-block; }
.back-link:hover { color: var(--text-normal); }

/* toast */
#toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 999; }
.toast {
  background: var(--bg-floating); border-left: 4px solid var(--accent); padding: 12px 16px;
  border-radius: 4px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.4); min-width: 220px;
}
.toast.error { border-color: var(--danger); }

/* premium sparkle badge next to usernames */
.premium-star { color: #f4a4ff; font-size: 13px; }

/* scrollable modal helper */
.field small.hint { color: var(--text-faint); display: block; margin-top: 4px; font-size: 12px; }

/* ---- pinned messages modal ---- */
#pinned-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; margin-top: 6px; }
.pinned-row { display: flex; gap: 10px; padding: 10px 8px; border-radius: 6px; }
.pinned-row:hover { background: var(--bg-modifier-hover); }
.pinned-row .avatar { width: 34px; height: 34px; flex-shrink: 0; }
.pinned-row .pr-body { flex: 1; min-width: 0; }
.pinned-row .pr-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.pinned-row .pr-author { font-weight: 600; font-size: 14px; }
.pinned-row .pr-time { font-size: 11px; color: var(--text-faint); }
.pinned-row .pr-text { font-size: 14px; color: var(--text-muted); line-height: 1.4; word-break: break-word; }
.pinned-row .pr-unpin { color: var(--text-faint); align-self: flex-start; cursor: pointer; padding: 4px; border-radius: 4px; }
.pinned-row .pr-unpin:hover { color: var(--danger); background: var(--bg-modifier-hover); }

/* ---- search match highlight ---- */
.search-hit { background: rgba(240,178,50,.35); border-radius: 2px; padding: 0 1px; }

/* ---- tablet: narrow the rail/sidebar, still 3-pane like desktop ---- */
@media (max-width: 900px) and (min-width: 601px) {
  #app, #app.member-list-open { grid-template-columns: 60px 200px 1fr; }
  #app.member-list-open #member-panel { display: none; }
}

/* Narrow windows in general — a resized or split-screen desktop browser
   window is just as tight as a phone, even with a mouse. This mirrors
   the phone layout below (single pane at a time, sliding panel nav)
   without the touch-only bits like long-press or on-screen-keyboard
   tracking, which live in the touch-scoped media query further down. */
@media (max-width: 700px) {
  #app, #app.member-list-open { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
  #server-rail { grid-column: 1; grid-row: 1; width: 56px; padding: 8px 0; }
  .rail-item { width: 42px; height: 42px; font-size: 13px; }
  #side-panel, #main-col {
    grid-row: 1; min-width: 0; display: flex;
    transition: transform .28s cubic-bezier(.25,.75,.4,1);
  }
  #side-panel { grid-column: 2 / 3; transform: translateX(0); }
  #main-col { grid-column: 1 / -1; z-index: 2; transform: translateX(100%); }
  #app.mobile-show-chat #side-panel { transform: translateX(-100%); }
  #app.mobile-show-chat #main-col { transform: translateX(0); }
  .mobile-back-btn { display: flex; }

  #member-panel { display: none; }
  #app.member-list-open #member-panel {
    display: block; position: fixed; inset: 0; top: 32px; z-index: 45;
    width: 100%; height: calc(100% - 32px); padding: 16px 12px;
  }

  #settings-modal .modal-box { flex-direction: column; height: 88vh; }
  #settings-nav { width: 100%; display: flex; flex-wrap: wrap; gap: 2px; padding: 10px; }
  #settings-nav .nav-label { display: none; }
  .admin-layout { flex-direction: column; height: auto; }
  .admin-left { width: 100%; }
  .admin-right { border-left: none; border-top: 1px solid var(--divider); padding-left: 0; padding-top: 16px; }
}

/* ============ ICONS (no emoji anywhere — plain inline SVG) ============ */
.i { display: inline-flex; width: 14px; height: 14px; vertical-align: middle; flex-shrink: 0; }
.i svg { width: 100%; height: 100%; display: block; }
.premium-star { color: #f4a4ff; width: 12px; height: 12px; margin-left: 3px; }
.owner-crown { color: var(--idle); width: 13px; height: 13px; margin-left: 3px; }
.del-msg .i, .del-channel .i { width: 13px; height: 13px; }
.lock-badge { width: 13px; height: 13px; opacity: .8; }
.big-choice .em { display: flex; align-items: center; justify-content: center; color: var(--text-muted); width: 26px; }

/* ============ ROLE / STATE TAGS ============ */
.op-tag, .ban-tag, .owner-tag {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px; margin-left: 5px; vertical-align: middle; letter-spacing: .3px;
}
.op-tag { background: var(--accent-soft); color: var(--accent); }
.ban-tag { background: rgba(218,55,60,.18); color: var(--danger); }
.owner-tag { background: rgba(240,177,50,.18); color: #f0b132; }
/* inline-flex + align-items:center centers the checkmark against the text
   using true vertical centering instead of vertical-align (which drifts
   depending on font metrics) */
.bot-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px 1px 5px; border-radius: 3px; margin-left: 5px; letter-spacing: .3px;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle;
}
.bot-tag .i { width: 10px; height: 10px; }

/* ============ PURGE CONFIRMATION CARD (Sapphire) ============ */
.purge-card {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(59,165,93,.08); border-left: 3px solid #3ba55d;
  padding: 8px 12px; border-radius: 4px; font-size: 14px; color: var(--text-normal);
}
.purge-card .i { color: #3ba55d; width: 16px; height: 16px; flex-shrink: 0; }

/* ============ ADMIN PANEL ============ */
.admin-box { width: 820px; }
.admin-tabs { display: flex; gap: 4px; margin: 14px 0 4px; border-bottom: 1px solid var(--divider); }
.admin-tab { padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--text-muted); border-bottom: 2px solid transparent; }
.admin-tab:hover { color: var(--text-normal); }
.admin-tab.on { color: var(--text-normal); border-color: var(--accent); }
.admin-pane { margin-top: 10px; }
.fld-label { display: block; font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; font-weight: 700; letter-spacing: .3px; }
.hint { color: var(--text-faint); display: block; margin-top: 8px; font-size: 12px; }
.admin-emoji-list { display: flex; flex-wrap: wrap; gap: 10px; max-height: 220px; overflow-y: auto; }
.admin-emoji-chip { display: flex; align-items: center; gap: 7px; background: var(--bg-input); padding: 6px 10px; border-radius: 20px; font-size: 13px; }
.admin-emoji-chip img { width: 22px; height: 22px; }
.admin-emoji-chip .rm { display: inline-flex; cursor: pointer; color: var(--text-faint); }
.admin-emoji-chip .rm:hover { color: var(--danger); }

/* ============ AVATAR DECORATION DRAWING EDITOR ============ */
.deco-editor { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.deco-canvas-wrap { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
#deco-draw-canvas {
  width: 200px; height: 200px; border-radius: 8px; background: var(--bg-input);
  border: 1px solid rgba(255,255,255,.08); cursor: crosshair; touch-action: none; display: block;
}
.deco-guide-circle {
  position: absolute; top: 12%; left: 12%; width: 76%; height: 76%; border-radius: 50%;
  border: 1.5px dashed rgba(255,255,255,.25); pointer-events: none;
}
.deco-editor-tools { flex: 1; min-width: 200px; }
.deco-preview-block { margin-bottom: 16px; }
.deco-preview-avatar { width: 64px; height: 64px; }
.deco-color-input { width: 60px; height: 34px; padding: 2px; border-radius: 6px; border: none; background: var(--bg-input); cursor: pointer; }
.deco-size-btn.on, #deco-eraser-btn.on { background: var(--accent); color: #fff; }
.deco-mode-btn.on { background: var(--accent); color: #fff; }
.deco-editor.hidden { display: none; }
/* emoji layout editor: the box is the decoration area, layers are positioned by percentage */
.eml-stage { background: var(--bg-input); border-radius: 8px; border: 1px solid rgba(255,255,255,.08); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.eml-layers { position: absolute; inset: 0; }
.eml-layer { position: absolute; transform: translate(-50%, -50%); line-height: 1; cursor: grab; touch-action: none; padding: 2px; border-radius: 6px; outline: 1.5px dashed transparent; }
.eml-layer:active { cursor: grabbing; }
.eml-layer.sel { outline-color: var(--accent); background: rgba(255,255,255,.06); }
.eml-size { width: 100%; accent-color: var(--accent); }
.eml-size-val, .eml-rot-val { color: var(--text-muted); font-weight: 500; margin-left: 6px; }
.eml-rot { width: 100%; accent-color: var(--accent); }
.eml-rot-btns { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.eml-host .deco-editor { margin-top: 0; }
.eml-host .deco-guide-circle, #deco-mode-emoji .deco-guide-circle { z-index: 0; }
.avatar-decoration-emoji { position: absolute; transform: translate(-50%, -50%); line-height: 1; }

/* ============ THEME (GRADIENT) CREATOR ============ */
.theme-editor { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; align-items: flex-start; }
.theme-preview-swatch {
  position: relative; width: 140px; height: 90px; border-radius: 10px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.theme-preview-swatch span { position: absolute; bottom: 8px; left: 8px; width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 6px rgba(0,0,0,.4); }
.theme-editor-tools { flex: 1; min-width: 220px; }
.admin-theme-chip-swatch { width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; }
.admin-layout { display: flex; gap: 16px; height: 460px; margin-top: 10px; }
.admin-left { width: 260px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.fld-input {
  width: 100%; padding: 9px 11px; border-radius: 4px; border: none;
  background: var(--bg-input); color: var(--text-normal); font-size: 14px; outline: none;
}
.fld-input:focus { box-shadow: 0 0 0 2px var(--accent); }
.admin-user-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.admin-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 14px;
}
.admin-row:hover { background: var(--bg-modifier-hover); }
.admin-row.on { background: var(--bg-modifier-selected); }
.admin-row .ar-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Owner panel > Purge Perms (v4.59) */
.purgeperm-pane { max-width: 560px; }
.purgeperm-note { color: var(--text-muted); font-size: 14px; margin: 0 0 12px; }
.purgeperm-add { display: flex; gap: 8px; margin-bottom: 12px; }
.purgeperm-add .fld-input { flex: 1; min-width: 0; }
.purgeperm-pane .admin-row { cursor: default; }
.admin-right { flex: 1; overflow-y: auto; border-left: 1px solid var(--divider); padding-left: 20px; }
.empty { color: var(--text-faint); font-size: 14px; padding: 10px 0; }
.admin-right .empty { color: var(--text-faint); font-size: 14px; padding-top: 10px; }
.admin-sel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.admin-sel-head .as-name { font-weight: 700; font-size: 16px; }
.admin-sel-head .as-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.admin-block { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--divider); }
.admin-block:last-child { border-bottom: none; }
.ab-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; letter-spacing: .3px; }
.ab-row { display: flex; gap: 8px; align-items: center; }
/* staff badges on a person's page (v4.65) */
.admin-badge-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-badge-pick { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 6px; background: var(--bg-tertiary); cursor: pointer; font-size: 13px; }
.admin-badge-pick input { margin: 0; }
.gen-code-uses-row { margin-top: 8px; flex-wrap: wrap; }
.gen-code-uses-row .fld-label, .gen-code-uses-row .hint { margin: 0; }
.gen-code-uses-row .fld-input { width: 90px; flex: none; }
.ab-note { flex: 1; font-size: 13px; color: var(--text-muted); }
.btn-secondary.slim, .btn-accent-inline.slim, .btn-danger.slim { padding: 6px 12px; font-size: 13px; }

/* ============ HOME NAV (Friends / Quests / Codes) ============ */
#home-nav { padding: 8px; }
.home-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 4px;
  color: var(--text-muted); font-weight: 600; font-size: 15px; cursor: pointer; margin-bottom: 2px; position: relative;
}
.home-nav-item:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.home-nav-item.active { background: var(--bg-modifier-selected); color: var(--text-normal); }
.home-nav-item[data-home-view="shop"]:hover { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, #fff); }
.home-nav-item[data-home-view="shop"]:hover .hn-icon { color: var(--accent); }
.hn-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.hn-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; padding: 1px 6px; min-width: 16px; text-align: center;
}

/* ============ MAIN-CONTENT PAGE VIEWS (Friends / Quests / Codes) ============ */
.main-page-view { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.mp-header {
  height: 48px; display: flex; align-items: center; gap: 24px; padding: 0 20px; font-weight: 700; font-size: 16px;
  box-shadow: 0 1px 0 var(--divider); flex-shrink: 0;
}
.mp-body { flex: 1; overflow-y: auto; padding: 20px; }
.friends-tabs { display: flex; gap: 4px; }
.friends-tab { padding: 6px 12px; border-radius: 4px; font-weight: 600; font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.friends-tab:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.friends-tab.on { background: var(--bg-modifier-selected); color: var(--text-normal); }

.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--divider);
}
.friend-row-name { flex: 1; font-weight: 600; font-size: 15px; cursor: pointer; }
.friend-row-name:hover { text-decoration: underline; }
.friend-row-actions { display: flex; align-items: center; gap: 8px; }
.group-avatar { background: var(--bg-input); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.group-avatar .i { width: 16px; height: 16px; }

.friend-picker { max-height: 240px; overflow-y: auto; margin: 12px 0; border: 1px solid var(--divider); border-radius: 6px; padding: 6px; }
.friend-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.friend-pick-row:hover { background: var(--bg-modifier-hover); }
.friend-pick-row input { margin-left: auto; }

/* ---- switch-styled checkboxes ----
   Applied directly to the native <input type="checkbox"> itself (no
   extra wrapper markup needed) wherever a plain checkbox was used as an
   on/off toggle or list-item selector, so every one of these reads and
   behaves the same way as the app's other toggles. */
.role-perm-row input[type="checkbox"],
.friend-pick-row input[type="checkbox"],
.re-member-addable input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  width: 36px; height: 20px; min-width: 36px; border-radius: 10px;
  background: var(--bg-tertiary); border: 1px solid rgba(255,255,255,.08);
  position: relative; cursor: pointer; flex-shrink: 0; margin: 0;
  transition: background .15s ease;
}
.role-perm-row input[type="checkbox"]::before,
.friend-pick-row input[type="checkbox"]::before,
.re-member-addable input[type="checkbox"]::before {
  content: ''; position: absolute; top: 1px; left: 1px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.role-perm-row input[type="checkbox"]:checked,
.friend-pick-row input[type="checkbox"]:checked,
.re-member-addable input[type="checkbox"]:checked { background: var(--accent); }
.role-perm-row input[type="checkbox"]:checked::before,
.friend-pick-row input[type="checkbox"]:checked::before,
.re-member-addable input[type="checkbox"]:checked::before { transform: translateX(16px); }
.role-perm-row input[type="checkbox"]:disabled,
.re-member-addable input[type="checkbox"]:disabled { opacity: .5; cursor: default; }

/* ============ CHANNEL CATEGORIES ============ */
.category-header {
  display: flex; align-items: center; gap: 6px; padding: 14px 4px 4px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; color: var(--text-muted); letter-spacing: .3px; cursor: pointer;
}
.category-header:hover { color: var(--text-normal); }
.cat-chevron { transition: transform .12s ease; }
.cat-chevron.collapsed { transform: rotate(-90deg); }

/* ============ BEGINNING-OF-CONVERSATION STATE ============ */
.convo-start { padding: 24px 16px 12px; }
.convo-start-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--bg-secondary); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; margin-bottom: 12px;
}
.convo-start-icon .i { width: 26px; height: 26px; }
.convo-start h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.convo-start p { color: var(--text-muted); font-size: 14px; }

/* ============ CODE DISPLAY ============ */
.code-display {
  background: var(--bg-input); border-radius: 6px; padding: 16px; text-align: center; font-size: 20px;
  font-weight: 700; letter-spacing: 1px; font-family: monospace; margin: 6px 0 4px; color: var(--accent);
}

/* ============ PROFILE MODAL ============ */
/* (v4.66, request 38: bigger than the old 460px card, with more room for the banner) */
.profile-box { width: 600px; padding: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.profile-close { position: absolute; top: 12px; right: 12px; color: #fff; background: rgba(0,0,0,.35); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.profile-banner { height: 120px; flex-shrink: 0; }
/* .profile-main used to inherit overflow:hidden from .profile-box, which
   clipped the bottom of the card instead of scrolling it — with the edit
   fields open (display name, pronouns, bio, banner colors, gradient
   banners) the card runs taller than the 86vh cap from .modal-box, and
   there was no way to reach the rest of it. Making this its own scroll
   region (flex:1 + min-height:0) fixes that while .profile-box still
   clips the banner's rounded top corners. */
.profile-main { padding: 0 20px 20px; margin-top: -40px; overflow-y: auto; flex: 1; min-height: 0; position: relative; z-index: 2; }
.profile-avatar-wrap { margin-bottom: 10px; position: relative; width: 80px; }
/* Badges (v4.65): a small box to the right of the picture; hover or tap one for a card about it */
.profile-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.profile-top .profile-avatar-wrap { margin-bottom: 0; flex-shrink: 0; }
.profile-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; padding: 3px; margin-bottom: 4px; background: var(--bg-secondary); border-radius: 8px; max-width: 300px; position: relative; z-index: 6; }
.pbadge { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; cursor: pointer; }
.pbadge:hover, .pbadge:focus-visible { background: var(--bg-modifier-hover); outline: none; }
.badge-tip { position: fixed; z-index: 400; width: 210px; padding: 14px 14px 12px; border-radius: 10px; background: var(--bg-floating); box-shadow: 0 8px 24px rgba(0,0,0,.45); text-align: center; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.badge-tip.on { opacity: 1; transform: none; }
.bt-icon { display: flex; justify-content: center; margin-bottom: 8px; }
.bt-title { font-weight: 700; font-size: 15px; }
.bt-tier { font-size: 11px; font-weight: 800; letter-spacing: .08em; margin-top: 2px; }
.bt-text { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.35; }
.profile-avatar { border: 6px solid var(--bg-floating); }
.avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-input); color: var(--text-normal); display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--bg-floating);
}
.avatar-edit-btn:hover { background: var(--accent); color: #fff; }
.remove-avatar-link { display: block; font-size: 12.5px; color: var(--text-link); cursor: pointer; margin-bottom: 14px; }
.remove-avatar-link:hover { text-decoration: underline; }
.profile-body { background: var(--bg-secondary); border-radius: 8px; padding: 16px; }
/* Nameplate bleeds to the card's edges (negative margin cancels .profile-body's
   own padding) since that's how it actually reads visually — a background
   plate behind just the name/status block, not the whole card. */
/* a Premium name gradient, on the name text only (v4.68) */
.grad-name { -webkit-background-clip: text; background-clip: text; color: transparent; }
.profile-name-block { position: relative; margin: -16px -16px 12px; padding: 16px 16px 12px; overflow: hidden;
  /* keeps the card's rounded top corners when a nameplate is on (v4.68, request 72) */
  border-top-left-radius: inherit; border-top-right-radius: inherit; }
.profile-nameplate-bg { position: absolute; inset: 0; z-index: 0; }
.profile-name-block > *:not(.profile-nameplate-bg) { position: relative; z-index: 1; }
.profile-name-row { display: flex; align-items: center; gap: 6px; }
.profile-username { font-size: 20px; font-weight: 700; }
.profile-handle { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.profile-pronouns { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 4px; }

/* ============ NAMEPLATES ============ */
.nameplate-blazing { background: linear-gradient(180deg, #2b1a35 0%, #1a0e20 60%, #0d0710 100%); }
.nameplate-blazing::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 100%, rgba(255,111,0,.5), transparent 40%),
    radial-gradient(circle at 55% 100%, rgba(236,64,122,.45), transparent 45%),
    radial-gradient(circle at 85% 100%, rgba(255,111,0,.4), transparent 40%);
  animation: nameplateFlicker 2.4s ease-in-out infinite alternate;
}
@keyframes nameplateFlicker { from { opacity: .7; } to { opacity: 1; } }
.nameplate-starfall { background: linear-gradient(180deg, #0d1b3d, #05091a); }
.nameplate-starfall::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 15% 30%, #fff, transparent),
    radial-gradient(2px 2px at 35% 65%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 25%, #fff, transparent),
    radial-gradient(2px 2px at 75% 55%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 35%, #fff, transparent);
  animation: nameplateTwinkle 1.8s ease-in-out infinite alternate;
}
@keyframes nameplateTwinkle { from { opacity: .35; } to { opacity: 1; } }
.nameplate-ocean { background: linear-gradient(180deg, #0a3d5c, #05202f); }
.nameplate-ocean::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: rgba(255,255,255,.08);
  clip-path: polygon(0% 60%, 10% 40%, 20% 55%, 30% 35%, 40% 55%, 50% 35%, 60% 55%, 70% 35%, 80% 55%, 90% 40%, 100% 60%, 100% 100%, 0% 100%);
}
.nameplate-aurora { background: linear-gradient(120deg, #134e4a, #1e3a5f, #2d1b4e); background-size: 200% 200%; animation: nameplateAuroraShift 6s ease-in-out infinite; }
@keyframes nameplateAuroraShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.nameplate-aurora::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(52,211,153,.35), transparent 50%), radial-gradient(circle at 70% 80%, rgba(167,139,250,.3), transparent 50%);
  animation: nameplateFlicker 3s ease-in-out infinite alternate;
}
.nameplate-blossom { background: linear-gradient(180deg, #4a2c3a, #2a1620); }
.nameplate-blossom::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(5px 4px at 15% 30%, #f9a8d4, transparent),
    radial-gradient(4px 3px at 40% 60%, #f472b6, transparent),
    radial-gradient(5px 4px at 65% 25%, #f9a8d4, transparent),
    radial-gradient(4px 3px at 85% 55%, #f472b6, transparent),
    radial-gradient(4px 3px at 25% 75%, #fbcfe8, transparent);
}
.nameplate-cybergrid {
  background-image:
    linear-gradient(180deg, #0a0e14, #05070a),
    repeating-linear-gradient(0deg, rgba(0,255,200,.08) 0px, rgba(0,255,200,.08) 1px, transparent 1px, transparent 8px),
    repeating-linear-gradient(90deg, rgba(0,255,200,.08) 0px, rgba(0,255,200,.08) 1px, transparent 1px, transparent 8px);
}
.nameplate-cybergrid::before {
  content: ''; position: absolute; left: 0; right: 0; height: 2px;
  background: rgba(0,255,200,.8); box-shadow: 0 0 8px rgba(0,255,200,.8);
  animation: cybergridScan 2.5s linear infinite;
}
@keyframes cybergridScan { 0% { top: 0%; } 100% { top: 96%; } }
.sic-nameplate-preview {
  position: relative; width: 100%; height: 56px; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.08);
}
/* The plain backing goes under a built-in nameplate's own colors. As a normal rule it came later in this file than
   the first six (Blazing to Cybergrid) and hid their colors in the Shop (v4.71). */
:where(.sic-nameplate-preview) { background: var(--bg-tertiary); }
.sic-nameplate-preview span { position: relative; z-index: 1; color: #fff; font-weight: 700; font-size: 13px; }
/* Round corners on every nameplate in every browser (v4.71, request 81). Safari can draw an animated layer, like the
   built-in nameplates' glows and stars, with square corners inside a rounded box unless that box starts its own
   stacking context. So each box that holds a nameplate isolates, and the art and its full-size layers round
   themselves too. */
.dm-row.has-nameplate, .profile-name-block, .mup-plate, .sic-nameplate-preview { isolation: isolate; }
.dm-row-nameplate-bg, .profile-nameplate-bg, .mup-plate-art { border-radius: inherit; overflow: hidden; }
.nameplate-blazing::before, .nameplate-starfall::before, .nameplate-ocean::before, .nameplate-aurora::before,
.nameplate-blossom::before, .nameplate-galaxy::before, .nameplate-shimmer::after { border-radius: inherit; }

/* ============ PROFILE EFFECTS ============
   Falling/rising particles animate `top` (a % of the card) rather than
   translateY — translateY percentages are relative to the particle's OWN
   few-pixel height, which is why effects used to only move ~60px and never
   actually cross the profile card. Each particle gets --s (size scale) and
   --drift (sideways sway) inline from PROFILE_EFFECT_PARTICLES_HTML. */
.profile-effect-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
/* Drawn effects (v4.65): under the profile's text, over its background; the panel lets some of it through.
   During a "front" intro (Smoke Bomb, Toxic Ooze, Glitch) it covers the whole card for a moment. */
.profile-fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; display: none; }
.profile-box.fx-on .profile-fx-canvas { display: block; }
.profile-fx-canvas.pfx-front { z-index: 6; }
.profile-box.fx-on .profile-body { background: color-mix(in srgb, var(--bg-secondary) 64%, transparent); }
.pfx-preview { height: 96px; }
.pfx-preview canvas { display: block; width: 100%; height: 100%; }
.profile-effect-overlay .particle, .sic-effect-preview .particle { position: absolute; top: -12%; will-change: top, transform, opacity; }
@keyframes fxFall {
  0% { top: -12%; transform: translateX(0) rotate(0deg) scale(var(--s, 1)); }
  100% { top: 112%; transform: translateX(var(--drift, 0px)) rotate(var(--rot, 0deg)) scale(var(--s, 1)); }
}
@keyframes fxRise {
  0% { top: 112%; opacity: 0; transform: translateX(0) scale(var(--s, 1)); }
  12% { opacity: 1; }
  85% { opacity: .9; }
  100% { top: -12%; opacity: 0; transform: translateX(var(--drift, 0px)) scale(calc(var(--s, 1) * .6)); }
}
@keyframes fxTwinkle { 0%, 100% { opacity: 0; transform: scale(calc(var(--s, 1) * .4)); } 50% { opacity: 1; transform: scale(calc(var(--s, 1) * 1.3)); } }
@keyframes fxDrift {
  0%, 100% { opacity: .25; transform: translate(0, 0) scale(var(--s, 1)); }
  50% { opacity: 1; transform: translate(var(--drift, 6px), -14px) scale(var(--s, 1)); }
}
@keyframes fxShoot {
  0% { top: -10%; left: var(--start, 20%); opacity: 0; transform: rotate(35deg) scaleX(.3); }
  8% { opacity: 1; }
  40% { opacity: 1; transform: rotate(35deg) scaleX(1); }
  60%, 100% { top: 70%; opacity: 0; transform: translateX(-120px) rotate(35deg) scaleX(.3); }
}

.effect-snowfall .particle { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .85; box-shadow: 0 0 4px rgba(255,255,255,.6); animation: fxFall 6s linear infinite; }
.effect-petals .particle { --rot: 340deg; width: 10px; height: 7px; border-radius: 60% 10% 60% 10%; background: #f7a8c4; animation: fxFall 7s linear infinite; }
.effect-sparkles .particle, .effect-fireflies .particle, .effect-glitter .particle,
.effect-style-twinkling .particle, .effect-style-floating .particle { top: 48%; }
.effect-sparkles .particle:nth-child(3n), .effect-fireflies .particle:nth-child(3n), .effect-glitter .particle:nth-child(3n),
.effect-style-twinkling .particle:nth-child(3n), .effect-style-floating .particle:nth-child(3n) { top: 18%; }
.effect-sparkles .particle:nth-child(3n+2), .effect-fireflies .particle:nth-child(3n+2), .effect-glitter .particle:nth-child(3n+2),
.effect-style-twinkling .particle:nth-child(3n+2), .effect-style-floating .particle:nth-child(3n+2) { top: 78%; }
.effect-sparkles .particle { width: 5px; height: 5px; background: #ffe066; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: fxTwinkle 2.2s ease-in-out infinite; }
.effect-rain .particle { width: 2px; height: 16px; background: linear-gradient(180deg, transparent, rgba(150,200,255,.75)); border-radius: 2px; --drift: -6px; animation: fxFall 1.1s linear infinite; }
.effect-fireflies .particle { width: 5px; height: 5px; border-radius: 50%; background: #ffe066; box-shadow: 0 0 6px 2px rgba(255,224,102,.8); animation: fxDrift 4s ease-in-out infinite; }
.effect-confetti .particle { --rot: 540deg; width: 6px; height: 10px; animation: fxFall 3.5s linear infinite; }
.effect-confetti .particle:nth-child(5n) { background: #f87171; }
.effect-confetti .particle:nth-child(5n+1) { background: #60a5fa; }
.effect-confetti .particle:nth-child(5n+2) { background: #34d399; }
.effect-confetti .particle:nth-child(5n+3) { background: #fbbf24; }
.effect-confetti .particle:nth-child(5n+4) { background: #a78bfa; }
/* New built-in effects */
.effect-embers .particle { width: 4px; height: 4px; border-radius: 50%; background: #ff8a3d; box-shadow: 0 0 6px 2px rgba(255,110,40,.75); animation: fxRise 3.2s ease-out infinite; }
.effect-embers .particle:nth-child(2n) { background: #ffd05a; }
.effect-hearts .particle { width: 10px; height: 10px; background: #ff5c8a; clip-path: path('M5 9.2 L1.2 5.4 A2.3 2.3 0 0 1 5 2.2 A2.3 2.3 0 0 1 8.8 5.4 Z'); animation: fxRise 5s ease-in-out infinite; }
.effect-hearts .particle:nth-child(3n) { background: #ff9ec0; }
.effect-bubbles .particle { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(180,230,255,.85); background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.7) 0 15%, transparent 30%); animation: fxRise 6s ease-in infinite; }
.effect-leaves .particle { --rot: 420deg; width: 11px; height: 7px; border-radius: 0 80% 0 80%; background: #e8833a; animation: fxFall 6.5s ease-in-out infinite; }
.effect-leaves .particle:nth-child(3n) { background: #c9452b; }
.effect-leaves .particle:nth-child(3n+1) { background: #e8b83a; }
.effect-matrix .particle { width: 2px; height: 22px; background: linear-gradient(180deg, transparent, #22ff66); box-shadow: 0 0 6px rgba(34,255,102,.6); --drift: 0px; animation: fxFall 1.6s linear infinite; }
.effect-shooting-stars .particle { width: 46px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff); box-shadow: 0 0 6px rgba(255,255,255,.8); animation: fxShoot 4.5s ease-in infinite; }
.effect-shooting-stars .particle:nth-child(n+7) { display: none; }
.effect-shooting-stars .particle:nth-child(1) { --start: 30%; }
.effect-shooting-stars .particle:nth-child(2) { --start: 70%; }
.effect-shooting-stars .particle:nth-child(3) { --start: 50%; }
.effect-shooting-stars .particle:nth-child(4) { --start: 90%; }
.effect-shooting-stars .particle:nth-child(5) { --start: 15%; }
.effect-shooting-stars .particle:nth-child(6) { --start: 60%; }
.effect-glitter .particle { width: 4px; height: 4px; border-radius: 1px; animation: fxTwinkle 1.4s ease-in-out infinite; }
.effect-glitter .particle:nth-child(4n) { background: #ff7ad9; }
.effect-glitter .particle:nth-child(4n+1) { background: #7ad7ff; }
.effect-glitter .particle:nth-child(4n+2) { background: #ffe27a; }
.effect-glitter .particle:nth-child(4n+3) { background: #b58bff; }

.sic-effect-preview {
  position: relative; width: 100%; height: 56px; border-radius: 8px; overflow: hidden;
  background: var(--bg-tertiary); border: 1px solid rgba(255,255,255,.08);
}

/* ============ USER-CREATED (admin/owner) NAMEPLATES, EFFECTS, FRAMES ============
   Generic, color-parameterized versions of the same visual patterns above —
   an admin's own color choice comes in via a CSS custom property or inline
   style rather than a hand-authored class per item. */
.nameplate-shimmer::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: nameplateShimmerSweep 2.5s linear infinite;
}
@keyframes nameplateShimmerSweep { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.effect-style-falling .particle { width: 6px; height: 6px; background: var(--custom-particle-color, #fff); border-radius: 50%; animation: fxFall 4s linear infinite; }
.effect-style-rising .particle { width: 5px; height: 5px; background: var(--custom-particle-color, #fff); border-radius: 50%; box-shadow: 0 0 6px 1px var(--custom-particle-color, #fff); animation: fxRise 4s ease-out infinite; }
.effect-style-floating .particle { width: 5px; height: 5px; background: var(--custom-particle-color, #fff); border-radius: 50%; box-shadow: 0 0 6px 2px var(--custom-particle-color, #fff); animation: fxDrift 4s ease-in-out infinite; }
.effect-style-twinkling .particle { width: 4px; height: 4px; background: var(--custom-particle-color, #fff); border-radius: 50%; animation: fxTwinkle 2.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .profile-effect-overlay .particle, .sic-effect-preview .particle { animation-duration: 0s !important; animation-iteration-count: 1 !important; }
}

.frame-custom-glow { animation: frameCustomPulse 1.6s ease-in-out infinite alternate; }
@keyframes frameCustomPulse {
  from { box-shadow: 0 0 8px var(--custom-frame-color, #fff), inset 0 0 10px var(--custom-frame-color, #fff); }
  to { box-shadow: 0 0 18px var(--custom-frame-color, #fff), inset 0 0 20px var(--custom-frame-color, #fff); }
}
.np-check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); margin: 10px 0; cursor: pointer; }
.np-check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ============ PROFILE FRAMES (redrawn in v4.62) ============
   A frame is drawn on its own layer over the profile card (.profile-frame-layer) or on the Shop's preview box, never
   on the card itself. On the card, the card's pop-in animation (frxPop) replaced a frame's own animation, so Rainbow,
   Neon and Plasma never moved; and in the Shop, the preview's own 1px border hid most of every frame.
   Ring frames paint a gradient on ::before and mask it down to a ring, so they follow the card's rounded corners.
   Thorns and Rosevine repeat a small drawing along every edge (border-image); the card's rounded, clipped corners
   trim them. Anything that moves here is also listed under Epilepsy mode further down. */
.profile-frame-layer { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5; }
.sic-frame-preview {
  position: relative; overflow: hidden;
  width: 100%; height: 84px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); border: 1px solid rgba(255,255,255,.08);
}
.sic-frame-preview .avatar { border-radius: 50%; }
.sic-frame-preview.frame-golden, .sic-frame-preview.frame-neon, .sic-frame-preview.frame-ice,
.sic-frame-preview.frame-rainbow, .sic-frame-preview.frame-emerald, .sic-frame-preview.frame-plasma,
.sic-frame-preview.frame-eventhorizon, .sic-frame-preview.frame-custom-gradient { border-color: transparent; }
.frame-golden::before, .frame-neon::before, .frame-ice::before, .frame-rainbow::before,
.frame-emerald::before, .frame-plasma::before, .frame-eventhorizon::before, .frame-custom-gradient::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: var(--ring, 4px); pointer-events: none;
  background: var(--ring-bg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.frame-custom-gradient { --ring: 4px; }
.frame-custom-gradient.frame-grad-anim::before { animation: frameHueSpin 4s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .frame-custom-gradient.frame-grad-anim::before { animation: none; }
}
/* Golden: polished gold, light catching on it, with a warm glow inside */
.frame-golden { --ring: 5px; --ring-bg: linear-gradient(135deg, #7a4e00 0%, #e9b949 18%, #fff1b8 30%, #c8921c 45%, #f5d06b 62%, #8a5a00 80%, #e9b949 100%);
  box-shadow: inset 0 0 24px rgba(240,178,50,.24); }
/* Neon: a hot pink tube that pulses */
.frame-neon { --ring: 3px; --ring-bg: #ff5ae0; animation: frameNeonPulse 1.6s ease-in-out infinite alternate; }
@keyframes frameNeonPulse {
  from { box-shadow: inset 0 0 6px rgba(255,47,214,.45), inset 0 0 16px rgba(255,47,214,.12); }
  to { box-shadow: inset 0 0 12px rgba(255,47,214,.95), inset 0 0 34px rgba(255,47,214,.35); }
}
/* Thorns: a dark branch with thorns all the way round */
.frame-thorns { border: 12px solid transparent; box-shadow: inset 0 0 18px rgba(20,10,0,.55);
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg id='t'%3E%3Cpath d='M0 6.5H48' stroke='%236b4423' stroke-width='3.6'/%3E%3Cpath d='M0 5.8H48' stroke='%23a8794a' stroke-width='1.1'/%3E%3Cpath d='M14 5.5L17.5 0L20.5 5.5ZM27.5 7.5L30.5 12L34 7.5ZM40 5.5L42 1.5L44 5.5ZM4 7.5L6 11.5L8 7.5Z' fill='%23c9a46e'/%3E%3C/g%3E%3Cuse xlink:href='%23t' transform='rotate(90 24 24)'/%3E%3Cuse xlink:href='%23t' transform='rotate(180 24 24)'/%3E%3Cuse xlink:href='%23t' transform='rotate(270 24 24)'/%3E%3C/svg%3E") 12 round; }
/* Ice: a frosted ring with icicles hanging from the top */
.frame-ice { --ring: 4px; --ring-bg: linear-gradient(135deg, #f0fbff, #7dd3fc 25%, #e0f2fe 45%, #38bdf8 65%, #f0fbff 85%, #7dd3fc);
  box-shadow: inset 0 0 24px rgba(125,211,252,.3); }
.frame-ice::after { content: ''; position: absolute; left: var(--ring, 4px); right: var(--ring, 4px); top: var(--ring, 4px); height: 16px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 16'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%237dd3fc' stop-opacity='.55'/%3E%3C/linearGradient%3E%3Cpath d='M0 0H30V2.5H28L26.5 9L25 2.5H19L17 14L15 2.5H10L8.6 7L7.2 2.5H3L2 5L1 2.5H0Z' fill='url(%23g)'/%3E%3C/svg%3E") repeat-x 0 0 / 30px 16px; }
/* Rainbow: every part of the ring keeps cycling through every color */
.frame-rainbow { --ring: 4px; --ring-bg: conic-gradient(from 0deg, #ff5e5e, #ffb347, #ffe066, #6ee7b7, #60a5fa, #a78bfa, #ff5e5e);
  animation: frameRainbowGlow 3s linear infinite; }
.frame-rainbow::before { animation: frameHueSpin 3s linear infinite; }
@keyframes frameHueSpin { to { filter: hue-rotate(360deg); } }
@keyframes frameRainbowGlow {
  0%, 100% { box-shadow: inset 0 0 18px rgba(255,94,94,.35); }
  17% { box-shadow: inset 0 0 18px rgba(255,179,71,.35); }
  33% { box-shadow: inset 0 0 18px rgba(255,224,102,.35); }
  50% { box-shadow: inset 0 0 18px rgba(110,231,183,.35); }
  67% { box-shadow: inset 0 0 18px rgba(96,165,250,.35); }
  83% { box-shadow: inset 0 0 18px rgba(167,139,250,.35); }
}
/* Rosevine: a climbing vine with leaves and little roses */
.frame-rosevine { border: 12px solid transparent; box-shadow: inset 0 0 16px rgba(10,40,10,.5);
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg id='v'%3E%3Cpath d='M0 6Q6 2 12 6T24 6T36 6T48 6' fill='none' stroke='%232f5d2a' stroke-width='2.2'/%3E%3Cellipse cx='17' cy='3' rx='3' ry='1.5' fill='%233f7d38' transform='rotate(-25 17 3)'/%3E%3Cellipse cx='31' cy='9' rx='3' ry='1.5' fill='%233f7d38' transform='rotate(-25 31 9)'/%3E%3Ccircle cx='24' cy='6' r='3.4' fill='%23a3123f'/%3E%3Ccircle cx='24' cy='6' r='1.7' fill='%23e0447a'/%3E%3C/g%3E%3Cuse xlink:href='%23v' transform='rotate(90 24 24)'/%3E%3Cuse xlink:href='%23v' transform='rotate(180 24 24)'/%3E%3Cuse xlink:href='%23v' transform='rotate(270 24 24)'/%3E%3C/svg%3E") 12 round; }
.sic-frame-preview.frame-thorns, .sic-frame-preview.frame-rosevine { border-width: 10px; }

.sic-theme-preview { position: relative; width: 100%; height: 110px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 0 16px rgba(255,255,255,.08); overflow: hidden; display: flex; align-items: flex-end; }
.sic-theme-overlay {
  width: 100%; padding: 8px 10px 7px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: linear-gradient(0deg, rgba(0,0,0,.68) 0%, rgba(0,0,0,0) 100%);
}
.sic-theme-name { font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); text-align: left; }
.is-theme-card .sic-animated-tag { background: rgba(255,255,255,.18); color: #fff; flex-shrink: 0; }
/* ============ EASTER EGGS (v4.62) ============ */
.cracker-tag { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 1px 6px;
  border-radius: 3px; margin-left: 5px; vertical-align: middle; background: #c4161c; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
/* the name box at the bottom left is narrow: with a staff tag already there, the Cracker tag would be cut off */
#user-panel .owner-tag ~ .cracker-tag, #user-panel .coowner-tag ~ .cracker-tag, #user-panel .op-tag ~ .cracker-tag { display: none; }
.egg-block { margin-top: 26px; padding: 14px 16px; border-radius: 10px; background: var(--bg-secondary); }
/* one-time password sign-ins on your account (v4.66) */
/* a newer Frixion is out and you were busy (v4.66) */
.version-bar { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--bg-floating, #111214); color: var(--text-primary, #fff); font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.08); }
.version-bar button { border: 0; border-radius: 999px; padding: 6px 14px; background: var(--brand, #5865f2); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
/* System Hub on someone of your own rank (v4.66) */
.admin-same-rank { display: block; margin: 10px 0 2px; padding: 8px 10px; border-radius: 8px; background: var(--bg-tertiary); line-height: 1.4; }
.seclog-block { margin-top: 26px; padding: 14px 16px; border-radius: 10px; background: var(--bg-secondary); border-left: 3px solid var(--warning, #f0b232); }
.seclog-title { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.seclog-sub { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 8px; }
.seclog-row { font-size: 13px; color: var(--text-normal, var(--text-primary)); padding: 4px 0; border-top: 1px solid var(--bg-modifier-accent, rgba(255,255,255,.06)); }
.egg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.egg-title { font-weight: 800; color: var(--text-normal); }
.egg-count { font-weight: 700; color: #ed4245; }
.egg-sub { margin: 6px 0 10px; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.egg-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.egg-chip { font: inherit; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px dashed rgba(255,255,255,.18); color: var(--text-muted); background: none; cursor: pointer; }
.egg-chip:hover { border-color: rgba(255,255,255,.4); }
.egg-hint { margin-top: 10px; min-height: 18px; font-size: 13px; color: var(--text-normal); }
/* tiny hints around Frixion (v4.62) */
.egg-tip { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); opacity: .6; text-align: center; }
.codes-card .egg-tip { text-align: left; margin-top: 14px; }
.fg-window .egg-tip { color: inherit; }
.help-row.egg-tip-row { opacity: .55; font-size: 12px; }
/* Settings > Easter Eggs, the Owner's list */
.eg-sum { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.45; }
.eg-group { margin-bottom: 16px; }
.eg-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); margin-bottom: 6px; }
.eg-row { padding: 9px 12px; border-radius: 8px; background: var(--bg-secondary); margin-bottom: 6px; }
.eg-row.found { opacity: .65; }
.eg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eg-name { font-weight: 700; color: var(--text-normal); }
.eg-tier { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--text-muted); }
.eg-tier.t-v, .eg-tier.t-l { background: rgba(237,66,69,.18); color: #f08d8f; }
.eg-found { font-size: 11px; font-weight: 700; color: #3ba55c; }
.eg-how { margin-top: 4px; font-size: 13px; color: var(--text-normal); line-height: 1.45; user-select: text; }
.eg-code { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.eg-code code { font-family: Consolas, monospace; font-size: 13px; padding: 1px 6px; border-radius: 4px; background: var(--bg-input); color: var(--text-normal); user-select: all; }
.egg-chip.found { border-style: solid; color: #fff; background: rgba(237,66,69,.18); border-color: rgba(237,66,69,.55); }
.egg-chip.t-v:not(.found), .egg-chip.t-l:not(.found) { border-color: rgba(237,66,69,.45); }
#pane-account { position: relative; }
.egg-dot { position: absolute; right: 6px; bottom: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); opacity: .14; cursor: default; }
.egg-dot:hover { opacity: .3; }
.egg-credits { margin-top: 28px; font-size: 11.5px; color: var(--text-faint, var(--text-muted)); opacity: .55; text-align: center; }
.egg-toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 100001; min-width: 240px; max-width: 92vw; padding: 12px 18px;
  border-radius: 10px; background: #160406; color: #fff; text-align: center; box-shadow: 0 0 0 1px rgba(237,66,69,.6), 0 12px 32px rgba(0,0,0,.5);
  animation: eggIn .35s cubic-bezier(.2,.9,.3,1.15); transition: opacity .5s ease, transform .5s ease; }
.egg-toast.out { opacity: 0; transform: translate(-50%, -12px); }
.egg-toast-t { font-weight: 800; letter-spacing: .3px; }
.egg-toast-s { margin-top: 3px; font-size: 13px; color: #f3b5b7; }
@keyframes eggIn { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.egg-cut { position: fixed; inset: 0; z-index: 100002; background: radial-gradient(ellipse at center, #120304 0%, #000 75%); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; cursor: pointer;
  animation: eggFade .5s ease; transition: opacity .45s ease; font-family: inherit; text-align: center; }
.egg-cut.out { opacity: 0; }
.egg-cut-title { font-size: clamp(28px, 6vw, 56px); font-weight: 900; letter-spacing: 6px; color: #ed4245; }
.egg-cut-red .egg-cut-title { color: #ff2a2a; text-shadow: 0 0 18px rgba(255,30,30,.45); }
.egg-cut-lines { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.egg-cut-line { font-size: clamp(16px, 2.6vw, 22px); line-height: 1.4; animation: eggLine .6s ease both; }
.egg-cut-skip { position: absolute; bottom: 22px; font-size: 12px; color: rgba(255,255,255,.4); letter-spacing: 1px; text-transform: uppercase; }
@keyframes eggFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes eggLine { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.egg-canvas { position: fixed; inset: 0; z-index: 100000; pointer-events: none; }
.egg-bigword { position: fixed; left: 50%; top: 45%; z-index: 100000; pointer-events: none; font-size: clamp(48px, 12vw, 140px); font-weight: 900; letter-spacing: 10px;
  color: #ed4245; text-shadow: 0 0 30px rgba(237,66,69,.5); animation: eggBig 2.4s ease forwards; }
@keyframes eggBig { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
html.egg-mirror body { transform: scaleX(-1); transition: transform .6s ease; }
html.egg-spin body { animation: eggSpin 1.25s ease-in-out; }
@keyframes eggSpin { to { transform: rotate(360deg); } }
html.egg-gravity .msg-line, html.egg-gravity .dm-row, html.egg-gravity .channel-row, html.egg-gravity .member-row { animation: eggDrop 2.5s cubic-bezier(.5,0,.5,1) both; }
html.egg-gravity .msg-line:nth-child(3n), html.egg-gravity .dm-row:nth-child(3n) { animation-delay: .12s; }
html.egg-gravity .msg-line:nth-child(3n+1), html.egg-gravity .dm-row:nth-child(3n+1) { animation-delay: .24s; }
@keyframes eggDrop { 0% { transform: none; } 35%, 60% { transform: translateY(70vh) rotate(7deg); opacity: .9; } 100% { transform: none; } }
#profile-avatar.egg-avspin { animation: eggSpin .9s ease-in-out; }
.egg-saver { position: fixed; inset: 0; z-index: 100003; background: #000; cursor: none; }
.egg-saver-logo { position: absolute; left: 0; top: 0; font-size: 44px; font-weight: 900; letter-spacing: 6px; color: #ed4245; will-change: transform; }

/* Settings > Quick Open (v4.62) */
.qo-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 16px; }
.qo-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; background: var(--bg-secondary); }
.qo-label { flex: 1; min-width: 0; font-weight: 600; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qo-keys { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.qo-keys kbd, .qo-note kbd { font: 600 12px/1 inherit; padding: 4px 7px; border-radius: 5px; background: var(--bg-input); color: var(--text-normal); border-bottom: 2px solid rgba(0,0,0,.35); }
.qo-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qo-add-row { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 220px; }
.qo-add select { flex: 1; min-width: 140px; padding: 9px 10px; border-radius: 6px; border: none; background: var(--bg-input); color: var(--text-normal); font: inherit; }
#qo-add-btn.capturing { background: var(--bg-input); color: var(--text-normal); box-shadow: 0 0 0 2px var(--accent) inset; }
.qo-note { margin-top: 14px; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
/* the Themes tab's Free section (v4.62) */
.sic-free-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 1px 6px; border-radius: 3px;
  background: rgba(35,165,90,.85); color: #fff; flex-shrink: 0; }
.sic-btn.is-equipped[disabled] { cursor: default; }

.profile-section { font-size: 14px; color: var(--text-normal); line-height: 1.4; }
.profile-action-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.profile-note-input {
  width: 100%; min-height: 60px; background: var(--bg-input); border: none; border-radius: 4px;
  padding: 8px 10px; color: var(--text-normal); font-size: 13px; resize: vertical; outline: none;
}

/* ============ TOGGLE SWITCH (admin conversations list) ============ */
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--bg-input);
  border-radius: 20px; transition: background .15s ease;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px;
  background: var(--text-muted); border-radius: 50%; transition: transform .15s ease, background .15s ease;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-soft); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: var(--accent); }
.conv-row { display: flex; align-items: center; gap: 12px; }
.conv-row .ar-name { flex: 1; }

/* ============ MESSAGE ATTACHMENTS / FILES ============ */
.msg-attachment { margin-top: 4px; max-width: 360px; flex-basis: 100%; }
.msg-attachment img { max-width: 100%; max-height: 300px; border-radius: 8px; display: block; }
.msg-file-card {
  display: flex; align-items: center; gap: 10px; background: var(--bg-input); border-radius: 8px;
  padding: 10px 14px; margin-top: 4px; max-width: 320px; color: var(--text-normal);
}
.msg-file-card:hover { background: var(--bg-modifier-selected); }
.mfc-icon { display: flex; color: var(--text-muted); flex-shrink: 0; width: 22px; height: 22px; }
.mfc-body { display: flex; flex-direction: column; min-width: 0; }
.mfc-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfc-size { font-size: 12px; color: var(--text-faint); }
#upload-progress { padding: 6px 4px 0; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.msg-attachment-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-width: 400px;
}
.msg-attachment-grid img { width: 100%; height: 140px; max-height: 140px; object-fit: cover; }
.msg-att-item { position: relative; }
.msg-att-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .1s ease; cursor: pointer;
}
.msg-att-item:hover .msg-att-del { opacity: 1; }
.msg-att-del:hover { background: var(--danger); }
.msg-att-del .i svg { width: 12px; height: 12px; }
/* file cards: a download button that is always visible, and the delete button moves to the card's corner so they don't overlap */
.msg-att-item.is-file { width: fit-content; max-width: 100%; }
.msg-att-item.is-file .msg-file-card { padding-right: 56px; }
.msg-att-dl {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; padding: 0; text-decoration: none; transition: filter .12s ease, transform .12s ease;
}
.msg-att-dl:hover { filter: brightness(1.15); transform: translateY(-50%) scale(1.08); }
.msg-att-dl .i { display: flex; }
.msg-att-dl .i { width: 18px; height: 18px; }
.msg-att-item.is-file .msg-att-del { top: -7px; right: -7px; }
/* audio / video players inside a message */
.msg-att-item.is-media { width: 100%; }
.msg-media-card { background: var(--bg-input); border-radius: 8px; padding: 8px; margin-top: 4px; width: 100%; box-sizing: border-box; }
.msg-media { display: block; width: 100%; border-radius: 6px; outline: 0; }
.msg-media-video { max-height: 320px; background: #000; }
.msg-media-audio { height: 40px; }
.msg-media-cap { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
.msg-media-cap .mfc-icon { width: 18px; height: 18px; }
.mmc-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmc-size { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.msg-media-dl {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; text-decoration: none; transition: filter .12s ease, transform .12s ease;
}
.msg-media-dl:hover { filter: brightness(1.15); transform: scale(1.08); }
.msg-media-dl .i { display: flex; width: 15px; height: 15px; }
.msg-media-err { padding: 10px 12px; font-size: 13px; color: var(--text-muted); }
.msg-att-item.is-media .msg-att-del { top: -7px; right: -7px; }

/* ============ STAGED ATTACHMENTS (draft strip above composer) ============ */
.attachment-draft {
  display: flex; gap: 10px; padding: 12px 16px 0; overflow-x: auto;
}
.draft-card { flex-shrink: 0; width: 88px; }
.draft-card-thumb {
  position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden;
  background: var(--bg-input); display: flex; align-items: center; justify-content: center;
}
.draft-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.draft-file-icon { color: var(--text-muted); width: 32px; height: 32px; }
.draft-card-actions {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(0,0,0,.45); opacity: 0; transition: opacity .1s ease;
}
.draft-card-thumb:hover .draft-card-actions { opacity: 1; }
.draft-action-btn {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(30,31,34,.85); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.draft-action-btn .i { width: 14px; height: 14px; }
.draft-action-btn:hover { background: var(--bg-modifier-selected); }
.draft-action-btn.danger:hover { background: var(--danger); }
.draft-card-name {
  font-size: 11px; color: var(--text-muted); margin-top: 4px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ============ MENTIONS ============ */
.mention-pill { color: var(--text-link); background: var(--accent-soft); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.msg-link:hover { text-decoration: underline; }
.mention-pill.mention-glow { color: #fff; background: color-mix(in srgb, var(--accent) 40%, transparent); }
.mention-pill.mention-glow.mention-self { font-weight: 700; }

#mention-popup {
  position: fixed; width: 240px; max-width: calc(100% - 32px);
  background: var(--bg-floating); border-radius: 8px; padding: 6px; box-shadow: 0 8px 30px var(--shadow-color); z-index: 60;
}
.mention-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.mention-row .avatar { flex-shrink: 0; }
.mention-row-name { font-size: 14px; font-weight: 500; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-row-you { margin-left: auto; font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.mention-row.selected { background: var(--accent); }
.mention-row.selected .mention-row-name, .mention-row.selected .mention-row-you { color: #fff; }
.mention-hint { font-size: 11px; color: var(--text-faint); padding: 6px 8px 2px; border-top: 1px solid var(--divider); margin-top: 4px; }

/* ============ IMAGE PREVIEW MODAL (staged attachment eye icon) ============ */
.image-preview-box { position: relative; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: flex-start; }
.image-preview-scroller { max-width: 92vw; max-height: 86vh; overflow: hidden; border-radius: 8px; line-height: 0; }
.image-preview-scroller img { display: block; width: var(--fit-w, auto); max-width: 92vw; max-height: 86vh; height: auto; border-radius: 8px; cursor: zoom-in; user-select: none; -webkit-user-drag: none; transition: width .26s cubic-bezier(.2,.8,.2,1); }
/* zoom level 1: Discord-style "bigger" — fills the screen and can be panned */
.image-preview-box.zoom-1 .image-preview-scroller { overflow: auto; }
.image-preview-box.zoom-1 .image-preview-scroller img { max-width: none; max-height: none; width: var(--zoom-w, auto); cursor: zoom-out; }
.image-preview-box.no-anim .image-preview-scroller img { transition: none; }
/* open / close animation */
.image-preview-box.opening { animation: frxImgIn .22s cubic-bezier(.2,.8,.2,1); }
@keyframes frxImgIn { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
#image-preview-modal.closing { animation: frxImgFadeOut .16s ease forwards; pointer-events: none; }
#image-preview-modal.closing .image-preview-box { animation: frxImgOut .16s ease forwards; }
@keyframes frxImgFadeOut { to { opacity: 0; } }
@keyframes frxImgOut { to { transform: scale(.92); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .image-preview-scroller img { transition: none; }
  .image-preview-box.opening, #image-preview-modal.closing, #image-preview-modal.closing .image-preview-box { animation: none; }
}
.image-preview-close { position: absolute; top: -32px; right: 0; color: #fff; font-size: 22px; cursor: pointer; }
.image-preview-close:hover { color: var(--text-muted); }
.image-preview-open { margin-top: 8px; color: #fff; opacity: .7; font-size: 13px; text-decoration: none; }
.image-preview-open:hover { opacity: 1; text-decoration: underline; }
.image-preview-links { display: flex; gap: 16px; align-items: center; }
button.image-preview-open { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; cursor: pointer; }
/* right-clicking a picture in the computer app (copyImage()) */
.img-menu { position: fixed; z-index: 400; min-width: 168px; padding: 6px; background: var(--bg-floating); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.img-menu button { background: none; border: 0; text-align: left; padding: 7px 8px; border-radius: 3px; color: var(--text-normal);
  font: inherit; font-size: 14px; cursor: pointer; }
.img-menu button:hover { background: var(--accent); color: #fff; }
.img-menu button[disabled] { opacity: .4; cursor: default; }
.img-menu button[disabled]:hover { background: none; color: var(--text-normal); }
.msg-attachment img:not(.custom-emoji) { cursor: zoom-in; }

/* ============ STICKERS ============ */
/* inline-block (not block) so this shrinks to the sticker's own width —
   same reasoning as .msg-row-wrap above, so the hover toolbar sits next
   to the sticker instead of off to the right of the whole row. */
.msg-row-wrap.is-sticker { display: inline-block; min-width: 138px; }
.msg-sticker { width: 128px; height: 128px; object-fit: contain; display: block; }
#sticker-picker-panel {
  position: absolute; bottom: 74px; right: 16px; width: 300px; max-width: calc(100% - 32px);
  background: var(--bg-floating); border-radius: 8px; padding: 12px; box-shadow: 0 8px 30px var(--shadow-color); z-index: 50;
}
.sticker-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; max-height: 260px; overflow-y: auto; }
.sticker-grid button { height: auto !important; padding: 4px !important; }
.sticker-grid img { width: 100%; height: 80px; object-fit: contain; }
.admin-sticker-list { display: flex; flex-wrap: wrap; gap: 10px; max-height: 260px; overflow-y: auto; }

/* ============ GIF PICKER (Tenor) ============ */
#gif-picker-panel {
  position: absolute; bottom: 74px; right: 16px; width: 340px; max-width: calc(100% - 32px);
  background: var(--bg-floating); border-radius: 8px; padding: 12px; box-shadow: 0 8px 30px var(--shadow-color); z-index: 50;
}
.gif-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 300px; overflow-y: auto; }
.gif-thumb { border-radius: 6px; overflow: hidden; padding: 0; }
.gif-thumb img { width: 100%; display: block; border-radius: 6px; }
.gif-thumb:hover img { opacity: .85; }
.gif-attribution { font-size: 10px; color: var(--text-faint); text-align: right; margin-top: 6px; }

/* ============================================================
   PHONE LAYOUT (not tablets — iPad's narrowest width is 768px,
   safely above this threshold). One pane visible at a time:
   the server rail stays put, and the channel/DM list slides
   for the chat area via a class on #app.

   This has to trigger the same way in landscape as it does in
   portrait, or rotating the phone drops back into the desktop
   layout. Checking max-width alone only catches portrait — a
   phone turned sideways reports a viewport width around 700-900px,
   which used to fall into the tablet/desktop breakpoint instead.
   So this checks whichever dimension is the "short" one (width in
   portrait, height in landscape), scoped to touch devices via
   (hover: none) and (pointer: coarse) so a resized desktop browser
   window doesn't get mistaken for a phone.
   ============================================================ */
@media (hover: none) and (pointer: coarse) and (max-width: 600px),
       (hover: none) and (pointer: coarse) and (max-height: 600px) {
  #title-bar { display: none; }
  #page-body { height: 100%; min-height: 0; }

  /* Hover doesn't really exist on touch — hold a message to bring up
     the action sheet instead (see setupMessageLongPress in script.js). */
  .msg-line:hover .msg-hover-actions, .msg-hover-actions { display: none !important; }

  /* Keep the compact rail in the conversation list, but let the active
     chat span the entire screen. Keeping it beside the chat was what made
     the composer and messages feel cramped on narrow phones. */
  #app, #app.member-list-open { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
  /* #main-col spans column 1/-1 (so it can slide over the rail) and
     #side-panel is pinned to column 2 — both have explicit placement.
     Without an explicit placement of its own, #server-rail's auto-placement
     finds row 1 already fully claimed by those two spans and drops itself
     into a new implicit row instead, which is what pushed it below the
     rest of the layout instead of beside it. Pin it explicitly so it
     always lands in row 1, column 1. */
  #server-rail { grid-column: 1; grid-row: 1; width: 56px; padding: 8px 0; }
  .rail-item { width: 42px; height: 42px; font-size: 13px; }

  #side-panel, #main-col {
    grid-row: 1; min-width: 0; display: flex;
    transition: transform .28s cubic-bezier(.25,.75,.4,1);
  }
  #side-panel { grid-column: 2 / 3; }
  #main-col { grid-column: 1 / -1; z-index: 2; }
  #side-panel { transform: translateX(0); }
  #main-col { transform: translateX(100%); }
  #app.mobile-show-chat #side-panel { transform: translateX(-100%); }
  #app.mobile-show-chat #main-col { transform: translateX(0); }
  #app.mobile-dragging #side-panel, #app.mobile-dragging #main-col { transition: none; }

  .mobile-back-btn { display: flex; }

  /* member list becomes a full-screen overlay instead of a 4th column */
  #member-panel { display: none; }
  #app.member-list-open #member-panel {
    display: block; position: fixed; inset: 0; top: 32px; z-index: 45;
    width: 100%; height: calc(100% - 32px); padding: 16px 12px;
  }

  #chat-header { height: 52px; padding: 0 8px; gap: 6px; }
  #chat-header .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-header-actions { gap: 0; }
  .hdr-icon-btn, #chat-header .members-toggle { width: 28px; height: 30px; }
  #messages { padding-top: 8px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .msg-group { gap: 10px; padding: 2px 12px; }
  .msg-group .avatar { width: 36px; height: 36px; }
  .msg-text { font-size: 15px; }

  /* A one-line preview keeps DM navigation readable without turning the
     list into a second message view. It is deliberately phone-only. */
  .dm-row { padding: 8px; margin-bottom: 2px; align-items: center; }
  .dm-preview { display: block; }
  .dm-row.active .dm-preview { color: var(--text-muted); }

  #composer-wrap {
    padding: 0 8px max(10px, env(safe-area-inset-bottom));
    background: var(--bg-primary); z-index: 3;
  }
  #composer { min-height: 48px; border-radius: 8px; padding: 0 8px; gap: 2px; }
  #composer textarea { min-width: 0; min-height: 46px; padding: 12px 4px; font-size: 16px; }
  .composer-icon-btn { width: 32px; height: 34px; }
  #emoji-picker-panel, #sticker-picker-panel, #gif-picker-panel, .composer-action-menu { bottom: 66px; }

  /* modals: fit the screen, stack multi-column layouts */
  .modal-box, .modal-box.wide, .admin-box, .profile-box { width: 94vw; max-width: 94vw; }
  #settings-modal .modal-box { width: 94vw; height: 88vh; flex-direction: column; }
  #settings-nav { width: 100%; display: flex; flex-wrap: wrap; gap: 2px; padding: 10px; }
  #settings-nav .nav-label { display: none; }
  #settings-content { padding: 20px; }
  .admin-layout { flex-direction: column; height: auto; }
  .admin-left { width: 100%; }
  .admin-right { border-left: none; border-top: 1px solid var(--divider); padding-left: 0; padding-top: 16px; }
  .ab-row { flex-wrap: wrap; }

  #emoji-picker-panel, #sticker-picker-panel, #gif-picker-panel { left: 8px; right: 8px; width: auto; }
  .composer-action-menu { left: 8px; width: 200px; }
  .mp-header { gap: 12px; padding: 0 12px; flex-wrap: wrap; height: auto; min-height: 48px; padding-top: 8px; padding-bottom: 8px; }
  .friends-tabs { flex-wrap: wrap; }

  /* polls: give the card the full message width instead of a fixed max */
  .poll-card { max-width: 100%; }
  .poll-modal-box { width: 94vw; }
}

/* Keep the essentials reachable on very narrow phone screens. */
@media (max-width: 350px) {
  #gift-btn, #gif-btn, #sticker-btn { display: none; }
  #composer { padding: 0 6px; }
  .composer-icon-btn { width: 30px; }
}

/* ============================================================
   DISCORD-PARITY POLISH LAYER
   Appended overrides that bring spacing, switches, presence, and
   mobile behaviour in line with Discord's current client. Kept in one
   block at the end so it wins the cascade over the older rules above.
   ============================================================ */

/* ---- Discord-style toggle switches (every on/off control) ---- */
.toggle-switch { width: 40px; height: 24px; }
.toggle-slider { background: #80848e; border-radius: 14px; transition: background .2s ease; }
.toggle-slider::before {
  width: 18px; height: 18px; left: 3px; top: 3px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), background .2s ease;
}
/* tiny "x" / check drawn on the knob, like Discord */
.toggle-slider::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6.5 6.5l7 7M13.5 6.5l-7 7' stroke='%2380848e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat;
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.toggle-switch input:checked + .toggle-slider { background: var(--online); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: #fff; }
.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(16px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%2323a55a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.toggle-switch input:focus-visible + .toggle-slider { box-shadow: 0 0 0 2px var(--accent); }
.toggle-switch input:disabled + .toggle-slider { opacity: .5; cursor: default; }

.role-perm-row input[type="checkbox"],
.friend-pick-row input[type="checkbox"],
.re-member-addable input[type="checkbox"] {
  width: 40px; height: 24px; min-width: 40px; border-radius: 14px; border: none; background: #80848e;
}
.role-perm-row input[type="checkbox"]::before,
.friend-pick-row input[type="checkbox"]::before,
.re-member-addable input[type="checkbox"]::before {
  width: 18px; height: 18px; top: 3px; left: 3px;
}
.role-perm-row input[type="checkbox"]:checked,
.friend-pick-row input[type="checkbox"]:checked,
.re-member-addable input[type="checkbox"]:checked { background: var(--online); }
.role-perm-row input[type="checkbox"]:focus-visible,
.friend-pick-row input[type="checkbox"]:focus-visible,
.re-member-addable input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
/* Permission rows: label on the left, switch on the right, like Discord */
.role-perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.role-perm-row:last-child { border-bottom: none; }
.role-perm-row > span { display: flex; flex-direction: column; gap: 2px; }
.role-perm-row small { color: var(--text-muted); font-size: 12px; }

/* ---- Mobile presence: phone glyph replaces the status dot ---- */
.avatar .status-dot.mobile { width: auto; height: auto; background: transparent !important; border-radius: 0; display: flex; }
.status-phone { display: block; }
.status-dot.mobile .phone-body { fill: var(--online); }
.status-dot.mobile .phone-screen { fill: #fff; }
.status-dot.mobile.idle .phone-body { fill: var(--idle); }
.status-dot.mobile.dnd .phone-body { fill: var(--dnd); }
.status-dot.mobile.idle .phone-screen, .status-dot.mobile.dnd .phone-screen { fill: rgba(255,255,255,.9); }

/* ---- Server rail: Discord's pill + hover shape ---- */
.rail-item { transition: border-radius .2s ease, background .2s ease, color .2s ease; }
.rail-item.dm-item { background: var(--bg-secondary); color: var(--text-normal); }
.rail-item.dm-item.active, .rail-item.dm-item:hover { background: var(--accent); color: #fff; }
.rail-item:not(.active):not(.dm-item):not(.action):not(.explore-btn):hover { background: var(--accent); }
.rail-item.action, .rail-item.explore-btn { background: var(--bg-secondary); }
.rail-item.action:hover, .rail-item.explore-btn:hover { border-radius: 16px; }

/* ---- Sidebar / channel list ---- */
#side-header { font-size: 15px; box-shadow: 0 1px 0 rgba(0,0,0,.24), 0 1.5px 0 rgba(0,0,0,.05), 0 2px 0 rgba(0,0,0,.05); }
.channel-row, .dm-row { padding: 6px 8px; min-height: 34px; font-size: 16px; font-weight: 500; margin-bottom: 2px; }
.channel-row .hash { font-size: 20px; line-height: 1; opacity: .6; }
.channel-row.active .hash { opacity: 1; }
.side-section-label { font-size: 12px; letter-spacing: .02em; padding: 16px 8px 4px; }
.side-section-label:hover { color: var(--text-normal); }
.home-nav-item { border-radius: 4px; }

/* ---- User panel (bottom-left) ---- */
#user-panel { height: 52px; padding: 0 8px; }
#user-panel .who { padding: 4px 8px; }
#user-panel .utag { font-size: 12px; line-height: 1.2; }

/* ---- Chat header & messages ---- */
#chat-header { box-shadow: 0 1px 0 rgba(0,0,0,.24), 0 1.5px 0 rgba(0,0,0,.05), 0 2px 0 rgba(0,0,0,.05); z-index: 1; position: relative; }
#chat-header .hash { color: var(--text-muted); }
.hdr-icon-btn:hover, #chat-header .members-toggle:hover { color: var(--text-normal); }

/* ---- Buttons & inputs ---- */
.btn-primary, .btn-accent-inline, .btn-danger, .btn-secondary { border-radius: 3px; font-weight: 500; transition: background .17s ease, color .17s ease; }
.btn-primary { padding: 12px; min-height: 44px; font-size: 16px; }
.field input, .field textarea, .field select { background: var(--bg-deepest); border-radius: 3px; border: 1px solid transparent; }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: none; border-color: var(--accent); }
.field label { font-size: 12px; letter-spacing: .02em; }

/* ---- Auth card: Discord login look ---- */
.auth-card { width: 480px; border-radius: 5px; padding: 32px; }
.auth-card h1 { font-size: 24px; }
.auth-card p.sub { font-size: 16px; }

/* ---- Modals ---- */
.modal-box { border-radius: 4px; }
.modal-overlay { backdrop-filter: none; background: rgba(0,0,0,.7); }

/* ---- Touch devices: fix the member-list overlay leaving a title-bar gap
   (the title bar is hidden on phones, so there is nothing to offset) ---- */
@media (hover: none) and (pointer: coarse) and (max-width: 600px),
       (hover: none) and (pointer: coarse) and (max-height: 600px) {
  #app.member-list-open #member-panel { top: 0; height: 100%; padding-top: max(16px, env(safe-area-inset-top)); }
  #inbox-popover, #help-popover { top: 8px; }
}
/* Real-device class set by script.js — narrow browser windows on a phone
   that report hover:hover (some Android browsers) still get phone layout. */
body.is-mobile #title-bar { display: none; }
body.is-mobile #page-body { height: 100%; }
body.is-mobile #app.member-list-open #member-panel { top: 0; height: 100%; }
body.is-mobile .msg-hover-actions { display: none !important; }
body.is-mobile .channel-row, body.is-mobile .dm-row, body.is-mobile .home-nav-item { min-height: 42px; }
body.is-mobile .rail-item { width: 44px; height: 44px; }

/* ============================================================
   FRIXION 3.1 POLISH LAYER
   Modal stacking fixes, Discord-parity Server Settings + Roles,
   shop card centering, and Gradient Banners.
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }

@keyframes frxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes frxPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes frxSlideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes frxSettingsIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes frxShake {
  0%, 100% { transform: none; }
  10%, 50%, 90% { transform: translateX(-6px); background: var(--danger); }
  30%, 70% { transform: translateX(6px); background: var(--danger); }
}
@keyframes frxBannerFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ---- Modal stacking: a confirmation always sits above whatever opened it ---- */
.modal-overlay { z-index: 100; animation: frxFade .14s ease; }
.ds-settings-layer { z-index: 150; }
#confirm-modal { z-index: 400; }
#toast-stack { z-index: 1000; }
.modal-overlay:not(.ds-settings-layer) > .modal-box {
  animation: frxPop .18s cubic-bezier(.2,.9,.3,1.15);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 16px 48px rgba(0,0,0,.5);
}
.modal-header-row { align-items: center; gap: 12px; margin-bottom: 8px; }
.modal-header-row .x {
  width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; font-size: 18px; transition: background .12s ease, color .12s ease;
}
.modal-header-row .x:hover { background: var(--bg-modifier-hover); }

/* ---- Discord-style confirmation dialog ---- */
#confirm-modal .modal-box { width: 540px; padding: 0; overflow: hidden; background: var(--bg-primary); }
#confirm-modal .modal-header-row { padding: 20px 16px 0; margin: 0; }
#confirm-modal h2 { font-size: 24px; font-weight: 700; margin: 0; }
#confirm-modal p.desc { padding: 14px 20px 24px; margin: 0; font-size: 17px; line-height: 1.4; color: var(--text-normal); opacity: .85; }
#confirm-modal .modal-actions { margin: 0; padding: 16px; background: var(--bg-secondary); }
#confirm-modal .btn-secondary { background: transparent; }
#confirm-modal .btn-secondary:hover { background: transparent; text-decoration: underline; }

/* ---- Buttons ---- */
.btn-accent-inline, .btn-danger, .btn-secondary { min-height: 38px; padding: 2px 16px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-accent-inline.slim, .btn-secondary.slim { min-height: 32px; padding: 2px 12px; font-size: 13px; }
button:focus-visible, [tabindex]:focus-visible, .ds-nav-item:focus-visible { outline: 2px solid var(--text-link); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0;
  min-height: 38px; padding: 2px 16px; border-radius: 3px; font-size: 14px; font-weight: 500;
  color: #fff; white-space: nowrap; transition: background .17s ease, color .17s ease, border-color .17s ease;
}
.ds-btn-sm { min-height: 32px; padding: 2px 14px; }
.ds-btn-brand { background: var(--accent); }
.ds-btn-brand:hover { background: var(--accent-hover); }
.ds-btn-green { background: #248046; }
.ds-btn-green:hover { background: #1a6334; }
.ds-btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.ds-btn-danger-outline:hover { background: var(--danger); color: #fff; }
.ds-link-btn { background: none; color: var(--text-normal); font-size: 14px; font-weight: 500; padding: 2px 4px; flex-shrink: 0; }
.ds-link-btn:hover { text-decoration: underline; }

/* ---- Small global touches ---- */
.channel-row, .dm-row, .home-nav-item, .friends-tab, .shop-tab, .admin-tab, .shop-mgr-tab, .explore-server-row { transition: background .12s ease, color .12s ease, box-shadow .15s ease; }
.explore-server-row:hover { background: var(--bg-tertiary); }
.toast { border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: frxSlideUp .2s ease; }
/* The tabs wrap onto another row when they don't all fit, so every tab stays in sight. They used to scroll sideways
   with no scrollbar showing, which hid the last ones past the edge (Purge Perms, v4.59). */
.admin-tabs { flex-wrap: wrap; row-gap: 2px; }
.admin-tab { white-space: nowrap; flex-shrink: 0; }
.admin-block, .admin-block:last-child {
  background: var(--bg-secondary); border: 1px solid var(--divider); border-radius: 8px;
  padding: 16px; margin-bottom: 14px;
}
.admin-pane { padding-top: 14px; }
.admin-chip-price { font-size: 11px; font-weight: 700; color: #f0b232; }

/* ============ SERVER SETTINGS — full-screen, Discord layout ============ */
.ds-settings-layer { background: var(--bg-primary); align-items: stretch; justify-content: stretch; animation: frxSettingsIn .2s ease; }
.ds-settings { display: flex; width: 100%; height: 100%; }
.ds-sidebar { flex: 1 0 288px; display: flex; justify-content: flex-end; background: var(--bg-secondary); overflow-y: auto; }
.ds-sidebar-inner { width: 288px; padding: 72px 10px 72px 24px; display: flex; flex-direction: column; gap: 2px; }
.ds-nav-label {
  padding: 8px 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ds-nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 42px;
  padding: 8px 12px; border-radius: 6px; text-align: left; font-size: 17px; font-weight: 500; line-height: 20px;
  color: var(--text-muted); transition: background .12s ease, color .12s ease;
}
.ds-nav-item:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.ds-nav-item.on { background: var(--bg-modifier-selected); color: var(--text-normal); }
.ds-nav-item.ds-nav-danger { color: #f23f42; }
.ds-nav-item.ds-nav-danger:hover { background: rgba(242,63,66,.1); color: #f23f42; }
.ds-nav-sep { height: 1px; margin: 8px 10px; background: var(--divider); }
.ds-content { flex: 1 1 800px; display: flex; align-items: flex-start; overflow-y: auto; background: var(--bg-primary); }
.ds-content-inner { flex: 1 1 auto; max-width: 960px; min-width: 0; padding: 72px 48px 96px; }
.ds-close-wrap {
  position: sticky; top: 60px; margin-top: 60px; margin-right: 21px; flex: 0 0 36px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ds-close {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--text-muted); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ds-close:hover { background: var(--bg-modifier-hover); color: var(--text-normal); border-color: var(--text-normal); }
.ds-close-kbd { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.ss-h2 { font-size: 20px; font-weight: 700; line-height: 24px; color: var(--text-normal); margin-bottom: 20px; }
.ss-desc { font-size: 14px; line-height: 1.4; color: var(--text-muted); margin: -12px 0 20px; }
.ss-hint { font-size: 14px; line-height: 1.4; color: var(--text-muted); margin: 8px 0 16px; }
.ss-divider { height: 1px; background: var(--divider); margin: 28px 0; }
.ss-overview-top { display: flex; align-items: center; gap: 24px; }
.ss-grow { flex: 1; min-width: 0; margin: 0; }
.ss-icon-preview {
  width: 100px; height: 100px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.08);
}
.ss-invite-row { display: flex; gap: 8px; }
.ss-invite-row input { flex: 1; min-width: 0; }
.ss-footer-actions { display: flex; justify-content: flex-end; }
.ds-settings .field input:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Roles: list view ---- */
.dr-default-card {
  width: 100%; display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 24px;
  border-radius: 8px; background: var(--bg-secondary); text-align: left; transition: background .12s ease;
}
.dr-default-card:hover { background: var(--bg-tertiary); }
.dr-default-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center; color: var(--text-normal);
}
.dr-default-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dr-default-text b { font-size: 16px; font-weight: 600; color: var(--text-normal); }
.dr-default-text small { font-size: 14px; color: var(--text-muted); }
.dr-chevron { display: flex; color: var(--text-muted); }
.dr-toolbar, .dr-perm-toolbar { display: flex; align-items: center; gap: 16px; }
.dr-perm-toolbar { margin-bottom: 24px; }
.dr-search { position: relative; display: flex; align-items: center; }
.dr-grow { flex: 1; min-width: 0; }
.dr-search input {
  width: 100%; height: 34px; padding: 0 32px 0 10px; border: none; border-radius: 4px; outline: none;
  background: var(--bg-deepest); color: var(--text-normal); font-size: 14px;
}
.dr-search input::placeholder { color: var(--text-faint); }
.dr-search input:focus { box-shadow: 0 0 0 1px var(--accent); }
.dr-search-icon { position: absolute; right: 9px; display: flex; color: var(--text-muted); pointer-events: none; }
.dr-table { margin-top: 8px; }
.dr-thead, .dr-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 56px; align-items: center; }
.dr-thead {
  padding: 0 8px 8px 30px; border-bottom: 1px solid var(--divider);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted);
}
.dr-row { min-height: 60px; padding: 0 8px; border-bottom: 1px solid var(--divider); border-radius: 4px; cursor: pointer; transition: background .1s ease; }
.dr-row:hover { background: var(--bg-modifier-hover); }
.dr-cell-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dr-drag { width: 14px; flex-shrink: 0; display: flex; color: var(--text-faint); opacity: 0; cursor: grab; }
.dr-row:hover .dr-drag { opacity: 1; }
.dr-shield { display: flex; flex-shrink: 0; }
.dr-name { font-size: 16px; font-weight: 500; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-cell-members { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); }
.dr-cell-actions { display: flex; justify-content: flex-end; }
.dr-icon-btn {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--bg-secondary); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: background .12s ease, color .12s ease;
}
.dr-row:hover .dr-icon-btn, .dr-icon-btn:hover { background: var(--bg-tertiary); color: var(--text-normal); }
.dr-row.dragging, .dr-side-row.dragging { opacity: .4; }
.dr-row.drag-over, .dr-side-row.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.dr-empty { padding: 24px 8px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* ---- Roles: edit view ---- */
.dr-edit { display: flex; align-items: flex-start; }
.dr-edit-side {
  position: sticky; top: 0; width: 200px; flex-shrink: 0; max-height: calc(100dvh - 140px);
  display: flex; flex-direction: column; padding-right: 16px; margin-right: 24px; border-right: 1px solid var(--divider);
}
.dr-edit-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dr-back { display: flex; align-items: center; gap: 6px; padding: 6px 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.dr-back:hover { color: var(--text-normal); }
.dr-edit-side-head .dr-icon-btn { width: 28px; height: 28px; background: transparent; }
.dr-side-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.dr-side-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px;
  border-radius: 4px; text-align: left; font-size: 14px; font-weight: 500; color: var(--text-muted);
}
.dr-side-row:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.dr-side-row.on { background: var(--bg-modifier-selected); color: var(--text-normal); }
.dr-dot { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; }
.dr-side-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-edit-main { flex: 1; min-width: 0; }
.dr-edit-head h3 {
  margin-bottom: 16px; font-size: 16px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dr-tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--divider); overflow-x: auto; scrollbar-width: none; }
.dr-tab {
  flex-shrink: 0; padding: 0 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  font-size: 15px; font-weight: 500; color: var(--text-muted); transition: color .12s ease, border-color .12s ease;
}
.dr-tab:hover { color: var(--text-normal); border-bottom-color: rgba(255,255,255,.2); }
.dr-tab.on { color: var(--text-normal); border-bottom-color: var(--accent); }
.dr-locked { margin-bottom: 16px; padding: 10px 12px; border-radius: 4px; background: var(--accent-soft); color: var(--text-normal); font-size: 14px; }
.dr-everyone-note { margin-top: 0; }
.dr-req { color: var(--dnd); }
.dr-section-title { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); }
.dr-color-picker { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dr-color-big {
  position: relative; width: 66px; height: 50px; flex-shrink: 0; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.dr-color-custom input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: none; opacity: 0; cursor: pointer; }
.dr-dropper { position: absolute; top: 4px; right: 4px; display: flex; color: #fff; pointer-events: none; }
.dr-color-grid { display: grid; grid-template-columns: repeat(10, 20px); gap: 10px; }
.dr-color-sm { width: 20px; height: 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; }
.dr-color-sm svg { width: 12px; height: 12px; }
.dr-color-sm:hover, .dr-color-big:hover { filter: brightness(1.12); }
.dr-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dr-toggle-title { font-size: 16px; font-weight: 500; line-height: 1.25; color: var(--text-normal); }
.dr-perm-group { margin-bottom: 28px; }
.dr-perm-group > .dr-section-title { margin-bottom: 14px; }
.dr-perm-row { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--divider); }
.dr-perm-row:last-child { margin-bottom: 0; border-bottom: none; }
.dr-perm-desc { margin-top: 8px; padding-right: 56px; font-size: 14px; line-height: 1.4; color: var(--text-muted); }
.dr-member-list, .dr-add-panel { display: flex; flex-direction: column; gap: 2px; }
.dr-add-panel { max-height: 320px; overflow-y: auto; margin-bottom: 16px; padding: 12px; border-radius: 8px; background: var(--bg-secondary); }
.dr-member-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 4px; }
.dr-member-row:hover { background: var(--bg-modifier-hover); }
.dr-member-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dr-member-names b { font-size: 15px; font-weight: 600; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-member-names small { font-size: 13px; color: var(--text-muted); }
.dr-member-remove {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: var(--bg-secondary); transition: background .12s ease, color .12s ease;
}
.dr-member-remove:hover { background: var(--danger); color: #fff; }

/* Unsaved-changes notice — floats at the bottom like Discord's */
.ds-unsaved {
  position: sticky; bottom: 20px; z-index: 5; margin-top: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: 8px; background: #111214; color: #f2f3f5;
  font-size: 15px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: frxSlideUp .2s ease;
}
.ds-unsaved.shake { animation: frxShake .5s ease; }
.ds-unsaved-actions { display: flex; align-items: center; gap: 12px; }
.ds-unsaved .ds-link-btn { color: #f2f3f5; }

@media (max-width: 760px) {
  .ds-settings { flex-direction: column; }
  .ds-sidebar { flex: 0 0 auto; justify-content: flex-start; }
  .ds-sidebar-inner { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 60px 12px 12px; }
  .ds-nav-label { width: 100%; }
  .ds-nav-item { width: auto; }
  .ds-nav-sep { display: none; }
  .ds-content-inner { padding: 24px 16px 60px; }
  .ds-close-wrap { position: fixed; top: 12px; right: 12px; margin: 0; z-index: 2; }
  .ds-close-kbd { display: none; }
  .ss-overview-top { flex-direction: column; align-items: stretch; }
  .ss-icon-preview { width: 72px; height: 72px; font-size: 28px; }
  .dr-edit { flex-direction: column; align-items: stretch; }
  .dr-edit-side { position: static; width: 100%; max-height: 180px; margin: 0 0 16px; padding: 0 0 12px; border-right: none; border-bottom: 1px solid var(--divider); }
  .dr-thead, .dr-row { grid-template-columns: minmax(0, 1fr) 64px 44px; }
  .dr-toolbar { flex-wrap: wrap; }
  .dr-perm-desc { padding-right: 0; }
  .ds-unsaved { flex-direction: column; align-items: stretch; text-align: center; }
  .ds-unsaved-actions { justify-content: center; }
}

/* ============ SHOP — centered, even cards ============ */
.shop-grid .empty { grid-column: 1 / -1; }
.shop-item-card {
  position: relative; overflow: hidden; padding: 12px; gap: 6px; border-radius: 12px;
  background: var(--bg-secondary); border: 1px solid var(--divider);
}
.shop-item-card:hover { border-color: rgba(255,255,255,.14); }
.sic-preview {
  display: flex; align-items: center; justify-content: center; min-height: 108px; padding: 8px; margin-bottom: 6px;
  border-radius: 8px; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.07), transparent 68%), var(--bg-tertiary);
}
.sic-preview > * { max-width: 100%; }
.is-theme-card .sic-preview, .shop-item-card[data-cat="banners"] .sic-preview { min-height: 0; padding: 0; background: none; }
.sic-deco-stage { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; }
.sic-deco-stage .avatar { margin: 0 auto; }
/* Shop badges (v4.65) */
.sic-badge-preview { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.07), transparent 70%); }
.sic-badge-preview svg { filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); }
.shop-note { font-size: 13px; color: var(--text-muted); margin: 2px 0 10px; }
.sic-name { width: 100%; justify-content: center; text-align: center; line-height: 1.25; }
.sic-desc { width: 100%; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sic-btn { min-height: 32px; border-radius: 4px; }
.shop-empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; text-align: center;
  border: 1px dashed var(--divider); border-radius: 12px; font-size: 14px; color: var(--text-muted);
}
.shop-empty-state b { font-size: 16px; color: var(--text-normal); }

/* ---- Gradient Banners ---- */
.banner-anim { background-size: 220% 220% !important; animation: frxBannerFlow 6s ease infinite; }
.sic-banner-preview { position: relative; width: 100%; padding-bottom: 12px; border-radius: 8px; overflow: hidden; background: var(--bg-floating); text-align: left; }
.sic-banner-strip { height: 64px; }
.sic-banner-avatar { position: absolute; left: 12px; top: 36px; display: flex; padding: 4px; border-radius: 50%; background: var(--bg-floating); }
.sic-banner-lines { display: flex; flex-direction: column; gap: 6px; padding: 30px 12px 0; }
.sic-banner-lines span { height: 8px; width: 60%; border-radius: 4px; background: var(--bg-input); }
.sic-banner-lines span + span { width: 38%; }
.banner-editor { display: flex; gap: 20px; flex-wrap: wrap; }
.banner-editor-preview { width: 260px; max-width: 100%; flex-shrink: 0; }
.banner-editor .theme-editor-tools { flex: 1; min-width: 240px; }
.banner-mock { position: relative; overflow: hidden; padding-bottom: 16px; border-radius: 8px; background: var(--bg-floating); border: 1px solid var(--divider); }
.banner-mock-banner { height: 96px; }
.banner-mock-avatar { position: absolute; left: 14px; top: 58px; width: 68px; height: 68px; border-radius: 50%; background: var(--accent); border: 6px solid var(--bg-floating); }
.banner-mock-lines { display: flex; flex-direction: column; gap: 8px; padding: 40px 14px 0; }
.banner-mock-lines span { height: 10px; width: 55%; border-radius: 5px; background: var(--bg-input); }
.banner-mock-lines span + span { width: 35%; }
.banner-range { width: 100%; accent-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .banner-anim, .modal-overlay, .modal-box, .ds-unsaved, .toast { animation: none !important; }
}


/* ============ THEME-DRIVEN BUTTON GLOW ============
   Every hover glow derives from --accent, which the active Settings theme or
   Shop theme sets on <body>, so the glow always matches the current theme.
   color-mix() is used inline per rule (not via a :root variable) because a
   variable computed on :root would freeze the default accent and ignore a
   theme's override on <body>. */
.home-nav-item:hover, .channel-row:hover, .dm-row:hover, .friends-tab:hover,
.shop-tab:hover, .admin-tab:hover, .shop-mgr-tab:hover, .nav-item:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 12px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn-primary, .btn-accent-inline, .btn-secondary, .rail-item, .icon-btn, .hdr-icon-btn, .tb-icon-btn, .shop-icon-btn, .members-toggle {
  transition: background .12s ease, color .12s ease, box-shadow .15s ease, border-radius .15s ease;
}
.btn-primary:hover:not(:disabled), .btn-accent-inline:hover:not(:disabled) {
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 55%, transparent);
}
.btn-secondary:hover:not(:disabled) {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 12px color-mix(in srgb, var(--accent) 25%, transparent);
}
.rail-item:hover, .rail-item.active { box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 50%, transparent); }
.icon-btn:hover, .hdr-icon-btn:hover, .tb-icon-btn:hover, .shop-icon-btn:hover, .members-toggle:hover {
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
.shop-item-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 8px 20px rgba(0,0,0,.35), 0 0 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.tb-win-btn.tb-close:hover { box-shadow: none; }

/* ============ ADMIN: SHOP MANAGER SUB-TABS + EDITING ============ */
.shop-mgr-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.shop-mgr-tab {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: var(--bg-input);
}
.shop-mgr-tab:hover { color: var(--text-normal); }
.shop-mgr-tab.on { color: #fff; background: var(--accent); }
.shop-mgr-hint { display: block; margin-bottom: 12px; }
.admin-emoji-chip.editable { cursor: pointer; transition: box-shadow .15s ease, background .12s ease; }
.admin-emoji-chip.editable:hover { background: var(--bg-modifier-selected); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent); }
.admin-chip-emoji { font-size: 18px; line-height: 1; }
.admin-chip-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-faint); }
.admin-chip-deco { width: 22px; height: 22px; display: inline-flex; }
.admin-chip-deco svg { width: 22px; height: 22px; }
.admin-builtin-label { flex-basis: 100%; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-top: 8px; }

#shop-edit-modal { z-index: 300; }
#shop-edit-modal .modal-box { width: 460px; max-width: 94vw; max-height: 88vh; overflow-y: auto; }
.shop-edit-kind { font-size: 12px; color: var(--text-muted); margin: -6px 0 14px; }
.shop-edit-extra { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0 12px; }
.shop-edit-extra .field.full { grid-column: 1 / -1; }
.shop-edit-extra input[type="color"] { height: 38px; padding: 2px; cursor: pointer; }
.shop-edit-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-normal); margin: 4px 0 16px; cursor: pointer; }
.shop-edit-check input { width: 16px; height: 16px; accent-color: var(--accent); }
#shop-edit-modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#shop-edit-modal .modal-actions .spacer { flex: 1; }

/* ============ NEW BUILT-IN NAMEPLATES ============ */
.nameplate-sunset { background: linear-gradient(180deg, #ff7e5f 0%, #b2456e 55%, #3a1c4a 100%); }
.nameplate-sunset::before {
  content: ''; position: absolute; left: 50%; bottom: -30%; width: 60%; aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(255,214,120,.55), transparent 65%);
}
.nameplate-galaxy { background: linear-gradient(120deg, #1a0633, #0b1b4d, #3b0a45, #1a0633); background-size: 300% 300%; animation: nameplateAuroraShift 8s ease-in-out infinite; }
.nameplate-galaxy::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 40%, #fff, transparent), radial-gradient(2px 2px at 30% 70%, #cbb8ff, transparent),
    radial-gradient(1.5px 1.5px at 52% 30%, #fff, transparent), radial-gradient(2px 2px at 70% 62%, #9fd8ff, transparent),
    radial-gradient(1.5px 1.5px at 88% 28%, #fff, transparent);
  animation: nameplateTwinkle 2.2s ease-in-out infinite alternate;
}
.nameplate-lava { background: linear-gradient(90deg, #2a0500, #6b1300, #c43a00, #6b1300, #2a0500); background-size: 250% 100%; animation: nameplateLavaFlow 5s linear infinite; }
@keyframes nameplateLavaFlow { from { background-position: 0% 50%; } to { background-position: 250% 50%; } }

/* ============ MORE BUILT-IN PROFILE FRAMES (drawn the same way as PROFILE FRAMES above) ============ */
/* Emerald: a cut, faceted green stone */
.frame-emerald { --ring: 5px; --ring-bg: repeating-linear-gradient(135deg, #064e3b 0 7px, #10b981 7px 11px, #6ee7b7 11px 13px, #047857 13px 20px);
  box-shadow: inset 0 0 22px rgba(16,185,129,.24); }
/* Plasma: violet and cyan flowing round the ring, pulsing from one to the other */
.frame-plasma { --ring: 4px; --ring-bg: linear-gradient(135deg, #a855f7, #22d3ee, #a855f7, #22d3ee, #a855f7);
  animation: framePlasmaPulse 1.8s ease-in-out infinite alternate; }
.frame-plasma::before { background-size: 300% 300%; animation: framePlasmaFlow 4s linear infinite; }
@keyframes framePlasmaFlow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes framePlasmaPulse {
  from { box-shadow: inset 0 0 8px rgba(168,85,247,.6), inset 0 0 24px rgba(168,85,247,.18); }
  to { box-shadow: inset 0 0 12px rgba(34,211,238,.85), inset 0 0 32px rgba(34,211,238,.26); }
}

/* ============ THE BLACK HOLE AND SPACE SET (v4.72, request 84) ============
   Everything that moves here is also under Epilepsy mode further down. */
/* Event Horizon frame: hot light falling round the card, slowly turning, with a dark glow inside. The turn needs
   @property (an older browser shows the ring standing still). */
@property --eh-turn { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.frame-eventhorizon { --ring: 5px; box-shadow: inset 0 0 22px rgba(255,140,40,.35), inset 0 0 70px rgba(0,0,0,.45); }
.frame-eventhorizon::before {
  background: conic-gradient(from var(--eh-turn), #ff7a1a, #ffd9a0 12%, #fff6e6 18%, #ff9a3c 30%, #b23aff 52%, #2a0a45 66%, #c2410c 84%, #ff7a1a);
  animation: frameEventHorizonTurn 9s linear infinite;
}
@keyframes frameEventHorizonTurn { to { --eh-turn: 360deg; } }
/* Black Hole nameplate: a black hole at the right end, its tilted disk turning, with a few stars */
.nameplate-blackhole {
  background:
    radial-gradient(1.2px 1.2px at 8% 30%, #fff, transparent), radial-gradient(1px 1px at 22% 70%, #dfe6ff, transparent),
    radial-gradient(1.4px 1.4px at 38% 22%, #fff, transparent), radial-gradient(1px 1px at 55% 66%, #fff, transparent),
    radial-gradient(ellipse 40% 90% at 84% 50%, #2a1530 0%, rgba(42, 21, 48, 0) 70%),
    linear-gradient(90deg, #04030a, #0a0612);
}
.nameplate-blackhole::before, .nameplate-blackhole::after {
  content: ''; position: absolute; top: -45%; right: 3%; height: 190%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
}
.nameplate-blackhole::before {   /* the disk: a turning swirl, squashed into a tilted ring */
  background: conic-gradient(rgba(255,150,60,.1), rgba(255,180,90,.95), #fff4e0, rgba(255,120,40,.85), rgba(170,80,230,.5), rgba(255,150,60,.1));
  -webkit-mask: radial-gradient(closest-side, transparent 34%, #000 38%, #000 66%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 34%, #000 38%, #000 66%, transparent 100%);
  transform: scaleY(.3); animation: nameplateBlackHoleTurn 5s linear infinite;
}
@keyframes nameplateBlackHoleTurn { from { transform: scaleY(.3) rotate(0deg); } to { transform: scaleY(.3) rotate(360deg); } }
.nameplate-blackhole::after {   /* the hole, with a thin ring of bent light */
  background: radial-gradient(circle, #000 0 17%, #ffe9c8 18.5%, rgba(255,170,80,.6) 21%, rgba(255,140,50,.15) 27%, transparent 34%);
}
/* Planetrise nameplate: a planet's glowing edge curving along the bottom, with stars above */
.nameplate-planetrise {
  background:
    radial-gradient(1.3px 1.3px at 10% 24%, #fff, transparent), radial-gradient(1px 1px at 27% 46%, #e4ebff, transparent),
    radial-gradient(1.5px 1.5px at 45% 18%, #fff, transparent), radial-gradient(1px 1px at 63% 36%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 80% 20%, #fff, transparent), radial-gradient(1px 1px at 93% 44%, #dfe7ff, transparent),
    linear-gradient(180deg, #01020a 0%, #070c26 100%);
}
.nameplate-planetrise::before {
  content: ''; position: absolute; left: -80%; right: -120%; top: 64%; height: 600%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse 30% 8% at 50% 0%, #3b82d6 0%, #163f86 45%, #081a40 100%);
  box-shadow: 0 0 0 1px rgba(150, 210, 255, .6), 0 -3px 10px rgba(110, 180, 255, .75), 0 -10px 30px rgba(70, 140, 255, .35);
}
/* Black Hole theme: a black hole in the bottom-right corner of the screen, behind every panel, its disk slowly turning
   (body::before is the theme's gradient; this sits just above it). The Shop card draws a small one. */
body.shop-anim-blackhole::after, .sic-theme-preview.sic-theme-blackhole::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  right: -16vmin; bottom: -16vmin; width: 70vmin; height: 70vmin;
  background:
    radial-gradient(circle, #000 0 19%, rgba(255,236,206,.95) 20.5%, rgba(255,160,70,.7) 23%, rgba(255,120,40,.25) 30%, rgba(120,50,170,.12) 40%, transparent 52%),
    conic-gradient(rgba(255,150,60,0), rgba(255,170,80,.55) 60deg, rgba(255,236,206,.7) 110deg, rgba(255,120,40,.4) 170deg, rgba(160,70,220,.25) 240deg, rgba(255,150,60,.35) 300deg, rgba(255,150,60,0));
  -webkit-mask: radial-gradient(circle, #000 0 48%, transparent 70%);
  mask: radial-gradient(circle, #000 0 48%, transparent 70%);
  animation: shopBlackHoleTurn 60s linear infinite;
}
.sic-theme-preview.sic-theme-blackhole::before { position: absolute; z-index: 0; right: -34px; bottom: -52px; width: 190px; height: 190px; animation-duration: 24s; }
.sic-theme-blackhole .sic-theme-overlay,
.sic-theme-supernova .sic-theme-overlay,
.sic-theme-eclipse .sic-theme-overlay,
.sic-theme-nebula .sic-theme-overlay,
.sic-theme-crimsonrift .sic-theme-overlay { position: relative; z-index: 1; }
@keyframes shopBlackHoleTurn { to { transform: rotate(360deg); } }

/* ============ MORE W ANIMATED THEMES (v4.76, request 86) ============
   Supernova, Solar Eclipse, Cosmic Nebula, and Crimson Rift — each paints a
   slow ambient celestial centerpiece behind the translucent panels and a mini
   version on its Shop card. All four pause in Epilepsy mode and reduced motion. */
body.shop-anim-supernova::after, .sic-theme-preview.sic-theme-supernova::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  right: -14vmin; bottom: -14vmin; width: 74vmin; height: 74vmin;
  background:
    radial-gradient(circle, #fff8ec 0 6%, #ffd166 11%, rgba(255,77,148,.85) 18%, rgba(255,77,148,.12) 26%, rgba(255,209,102,.52) 31%, rgba(168,30,110,.15) 37%, transparent 50%),
    conic-gradient(rgba(255,77,148,0), rgba(255,209,102,.55) 28deg, rgba(255,77,148,.65) 75deg, rgba(168,30,110,.15) 125deg, rgba(255,236,190,.6) 185deg, rgba(255,77,148,.55) 250deg, rgba(130,40,210,.35) 310deg, rgba(255,77,148,0));
  -webkit-mask: radial-gradient(circle, #000 0 46%, transparent 72%);
  mask: radial-gradient(circle, #000 0 46%, transparent 72%);
  animation: shopBlackHoleTurn 48s linear infinite;
}
.sic-theme-preview.sic-theme-supernova::before { position: absolute; z-index: 0; right: -36px; bottom: -54px; width: 200px; height: 200px; animation-duration: 20s; }

body.shop-anim-eclipse::after, .sic-theme-preview.sic-theme-eclipse::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  right: -15vmin; bottom: -15vmin; width: 70vmin; height: 70vmin;
  background:
    radial-gradient(circle at 39% 39%, #fffdf5 0 3.2%, rgba(255,232,160,.85) 6.5%, transparent 15%),
    radial-gradient(circle, #010104 0 21%, #fff7df 22.3%, rgba(255,224,130,.85) 24.5%, rgba(255,190,85,.35) 31%, rgba(120,95,40,.12) 42%, transparent 55%),
    conic-gradient(from 25deg, rgba(255,224,130,.12), rgba(255,247,214,.65) 40deg, rgba(255,200,90,.2) 110deg, rgba(255,240,190,.55) 210deg, rgba(255,180,70,.18) 295deg, rgba(255,224,130,.12));
  -webkit-mask: radial-gradient(circle, #000 0 48%, transparent 72%);
  mask: radial-gradient(circle, #000 0 48%, transparent 72%);
  animation: shopBlackHoleTurn 70s linear infinite;
}
.sic-theme-preview.sic-theme-eclipse::before { position: absolute; z-index: 0; right: -34px; bottom: -52px; width: 192px; height: 192px; animation-duration: 28s; }

body.shop-anim-nebula::after, .sic-theme-preview.sic-theme-nebula::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  right: -18vmin; bottom: -18vmin; width: 82vmin; height: 82vmin;
  background:
    radial-gradient(1.6px 1.6px at 32% 38%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 56% 29%, #c7f9ff, transparent),
    radial-gradient(1.8px 1.8px at 44% 58%, #f0d6ff, transparent),
    radial-gradient(1.3px 1.3px at 66% 52%, #fff, transparent),
    radial-gradient(circle at 42% 45%, rgba(44,230,255,.55) 0%, rgba(44,230,255,.15) 24%, transparent 45%),
    radial-gradient(circle at 60% 56%, rgba(192,132,252,.58) 0%, rgba(124,58,237,.22) 26%, transparent 50%),
    conic-gradient(rgba(44,230,255,.08), rgba(44,230,255,.45) 85deg, rgba(192,132,252,.55) 175deg, rgba(236,72,153,.35) 255deg, rgba(56,189,248,.4) 320deg, rgba(44,230,255,.08));
  -webkit-mask: radial-gradient(circle, #000 0 46%, transparent 72%);
  mask: radial-gradient(circle, #000 0 46%, transparent 72%);
  animation: shopBlackHoleTurn 64s linear infinite reverse;
}
.sic-theme-preview.sic-theme-nebula::before { position: absolute; z-index: 0; right: -40px; bottom: -56px; width: 210px; height: 210px; animation-duration: 26s; }

body.shop-anim-crimsonrift::after, .sic-theme-preview.sic-theme-crimsonrift::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  right: -16vmin; bottom: -16vmin; width: 72vmin; height: 72vmin;
  background:
    radial-gradient(circle, #050002 0 18%, rgba(255,210,220,.92) 19.4%, rgba(255,41,87,.85) 22.5%, rgba(180,12,50,.35) 31%, rgba(90,6,34,.15) 42%, transparent 54%),
    conic-gradient(rgba(255,41,87,.05), rgba(255,60,100,.72) 55deg, rgba(255,190,205,.75) 105deg, rgba(220,20,60,.45) 175deg, rgba(140,10,60,.3) 245deg, rgba(255,41,87,.5) 315deg, rgba(255,41,87,.05));
  -webkit-mask: radial-gradient(circle, #000 0 48%, transparent 71%);
  mask: radial-gradient(circle, #000 0 48%, transparent 71%);
  animation: shopBlackHoleTurn 52s linear infinite;
}
.sic-theme-preview.sic-theme-crimsonrift::before { position: absolute; z-index: 0; right: -34px; bottom: -52px; width: 194px; height: 194px; animation-duration: 22s; }
@media (prefers-reduced-motion: reduce) {
  body.shop-anim-supernova::after, .sic-theme-preview.sic-theme-supernova::before,
  body.shop-anim-eclipse::after, .sic-theme-preview.sic-theme-eclipse::before,
  body.shop-anim-nebula::after, .sic-theme-preview.sic-theme-nebula::before,
  body.shop-anim-crimsonrift::after, .sic-theme-preview.sic-theme-crimsonrift::before { animation: none !important; }
}
.shop-collection .sic-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); margin-bottom: -4px; }


/* ============ OPAQUE OVERLAYS UNDER SHOP THEMES ============
   Shop themes make every panel color ~62% transparent so the gradient can
   show through the app. Anything layered ON TOP of the app (full-screen
   settings, modals, menus) then let the chat underneath bleed through.
   Painting the opaque theme gradient behind them fixes it on all screens. */
body.shop-theme-active .ds-settings-layer { background: var(--shop-theme-bg); }
body.shop-theme-active .modal-box,
body.shop-theme-active .server-menu {
  background: linear-gradient(var(--bg-floating), var(--bg-floating)), var(--shop-theme-bg);
  background-attachment: local, fixed;
}

/* ============ SERVER DROPDOWN MENU (Discord-style) ============ */
#side-panel { position: relative; }
#side-header-chevron { flex-shrink: 0; transition: transform .15s ease; }
#side-header[aria-expanded="true"] #side-header-chevron { transform: rotate(180deg); }
#side-header[aria-expanded="true"] { background: var(--bg-modifier-hover); }
.server-menu {
  position: absolute; top: 60px; left: 8px; right: 8px; max-width: 310px; margin-inline: auto; z-index: 60;
  padding: 6px 8px; border-radius: 8px; background: var(--bg-floating);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.45);
  animation: frxPop .14s cubic-bezier(.2,.9,.3,1.15); transform-origin: top center;
}
.server-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: 44px; padding: 8px 12px; border-radius: 6px; font-size: 16px; font-weight: 500;
  color: var(--text-normal); text-align: left;
}
.server-menu-item svg { flex-shrink: 0; opacity: .85; }
.server-menu-item:hover, .server-menu-item:focus-visible { background: var(--accent); color: #fff; outline: none; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.server-menu-item.danger { color: #f23f42; }
.server-menu-item.danger:hover, .server-menu-item.danger:focus-visible { background: #da373c; color: #fff; box-shadow: none; }
.server-menu-sep { height: 1px; margin: 4px 6px; background: var(--divider); }
@media (max-width: 768px) { .server-menu { max-width: none; } .server-menu-item { min-height: 42px; font-size: 15px; } }


/* ============ CHANNEL SETTINGS / SLOWMODE / INVITES ============ */
.chat-topic { min-width: 0; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--divider); color: var(--text-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) { .chat-topic { display: none; } }
.slowmode-indicator { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 0 16px 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.slowmode-indicator.active { color: var(--accent); }
#composer-input:disabled { cursor: not-allowed; opacity: .6; }
.ss-textarea { width: 100%; resize: vertical; min-height: 72px; font: inherit; }
.ss-nav-mod { margin-top: 12px; }
.cs-slow-val { margin-left: 8px; color: var(--accent); text-transform: none; }
.cs-range { width: 100%; accent-color: var(--accent); margin-top: 8px; }
.cs-private-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cs-private-title { font-weight: 600; color: var(--text-normal); }
.cs-perm-layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 768px) { .cs-perm-layout { grid-template-columns: 1fr; } }
.cs-col-head { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.cs-target-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.cs-target { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 10px; border-radius: 4px; color: var(--text-muted); font-weight: 500; text-align: left; }
.cs-target:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.cs-target.on { background: var(--bg-modifier-selected, var(--bg-modifier-hover)); color: var(--text-normal); }
.cs-target .cs-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cs-target .cs-tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-target .cs-rm { opacity: .6; font-size: 12px; padding: 0 4px; }
.cs-target .cs-rm:hover { opacity: 1; color: #f23f42; }
.cs-group-label { margin: 16px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.cs-group-label:first-child { margin-top: 0; }
.cs-perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.cs-perm-text { min-width: 0; }
.cs-perm-name { font-weight: 600; color: var(--text-normal); font-size: 15px; }
.cs-perm-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.tri { display: inline-flex; flex-shrink: 0; border: 1px solid var(--divider); border-radius: 4px; overflow: hidden; }
.tri button { width: 30px; height: 26px; display: grid; place-items: center; color: var(--text-muted); font-weight: 700; }
.tri button + button { border-left: 1px solid var(--divider); }
.tri button:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
.tri button.on[data-v="deny"] { background: #da373c; color: #fff; }
.tri button.on[data-v="inherit"] { background: #4e5058; color: #fff; }
.tri button.on[data-v="allow"] { background: #23a55a; color: #fff; }
.ss-search { width: 100%; margin-bottom: 12px; }
.bans-list { display: flex; flex-direction: column; }
.ban-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--divider); }
.ban-row .ban-name { flex: 1; min-width: 0; font-weight: 600; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; }
.bans-empty { padding: 32px 8px; text-align: center; color: var(--text-muted); }
.invite-preview { text-align: center; max-width: 440px; }
.invite-icon { width: 72px; height: 72px; margin: 4px auto 16px; border-radius: 22px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 26px; font-weight: 800; }
.invite-sub { color: var(--text-muted); font-size: 14px; }
.invite-name { margin: 4px 0 8px; font-size: 24px; }
.invite-desc { color: var(--text-normal); font-size: 14px; line-height: 1.4; margin-bottom: 8px; }
.invite-desc:empty { display: none; }
.invite-meta { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.invite-actions { justify-content: center; }
body.shop-theme-active .ds-settings-layer#channel-settings-modal { background: var(--shop-theme-bg); }

/* ============================================================
   FRIXION 3.2 FIX LAYER
   ============================================================ */

/* ---- Phone layout: stop hidden panes from bleeding through ----
   Shop themes make panel backgrounds translucent, so the server rail and
   channel list were visible underneath the open chat (and vice versa).
   The pane that isn't on screen is now hidden once its slide finishes;
   during a swipe (.mobile-dragging) both stay visible so the drag works. */
@media (hover: none) and (pointer: coarse) and (max-width: 600px),
       (hover: none) and (pointer: coarse) and (max-height: 600px) {
  #server-rail, #side-panel { transition: transform .28s cubic-bezier(.25,.75,.4,1), visibility 0s linear 0s; }
  #main-col { transition: transform .28s cubic-bezier(.25,.75,.4,1), visibility 0s linear .28s; visibility: hidden; background: var(--bg-primary); }
  #app.mobile-show-chat #main-col { visibility: visible; transition: transform .28s cubic-bezier(.25,.75,.4,1), visibility 0s linear 0s; }
  #app.mobile-show-chat #server-rail,
  #app.mobile-show-chat #side-panel { visibility: hidden; transition: transform .28s cubic-bezier(.25,.75,.4,1), visibility 0s linear .28s; }
  #app.mobile-dragging #server-rail, #app.mobile-dragging #side-panel, #app.mobile-dragging #main-col { visibility: visible !important; }
  body.shop-theme-active #main-col { background: color-mix(in srgb, var(--bg-primary) 92%, #000); }

  #chat-header .mobile-back-btn {
    width: 34px; height: 34px; flex-shrink: 0; align-items: center; justify-content: center;
    border-radius: 8px; color: var(--text-normal); margin-right: 2px;
  }
  #chat-header .mobile-back-btn:active { background: var(--bg-modifier-hover); }

  /* keyboard up: no home-indicator padding under the composer */
  body.keyboard-open #composer-wrap { padding-bottom: 6px; }
  #messages { overflow-anchor: none; }
  html, body { overscroll-behavior: none; }
}

/* ---- Mobile presence glyph (cut-out phone, no white fill) ---- */
.avatar .status-dot.mobile { padding: 0; align-items: center; justify-content: center; line-height: 0; }
.status-dot.mobile .status-phone { width: 100%; height: 100%; display: block; }
.status-dot.mobile .phone-body { fill: var(--online); }
.status-dot.mobile.idle .phone-body { fill: var(--idle); }
.status-dot.mobile.dnd .phone-body { fill: var(--dnd); }

/* ---- Long channel / category names never break the layout ---- */
.channel-row .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chat-header .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#side-header-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Permission editor: features that aren't in Frixion yet ---- */
.perm-soon-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; vertical-align: middle;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  background: var(--bg-modifier-selected); color: var(--text-muted);
}

/* ---- Info modals: nickname, audit log, insights ---- */
.frx-info-modal .modal-box { width: 460px; max-width: 94vw; max-height: 80vh; display: flex; flex-direction: column; padding: 20px; background: var(--bg-primary); }
.frx-info-modal .modal-header-row { display: flex; justify-content: space-between; }
.frx-info-modal h2 { font-size: 18px; font-weight: 700; }
.frx-info-modal .x { cursor: pointer; color: var(--text-muted); }
.frx-info-body { overflow-y: auto; min-height: 0; }
.frx-info-body .desc { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.frx-audit-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.frx-audit-list li { padding: 8px 10px; border-radius: 6px; font-size: 14px; line-height: 1.4; }
.frx-audit-list li:nth-child(odd) { background: var(--bg-secondary); }
.frx-audit-list time { display: block; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.frx-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.frx-stat { background: var(--bg-secondary); border-radius: 8px; padding: 14px 12px; }
.frx-stat-n { font-size: 24px; font-weight: 800; }
.frx-stat-l { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Manage member: timeout row ---- */
.mm-inline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mm-inline-row select { flex: 1; min-width: 140px; padding: 9px 10px; border-radius: 4px; border: 1px solid var(--divider); background: var(--bg-deepest); color: var(--text-normal); font-family: inherit; }
.mm-timeout-left { color: var(--dnd); text-transform: none; font-weight: 600; }

/* ---- Double-click / double-tap hint ---- */
.msg-line { -webkit-tap-highlight-color: transparent; }

/* ============ FRIXION 3.3: rank tags, Discord-style hover bar, quick delete ============ */
/* Owner + Co-Owner are always red, Admin always gold — regardless of theme. */
.owner-tag, .coowner-tag, .op-tag {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px; margin-left: 5px; vertical-align: middle; letter-spacing: .3px;
}
.owner-tag, .coowner-tag { background: rgba(237,66,69,.18) !important; color: #ed4245 !important; }
.op-tag { background: rgba(240,177,50,.18) !important; color: #f0b132 !important; }

/* Hover toolbar floats over the top-right corner of the message, like Discord. */
.msg-line .msg-hover-actions {
  top: -16px; right: 16px; padding: 2px; gap: 0;
  border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--divider);
  box-shadow: 0 4px 12px rgba(0,0,0,.35); z-index: 8;
}
.msg-line:hover { z-index: 7; }
.msg-line .msg-hover-actions .hover-icon-btn { padding: 6px; }
#messages > :first-child .msg-line:first-child .msg-hover-actions { top: 0; }
/* Message toolbar (react / reply / edit / pin / delete): small, but bright with an accent border so it stands out, and kept to the far
   right of the chat with a small gap so the whole outline shows. It is anchored by its right edge, so any button added later just
   makes it grow leftward. Its size follows the screen width (--tb-icon): about 13px icons on a small laptop, 16px on a 2000px
   screen, 18px at most on very wide ones. The message content row shrinks to fit its text, so it isn't the anchor here; the
   full-width message line is. Phones don't show the toolbar at all (they use the long-press sheet), so this is for computers only. */
body:not(.is-mobile) .msg-line .msg-row-wrap { position: static; }
body:not(.is-mobile) .msg-line .msg-hover-actions {
  --tb-icon: clamp(13px, 0.5vw + 6px, 18px);
  right: calc(clamp(4px, 0.5vw, 10px) - 16px); top: -16px; max-width: calc(100% - 8px); box-sizing: border-box;
  padding: calc(var(--tb-icon) * .12) calc(var(--tb-icon) * .2); gap: 1px; border-radius: 8px;
  background: var(--bg-tertiary); border: 1px solid var(--divider);
  border-color: color-mix(in srgb, var(--accent) 65%, var(--divider));
  box-shadow: 0 3px 12px rgba(0,0,0,.5), 0 0 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
body:not(.is-mobile) .msg-line .msg-hover-actions .hover-icon-btn { padding: calc(var(--tb-icon) * .32); border-radius: 6px; color: var(--text-normal); }
body:not(.is-mobile) .msg-line .msg-hover-actions .hover-icon-btn .i { width: var(--tb-icon); height: var(--tb-icon); }
body:not(.is-mobile) .msg-line .msg-hover-actions .hover-icon-btn:hover { background: var(--accent); color: #fff; }
body:not(.is-mobile) .msg-line .msg-hover-actions .hover-icon-btn.del-msg:hover { background: var(--danger); color: #fff; }
body:not(.is-mobile) .msg-line .msg-hover-actions .hover-icon-btn.pin-msg.on { color: var(--accent); }
body:not(.is-mobile) .msg-line .msg-hover-actions .hover-icon-btn.pin-msg.on:hover { color: #fff; }

/* Quick delete armed: red outline on hover, trash cursor feel */
body.quick-delete-armed #messages .msg-line { cursor: pointer; }
body.quick-delete-armed #messages .msg-line:hover { background: rgba(237,66,69,.14); box-shadow: inset 2px 0 0 #ed4245; }
body.quick-delete-armed #messages .msg-line:hover .msg-hover-actions { display: none; }

/* ---- Games ---- */
.fg-heading { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.fg-sub { color: var(--text-muted); font-size: 16px; }
.fg-grid { display: grid; gap: 16px; }
.fg-overlay { position: fixed; inset: 0; z-index: 200; display: flex; background: var(--bg-deepest, #000); }
.fg-overlay[hidden] { display: none; }
.fg-window {
  display: flex; flex-direction: column; overflow: hidden; width: 100%; height: var(--mobile-viewport-height, 100%);
  background: var(--bg-primary); animation: frxPop .18s cubic-bezier(.2,.9,.3,1.15);
}
.fg-bar { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) max(20px, 4vw) 14px; background: var(--bg-secondary); border-bottom: 1px solid var(--divider); }
.fg-title { font-size: 20px; font-weight: 700; }
.fg-x { width: 36px; height: 36px; border-radius: 6px; font-size: 18px; color: var(--text-muted); }
.fg-x:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
/* Owner-only game BOT toggle (v4.73) */
.fg-bot-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-tertiary); border: 1px solid var(--divider);
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  flex-shrink: 0;
}
.fg-bot-btn.hidden { display: none; }
.fg-bot-btn:hover { color: var(--text-normal); border-color: rgba(255,255,255,.22); }
.fg-bot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.fg-bot-btn.on {
  color: #fff; background: rgba(35,165,90,.22); border-color: #23a55a;
  box-shadow: 0 0 14px rgba(35,165,90,.35);
}
.fg-bot-btn.on .fg-bot-dot { background: #38e07b; box-shadow: 0 0 8px #38e07b; animation: fgBotPulse 1.4s ease-in-out infinite; }
@keyframes fgBotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.fg-window.bot-on { cursor: not-allowed; }
.fg-window.bot-on .fg-bar { cursor: default; }
.fg-window.bot-on #game-stage { pointer-events: none !important; user-select: none; }
.fg-stage { overflow-y: auto; }
.fg-btn { min-height: 42px; padding: 2px 22px; font-size: 15px; font-weight: 600; color: var(--text-normal); background: var(--bg-input); border-radius: 6px; }
.fg-btn:hover:not(:disabled) { background: var(--bg-modifier-selected); }
@media (prefers-reduced-motion: reduce) { .fg-window { animation: none; } .fg-tile { transition: none; } }

/* ---- Games (ported from Toblox) ---- */
.fg-window {
  --card-bg: var(--bg-secondary); --card-bg-2: var(--bg-tertiary); --page-bg: var(--bg-primary);
  --border: var(--divider); --border-strong: rgba(255,255,255,.16);
  --text: var(--text-normal); --text-dim: var(--text-muted);
  --accent-2: var(--accent-hover); --nav-active-bg: var(--bg-modifier-selected);
  --buy: var(--online); --buy-hover: #2bbd6a; --buy-glow: rgba(35,165,90,.4);
  --shadow: 0 2px 10px rgba(0,0,0,.4); --shadow-lg: 0 14px 34px rgba(0,0,0,.5);
  --font-display: inherit;
}
.orb-ic { display: inline-block; width: .85em; height: .85em; margin-right: .2em; vertical-align: -.1em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #f0b232 60%, #b97a12); box-shadow: 0 0 6px rgba(240,178,50,.45); }
.fg-window .empty { padding: 24px; text-align: center; color: var(--text-muted); }

.fg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.fg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 16px; color: var(--text-normal); background: var(--bg-secondary); border: 1px solid var(--divider); border-radius: 999px; }
.fg-chip b { font-weight: 700; }
/* how many more Orbs games can pay today, just above Overcontrol RNG (v4.68) */
.fg-left { display: flex; align-items: center; gap: 8px; margin: -10px 0 14px; padding: 8px 12px; font-size: 14px; color: var(--text-muted);
  background: var(--bg-secondary); border: 1px solid var(--divider); border-radius: 8px; }
.fg-left b { color: var(--text-normal); font-weight: 700; }
.fg-left-cap { opacity: .8; }
.fg-left-text:empty, .fg-left:has(.fg-left-text:empty) { display: none; }
.fg-tile { display: flex; flex-direction: column; text-align: left; overflow: hidden; color: var(--text-normal); background: var(--bg-secondary); border: 1px solid var(--divider); border-radius: 12px; transition: border-color .12s ease, transform .12s ease; }
.fg-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.fg-thumb { display: flex; align-items: center; justify-content: center; height: 112px; }
.fg-ic { font-size: 46px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.fg-name { padding: 12px 14px; font-size: 16px; font-weight: 700; }
.fg-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.fg-btn:disabled { opacity: .5; cursor: not-allowed; }
.fg-stage { display: block; flex: 1; min-height: 0; padding: 28px max(20px, 4vw) calc(28px + env(safe-area-inset-bottom, 0px)); }
.fg-stage > * { width: 100%; max-width: 1040px; margin-left: auto; margin-right: auto; }
.fg-window .fg-title { flex: 1; }

/* Toblox game styles, scoped to the game window */
.fg-window .games-tabs{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap}
.fg-window .game-tab{padding:9px 16px;border:1px solid var(--border);background:var(--card-bg);color:var(--text);font-weight:800;text-transform:uppercase;letter-spacing:.5px;font-size:.85rem}
.fg-window .game-tab.on{background:var(--accent);color:#fff;border-color:transparent}
.fg-window .cookie-game{display:grid;grid-template-columns:300px 1fr;gap:18px;align-items:start}
.fg-window .ck-left{background:var(--card-bg);border:1px solid var(--border);padding:24px 18px;text-align:center;box-shadow:var(--shadow);position:sticky;top:70px}
.fg-window .ck-count{font-family:inherit;font-size:2.7rem;letter-spacing:1px;line-height:1;color:var(--accent-2)}
.fg-window .ck-sub{color:var(--text-dim);font-size:.85rem;margin-top:4px}
.fg-window .ck-cookie{width:160px;height:160px;border:none;background:none;font-size:128px;line-height:1;cursor:pointer;margin:18px auto;display:block;transition:transform .08s;user-select:none;filter:drop-shadow(0 6px 14px rgba(0,0,0,.45))}
.fg-window .ck-cookie:hover{transform:scale(1.04)}
.fg-window .ck-cookie:active{transform:scale(.93)}
.fg-window .ck-cashout{margin-top:14px;width:100%;padding:11px;border:none;background:var(--buy);color:#fff;font-weight:800;text-transform:uppercase;letter-spacing:.4px;cursor:pointer;font-size:.82rem}
.fg-window .ck-cashout:hover{background:var(--buy-hover)}
.fg-window .ck-shop{display:flex;flex-direction:column;gap:8px}
.fg-window .ck-item{display:flex;align-items:center;gap:12px;padding:10px 14px;background:var(--card-bg);border:1px solid var(--border);cursor:pointer;text-align:left;transition:.12s;color:var(--text)}
.fg-window .ck-item:hover:not(.no){border-color:var(--accent);transform:translateX(2px)}
.fg-window .ck-item.no{opacity:.45;cursor:not-allowed}
.fg-window .cki-ic{font-size:1.8rem;width:40px;text-align:center;flex-shrink:0}
.fg-window .cki-mid{flex:1;display:flex;flex-direction:column;min-width:0}
.fg-window .cki-name{font-weight:800;font-size:1rem;font-family:inherit;letter-spacing:.5px}
.fg-window .cki-price{font-size:.76rem;color:#f5b50a;font-weight:600}
.fg-window .cki-owned{font-family:inherit;font-size:1.7rem;color:var(--text-dim);min-width:30px;text-align:right}
.ck-float{position:fixed;z-index:5000;font-weight:900;color:var(--accent-2);pointer-events:none;animation:ckFloat .9s ease-out forwards;font-family:inherit;font-size:1.4rem;text-shadow:0 2px 6px rgba(0,0,0,.5)}
@keyframes ckFloat{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-52px)}}
.fg-window .bot-msg{display:flex;max-width:80%}
.fg-window .bot-msg.you{align-self:flex-end;justify-content:flex-end}
.fg-window .gd-wrap{position:relative;border:1px solid var(--border-strong);background:var(--card-bg);overflow:hidden}
.fg-window .gd-hud{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;font-size:.82rem;color:var(--text-dim);letter-spacing:.04em;text-transform:uppercase;border-bottom:1px solid var(--border)}
.fg-window .gd-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .gd-mode-tag{padding:3px 12px;background:var(--accent);color:#fff;font-size:.72rem;font-weight:700;letter-spacing:.06em}
.fg-window .gd-canvas{display:block;width:100%;height:380px;touch-action:none;cursor:pointer}
.fg-window .gd-overlay{position:absolute;inset:0;top:42px;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.45);backdrop-filter:blur(2px)}
.fg-window .gd-card{text-align:center;padding:26px 30px;background:var(--card-bg);border:1px solid var(--border-strong);max-width:420px;box-shadow:var(--shadow-lg)}
.fg-window .gd-title{font-family:var(--font-display,inherit);font-size:2rem;letter-spacing:.05em;color:var(--accent);text-transform:uppercase}
.fg-window .gd-sub{margin:8px 0 16px;color:var(--text-dim);font-size:.86rem;line-height:1.5}
.fg-window .gd-reward{margin-bottom:16px;font-weight:700;font-size:1.05rem;color:var(--text)}
.fg-window .gd-btn{padding:11px 26px;background:var(--accent);color:#fff;border:none;font-weight:700;letter-spacing:.04em;text-transform:uppercase;cursor:pointer}
.fg-window .gd-btn:hover{background:var(--accent-2)}
.fg-window .xm-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:20px}
.fg-window .xm-head{margin-bottom:14px}
.fg-window .xm-title{font-family:var(--font-display,inherit);font-size:1.9rem;letter-spacing:.05em;color:var(--accent);text-transform:uppercase}
.fg-window .xm-sub{color:var(--text-dim);font-size:.84rem;margin-top:4px}
.fg-window .xm-stats{display:flex;gap:18px;flex-wrap:wrap;padding:10px 0 16px;border-bottom:1px solid var(--border);font-size:.8rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em}
.fg-window .xm-stats b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .xm-levels{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:16px}
.fg-window .xm-lvl{display:flex;flex-direction:column;gap:6px;align-items:flex-start;padding:16px;background:var(--card-bg-2);border:1px solid var(--border);cursor:pointer;text-align:left;transition:border-color .12s,transform .12s}
.fg-window .xm-lvl:hover{border-color:var(--accent);transform:translateY(-2px)}
.fg-window .xm-lvl-n{font-size:.72rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.05em}
.fg-window .xm-lvl-name{font-weight:700;color:var(--text);font-size:1.05rem}
.fg-window .xm-lvl-rw{font-size:.82rem;color:var(--accent);font-weight:700}
.fg-window .xm-play{margin-top:6px}
.fg-window .xm-playhead{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:18px}
.fg-window .xm-back2{background:none;border:none;color:var(--text-dim);cursor:pointer;font-size:.86rem;padding:4px 0}
.fg-window .xm-back2:hover{color:var(--accent)}
.fg-window .xm-lvltag{font-size:.76rem;color:var(--text-dim)}
.fg-window .xm-problem{font-size:1.7rem;font-weight:700;color:var(--text);text-align:center;padding:28px 14px;background:var(--card-bg-2);border:1px solid var(--border);min-height:60px;line-height:1.4}
.fg-window .xm-row{display:flex;gap:10px;margin-top:16px}
.fg-window .xm-input{flex:1;padding:13px 14px;background:var(--card-bg-2);border:1px solid var(--border-strong);color:var(--text);font-size:1.1rem}
.fg-window .xm-input:focus{outline:none;border-color:var(--accent)}
.fg-window .xm-submit{padding:0 26px;background:var(--accent);color:#fff;border:none;font-weight:700;letter-spacing:.04em;text-transform:uppercase;cursor:pointer}
.fg-window .xm-submit:hover{background:var(--accent-2)}
.fg-window .xm-actions{display:flex;align-items:center;gap:14px;margin-top:12px;flex-wrap:wrap}
.fg-window .xm-skip{background:none;border:1px solid var(--border);color:var(--text-dim);padding:7px 14px;cursor:pointer;font-size:.78rem}
.fg-window .xm-skip:hover{border-color:var(--accent);color:var(--text)}
.fg-window .xm-fb{font-size:.86rem;font-weight:600}
.fg-window .xm-fb.ok{color:#22cc77}
.fg-window .xm-fb.bad{color:#e34b4b}
.fg-window .xm-fb.warn{color:#f5b50a}
.fg-window .sn-wrap{position:relative;border:1px solid var(--border-strong);background:var(--card-bg);overflow:hidden}
.fg-window .sn-hud{display:flex;justify-content:space-between;padding:10px 14px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--border)}
.fg-window .sn-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .sn-canvas{display:block;width:100%;touch-action:none;cursor:pointer}
.fg-window .sn-overlay{position:absolute;inset:0;top:42px;z-index:20;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.58)}
.fg-window .sn-card{text-align:center;padding:24px 28px;background:var(--card-bg);border:1px solid var(--border-strong);max-width:420px;box-shadow:var(--shadow-lg)}
.fg-window .sn-title{font-family:var(--font-display,inherit);font-size:1.9rem;letter-spacing:.05em;color:var(--accent);text-transform:uppercase}
.fg-window .sn-sub{margin:8px 0 16px;color:var(--text-dim);font-size:.85rem;line-height:1.5}
.fg-window .sn-reward{margin-bottom:14px;font-weight:700;color:var(--text)}
.fg-window .sn-btn{padding:10px 26px;background:var(--accent);color:#fff;border:none;font-weight:700;letter-spacing:.04em;text-transform:uppercase;cursor:pointer}
.fg-window .sn-btn:hover{filter:brightness(1.1)}
.fg-window .mg-wrap{position:relative;border:1px solid var(--border-strong);background:var(--card-bg);padding:16px}
.fg-window .mg-hud{display:flex;justify-content:space-between;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;margin-bottom:12px}
.fg-window .mg-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .mg-board{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;max-width:380px;margin:0 auto;background:rgba(0,0,0,.28);padding:10px;border-radius:14px}
.fg-window .mg-cell{position:relative;background:rgba(255,255,255,.05);border-radius:8px;aspect-ratio:1/1}
.fg-window .mg-tile{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-weight:800;border-radius:8px;box-shadow:0 2px 6px rgba(0,0,0,.22);user-select:none}
.fg-window .mg-new{animation:mgPop .18s ease}
.fg-window .mg-merged{animation:mgPulse .2s ease}
@keyframes mgPop{0%{transform:scale(.1);opacity:0}100%{transform:scale(1);opacity:1}}
@keyframes mgPulse{0%{transform:scale(1)}50%{transform:scale(1.18)}100%{transform:scale(1)}}
.fg-window .mg-foot{margin-top:14px;text-align:center;color:var(--text-dim);font-size:.8rem}
.fg-window .mg-restart{margin-left:10px;padding:5px 12px;background:none;border:1px solid var(--border);color:var(--text);cursor:pointer}
.fg-window .mg-restart:hover{border-color:var(--accent)}
.fg-window .mg-over{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.64);border-radius:inherit}
.fg-window .mg-over-card{text-align:center;padding:24px 28px;background:var(--card-bg);border:1px solid var(--border-strong);border-radius:14px;box-shadow:var(--shadow-lg)}
.fg-window .atd-back{border-radius:10px !important}
.fg-window .msg-del,.fg-window .msg-pin{border-radius:8px !important}
.fg-window .tb-badge,.fg-window .nav-badge,.fg-window .pin-badge,.fg-window .font-rarity,.fg-window .tc-badge,.fg-window .gc-soon{border-radius:999px !important}
.fg-window .gd-mode-tag,.fg-window .xm-lvl-rw{border-radius:999px}
.fg-window .mg-tile{border-radius:10px}
.fg-window .atd-gold{position:absolute;top:10px;right:10px;z-index:2;background:rgba(176,107,255,.92);border:1px solid #d8b4ff;color:#fff;padding:7px 12px;font-weight:800;font-size:.74rem;cursor:pointer}
.fg-window .atd-gold:hover{filter:brightness(1.1)}
.fg-window .admin-pfp-prev{margin:10px 0;display:flex;justify-content:center;min-height:4px}
.fg-window .ts-wrap,.fg-window .at-wrap{position:relative;border:1px solid var(--border-strong);background:var(--card-bg);overflow:hidden}
.fg-window .ts-hud,.fg-window .at-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 14px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--border)}
.fg-window .ts-hud b,.fg-window .at-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .ts-field{position:relative;height:340px;overflow:hidden;background:linear-gradient(135deg,var(--card-bg),var(--card-bg-2))}
.fg-window .ts-word{position:absolute;white-space:nowrap;padding:6px 12px;background:var(--card-bg-2);border:1px solid var(--accent);color:var(--text);font-weight:700;font-size:1.05rem;box-shadow:0 2px 8px rgba(0,0,0,.3)}
.fg-window .ts-word.hit{background:var(--accent);color:#fff;transform:scale(1.15);transition:.12s}
.fg-window .ts-foot{padding:12px 14px;border-top:1px solid var(--border)}
.fg-window .ts-input{width:100%;padding:13px 14px;background:var(--card-bg-2);border:1px solid var(--border-strong);color:var(--text);font-size:1.05rem}
.fg-window .ts-input:focus{outline:none;border-color:var(--accent)}
.fg-window .ts-input.wrong{border-color:#e34b4b;animation:tsShake .2s}
@keyframes tsShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
.fg-window .ts-overlay,.fg-window .at-overlay{position:absolute;inset:0;top:42px;z-index:20;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6)}
.fg-window .ts-card{text-align:center;padding:24px 28px;background:var(--card-bg);border:1px solid var(--border-strong);border-radius:14px;max-width:430px;box-shadow:var(--shadow-lg)}
.fg-window .ts-title{font-family:var(--font-display,inherit);font-size:1.9rem;letter-spacing:.05em;color:var(--accent);text-transform:uppercase}
.fg-window .ts-sub{margin:8px 0 16px;color:var(--text-dim);font-size:.85rem;line-height:1.5}
.fg-window .ts-reward{margin-bottom:14px;font-weight:700;color:var(--text)}
.fg-window .ts-btn{padding:10px 26px;background:var(--accent);color:#fff;border:none;font-weight:700;letter-spacing:.04em;text-transform:uppercase;cursor:pointer}
.fg-window .ts-btn:hover{filter:brightness(1.1)}
.fg-window .at-field{position:relative;height:340px;cursor:crosshair;background:linear-gradient(135deg,var(--card-bg),var(--card-bg-2));touch-action:none}
.fg-window .at-target{position:absolute;border-radius:50%;background:radial-gradient(circle at 35% 35%,var(--accent-2),var(--accent));box-shadow:0 0 14px var(--accent);cursor:pointer}
.fg-window .at-target:active{transform:scale(.9)}
.fg-window .dw-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:18px}
.fg-window .dw-head{text-align:center;margin-bottom:14px}
.fg-window .dw-title{font-family:var(--font-display,inherit);font-size:1.9rem;letter-spacing:.05em;color:var(--accent);text-transform:uppercase}
.fg-window .dw-sub{color:var(--text-dim);font-size:.84rem;margin-top:3px}
.fg-window .dw-board{display:flex;flex-direction:column;gap:6px;align-items:center;margin-bottom:12px}
.fg-window .dw-row{display:flex;gap:6px}
.fg-window .dw-tile{width:52px;height:52px;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.5rem;color:#fff;border:2px solid var(--border);background:transparent}
.fg-window .dw-tile.dw-filled{border-color:var(--accent)}
.fg-window .dw-tile.dw-g{background:#2faf4e;border-color:#2faf4e}
.fg-window .dw-tile.dw-y{background:#c8a417;border-color:#c8a417}
.fg-window .dw-tile.dw-b{background:#3a3f4a;border-color:#3a3f4a}
.fg-window .dw-msg{text-align:center;min-height:1.2em;font-weight:700;font-size:.9rem;margin-bottom:10px}
.fg-window .dw-msg.ok{color:#2fcf6e}
.fg-window .dw-msg.bad{color:#e34b4b}
.fg-window .dw-hint{text-align:center;min-height:1em;color:var(--accent);font-weight:700;font-size:.85rem;margin-bottom:8px}
.fg-window .dw-keys{display:flex;flex-direction:column;gap:6px;align-items:center}
.fg-window .dw-krow{display:flex;gap:5px}
.fg-window .dw-key{min-width:30px;height:46px;padding:0 8px;background:var(--card-bg-2);border:1px solid var(--border);color:var(--text);font-weight:700;font-size:.9rem;cursor:pointer;text-transform:uppercase}
.fg-window .dw-key:hover{border-color:var(--accent)}
.fg-window .dw-key.dw-g{background:#2faf4e;color:#fff;border-color:#2faf4e}
.fg-window .dw-key.dw-y{background:#c8a417;color:#fff;border-color:#c8a417}
.fg-window .dw-key.dw-b{background:#262a31;color:var(--text-dim);border-color:#262a31}
.fg-window .dw-wide{min-width:54px;font-size:.74rem}
@media(max-width:560px){.fg-window .dw-tile{width:44px;height:44px;font-size:1.25rem}
.fg-window .dw-key{min-width:26px;height:42px;padding:0 5px}}
.fg-window .bb-wrap{position:relative;border:1px solid var(--border-strong);background:var(--card-bg);overflow:hidden;padding-bottom:12px}
.fg-window .bb-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 14px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--border)}
.fg-window .bb-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .bb-stage{display:flex;justify-content:center;padding:14px 0 10px}
.fg-window .bb-canvas{display:block;border:1px solid var(--border);background:#0d0f14;touch-action:none}
.fg-window .bb-controls{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}
.fg-window .bb-controls button{min-width:48px;height:42px;background:var(--card-bg-2);border:1px solid var(--border);color:var(--text);font-size:1rem;font-weight:700;cursor:pointer;border-radius:10px}
.fg-window .bb-controls button:hover{border-color:var(--accent)}
.fg-window .su-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:18px}
.fg-window .su-head{text-align:center;margin-bottom:14px}
.fg-window .su-title{font-family:var(--font-display,inherit);font-size:1.9rem;letter-spacing:.05em;color:var(--accent);text-transform:uppercase}
.fg-window .su-sub{color:var(--text-dim);font-size:.84rem;margin-top:3px}
.fg-window .su-board{display:grid;grid-template-columns:repeat(9,1fr);max-width:400px;margin:0 auto;border:2px solid var(--accent);background:var(--card-bg-2)}
.fg-window .su-cell{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:1.1rem;color:var(--accent-2);border:1px solid var(--border);cursor:pointer;user-select:none}
.fg-window .su-cell.su-given{color:var(--text);font-weight:800;background:rgba(255,255,255,.05);cursor:default}
.fg-window .su-cell.su-sel{background:var(--nav-active-bg);outline:2px solid var(--accent);outline-offset:-2px}
.fg-window .su-cell.su-bad{color:#e34b4b}
.fg-window .su-cell.su-br{border-right:2px solid var(--accent)}
.fg-window .su-cell.su-bb{border-bottom:2px solid var(--accent)}
.fg-window .su-msg{text-align:center;min-height:1.2em;font-weight:700;font-size:.9rem;margin:10px 0}
.fg-window .su-msg.ok{color:#2fcf6e}
.fg-window .su-pad{display:flex;justify-content:center;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.fg-window .su-key{min-width:38px;height:46px;background:var(--card-bg-2);border:1px solid var(--border);color:var(--text);font-weight:800;font-size:1.05rem;cursor:pointer;border-radius:10px}
.fg-window .su-key:hover{border-color:var(--accent)}
.fg-window .su-erase{min-width:62px;font-size:.78rem}
.fg-window .su-actions{text-align:center}
.fg-window .c4-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:18px}
.fg-window .c4-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.fg-window .c4-ava{width:46px;height:46px;border-radius:12px;background:var(--card-bg-2);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:1.7rem;flex-shrink:0}
.fg-window .c4-name{font-weight:800;font-size:1.1rem}
.fg-window .c4-status{color:var(--text-dim);font-size:.85rem}
.fg-window .c4-board{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;max-width:420px;margin:0 auto;background:#1f3a8a;padding:8px;border-radius:14px}
.fg-window .c4-col{display:flex;flex-direction:column;gap:6px;cursor:pointer}
.fg-window .c4-col:hover{background:rgba(255,255,255,.07);border-radius:8px}
.fg-window .c4-slot{aspect-ratio:1/1;background:#0d1530;border-radius:50%;display:flex;align-items:center;justify-content:center}
.fg-window .c4-disc{width:84%;height:84%;border-radius:50%}
.fg-window .c4-disc.c4-p{background:radial-gradient(circle at 35% 35%,#ff7a7a,#e34b4b)}
.fg-window .c4-disc.c4-r{background:radial-gradient(circle at 35% 35%,#ffe680,#edc22e)}
.fg-window .c4-foot{display:flex;justify-content:center;gap:10px;margin-top:14px}
.fg-window .st-wrap{position:relative;border:1px solid var(--border-strong);background:var(--card-bg);overflow:hidden}
.fg-window .st-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 14px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--border)}
.fg-window .st-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .st-canvas{display:block;width:100%;height:380px;touch-action:none;cursor:pointer}
.fg-window .st-overlay{position:absolute;inset:0;top:42px;z-index:20;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.58)}
.fg-window .mm-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:18px}
.fg-window .mm-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;margin-bottom:14px}
.fg-window .mm-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .mm-board{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;max-width:400px;margin:0 auto}
.fg-window .mm-card{aspect-ratio:1/1;perspective:600px;cursor:pointer}
.fg-window .mm-inner{position:relative;width:100%;height:100%;transition:transform .35s;transform-style:preserve-3d}
.fg-window .mm-card.flip .mm-inner{transform:rotateY(180deg)}
.fg-window .mm-front,.fg-window .mm-back{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;backface-visibility:hidden;border-radius:12px;font-size:1.9rem}
.fg-window .mm-front{background:linear-gradient(135deg,var(--accent),var(--accent-2))}
.fg-window .mm-back{background:var(--card-bg-2);border:1px solid var(--border);transform:rotateY(180deg)}
.fg-window .mm-card.done .mm-back{border-color:var(--buy);box-shadow:0 0 0 2px var(--buy) inset;opacity:.65}
.fg-window .mm-msg{text-align:center;min-height:1.4em;margin-top:14px;font-weight:700;font-size:.9rem}
.fg-window .mm-msg.ok{color:#2fcf6e}
.fg-window .cs-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:18px}
.fg-window .cs-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;margin-bottom:14px}
.fg-window .cs-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .cs-flagbtn{padding:6px 12px;background:var(--card-bg-2);border:1px solid var(--border);color:var(--text);font-weight:700;font-size:.76rem;cursor:pointer;border-radius:10px}
.fg-window .cs-flagbtn:hover{border-color:var(--accent)}
.fg-window .cs-board{display:grid;gap:3px;max-width:400px;margin:0 auto}
.fg-window .cs-cell{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;background:var(--card-bg-2);border:1px solid var(--border);font-weight:800;font-size:1rem;cursor:pointer;user-select:none;border-radius:4px}
.fg-window .cs-cell:hover{border-color:var(--accent)}
.fg-window .cs-rev{background:rgba(255,255,255,.03);cursor:default;border-color:transparent}
.fg-window .cs-mine{background:#e34b4b;cursor:default}
.fg-window .cs-flag{background:var(--card-bg)}
.fg-window .cs-msg{text-align:center;min-height:1.4em;margin-top:14px;font-weight:700;font-size:.9rem}
.fg-window .cs-msg.ok{color:#2fcf6e}
.fg-window .cs-msg.bad{color:#e34b4b}
.fg-window .cs-foot{text-align:center;margin-top:12px}
.fg-window .cr-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:16px}
.fg-window .cr-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;margin-bottom:12px}
.fg-window .cr-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .cr-board{display:grid;gap:4px;max-width:384px;margin:0 auto;background:rgba(0,0,0,.25);padding:6px;border-radius:12px}
.fg-window .cr-cell{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px}
.fg-window .cr-cell.cr-sel{outline:2px solid #fff;outline-offset:-2px;background:rgba(255,255,255,.08)}
.fg-window .cr-gem{width:84%;height:84%;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.3),inset 0 -3px 6px rgba(0,0,0,.25),inset 0 3px 6px rgba(255,255,255,.32)}
.fg-window .cr-msg{text-align:center;min-height:1.4em;margin-top:12px;font-weight:700;font-size:.88rem;color:var(--text-dim)}
.fg-window .cr-msg.ok{color:#2fcf6e}
.fg-window .bk-wrap{position:relative;border:1px solid var(--border-strong);background:var(--card-bg);overflow:hidden}
.fg-window .bk-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 14px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--border)}
.fg-window .bk-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .bk-canvas{display:block;width:100%;height:380px;touch-action:none;cursor:none}
.fg-window .bk-overlay{position:absolute;inset:0;top:42px;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.45)}
.fg-window .sm-wrap{border:1px solid var(--border-strong);background:var(--card-bg);padding:18px}
.fg-window .sm-hud{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.82rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;margin-bottom:16px}
.fg-window .sm-hud b{color:var(--text);font-size:1.05rem;margin-left:4px}
.fg-window .sm-pads{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:320px;margin:0 auto 16px}
.fg-window .sm-pad{aspect-ratio:1/1;border:none;border-radius:16px;cursor:pointer;opacity:.5;transition:opacity .1s,transform .1s,box-shadow .1s}
.fg-window .sm-pad:hover{opacity:.7}
.fg-window .sm-pad.lit{opacity:1;transform:scale(1.04);box-shadow:0 0 26px rgba(255,255,255,.65)}
.fg-window .sm-msg{text-align:center;min-height:1.4em;margin-bottom:14px;font-weight:700;font-size:.95rem;color:var(--text)}
.fg-window .mg-board{touch-action:none}
.fg-window #game-stage{touch-action:manipulation}
.fg-window .gg-game{display:flex;flex-direction:column;gap:16px}
.fg-window .gg-top{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:var(--card-bg);border:1px solid var(--border);border-radius:14px;padding:14px 18px}
.fg-window .gg-bank{display:flex;flex-direction:column}
.fg-window .gg-bank-amt{font-family:inherit;font-size:2.1rem;line-height:1;color:#ffcf3a;display:flex;align-items:center;gap:8px}
.fg-window .gg-coin{font-size:1.5rem;filter:drop-shadow(0 0 6px rgba(255,200,0,.6))}
.fg-window .gg-bank-sub{color:var(--text-dim);font-size:.8rem;letter-spacing:.5px;text-transform:uppercase;margin-top:2px}
.fg-window .gg-actions{display:flex;gap:8px;flex-wrap:wrap}
.fg-window .gg-btn{border:1px solid var(--border);border-radius:11px;padding:10px 16px;font-weight:800;font-size:.84rem;cursor:pointer;background:var(--card-bg-2);color:var(--text);transition:.13s}
.fg-window .gg-btn:hover{transform:translateY(-1px)}
.fg-window .gg-harvest{background:var(--buy);color:#fff;border-color:transparent;box-shadow:0 4px 14px -4px var(--buy-glow)}
.fg-window .gg-harvest:hover{background:var(--buy-hover)}
.fg-window .gg-cash{color:#ffcf3a;border-color:rgba(255,200,0,.35)}
.fg-window .gg-cash:hover{background:rgba(255,200,0,.12)}
.fg-window .gg-main{display:grid;grid-template-columns:1fr 290px;gap:16px;align-items:start}
.fg-window .gg-garden{background:var(--card-bg);border:1px solid var(--border);border-radius:14px;padding:16px;position:relative;overflow:hidden}
.fg-window .gg-pets-layer{position:absolute;inset:0;pointer-events:none;z-index:4;overflow:hidden}
.fg-window .gg-pet-walker{position:absolute;pointer-events:none;z-index:4;transition:left 3s linear,top 3s linear,transform .25s;will-change:left,top}
.fg-window .gg-pet-body{display:inline-block;font-size:1.5rem;line-height:1;filter:drop-shadow(0 2px 4px rgba(0,0,0,.55));animation:ggPetBob .9s ease-in-out infinite}
@keyframes ggPetBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
.fg-window .gg-plots{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
/* someone else's garden, to look at (v4.68, request 64) */
.fg-window .gg-visit-garden .gg-plot{cursor:default}
.fg-window .gg-visit-garden .gg-plot:hover{transform:none}
.fg-window .gg-visit-note,.fg-window .gg-visit-pets,.fg-window .gg-visit-empty,.fg-window .gg-visit-loading{background:var(--card-bg);border:1px solid var(--border);border-radius:12px;padding:10px 14px;font-size:14px;color:var(--text-muted)}
.fg-window .gg-visit-note b,.fg-window .gg-visit-pets b{color:var(--text-normal)}
.fg-window .gg-visit-pets{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.fg-window .gg-visit-pet{padding:3px 10px;border-radius:999px;background:var(--bg-tertiary);color:var(--text-normal)}
.fg-window .gg-visit-empty,.fg-window .gg-visit-loading{padding:28px;text-align:center}
.fg-window .gg-plot{position:relative;aspect-ratio:1/1;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;border:1px solid rgba(120,80,45,.4);background:linear-gradient(160deg,#2c1c10,#1a1009);transition:.13s;user-select:none}
.fg-window .gg-plot.empty{border-style:dashed;border-color:rgba(120,80,45,.55);background:repeating-linear-gradient(135deg,rgba(120,80,45,.12) 0 8px,transparent 8px 16px),linear-gradient(160deg,#241608,#170d06)}
.fg-window .gg-plot.empty:hover{border-color:var(--buy);background:rgba(2,183,87,.1)}
.fg-window .gg-soil{font-size:2rem;color:rgba(255,225,180,.35);font-weight:300}
.fg-window .gg-plant{font-size:2.7rem;line-height:1;transition:opacity .5s,transform .5s;filter:drop-shadow(0 4px 8px rgba(0,0,0,.4))}
.fg-window .gg-grow{position:absolute;left:8px;right:8px;bottom:8px;height:6px;border-radius:999px;background:rgba(0,0,0,.45);overflow:hidden}
.fg-window .gg-grow-bar{height:100%;border-radius:999px;background:linear-gradient(90deg,#3fae54,#7fe06a);transition:width .6s linear}
.fg-window .gg-plot.ready{border-color:var(--buy);background:linear-gradient(160deg,#1c3a1f,#102612);box-shadow:0 0 0 1px var(--buy),0 0 18px -4px var(--buy-glow);animation:ggReady 1.6s ease-in-out infinite}
@keyframes ggReady{0%,100%{box-shadow:0 0 0 1px var(--buy),0 0 12px -4px var(--buy-glow)}50%{box-shadow:0 0 0 1px var(--buy),0 0 22px 0 var(--buy-glow)}}
.fg-window .gg-plot.ready .gg-plant{animation:ggBob 1.4s ease-in-out infinite}
@keyframes ggBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.fg-window .gg-ready-tag{position:absolute;bottom:7px;font-size:.66rem;font-weight:900;text-transform:uppercase;letter-spacing:.5px;color:#fff;background:var(--buy);padding:2px 8px;border-radius:999px}
.fg-window .gg-plot.locked{cursor:default;border-style:dashed;border-color:var(--border);background:var(--card-bg-2);opacity:.7}
.fg-window .gg-plot.locked.next{cursor:pointer;opacity:1;border-color:rgba(255,200,0,.4)}
.fg-window .gg-plot.locked.next:hover{border-color:#ffcf3a;background:rgba(255,200,0,.08)}
.fg-window .gg-lock{font-size:1.6rem;opacity:.7}
.fg-window .gg-lock-cost{margin-top:6px;font-size:.78rem;font-weight:800;color:#ffcf3a}
.fg-window .gg-lock-hint{font-size:.66rem;text-transform:uppercase;letter-spacing:.5px;color:var(--text-dim);margin-top:2px}
.fg-window .gg-hint{margin-top:12px;color:var(--text-dim);font-size:.82rem;text-align:center}
.fg-window .gg-shop{background:var(--card-bg);border:1px solid var(--border);border-radius:14px;padding:14px;position:sticky;top:70px}
.fg-window .gg-shop-title{font-family:inherit;letter-spacing:1px;font-size:1.4rem;margin-bottom:10px}
.fg-window .gg-seedlist{display:flex;flex-direction:column;gap:7px;max-height:60vh;overflow-y:auto}
.fg-window .gg-seed{display:flex;align-items:center;gap:10px;padding:8px 11px;border:1px solid var(--border);border-radius:11px;background:var(--card-bg-2);cursor:pointer;transition:.12s}
.fg-window .gg-seed:hover:not(.locked){border-color:var(--accent)}
.fg-window .gg-seed.sel{border-color:var(--buy);box-shadow:0 0 0 1px var(--buy) inset}
.fg-window .gg-seed.poor{opacity:.55}
.fg-window .gg-seed.locked{cursor:not-allowed;opacity:.5}
.fg-window .gg-seed-ic{font-size:1.6rem;width:30px;text-align:center;flex-shrink:0}
.fg-window .gg-seed-mid{flex:1;min-width:0;display:flex;flex-direction:column}
.fg-window .gg-seed-name{font-weight:800;font-size:.92rem}
.fg-window .gg-seed-meta{font-size:.7rem;color:var(--text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fg-window .gg-seed-sel{color:var(--buy);font-weight:900}
.fg-window .gg-seed-lock{color:var(--text-dim)}
.gg-float{position:fixed;z-index:5000;transform:translateX(-50%);font-family:inherit;font-size:1.5rem;font-weight:900;color:#ffcf3a;pointer-events:none;text-shadow:0 2px 6px rgba(0,0,0,.6);animation:ckFloat 1.1s ease-out forwards}
.gg-float.gold{color:#ffd24a}
.gg-float.rainbow{background:linear-gradient(90deg,#ff5e5e,#ffd24a,#7fe06a,#4f9cff,#b06bff);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}
@media(max-width:760px){.fg-window .gg-main{grid-template-columns:1fr}
.fg-window .gg-shop{position:static}
.fg-window .gg-seedlist{max-height:none}
.fg-window .gg-plots{grid-template-columns:repeat(3,1fr)}}
.fg-window .gg-shoptabs{display:flex;gap:6px;margin-bottom:10px}
.fg-window .gg-shoptab{flex:1;padding:8px;border:1px solid var(--border);border-radius:10px;background:var(--card-bg-2);color:var(--text-dim);font-weight:800;font-size:.82rem;cursor:pointer;transition:.12s}
.fg-window .gg-shoptab.on{background:var(--buy);color:#fff;border-color:transparent}
.fg-window .gg-spr-note{font-size:.74rem;color:var(--text-dim);line-height:1.45;margin-bottom:9px}
.fg-window .gg-spr .gg-seed-ic{filter:drop-shadow(0 0 6px rgba(120,200,255,.55))}
.fg-window .gg-spr-owned{font-family:inherit;font-size:1.5rem;color:#9fe3ff;min-width:22px;text-align:right}
@media(max-width:760px){}
.fg-window .gg-shk{display:inline-flex;align-items:center;justify-content:center;width:1.15em;height:1.15em;border-radius:50%;background:linear-gradient(160deg,#ffe27a,#e3a31c);color:#5a3d00;font-weight:900;font-size:.72em;line-height:1;vertical-align:-.12em;box-shadow:inset 0 0 0 1px rgba(255,255,255,.45)}
.fg-window .gg-bank-amt{display:flex;align-items:center;gap:8px}
.fg-window .gg-shovel-btn.on{background:#b5532a;color:#fff;border-color:transparent}
.fg-window .gg-plot.dig{cursor:pointer}
.fg-window .gg-plot.dig:hover{border-color:#e0662a;box-shadow:0 0 0 1px #e0662a,0 0 14px -2px rgba(224,102,42,.6)}
.fg-window .gg-plot.sprinklable:hover{border-color:#4fc3ff;box-shadow:0 0 0 1px #4fc3ff,0 0 14px -2px rgba(79,195,255,.6)}
.fg-window .gg-plot-spr{position:absolute;top:4px;right:5px;font-size:.92rem;filter:drop-shadow(0 1px 2px rgba(0,0,0,.6));z-index:2}
.fg-window .gg-sell:hover{border-color:var(--buy)}
.fg-window .gg-sell-btn{font-family:inherit;font-size:1rem;letter-spacing:.5px;color:#fff;background:var(--buy);padding:5px 15px;border-radius:8px;align-self:center;white-space:nowrap}
.fg-window .gg-sellall{width:100%;margin-bottom:10px;background:var(--buy);color:#fff;border-color:transparent;justify-content:center;display:flex}
.fg-window .gg-sellall:hover{background:var(--buy-hover)}
.fg-window .gg-plot-spr{max-width:46px;overflow:hidden;text-overflow:clip;white-space:nowrap;font-size:.78rem}
.fg-window .gg-pet.owned{opacity:.78}
.fg-window .gg-pet.owned .gg-seed-sel{color:#9fe3ff}
.fg-window .gg-rar,.gag-item .gg-rar{display:inline-block;font-size:.6rem;font-weight:900;text-transform:uppercase;letter-spacing:.5px;padding:1px 6px;border-radius:999px;vertical-align:middle;border:1px solid currentColor;line-height:1.4}
.fg-window .r-common,.gag-item .r-common{color:#9aa0a6}
.fg-window .r-uncommon,.gag-item .r-uncommon{color:#46c93a}
.fg-window .r-rare,.gag-item .r-rare{color:#4fc3ff}
.fg-window .r-epic,.gag-item .r-epic{color:#b06bff}
.fg-window .r-legendary,.gag-item .r-legendary{color:#ffd23a}
.fg-window .r-divine,.gag-item .r-divine{color:#ff8a1e}
.fg-window .r-super,.gag-item .r-super{border-color:transparent;color:#fff;background:linear-gradient(90deg,#ff4d4d,#ffb020,#46c93a,#4fc3ff,#b06bff,#ff4d4d);background-size:300% 100%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;animation:rarRainbow 3s linear infinite}
.fg-window .r-super,.gag-item .r-super{border:1px solid rgba(255,255,255,.25)}
@keyframes rarRainbow{to{background-position:300% 0}}
.fg-window .r-prismatic,.gag-item .r-prismatic{border-color:transparent;color:#fff;background:linear-gradient(90deg,#23e6c8,#46c93a,#4fc3ff,#b06bff,#23e6c8);background-size:300% 100%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;animation:rarAurora 4s ease-in-out infinite;border:1px solid rgba(120,230,210,.35)}
@keyframes rarAurora{0%{background-position:0 0}50%{background-position:200% 0}100%{background-position:0 0}}
.fg-window .r-transcendent,.gag-item .r-transcendent{border:1px solid rgba(255,60,60,.5);color:#fff;background:linear-gradient(90deg,#000,#7a0000,#ff2a2a,#7a0000,#000);background-size:300% 100%;animation:rarTrans 2.4s linear infinite;text-shadow:0 0 5px rgba(255,40,40,.7)}
@keyframes rarTrans{to{background-position:300% 0}}

/* ---- Games: cookie run panel, themes, touch and small screens ---- */
.fg-window .ck-run { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.fg-window .ck-run > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; background: var(--card-bg-2); border-radius: 8px; }
.fg-window .ck-run span { font-size: 12px; color: var(--text-dim); }
.fg-window .ck-run b { font-size: 16px; }
.fg-window .ck-cashout:disabled { opacity: .55; cursor: not-allowed; }

/* Light theme: the games were drawn for dark surfaces */
body.theme-light .fg-window .dw-tile { color: var(--text-normal); }
body.theme-light .fg-window .dw-tile.dw-g, body.theme-light .fg-window .dw-tile.dw-y, body.theme-light .fg-window .dw-tile.dw-b { color: #fff; }
body.theme-light .fg-window :is(.cki-price, .xm-fb.warn, .gg-bank-amt, .gg-cash, .gg-lock-cost) { color: #9a6200; }
body.theme-light .fg-window .su-cell.su-given { background: rgba(0,0,0,.06); }
body.theme-light .fg-window .fg-chip b { color: var(--text-normal); }

/* Touch: no double-tap zoom or accidental text selection while playing, canvases own their gestures */
.fg-window button, .fg-tile { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fg-window canvas { touch-action: none; max-width: 100%; }
.fg-stage { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

@media (max-width: 760px) {
  .fg-window { animation: none; }
  .fg-bar { gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
  .fg-title { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fg-chip { padding: 5px 10px; font-size: 14px; }
  .fg-x { width: 40px; height: 40px; }
  .fg-stage { padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .fg-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .fg-thumb { height: 84px; } .fg-ic { font-size: 36px; } .fg-name { padding: 10px 12px; font-size: 15px; }
  .fg-head { margin-bottom: 16px; } .fg-heading { font-size: 20px; } .fg-sub { font-size: 15px; }
  .fg-window .cookie-game { grid-template-columns: 1fr; }
  .fg-window .ck-left { position: static; }
  .fg-window .gd-canvas, .fg-window .st-canvas { height: min(380px, 52vh); }
  .fg-window button { min-height: 40px; }
}
@media (max-width: 380px) { .fg-grid { gap: 8px; } .fg-name { font-size: 14px; } }

/* Shop and custom themes paint translucent panels over an animated gradient, so the
   game window (which sits on its own dimmed layer) gets the same opaque gradient
   treatment as other modals. */
body.shop-theme-active .fg-window {
  background: linear-gradient(var(--bg-primary), var(--bg-primary)), var(--shop-theme-bg);
  background-attachment: local, fixed;
}
body.shop-theme-active .fg-bar { background: rgba(0,0,0,.28); }
body.shop-theme-active .fg-window .fg-chip { background: rgba(0,0,0,.3); }


.fg-window .ck-note { margin-top: 10px; font-size: .8rem; line-height: 1.4; color: var(--text-dim); text-align: center; }

/* emoji layout editor: self-contained field styling (it also lives inside the shop item editor) */
.eml-input { width: 100%; padding: 10px 12px; font-size: 18px; color: var(--text-normal); background: var(--bg-input); border: 1px solid rgba(255,255,255,.08); border-radius: 6px; outline: none; }
.eml-input:focus { border-color: var(--accent); }
.eml-host .deco-preview-block, #deco-mode-emoji .deco-preview-block { margin-bottom: 28px; }
.eml-preview { margin-left: 8px; margin-top: 12px; }
.eml-add:disabled, .eml-remove:disabled { opacity: .5; cursor: not-allowed; }

/* full avatar masks */
.avatar-decoration.is-mask { border-radius: 50%; overflow: hidden; }
.deco-canvas-wrap.is-mask .deco-guide-circle { top: 0; left: 0; width: 100%; height: 100%; border-style: solid; border-color: rgba(255,255,255,.3); }
.deco-mask-opt { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; color: var(--text-muted); background: var(--bg-input); border-radius: 8px; cursor: pointer; }
.deco-mask-opt input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.deco-mask-opt b { color: var(--text-normal); }

/* ---- game animations ---- */
@keyframes fgCardPop { 0% { opacity: 0; transform: scale(.82) translateY(8px); } 70% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes fgFadeIn { from { opacity: 0; } to { opacity: 1; } }
.fg-window :is(.sn-overlay, .mg-over, .ts-overlay, .gd-overlay) { animation: fgFadeIn .25s ease; }
.fg-window :is(.sn-card, .mg-over-card, .ts-card, .gd-card) { animation: fgCardPop .32s cubic-bezier(.2,.9,.3,1.2); }
.fg-window .sn-hud b.bump { display: inline-block; animation: fgBump .25s ease; }
@keyframes fgBump { 50% { transform: scale(1.5); color: #f5c518; } }

.fg-window .mg-tile.mg-ghost { z-index: 0; }
.fg-window .mg-tile:not(.mg-ghost) { z-index: 1; will-change: transform; }
.fg-window .mg-new { animation: mgPop .2s ease .12s both; }
.fg-window .mg-merged { animation: mgPulse .22s ease .1s; }

@keyframes mmDeal { from { opacity: 0; transform: translateY(-18px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes mmPop { 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes mmShake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes mmWave { 0% { transform: none; } 40% { transform: translateY(-9px) scale(1.07); } 100% { transform: none; } }
.fg-window .mm-card.deal { animation: mmDeal .38s ease both; animation-delay: calc(var(--i) * 40ms); }
.fg-window .mm-card.pop { animation: mmPop .45s ease .3s; }
.fg-window .mm-card.shake { animation: mmShake .38s ease; }
.fg-window .mm-card.done .mm-back { box-shadow: 0 0 14px var(--buy), 0 0 0 2px var(--buy) inset; }
.fg-window .mm-board.win .mm-card { animation: mmWave .6s ease both; animation-delay: calc(var(--i) * 45ms); }

@keyframes c4Fall { from { transform: translateY(calc(var(--fall) * -112%)); } 60% { transform: none; } 78% { transform: translateY(-9%); } 100% { transform: none; } }
.fg-window .c4-disc.c4-drop { position: relative; z-index: 1; animation: c4Fall .5s cubic-bezier(.45,0,.75,.55) both; }
@media (prefers-reduced-motion: reduce) {
  .fg-window :is(.sn-card, .mg-over-card, .ts-card, .gd-card, .sn-overlay, .mg-over, .ts-overlay, .gd-overlay, .mm-card, .c4-disc, .mg-new, .mg-merged) { animation: none !important; }
}

/* ---- server ban list ---- */
.bans-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bans-count { flex-shrink: 0; margin-top: 2px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: #fff; background: var(--danger); border-radius: 999px; }
.bans-count.none { color: var(--text-muted); background: var(--bg-input); }
.bans-search-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 0 14px; color: var(--text-muted); background: var(--bg-input); border: 1px solid transparent; border-radius: 10px; transition: border-color .12s ease; }
.bans-search-wrap:focus-within { border-color: var(--accent); }
.bans-search { flex: 1; min-width: 0; height: 44px; font-size: 16px; color: var(--text-normal); background: transparent; border: 0; outline: none; }
.bans-list { display: flex; flex-direction: column; gap: 10px; }
.ban-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-secondary); border: 1px solid var(--divider); border-left: 3px solid var(--danger); border-radius: 10px; }
.ban-info { flex: 1; min-width: 0; }
.ban-row .ban-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 700; color: var(--text-normal); }
.ban-handle { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.ban-meta { margin-top: 3px; font-size: 13px; color: var(--text-muted); }
.ban-reason { margin-top: 8px; padding: 7px 10px; font-size: 14px; line-height: 1.4; color: var(--text-normal); background: rgba(0,0,0,.2); border-radius: 6px; overflow-wrap: anywhere; }
.ban-reason span { margin-right: 8px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--danger); }
.ban-revoke { flex-shrink: 0; min-height: 38px; padding: 0 16px; font-size: 14px; font-weight: 600; color: var(--danger); background: transparent; border: 1px solid var(--danger); border-radius: 8px; transition: background .12s ease, color .12s ease; }
.ban-revoke:hover:not(:disabled) { color: #fff; background: var(--danger); }
.ban-revoke:disabled { opacity: .5; cursor: wait; }
.bans-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 16px; text-align: center; color: var(--text-muted); border: 1px dashed var(--divider); border-radius: 12px; }
.bans-empty b { font-size: 18px; color: var(--text-normal); }
.bans-empty-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 8px; color: var(--online); background: rgba(35,165,90,.12); border-radius: 50%; }
@media (max-width: 640px) { .ban-row { flex-wrap: wrap; } .ban-revoke { width: 100%; } .bans-head { flex-direction: column; gap: 8px; } }
.ban-tag.mute-tag { background: #b8860b; }

/* ---- account ban notice ---- */
#ban-screen { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 30%, #3a0a0f 0%, #14070a 55%, #070304 100%); animation: fgFadeIn .3s ease; }
.ban-card { width: min(560px, 100%); text-align: center; color: #f6eeee; }
.ban-icon { display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; margin-bottom: 22px; color: #ff5a5f; background: rgba(255,90,95,.12); border: 2px solid rgba(255,90,95,.45); border-radius: 50%; box-shadow: 0 0 40px rgba(255,90,95,.25); }
.ban-card h1 { font-size: clamp(30px, 6vw, 44px); font-weight: 800; letter-spacing: -.01em; }
.ban-lead { margin: 10px 0 30px; font-size: 18px; color: rgba(246,238,238,.7); }
.ban-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 32px; text-align: left; }
.ban-facts > div { padding: 16px 18px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; }
.ban-facts .wide { grid-column: 1 / -1; }
.ban-facts dt { margin-bottom: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ff7b80; }
.ban-facts dd { font-size: 18px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.ban-ack { min-width: 240px; min-height: 54px; padding: 0 36px; font-size: 18px; font-weight: 700; color: #fff; background: #e5252a; border-radius: 12px; box-shadow: 0 8px 24px rgba(229,37,42,.35); transition: background .12s ease, transform .12s ease; }
.ban-ack:hover { background: #ff3a3f; transform: translateY(-1px); }
.ban-ack:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (max-width: 560px) { .ban-facts { grid-template-columns: 1fr; } .ban-ack { width: 100%; } }

/* ---- slash commands ---- */
#slash-popup { position: absolute; left: 16px; right: 16px; bottom: 74px; max-width: 620px; max-height: min(380px, 50vh); overflow: hidden; display: flex; z-index: 55;
  background: var(--bg-floating); border-radius: 10px; padding: 6px; box-shadow: 0 8px 30px var(--shadow-color), 0 0 0 1px rgba(255,255,255,.04); }
.slash-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.slash-head b { color: var(--text-normal); text-transform: none; letter-spacing: 0; }
.slash-app { color: var(--accent); }
.slash-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.slash-row.selected, .slash-row:hover { background: var(--bg-modifier-selected); }
.slash-ico { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; font-size: 18px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 8px; }
.slash-ico.has-img, .cmd-ico.has-img { background: none; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.slash-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.slash-name { font-size: 15px; font-weight: 700; color: var(--text-normal); }
.slash-opt { padding: 1px 7px; font-size: 12px; color: var(--text-muted); background: rgba(0,0,0,.25); border-radius: 4px; }
.slash-opt.optional { font-style: italic; opacity: .8; }
.slash-desc { margin-left: auto; padding-left: 12px; font-size: 13px; color: var(--text-muted); text-align: right; }
.slash-foot { padding: 8px 10px 4px; margin-top: 4px; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--divider); }
.slash-foot b { color: var(--text-muted); }

#cmd-bar { margin: 0 0 8px; background: var(--bg-secondary); border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.05); }
.cmd-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; }
.cmd-ico { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 16px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 7px; }
.cmd-name { margin-right: 4px; font-size: 16px; font-weight: 700; color: var(--text-normal); }
.cmd-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; min-height: 32px; padding: 0 12px; font-size: 14px; color: var(--text-normal); background: rgba(0,0,0,.3); border: 1px solid transparent; border-radius: 6px; }
.cmd-chip.need { border-color: rgba(255,255,255,.18); }
.cmd-chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.cmd-chip-name { font-weight: 700; }
.cmd-chip-name::after { content: ':'; }
.cmd-chip-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.cmd-close { margin-left: auto; width: 30px; height: 30px; border-radius: 6px; font-size: 14px; color: var(--text-muted); }
.cmd-close:hover { color: var(--text-normal); background: var(--bg-modifier-hover); }
.cmd-hint { padding: 9px 14px; font-size: 14px; color: var(--text-muted); border-top: 1px solid var(--divider); }
.cmd-hint b { color: var(--text-normal); }
@media (max-width: 760px) {
  #slash-popup { left: 8px; right: 8px; }
  .slash-row { flex-wrap: wrap; row-gap: 2px; }
  .slash-desc { margin-left: 44px; padding-left: 0; width: 100%; text-align: left; }
}

@media (pointer: coarse) { .slash-foot { display: none; } }

/* ---- category header actions (create channel here / delete category) ---- */
.category-header { display: flex; align-items: center; }
.category-header .cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cat-actions { display: none; align-items: center; gap: 6px; margin-left: auto; }
.category-header:hover .cat-actions { display: flex; }
.cat-actions .cat-add { font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.cat-actions .cat-del { cursor: pointer; display: inline-flex; }
.cat-actions .cat-del .i svg, .cat-actions .cat-del svg { width: 13px; height: 13px; }
.cat-actions .cat-add:hover, .cat-actions .cat-del:hover { color: var(--text-normal); }
@media (hover: none) { .cat-actions { display: flex; } }

/* ============ APPS: + menu panel, Add App modal ============ */
.apps-panel {
  position: absolute; bottom: 74px; left: 16px; width: 340px; max-width: calc(100vw - 24px);
  background: var(--bg-floating); border-radius: 8px; padding: 6px; box-shadow: 0 8px 30px var(--shadow-color); z-index: 50;
  display: flex; flex-direction: column; gap: 2px;
}
.apps-panel-head { padding: 8px 12px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); }
.apps-panel-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 6px; text-align: left; color: var(--text-normal); }
.apps-panel-item:hover { background: var(--bg-modifier-hover); }
.apps-panel-item img { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.apn-text { display: flex; flex-direction: column; min-width: 0; }
.apn-text b { font-size: 15px; }
.apn-text small { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.apps-panel-empty { padding: 12px; font-size: 14px; color: var(--text-muted); line-height: 1.4; }
.apps-panel-add { margin: 4px; padding: 10px 12px; border-radius: 6px; font-weight: 600; background: var(--accent, #5865f2); color: #fff; text-align: center; }
.apps-panel-add:hover { filter: brightness(1.1); }
.add-app-list { display: flex; flex-direction: column; gap: 10px; min-width: min(420px, 80vw); }
.add-app-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 8px; background: var(--bg-input); }
.add-app-avatar { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; }
.add-app-info { flex: 1; min-width: 0; }
.add-app-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.add-app-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.add-app-cmd { font-size: 12px; color: var(--text-faint, var(--text-muted)); margin-top: 4px; }
.add-app-btn { flex-shrink: 0; }

/* ============ WORDLE ============ */
.wordle-card { margin-top: 4px; max-width: 420px; padding: 14px 16px; border-radius: 8px; background: var(--bg-secondary, var(--bg-input)); border-left: 4px solid #538d4e; display: flex; flex-direction: column; gap: 10px; }
.wc-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.wc-logo { width: 24px; height: 24px; border-radius: 6px; }
.wc-sub { font-size: 14px; color: var(--text-normal); }
.wc-players { display: flex; flex-direction: column; gap: 8px; }
.wc-player { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.wc-player b { color: var(--text-normal); margin-right: 6px; }
.wc-mini { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.wc-mini-row { display: flex; gap: 2px; }
.wc-sq { width: 14px; height: 14px; border-radius: 3px; display: block; background: #3a3a3c; }
.wc-sq.correct { background: #538d4e; } .wc-sq.present { background: #b59f3b; } .wc-sq.absent { background: #3a3a3c; }
.wc-play { align-self: flex-start; padding: 8px 22px; border-radius: 6px; background: #538d4e; color: #fff; font-weight: 700; font-size: 14px; }
.wc-play:hover { filter: brightness(1.12); }

.wordle-box { width: min(420px, 94vw); padding-bottom: 18px; user-select: none; }
.wordle-board { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 10px 0 8px; }
.wordle-row { display: flex; gap: 6px; }
.wordle-tile { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: #fff; border: 2px solid #565758; border-radius: 4px; box-sizing: border-box; }
.wordle-tile.filled { border-color: #818384; animation: wordlePop .1s ease; }
.wordle-tile.correct { background: #538d4e; border-color: #538d4e; }
.wordle-tile.present { background: #b59f3b; border-color: #b59f3b; }
.wordle-tile.absent { background: #3a3a3c; border-color: #3a3a3c; }
.wordle-tile.flip { animation: wordleFlip .5s ease both; }
.wordle-row.shake { animation: wordleShake .4s ease; }
@keyframes wordlePop { 50% { transform: scale(1.1); } }
@keyframes wordleFlip { 0% { transform: rotateX(0); background: transparent; border-color: #565758; } 49% { background: transparent; border-color: #565758; } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes wordleShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.wordle-msg { min-height: 22px; text-align: center; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .15s; }
.wordle-msg.show { opacity: 1; }
.wordle-kb { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 6px; }
.wordle-kb-row { display: flex; gap: 5px; }
.wordle-key { min-width: 32px; height: 46px; padding: 0 8px; border-radius: 4px; background: #818384; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.wordle-key.wide { min-width: 52px; }
.wordle-key.correct { background: #538d4e; } .wordle-key.present { background: #b59f3b; } .wordle-key.absent { background: #3a3a3c; }
@media (max-width: 420px) { .wordle-tile { width: 46px; height: 46px; font-size: 24px; } .wordle-key { min-width: 27px; padding: 0 5px; } .wordle-key.wide { min-width: 44px; } }
@media (prefers-reduced-motion: reduce) { .wordle-tile.flip, .wordle-row.shake, .wordle-tile.filled { animation: none; } }

/* ============ NULL RARITY (rarest: black and red) ============ */
.fg-window .r-null,.gag-item .r-null{border:1px solid #ff1a1a;color:#ff2020;background:#000;text-shadow:0 0 6px rgba(255,20,20,.9);box-shadow:0 0 8px rgba(255,0,0,.55),inset 0 0 6px rgba(255,0,0,.35);animation:rarNull 1.6s ease-in-out infinite}
@keyframes rarNull{0%,100%{box-shadow:0 0 6px rgba(255,0,0,.45),inset 0 0 4px rgba(255,0,0,.25);color:#e01818}50%{box-shadow:0 0 14px rgba(255,0,0,.95),inset 0 0 9px rgba(255,0,0,.55);color:#ff4040}}
.fg-window .gg-pet.locked{opacity:.6}
@media (prefers-reduced-motion: reduce){.fg-window .r-null{animation:none}}

/* ============ ADMIN: QUESTS / GAG ============ */
.gag-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
/* Owner panel, Grow a Garden (v4.62): pets with several abilities, editing, weather */
.gag-abilities-field { grid-column: 1 / -1; }
.gag-abilities { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.gag-ability-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.gag-item[data-id] { cursor: pointer; }
.gag-item.editing { box-shadow: 0 0 0 2px var(--accent) inset; }
.gag-edit-hint { display: block; margin: 6px 0 10px; }
.gag-wx-now { margin-top: 10px; font-size: 13px; color: var(--text-muted); }
/* Quests, GAG, Stock (v4.67): bypass for yourself, and each item's chance of being in a restock */
.gag-bypass { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-primary); margin: 6px 0; cursor: pointer; }
.gag-stock-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.gag-stock-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 6px 0 2px; }
.gag-stock-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(100px, 1fr) auto 96px minmax(110px, 1fr); align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; background: var(--bg-tertiary); font-size: 13px; }
/* Add stock / Reset to 0 (v4.70) */
.gag-stock-tools { display: flex; align-items: center; gap: 4px; }
.gag-stock-add { width: 64px; padding: 4px 6px; }
.gag-stock-tools .btn-secondary.slim { padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.gag-stock-name { font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gag-stock-rar, .gag-stock-now { color: var(--text-muted); font-size: 12px; }
.gag-stock-in { display: flex; align-items: center; gap: 4px; color: var(--text-muted); }
.gag-stock-pct { width: 70px; padding: 4px 6px; }
@media (max-width: 600px) { .gag-stock-row { grid-template-columns: 1fr 90px; } .gag-stock-rar, .gag-stock-now, .gag-stock-tools { grid-column: 1 / -1; } }
#gag-wx-stop { margin-left: 8px; }

/* Cookie Clicker additions (v4.62): Lucky Crumbs, boosts, buying several, achievements, stats */
.fg-window .ck-left { position: relative; }
.fg-window .ck-lucky { position: absolute; width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #fff6c8 0 12%, #f7c948 30%, #c98a12 70%, #8a5a00 100%);
  box-shadow: 0 0 0 2px rgba(255,220,120,.5), 0 0 18px rgba(255,200,60,.7); animation: ckLucky 1.4s ease-in-out infinite alternate; }
@keyframes ckLucky { from { transform: translateY(0) rotate(-8deg) scale(1); } to { transform: translateY(-6px) rotate(8deg) scale(1.08); } }
.fg-window .ck-buffs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 2px; }
.fg-window .ck-buffs span { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #c98a12; color: #fff; }
.fg-window .ck-stats { margin-top: 10px; font-size: .74rem; line-height: 1.5; color: var(--text-dim); text-align: center; }
.fg-window .ck-head .ck-buyn { float: right; display: inline-flex; gap: 3px; }
.fg-window .ck-buyn button { font: inherit; font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--card-bg-2); color: var(--text-dim); cursor: pointer; }
.fg-window .ck-buyn button.on { background: #c8841e; border-color: #c8841e; color: #fff; }
.fg-window .cki-n { font-size: .72rem; font-weight: 800; color: #f0b232; }
.fg-window .ck-head small { font-weight: 600; color: var(--text-dim); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.fg-window .ck-ach { display: flex; flex-wrap: wrap; gap: 5px; }
.fg-window .ck-ach-chip { font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px dashed var(--border); color: var(--text-dim); opacity: .6; }
.fg-window .ck-ach-chip.got { opacity: 1; border-style: solid; border-color: #c8841e; color: #fff; background: rgba(200,132,30,.25); }

/* Grow a Garden: weather, mutations, stock and quests (v4.62) */
.fg-window .gg-weather { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 7px 12px; border-radius: 10px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.08); font-size: .82rem; color: var(--text-dim, #c9c9c9); }
.fg-window .gg-wx-name { font-weight: 800; text-transform: uppercase; letter-spacing: .6px; font-size: .72rem; padding: 2px 8px; border-radius: 6px; color: #fff; background: #3b4250; }
.fg-window .gg-wx-name.wx-drizzle { background: #2f6fb3; } .fg-window .gg-wx-name.wx-heatwave { background: #c2621b; }
.fg-window .gg-wx-name.wx-coldsnap { background: #5aa9cf; } .fg-window .gg-wx-name.wx-storm { background: #4a3f8f; }
.fg-window .gg-wx-name.wx-starfall { background: #8a6d1e; } .fg-window .gg-wx-name.wx-eclipse { background: #000; color: #ff3030; box-shadow: inset 0 0 0 1px #ff2020; }
.fg-window .gg-garden { position: relative; }
.fg-window .gg-wx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; border-radius: 12px; overflow: hidden; opacity: 0; transition: opacity .8s ease; }
.fg-window .gg-wx-layer[class*="wx-"] { opacity: 1; }
.fg-window .gg-wx-layer.wx-drizzle, .fg-window .gg-wx-layer.wx-storm {
  background-image: repeating-linear-gradient(105deg, transparent 0 14px, rgba(160,200,255,.22) 14px 15px, transparent 15px 31px);
  background-size: 62px 62px; animation: ggRain .6s linear infinite; }
.fg-window .gg-wx-layer.wx-storm { background-color: rgba(30,20,70,.28); animation-duration: .35s; }
@keyframes ggRain { from { background-position: 0 0; } to { background-position: -16px 62px; } }
.fg-window .gg-wx-layer.wx-heatwave { background: linear-gradient(180deg, rgba(255,140,40,.16), rgba(255,200,80,.05)); animation: ggHeat 3s ease-in-out infinite alternate; }
@keyframes ggHeat { from { opacity: .7; } to { opacity: 1; } }
.fg-window .gg-wx-layer.wx-coldsnap { background: radial-gradient(1.6px 1.6px at 20% 30%, #fff, transparent), radial-gradient(1.4px 1.4px at 70% 60%, #fff, transparent),
  radial-gradient(1.8px 1.8px at 45% 80%, #fff, transparent), radial-gradient(1.3px 1.3px at 85% 15%, #fff, transparent), rgba(170,220,255,.1);
  background-size: 90px 90px; animation: ggSnow 6s linear infinite; }
@keyframes ggSnow { from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; } to { background-position: 20px 90px, -15px 90px, 10px 90px, -20px 90px, 0 0; } }
.fg-window .gg-wx-layer.wx-starfall { background: radial-gradient(2px 2px at 30% 20%, #ffe9a0, transparent), radial-gradient(1.5px 1.5px at 75% 45%, #fff, transparent),
  radial-gradient(2px 2px at 55% 75%, #ffd36a, transparent), rgba(40,30,80,.18); background-size: 120px 120px; animation: ggStars 4s linear infinite; }
@keyframes ggStars { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: -60px 120px, -40px 120px, -80px 120px, 0 0; } }
.fg-window .gg-wx-layer.wx-eclipse { background: radial-gradient(circle at 50% 40%, rgba(0,0,0,0) 0 30%, rgba(0,0,0,.55) 80%), rgba(60,0,0,.22); }
.fg-window .gg-plot-muts { position: absolute; left: 6px; top: 6px; display: flex; gap: 3px; z-index: 1; }
.fg-window .gg-plot-muts i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0,0,0,.45); }
.gm-dewy { background: #5fb4ff; } .gm-sunbaked { background: #ff9a3c; } .gm-frosted { background: #c9f1ff; } .gm-charged { background: #b18cff; }
.gm-starlit { background: #ffe066; } .gm-voidtouched { background: #000; box-shadow: 0 0 0 1.5px #ff2020 !important; }
.fg-window .gg-plot.mutated { box-shadow: inset 0 0 14px rgba(150,200,255,.25); }
.fg-window .gg-stock { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #8fdc8f; margin-left: 2px; white-space: nowrap; }
.fg-window .gg-stock.out { color: #ff7b7b; }
.fg-window .gg-restock-note b { color: var(--text, #fff); }
.fg-window .gg-shoptabs { flex-wrap: wrap; }
.fg-window .gg-shoptab { min-width: 0; padding: 7px 3px; font-size: .76rem; line-height: 1.25; }
.fg-window .gg-shoptab[data-tab="sprinklers"] { flex-grow: 1.7; }
.fg-window .gg-shoptab[data-tab="quests"] { flex-basis: 100%; }
.fg-window .gg-shoptab[data-badge]:not([data-badge=""])::after { content: attr(data-badge); margin-left: 5px; font-size: .62rem; font-weight: 800; padding: 0 5px; border-radius: 999px; background: #e0563b; color: #fff; }
.fg-window .gg-quest-list { display: flex; flex-direction: column; gap: 8px; }
.fg-window .gg-quest { padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.07); }
.fg-window .gg-quest.claimed { opacity: .55; }
.fg-window .gg-quest-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-weight: 700; }
.fg-window .gg-quest-tier { font-size: .66rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim, #aaa); }
.fg-window .gg-quest-bar { margin: 8px 0 6px; position: static; }
.fg-window .gg-quest-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-dim, #bbb); }
.fg-window .gg-quest-claim { padding: 4px 14px; }
.fg-window .gg-quest-claim[disabled] { opacity: .45; cursor: default; }
.fg-window .gg-quest-done { font-weight: 800; color: #8fdc8f; }
.gag-list { display: flex; flex-direction: column; gap: 6px; }
.gag-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; background: var(--bg-input); }
.gag-item.builtin { opacity: .7; }
.gag-item-ic { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }
.gag-item-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gag-item-mid small { color: var(--text-muted); font-size: 12px; }
.gag-item-del { cursor: pointer; color: var(--text-muted); display: inline-flex; }
.gag-item-del:hover { color: var(--danger, #ed4245); }


/* ---- Friends overlay (desktop only; shortcut is set in Settings → Keyboard) ----
   Everything is built from the theme variables, so it follows Light / Ash / Onyx
   and shop themes automatically. Sits above the Quests game window (z 200) and
   modals (z 100), below toasts. */
#ov-root {
  position: fixed; inset: 0; z-index: 450;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  font-family: var(--font); color: var(--text-normal);
  animation: ovFade .14s ease;
}
#ov-root[hidden] { display: none; }
body.is-mobile #ov-root { display: none !important; }
:where(#ov-root) button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
#ov-root :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@keyframes ovFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ovSlide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.ov-panel {
  position: absolute; top: 16px; right: 16px; width: 320px; height: calc(100vh - 32px);   /* fallback; JS sets left/top/width/height */
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-floating); border: 1px solid var(--divider); border-radius: 12px;
  box-shadow: 0 12px 40px var(--shadow-color);
  animation: ovSlide .18s cubic-bezier(.2,.9,.3,1.1);
}
.ov-tabs { display: flex; gap: 4px; padding: 10px 10px 0; }
.ov-tab { flex: 1; padding: 8px 10px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-align: center !important; }
.ov-tab:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.ov-tab.on { background: var(--bg-modifier-selected); color: var(--text-normal); }

.ov-search-wrap { position: relative; padding: 10px; color: var(--text-muted); }
.ov-search-wrap svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.ov-search { width: 100%; padding: 8px 10px 8px 32px; border: 0; border-radius: 6px; background: var(--bg-input); color: var(--text-normal); font: 14px var(--font); }
.ov-search::placeholder { color: var(--text-muted); }

.ov-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; }
.ov-section { padding: 12px 8px 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ov-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 8px; }
.ov-row:hover { background: var(--bg-modifier-hover); }
.ov-row.off .avatar, .ov-row.off .ov-row-copy { opacity: .6; }
.ov-row-copy { display: flex; flex-direction: column; min-width: 0; }
.ov-row-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-empty { padding: 28px 16px; text-align: center; font-size: 14px; color: var(--text-muted); }
.ov-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--divider); font-size: 12px; color: var(--text-muted); }
.ov-foot kbd, .ov-bind-btn kbd, .help-kbds kbd {
  background: var(--bg-input); border: 1px solid var(--divider); border-radius: 4px;
  padding: 2px 6px; font: 600 11px var(--font); color: var(--text-normal);
}

/* chat windows dock to the left of the panel, bottom-aligned, newest furthest left */
/* chat windows float freely; JS gives each one its left/top/width/height */
.ov-chats { position: absolute; inset: 0; pointer-events: none; }
.ov-chat {
  position: absolute; pointer-events: auto; right: 364px; bottom: 16px; width: 340px; height: min(480px, calc(100vh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-primary); border: 1px solid var(--divider); border-radius: 12px;
  box-shadow: 0 12px 40px var(--shadow-color);
  animation: ovSlide .18s cubic-bezier(.2,.9,.3,1.1);
}
.ov-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-secondary); border-bottom: 1px solid var(--divider); }
.ov-chat-who { flex: 1; min-width: 0; }
.ov-chat-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-chat-status { font-size: 12px; color: var(--text-muted); }
.ov-x { width: 28px; height: 28px; border-radius: 6px; color: var(--text-muted); text-align: center !important; }
.ov-x:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.ov-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0; }
.ov-msg { display: flex; gap: 10px; padding: 2px 12px; }
.ov-msg.first { margin-top: 10px; }
.ov-gutter { width: 32px; flex: none; }
.ov-msg-main { flex: 1; min-width: 0; }
.ov-msg-meta { display: flex; align-items: baseline; gap: 8px; }
.ov-msg-name { font-size: 14px; font-weight: 600; }
.ov-msg-time { font-size: 11px; color: var(--text-muted); }
.ov-text { font-size: 14px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.ov-note { color: var(--text-muted); font-style: italic; }
.ov-img { display: block; max-width: 100%; max-height: 200px; margin-top: 4px; border-radius: 8px; }
.ov-file { display: inline-block; margin-top: 4px; color: var(--text-link); font-size: 14px; }
.ov-compose { padding: 10px 12px 12px; }
.ov-input { display: block; width: 100%; max-height: 96px; resize: none; border: 0; border-radius: 8px; padding: 10px 12px; background: var(--bg-input); color: var(--text-normal); font: 14px/1.35 var(--font); }
.ov-input::placeholder { color: var(--text-muted); }

@media (max-width: 900px) {
  .ov-panel { width: 280px; }
  .ov-chat { width: 300px; right: 324px; }
}

/* drag grip on the panel, window header as the chat's drag handle */
.ov-grip { flex: none; height: 16px; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.ov-grip-dots { width: 36px; height: 4px; border-radius: 2px; background: var(--text-faint, var(--text-muted)); opacity: .55; }
.ov-grip:hover .ov-grip-dots { opacity: .9; }
.ov-chat-head { cursor: grab; touch-action: none; user-select: none; }
.ov-win.ov-dragging { user-select: none; box-shadow: 0 18px 54px var(--shadow-color); }
.ov-win.ov-dragging, .ov-win.ov-dragging * { cursor: grabbing; }
.ov-win.ov-dragging[class] { transition: none; }
.ov-win .ov-msgs, .ov-win .ov-list { margin-right: 5px; }   /* keep the scrollbar clear of the resize edge */

/* resize handles: thin strips on every edge plus the four corners */
.ov-rz { position: absolute; z-index: 5; touch-action: none; }
.ov-rz-n, .ov-rz-s { left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.ov-rz-e, .ov-rz-w { top: 12px; bottom: 12px; width: 5px; cursor: ew-resize; }
.ov-rz-n { top: 0; } .ov-rz-s { bottom: 0; } .ov-rz-e { right: 0; } .ov-rz-w { left: 0; }
.ov-rz-ne, .ov-rz-nw, .ov-rz-se, .ov-rz-sw { width: 12px; height: 12px; }
.ov-rz-ne { top: 0; right: 0; cursor: nesw-resize; } .ov-rz-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.ov-rz-nw { top: 0; left: 0; cursor: nwse-resize; } .ov-rz-se { bottom: 0; right: 0; cursor: nwse-resize; }

/* Servers tab */
.ov-srv-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.ov-srv-ico.small { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.ov-hash { flex: none; width: 24px; text-align: center; font-size: 20px; font-weight: 500; color: var(--text-muted); }
.ov-chan { padding-top: 5px; padding-bottom: 5px; }
.ov-back { margin-bottom: 4px; border-bottom: 1px solid var(--divider); border-radius: 8px 8px 0 0; }
.ov-back-arrow { flex: none; width: 24px; text-align: center; font-size: 26px; line-height: 1; color: var(--text-muted); }
.ov-reset { margin-left: auto; padding: 3px 8px; border-radius: 6px; font-size: 12px; color: var(--text-muted); }
.ov-reset:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.ov-input:disabled { opacity: .6; cursor: not-allowed; }
.ov-tab { padding-left: 6px; padding-right: 6px; }
@media (prefers-reduced-motion: reduce) {
  #ov-root, .ov-panel, .ov-chat { animation: none; }
}

/* settings row + help popover */
.ov-bind-ctl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ov-bind-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--divider); border-radius: 6px; background: var(--bg-input); color: var(--text-normal); font-size: 13px; cursor: pointer; }
.ov-bind-btn:hover { background: var(--bg-modifier-selected); }
.ov-bind-btn.capturing { border-color: var(--accent); background: var(--accent-soft); }
.help-kbds { display: inline-flex; align-items: center; gap: 6px; }
body.is-mobile .ov-setting, body.is-mobile .ov-help-row { display: none; }

/* ---- Cookie Clicker: upgrades and items ---- */
.fg-window .ck-sec { display: flex; flex-direction: column; gap: 8px; }
.fg-window .ck-sec + .ck-sec { margin-top: 10px; }
.fg-window .ck-head { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 2px 2px 0; }
.fg-window .ck-upg-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding-right: 2px; overscroll-behavior: contain; }
.fg-window .ck-bought { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .76rem; color: var(--text-dim); }
.fg-window .ck-chip { font-size: 1.2rem; line-height: 1; cursor: help; }

/* ============================================================
   ACCOUNT TERMINATION (skull sequence, see startTermination in script.js)
   ============================================================ */
#terminate-screen { position: fixed; inset: 0; z-index: 200000; background: #050000; overflow: hidden; cursor: none; user-select: none; -webkit-user-select: none; transition: opacity .8s ease; --term-p: 0; }
#terminate-screen.is-out { opacity: 0; pointer-events: none; }
#terminate-screen .hidden { display: none; }
#terminate-screen .term-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; will-change: transform; }
#terminate-screen .term-skull { height: 56vmin; width: auto; image-rendering: crisp-edges; image-rendering: pixelated; will-change: transform, opacity; transform-origin: 50% 40%; filter: saturate(1.15) contrast(1.1) drop-shadow(0 0 calc(10px + 40px * var(--term-p)) rgba(255, 20, 20, .55)); }
#terminate-screen .term-static { position: absolute; inset: 0; pointer-events: none; opacity: calc(.12 + var(--term-p) * .3); mix-blend-mode: screen; background-image: repeating-radial-gradient(circle at 17% 32%, rgba(255,40,30,.5) 0 1px, transparent 1px 3px), repeating-radial-gradient(circle at 83% 71%, rgba(255,40,30,.4) 0 1px, transparent 1px 4px); background-size: 6px 6px, 5px 5px; animation: term-static .18s steps(3) infinite; }
#terminate-screen .term-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(0,0,0,.35) 0 1px, transparent 1px 3px); opacity: .55; }
#terminate-screen .term-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent calc(60% - var(--term-p) * 35%), rgba(0,0,0,.92) 100%); }
#terminate-screen .term-flash { position: absolute; inset: 0; pointer-events: none; background: #ff1d12; opacity: 0; mix-blend-mode: screen; }
#terminate-screen .term-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; background: #070000; }
#terminate-screen .term-title { position: relative; font-family: 'Courier New', ui-monospace, monospace; font-weight: 900; font-size: clamp(34px, 9vw, 120px); letter-spacing: .04em; text-transform: uppercase; color: #ff2a1f; text-shadow: 0 0 18px rgba(255, 30, 20, .75), 0 0 60px rgba(255, 30, 20, .4); animation: term-jitter .35s steps(2) infinite; }
#terminate-screen .term-title::before, #terminate-screen .term-title::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; }
#terminate-screen .term-title::before { color: #00e5ff; mix-blend-mode: screen; transform: translate(-4px, 0); clip-path: inset(0 0 55% 0); animation: term-slice-a 1.3s steps(1) infinite; text-shadow: none; }
#terminate-screen .term-title::after { color: #ff00a8; mix-blend-mode: screen; transform: translate(4px, 0); clip-path: inset(55% 0 0 0); animation: term-slice-b 1.1s steps(1) infinite; text-shadow: none; }
#terminate-screen.is-end .term-static { opacity: .35; }
#terminate-screen.is-end .term-vignette { background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.9) 100%); }
#terminate-screen.is-fading .term-end { opacity: 0; transition: opacity .7s ease-in; }
#terminate-screen.is-black { background: #000; }
#terminate-screen.is-black .term-static, #terminate-screen.is-black .term-scan, #terminate-screen.is-black .term-vignette { opacity: 0; }
@keyframes term-static { 0% { background-position: 0 0, 0 0; } 33% { background-position: -7px 4px, 3px -5px; } 66% { background-position: 5px -6px, -4px 2px; } 100% { background-position: 0 0, 0 0; } }
@keyframes term-jitter { 0% { transform: translate(0, 0); } 50% { transform: translate(2px, -1px); } 100% { transform: translate(-2px, 1px); } }
@keyframes term-slice-a { 0% { clip-path: inset(0 0 70% 0); transform: translate(-5px, 0); } 25% { clip-path: inset(30% 0 40% 0); transform: translate(6px, 0); } 50% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, 0); } 75% { clip-path: inset(50% 0 20% 0); transform: translate(4px, 0); } 100% { clip-path: inset(0 0 55% 0); transform: translate(-4px, 0); } }
@keyframes term-slice-b { 0% { clip-path: inset(60% 0 0 0); transform: translate(5px, 0); } 30% { clip-path: inset(20% 0 50% 0); transform: translate(-6px, 0); } 60% { clip-path: inset(70% 0 5% 0); transform: translate(3px, 0); } 100% { clip-path: inset(55% 0 0 0); transform: translate(4px, 0); } }
@keyframes term-blink { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #terminate-screen .term-static, #terminate-screen .term-title, #terminate-screen .term-title::before, #terminate-screen .term-title::after { animation: none; }
}

/* tiny diagonal wall of text behind the Account Terminated card */
#terminate-screen .term-wall { position: absolute; left: 50%; top: 50%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%) rotate(-32deg); overflow: hidden; z-index: 0; pointer-events: none;
  font: 700 10px/1.45 'Courier New', ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 38, 28, .62); word-spacing: .2em; animation: term-wall-flicker 1.7s steps(1) infinite; }
#terminate-screen .term-end::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 55% 40% at 50% 50%, rgba(5, 0, 0, .9) 0%, rgba(5, 0, 0, .65) 55%, transparent 100%); }
@keyframes term-wall-flicker { 0% { opacity: 1; } 18% { opacity: .55; } 22% { opacity: 1; } 61% { opacity: .8; } 64% { opacity: 1; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #terminate-screen .term-wall { animation: none; } }

/* Devices tab (owner panel) */
.dev-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-tertiary); color: var(--text-muted); flex-shrink: 0; }
.dev-ico.big { width: 44px; height: 44px; }
.dev-ico.big svg { width: 22px; height: 22px; }
.admin-row .dev-sub { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.dev-facts { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.dev-facts dt { color: var(--text-muted); }
.dev-facts dd { margin: 0; word-break: break-all; }
.dev-facts dd.mono { font-family: 'Courier New', ui-monospace, monospace; font-size: 12px; }
.dev-accts { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--divider); background: var(--bg-tertiary); color: var(--text-normal, inherit); font: inherit; font-size: 13px; cursor: pointer; }
button.dev-chip:hover { background: var(--bg-modifier-hover); }
.dev-chip.gone { opacity: .55; cursor: default; }
/* an account chip with its x (take it off this device or network, v4.68) */
.dev-chip-wrap { display: inline-flex; align-items: stretch; }
.dev-chip-wrap .dev-chip { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dev-chip-x { padding: 0 9px; border: 1px solid var(--divider); border-left: 0; border-radius: 0 999px 999px 0; background: var(--bg-tertiary);
  color: var(--text-muted); font-size: 15px; line-height: 1; cursor: pointer; }
.dev-chip-x:hover { background: var(--bg-modifier-hover); color: var(--text-danger, #f23f43); }
.dev-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.dev-line .dl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Message filter: words are switches, not deletable */
.filter-chip { user-select: none; }
.filter-chip .fc-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ba55d; flex-shrink: 0; }
.filter-chip .fc-state { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); }
.filter-chip.off .fc-dot { background: var(--text-faint); }
.filter-chip.off .fc-word { text-decoration: line-through; opacity: .55; }
.filter-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-all-off .filter-chip { opacity: .5; }

/* ---------- Shop: Music ---------- */
.music-shop-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.music-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: var(--bg-secondary); font-size: 13px; color: var(--text-muted); }
.music-toolbar .mt-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--accent); margin-right: 6px; }
.music-toolbar .mt-now { color: var(--text-normal); flex: 1; min-width: 180px; }
.music-toolbar .mt-vol { display: inline-flex; align-items: center; gap: 8px; }
.music-toolbar .mt-vol input { width: 120px; accent-color: var(--accent); }
.shop-item-card.is-music-card { padding: 12px 12px 12px; }
.shop-item-card.is-music-card .sic-desc { padding: 0 4px; }
.sic-music-preview { position: relative; width: 100%; min-height: 150px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 18px 14px; text-align: center; background: #05050a; border: 1px solid rgba(255,255,255,.1); }
.sic-music-preview.fx-bg-equinox { background: radial-gradient(ellipse at 50% 45%, #1c2238 0%, #0a0c16 55%, #000 100%); box-shadow: inset 0 0 40px rgba(140,170,255,.12); }
.sic-music-preview .smp-title { font-weight: 700; color: #fff; position: relative; z-index: 1; }
/* a track with its own banner image (Pure Vessel): the picture fills the card, with a dark wash so the name stays readable */
.sic-music-preview.has-banner { background-color: #05050a; background-size: cover; background-position: center; background-repeat: no-repeat; }
.sic-music-preview.has-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.28), rgba(0,0,0,.5)); }
.sic-music-preview.has-banner .smp-title { font-family: 'Times New Roman', Georgia, 'Noto Serif', serif; font-size: 24px; letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 0 10px rgba(0,0,0,.9), 0 2px 14px rgba(0,0,0,.8); }
/* little equalizer along the bottom; it only moves while the track is the equipped one */
.smp-eq { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; opacity: .45; }
.smp-eq i { display: block; width: 5px; height: 4px; border-radius: 2px 2px 0 0; background: rgba(255,255,255,.8); }
.sic-music-preview.is-playing .smp-eq { opacity: .9; }
.sic-music-preview.is-playing .smp-eq i { animation: smp-eq .9s ease-in-out infinite; }
.smp-eq i:nth-child(2) { animation-delay: -.15s !important; } .smp-eq i:nth-child(3) { animation-delay: -.45s !important; }
.smp-eq i:nth-child(4) { animation-delay: -.3s !important; } .smp-eq i:nth-child(5) { animation-delay: -.6s !important; }
.smp-eq i:nth-child(6) { animation-delay: -.2s !important; } .smp-eq i:nth-child(7) { animation-delay: -.5s !important; }
@keyframes smp-eq { 0%, 100% { height: 4px; } 50% { height: 22px; } }
/* Equinox only: the strip matches the Equinox bars, flat black and white blocks with gaps that jump up and down and flash */
.fx-bg-equinox .smp-eq { height: 32px; justify-content: space-around; gap: 0; padding: 0 4px; opacity: .6; overflow: hidden; }
.fx-bg-equinox .smp-eq i { width: 9%; height: 8px; border-radius: 0; background: #fff; }
.fx-bg-equinox .smp-eq i:nth-child(even) { background: #000; }
.fx-bg-equinox.is-playing .smp-eq { opacity: 1; }
.fx-bg-equinox.is-playing .smp-eq i { animation: smp-eq-h .62s ease-in-out infinite, smp-eq-c .34s steps(1, end) infinite; }
.fx-bg-equinox .smp-eq i:nth-child(1) { animation-delay: -.10s, -.05s !important; animation-duration: .58s, .31s !important; }
.fx-bg-equinox .smp-eq i:nth-child(2) { animation-delay: -.45s, -.20s !important; animation-duration: .71s, .27s !important; }
.fx-bg-equinox .smp-eq i:nth-child(3) { animation-delay: -.25s, -.12s !important; animation-duration: .49s, .38s !important; }
.fx-bg-equinox .smp-eq i:nth-child(4) { animation-delay: -.55s, -.28s !important; animation-duration: .66s, .24s !important; }
.fx-bg-equinox .smp-eq i:nth-child(5) { animation-delay: -.05s, -.17s !important; animation-duration: .54s, .35s !important; }
.fx-bg-equinox .smp-eq i:nth-child(6) { animation-delay: -.35s, -.08s !important; animation-duration: .77s, .29s !important; }
.fx-bg-equinox .smp-eq i:nth-child(7) { animation-delay: -.60s, -.22s !important; animation-duration: .6s, .33s !important; }
@keyframes smp-eq-h { 0%, 100% { height: 6px; } 25% { height: 30px; } 50% { height: 14px; } 75% { height: 26px; } }
@keyframes smp-eq-c { 0% { background: #fff; } 50% { background: #000; } }

/* ---------- Animated aura name text (EQUINOX) ----------
   The name itself stays steady and glows. Little words (.fx-echo) keep slipping out from behind it,
   drifting outward in every direction and fading away, like pulses leaving the title. */
.fx-text { position: relative; display: inline-block; max-width: 100%; z-index: 1; }
.fx-text .fx-letters { position: relative; z-index: 1; display: block; }
.fx-text .fx-w { display: inline-block; white-space: nowrap; }
.fx-text .fx-ch { display: inline-block; }
.fx-equinox { font-family: 'Times New Roman', Georgia, 'Noto Serif', serif; font-style: italic; font-weight: 700; font-size: 22px; line-height: 1.25; letter-spacing: .08em; color: #fff; }
.fx-equinox .fx-letters { text-shadow: 0 0 5px rgba(255,255,255,.9), 0 0 16px rgba(130,165,255,.65), 0 0 32px rgba(90,120,255,.35); animation: fx-eq-glow 3s ease-in-out infinite; }
.fx-echo { position: absolute; left: 50%; top: 50%; z-index: 0; pointer-events: none; white-space: nowrap; opacity: 0;
  font-family: 'Times New Roman', Georgia, 'Noto Serif', serif; font-style: italic; font-weight: 600; font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(200,220,255,.95); text-shadow: 0 0 6px rgba(130,165,255,.85);
  transform: translate(-50%, -50%) scale(.5); animation: fx-echo-out 4.4s ease-out infinite; animation-delay: var(--d); }
@keyframes fx-eq-glow {
  0%, 100% { text-shadow: 0 0 4px rgba(255,255,255,.85), 0 0 12px rgba(130,165,255,.5), 0 0 24px rgba(90,120,255,.25); }
  50% { text-shadow: 0 0 7px rgba(255,255,255,1), 0 0 22px rgba(150,180,255,.85), 0 0 44px rgba(90,120,255,.5); }
}
@keyframes fx-echo-out {
  0% { transform: translate(-50%, -50%) scale(.5); opacity: 0; }
  14% { opacity: .9; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.05); opacity: 0; }
}
.shop-item-card.is-hero .fx-equinox { font-size: 24px; }

/* ---------- Purchase cutscene ---------- */
#cutscene-screen { position: fixed; inset: 0; z-index: 150000; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity .4s ease; }
#cutscene-screen.is-out { opacity: 0; pointer-events: none; }
#cutscene-screen .cut-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#cutscene-screen video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* A phone held upright: the video is wide, so turn the whole stage (video and Skip button) a quarter turn
   and swap its width and height. It then fills the screen; the person just turns their phone to match.
   Held sideways (landscape) it plays normally. */
@media (orientation: portrait) and (pointer: coarse) {
  #cutscene-screen .cut-stage { position: absolute; top: 50%; left: 50%; width: 100vh; width: 100dvh; height: 100vw; height: 100dvw; transform: translate(-50%, -50%) rotate(90deg); }
}
#cutscene-screen .cut-skip { position: absolute; right: 20px; bottom: 20px; padding: 8px 16px; border-radius: 6px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.55); color: #fff; font-weight: 600; cursor: pointer; }
#cutscene-screen .cut-skip:hover { background: rgba(255,255,255,.18); }
#cutscene-screen .cut-skip.hidden { display: none; }

/* ---------- Screen shake (see ACCESSIBILITY — SCREEN SHAKE in script.js) ----------
   RULE FOR ANY AI MODEL / DEVELOPER: Settings > Accessibility > "Reduce screen shake" sets
   html[data-no-shake]. EVERY shake or violent-motion animation, today and in the future, must have
   a rule here that switches it off. Add yours to the list below. */
html.is-shaking { overflow: hidden; background: #000; }
html[data-no-shake] .ds-unsaved.shake,
html[data-no-shake] .fg-window .mm-card.shake,
html[data-no-shake] .wordle-row.shake { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .fx-equinox .fx-letters, .fx-echo { animation: none; }
  .fx-echo { display: none; }
}

/* Owner panel: a player's Shop items */
.admin-items-list { max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.admin-item-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.admin-item-row .ai-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-row .ai-cat { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.dev-member { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.dev-member .dm-main { flex: 1; min-width: 0; }
.dev-member .dm-main small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Equinox bars (see musicBarsTick in script.js). Flat black and white blocks with gaps between them, like the ones in
   Sol's RNG: one row hanging from the top of the screen, one standing on the bottom. Fixed to the screen, above
   everything except the ban screen. The script slides each block up and down with transforms and flips its colour. */
#music-bars { position: fixed; inset: 0; pointer-events: none; z-index: 9000; overflow: hidden; }
#music-bars .mb-row { position: absolute; left: 0; right: 0; display: flex; overflow: hidden; }
#music-bars .mb-top { top: 0; height: 14vh; }
#music-bars .mb-bot { bottom: 0; height: 17vh; }
#music-bars .mb-slot { position: relative; flex: 1 1 0; min-width: 0; height: 100%; }
#music-bars .mb-bar { position: absolute; top: 0; left: 13.5%; width: 62.5%; height: 100%; background: #000; will-change: transform; transform: translateY(-100%); }
#music-bars .mb-bot .mb-bar { transform: translateY(100%); }
#music-bars .mb-bar.w { background: #fff; }
.admin-items-search { width: 100%; box-sizing: border-box; margin: 6px 0 8px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border, rgba(255,255,255,.12)); background: var(--bg-tertiary, rgba(0,0,0,.25)); color: inherit; font: inherit; }
.admin-item-row[hidden], .admin-items-none[hidden] { display: none !important; }

/* ---------- Epilepsy mode (see ACCESSIBILITY — EPILEPSY MODE in script.js) ----------
   RULE FOR ANY AI MODEL / DEVELOPER: Settings > Accessibility > "Epilepsy mode" sets html[data-epilepsy].
   Anything that flashes, flickers, strobes or pulses brightly, today or added later, must be switched
   off here. Add your selector to the list below. */
html[data-epilepsy] body.shop-anim-hue::before,
html[data-epilepsy] body.shop-anim-holo::before,
html[data-epilepsy] body.shop-anim-aurora::before,
html[data-epilepsy] .nameplate-blazing::before,
html[data-epilepsy] .nameplate-starfall::before,
html[data-epilepsy] .nameplate-aurora::before,
html[data-epilepsy] .effect-sparkles .particle,
html[data-epilepsy] .effect-glitter .particle,
html[data-epilepsy] .nameplate-shimmer::after,
html[data-epilepsy] .effect-style-twinkling .particle,
html[data-epilepsy] .frame-custom-glow,
html[data-epilepsy] .frame-custom-gradient.frame-grad-anim::before,
html[data-epilepsy] .frame-neon,
html[data-epilepsy] .frame-rainbow,
html[data-epilepsy] .frame-rainbow::before,
html[data-epilepsy] .frame-plasma::before,
html[data-epilepsy] .nameplate-galaxy::before,
html[data-epilepsy] .frame-plasma,
html[data-epilepsy] body.shop-anim-blackhole::after,
html[data-epilepsy] .sic-theme-blackhole::before,
html[data-epilepsy] body.shop-anim-supernova::after,
html[data-epilepsy] .sic-theme-supernova::before,
html[data-epilepsy] body.shop-anim-eclipse::after,
html[data-epilepsy] .sic-theme-eclipse::before,
html[data-epilepsy] body.shop-anim-nebula::after,
html[data-epilepsy] .sic-theme-nebula::before,
html[data-epilepsy] body.shop-anim-crimsonrift::after,
html[data-epilepsy] .sic-theme-crimsonrift::before,
html[data-epilepsy] .nameplate-blackhole::before,
html[data-epilepsy] .frame-eventhorizon::before,
html[data-epilepsy] .fg-window .gg-plot.ready,
html[data-epilepsy] .fg-bot-btn.on .fg-bot-dot,
html[data-epilepsy] .fg-window .gg-wx-layer,
html[data-epilepsy] .fg-window .r-super,
html[data-epilepsy] .gag-item .r-super,
html[data-epilepsy] .fg-window .r-prismatic,
html[data-epilepsy] .gag-item .r-prismatic,
html[data-epilepsy] .fg-window .r-transcendent,
html[data-epilepsy] .gag-item .r-transcendent,
html[data-epilepsy] .fg-window .r-null,
html[data-epilepsy] .gag-item .r-null,
html[data-epilepsy] #terminate-screen .term-static,
html[data-epilepsy] #terminate-screen .term-title,
html[data-epilepsy] #terminate-screen .term-title::before,
html[data-epilepsy] #terminate-screen .term-title::after,
html[data-epilepsy] #terminate-screen .term-wall,
html[data-epilepsy] .fx-equinox .fx-letters,
html[data-epilepsy] .fx-bg-equinox.is-playing .smp-eq i,
html[data-epilepsy] .fx-echo,
html[data-epilepsy] .ss-live-dot { animation: none !important; }
html[data-epilepsy] #terminate-screen .term-flash,
html[data-epilepsy] #terminate-screen .term-static,
html[data-epilepsy] #music-bars { display: none !important; }
html[data-epilepsy] .fx-echo { display: none; }
html[data-epilepsy] #terminate-screen .term-wall { opacity: .8; }
html[data-epilepsy] #terminate-screen .term-title::before,
html[data-epilepsy] #terminate-screen .term-title::after { display: none; }

/* ============================================================
   PHONE REWORK (body.is-mobile only; desktop and tablets are untouched)
   - Messages header above the DMs, Friends/Quests/Codes/Shop as a row of buttons under it
   - softer, rounder shapes
   - menus slide in and out
   ============================================================ */
#mobile-home-top { display: none; }
@keyframes frxSheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes frxSheetDown { from { transform: none; } to { transform: translateY(100%); } }
@keyframes frxSlideInRight { from { transform: translateX(100%); } to { transform: none; } }
@keyframes frxSlideOutRight { from { transform: none; } to { transform: translateX(100%); } }
@keyframes frxDropIn { from { opacity: 0; transform: translateY(-16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes frxRiseIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes frxBackdropOut { from { opacity: 1; } to { opacity: 0; } }

body.is-mobile #app { background: var(--bg-deepest); }

/* ---- rail: round icons, the active one turns into a rounded square ---- */
body.is-mobile #server-rail { background: transparent; padding-top: 10px; }
body.is-mobile .rail-item { border-radius: 50%; transition: border-radius .22s ease, background .2s ease, transform .15s ease; }
body.is-mobile .rail-item:hover { border-radius: 50%; background: var(--bg-secondary); color: inherit; }
body.is-mobile .rail-item.active, body.is-mobile .rail-item.dm-item.active { border-radius: 16px; background: var(--accent); color: #fff; }
body.is-mobile .rail-item:active { transform: scale(.92); }
body.is-mobile .rail-item::before { display: none; }

/* ---- the second column becomes a rounded card ---- */
body.is-mobile #side-panel { border-radius: 28px 0 0 0; background: var(--bg-secondary); overflow: hidden; box-shadow: -1px 0 0 rgba(255,255,255,.05); }
body.is-mobile #app.is-home #side-header { display: none; }
body.is-mobile #side-header { margin: 12px 12px 4px; height: 46px; border-radius: 16px; background: rgba(255,255,255,.06); box-shadow: none; }
body.is-mobile #channel-list, body.is-mobile #dm-list { padding: 4px 8px 12px; scrollbar-width: none; }
body.is-mobile #channel-list::-webkit-scrollbar, body.is-mobile #dm-list::-webkit-scrollbar { display: none; }
body.is-mobile .channel-row { border-radius: 14px; min-height: 46px; padding: 8px 12px; }
body.is-mobile .channel-row:hover { background: transparent; }
body.is-mobile .channel-row.active { background: rgba(255,255,255,.09); }

/* ---- Messages header ---- */
body.is-mobile #mobile-home-top { display: block; position: relative; padding: 14px 8px 2px; }
body.is-mobile .mht-title { font-size: 31px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; padding: 4px 8px 12px; margin: 0; }
body.is-mobile .mht-actions { display: flex; align-items: center; gap: 10px; padding: 0 8px 12px; }
body.is-mobile .mht-round, body.is-mobile .mht-pill {
  height: 44px; border-radius: 22px; background: rgba(255,255,255,.08); color: var(--text-normal);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 16px;
  transition: transform .15s ease, background .2s ease;
}
body.is-mobile .mht-round { width: 44px; flex-shrink: 0; }
body.is-mobile .mht-pill { flex: 1; min-width: 0; }
body.is-mobile .mht-round.accent { background: var(--accent); color: #fff; }
body.is-mobile .mht-round:active, body.is-mobile .mht-pill:active { transform: scale(.94); }
body.is-mobile #mht-new[aria-expanded="true"] svg { transform: rotate(45deg); }
body.is-mobile #mht-new svg { transition: transform .2s ease; }
body.is-mobile .mht-search-row { display: flex; gap: 10px; align-items: center; padding: 0 8px 12px; }
body.is-mobile .mht-search-row[hidden] { display: none; }
body.is-mobile .mht-search-row.is-open { animation: frxDropIn .22s cubic-bezier(.2,.8,.3,1); }
body.is-mobile .mht-search-row input { flex: 1; min-width: 0; height: 44px; border-radius: 22px; border: none; padding: 0 18px; background: rgba(255,255,255,.08); color: inherit; font: inherit; font-size: 16px; outline: none; }
body.is-mobile .mht-search-row input:focus { box-shadow: 0 0 0 2px var(--accent); }
body.is-mobile .mht-search-row button { color: var(--accent); font-weight: 600; font-size: 15px; padding: 8px 4px; }
body.is-mobile .mht-menu { position: absolute; right: 16px; top: 112px; z-index: 20; min-width: 200px; padding: 6px; border-radius: 18px; background: var(--bg-floating); box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 12px 32px rgba(0,0,0,.5); transform-origin: top right; }
body.is-mobile .mht-menu:not([hidden]) { animation: frxDropIn .2s cubic-bezier(.2,.8,.3,1); }
body.is-mobile .mht-menu button { display: block; width: 100%; text-align: left; padding: 13px 16px; border-radius: 12px; font-size: 16px; font-weight: 500; color: var(--text-normal); }
body.is-mobile .mht-menu button:active { background: rgba(255,255,255,.09); }

/* Friends / Quests / Codes / Shop: a scrolling row of buttons under the header */
body.is-mobile #home-nav { display: flex; gap: 8px; overflow-x: auto; margin: 0 -8px; padding: 0 24px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
body.is-mobile #home-nav::-webkit-scrollbar { display: none; }
body.is-mobile .home-nav-item { flex-shrink: 0; margin: 0; height: 40px; min-height: 40px; padding: 0 16px 0 12px; gap: 8px; border-radius: 20px; background: rgba(255,255,255,.07); font-size: 15px; transition: transform .15s ease, background .2s ease; }
body.is-mobile .home-nav-item:hover, body.is-mobile .home-nav-item.active { background: rgba(255,255,255,.07); color: var(--text-muted); }
body.is-mobile .home-nav-item:active { transform: scale(.94); background: rgba(255,255,255,.13); }
body.is-mobile .home-nav-item .hn-badge { margin-left: 2px; }
body.is-mobile #dm-list .side-section-label { display: none; }

/* ---- DM rows: roomy and rounded ---- */
body.is-mobile .dm-row { padding: 10px 14px; margin: 0 0 4px; gap: 12px; border-radius: 20px; min-height: 64px; color: var(--text-normal); transition: background .15s ease, transform .15s ease; }
body.is-mobile .dm-row[hidden] { display: none; }
body.is-mobile .dm-row:hover { background: transparent; }
body.is-mobile .dm-row:active { background: rgba(255,255,255,.08); transform: scale(.985); }
body.is-mobile .dm-row.active { background: rgba(255,255,255,.08); }
body.is-mobile .dm-row .avatar { transform: scale(1.3); transform-origin: left center; margin-right: 12px; }
body.is-mobile .dm-row .dm-name { font-size: 17px; font-weight: 600; }
body.is-mobile .dm-row .dm-preview { font-size: 14px; }
body.is-mobile .dm-row.has-nameplate { overflow: hidden; }

/* ---- floating profile bar ---- */
body.is-mobile #user-panel { height: 60px; margin: 6px 10px max(10px, env(safe-area-inset-bottom)); border-radius: 30px; padding: 0 12px 0 10px; background: rgba(255,255,255,.08); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.3); }
body.is-mobile #user-panel .who { border-radius: 14px; }
body.is-mobile #user-panel .icon-btn { width: 40px; height: 40px; background: rgba(255,255,255,.07); }
body.is-mobile #user-panel .icon-btn:active { transform: scale(.92); }

/* ---- chat: softer edges ---- */
body.is-mobile #main-col { box-shadow: -10px 0 30px rgba(0,0,0,.35); }
body.is-mobile #composer { border-radius: 24px; padding: 0 10px; }
body.is-mobile .mp-header { height: auto; }

/* ---- menus slide in and out ---- */
body.is-mobile .modal-overlay:not(.ds-settings-layer) { align-items: flex-end; justify-content: center; animation: frxFade .2s ease; }
body.is-mobile .modal-overlay:not(.ds-settings-layer) > .modal-box { width: 100%; max-width: 100%; border-radius: 26px 26px 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); animation: frxSheetUp .34s cubic-bezier(.22,.8,.3,1); box-shadow: 0 -10px 40px rgba(0,0,0,.45); }
body.is-mobile #settings-modal > .modal-box { width: 100%; max-width: 100%; height: 92vh; max-height: 92vh; }
body.is-mobile #confirm-modal { align-items: center; }
body.is-mobile #confirm-modal > .modal-box { width: 92vw; max-width: 420px; border-radius: 24px; animation: frxPop .22s cubic-bezier(.2,.9,.3,1.15); }
body.is-mobile .ds-settings-layer { animation: frxSlideInRight .32s cubic-bezier(.22,.8,.3,1); }
body.is-mobile .modal-overlay.sheet-closing:not(.ds-settings-layer) { animation: frxBackdropOut .23s ease forwards; }
body.is-mobile .modal-overlay.sheet-closing:not(.ds-settings-layer) > .modal-box { animation: frxSheetDown .23s cubic-bezier(.4,0,.8,.4) forwards; }
body.is-mobile .modal-overlay.sheet-closing#confirm-modal > .modal-box { animation: none; opacity: 0; transition: opacity .2s; }
body.is-mobile .ds-settings-layer.sheet-closing { animation: frxSlideOutRight .23s cubic-bezier(.4,0,.8,.4) forwards; }
body.is-mobile #app.member-list-open #member-panel { animation: frxSlideInRight .3s cubic-bezier(.22,.8,.3,1); border-radius: 28px 0 0 28px; }
body.is-mobile #emoji-picker-panel:not(.hidden), body.is-mobile #sticker-picker-panel:not(.hidden), body.is-mobile #gif-picker-panel:not(.hidden),
body.is-mobile .composer-action-menu:not(.hidden), body.is-mobile .ck-quicktext-popover { animation: frxRiseIn .24s cubic-bezier(.22,.8,.3,1); border-radius: 20px; }
body.is-mobile .server-menu { animation: frxDropIn .24s cubic-bezier(.22,.8,.3,1); border-radius: 20px; }
body.is-mobile #inbox-popover:not(.hidden), body.is-mobile #help-popover:not(.hidden) { animation: frxDropIn .24s cubic-bezier(.22,.8,.3,1); border-radius: 20px; }
body.is-mobile .action-sheet-backdrop { animation: sheetFadeIn .2s ease; }
body.is-mobile .action-sheet { border-radius: 26px 26px 0 0; animation: frxSheetUp .32s cubic-bezier(.22,.8,.3,1); }
body.is-mobile #app.mobile-show-chat #main-col, body.is-mobile #side-panel, body.is-mobile #main-col { transition-timing-function: cubic-bezier(.22,.8,.3,1); transition-duration: .34s; }

@media (prefers-reduced-motion: reduce) {
  body.is-mobile .modal-overlay > .modal-box, body.is-mobile .ds-settings-layer, body.is-mobile #app.member-list-open #member-panel,
  body.is-mobile .server-menu, body.is-mobile .action-sheet, body.is-mobile .mht-menu, body.is-mobile .mht-search-row { animation: none !important; }
  body.is-mobile #side-panel, body.is-mobile #main-col { transition-duration: .01s; }
}

/* ============================================================
   PHONE ROUNDING PASS (body.is-mobile only)
   Buttons, fields, pages, cards, tabs, messages and pop-ups all lose their square corners.
   ============================================================ */
/* buttons become pills */
body.is-mobile .btn-primary, body.is-mobile .btn-secondary, body.is-mobile .btn-danger, body.is-mobile .btn-accent-inline,
body.is-mobile .ds-btn, body.is-mobile .sic-btn, body.is-mobile .shop-icon-btn { border-radius: 22px; }
body.is-mobile .btn-secondary.slim, body.is-mobile .btn-accent-inline.slim, body.is-mobile .btn-danger.slim { border-radius: 18px; }
body.is-mobile .btn-primary, body.is-mobile .btn-secondary, body.is-mobile .btn-danger, body.is-mobile .btn-accent-inline { min-height: 44px; padding-left: 20px; padding-right: 20px; }
body.is-mobile .btn-secondary.slim, body.is-mobile .btn-accent-inline.slim, body.is-mobile .btn-danger.slim { min-height: 36px; padding-left: 14px; padding-right: 14px; }
body.is-mobile button:active:not(:disabled) { transform: scale(.97); }
body.is-mobile .hdr-icon-btn, body.is-mobile .composer-icon-btn, body.is-mobile .icon-btn, body.is-mobile #chat-header .members-toggle { border-radius: 50%; }

/* fields */
body.is-mobile input[type="text"], body.is-mobile input[type="password"], body.is-mobile input[type="search"], body.is-mobile input[type="email"],
body.is-mobile input[type="number"], body.is-mobile input:not([type]), body.is-mobile select, body.is-mobile .fld-input, body.is-mobile textarea.fld-input { border-radius: 16px; }
body.is-mobile textarea.fld-input { border-radius: 18px; }
body.is-mobile input[type="text"]:not(#composer input), body.is-mobile input[type="password"], body.is-mobile .fld-input { padding-left: 16px; padding-right: 16px; }
body.is-mobile #composer textarea { border-radius: 0; }

/* the chat screen itself */
body.is-mobile #main-col { border-radius: 28px 0 0 0; overflow: hidden; }
body.is-mobile #chat-header { margin: 8px 10px 0; height: 52px; border-radius: 26px; background: rgba(255,255,255,.06); box-shadow: none; padding: 0 8px; }
body.is-mobile #app.mobile-show-chat #main-col { border-radius: 0; }
body.is-mobile #reply-bar { margin: 0 10px; border-radius: 18px 18px 0 0; }
body.is-mobile .msg-attachment img, body.is-mobile .msg-attachment video, body.is-mobile .msg-attachment-grid > *, body.is-mobile .msg-sticker,
body.is-mobile .msg-file-card, body.is-mobile .msg-reply-ref, body.is-mobile .attachment-draft, body.is-mobile .msg-embed, body.is-mobile .embed { border-radius: 18px; }
body.is-mobile .msg-attachment img, body.is-mobile .msg-attachment video { overflow: hidden; }
body.is-mobile .msg-edit-box, body.is-mobile .msg-edit-input { border-radius: 16px; }
body.is-mobile .reaction-pill { border-radius: 16px; }
body.is-mobile .poll-card, body.is-mobile .poll-option, body.is-mobile .poll-modal-box { border-radius: 20px; }
body.is-mobile .typing-indicator { border-radius: 14px; }
body.is-mobile .day-divider { margin-left: 18px; margin-right: 18px; }
body.is-mobile .pinned-row { border-radius: 16px; }
body.is-mobile #welcome-view .welcome-icon { border-radius: 50%; }

/* Friends / Quests / Codes / Shop pages */
body.is-mobile .main-page-view { border-radius: 28px 28px 0 0; }
body.is-mobile .mp-header { margin: 8px 10px 0; border-radius: 26px; background: rgba(255,255,255,.06); box-shadow: none; padding: 8px 14px; }
body.is-mobile .friends-tab { border-radius: 18px; padding: 7px 14px; }
body.is-mobile .friends-tab.on { background: var(--accent); color: #fff; }
body.is-mobile .friend-row, body.is-mobile .friend-pick-row, body.is-mobile .member-row { border-radius: 18px; }
body.is-mobile .friend-row { background: rgba(255,255,255,.04); margin: 0 10px 6px; }
body.is-mobile .quest-row { border-radius: 22px; margin-left: 10px; margin-right: 10px; }
body.is-mobile .quest-bar, body.is-mobile .quest-bar-fill { border-radius: 8px; }
body.is-mobile .code-display { border-radius: 16px; }
body.is-mobile .shop-topbar { margin: 8px 10px 0; border-radius: 26px; }
body.is-mobile .shop-tab, body.is-mobile .shop-browse-opt, body.is-mobile .shop-orb-chip, body.is-mobile .shop-mgr-tab { border-radius: 18px; }
body.is-mobile .shop-search, body.is-mobile .shop-search input { border-radius: 20px; }
body.is-mobile .shop-item-card, body.is-mobile .theme-card { border-radius: 24px; overflow: hidden; }
body.is-mobile .sic-preview, body.is-mobile .sic-theme-preview, body.is-mobile .sic-banner-preview, body.is-mobile .sic-music-preview,
body.is-mobile .sic-nameplate-preview, body.is-mobile .sic-effect-preview, body.is-mobile .sic-frame-preview, body.is-mobile .sic-deco-stage { border-radius: 18px; }
body.is-mobile .shop-empty-state, body.is-mobile .music-toolbar { border-radius: 20px; }
body.is-mobile .shop-browse-menu { border-radius: 20px; }
body.is-mobile .big-choice { border-radius: 20px; }

/* settings and other full-screen sheets */
body.is-mobile #settings-nav { border-radius: 26px 26px 0 0; }
body.is-mobile #settings-nav .nav-item, body.is-mobile .ds-nav-item { border-radius: 18px; }
body.is-mobile #settings-content { border-radius: 0; }
body.is-mobile .setting-row { border-radius: 20px; background: rgba(255,255,255,.04); padding: 14px 16px; margin-bottom: 10px; }
body.is-mobile .ds-sidebar, body.is-mobile .ds-content { border-radius: 0; }
body.is-mobile .ds-unsaved { border-radius: 22px; margin: 0 12px max(12px, env(safe-area-inset-bottom)); }
body.is-mobile .theme-preview-swatch, body.is-mobile .admin-theme-chip-swatch { border-radius: 16px; }

/* profile card, member list, pickers, toasts */
body.is-mobile .profile-box { border-radius: 28px; overflow: hidden; }
body.is-mobile .profile-banner { border-radius: 0; }
body.is-mobile #member-panel .member-row { border-radius: 18px; }
body.is-mobile .ep-search input, body.is-mobile .ep-cat-btn, body.is-mobile .gif-thumb, body.is-mobile .sticker-grid > * { border-radius: 14px; }
body.is-mobile .toast { border-radius: 22px; }
body.is-mobile .admin-emoji-chip, body.is-mobile .admin-row, body.is-mobile .admin-block { border-radius: 18px; }
body.is-mobile .op-tag, body.is-mobile .ban-tag, body.is-mobile .owner-tag, body.is-mobile .bot-tag { border-radius: 8px; }

/* ============================================================
   LIQUID GLASS (Settings > Accessibility > Liquid glass; html[data-liquid-glass])
   Frosted, see-through panels with a bright rim, like Apple's liquid glass. Menus, pop-ups, pickers, sheets,
   toasts and floating bars. Add new menus and pop-ups to the lists below.
   ============================================================ */
html[data-liquid-glass] .modal-overlay:not(.ds-settings-layer) > .modal-box,
html[data-liquid-glass] .server-menu,
html[data-liquid-glass] .composer-action-menu,
html[data-liquid-glass] #emoji-picker-panel,
html[data-liquid-glass] #sticker-picker-panel,
html[data-liquid-glass] #gif-picker-panel,
html[data-liquid-glass] .ck-quicktext-popover,
html[data-liquid-glass] #inbox-popover,
html[data-liquid-glass] #help-popover,
html[data-liquid-glass] .react-popover,
html[data-liquid-glass] .full-react-popover,
html[data-liquid-glass] .action-sheet,
html[data-liquid-glass] .shop-browse-menu,
html[data-liquid-glass] .toast,
html[data-liquid-glass] #mention-popup,
html[data-liquid-glass] .mht-menu,
html[data-liquid-glass] #user-panel,
html[data-liquid-glass] body.is-mobile #mobile-user-pill {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,calc(.30 * var(--glass-hl, 1))) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(100% 80% at 100% 100%, rgba(255,255,255,calc(.16 * var(--glass-hl, 1))) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(135deg, rgba(255,255,255,calc(.16 * var(--glass-hl, 1))), rgba(255,255,255,calc(.05 * var(--glass-hl, 1))) 50%, rgba(255,255,255,calc(.12 * var(--glass-hl, 1)))),
    rgba(24, 26, 34, var(--glass-a, .34)) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 30px)) saturate(var(--glass-sat, 1.9)) brightness(1.12);
  backdrop-filter: blur(var(--glass-blur, 30px)) saturate(var(--glass-sat, 1.9)) brightness(1.12);
  border: 1px solid rgba(255,255,255,.26);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,calc(.7 * var(--glass-hl, 1))),
    inset 0 -1px 0 rgba(255,255,255,calc(.14 * var(--glass-hl, 1))),
    inset 1.5px 0 0 rgba(255,255,255,calc(.28 * var(--glass-hl, 1))),
    inset -1px 0 0 rgba(255,255,255,.1),
    inset 0 0 28px rgba(255,255,255,.07),
    0 18px 50px rgba(0,0,0,.38), 0 2px 10px rgba(0,0,0,.2) !important;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-liquid-glass] .modal-overlay:not(.ds-settings-layer) > .modal-box,
html[data-liquid-glass] .server-menu,
html[data-liquid-glass] .composer-action-menu,
html[data-liquid-glass] #emoji-picker-panel,
html[data-liquid-glass] #sticker-picker-panel,
html[data-liquid-glass] #gif-picker-panel,
html[data-liquid-glass] .ck-quicktext-popover,
html[data-liquid-glass] #inbox-popover,
html[data-liquid-glass] #help-popover,
html[data-liquid-glass] .react-popover,
html[data-liquid-glass] .full-react-popover,
html[data-liquid-glass] .action-sheet,
html[data-liquid-glass] .shop-browse-menu,
html[data-liquid-glass] .toast,
html[data-liquid-glass] #mention-popup,
html[data-liquid-glass] .mht-menu,
html[data-liquid-glass] #user-panel,
html[data-liquid-glass] body.is-mobile #mobile-user-pill { background: rgba(44, 46, 56, .92) !important; }
}
html[data-liquid-glass] .server-menu, html[data-liquid-glass] .composer-action-menu, html[data-liquid-glass] #emoji-picker-panel,
html[data-liquid-glass] #sticker-picker-panel, html[data-liquid-glass] #gif-picker-panel, html[data-liquid-glass] .ck-quicktext-popover,
html[data-liquid-glass] #inbox-popover, html[data-liquid-glass] #help-popover, html[data-liquid-glass] .react-popover,
html[data-liquid-glass] .full-react-popover, html[data-liquid-glass] .shop-browse-menu, html[data-liquid-glass] #mention-popup { border-radius: 22px; }
html[data-liquid-glass] .modal-overlay:not(.ds-settings-layer) > .modal-box { border-radius: 28px; }
/* The phone layout (v4.70, request 78): its floating profile bar is glass too (it stands in for #user-panel there), and
   windows that slide up from the bottom keep their square bottom edge. */
html[data-liquid-glass] body.is-mobile #mobile-user-pill { border-radius: 28px; }
html[data-liquid-glass] body.is-mobile .modal-overlay:not(.ds-settings-layer):not(#confirm-modal) > .modal-box { border-radius: 26px 26px 0 0; }
html[data-liquid-glass] .toast { border-radius: 24px; }
html[data-liquid-glass] #user-panel { border-radius: 26px; margin: 8px; height: 56px; }
html[data-liquid-glass] .modal-overlay:not(.ds-settings-layer) { background: rgba(10, 12, 20, .32); }
html[data-liquid-glass] .action-sheet-backdrop { background: rgba(10, 12, 20, .3); }
/* Menu background blur slider (works with glass on or off): blurs the page behind pop-up windows and sheets */
html .modal-overlay:not(.ds-settings-layer), html .action-sheet-backdrop { -webkit-backdrop-filter: var(--menu-bg-filter, none); backdrop-filter: var(--menu-bg-filter, none); }
/* things inside glass stay readable and look like glass too */
html[data-liquid-glass] .modal-box .fld-input, html[data-liquid-glass] .modal-box input[type="text"], html[data-liquid-glass] .modal-box input[type="password"],
html[data-liquid-glass] .modal-box textarea, html[data-liquid-glass] .ep-search input { background: rgba(255,255,255,.1) !important; border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 2px rgba(0,0,0,.2); color: #fff; }
html[data-liquid-glass] .modal-box .btn-secondary, html[data-liquid-glass] .action-sheet .as-quick-react { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
html[data-liquid-glass] .modal-box .btn-accent-inline, html[data-liquid-glass] .modal-box .btn-primary { box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent); }
html[data-liquid-glass] .server-menu-item:hover, html[data-liquid-glass] .server-menu-item:focus-visible { background: rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); color: #fff; }
html[data-liquid-glass] .server-menu-item.danger:hover { background: rgba(218,55,60,.55); }
html[data-liquid-glass] .composer-action-menu button:hover:not(:disabled), html[data-liquid-glass] .as-item:active, html[data-liquid-glass] .mht-menu button:active { background: rgba(255,255,255,.16); }
html[data-liquid-glass] .modal-box, html[data-liquid-glass] .server-menu, html[data-liquid-glass] .action-sheet, html[data-liquid-glass] .toast { color: #fff; }
/* phone: the floating pills turn to glass as well */
html[data-liquid-glass] body.is-mobile #chat-header,
html[data-liquid-glass] body.is-mobile .mp-header,
html[data-liquid-glass] body.is-mobile .shop-topbar,
html[data-liquid-glass] body.is-mobile #side-header,
html[data-liquid-glass] body.is-mobile .friend-row,
html[data-liquid-glass] body.is-mobile .setting-row {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,.22), rgba(255,255,255,0) 60%),
    rgba(255,255,255,.08) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(var(--glass-sat, 1.8)); backdrop-filter: blur(var(--glass-blur, 24px)) saturate(var(--glass-sat, 1.8));
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(255,255,255,.1), 0 8px 24px rgba(0,0,0,.25) !important;
}

/* glass sliders in Settings > Accessibility */
.glass-tune { display: flex; flex-direction: column; gap: 10px; margin: -2px 0 14px; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.04); }
.glass-tune .gt-row { display: grid; grid-template-columns: minmax(96px, 150px) 1fr 48px; align-items: center; gap: 12px; font-size: 14px; }
.glass-tune .gt-name { color: var(--text-normal); font-weight: 600; }
.glass-tune .gt-val { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.glass-tune input[type="range"] { width: 100%; accent-color: var(--accent); }
.glass-tune #a11y-glass-reset { align-self: flex-start; }
.glass-tune.is-off .gt-row:nth-child(-n+2) { opacity: .45; }
body.is-mobile .glass-tune .gt-row { grid-template-columns: 1fr 48px; }
body.is-mobile .glass-tune .gt-name { grid-column: 1 / -1; }
/* phone: the member list is opaque like the chat, and slides with the finger */
body.is-mobile #app.member-list-open #member-panel { background: color-mix(in srgb, var(--bg-primary) 92%, #000); will-change: transform; }


/* ===== v4.14: vanish, system messages, command autofill (rail + scrolling), app command lists ===== */
#slash-popup.hidden { display: none; }
#slash-popup { padding: 0; }
.slash-rail { flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; overflow-y: auto; scrollbar-width: none; background: rgba(0,0,0,.14); border-radius: 10px 0 0 10px; }
.slash-rail::-webkit-scrollbar { display: none; }
.slash-rail-btn { width: 38px; height: 38px; padding: 0; border-radius: 12px; overflow: hidden; flex-shrink: 0; opacity: .6; transition: opacity .15s, border-radius .15s, transform .15s; }
.slash-rail-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slash-rail-btn:hover, .slash-rail-btn.on { opacity: 1; border-radius: 10px; }
.slash-rail-btn.on { box-shadow: 0 0 0 2px var(--accent); }
.slash-col { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px; }
.slash-head { flex: 0 0 auto; }
.slash-count { font-weight: 600; color: var(--text-faint); }
.slash-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.slash-group { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); background: var(--bg-floating); }
.slash-group img { width: 18px; height: 18px; border-radius: 5px; }
.slash-foot { flex: 0 0 auto; }
.app-cmd-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.app-cmd-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; }
.app-cmd-ico { width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; object-fit: cover; }
.app-cmd-name { font-weight: 700; color: var(--text-normal); }
.app-cmd-desc { flex-basis: 100%; padding-left: 32px; margin-top: -2px; font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.apps-panel-item { align-items: flex-start; }
.apps-panel-item .apn-text small { display: block; white-space: normal; }
@media (max-width: 760px) {
  #slash-popup { max-height: min(340px, 45dvh); }
  .slash-rail { flex-basis: 46px; }
  .slash-rail-btn { width: 34px; height: 34px; }
}

/* join / leave lines */
.sys-msg { display: flex; align-items: center; gap: 12px; margin: 6px 16px 6px 16px; padding: 4px 8px; border-radius: 8px; font-size: 15px; color: var(--text-muted); animation: sysIn .25s ease both; }
.sys-msg:hover { background: var(--bg-modifier-hover); }
.sys-ico { flex: 0 0 40px; display: flex; justify-content: center; }
.sys-join .sys-ico { color: #3ba55d; }
.sys-leave .sys-ico { color: #ed4245; }
.sys-name { color: var(--text-normal); font-weight: 600; }
.sys-time { margin-left: 4px; font-size: 11px; color: var(--text-faint); }
@keyframes sysIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.is-mobile .sys-msg { margin: 4px 10px; font-size: 14px; }
body.is-mobile .sys-ico { flex-basis: 32px; }

/* "Only you can see this" */
.msg-line.is-ephemeral .msg-text { color: var(--text-normal); }
.eph-foot { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; color: var(--text-faint); }
.eph-eye .i { width: 14px; height: 14px; display: inline-flex; }
.eph-eye svg { width: 14px; height: 14px; }
.eph-dismiss { color: var(--text-link, #00a8fc); text-decoration: none; }
.eph-dismiss:hover { text-decoration: underline; }
.vanish-tag { margin-left: 6px; padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 4px; color: var(--text-muted); background: rgba(255,255,255,.08); }
@media (prefers-reduced-motion: reduce) { .sys-msg { animation: none; } }
.msg-line.is-ephemeral, .msg-line.is-ephemeral .msg-row-wrap { max-width: 100%; }
.msg-line.is-ephemeral .msg-text { display: block; max-width: 100%; overflow-wrap: anywhere; }
.msg-line.is-ephemeral .msg-row-wrap { padding-right: 0; min-width: 0; display: block; }
.add-app-row { align-items: flex-start; }

/* Replay buttons: one pill, split in half (two halves when a track has two cutscenes). */
.sic-replay { display: flex; margin-top: 6px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border, rgba(255,255,255,.2)); }
.sic-replay-seg { flex: 1; min-width: 0; padding: 9px 6px; font-size: 13px; font-weight: 600; background: transparent; color: inherit; cursor: pointer; border: 0; }
.sic-replay-seg + .sic-replay-seg { border-left: 1px solid var(--border, rgba(255,255,255,.2)); }
.sic-replay-seg:hover { background: rgba(255,255,255,.08); }
.sic-replay { align-self: stretch; width: 100%; box-sizing: border-box; }

/* ---------- staff: add a song (Admin / Owner panel > Shop > Music) ---------- */
.music-creator { display: flex; flex-direction: column; gap: 12px; }
.music-file-input { width: 100%; box-sizing: border-box; padding: 8px; border-radius: 6px; background: var(--bg-input); color: var(--text-normal); font: inherit; font-size: 13px; }
.music-anim-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.music-anim-row .music-anim-name { flex: 0 0 38%; min-width: 0; }
.music-anim-row .music-anim-file { flex: 1; min-width: 0; padding: 6px; border-radius: 6px; background: var(--bg-input); color: var(--text-normal); font: inherit; font-size: 12px; }
.music-anim-count { font-weight: 600; color: var(--text-faint); margin-left: 6px; }
.music-publish-status { font-size: 13px; color: var(--text-muted); min-height: 18px; }

.music-card-preview { max-width: 320px; }
.music-card-preview .sic-music-preview { height: 112px; }
.shop-edit-banner { display: flex; flex-direction: column; gap: 8px; }
.shop-edit-banner .sic-music-preview { height: 96px; max-width: 280px; }


/* ============================================================
   RICH PRESENCE (activity status): profile card, friends list line, phone Home cards, Settings pane
   ============================================================ */
.rpc-card { background: var(--bg-tertiary, rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; padding: 14px; margin: 4px 0 10px; }
.rpc-head { font-size: 13px; font-weight: 700; color: var(--text-normal); margin-bottom: 10px; }
.rpc-body { display: flex; gap: 14px; align-items: center; min-width: 0; }
.rpc-img { width: 68px; height: 68px; flex: none; border-radius: 10px; background: rgba(255,255,255,.08) center / cover no-repeat; }
.rpc-art-icon { background-color: rgba(0,0,0,.32); background-size: 44px 44px; background-position: center; background-repeat: no-repeat; }
.rpc-art-glyph { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.92); }
.rpc-art-glyph svg { width: 44%; height: 44%; }
.rpc-img, .rpch-art { position: relative; overflow: hidden; }
.rpc-art-file { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: #1e1f22; }
.rpc-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rpc-name { font-weight: 700; font-size: 16px; color: var(--text-header, #fff); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpc-line { font-size: 13.5px; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpc-clock { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: #23a55a; font-size: 13px; }
.rpc-clock-ico { display: inline-flex; width: 16px; height: 16px; }
.rpc-clock-ico svg { width: 16px; height: 16px; }
.rpc-clock-val { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.rpc-preview .rpc-card { margin: 0; }
.rpc-none { color: var(--text-muted); font-size: 14px; padding: 4px 0; }
.rpc-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.04); }
.rpc-form-title { font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.rpc-form .field { margin: 0; }
.rpc-form select, .rpc-form input[type="text"], .rpc-form input[type="url"] { width: 100%; }
.rpc-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rpc-dev { margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.rpc-dev summary { cursor: pointer; font-weight: 600; color: var(--text-normal); }
.rpc-dev pre { background: rgba(0,0,0,.35); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; line-height: 1.5; white-space: pre; user-select: text; }
.friend-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.friend-row-text .friend-row-name { flex: none; align-self: flex-start; max-width: 100%; }
.friend-row-act { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-activity, .dm-time { display: none; }

/* ============================================================
   PHONE POLISH: closer to Discord's phone app
   ============================================================ */
/* Friend activity cards across the top of Home, like Discord's "Listening to" cards. */
body.is-mobile .home-activity:not(.hidden) { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -8px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
body.is-mobile .home-activity::-webkit-scrollbar { display: none; }
body.is-mobile .rpc-home-card { flex: 0 0 min(78%, 300px); scroll-snap-align: start; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 20px; background: rgba(255,255,255,.06); min-width: 0; cursor: pointer; }
body.is-mobile .rpc-home-card:active { background: rgba(255,255,255,.1); }
body.is-mobile .rpch-art { position: relative; width: 62px; height: 62px; flex: none; border-radius: 14px; background: rgba(255,255,255,.08) center / cover no-repeat; }
body.is-mobile .rpch-art.rpc-art-icon { background-size: 40px 40px; }
body.is-mobile .rpch-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
body.is-mobile .rpch-who { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile .rpch-act, body.is-mobile .rpch-sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Message rows: the time sits on the right, name and preview on the left. */
body.is-mobile .dm-row .dm-time { display: block; flex: none; align-self: flex-start; margin-top: 4px; font-size: 13px; color: var(--text-faint); }
body.is-mobile .dm-row.has-nameplate .dm-time { position: relative; z-index: 1; color: rgba(255,255,255,.75); }
body.is-mobile .mht-title { font-size: 30px; letter-spacing: -.01em; }
/* The server list gets Discord's white marker on the left edge for the selected server. */
body.is-mobile #server-rail { overflow-x: visible; }
body.is-mobile .rail-item { position: relative; overflow: visible; }
body.is-mobile .rail-item::before { display: block; content: ''; position: absolute; left: -6px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--m-text, #fff); transform: translateY(-50%); transition: height .18s ease; pointer-events: none; }
body.is-mobile .rail-item.active::before { height: 28px; }
/* The message box: one tidy line. A long "Message @name" used to wrap and get cut off. */
body.is-mobile #composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.is-mobile #composer textarea { white-space: pre-wrap; min-width: 0; }

/* Settings on a phone: the tabs sit in one swipeable row instead of wrapping into a block that fills half the screen. */
body.is-mobile #settings-nav { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; flex-shrink: 0; gap: 8px; padding: 14px 12px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
body.is-mobile #settings-nav::-webkit-scrollbar { display: none; }
body.is-mobile #settings-nav .nav-item { flex: none; white-space: nowrap; font-size: 15px; padding: 9px 16px; margin: 0; border-radius: 999px; background: rgba(255,255,255,.06); order: 2; }
body.is-mobile #settings-nav .nav-item[data-pane="pane-account"] { order: 0; }
body.is-mobile #settings-nav #egg-guide-nav { order: 1; }
body.is-mobile #settings-nav .nav-item.active { background: var(--accent); color: #fff; }
body.is-mobile #settings-content { padding: 16px 16px 28px; }
#self-status-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#open-my-settings, .who { min-width: 0; }

.rpc-auto-list { margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.04); }
.rpc-auto-list ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* Desktop app */
.rpc-desktop-note { margin: 4px 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--bg-secondary, rgba(255,255,255,.04)); color: var(--text-muted); font-size: 13px; line-height: 1.4; }

/* Frixion App: reminder window and Settings tab */
.app-prompt-box { max-width: 440px; }
.app-perks { margin: 4px 0 14px; padding-left: 20px; color: var(--text-normal); font-size: 14px; line-height: 1.6; }
.app-dl { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.app-dl-main { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 6px; background: var(--accent, #5865f2); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.app-dl-main:hover { background: var(--accent-hover, #4752c4); }
.app-dl-main small { font-weight: 500; opacity: .85; }
.app-dl-others, .app-dl-tip { font-size: 13px; color: var(--text-muted); }
.app-dl-others a { color: var(--text-link, #00a8fc); }
.app-prompt-actions { justify-content: space-between; flex-wrap: wrap; }
#pane-app .setting-row { margin-top: 18px; }

/* ============================================================
   PHONE: the floating profile bar (like Discord's app) and the You / Notifications pages it opens
   ============================================================ */
#mobile-user-pill, .mpage { display: none; }
body.is-mobile #user-panel { display: none; }
body.is-mobile #mobile-user-pill {
  display: flex; align-items: center; position: fixed; z-index: 85;
  left: 40px; right: 24px; bottom: max(14px, env(safe-area-inset-bottom)); height: 56px; border-radius: 28px;
  background: var(--m-pill); box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04);
}
body.is-mobile #app.mobile-show-chat > #mobile-user-pill, body.is-mobile #app.mobile-page-open > #mobile-user-pill { display: none; }
.mup-plate { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
/* Your nameplate shows behind the bar, fading in from the left so the name stays readable. */
.mup-plate-art { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(90deg, transparent 15%, #000 70%); mask-image: linear-gradient(90deg, transparent 15%, #000 70%); }
.mup-me { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; padding: 0 8px 0 61px; text-align: left; color: inherit; -webkit-tap-highlight-color: transparent; }
.mup-avatar { position: absolute; left: -20px; top: -9px; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 4px var(--m-panel); }
.mup-who { min-width: 0; display: flex; flex-direction: column; }
.mup-name { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 21px; line-height: 26px; font-weight: 700; color: var(--m-text); }
.mup-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mup-name svg { flex: none; color: var(--m-muted); }
.mup-status { font-size: 14px; line-height: 18px; color: var(--m-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mup-bell { position: relative; flex: none; width: 40px; height: 40px; margin-right: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.28); color: #fff; -webkit-tap-highlight-color: transparent; }
.mup-bell:active, .mup-me:active .mup-who { opacity: .75; }
.mup-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f23f43; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--m-pill); }
.mup-badge.hidden { display: none; }
/* The lists scroll under the bar, so they leave room for it at the end. */
body.is-mobile #channel-list, body.is-mobile #dm-list { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.is-mobile #server-rail { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* The pages are solid. (With a Shop theme the panel colours are see-through, so the theme's own backdrop goes under them;
   before, the Home screen showed through the You page.) */
body.is-mobile .mpage:not(.hidden) { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 80; background: var(--m-panel); }
body.is-mobile.shop-theme-active .mpage:not(.hidden) { background: linear-gradient(var(--m-panel), var(--m-panel)), var(--shop-theme-bg); }
body.is-mobile .mpage-title { flex: none; display: flex; align-items: center; gap: 2px; padding: max(10px, env(safe-area-inset-top)) 16px 6px 6px; font-size: 21px; line-height: 28px; font-weight: 800; color: var(--m-text); }
body.is-mobile .mpage-back { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--m-text); -webkit-tap-highlight-color: transparent; }
body.is-mobile .mpage-back:active { background: var(--m-row); }
body.is-mobile .myou-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #f23f43; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
body.is-mobile .mpage-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 14px 48px; }
body.is-mobile .mpage-label { margin: 18px 8px 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
body.is-mobile .mpage-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 60px 24px; color: var(--text-muted); font-size: 14px; }
body.is-mobile .mpage-empty svg { color: var(--online, #23a55a); margin-bottom: 6px; }
body.is-mobile .mpage-empty b { color: var(--text-normal); font-size: 16px; }
body.is-mobile .mnotif-row { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: 16px; background: rgba(255,255,255,.05); }
body.is-mobile .mnotif-text { flex: 1; min-width: 0; }
body.is-mobile .mnotif-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile .mnotif-sub { font-size: 13px; color: var(--text-muted); }
body.is-mobile .mnotif-btn { flex: none; padding: 9px 14px; border-radius: 18px; background: rgba(255,255,255,.1); font-weight: 600; font-size: 14px; }
body.is-mobile .mnotif-btn.yes { background: var(--accent, #5865f2); color: #fff; }
body.is-mobile .myou-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.06); }
body.is-mobile .myou-card:active { background: rgba(255,255,255,.1); }
body.is-mobile .myou-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
body.is-mobile .myou-name { font-size: 20px; font-weight: 800; color: var(--m-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile .myou-user { font-size: 14px; color: var(--text-normal); }
body.is-mobile .myou-status { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile .myou-chev { flex: none; color: var(--text-muted); }
body.is-mobile .myou-group { border-radius: 18px; background: rgba(255,255,255,.05); overflow: hidden; }
body.is-mobile .myou-out { margin-top: 20px; }
body.is-mobile .myou-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; text-align: left; font-size: 16px; font-weight: 500; color: var(--text-normal); border-top: 1px solid rgba(255,255,255,.05); }
body.is-mobile .myou-row:first-child { border-top: 0; }
body.is-mobile .myou-row:active { background: rgba(255,255,255,.08); }
body.is-mobile .myou-ico { flex: none; display: inline-flex; width: 24px; height: 24px; color: var(--text-muted); }
body.is-mobile .myou-ico svg { width: 24px; height: 24px; }
body.is-mobile .myou-label { flex: 1; }
body.is-mobile .myou-row.danger, body.is-mobile .myou-row.danger .myou-ico { color: #f87171; }

/* Settings opened on a phone: calm sentence-case heading instead of a huge all-caps one. */
body.is-mobile #settings-content h2 { font-size: 22px; text-transform: none; letter-spacing: -.01em; margin-bottom: 12px; }

/* Song editor: files section (Owner and Co-Owners) */
.shop-edit-files .sef-note, .sef-anim-row .sef-note, .sef-locked { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; margin: 2px 0 6px; }
.sef-locked { padding: 10px 12px; border-radius: 8px; background: rgba(255,255,255,.05); }
.sef-anim-row { flex-wrap: wrap; margin-bottom: 8px; }
.sef-anim-row .sef-note { flex: 1 1 100%; margin: 2px 0 0; }
#shop-edit-anim-add { margin-top: 4px; }

/* Who made a shop item */
.admin-chip-by { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.admin-emoji-chip.locked { opacity: .7; }
.admin-emoji-chip.locked::after { content: '\1F512'; font-size: 11px; margin-left: 2px; }

/* The computer app's overlay window (script.js OVERLAY_WINDOW): see-through, and only the overlay shows. */
html.ov-window, html.ov-window body { background: transparent !important; }
/* A dark color-scheme makes Chromium fill an empty page background with dark grey, which would hide the game. */
html.ov-window { color-scheme: normal !important; }
html.ov-window #boot-screen, html.ov-window #title-bar, html.ov-window #page-body { display: none !important; }
/* Over a game it's see-through like Discord's overlay: a Shop theme's full-screen picture isn't drawn behind it (it covered
   the whole game), and the game is only lightly dimmed, not blurred. The panels keep their theme. */
html.ov-window body::before, html.ov-window body::after { display: none !important; }
html.ov-window #ov-root { background: rgba(0,0,0,.3); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* a see-through Shop theme colour sits on a dark base so the windows stay readable over a bright game */
html.ov-window .ov-panel, html.ov-window .ov-chat { background: linear-gradient(var(--bg-floating), var(--bg-floating)) rgba(17, 18, 20, .88); }

/* ============================================================
   PHONE: Discord's app look. Sizes and colours were measured from a screenshot of Discord's phone app (iPhone, 2026);
   one iPhone point is one pixel here. The default Dark theme uses Discord's exact colours; the other themes (and Shop
   themes) keep their own colours in the same layout.
   ============================================================ */
body.is-mobile {
  --m-rail: var(--bg-deepest); --m-panel: var(--bg-secondary);
  --m-row: color-mix(in srgb, var(--text-normal) 8%, var(--m-panel));
  --m-btn: color-mix(in srgb, var(--text-normal) 15%, var(--m-panel));
  --m-card: color-mix(in srgb, var(--text-normal) 3%, var(--m-panel));
  --m-card-in: color-mix(in srgb, var(--text-normal) 9%, var(--m-panel));
  --m-icon: color-mix(in srgb, var(--text-normal) 7%, var(--m-rail));
  --m-pill: color-mix(in srgb, var(--text-normal) 10%, var(--m-panel));
  --m-text: var(--text-header, var(--text-normal)); --m-soft: var(--text-normal); --m-muted: var(--text-muted); --m-faint: var(--text-faint);
  --m-chat: var(--bg-primary); --m-field: color-mix(in srgb, var(--text-normal) 8%, var(--m-chat));
}
body.is-mobile:not(.theme-light):not(.theme-ash):not(.theme-onyx):not(.shop-theme-active) {
  --m-rail: #131217; --m-panel: #1b1c20; --m-row: #26282c; --m-btn: #383c41; --m-card: #212229; --m-card-in: #32323b;
  --m-icon: #25262e; --m-pill: #2c2b32; --m-text: #f2f3f5; --m-soft: #d0d1da; --m-muted: #8e8f99; --m-faint: #72747a;
  --m-chat: #1b1c20; --m-field: #26272d;
}

/* rail: 72 wide, 48px icons 8 apart, the white marker on the screen edge, a blurple chat-bubble button on top */
body.is-mobile #app, body.is-mobile #app.member-list-open { grid-template-columns: 72px minmax(0, 1fr); background: var(--m-rail); }
body.is-mobile #server-rail { width: 72px; background: var(--m-rail); padding-top: 4px; gap: 8px; }
body.is-mobile .rail-item { width: 48px; height: 48px; font-size: 16px; font-weight: 600; background: var(--m-icon); color: var(--m-soft); }
body.is-mobile .rail-item:hover { background: var(--m-icon); }
body.is-mobile .rail-item.active, body.is-mobile .rail-item.dm-item.active { border-radius: 16px; background: var(--accent); color: #fff; }
body.is-mobile .rail-item::before { left: -12px; width: 4px; }
body.is-mobile .rail-item.active::before { height: 40px; }
.rail-home-phone { display: none; }
body.is-mobile .rail-home-desk { display: none; }
body.is-mobile .rail-home-phone { display: block; }
body.is-mobile .rail-divider { width: 32px; height: 2px; margin: 0; background: color-mix(in srgb, var(--text-normal) 12%, var(--m-rail)); }
body.is-mobile .rail-item.action { color: var(--online); }
body.is-mobile .rail-item.explore-btn { color: var(--m-soft); }

/* the panel: one rounded corner where it meets the rail */
body.is-mobile #side-panel { background: var(--m-panel); border-radius: 24px 0 0 0; box-shadow: none; }
body.is-mobile #channel-list, body.is-mobile #dm-list { padding-left: 8px; padding-right: 8px; padding-top: 0; }

/* Messages header: a 21px title, then a 32px row of search, Add Friends and + */
body.is-mobile #mobile-home-top { padding: 19px 9px 0; }
body.is-mobile .mht-title { font-size: 21px; line-height: 28px; font-weight: 800; letter-spacing: 0; padding: 0; margin: 0 0 10px; color: var(--m-text); }
body.is-mobile .mht-actions { gap: 9px; padding: 0 0 16px; }
body.is-mobile .mht-round, body.is-mobile .mht-pill { height: 32px; border-radius: 16px; gap: 6px; background: var(--m-btn); color: var(--m-soft); font-size: 14px; font-weight: 600; }
body.is-mobile .mht-round { width: 32px; }
body.is-mobile .mht-round svg { width: 18px; height: 18px; }
body.is-mobile .mht-pill svg { width: 17px; height: 17px; }
body.is-mobile .mht-round.accent { background: var(--accent); color: #fff; }
body.is-mobile .mht-search-row { padding: 0 0 14px; }
body.is-mobile .mht-search-row input { height: 36px; border-radius: 18px; background: var(--m-btn); font-size: 15px; padding: 0 14px; }
body.is-mobile .mht-menu { top: 92px; right: 8px; border-radius: 16px; background: var(--m-card-in); }
/* Friends, Shop, Quests and Codes live on the You page on a phone */
body.is-mobile #home-nav { display: none; }

/* cards across the top (what friends are doing): 265 x 88, a 71px picture, 8 apart */
body.is-mobile .home-activity:not(.hidden) { gap: 8px; margin: 0 -8px; padding: 0 16px 8px; scroll-padding-left: 16px; }
body.is-mobile .rpc-home-card { flex: 0 0 265px; height: 88px; padding: 0 12px 0 9px; gap: 13px; border-radius: 16px; background: var(--m-card); }
body.is-mobile .rpc-home-card:active { background: var(--m-row); }
body.is-mobile .rpch-art { width: 71px; height: 71px; border-radius: 12px; background-color: var(--m-card-in); }
body.is-mobile .rpch-who { font-size: 18px; line-height: 22px; font-weight: 700; color: var(--m-text); }
body.is-mobile .rpch-act { font-size: 14px; line-height: 18px; color: var(--m-soft); }
body.is-mobile .rpch-sub { font-size: 14px; line-height: 18px; color: var(--m-muted); }

/* conversation rows: 68 tall, 32px avatar, grey once read, white while unread or open */
body.is-mobile .dm-row { height: 68px; min-height: 68px; margin: 0; padding: 0 13px 0 8px; gap: 10px; border-radius: 12px; align-items: center; }
body.is-mobile .dm-row:active { background: var(--m-row); transform: none; }
body.is-mobile .dm-row.active { background: var(--m-row); }
body.is-mobile .dm-row .avatar { transform: none; margin: 0; }
body.is-mobile .dm-row .dm-copy { gap: 1px; }
body.is-mobile .dm-row .dm-name { font-size: 18px; line-height: 23px; font-weight: 600; color: var(--m-muted); }
body.is-mobile .dm-row .dm-preview { font-size: 15px; line-height: 19px; font-weight: 500; color: var(--m-muted); }
body.is-mobile .dm-row.active .dm-name, body.is-mobile .dm-row.active .dm-preview,
body.is-mobile .dm-row.unread .dm-name, body.is-mobile .dm-row.unread .dm-preview { color: var(--m-text); }
body.is-mobile .dm-row .dm-time { align-self: flex-start; margin-top: 15px; font-size: 14px; line-height: 17px; font-weight: 500; color: var(--m-faint); }
body.is-mobile .dm-row.has-nameplate .dm-name, body.is-mobile .dm-row.has-nameplate .dm-preview { color: #fff; }
/* Discord shows "offline" as a hollow ring */
body.is-mobile .status-dot.offline { background: transparent; border: 3px solid var(--offline); box-sizing: border-box; }

/* a server's channel list: a flat bold title like "Messages", then Discord-sized channel rows */
body.is-mobile #side-header { height: auto; margin: 0; padding: 19px 17px 12px; border-radius: 0; background: transparent; box-shadow: none; justify-content: flex-start; gap: 4px; font-size: 21px; line-height: 28px; font-weight: 800; color: var(--m-text); }
body.is-mobile #side-header:hover { background: transparent; }
body.is-mobile #side-header-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile #side-header-chevron { flex: none; width: 18px; height: 18px; color: var(--m-muted); }
body.is-mobile #channel-list .side-section-label, body.is-mobile .category-header { padding: 14px 8px 6px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--m-muted); }
body.is-mobile .channel-row { min-height: 40px; padding: 0 10px; margin: 0 0 2px; gap: 8px; border-radius: 10px; font-size: 16px; font-weight: 500; color: var(--m-muted); }
body.is-mobile .channel-row .hash { font-size: 20px; opacity: .8; }
body.is-mobile .channel-row.active { background: var(--m-row); color: var(--m-text); }

/* the chat screen: a flat header (back, their picture or #, the bold name and a ›), then Discord's message bar:
   round + and gift buttons, a round field with the GIF, sticker and emoji buttons inside, and a send button once you type */
body.is-mobile:not(.shop-theme-active) #main-col, body.is-mobile:not(.shop-theme-active) #composer-wrap { background: var(--m-chat); }
body.is-mobile #chat-header { height: 56px; margin: 0; padding: 0 6px 0 4px; gap: 6px; border-radius: 0; background: transparent; box-shadow: 0 1px 0 color-mix(in srgb, var(--text-normal) 7%, transparent); }
body.is-mobile #chat-header .mobile-back-btn { width: 40px; height: 40px; margin: 0; border-radius: 50%; color: var(--m-text); }
body.is-mobile #chat-header .mobile-back-btn svg { width: 24px; height: 24px; }
.chat-header-avatar, .chat-header-chev { display: none; }
body.is-mobile #chat-header[data-kind="dm"] .chat-header-avatar { display: block; flex: none; }
body.is-mobile #chat-header[data-kind="dm"] .hash { display: none; }
body.is-mobile #chat-header .hash { font-size: 24px; line-height: 1; font-weight: 500; color: var(--m-muted); margin-left: 4px; }
body.is-mobile #chat-header .title { min-width: 0; font-size: 17px; line-height: 22px; font-weight: 700; color: var(--m-text); }
body.is-mobile #chat-header[data-kind] .chat-header-chev { display: block; flex: none; margin-left: -3px; color: var(--m-muted); }
body.is-mobile #chat-header[data-kind] :is(.chat-header-avatar, .hash, .title, .chat-header-chev) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
body.is-mobile .chat-header-actions { gap: 2px; }
body.is-mobile #chat-header .hdr-icon-btn, body.is-mobile #chat-header .members-toggle { width: 40px; height: 40px; color: var(--m-soft); }
body.is-mobile #chat-header .hdr-icon-btn svg, body.is-mobile #chat-header .members-toggle svg { width: 22px; height: 22px; }

/* messages: 40px pictures 16 from the edge, 16px names and text */
body.is-mobile .msg-group { padding: 2px 16px; gap: 12px; }
body.is-mobile .msg-meta .author { font-size: 16px; }
body.is-mobile .msg-text { font-size: 16px; line-height: 22px; }
/* Phones have no hover toolbar (they use the long-press sheet), so text uses the full width instead of stopping 138px short. */
body.is-mobile .msg-row-wrap { padding-right: 0; min-width: 0; }

/* the message bar */
body.is-mobile #composer-wrap { padding-top: 8px; padding-left: 12px; padding-right: 12px; }
body.is-mobile #composer { min-height: 40px; padding: 0; gap: 8px; border-radius: 0; background: transparent; align-items: flex-end; }
body.is-mobile #composer > .composer-icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--m-field); color: var(--m-soft); }
body.is-mobile #composer > .composer-icon-btn svg { width: 22px; height: 22px; }
body.is-mobile #composer > #gift-btn { order: 0; margin: 0; }
body.is-mobile .composer-field { display: flex; align-items: flex-end; flex: 1; min-width: 0; min-height: 40px; padding: 0 4px 0 16px; border-radius: 20px; background: var(--m-field); position: relative; }
body.is-mobile #composer textarea { min-height: 40px; padding: 9px 0; font-size: 16px; line-height: 22px; color: var(--m-text); }
body.is-mobile #composer textarea::placeholder { color: var(--m-muted); }
body.is-mobile .composer-field .composer-icon-btn { width: 34px; height: 40px; background: transparent; color: var(--m-muted); }
body.is-mobile .composer-field .composer-icon-btn svg { width: 22px; height: 22px; }
body.is-mobile .composer-char-count { right: 6px; bottom: calc(100% + 6px); }
body.is-mobile #composer.has-text :is(#gift-btn, #gif-btn, #sticker-btn) { display: none; }
body.is-mobile #composer.has-text .composer-send-btn { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; }
body.is-mobile .composer-send-btn:active { transform: scale(.92); }

/* Liquid Glass keeps its floating glass bars */
html[data-liquid-glass] body.is-mobile #chat-header { margin: 8px 10px 0; border-radius: 26px; }
html[data-liquid-glass] body.is-mobile #side-header { margin: 10px 10px 4px; padding: 9px 14px; border-radius: 18px; }
/* Discord's + is a plain plus in the round button */
body.is-mobile #attach-btn svg circle { display: none; }
body.is-mobile #attach-btn svg path { transform: scale(1.75); transform-origin: 12px 12px; stroke-width: 1.4; }

/* phone: a channel or group keeps only search and members up top; tapping its name opens the rest in a sheet */
body.is-mobile #chat-header:is([data-kind="channel"], [data-kind="group"]) :is(#mute-toggle, #pins-toggle, #bookmarks-toggle, #add-member-toggle, #leave-group-toggle) { display: none; }
.as-title { padding: 2px 14px 10px; font-size: 18px; font-weight: 800; color: var(--text-header, var(--text-normal)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-item > svg { flex: none; width: 20px; height: 20px; }
/* Discord's selected server has no glow */
body.is-mobile .rail-item.active { box-shadow: none; }
body.is-mobile #chat-header .hash:empty { display: none; }

/* phone: the member list gets a back button and a title, like Discord's Members page */
.mp-phone-head { display: none; }
body.is-mobile .mp-phone-head { display: flex; align-items: center; gap: 2px; margin: -6px -4px 8px; font-size: 21px; line-height: 28px; font-weight: 800; color: var(--m-text); }
body.is-mobile:not(.shop-theme-active) #app.member-list-open #member-panel { background: var(--m-chat); }
/* phone: message search is a round field like the message bar */
body.is-mobile #search-bar { margin: 8px 12px 0; padding: 0 6px 0 14px; min-height: 40px; border-radius: 20px; background: var(--m-field); color: var(--m-muted); }
body.is-mobile #search-bar input { font-size: 16px; color: var(--m-text); }
body.is-mobile #search-bar .hdr-icon-btn { width: 32px; height: 32px; }

/* phone Friends list: plain rows with round message and remove buttons, like Discord's app */
.fr-msg-ico { display: none; }
body.is-mobile #friends-view .mp-header > span:first-child { display: none; }
body.is-mobile .friend-row { margin: 0 4px; padding: 10px 8px; gap: 12px; border: 0; border-radius: 12px; background: transparent; }
body.is-mobile .friend-row:active { background: var(--m-row); }
body.is-mobile .friend-row-name { font-size: 16px; font-weight: 700; color: var(--m-text); }
body.is-mobile .friend-row-act { font-size: 14px; color: var(--m-muted); }
body.is-mobile .friend-row :is([data-msg], [data-remove]) { width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--m-btn); color: var(--m-soft); }
body.is-mobile .friend-row [data-msg] .fr-msg-ico { display: block; }
body.is-mobile .friend-row [data-msg] .fr-msg-label { display: none; }
/* phone Notifications: plain rows with round accept / ignore buttons */
body.is-mobile .mnotif-row { gap: 12px; padding: 10px 8px; margin: 0 -4px 2px; background: transparent; border-radius: 12px; }
body.is-mobile .mnotif-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--m-btn); color: var(--m-soft); }
body.is-mobile .mnotif-btn.yes { background: var(--accent, #5865f2); color: #fff; }

/* ============================================================
   Discord's text formatting in messages (script.js renderMessageText)
   ============================================================ */
.md-code { padding: 0 .25em; border-radius: 4px; background: color-mix(in srgb, var(--text-normal) 11%, transparent); font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: .875em; }
.md-pre { display: block; max-width: 100%; margin: 4px 0; padding: 8px 10px; overflow-x: auto; white-space: pre; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--text-normal) 12%, transparent); background: color-mix(in srgb, #000 22%, var(--bg-secondary)); }
.md-pre code { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: .85em; line-height: 1.45; }
.md-quote { display: block; margin: 2px 0; padding-left: 12px; border-left: 4px solid color-mix(in srgb, var(--text-normal) 30%, transparent); border-radius: 2px; }
.md-h { display: block; margin: 6px 0 2px; font-weight: 700; line-height: 1.3; color: var(--text-header, var(--text-normal)); }
.md-h1 { font-size: 1.5em; }
.md-h2 { font-size: 1.25em; }
.md-h3 { font-size: 1.1em; }
.md-sub { display: block; font-size: .8em; color: var(--text-muted); }
.md-li { display: block; position: relative; padding-left: 18px; }
.md-li::before { content: ''; position: absolute; left: 6px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.md-li2 { padding-left: 34px; }
.md-li2::before { left: 22px; background: transparent; border: 1px solid currentColor; box-sizing: border-box; }
/* a spoiler is a dark bar until it's clicked */
.md-spoiler { border-radius: 4px; color: transparent; background: color-mix(in srgb, var(--text-normal) 24%, #1e1f22); cursor: pointer; transition: background .15s ease; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.md-spoiler:hover { background: color-mix(in srgb, var(--text-normal) 32%, #1e1f22); }
.md-spoiler * { visibility: hidden; pointer-events: none; }
.md-spoiler.revealed { color: inherit; cursor: auto; background: color-mix(in srgb, var(--text-normal) 10%, transparent); }
.md-spoiler.revealed * { visibility: visible; pointer-events: auto; }

/* ============================================================
   Unread dots and red @mention numbers (script.js refreshUnread)
   ============================================================ */
.rail-item.unread:not(.active)::before { height: 8px; opacity: 1; }
.rail-item.unread:not(.active):hover::before { height: 20px; }
body.is-mobile .rail-item.unread:not(.active)::before { height: 8px; }
.rail-badge {
  position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: #f23f43; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 3px var(--bg-deepest); pointer-events: none;
}
body.is-mobile .rail-badge { box-shadow: 0 0 0 3px var(--m-rail); }
.channel-row.unread { color: var(--text-header, var(--text-normal)); font-weight: 600; }
.channel-row.unread::before { content: ''; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--text-header, var(--text-normal)); }
body.is-mobile .channel-row.unread { color: var(--m-text); }
.ch-badge { flex-shrink: 0; margin-left: auto; min-width: 16px; height: 16px; padding: 0 5px; box-sizing: border-box; border-radius: 8px; background: #f23f43; color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }

/* ============================================================
   Threads: listed under their channel, a link under the message they started from, and a thread icon in the header
   ============================================================ */
.thread-row { position: relative; display: flex; align-items: center; gap: 6px; margin: 0 0 2px 26px; padding: 5px 8px; border-radius: 4px; color: var(--text-muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.thread-row:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.thread-row.active { background: var(--bg-modifier-selected); color: var(--text-normal); }
.thread-row .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-curve { position: absolute; left: -14px; top: -8px; width: 12px; height: 22px; border-left: 2px solid color-mix(in srgb, var(--text-muted) 45%, transparent); border-bottom: 2px solid color-mix(in srgb, var(--text-muted) 45%, transparent); border-bottom-left-radius: 8px; pointer-events: none; }
body.is-mobile .thread-row { min-height: 36px; padding: 0 10px; margin-left: 30px; border-radius: 10px; font-size: 15px; color: var(--m-muted); }
body.is-mobile .thread-row.active { background: var(--m-row); color: var(--m-text); }
.msg-thread-chip {
  display: flex; width: max-content; align-items: center; gap: 8px; max-width: min(420px, 100%); margin: 4px 0 2px; padding: 6px 10px;
  border: 1px solid var(--divider); border-radius: 8px; background: var(--bg-secondary); color: var(--text-normal);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.msg-thread-chip:hover { border-color: color-mix(in srgb, var(--text-normal) 30%, transparent); }
.msg-thread-chip svg { flex: none; color: var(--text-muted); }
.mtc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mtc-count { flex: none; color: var(--accent); font-weight: 600; white-space: nowrap; }
#chat-header.is-thread #chat-header-hash {
  display: inline-block !important; flex: none; width: 20px; height: 20px; font-size: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v10H9l-5 4V5z'/%3E%3Cpath d='M8 9h8M8 12h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v10H9l-5 4V5z'/%3E%3Cpath d='M8 9h8M8 12h5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.chat-topic.is-parent-link { cursor: pointer; }
.chat-topic.is-parent-link:hover { color: var(--text-normal); text-decoration: underline; }
/* Settings → Notifications */
.notify-permission { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; padding: 12px 14px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); font-size: 14px; }
.notify-permission.hidden { display: none; }
.notify-app-note { margin: 4px 0 14px; font-size: 13px; color: var(--text-muted); }
#notify-test-btn { margin-top: 10px; }
.notify-test-hint { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
/* unread DMs stand out on a computer too */
.dm-row.unread .dm-name { color: var(--text-header, var(--text-normal)); font-weight: 600; }
body.is-mobile .thread-curve { top: -14px; height: 32px; }
#pane-notifications .setting-row { margin-bottom: 16px; }

/* Like Discord, pictures, files and GIFs sit under the message text, not beside it: an invisible full-width item
   ends the text's line, and everything that isn't text comes after it. */
.msg-row-wrap:has(> .msg-text)::before { content: ''; order: 1; flex-basis: 100%; height: 0; }
.msg-row-wrap:has(> .msg-text) > :not(.msg-text):not(.edited-tag):not(.msg-hover-actions) { order: 2; }
.msg-row-wrap:has(> .msg-text) { row-gap: 2px; }

/* Server icons: a picture instead of the two letters (Server Settings → Upload Image) */
.server-icon-img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; }
.rail-item.has-icon, .rail-item.has-icon:hover, .rail-item.has-icon.active, body.is-mobile .rail-item.has-icon, body.is-mobile .rail-item.has-icon.active { background: transparent; }
.ov-srv-ico .server-icon-img { border-radius: inherit; }
.ss-icon-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.ss-icon-preview { overflow: hidden; }
.ss-icon-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ss-icon-btns { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ss-icon-btns.hidden { display: none; }
.ss-icon-btn { font-size: 12px; padding: 6px 10px; white-space: nowrap; }
.ss-icon-remove { background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; }
.ss-icon-remove:hover { color: var(--danger, #f23f43); text-decoration: underline; }
.invite-icon { overflow: hidden; }

/* ============================================================
   Games page: the Overcontrol RNG banner, as wide as a row of games
   ============================================================ */
.fg-feature {
  grid-column: 1 / -1; position: relative; display: flex; align-items: center; gap: 18px; min-height: 150px; padding: 24px 28px;
  overflow: hidden; text-align: left; color: #fff; cursor: pointer; border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  background: radial-gradient(120% 140% at 85% 20%, #3b1d7a 0%, #160b33 45%, #070512 100%);
  box-shadow: 0 10px 30px rgba(20,8,60,.45), inset 0 1px 0 rgba(255,255,255,.12); transition: transform .15s ease, box-shadow .15s ease;
}
.fg-feature:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(60,20,160,.5), inset 0 1px 0 rgba(255,255,255,.16); }
.fgf-sky { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(2px 2px at 12% 30%, #fff8, transparent 60%), radial-gradient(1.5px 1.5px at 28% 70%, #fff7, transparent 60%),
  radial-gradient(1.5px 1.5px at 45% 22%, #fff6, transparent 60%), radial-gradient(2px 2px at 62% 80%, #fff7, transparent 60%),
  radial-gradient(1.5px 1.5px at 75% 40%, #fff8, transparent 60%), radial-gradient(1px 1px at 90% 65%, #fff6, transparent 60%); }
.fgf-ring { position: absolute; right: 70px; top: 50%; width: 150px; height: 150px; margin-top: -75px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); box-shadow: 0 0 40px rgba(140,90,255,.5), inset 0 0 30px rgba(140,90,255,.35); animation: fgfSpin 9s linear infinite; }
.fgf-orb { position: absolute; top: 50%; right: 137px; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; animation: fgfOrbit 4s linear infinite; transform-origin: 8px 50%; }
.fgf-orb.a { background: #fff; box-shadow: 0 0 18px 6px rgba(255,255,255,.7); }
.fgf-orb.b { background: #000; box-shadow: 0 0 0 2px rgba(255,255,255,.55), 0 0 18px 4px rgba(150,120,255,.5); animation-delay: -2s; }
@keyframes fgfSpin { to { transform: rotate(360deg); } }
@keyframes fgfOrbit { from { transform: rotate(0deg) translateX(-64px) rotate(0deg); } to { transform: rotate(360deg) translateX(-64px) rotate(-360deg); } }
.fgf-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.fgf-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c9b8ff; }
.fgf-title { font-size: 34px; line-height: 1.05; font-weight: 900; letter-spacing: .01em; background: linear-gradient(90deg, #fff, #d7c8ff 55%, #9e86ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 30px rgba(160,120,255,.35); }
.fgf-sub { font-size: 14px; color: rgba(255,255,255,.75); max-width: 460px; }
.fgf-play { position: relative; z-index: 1; flex: none; margin-right: 150px; padding: 12px 26px; border-radius: 999px; font-weight: 900; letter-spacing: .08em; background: linear-gradient(180deg, #fff, #ddd3ff); color: #24105a; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
@media (max-width: 700px) {
  .fg-feature { flex-direction: column; align-items: flex-start; min-height: 0; padding: 20px; }
  .fgf-ring { right: -40px; width: 120px; height: 120px; margin-top: -60px; }
  .fgf-orb { right: 0; }
  .fgf-title { font-size: 26px; }
  .fgf-play { margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .fgf-ring, .fgf-orb { animation: none; } }

/* Games page: the Steal a Character banner, with characters walking down a runway along its bottom edge */
.fg-feature.sac { padding-bottom: 50px; background: radial-gradient(120% 140% at 85% 15%, #ff5fa2 0%, #7c3aed 50%, #1b0b3a 100%); }
.fg-feature.sac:hover { box-shadow: 0 16px 40px rgba(255, 64, 160, .4), inset 0 1px 0 rgba(255, 255, 255, .16); }
.fg-feature.sac .fgf-kicker { color: #ffc2e2; }
.fg-feature.sac .fgf-title { background: linear-gradient(90deg, #fff, #ffd1ea 55%, #ff8ac6); -webkit-background-clip: text; background-clip: text; }
.fg-feature.sac .fgf-play { margin-right: 0; color: #6a1046; background: linear-gradient(180deg, #fff, #ffd6ec); }
.fgs-run { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; overflow: hidden; pointer-events: none; background: repeating-linear-gradient(90deg, #3a3f4b 0 22px, #454b59 22px 44px); box-shadow: inset 0 3px 0 #ffd54f; }
.fgs-run i { position: absolute; left: 0; bottom: 5px; width: 18px; height: 22px; border-radius: 4px; animation: fgsWalk 14s linear infinite; }
.fgs-run i::before { content: ''; position: absolute; left: 3px; top: 6px; width: 3px; height: 3px; border-radius: 50%; background: #111; box-shadow: 8px 0 0 #111; }
.fgs-run i:nth-child(1) { background: #ffd54f; }
.fgs-run i:nth-child(2) { background: #66bb6a; height: 26px; animation-delay: -2.8s; }
.fgs-run i:nth-child(3) { background: #ef5350; animation-delay: -5.6s; }
.fgs-run i:nth-child(4) { background: #b388ff; height: 18px; animation-delay: -8.4s; }
.fgs-run i:nth-child(5) { background: #4fc3f7; height: 24px; animation-delay: -11.2s; }
@keyframes fgsWalk { from { transform: translateX(-30px); } to { transform: translateX(min(1200px, 100vw)); } }
@media (prefers-reduced-motion: reduce) { .fgs-run i { animation: none; } }

/* ---------- the Discord bridge (v4.45) ---------- */
.bot-tag.discord-tag { background: #5865f2; color: #fff; }
.chat-discord-pill { flex: none; margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 16px; cursor: default; }
.cs-dc-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 4px 0 14px; border-radius: 8px; background: var(--bg-secondary, rgba(255,255,255,.04)); border: 1px solid rgba(88,101,242,.45); }
.cs-dc-card.off { border-color: rgba(255,255,255,.12); }
.cs-dc-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #5865f2; color: #fff; }
.cs-dc-card.off .cs-dc-icon { background: rgba(255,255,255,.12); }
.cs-dc-icon svg { width: 18px; height: 18px; }
.cs-dc-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-dc-card-text b { font-size: 15px; }
.cs-dc-card-text span { font-size: 13px; opacity: .75; }
.cs-dc-steps { margin: 6px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; line-height: 1.45; }
.cs-dc-steps li b { display: block; margin-bottom: 2px; }
.cs-dc-steps a { color: #00a8fc; }
.cs-dc-steps .fld-input { display: block; width: 100%; max-width: 360px; margin-top: 8px; }
.cs-dc-code { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cs-dc-code code { padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,.3); font-size: 14px; user-select: all; overflow-wrap: anywhere; }
.cs-dc-msg:empty { display: none; }
.cs-dc-msg { color: #f0b232; }

/* ---- Blocking (v4.61) ---- */
/* someone you blocked: their messages in a row fold into one bar you can open */
.blocked-msgs { display: flex; align-items: center; gap: 10px; margin: 6px 16px 6px 72px; padding: 6px 10px; border-radius: 6px;
  background: var(--bg-secondary); color: var(--text-muted); font-size: 13px; }
.blocked-msgs-show { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.blocked-msgs-show:hover { text-decoration: underline; }
body.is-mobile .blocked-msgs { margin-left: 16px; }
/* a DM with someone you blocked: this note instead of the message box */
.blocked-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 16px 16px; padding: 12px 14px;
  border-radius: 8px; background: var(--bg-secondary); color: var(--text-muted); font-size: 14px; }
.blocked-bar.hidden { display: none; }
.profile-block-btn { color: var(--dnd); }
/* Owner panel > IP: each network's short tag (tagNetworks(), v4.61) */
.net-tag { font-family: ui-monospace, Consolas, monospace; font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-tertiary); padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }

/* ---- v4.64: Buy All on a Shop section, and the 2-to-8 color lists in the nameplate and banner makers ---- */
.shop-section-label { display: flex; align-items: center; gap: 10px; }
.shop-buyall { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--divider);
  background: var(--bg-secondary); color: var(--text-normal); font: inherit; font-size: 11.5px; font-weight: 700; text-transform: none; letter-spacing: 0; cursor: pointer; }
.shop-buyall:hover { border-color: var(--accent); background: var(--bg-modifier-hover); }
.color-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.color-list .cl-item { position: relative; display: inline-flex; }
.color-list .cl-rm { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; border: 0; padding: 0; line-height: 15px; font-size: 12px;
  background: var(--bg-floating); color: var(--text-muted); cursor: pointer; box-shadow: 0 0 0 1px var(--divider); }
.color-list .cl-rm:hover { color: var(--danger); }
.color-list .cl-add { width: 34px; height: 34px; border-radius: 8px; border: 1px dashed var(--text-faint); background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.color-list .cl-add:hover { border-color: var(--accent); color: var(--text-normal); }
.profile-orbs { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-normal); }
.profile-orbs svg { color: var(--accent); }
.profile-orbs-note { font-size: 11.5px; font-weight: 500; color: var(--text-faint); margin-left: 4px; }
/* profile buttons (v4.64): one matching set */
.profile-action-row { align-items: center; }
.pa-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--divider);
  background: var(--bg-tertiary); color: var(--text-normal); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s; }
.pa-btn:hover { background: var(--bg-modifier-hover); border-color: var(--bg-modifier-selected); }
.pa-btn.primary { background: var(--accent-soft); border-color: var(--accent); }
.pa-btn.primary:hover { background: var(--accent); color: #fff; }
.pa-btn.quiet { color: var(--text-muted); }
.pa-pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 6px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: var(--bg-tertiary); border: 1px solid var(--divider); }
.pa-pill svg { color: var(--online); }
.us-gap { display: inline-block; width: .14em; }
/* banner pictures (v4.64) */
.profile-banner.has-picture { height: 160px; }
.banner-image-row { display: flex; gap: 8px; flex-wrap: wrap; }
.banner-image-note { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
/* custom ranks (v4.64) */
.crank-tag { display: inline-flex; align-items: center; height: 16px; padding: 0 6px; margin-left: 4px; border-radius: 4px; font-size: 10px; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.45); vertical-align: middle; white-space: nowrap; }
.rank-maker { flex-wrap: wrap; align-items: center; gap: 8px; }
.rank-maker #rank-name { flex: 1 1 160px; }
.rank-grad { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-muted); }
.rank-row { display: grid; grid-template-columns: 22px auto 1fr auto auto auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--divider); }
.rank-row:last-child { border-bottom: 0; }
.rank-place { font-weight: 800; color: var(--text-faint); text-align: right; }
.rank-people { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-people i { color: var(--text-faint); }
/* loans and credit (v4.64) */
.profile-credit { display: flex; align-items: baseline; gap: 8px; }
.credit-num { font-weight: 800; font-size: 15px; color: var(--text-normal); }
.credit-num.good { color: var(--online); }
.credit-num.bad { color: var(--danger); }
.credit-note { font-size: 12px; color: var(--text-faint); }
.loan-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--bg-tertiary); margin-bottom: 6px; font-size: 13px; }
.loan-row.late { box-shadow: inset 3px 0 0 var(--danger); }
.loan-row.done { opacity: .6; }
/* (v4.66) the rest of a long loan history, on request */
.loan-more { display: block; width: 100%; margin-top: 2px; padding: 7px 10px; border: 1px dashed var(--bg-modifier-accent, rgba(255,255,255,.14)); border-radius: 8px; background: transparent; color: var(--text-muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.loan-more:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.loan-note { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.loan-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.loan-acts select, .loan-pay-amt { height: 32px; border-radius: 6px; border: 1px solid var(--divider); background: var(--bg-input); color: var(--text-normal); padding: 0 8px; font: inherit; font-size: 13px; }
.loan-pay-amt { width: 110px; }
.loan-empty { font-size: 12.5px; color: var(--text-faint); }
.loan-fine { font-size: 12px; color: var(--text-faint); margin: 4px 0 12px; }
/* Mouse Maze (v4.64, games/maze/maze.js; cleaner in v4.66; mobile gamepad in v4.74) */
.mz-root { position: relative; display: flex; flex-direction: column; width: 100%; height: min(72vh, 640px); background: #07080b; border-radius: 14px; overflow: hidden; user-select: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.mz-root.mz-touch { height: min(78vh, 680px); }
.mz-root:fullscreen, .mz-root:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }
.mz-stage { position: relative; flex: 1; min-height: 0; width: 100%; }
.mz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.mz-root.mz-pad-on .mz-canvas { cursor: default; }
.mz-root.mz-in-menu [data-mz="menu"] { display: none; }
.mz-root.mz-in-menu .mz-pad { display: none; }
.mz-bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.mz-btn { padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(20,22,30,.82); color: #e8eaf0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); transition: background .15s, border-color .15s; }
.mz-btn:hover { background: rgba(44,48,62,.95); border-color: rgba(255,255,255,.22); }
.mz-btn.on { background: rgba(88,101,242,.35); border-color: #5865f2; color: #fff; }
.mz-pad {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 20px; background: #0e1017; border-top: 1px solid rgba(255,255,255,.08);
  touch-action: none; flex-shrink: 0;
}
.mz-pad[hidden] { display: none; }
.mz-stick {
  position: relative; width: 118px; height: 118px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 50% 50%, #171b26 0%, #10131b 70%, #0b0d13 100%);
  border: 2px solid rgba(255,255,255,.14); box-shadow: inset 0 0 18px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab;
}
.mz-stick.active { border-color: rgba(88,101,242,.7); cursor: grabbing; }
.mz-stick-ring {
  position: absolute; inset: 14px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.12); pointer-events: none;
}
.mz-knob {
  width: 44px; height: 44px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 32%, #ffffff, #aeb6c8 68%, #6d758a 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,.55), 0 0 0 2px rgba(10,12,18,.7);
  will-change: transform;
}
.mz-pad-mid { flex: 1; text-align: center; min-width: 0; }
.mz-pad-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #8b92a2; }
.mz-pad-hint { font-size: 12px; color: #676e80; margin-top: 3px; }
.mz-pad-acts { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 108px; flex-shrink: 0; }
.mz-act {
  min-height: 46px; padding: 8px 16px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; touch-action: manipulation;
  border: 1px solid rgba(255,255,255,.14); background: #181c27; color: #dce0ea; transition: background .12s, border-color .12s, transform .1s, box-shadow .15s;
}
.mz-act:active:not(:disabled) { transform: scale(.96); }
.mz-act-slow.on { background: rgba(90,168,255,.22); border-color: #5aa8ff; color: #fff; }
.mz-act-finish { background: #1e2028; color: #6c7284; border-color: rgba(255,255,255,.08); }
.mz-act-finish:disabled { opacity: .45; cursor: default; }
.mz-act-finish.ready { background: #e3b23c; border-color: #f8d474; color: #12141a; box-shadow: 0 0 18px rgba(227,178,60,.55); }
@media (max-width: 560px) {
  .mz-pad { padding: 12px 14px; gap: 10px; }
  .mz-stick { width: 108px; height: 108px; }
  .mz-pad-mid { display: none; }
  .mz-pad-acts { min-width: 114px; }
}
.mz-menu { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; background: radial-gradient(circle at 50% 30%, rgba(26,30,44,.96), rgba(7,8,11,.97)); padding: 54px 20px 28px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mz-root.mz-touch .mz-menu { padding: 20px 14px 28px; }
.mz-menu[hidden] { display: none; }
.mz-menu-box { max-width: 720px; width: 100%; margin: auto; color: #e8e9ee; text-align: center; }
.mz-menu-box h2 { margin: 0 0 10px; font-size: 30px; letter-spacing: -.01em; }
.mz-menu-box p { color: #aab0bd; font-size: 14px; line-height: 1.55; margin: 6px auto; max-width: 600px; }
.mz-menu-box .g { color: #3ccf68; } .mz-menu-box .y { color: #e3b23c; }
.mz-fine { font-size: 12.5px !important; }
.mz-progress { height: 8px; max-width: 420px; margin: 16px auto 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.mz-progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #2faf4e, #e3b23c); transition: width .3s; }
.mz-progress-text { font-size: 12.5px; color: #8b92a2; font-weight: 600; }
.mz-continue { margin: 14px 0 18px; padding: 11px 26px; border: 0; border-radius: 999px; background: #5865f2; color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(88,101,242,.35); transition: transform .12s, background .15s; }
.mz-continue:hover { background: #4752c4; transform: translateY(-1px); }
.mz-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.mz-lv { height: 36px; border-radius: 9px; border: 1px solid rgba(255,255,255,.1); background: #191c25; color: #dfe2ea; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .12s, border-color .12s, transform .12s; }
.mz-lv:not(:disabled):hover { background: #262a36; transform: translateY(-1px); }
.mz-lv.done { background: #173d27; border-color: #2faf4e; color: #bff0cd; }
.mz-lv.next { border-color: #e3b23c; box-shadow: 0 0 0 1px #e3b23c inset; }
.mz-lv:disabled { opacity: .28; cursor: default; }
.mz-note { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #e8e9ee; text-align: center; padding: 20px; }
.mz-note span { color: #aab0bd; font-size: 14px; }
/* any file can be sent (v4.65); risky ones say so */
.msg-att-item.is-risky .msg-file-card { box-shadow: inset 3px 0 0 var(--idle); }
.mfc-warn { color: var(--idle); }

/* ============ v4.69: private and locked threads, voice messages, webhooks, events (request 50) ============ */
.thread-private-row { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 10px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg-secondary); cursor: pointer; }
.thread-private-row input { margin-top: 3px; }
.thread-private-row span { display: flex; flex-direction: column; gap: 2px; }
.thread-private-row small { color: var(--text-muted); font-size: 12.5px; }
.thread-flag { display: inline-flex; align-items: center; margin-left: 6px; color: var(--text-muted); flex: none; }
.thread-flag.thread-locked { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 0 5px; border-radius: 4px; background: var(--bg-modifier-selected); }
.ts-row { display: flex; gap: 8px; align-items: center; }
.ts-row input { flex: 1; min-width: 0; }
#ts-members { margin-bottom: 8px; }
.ts-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* voice messages */
.voice-rec { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 8px 12px; border-radius: 8px; background: var(--bg-secondary); }
.voice-rec.hidden { display: none; }
.vr-dot { width: 10px; height: 10px; border-radius: 50%; background: #f23f43; animation: vrBlink 1.2s ease-in-out infinite; flex: none; }
@keyframes vrBlink { 50% { opacity: .3; } }
.vr-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.vr-note { flex: 1; color: var(--text-muted); font-size: 13px; }
.msg-att-item.is-voice { max-width: 320px; }
.voice-msg { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; background: var(--bg-secondary); border: 1px solid var(--divider); }
.vm-play { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: #fff; }
.vm-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-modifier-selected); overflow: hidden; min-width: 120px; }
.vm-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.vm-time { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
/* webhooks (Server Settings, Integrations) */
.ss-sub { color: var(--text-muted); margin: -6px 0 14px; }
.wh-new { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.wh-new input { flex: 1; min-width: 160px; }
.wh-made { padding: 12px; margin-bottom: 12px; border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--accent); display: flex; flex-direction: column; gap: 8px; }
.wh-made.hidden { display: none; }
.wh-made small { color: var(--text-muted); }
.wh-url-row { display: flex; gap: 8px; }
.wh-url-row input { flex: 1; min-width: 0; font-family: monospace; font-size: 12.5px; }
.wh-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--bg-secondary); margin-bottom: 8px; }
.wh-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wh-info small { color: var(--text-muted); }
/* events */
.server-events-row { display: flex; align-items: center; gap: 8px; margin: 6px 8px 2px; padding: 7px 8px; border-radius: 6px; color: var(--text-muted); cursor: pointer; font-weight: 600; }
.server-events-row:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.se-label { flex: 1; }
.se-count { min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--bg-modifier-selected); color: var(--text-normal); font-size: 12px; text-align: center; }
.se-count.live { background: #23a55a; color: #fff; }
.events-box { width: min(560px, 94vw); }
#events-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
#events-list.hidden { display: none; }
.ev-card { padding: 12px 14px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--divider); }
.ev-card.live { border-color: #23a55a; }
.ev-when { font-size: 12.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.ev-card.live .ev-when { color: #23a55a; }
.ev-name { font-size: 17px; font-weight: 700; margin: 2px 0 4px; }
.ev-desc { color: var(--text-normal); white-space: pre-wrap; margin-bottom: 6px; }
.ev-where { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.ev-go { color: var(--text-link); }
.ev-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-int { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--divider); background: var(--bg-tertiary); font-weight: 600; }
.ev-int.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-by { flex: 1; font-size: 12.5px; color: var(--text-muted); }
.ev-small { font-size: 13px; color: var(--text-link); }
.ev-small.danger { color: #f23f43; }
.ev-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.ev-actions.hidden { display: none; }
.ev-form.hidden { display: none; }
.ev-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ev-row .field { flex: 1; min-width: 180px; }
#ev-place { margin-top: 6px; }

/* ============ v4.69: Grow a Garden's backpack and trades (request 65) ============ */
.fg-window .gg-bp-buy { flex: none; margin-left: 6px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg-2, var(--bg-tertiary)); color: var(--text-normal); font-size: 12px; font-weight: 700; cursor: pointer; }
.fg-window .gg-bp-buy:hover { border-color: var(--accent); }
.fg-window .gg-bp-have { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: rgba(35,165,90,.18); color: #3ba55d; font-size: 11px; font-weight: 700; }
.fg-window .gg-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.fg-window .gg-trade-new { width: 100%; margin: 4px 0 10px; }
.gg-trade-h { margin: 12px 0 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.fg-window .gg-trade { padding: 10px 12px; border-radius: 10px; background: var(--card-bg-2, var(--bg-tertiary)); border: 1px solid var(--border); margin-bottom: 8px; font-size: 13px; }
.fg-window .gg-trade-note { color: var(--text-muted); margin-top: 4px; }
.fg-window .gg-trade-acts { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.fg-window .gg-trade-said { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.gg-trade-badge { display: inline-block; min-width: 16px; margin-left: 5px; padding: 0 5px; border-radius: 8px; background: #f23f43; color: #fff; font-size: 11px; line-height: 16px; }
.gg-trade-badge.hidden { display: none; }
#gg-trade-modal { z-index: 300; }   /* (over the game window, which sits at 200) */
.gg-trade-box { width: min(620px, 94vw); }
.gg-trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
@media (max-width: 560px) { .gg-trade-cols { grid-template-columns: 1fr; } }
.gg-trade-cols > div > div:last-child { max-height: 40vh; overflow-y: auto; }
.gg-trade-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--bg-secondary); margin-bottom: 6px; }
.gg-trade-row .gg-seed-ic { font-size: 20px; }
.gg-trade-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.gg-trade-name small { color: var(--text-muted); font-weight: 400; }
.gg-trade-row input { width: 64px; }

/* ============ v4.75: Peer-to-peer WebRTC Screenshare ============ */
#screenshare-toggle.ss-live {
  color: var(--online);
  background: rgba(35, 165, 90, .18);
}
#screenshare-toggle.ss-live:hover {
  color: #fff;
  background: var(--online);
}

@keyframes ssLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.86); }
}
.ss-live-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--online);
  box-shadow: 0 0 0 2px rgba(35, 165, 90, .25);
  animation: ssLivePulse 1.9s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .ss-live-dot { animation: none !important; }
}

.ss-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 28px; padding: 0 11px; border-radius: 6px; border: 1px solid var(--divider);
  background: var(--bg-tertiary); color: var(--text-normal);
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.ss-btn:hover { background: var(--bg-modifier-hover); border-color: var(--text-faint); }
.ss-btn-accent {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.ss-btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ss-btn-danger {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
.ss-btn-danger:hover { filter: brightness(1.08); background: var(--danger); border-color: var(--danger); }

.ss-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--text-muted); cursor: pointer; flex-shrink: 0;
  transition: background .14s ease, color .14s ease;
}
.ss-icon-btn svg { width: 15px; height: 15px; flex-shrink: 0; display: block; }
.ss-icon-btn:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
.ss-icon-btn.on { color: var(--text-normal); background: var(--bg-modifier-selected); }

/* Away-sharing bar (shown when sharing in another room) */
#screen-away-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; flex-shrink: 0;
  background: linear-gradient(90deg, rgba(35, 165, 90, .16), rgba(35, 165, 90, .06));
  border-bottom: 1px solid rgba(35, 165, 90, .28);
  font-size: 13px; color: var(--text-normal);
}
#screen-away-bar .ss-away-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#screen-away-bar .ss-away-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* In-room live banner */
#screen-banner {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 16px; flex-shrink: 0;
  background: var(--bg-secondary); border-bottom: 1px solid var(--divider);
}
.ss-banner-row {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.ss-banner-info {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text-normal);
}
.ss-banner-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-banner-sub { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
.ss-banner-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Collapsible docked stage above messages */
#screen-stage {
  display: flex; flex-direction: column; flex-shrink: 0;
  margin: 10px 16px 4px; border-radius: 10px; overflow: hidden;
  background: #0b0c0e; border: 1px solid var(--divider);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}
#screen-stage.expanded .ss-video-wrap { height: min(56vh, 520px); }
#screen-stage:fullscreen,
#screen-stage:-webkit-full-screen {
  margin: 0; border-radius: 0; border: none; width: 100vw; height: 100vh;
}
#screen-stage:fullscreen .ss-video-wrap,
#screen-stage:-webkit-full-screen .ss-video-wrap {
  flex: 1; height: auto; max-height: none;
}

.ss-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 12px; background: rgba(18, 19, 22, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #f2f3f5; min-width: 0;
}
.ss-bar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.ss-bar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ss-bar .ss-icon-btn { color: #b5bac1; }
.ss-bar .ss-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.ss-bar .ss-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #f2f3f5; }
.ss-bar .ss-btn:hover { background: rgba(255, 255, 255, .16); }
.ss-bar .ss-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.ss-bar .ss-btn-danger:hover { filter: brightness(1.08); background: var(--danger); }

.ss-live-pill {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  background: rgba(35, 165, 90, .2); color: #4ade80;
}
.ss-live-pill.connecting { background: rgba(240, 178, 50, .2); color: #facc15; }
.ss-live-pill.connecting .ss-live-dot { background: #facc15; box-shadow: none; }
.ss-live-pill.error { background: rgba(242, 63, 66, .2); color: #f87171; }
.ss-live-pill.error .ss-live-dot { background: #f87171; animation: none; box-shadow: none; }

.ss-title { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-meta { font-size: 12px; color: #949ba4; white-space: nowrap; flex-shrink: 0; }

.ss-video-wrap {
  position: relative; width: 100%; height: min(36vh, 340px); min-height: 170px;
  background: #07080a; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#screen-video {
  width: 100%; height: 100%; object-fit: contain; display: block; background: #07080a;
}
.ss-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 16px;
  background: rgba(7, 8, 10, .82); color: #e3e5e8; text-align: center;
}
.ss-overlay-msg { font-size: 13.5px; max-width: 360px; line-height: 1.4; color: #dbdee1; }

body.is-mobile #screen-stage { margin: 8px 10px 4px; border-radius: 12px; }
@media (max-width: 720px) {
  #screen-stage { margin: 8px 10px 4px; border-radius: 12px; }
  .ss-video-wrap { height: 32vh; min-height: 160px; }
  #screen-stage.expanded .ss-video-wrap { height: 48vh; }
  .ss-bar { padding: 6px 8px; gap: 6px; }
  .ss-meta { display: none; }
  .ss-btn { height: 26px; padding: 0 9px; font-size: 12px; }
  #screen-banner { padding: 8px 12px; }
  .ss-banner-sub { display: none; }
  #screen-away-bar { padding: 7px 12px; font-size: 12.5px; }
}

/* ============================================================
   v4.77 — Live sidebar screenshare badges, Server AutoMod,
   Message Forwarding, and Bookmarks (Saved Messages)
   ============================================================ */

/* Live sidebar screenshare badge on DMs, group chats, channels, and threads */
.ss-side-live {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  margin-left: auto; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.35;
  background: rgba(35, 165, 90, .2); color: #4ade80; border: 1px solid rgba(35, 165, 90, .38);
}
.ss-side-live::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: #23a55a; flex-shrink: 0;
}
.dm-row .ss-side-live { margin-left: 6px; }
.channel-row .ss-side-live,
.thread-row .ss-side-live { margin-left: 6px; }
body.theme-light .ss-side-live {
  background: rgba(22, 163, 74, .14); color: #15803d; border-color: rgba(22, 163, 74, .32);
}

/* Server AutoMod settings pane */
.am-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0;
}
.am-copy { flex: 1; min-width: 0; }
.am-title { font-size: 15px; font-weight: 600; color: var(--text-header, var(--text-normal)); margin-bottom: 2px; }
.am-row .ss-hint { margin: 0; }
.am-action-field { margin-top: 10px; }

/* Bookmark active state in message hover bar */
.hover-icon-btn.bookmark-msg.on { color: var(--accent); }
.hover-icon-btn.bookmark-msg.on svg { fill: currentColor; }

/* Forwarded message card inside chat */
.msg-forwarded {
  margin-top: 4px; padding: 8px 12px; max-width: 520px;
  border-left: 3px solid var(--accent);
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
  border-top: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}
.msg-fwd-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px;
}
.msg-fwd-head .i { display: inline-flex; width: 13px; height: 13px; color: var(--accent); }
.msg-fwd-head .i svg { width: 13px; height: 13px; }
.msg-fwd-label { font-style: italic; font-weight: 600; color: var(--text-muted); }
.msg-fwd-who { font-weight: 700; color: var(--text-normal); }
.msg-fwd-where { color: var(--text-muted); }
.msg-fwd-text {
  font-size: 14px; line-height: 1.4; color: var(--text-normal);
  word-break: break-word; white-space: pre-wrap;
}
.msg-fwd-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-fwd-img {
  max-width: 240px; max-height: 180px; border-radius: 6px; display: block;
  object-fit: cover; cursor: zoom-in; border: 1px solid var(--divider);
}
.msg-fwd-file {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  background: var(--bg-tertiary); color: var(--text-normal); text-decoration: none;
  border: 1px solid var(--divider);
}
.msg-fwd-file:hover { border-color: var(--accent); color: var(--accent); }
.msg-fwd-sticker { width: 96px; height: 96px; object-fit: contain; display: block; margin-top: 4px; }

/* Forward Message modal */
.forward-modal-box { width: min(480px, 94vw); }
.fwd-preview {
  padding: 9px 11px; margin-bottom: 12px; border-radius: 8px;
  background: var(--bg-tertiary); border-left: 3px solid var(--accent);
  font-size: 13px; color: var(--text-normal); max-height: 92px; overflow-y: auto;
}
.fwd-preview-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px; font-weight: 600; }
.fwd-preview-text { white-space: pre-wrap; word-break: break-word; }
.fwd-note-field { margin-bottom: 10px; }
.fwd-search-field { margin-bottom: 8px; }
.fwd-note-field input,
.fwd-search-field input,
.bm-search-field input {
  width: 100%; padding: 9px 11px; border-radius: 6px; font-size: 13.5px; font-family: inherit;
  background: var(--input-bg, var(--bg-tertiary)); color: var(--text-normal);
  border: 1px solid var(--divider); outline: none;
}
.fwd-note-field input:focus,
.fwd-search-field input:focus,
.bm-search-field input:focus { border-color: var(--accent); }
.fwd-targets {
  max-height: 270px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  padding-right: 2px;
}
.fwd-group-lbl {
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted); padding: 6px 4px 2px;
}
.fwd-target-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 7px;
  background: var(--bg-secondary); border: 1px solid transparent;
}
.fwd-target-row:hover { border-color: var(--divider); background: var(--bg-modifier-hover); }
.fwd-target-info { flex: 1; min-width: 0; }
.fwd-target-name { font-size: 13.5px; font-weight: 600; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-target-sub { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-send-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; flex-shrink: 0;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
}
.fwd-send-btn:hover { filter: brightness(1.08); }
.fwd-send-btn:disabled { opacity: .6; cursor: default; filter: none; }

/* Saved Messages (Bookmarks) modal */
.bookmarks-modal-box { width: min(540px, 95vw); }
.bm-search-field { margin-bottom: 10px; }
.bm-list {
  max-height: 410px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding-right: 2px;
}
.bm-item {
  padding: 10px 12px; border-radius: 8px;
  background: var(--bg-secondary); border: 1px solid var(--divider);
  display: flex; flex-direction: column; gap: 5px;
}
.bm-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
}
.bm-who { font-weight: 700; color: var(--text-normal); }
.bm-where { color: var(--accent); font-weight: 600; }
.bm-time { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.bm-body {
  font-size: 13.5px; line-height: 1.42; color: var(--text-normal);
  white-space: pre-wrap; word-break: break-word;
}
.bm-actions { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.bm-btn {
  padding: 4px 9px; border-radius: 5px; font-size: 12px; font-weight: 600;
  background: var(--bg-tertiary); color: var(--text-normal);
  border: 1px solid var(--divider); cursor: pointer;
}
.bm-btn:hover { background: var(--bg-modifier-hover); }
.bm-btn-del { color: var(--danger); }
.bm-btn-del:hover { background: rgba(242, 63, 66, .12); border-color: rgba(242, 63, 66, .35); }
.bm-empty { text-align: center; padding: 28px 14px; color: var(--text-muted); font-size: 13.5px; }

/* ============ v4.78: CLOSING DMS, MOBILE TYPING STABILITY, GRADIENT FRAMES & GREAT SHOP RUSH ============ */
/* Game death/start overlays always sit above game tiles & canvases (Blox Merge, Block Blast, Geo Dash, etc.) */
.fg-window .bb-overlay, .fg-window .gd-overlay { z-index: 20; }

/* Discord-style DM close button */
.dm-row .dm-close-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 0; height: 22px; padding: 0; border: none; border-radius: 50%;
  background: transparent; color: var(--text-faint); font-size: 17px; line-height: 1;
  opacity: 0; overflow: hidden; flex-shrink: 0; cursor: pointer; position: relative; z-index: 2;
  transition: opacity .12s ease, width .12s ease, background .12s ease, color .12s ease;
}
.dm-row:hover .dm-close-btn, .dm-row:focus-within .dm-close-btn { width: 22px; opacity: .78; margin-left: 2px; }
.dm-row .dm-close-btn:hover { opacity: 1; background: rgba(255,255,255,.12); color: var(--text-normal); }
.dm-row.has-nameplate .dm-close-btn { color: rgba(255,255,255,.85); }
.dm-row.has-nameplate .dm-close-btn:hover { background: rgba(0,0,0,.35); color: #fff; }
body.is-mobile .dm-row .dm-close-btn {
  width: 28px; height: 28px; opacity: .55; margin-left: 2px; font-size: 18px;
}
body.is-mobile .dm-row .dm-close-btn:active { opacity: 1; background: rgba(255,255,255,.14); color: var(--text-normal); }

/* Mobile typing stability: stop iOS/WebKit outer-page pan & scroll-anchor drift while keyboard is open */
body.is-mobile #messages { overflow-anchor: none; }
body.is-mobile.keyboard-open {
  position: fixed; top: 0; left: 0; right: 0; width: 100%; overflow: hidden;
}

/* Admin Panel Gradient Profile Frame creator */
.frame-mode-row { display: flex; gap: 6px; flex-wrap: wrap; }
.frame-mode-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
#frame-preview-swatch { width: 126px; min-width: 126px; height: 98px; }
.color-list input[type="color"] {
  width: 40px; height: 34px; padding: 2px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12); background: var(--bg-input); cursor: pointer;
}

/* Great Shop Rush (4,000+ items): hero summary, filter/sort toolbar, load-more pagination */
.shop-rush-banner {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin-bottom: 18px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(135deg, rgba(88,101,242,.22), rgba(235,69,158,.16) 55%, rgba(240,178,50,.14));
}
.shop-rush-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.shop-rush-title { font-size: 16px; font-weight: 800; letter-spacing: .02em; color: var(--text-normal); }
.shop-rush-count {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff;
}
.shop-rush-sub { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.shop-rush-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-rush-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.09); color: var(--text-normal);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.shop-rush-pill:hover { background: rgba(255,255,255,.12); border-color: var(--accent); }
.shop-rush-pill span { color: var(--text-muted); font-size: 11.5px; font-weight: 700; }

.shop-filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-secondary); border: 1px solid rgba(255,255,255,.06);
}
.shop-filter-count { font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-right: auto; }
.shop-filter-select {
  background: var(--bg-input); color: var(--text-normal); border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; outline: none; cursor: pointer;
}
.shop-filter-select:focus { border-color: var(--accent); }
.shop-load-more-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 18px 0 8px;
}
.shop-load-more-btn {
  padding: 9px 20px; border-radius: 8px; font-size: 13.5px; font-weight: 700;
  background: var(--bg-secondary); color: var(--text-normal);
  border: 1px solid rgba(255,255,255,.14); cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.shop-load-more-btn:hover { background: var(--bg-modifier-hover); border-color: var(--accent); }
.shop-load-more-sub { font-size: 12px; color: var(--text-muted); }
.admin-gsr-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; width: 100%; }
.shop-buy-entire-top, .shop-buy-entire-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #eb459e); color: #fff; border: none;
  font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(88,101,242,.35); transition: filter .12s ease, transform .12s ease;
}
.shop-buy-entire-top:hover, .shop-buy-entire-btn:hover { filter: brightness(1.1); }
.shop-buy-entire-top:active, .shop-buy-entire-btn:active { transform: scale(.97); }
.shop-buy-entire-top.is-done, .shop-buy-entire-btn.is-done {
  background: rgba(255,255,255,.1); color: var(--text-muted); box-shadow: none; cursor: default; filter: none;
}
.shop-rush-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.is-mobile .shop-buy-entire-top { display: none; }
body.is-mobile .shop-filter-bar { padding: 8px 10px; gap: 6px; }
body.is-mobile .shop-filter-select { flex: 1 1 130px; min-width: 0; }

/* Old-Discord low-tier UI animations (fast, subtle upward slide-in, GPU-cheap transform+opacity only) */
@keyframes fxPopUp {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fxBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-overlay:not(.hidden) { animation: fxBackdropIn 120ms ease-out both; }
.modal-overlay:not(.hidden) > .modal-box,
#profile-modal:not(.hidden) #profile-modal-box { animation: fxPopUp 165ms cubic-bezier(.2, .9, .3, 1) both; }
#inbox-popover:not(.hidden),
#help-popover:not(.hidden),
#emoji-picker-panel:not(.hidden),
#sticker-picker-panel:not(.hidden),
#gif-picker-panel:not(.hidden),
#mention-popup:not(.hidden),
.server-menu,
.composer-action-menu,
.react-popover,
.full-react-popover,
.shop-browse-menu,
.mht-menu,
.action-sheet,
#mobile-you-page:not(.hidden),
#mobile-notif-page:not(.hidden) { animation: fxPopUp 150ms cubic-bezier(.2, .9, .3, 1) both; }
.channel-row, .dm-row, .member-row, .rail-item { transition: background-color 110ms ease, color 110ms ease, border-radius 140ms ease; }
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-box, #inbox-popover, #help-popover, #emoji-picker-panel, #sticker-picker-panel,
  #gif-picker-panel, #mention-popup, .server-menu, .composer-action-menu, .react-popover,
  .full-react-popover, .shop-browse-menu, .mht-menu, .action-sheet, #mobile-you-page, #mobile-notif-page {
    animation: none !important;
  }
}
