:root,
.social-profile-card[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080808;
  --panel: #151515;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --grid-line: #1b1b1b;
  --surface: #111111;
  --surface-raised: #202020;
  --input-bg: #080808;
  --border: #292929;
  --border-strong: #333333;
  --border-contrast: #3a3a3a;
  --border-hover: #555555;
  --hover: #303030;
  --focus: #ffffff;
  --control-text: #d0d0d0;
  --player-bg: #000000;
  --status-success: #a5e6ae;
  --status-error: #ff9999;
  --favorite: #ff8296;
  --favorite-border: #75404a;
}

:root[data-theme="midnight-blue"],
.social-profile-card[data-theme="midnight-blue"] {
  color-scheme: dark;
  --bg: #0b2846;
  --panel: #143d65;
  --text: #edf4ff;
  --muted: #b8d3e8;
  --grid-line: #164164;
  --surface: #103454;
  --surface-raised: #1a4d76;
  --input-bg: #081f38;
  --border: #29577a;
  --border-strong: #39729a;
  --border-contrast: #4381a8;
  --border-hover: #65add1;
  --hover: #245c85;
  --focus: #ffffff;
  --control-text: #d0e0f3;
  --status-success: #a5e6ae;
  --status-error: #ff9999;
  --favorite: #ff8296;
  --favorite-border: #75404a;
}

:root[data-theme="dark-sakura"],
.social-profile-card[data-theme="dark-sakura"] {
  color-scheme: dark;
  --bg: #351324;
  --panel: #502039;
  --text: #fff0f5;
  --muted: #e5b7cd;
  --grid-line: #4d2038;
  --surface: #45192f;
  --surface-raised: #642b49;
  --input-bg: #260d1d;
  --border: #71415a;
  --border-strong: #935676;
  --border-contrast: #a55f83;
  --border-hover: #d78aaf;
  --hover: #7b365c;
  --focus: #ffe3ef;
  --control-text: #f0cddd;
  --status-success: #a5e6ae;
  --status-error: #ff9baa;
  --favorite: #ff8bb2;
  --favorite-border: #75404a;
}

:root[data-theme="forest-night"],
.social-profile-card[data-theme="forest-night"] {
  color-scheme: dark;
  --bg: #0d2b1d;
  --panel: #194531;
  --text: #eef8f0;
  --muted: #b9daca;
  --grid-line: #1b4630;
  --surface: #143a28;
  --surface-raised: #255b3e;
  --input-bg: #092015;
  --border: #35664a;
  --border-strong: #46815e;
  --border-contrast: #50916b;
  --border-hover: #7ac194;
  --hover: #2b6b49;
  --focus: #f3fff5;
  --control-text: #d4ead9;
  --status-success: #a5e6ae;
  --status-error: #ff9999;
  --favorite: #ff8ba0;
  --favorite-border: #75404a;
}

:root[data-theme="sakura"],
.social-profile-card[data-theme="sakura"] {
  color-scheme: light;
  --bg: #fff7fa;
  --panel: #fff0f5;
  --text: #493640;
  --muted: #8f7180;
  --grid-line: #f4dce6;
  --surface: #fff9fb;
  --surface-raised: #fceaf1;
  --input-bg: #ffffff;
  --border: #eed2df;
  --border-strong: #e5bfd0;
  --border-contrast: #e3bdce;
  --border-hover: #d59bb5;
  --hover: #f9e3ed;
  --focus: #70445a;
  --control-text: #694456;
  --status-success: #35794b;
  --status-error: #a63852;
  --favorite: #d85c83;
  --favorite-border: #e7a3b8;
}

:root[data-theme="baby-blue"],
.social-profile-card[data-theme="baby-blue"] {
  color-scheme: light;
  --bg: #f4f9ff;
  --panel: #eaf3ff;
  --text: #2e4056;
  --muted: #6c8099;
  --grid-line: #dce9f8;
  --surface: #f9fcff;
  --surface-raised: #e7f1fd;
  --input-bg: #ffffff;
  --border: #d1e1f4;
  --border-strong: #bad1eb;
  --border-contrast: #b8d0eb;
  --border-hover: #91b5dc;
  --hover: #e1edfb;
  --focus: #3a5c83;
  --control-text: #3c5879;
  --status-success: #34734a;
  --status-error: #a13d4c;
  --favorite: #d85c83;
  --favorite-border: #e7a3b8;
}

:root[data-theme="lavender"],
.social-profile-card[data-theme="lavender"] {
  color-scheme: light;
  --bg: #faf7ff;
  --panel: #f1eaff;
  --text: #413752;
  --muted: #7d7193;
  --grid-line: #e8def6;
  --surface: #fcfaff;
  --surface-raised: #eee6fa;
  --input-bg: #ffffff;
  --border: #ded2f0;
  --border-strong: #cbb9e5;
  --border-contrast: #cbb9e5;
  --border-hover: #a990d0;
  --hover: #e9dff7;
  --focus: #624d84;
  --control-text: #594875;
  --status-success: #35794b;
  --status-error: #a13d4c;
  --favorite: #c65e9a;
  --favorite-border: #dda6ca;
}

:root[data-theme="mint"],
.social-profile-card[data-theme="mint"] {
  color-scheme: light;
  --bg: #f4fbf8;
  --panel: #e8f6f0;
  --text: #30483f;
  --muted: #6d887b;
  --grid-line: #d9eee5;
  --surface: #f9fdfb;
  --surface-raised: #e3f2eb;
  --input-bg: #ffffff;
  --border: #cce5d9;
  --border-strong: #b2d8c8;
  --border-contrast: #b2d8c8;
  --border-hover: #84bea5;
  --hover: #dcf0e6;
  --focus: #3e7059;
  --control-text: #426755;
  --status-success: #287044;
  --status-error: #a13d4c;
  --favorite: #d85c83;
  --favorite-border: #e7a3b8;
}

:root[data-theme="peach"],
.social-profile-card[data-theme="peach"] {
  color-scheme: light;
  --bg: #fff8f3;
  --panel: #fff0e5;
  --text: #4b3b33;
  --muted: #90786a;
  --grid-line: #f4e1d3;
  --surface: #fffbf8;
  --surface-raised: #fcebdd;
  --input-bg: #ffffff;
  --border: #eed7c7;
  --border-strong: #e2c1aa;
  --border-contrast: #e2c1aa;
  --border-hover: #cfa383;
  --hover: #f8e6d8;
  --focus: #795641;
  --control-text: #70523f;
  --status-success: #35794b;
  --status-error: #a13d4c;
  --favorite: #d85c83;
  --favorite-border: #e7a3b8;
}

* {
  box-sizing: border-box;
}

textarea { resize: none; }

@supports (scrollbar-color: auto) {
  * {
    scrollbar-color: var(--muted) var(--surface);
  }
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  ::-webkit-scrollbar-track {
    background: var(--surface);
  }

  ::-webkit-scrollbar-thumb {
    border: 3px solid var(--surface);
    border-radius: 999px;
    background: var(--muted);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--text);
  }
}

html,
body {
  margin: 0;
  font-family: "Lexend", sans-serif;
  background: var(--bg);
  color: var(--text);
}

html {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
}

body {
  min-height: 100vh;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.settings-page {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 24px 140px;
}

.settings-panel {
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.settings-header {
  margin-bottom: 30px;
  text-align: center;
}

.settings-title {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  letter-spacing: -0.07em;
}

.settings-description {
  margin: 10px 0 0;
  color: var(--muted);
}

.settings-form {
  display: grid;
  gap: 20px;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.settings-field input,
.settings-field select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.settings-field input:focus-visible,
.settings-field select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.settings-favicon-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-favicon-preview {
  display: grid;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}

.settings-favicon-preview img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.settings-reset-favicon {
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.settings-reset-favicon:hover {
  border-color: var(--border-hover);
  background: var(--hover);
}

.settings-reset-favicon[hidden] {
  display: none;
}

.settings-save {
  width: fit-content;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.settings-status {
  min-height: 1.4em;
  margin: -10px 0 0;
  color: var(--status-success);
  font-size: 0.85rem;
}

.settings-status.is-error {
  color: var(--status-error);
}

.account-page {
  display: grid;
  width: min(680px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 24px 140px;
  place-items: center;
}

.community-page {
  width: min(1080px, 100%);
}

.account-panel {
  width: 100%;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.account-panel[hidden],
#auth-section[hidden],
#profile-section[hidden] {
  display: none;
}

.account-form[hidden],
.account-mode-prompt[hidden] {
  display: none;
}

.account-header {
  margin-bottom: 30px;
  text-align: center;
}

.account-title {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  letter-spacing: -0.07em;
}

.account-description {
  margin: 10px 0 0;
  color: var(--muted);
}

.account-form {
  display: grid;
  gap: 12px;
}

.auth-form {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.auth-form h2 {
  margin: 0;
  font-size: 1.25rem;
}

.account-privacy {
  margin: 0 0 16px;
  text-align: center;
}

.account-mode-prompt {
  margin: 16px 0 0;
  color: var(--muted);
  text-align: center;
}

.account-mode-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-mode-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.community-link {
  display: flex;
  width: fit-content;
  margin: 0 auto 20px;
  text-align: center;
}

.account-join-date {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.community-sign-in {
  display: flex;
  width: fit-content;
  margin: 18px auto 0;
}

.community-sign-in[hidden] {
  display: none;
}

.extras-page {
  width: min(1040px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 72px 24px 140px;
}

.extras-header {
  margin-bottom: 32px;
  text-align: center;
}

.extras-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.extras-header .page-title {
  margin: 0;
}

.extras-header .splash-text {
  max-width: 640px;
  margin: 12px auto 0;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.partner-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.partner-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.partner-grid {
  grid-template-columns: repeat(2, minmax(0, 320px));
  justify-content: center;
}

.partner-card-link {
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.partner-card-link:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: var(--surface-raised);
}

.partner-card-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.partner-logo {
  width: 160px;
  height: 160px;
  justify-self: center;
  border-radius: 14px;
  object-fit: contain;
}

.partner-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.extras-empty-state {
  margin: 0 0 18px;
  color: var(--muted);
  text-align: center;
}

.extras-account-page {
  width: min(720px, 100%);
}

.chat-page {
  display: grid;
  width: min(1100px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 24px 140px;
  place-items: center;
}

.chat-panel {
  min-width: 0;
}

.chat-header,
.chat-room-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.chat-header {
  margin-bottom: 18px;
}

.chat-header .account-title {
  font-size: clamp(2rem, 6vw, 3rem);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) minmax(0, 3fr);
  min-height: 440px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.chat-layout[hidden],
.chat-message-form[hidden] {
  display: none;
}

.chat-room-sidebar {
  padding: 16px;
  border-right: 1px solid var(--border);
  background: var(--surface-raised);
}

.chat-room-sidebar h2,
.chat-room-header h2,
.chat-admin-section h3 {
  margin: 0;
  font-size: 1rem;
}

.chat-admin-panel {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
}

.chat-admin-panel summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.chat-admin-panel summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.chat-admin-panel[hidden] {
  display: none;
}

.chat-admin-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.chat-admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-admin-danger {
  width: 100%;
  min-height: 40px;
}

.chat-admin-members {
  display: grid;
  gap: 8px;
}

.chat-admin-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
}

.chat-admin-member strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chat-room-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.chat-room-button {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-room-button:hover,
.chat-room-button[aria-pressed="true"] {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.chat-room-button:focus-visible,
.chat-message-form button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.chat-conversation {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
}

.chat-room-header {
  display: block;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chat-room-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-message-list {
  display: flex;
  min-height: 260px;
  max-height: min(48vh, 500px);
  flex: 1;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
  padding: 0 6px 0 0;
  overflow-y: auto;
  list-style: none;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}

.chat-message-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  object-fit: cover;
  font-size: 0.9rem;
}

.chat-message-content {
  min-width: 0;
  flex: 1;
}

.chat-message-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
}

.chat-message-heading strong {
  overflow-wrap: anywhere;
  color: var(--text);
}

.chat-message p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message-image {
  display: block;
  max-width: min(100%, 480px);
  max-height: 360px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: contain;
}

.chat-message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.chat-image-controls {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-image-controls[hidden] {
  display: none;
}

.chat-image-controls input {
  min-width: 0;
  color: var(--text);
  font: inherit;
}

.chat-image-controls .account-hint {
  margin: 0;
}

.chat-message-form textarea {
  width: 100%;
  min-height: 48px;
  max-height: 150px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: none;
}

.chat-message-form textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.chat-message-form button {
  min-height: 44px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.chat-message-form button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 620px) {
  .extras-page {
    padding: 44px 18px 130px;
  }

  .partner-grid {
    grid-template-columns: minmax(0, 320px);
  }

  .chat-page {
    padding: 24px 12px 130px;
  }

  .chat-panel {
    padding: 20px 14px;
  }

  .chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-room-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .chat-room-list {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  text-align: center;
}

.community-admin-link {
  display: flex;
  width: fit-content;
  margin: 0 auto 18px;
}

.community-admin-link[hidden] {
  display: none;
}

.profile-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-editor-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-raised);
}

.profile-editor-wide {
  grid-column: 1 / -1;
}

.profile-editor-card .account-remove {
  justify-self: start;
}

.profile-preferences {
  margin-top: 10px;
}

.profile-preferences h3,
.profile-preferences h4,
.profile-preferences p {
  margin: 0;
}

.profile-preference-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.admin-user-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.admin-user-filters input,
.admin-user-filters select {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.admin-user-filters input {
  flex: 1 1 180px;
}

@media (max-width: 600px) {
  .profile-editor {
    grid-template-columns: minmax(0, 1fr);
  }
}

.account-banner-preview {
  display: grid;
  width: 100%;
  height: clamp(72px, 12vw, 110px);
  margin: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-contrast);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--muted);
}

.account-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-banner-image[hidden] {
  display: none;
}

.account-banner-placeholder[hidden] {
  display: none;
}

.account-avatar-preview {
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-contrast);
  border-radius: 50%;
  background: var(--surface-raised);
}

.account-avatar-placeholder {
  color: var(--muted);
  font-size: 2.5rem;
  font-weight: 700;
}

.account-avatar-placeholder[hidden],
.nav-account-icon[hidden] {
  display: none;
}

.account-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-image[hidden] {
  display: none;
}

.account-form label {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.account-form input[type="text"],
.account-form input[type="file"],
.account-form input[type="email"],
.account-form input[type="password"],
.account-form select,
.account-form textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.account-form input[type="text"]:focus-visible,
.account-form input[type="file"]:focus-visible,
.account-form input[type="email"]:focus-visible,
.account-form input[type="password"]:focus-visible,
.account-form select:focus-visible,
.account-form textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.account-form input[type="color"] {
  width: 68px;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--input-bg);
  cursor: pointer;
}

.account-form input[type="color"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

select:not([multiple]):not([size]) {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  cursor: pointer;
}

select:not([multiple]):not([size]):hover {
  border-color: var(--border-hover);
}

select option {
  background: var(--input-bg);
  color: var(--text);
}

@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }

  select:not([multiple]):not([size]) {
    appearance: auto;
    background-image: none;
  }
}

.account-hint {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.account-save {
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.account-remove {
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

.account-remove:hover {
  border-color: var(--border-hover);
  background: var(--surface-raised);
}

.account-remove[hidden] {
  display: none;
}

.account-actions button:disabled,
.account-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.account-status {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: var(--status-success);
  font-size: 0.85rem;
}

.account-status.is-error {
  color: var(--status-error);
}

.public-profiles {
  align-self: start;
}

.public-profiles .account-header {
  margin-bottom: 20px;
}

.public-profiles .account-title {
  font-size: clamp(1.8rem, 6vw, 2.5rem);
}

.community-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
}

.community-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.community-search input {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.community-search input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.community-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.community-page-button {
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.community-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.community-page-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.community-page-status {
  min-width: 76px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.public-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.public-profile-card {
  display: grid;
  width: 100%;
  gap: 8px;
  min-width: 0;
  padding: 0 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.public-profile-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.public-profile-open {
  display: grid;
  width: 100%;
  min-width: 0;
  justify-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.public-profile-open:not(.has-banner) {
  padding-top: 12px;
}

.public-profile-banner {
  width: calc(100% + 24px);
  height: 64px;
  margin: 0 -12px;
  border-radius: 13px 13px 0 0;
  object-fit: cover;
}

.public-profile-open:focus-visible,
.public-profile-share:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.public-profile-share {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
}

.public-profile-share:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.public-profile-avatar {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-contrast);
  border-radius: 50%;
  background: var(--surface-raised);
  object-fit: cover;
}

.public-profile-open.has-banner .public-profile-avatar {
  margin-top: -28px;
  border-width: 3px;
}

.public-profile-placeholder {
  color: var(--muted);
  font-size: 1.6rem;
  font-weight: 700;
}

.public-profile-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  font-weight: 600;
}

@media (max-width: 620px) {
  .community-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-pagination {
    justify-content: space-between;
  }
}

.profile-label-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.profile-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.75rem;
  line-height: 1.2;
}

.profile-badge img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-badge.badge-banana,
.profile-badge.badge-owner {
  border-color: #e8d27b;
  background: #fff3bd;
  color: #574400;
}

.profile-badge.badge-developer {
  border-color: #9dcfa8;
  background: #dcf4df;
  color: #174e23;
}

.profile-badge.badge-femboy {
  border-color: #9bcbe8;
  background: #dcedff;
  color: #19486b;
}

.profile-badge.badge-friend {
  border-color: #bca3df;
  background: #e9dcfa;
  color: #473066;
}

.profile-badge.badge-silly {
  border-color: #e5a5a5;
  background: #ffe1e1;
  color: #722828;
}

.profile-badge.badge-custom {
  background: var(--surface);
}

.profile-badge-icon {
  font-size: 0.9rem;
}

.public-profile-page {
  width: min(600px, 100%);
  padding: 32px 16px 120px;
}

.public-profile-page .account-panel {
  padding: clamp(18px, 4vw, 24px);
}

.public-profile-page .community-link {
  margin-bottom: 12px;
}

.profile-entry {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  opacity: 1;
  transition: opacity 350ms ease;
}

.profile-entry.is-leaving {
  opacity: 0;
}

.profile-entry[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .profile-entry {
    transition: none;
  }
}

.profile-page-content {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.profile-banned {
  padding: 24px 0;
  text-align: center;
}
.profile-banned[hidden] { display: none; }
.profile-banned h1 { margin: 0 0 10px; overflow-wrap: anywhere; }
.profile-banned p { margin: 0; color: var(--status-error); }

.profile-page-content[hidden] {
  display: none;
}

.profile-page-banner {
  width: 100%;
  height: clamp(110px, 25vw, 160px);
  border: 1px solid var(--border);
  border-radius: 14px;
  object-fit: cover;
}

.profile-page-banner[hidden] {
  display: none;
}

.profile-page-avatar-wrap {
  display: grid;
  width: 104px;
  height: 104px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-contrast);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 2rem;
}

.profile-page-avatar-wrap.has-banner {
  margin-top: -62px;
  border: 4px solid var(--surface);
}

.profile-page-avatar,
.profile-page-avatar-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-page-avatar-placeholder {
  display: grid;
  place-items: center;
  font-weight: 700;
}

.profile-page-avatar[hidden],
.profile-page-avatar-placeholder[hidden] {
  display: none;
}

.profile-page-content h1,
.profile-page-content p {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-page-content h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.profile-page-join-date {
  font-size: 0.9rem;
}

.profile-page-bio {
  width: min(460px, 100%);
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.profile-page-badge-section {
  display: grid;
  width: 100%;
  gap: 6px;
}

.profile-page-badge-section h2 {
  margin: 0;
  font-size: 1rem;
}

.profile-page-badges {
  justify-content: center;
}

.profile-page-badge-empty {
  margin: 0;
  color: var(--muted);
}

.profile-social-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
}
.profile-social-actions[hidden], .profile-social-actions [hidden], .profile-playing[hidden],
.profile-playing img[hidden] { display: none; }
.profile-social-actions .home-button {
  min-width: 0;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
#profile-dm {
  border-color: #b69aff;
  background: #b69aff;
  color: #171322;
  font-weight: 700;
}
#profile-dm:hover {
  border-color: #d1bfff;
  background: #d1bfff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
#profile-friend {
  border-color: #78dfbd;
  background: #78dfbd;
  color: #171322;
  font-weight: 700;
}
#profile-friend:hover {
  border-color: #a4efd5;
  background: #a4efd5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.profile-social-actions button:disabled { opacity: 0.6; cursor: default; }
#profile-social-status:empty { display: none; }
.profile-playing {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(320px, 100%);
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
  text-align: left;
}
.profile-playing img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.profile-playing > div { display: grid; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.profile-playing small { color: var(--muted); font-size: 0.72rem; }

.admin-page {
  display: grid;
  width: min(1280px, 100%);
  gap: 18px;
  align-content: start;
  justify-items: stretch;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 2fr);
  align-items: start;
  gap: 18px;
}

.admin-dashboard[hidden] {
  display: none;
}

.admin-dashboard-main {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.admin-profile-panel {
  position: sticky;
  top: 24px;
  display: grid;
  justify-items: center;
  gap: 18px;
  align-self: start;
  text-align: center;
}

.admin-profile-panel h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.admin-profile-panel .account-description {
  margin-top: 8px;
}

.admin-profile-eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-profile-avatar {
  display: grid;
  width: 140px;
  height: 140px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-contrast);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 3rem;
}

.admin-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-profile-avatar img[hidden] {
  display: none;
}

.admin-profile-placeholder[hidden] {
  display: none;
}

.admin-section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-section-header .account-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.admin-section-header .account-description {
  margin-top: 6px;
}

.admin-section-header .account-status {
  flex: 0 0 auto;
  text-align: right;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  max-height: 430px;
  gap: 10px;
  overflow: auto;
}

.admin-user-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.admin-user-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.admin-user-item:focus-visible,
.admin-creation-option:focus-visible,
.admin-small-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.admin-user-item > img,
.admin-user-item-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-contrast);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  object-fit: cover;
}

.admin-user-item-identity {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.admin-user-item-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-item-identity small {
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-user-item > i {
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-creation-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-creation-option {
  display: grid;
  justify-items: start;
  gap: 9px;
  min-height: 130px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.admin-creation-option:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.admin-creation-option > i {
  color: var(--focus);
  font-size: 1.4rem;
}

.admin-creation-option > span {
  font-weight: 700;
}

.admin-creation-option > small {
  color: var(--muted);
  line-height: 1.4;
}

.admin-dialog {
  position: fixed;
  inset: 0;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: clamp(22px, 4vw, 32px);
  overflow: auto;
  border: 1px solid var(--border-contrast);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.admin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.admin-dialog > h2 {
  margin: 14px 0 20px;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.admin-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.admin-badge-manager {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.admin-badge-manager h3 {
  margin: 0;
}

.admin-badge-manager .account-status {
  margin: 0;
}

.admin-custom-badge-grid {
  display: grid;
  gap: 10px;
}

.admin-custom-badge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}

.admin-custom-badge-preview {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.admin-custom-badge-preview img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-custom-badge-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.admin-small-button {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.admin-danger-button {
  border-color: #b94a4a;
  color: #b94a4a;
}

.admin-empty-state {
  margin: 0;
  color: var(--muted);
}

.admin-create-account-form {
  margin-top: 20px;
}

.developer-requests-panel {
  grid-column: 1 / -1;
}

.developer-request-list {
  display: grid;
  gap: 12px;
}

.developer-request-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
}

.developer-request-item h3,
.developer-request-item p {
  margin: 0;
}

.developer-request-item p {
  color: var(--muted);
  white-space: pre-wrap;
}

.developer-request-item time {
  color: var(--muted);
  font-size: 0.78rem;
}

.developer-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 860px) {
  .admin-dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-profile-panel {
    position: static;
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    text-align: left;
  }

  .admin-profile-avatar {
    width: 96px;
    height: 96px;
    font-size: 2rem;
  }

  .admin-section-header {
    flex-direction: column;
  }

  .admin-section-header .account-status {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .admin-creation-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-custom-badge-item {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-custom-badge-controls {
    justify-content: flex-end;
  }
}

.admin-user-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-raised);
}

.admin-user-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.admin-user-heading img,
.admin-user-avatar-placeholder {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-contrast);
  border-radius: 50%;
  object-fit: cover;
}

.admin-user-avatar-placeholder {
  color: var(--muted);
  background: var(--surface);
}

.admin-user-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.admin-user-bio {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-user-form {
  display: grid;
  gap: 14px;
}

.admin-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.admin-user-form legend {
  padding: 0 6px;
  font-weight: 600;
}

.admin-choice,
.admin-role-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-choice img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-choice i {
  width: 24px;
  text-align: center;
}

.admin-role-choice {
  justify-self: start;
  font-weight: 600;
}

.admin-choice input,
.admin-role-choice input {
  accent-color: var(--focus);
}

.admin-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-user-status {
  min-height: 1.3em;
  margin: 0;
  color: var(--status-success);
  font-size: 0.85rem;
}

.admin-user-status.is-error {
  color: var(--status-error);
}

.admin-user-form button:disabled,
.admin-custom-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.games-page {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 64px 24px 140px;
}

.games-header {
  margin-bottom: 36px;
  text-align: center;
}

.games-title {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: -0.07em;
}

.games-header .splash-text {
  margin-top: 12px;
}

.games-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, 100%);
  margin: 28px auto 0;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
}

.games-search:focus-within {
  border-color: var(--border-hover);
}

.games-search input {
  width: 100%;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.games-search input::placeholder {
  color: var(--muted);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 22px;
}

.game-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.game-card-link {
  display: flex;
  min-width: 0;
  align-items: center;
  color: inherit;
}

.games-status[hidden] {
  display: none;
}

.game-card img {
  display: block;
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  object-fit: cover;
}

.game-card-content {
  min-width: 0;
  padding: 14px 48px 14px 14px;
}

.game-card h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 1.15rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.favorite-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.favorite-toggle:hover {
  border-color: var(--border-hover);
  background: var(--hover);
  color: var(--focus);
}

.favorite-toggle[aria-pressed="true"] {
  border-color: var(--favorite-border);
  color: var(--favorite);
}

.favorite-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.games-status {
  margin: 30px 0;
  color: var(--muted);
  text-align: center;
}

.game-card-link:focus-visible,
.player-back:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.player-page {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 2.8vw 140px;
}

.player-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.player-shell {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--player-bg);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.player-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--player-bg);
}

.player-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.player-status[hidden],
.player-viewport iframe[hidden] {
  display: none;
}

.player-viewport iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--player-bg);
}

.player-viewport iframe:fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.player-toolbar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  background: var(--surface);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-controls button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--control-text);
  cursor: pointer;
  font: inherit;
}

.player-controls button:hover {
  background: var(--hover);
  color: var(--focus);
}

.player-controls button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.player-back {
  display: block;
  width: fit-content;
  margin: 24px auto 0;
  color: var(--muted);
}

.player-back:hover {
  color: var(--text);
}

.page-title {
  margin: 0;
  font-size: clamp(3.5rem, 12vw, 8rem);
  line-height: 1;
  letter-spacing: -0.08em;
}

.splash-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  letter-spacing: 0.02em;
}

.home-announcements {
  display: grid;
  width: min(320px, 100%);
  gap: 14px;
  text-align: left;
}

.home-page:has(.home-announcements:not([hidden])) {
  gap: 24px;
  padding-bottom: 140px;
}

@media (min-width: 1200px) {
  .home-page:has(.home-announcements:not([hidden])) {
    grid-template-columns: minmax(300px, 1fr) minmax(0, 600px) minmax(300px, 1fr);
  }

  .home-page:has(.home-announcements:not([hidden])) .home-content {
    grid-column: 2;
  }

  .home-announcements {
    justify-self: end;
  }
}

.home-announcements[hidden],
.home-announcement[hidden],
.home-announcement-form[hidden],
.home-announcement-read-status[hidden] {
  display: none;
}

.home-announcement-dialog {
  position: fixed;
  inset: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 58px 18px 18px;
  overflow: auto;
  border: 1px solid var(--border-contrast);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  transition: opacity 220ms ease, transform 220ms ease;
}

.home-announcement-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  transition: opacity 220ms ease;
}

.home-announcement-dialog.is-closing {
  opacity: 0;
  transform: translateY(8px);
}

.home-announcement-dialog.is-closing::backdrop {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .home-announcement-dialog,
  .home-announcement-dialog::backdrop {
    transition: none;
  }
}

.home-announcement-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.home-announcement {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #e8d27b;
  border-radius: 14px;
  background: #fff3bd;
  color: #574400;
  text-align: left;
}

.home-announcement > img {
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  border-radius: 10px;
  object-fit: cover;
}

.home-announcement > img[hidden] {
  display: none;
}

.home-announcement-content {
  min-width: 0;
}

.home-announcement-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.home-announcement-message {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.home-announcement-form {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}

.home-announcement-form h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.home-announcement-read-status {
  text-align: center;
}

.proxy-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(600px, 100%);
  margin: 26px auto 0;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.proxy-search:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
}

.proxy-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.proxy-search input::placeholder {
  color: var(--muted);
}

.proxy-search button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.proxy-search button:hover {
  background: var(--hover);
}

.proxy-search button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.proxy-error {
  margin: 10px 0 0;
  color: var(--status-error);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.proxy-error-code {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.proxy-error:empty,
.proxy-error-code:empty {
  display: none;
}

.home-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 140px;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-button:hover {
  transform: translateY(-2px);
}

.discord-button:hover {
  border-color: #5865f2;
  box-shadow: 0 0 18px rgba(88, 101, 242, 0.65);
}

.support-button:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.15);
}

.home-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.floating-nav {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.nav-logo {
  display: grid;
  flex: 0 0 48px;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-logo img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  padding: 11px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.2s ease;
}

.nav-logo:hover,
.nav-item:hover {
  background: var(--hover);
  color: var(--focus);
  transform: translateY(-2px);
}

.nav-logo:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.nav-item i {
  font-size: 1.2rem;
}

.nav-extras-trigger {
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.nav-notifications {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
}

.nav-notifications[hidden],
.social-notifications[hidden],
.social-view[hidden],
.social-thread[hidden] {
  display: none;
}

.nav-notifications:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.social-notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  padding: 3px;
  border-radius: 12px;
  background: #d33f49;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.social-notifications {
  position: absolute;
  display: flex;
  flex-direction: column;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(340px, calc(100vw - 32px));
  max-height: min(65vh, 500px);
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  text-align: left;
}

.social-notification-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.social-notifications > .account-hint,
.social-notifications > button,
.social-notifications h2 { flex: 0 0 auto; }

.social-notifications h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.social-notification-row {
  display: flex;
  align-items: flex-start;
  border-radius: 8px;
}
.social-notification-link {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.social-notification-link:hover,
.social-notification-link:focus-visible {
  background: var(--hover);
}

.social-notification-link.is-unread {
  font-weight: 700;
}
.social-notification-clear {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: 4px 2px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}
.social-notification-clear:hover { background: var(--hover); color: var(--text); }
.social-notification-clear:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.social-notification-clear:disabled { opacity: 0.5; cursor: wait; }
.social-notification-image {
  position: relative;
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-raised);
  font-weight: 700;
}
.social-notification-image.is-server { border-radius: 12px; }
.social-notification-image img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.social-notification-image [hidden] { display: none; }
.social-notification-text {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.social-notification-text time {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
}

.social-panel {
  display: grid;
  gap: 14px;
  margin: 20px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-raised);
}

.social-panel h2, .social-panel h3, .social-panel h4,
.social-panel p {
  margin: 0;
}

.social-inline-form, .social-row, .social-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-panel button {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.social-panel .social-open-thread[aria-pressed="true"] {
  border-color: var(--focus);
  background: var(--hover);
}

.social-panel button:focus-visible,
.social-panel input:focus-visible,
.social-panel textarea:focus-visible,
.social-panel select:focus-visible,
.social-panel summary:focus-visible,
.social-profile-details summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.social-panel .social-server-profile,
.social-panel .social-server-discover {
  color: #171322;
  font-weight: 600;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.social-server-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}
.social-server-actions .social-server-profile,
.social-server-actions .social-server-discover {
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: normal;
  font-size: 0.82rem;
  line-height: 1.2;
}
.social-server-actions .social-popup-content {
  grid-column: 1 / -1;
}
.social-panel .social-server-profile {
  border-color: #b69aff;
  background: #b69aff;
}
.social-panel .social-server-profile:hover {
  border-color: #d1bfff;
  background: #d1bfff;
}
.social-panel .social-server-discover {
  border-color: #78dfbd;
  background: #78dfbd;
}
.social-panel .social-server-discover:hover {
  border-color: #a4efd5;
  background: #a4efd5;
}
.social-panel .social-server-profile:hover,
.social-panel .social-server-discover:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.social-view, .social-form, .social-list, .social-thread {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.social-view h4 {
  margin-top: 8px;
}

.social-inline-form input,
.social-inline-form textarea,
.social-inline-form select,
.social-form input:not([type="checkbox"]),
.social-form textarea,
.social-view > select,
.social-popup-content > select,
.social-mention-controls select {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.social-row-wide {
  width: 100%;
}

.social-list > input {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.social-inline-form button {
  flex: 0 0 auto;
}

.social-row {
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.social-row > span {
  flex: 1;
  min-width: 100px;
  overflow-wrap: anywhere;
}

.social-profile-link {
  font-weight: 700;
  text-decoration: none;
}
.social-profile-link:hover { color: var(--focus); }

.social-profile-details summary {
  cursor: pointer;
  font-weight: 700;
}

.social-profile-details[open] > summary {
  margin-bottom: 12px;
}

.social-thread {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.social-thread-messages {
  display: grid;
  gap: 10px;
  min-height: 100px;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-thread-messages li {
  padding: 10px;
  border-radius: 9px;
  background: var(--surface);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.social-sign-out {
  margin-top: 18px;
}

.social-navigation a:hover,
.social-account-link:hover {
  background: var(--hover);
}

.account-dashboard-page {
  width: min(1120px, 100%);
}

.account-dashboard-page #auth-section {
  width: min(100%, 520px);
  margin: 0 auto;
}

.account-bento-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-bento-welcome,
.account-bento-link,
.account-bento-editor {
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-raised);
}

.account-bento-welcome {
  display: flex;
  grid-column: span 2;
  grid-row: span 2;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(20px, 3vw, 32px);
  overflow: hidden;
  background: var(--panel);
}

.account-bento-welcome h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.account-bento-welcome .account-hint { margin: 0; }
.account-bento-welcome .account-join-date { text-align: left; }
.account-welcome-avatar {
  display: grid;
  flex: 0 0 min(38%, 140px);
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
}
.account-welcome-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-welcome-avatar [hidden] { display: none; }

.account-bento-link {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  overflow-wrap: anywhere;
  border-color: rgba(0, 0, 0, 0.12);
  background: var(--tile-color);
  color: #211b2b;
}
.account-bento-link[hidden] { display: none; }
.account-bento-link i { font-size: 1.5rem; }
.account-bento-link strong,
.account-bento-link small,
.account-bento-editor summary small { display: block; }
.account-bento-link small,
.account-bento-editor summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}
.account-bento-link small { color: #493d4b; }
.account-bento-friends { --tile-color: #f5a6ca; --tile-hover: #ffc3dd; }
.account-bento-messages { --tile-color: #a8baff; --tile-hover: #c3d0ff; }
.account-bento-servers { --tile-color: #9ee3c3; --tile-hover: #b9efd5; }
.account-bento-community { --tile-color: #f7c38c; --tile-hover: #ffdbb0; }
.account-bento-link:hover { background: var(--tile-hover); }
.account-bento-link,
.account-bento-editor > summary,
.account-panel button {
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.account-bento-link:hover,
.account-panel button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}
.account-bento-editor > summary:hover { background: var(--hover); }
.account-bento-editor > summary:hover i,
.account-bento-editor > summary:focus-visible i { color: var(--focus); }
.account-bento-link:focus-visible,
.account-bento-editor > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.account-bento-editor {
  grid-column: 1 / -1;
  padding: 18px;
}
.account-bento-editor > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -18px -18px 12px;
  padding: 18px;
  border-radius: 15px;
  list-style: none;
}
.account-bento-editor:not([open]) > summary { margin-bottom: -18px; }
.account-bento-editor > summary::-webkit-details-marker { display: none; }
.account-bento-editor > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
}
.account-bento-editor:not([open]) > summary::after { content: "▸"; }
.account-bento-editor > summary i { font-size: 1.2rem; }

@media (max-width: 700px) {
  .account-bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-bento-welcome { grid-row: auto; }
}

.social-page {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 24px 140px;
}

.social-page .social-panel {
  display: block;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
}

.social-gate {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: clamp(24px, 5vw, 48px);
}

.social-gate h1 {
  margin: 0;
}

.social-gate[hidden],
.social-workspace[hidden],
.social-thread-empty[hidden] {
  display: none;
}

.social-workspace {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: min(740px, calc(100vh - 180px));
}

.social-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 8px;
  border-right: 1px solid var(--border);
  background: var(--panel);
}

.social-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 800;
}

.social-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.social-brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.social-brand > span {
  display: none;
}

.social-navigation {
  display: grid;
  gap: 6px;
}

.social-navigation a,
.social-account-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.social-navigation a[aria-current="page"] {
  background: var(--surface-raised);
  color: var(--text);
}

.social-navigation i,
.social-account-link i {
  font-size: 1.15rem;
}

.social-server-switcher {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-height: 340px;
  padding-top: 12px;
  overflow: auto;
  border-top: 1px solid var(--border-strong);
}
.social-server-switcher[hidden] { display: none; }
.social-panel .social-server-switch {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  padding: 0;
  border-radius: 15px;
  background: var(--surface-raised);
  font-weight: 700;
}
.social-panel .social-server-switch:hover,
.social-panel .social-server-switch[aria-pressed="true"] {
  border-color: var(--focus);
  background: var(--hover);
}
.social-server-switch-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.social-panel .social-server-add {
  align-self: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 15px;
}

.social-account-link {
  margin-top: auto;
}

.social-main {
  min-width: 0;
}

.social-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.social-main-header h1 {
  margin: 3px 0 0;
  font-size: 1.35rem;
}

.social-eyebrow {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.social-layout {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
  min-height: 580px;
}

.social-layout[data-view="friends"] {
  grid-template-columns: minmax(0, 1fr);
}

.social-layout[data-view="servers"]:has(.social-members-panel:not([hidden])),
.social-layout[data-view="messages"]:has(.social-dm-profile:not([hidden])),
.social-layout[data-view="messages"]:has(#social-group-panel:not([hidden])) {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(190px, 230px);
}
.social-dm-profile[hidden] { display: none; }
.social-dm-profile {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  overflow-wrap: anywhere;
}
.social-dm-banner {
  height: 82px;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: var(--surface-raised);
}
.social-dm-banner-image { width: 100%; height: 100%; object-fit: cover; }
.social-dm-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: -32px 0 8px 10px;
  overflow: hidden;
  border: 4px solid var(--panel);
  border-radius: 50%;
  background: var(--surface-raised);
  font-size: 1.4rem;
  font-weight: 700;
}
.social-dm-avatar-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.social-dm-profile-name { color: var(--text); font-weight: 800; text-decoration: none; }
.social-dm-profile-name:hover { color: var(--focus); }
.social-dm-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.social-dm-badges .profile-badge { font-size: 0.7rem; }
.social-dm-profile .social-dm-bio { margin-top: 14px; white-space: pre-wrap; font-size: 0.85rem; }
.social-dm-joined { margin-top: 14px !important; font-size: 0.8rem; }
.social-dm-joined strong, .social-dm-joined span { display: block; }
.social-dm-joined span { margin-top: 4px; color: var(--muted); }
.social-dm-activity {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-raised);
  font-size: 0.85rem;
}
.social-dm-activity[hidden], .social-dm-game img[hidden], .social-dm-activity .home-button[hidden] { display: none; }
.social-dm-game { display: flex; align-items: center; gap: 8px; }
.social-dm-game img { width: 48px; height: 48px; border-radius: 7px; object-fit: cover; }
.social-dm-activity .home-button { width: 100%; text-align: center; }
.social-popup:has(#social-profile-preview-popup:not([hidden])) { width: min(360px, calc(100vw - 32px)); }
#social-preview-profile { border: 0; border-radius: 10px; }
#social-preview-profile .social-preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
#social-preview-profile .social-preview-actions:has(#social-preview-friend[hidden]) {
  grid-template-columns: 1fr;
}
#social-preview-profile .social-preview-actions button {
  width: 100%;
  min-width: 0;
  color: #171322;
  font-weight: 700;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
#social-preview-message {
  border-color: #b69aff !important;
  background: #b69aff !important;
}
#social-preview-message:hover {
  border-color: #d1bfff !important;
  background: #d1bfff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
#social-preview-friend {
  border-color: #78dfbd !important;
  background: #78dfbd !important;
}
#social-preview-friend:hover {
  border-color: #a4efd5 !important;
  background: #a4efd5 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
#social-preview-message[hidden] { display: none; }
.social-panel .social-message-profile {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-align: left;
}
.social-panel .social-message-profile:hover { color: var(--focus); }
.social-panel .social-message-avatar-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.social-members-panel[hidden] { display: none; }
.social-members-panel {
  min-width: 0;
  padding: 18px 12px;
  border-left: 1px solid var(--border);
  background: var(--panel);
}
.social-members-panel > summary {
  cursor: pointer;
  font-weight: 700;
}
#social-members-list,
#social-friends-list,
#social-requests,
#social-group-friends,
#social-conversations,
#social-spam,
#social-servers-list,
#social-group-members,
.social-invite-friends {
  max-height: min(60vh, 640px);
  overflow-y: auto;
  align-content: start;
  overscroll-behavior: contain;
}
.social-invite-card {
  display: grid;
  gap: 10px;
  width: min(100%, 340px);
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-raised);
}
.social-invite-banner { width: 100%; height: 100px; border-radius: 8px; object-fit: cover; }
.social-invite-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.social-invite-logo { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.social-invite-placeholder { display: grid; place-items: center; background: var(--surface); font-weight: 700; }
.social-invite-info { min-width: 0; overflow-wrap: anywhere; }
.social-invite-info strong, .social-invite-info small { display: block; }
.social-invite-info small { color: var(--muted); }
.social-invite-card .social-invite-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.social-member-group h3, .social-member-activity h3 {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
}
.social-member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.social-member:hover, .social-member:focus-visible { background: var(--hover); }
.social-member-avatar-wrap { position: relative; flex: 0 0 34px; }
.social-member-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-raised);
  object-fit: cover;
}
.social-member-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: #80848e;
}
.social-member-presence.is-online { background: #23a55a; }
.social-member-text { min-width: 0; overflow-wrap: anywhere; }
.social-playing {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}
.social-playing-image {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
}
.social-playing-image[hidden], .social-spam-dot[hidden] { display: none; }
.social-spam-details > summary { cursor: pointer; font-weight: 700; }
.social-spam-details .social-list { margin-top: 8px; }
.social-spam-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53e46;
  vertical-align: middle;
}
@media (prefers-reduced-motion: reduce) {
  .account-bento-link, .account-bento-editor > summary, .account-panel button,
  .social-panel .social-server-profile, .social-panel .social-server-discover { transition: none; }
  .account-bento-link:hover, .account-bento-editor > summary:hover, .account-panel button:not(:disabled):hover,
  .social-panel .social-server-profile:hover, .social-panel .social-server-discover:hover { transform: none; }
}
.social-member-text small { display: block; color: var(--muted); font-size: 0.72rem; }
.social-role-management {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.social-role-management strong { flex: 1 1 120px; overflow-wrap: anywhere; }
.social-role-color { display: flex; align-items: center; gap: 10px; }
.social-form .social-role-color input[type="color"] {
  flex: 0 0 52px;
  width: 52px;
  height: 42px;
  padding: 4px;
  cursor: pointer;
}
.social-role-color input[type="text"] { max-width: 150px; }

.social-layout > .social-view {
  align-content: start;
  padding: 20px 14px;
}

.social-layout:not([data-view="friends"]) > .social-view {
  border-right: 1px solid var(--border);
  background: var(--panel);
}

.social-layout[data-view="friends"] > .social-view {
  width: min(100%, 720px);
  padding: 24px;
}

.social-conversation {
  position: relative;
  min-width: 0;
}
.social-person-avatar,
.social-row > .social-person-avatar {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  min-width: 0;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-raised);
  object-fit: cover;
}
.social-message-request {
  margin: 12px 20px 0;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-raised);
}
.social-message-request[hidden] { display: none; }
.social-message-request p { margin-bottom: 8px; }
.social-message-request button { margin: 4px 4px 0 0; }
.social-panel .social-conversation-open {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.social-conversation-open i {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-raised);
}
.social-conversation-open span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.social-panel .social-conversation-open:hover { background: var(--hover); }
.social-panel .social-conversation.is-group .social-conversation-open { padding-right: 48px; }
.social-panel .social-conversation-tools {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  transform: translateY(-50%);
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.social-panel .social-conversation-tools:hover,
.social-panel .social-conversation-tools:focus-visible { background: var(--surface-raised); color: var(--text); }

.social-popup {
  width: min(620px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.social-popup::backdrop { background: rgba(0, 0, 0, 0.7); }
.social-popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.social-popup-header h2 {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}
.social-popup-header button[hidden],
.social-popup-content[hidden] { display: none; }
.social-popup-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.social-popup-content .social-inline-form { flex-wrap: wrap; }
.social-popup-content .social-inline-form input,
.social-popup-content .social-inline-form select { flex: 1 1 150px; }
.social-popup-content fieldset { min-width: 0; }
.social-popup-content > input {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.social-popup:has(.server-settings:not([hidden])) {
  width: min(940px, calc(100vw - 32px));
}
.social-popup-content.server-settings {
  display: grid;
  grid-template-columns: minmax(160px, 205px) minmax(0, 1fr);
  gap: 20px;
  min-height: 360px;
}
.social-popup-content.server-settings[hidden] { display: none; }
.server-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}
.social-panel .server-settings-link {
  width: 100%;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.social-panel .server-settings-link:hover,
.social-panel .server-settings-link[aria-pressed="true"] {
  background: var(--hover);
  color: var(--text);
}
.server-settings-content { min-width: 0; }
.server-settings-section {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}
.server-settings-section[hidden] { display: none; }
.server-settings-section > h3 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.server-settings-section > input {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}
@media (max-width: 620px) {
  .social-popup-content.server-settings { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 14px; }
  .server-settings-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .social-panel .server-settings-link { width: auto; flex: 0 0 auto; white-space: nowrap; }
}

.social-thread-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.social-thread-empty i {
  font-size: 2rem;
}

.social-thread-empty h2 {
  color: var(--text);
}

.social-thread-empty.is-server-start:not([hidden]) {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  overflow-y: auto;
  text-align: left;
}
.server-start-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-content: start;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
}
.server-start-category {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.server-start-category h3 { margin-bottom: 8px; color: var(--text); overflow-wrap: anywhere; }
.server-start-channel-list { display: grid; gap: 4px; }
.social-panel .server-start-channel {
  width: 100%;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  overflow-wrap: anywhere;
}
.social-panel .server-start-channel:hover,
.social-panel .server-start-channel:focus-visible { background: var(--hover); color: var(--text); }

.social-layout > .social-thread:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 0;
  border: 0;
}

.social-typing-status {
  min-height: 1.2em;
  padding: 0 20px;
  color: var(--muted);
  font-size: 0.8rem;
}

.social-typing-status.is-error {
  color: var(--status-error);
}

.social-composer { position: relative; flex: 1; min-width: 0; }
.social-composer textarea { display: block; padding-right: 55px; resize: none; }
.social-composer select {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 40px;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
}
.social-composer select[hidden] { display: none; }
.social-group-heading { display: flex; align-items: center; gap: 8px; }
.social-group-heading strong { min-width: 0; overflow-wrap: anywhere; }
.social-group-icon { position: relative; overflow: hidden; }
.social-group-icon img { position: absolute; inset: 0; }
.social-group-icon [hidden] { display: none; }
.social-group-panel-actions { display: grid; gap: 8px; margin: 12px 0; }
.social-group-friend { padding: 6px; border-radius: 8px; }
.social-group-friend:hover { background: var(--hover); }

.social-mention {
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--hover);
  color: var(--focus);
  font-weight: 700;
}

.server-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
}

.server-banner {
  width: 100%;
  height: 100px;
  border-radius: 10px;
  object-fit: cover;
}

.server-sidebar {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.server-sidebar[hidden] { display: none; }

.server-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.server-sidebar-logo, .server-sidebar-placeholder {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-raised);
  object-fit: cover;
  font-weight: 700;
}

.server-sidebar-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.server-sidebar-title small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.server-sidebar-content {
  display: grid;
  gap: 10px;
  padding: 0 10px 12px;
}
.server-category-wrapper { position: relative; min-width: 0; }
.server-channel-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}
.server-channel-category > summary {
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.server-channel-category > summary:hover { background: var(--hover); color: var(--text); }
.server-channel-list {
  display: grid;
  gap: 3px;
}
.social-panel .server-channel-list .social-open-thread {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  overflow-wrap: anywhere;
}
.social-panel .server-channel-list .social-open-thread:hover,
.social-panel .server-channel-list .social-open-thread[aria-pressed="true"] {
  background: var(--hover);
  color: var(--text);
}
.profile-badge.badge-server-owner {
  background: #d97706;
  color: #fff;
}

.server-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  overflow-wrap: anywhere;
}

.server-card h2,
.server-card p {
  margin: 0;
}

.server-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 14px;
}

.profile-featured-server {
  width: min(460px, 100%);
  margin-top: 4px;
  text-align: left;
}
.profile-featured-server h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}
.profile-featured-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}
.profile-featured-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}
.profile-featured-placeholder {
  display: grid;
  place-items: center;
  background: var(--surface);
  font-weight: 700;
}
.profile-featured-details { min-width: 0; }
.profile-featured-details h3 {
  margin: 0 0 3px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.profile-page-content .profile-featured-details p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}
.profile-featured-card .home-button {
  min-width: 0;
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 0.8rem;
}
@media (max-width: 420px) {
  .profile-featured-card { grid-template-columns: 40px minmax(0, 1fr); }
  .profile-featured-icon { width: 40px; height: 40px; }
  .profile-featured-card .home-button { grid-column: 2; justify-self: start; }
}

.social-thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.social-thread-header h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.social-panel .social-thread-back {
  display: none;
}

.social-layout .social-thread-messages {
  display: block;
  flex: 1;
  min-height: 360px;
  max-height: 600px;
  padding: 18px 20px;
}

.social-layout .social-thread-messages li {
  margin-bottom: 8px;
  background: transparent;
}

.social-layout #social-message-form {
  padding: 16px 20px 20px;
}

@media (min-width: 761px) and (min-height: 501px) {
  .social-workspace {
    height: calc(100vh - 174px);
    height: calc(100dvh - 174px);
    min-height: 0;
  }
  .social-sidebar, .social-main, .social-layout,
  .social-layout > .social-thread:not([hidden]) { min-height: 0; }
  .social-server-switcher { min-height: 0; }
  .social-main { display: flex; flex-direction: column; }
  .social-main-header { flex: 0 0 auto; }
  .social-layout { flex: 1; grid-template-rows: minmax(0, 1fr); }
  .social-layout > .social-view, .social-dm-profile, .social-members-panel { overflow-y: auto; }
  .social-layout .social-thread-messages { min-height: 0; max-height: none; }
}

@media (max-width: 760px) {
  .social-layout[data-view="servers"]:has(.social-members-panel:not([hidden])),
  .social-layout[data-view="messages"]:has(.social-dm-profile:not([hidden])),
  .social-layout[data-view="messages"]:has(#social-group-panel:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
  }
  .social-members-panel { border-left: 0; border-top: 1px solid var(--border); }
  .social-dm-profile { border-left: 0; border-top: 1px solid var(--border); }
  .social-page {
    padding: 16px 12px 120px;
  }

  .social-workspace {
    display: block;
  }

  .social-sidebar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .social-brand img {
    width: 32px;
    height: 32px;
  }

  .social-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1;
  }

  .social-navigation a {
    justify-content: center;
    padding: 8px 4px;
  }

  .social-account-link {
    margin: 0;
    padding: 8px 4px;
  }

  .social-server-switcher {
    order: 2;
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    max-height: none;
    padding-top: 10px;
  }
  .social-panel .social-server-add { order: 2; }

  .social-layout {
    display: block;
    min-height: 400px;
  }

  .social-layout:not([data-view="friends"]) > .social-view {
    border-right: 0;
  }

  .social-layout.has-thread > .social-view,
  .social-thread-empty:not(.is-server-start) {
    display: none;
  }

  .social-thread-empty.is-server-start:not([hidden]) {
    max-height: min(60vh, 600px);
    max-height: min(60dvh, 600px);
  }

  .social-panel .social-thread-back {
    display: inline-block;
    flex: none;
    font-size: 0.8rem;
  }

  .social-layout > .social-thread:not([hidden]) {
    height: clamp(360px, 70vh, 600px);
    height: clamp(360px, 70dvh, 600px);
    min-height: 0;
  }

  .social-layout .social-thread-messages { min-height: 0; max-height: none; }
}

.nav-extras-trigger[hidden] {
  display: none;
}

.nav-extras-trigger[aria-expanded="true"] {
  background: var(--hover);
  color: var(--focus);
}

.extras-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  width: min(320px, calc(100vw - 32px));
  max-height: min(65vh, 500px);
  padding: 12px;
  overflow-y: auto;
  transform: translateX(-50%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  text-align: left;
}

.extras-menu[hidden] {
  display: none;
}

.extras-menu-title {
  margin: 4px 8px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.extras-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
}

.extras-menu-link:hover,
.extras-menu-link:focus-visible {
  background: var(--hover);
}

.extras-menu-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.extras-menu-link > i {
  width: 22px;
  color: var(--muted);
  text-align: center;
}

.extras-menu-link > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.extras-menu-link strong {
  font-size: 0.9rem;
}

.extras-menu-link span span {
  color: var(--muted);
  font-size: 0.75rem;
}

.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-avatar[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .floating-nav {
    width: calc(100% - 22px);
    justify-content: space-between;
    padding: 10px 8px;
  }

  .nav-item {
    flex: 1;
    min-width: 0;
    font-size: 0.65rem;
  }
}

.browser-page {
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 320px;
  padding: 18px;
}

.browser-window {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--player-bg);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.browser-tab-strip,
.browser-toolbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
}

.browser-tab-strip {
  min-height: 48px;
  border-bottom: 1px solid var(--border);
}

.browser-tabs {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.browser-tab {
  display: flex;
  width: min(230px, 42vw);
  min-width: 112px;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.browser-tab.is-active {
  border-color: var(--border);
  background: var(--surface-raised);
}

.browser-tab-select,
.browser-tab-close,
.browser-new-tab,
.browser-navigation button,
.browser-address-form button,
.browser-actions a,
.browser-actions button {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--control-text);
  cursor: pointer;
  font: inherit;
}

.browser-tab-select {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  text-align: left;
}

.browser-tab-title {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-tab-favicon,
.browser-address-form img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: cover;
}

.browser-tab-close,
.browser-new-tab,
.browser-navigation button,
.browser-address-form button,
.browser-actions a,
.browser-actions button {
  width: 34px;
  height: 34px;
}

.browser-tab-close {
  width: 26px;
  height: 26px;
}

.browser-tab-close,
.browser-navigation button,
.browser-actions a,
.browser-actions button,
.browser-address-form button {
  font-size: 0.82rem;
}

.browser-tab-close:hover,
.browser-new-tab:hover,
.browser-navigation button:not(:disabled):hover,
.browser-address-form button:hover,
.browser-actions a:hover,
.browser-actions button:hover {
  background: var(--hover);
  color: var(--focus);
}

.browser-navigation,
.browser-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
}

.browser-navigation button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.5;
}

.browser-address-form {
  display: flex;
  min-width: 0;
  min-height: 38px;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--input-bg);
}

.browser-address-form:focus-within {
  border-color: var(--border-hover);
  outline: 2px solid color-mix(in srgb, var(--focus) 25%, transparent);
}

.browser-address-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.browser-address-form input::placeholder {
  color: var(--muted);
}

.browser-viewport {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--player-bg);
}

.browser-start {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: clamp(40px, 10vh, 100px) 20px 30px;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
}
.browser-start[hidden] { display: none; }
.browser-start > img { width: 58px; height: 58px; object-fit: contain; }
.browser-start h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.2rem); }
.browser-start-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(580px, 100%);
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--input-bg);
}
.browser-start-search:focus-within { outline: 2px solid var(--focus); }
.browser-start-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.browser-start-search button,
.browser-shortcuts button {
  border: 0;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.browser-start-search button { padding: 8px 14px; border-radius: 999px; background: var(--surface-raised); }
.browser-shortcuts { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.browser-shortcut-list { display: contents; }
.browser-shortcut { position: relative; }
.browser-shortcuts button {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 76px;
  padding: 10px;
  border-radius: 12px;
  background: transparent;
  font-size: 0.8rem;
}
.browser-shortcuts button:hover { background: var(--hover); }
.browser-shortcuts i,
.browser-shortcuts .browser-shortcut-image {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-raised);
  font-size: 1rem;
}
.browser-shortcuts .browser-shortcut-image { object-fit: cover; }
.browser-shortcuts .browser-shortcut-remove {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  min-width: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-raised);
  font-size: 0.9rem;
}
.browser-shortcuts .browser-shortcut-remove i {
  width: auto;
  height: auto;
  background: transparent;
  font-size: inherit;
}
.browser-shortcut-status { margin: 0; color: var(--status-error); font-size: 0.85rem; }
.browser-shortcut-status:empty { display: none; }
.browser-shortcut-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
}
.browser-shortcut-dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.browser-shortcut-dialog h2 { margin: 0; }
.browser-shortcut-dialog input {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.browser-status {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  background: var(--player-bg);
  color: var(--muted);
  text-align: center;
}

.browser-status[hidden],
.browser-frame[hidden] {
  display: none;
}

.browser-frames,
.browser-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.browser-frame {
  display: block;
  border: 0;
  background: var(--player-bg);
}

.browser-frame:fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.browser-tab-select:focus-visible,
.browser-tab-close:focus-visible,
.browser-new-tab:focus-visible,
.browser-navigation button:focus-visible,
.browser-address-form button:focus-visible,
.browser-actions a:focus-visible,
.browser-actions button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .browser-page {
    padding: 8px;
  }

  .browser-toolbar {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
  }

  .browser-address-form {
    order: 1;
    flex-basis: 100%;
  }

  .browser-navigation {
    margin-right: auto;
  }

  .browser-tab {
    width: min(190px, 55vw);
  }
}

.site-loading-screen {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease;
}

html:not(.site-loading) .site-loading-screen {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0s linear 0.2s;
}

.site-loading-content {
  display: grid;
  justify-items: center;
  gap: 16px;
  font-weight: 600;
}

.site-loading-content img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
}

.site-loading-content p {
  margin: 0;
  color: var(--muted);
}

.site-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--focus);
  border-radius: 50%;
  animation: site-loading-spin 0.8s linear infinite;
}

@keyframes site-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-loading-screen,
  html:not(.site-loading) .site-loading-screen {
    transition: none;
  }

  .site-loading-spinner {
    animation: none;
  }
}
