/* =========================================================
   css/components-late.css
   Non-critical UI split out of components.css.
   Loaded deferred (media="print" onload) so login / lobby first paint
   does not wait on profile, friends, DM, view-mode, or feedback styles.
   ========================================================= */

/* —— Profile open morph (from #circle-login-btn) —— */
/* GPU circle expand: transform scale only. Kill parallel overlayFadeIn. */
#prof-open-morph {
  position: fixed;
  z-index: 100001;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  border-radius: 50%;
  transform: translate3d(0,0,0) scale(1);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  backface-visibility: hidden;
  box-shadow: none;
  border: none;
  /* no contain:paint/strict — scaled circle must paint outside the 48px box */
}
#prof-open-morph.is-active {
  opacity: 1;
  visibility: visible;
}
/* While morphing / content reveal: solid theme fill; content opacity driven by --prof-open-content-opacity (JS progress). */
#profile-modal.modal-overlay.prof-opening,
#profile-modal.modal-overlay.prof-open-reveal {
  background: #000;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}
[data-theme="light"] #profile-modal.modal-overlay.prof-opening,
[data-theme="light"] #profile-modal.modal-overlay.prof-open-reveal {
  background: #f2f2f7;
}
/* Content+text stay invisible until progress fade; no CSS transition fight. */
#profile-modal.prof-opening .modal-window.prof-settings-window,
#profile-modal.prof-opening .prof-settings-window,
#profile-modal.prof-open-reveal .modal-window.prof-settings-window,
#profile-modal.prof-open-reveal .prof-settings-window {
  opacity: var(--prof-open-content-opacity, 0);
  transition: none !important;
}
html.gh-reduce-motion #prof-open-morph {
  display: none !important;
}

/* ==========================================
   個人中心 — iOS 黑白平面全螢幕（Settings）
   Desktop: 左 ~30% 欄目 / 右 ~70% 設定
   Mobile: 全頁欄目 → 詳情右入；返回右出
   ========================================== */
#profile-modal.modal-overlay {
  align-items: stretch;
  justify-content: stretch;
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Never run generic overlayFadeIn — fights open morph / looks like old fade */
  animation: none !important;
  padding: 0;
  /* Bound viewport so inner panes can scroll (body may be overflow:hidden) */
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
#profile-modal .modal-window.prof-settings-window,
#profile-modal .prof-settings-window {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: #000;
  color: #f5f5f7;
  box-shadow: none;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Override body.no-glass contain:paint which can clip inner scrollports */
  contain: none !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#profile-modal .prof-settings-window::before,
#profile-modal .prof-settings-window::after {
  display: none !important;
  content: none !important;
}

.prof-shell {
  display: flex;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: #000;
  min-height: 0;
  min-width: 0;
}

/* —— Menu / Sidebar —— */
.prof-pane-menu {
  display: flex;
  flex-direction: column;
  background: #000;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.prof-menu-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  min-height: 52px;
  border-bottom: 1px solid #1c1c1e;
  flex-shrink: 0;
}
.prof-menu-top h3 {
  margin: 0;
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f5f5f7;
}
.prof-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #1c1c1e;
  color: #f5f5f7;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.prof-close-btn:active { background: #2c2c2e; }

.prof-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 12px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  flex: 1 1 auto;
  min-height: 0;
}

.prof-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #f5f5f7;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  transition: background 0.15s ease;
  margin: 1px 0;
}
.prof-row:hover { background: #141414; }
.prof-row:active { background: #1c1c1e; }
.prof-row.active {
  background: #1c1c1e;
}
a.prof-row { text-decoration: none; color: inherit; box-sizing: border-box; }
.prof-row-static {
  cursor: default;
  background: #111;
  border: 1px solid #1c1c1e;
  border-radius: 12px;
  margin: 6px 0;
  padding: 14px;
}
.prof-row-static:hover { background: #111; }

.prof-row-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f5f5f7;
}
.prof-ico { display: block; }
.prof-row-label { flex: 1; font-weight: 560; letter-spacing: -0.01em; }
.prof-row-chevron {
  color: #636366;
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
}
.prof-row-help {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.45;
  font-weight: 400;
}

/* —— Detail pane —— */
.prof-pane-detail {
  display: flex;
  flex-direction: column;
  background: #000;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}
.prof-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px;
  min-height: 52px;
  border-bottom: 1px solid #1c1c1e;
  flex-shrink: 0;
}
.prof-nav h3 {
  margin: 0;
  flex: 1;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #f5f5f7;
  text-align: center;
}
.prof-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #1c1c1e;
  color: #f5f5f7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.prof-back-btn.hidden,
.prof-page.hidden,
.hidden { display: none !important; }
.prof-close-detail { margin-left: 0; }

/* Detail panes reuse .prof-menu-list as a stack — do NOT nest a second scrollport */
.prof-detail-scroll .prof-menu-list {
  flex: none;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
  overscroll-behavior: auto;
  touch-action: pan-y;
  padding: 0;
}
.prof-detail-scroll .prof-page {
  min-height: 0;
  touch-action: pan-y;
}
#prof-page-hub,
#prof-page-appearance,
#prof-page-privacy,
#prof-page-account,
#prof-page-stats,
#prof-page-overview,
#prof-page-wallet,
#prof-page-bind,
#prof-page-language,
#prof-page-about,
#prof-page-feedback,
#prof-page-gm,
#prof-page-updates,
#prof-page-terms,
#prof-page-devices,
#prof-page-notifications,
#prof-page-friends,
#prof-page-points,
#prof-page-audio,
#prof-page-accessibility,
#prof-page-storage,
#prof-page-advanced {
  touch-action: pan-y;
}

.prof-detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.prof-section { margin: 0 0 22px 0; }
.prof-section-title {
  margin: 0 0 10px 0;
  color: #8e8e93;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
}

.prof-overview-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #1c1c1e;
  background: #111;
  margin-bottom: 14px;
}
.prof-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #2c2c2e;
  background: #1c1c1e;
  cursor: pointer;
  flex-shrink: 0;
}
.prof-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.prof-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8e8e93;
}
.prof-avatar-placeholder .prof-row-icon { width: 36px; height: 36px; }
.prof-avatar-placeholder .prof-ico { width: 36px; height: 36px; }
.prof-avatar-img.hidden,
.prof-avatar-placeholder.hidden { display: none !important; }
.prof-avatar-edit {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 3px 0;
}
.prof-overview-meta { flex: 1; min-width: 0; }
.prof-username {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  word-break: break-all;
  color: #f5f5f7;
}
.prof-points-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #2c2c2e;
  background: #1c1c1e;
  color: #f5f5f7;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 650;
}
.prof-points-val { color: #fff; }
.prof-link-btn {
  display: block;
  margin-top: 8px;
  background: transparent;
  border: none;
  color: #8e8e93;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.prof-points-hint {
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.55;
  margin: 4px 2px 0;
}

/* Form controls inside profile: flat B/W */
#profile-modal .prof-settings-window input[type="text"],
#profile-modal .prof-settings-window input[type="password"],
#profile-modal .prof-settings-window input[type="number"],
#profile-modal .prof-detail-scroll input[type="text"],
#profile-modal .prof-detail-scroll input[type="password"],
#profile-modal .prof-detail-scroll input[type="number"] {
  background: #111 !important;
  border: 1px solid #2c2c2e !important;
  color: #f5f5f7 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
/* Profile / feedback: neutralize global .btn iOS-blue (--primary #0a84ff) */
#profile-modal .btn,
#feedback-inbox-modal .btn {
  border-radius: 10px;
  background: #3a3a3c !important;
  border: 1px solid #636366 !important;
  color: #f5f5f7 !important;
  box-shadow: none !important;
  filter: none !important;
}
#profile-modal .btn:hover,
#feedback-inbox-modal .btn:hover {
  background: #48484a !important;
  border-color: #8e8e93 !important;
  box-shadow: none !important;
  filter: brightness(1.05) !important;
}
#profile-modal .btn:active,
#feedback-inbox-modal .btn:active {
  background: #2c2c2e !important;
  box-shadow: none !important;
  filter: brightness(0.96) !important;
}
#profile-modal .btn:disabled,
#feedback-inbox-modal .btn:disabled {
  background: #1c1c1e !important;
  border-color: #2c2c2e !important;
  color: #636366 !important;
  box-shadow: none !important;
  filter: none !important;
}
[data-theme="light"] #profile-modal .btn,
[data-theme="light"] #feedback-inbox-modal .btn {
  background: #2c2c2e !important;
  border-color: #1d1d1f !important;
  color: #f5f5f7 !important;
}
[data-theme="light"] #profile-modal .btn:hover,
[data-theme="light"] #feedback-inbox-modal .btn:hover {
  background: #3a3a3c !important;
  border-color: #1d1d1f !important;
}
[data-theme="light"] #profile-modal .btn:active,
[data-theme="light"] #feedback-inbox-modal .btn:active {
  background: #1c1c1e !important;
}
/* Keep danger / muted logout accents (terracotta) over the stone fill */
#profile-modal #lan-logout-btn,
#profile-modal #prof-withdraw-consent-btn,
#profile-modal button[onclick="executeDeleteAccount()"] {
  background: rgba(138, 112, 96, 0.16) !important;
  border: 1px solid #8a7060 !important;
  color: #c4a090 !important;
}
[data-theme="light"] #profile-modal #lan-logout-btn,
[data-theme="light"] #profile-modal #prof-withdraw-consent-btn,
[data-theme="light"] #profile-modal button[onclick="executeDeleteAccount()"] {
  background: rgba(154, 107, 92, 0.12) !important;
  border-color: #a87868 !important;
  color: #7a5648 !important;
}

/* Hide legacy absolute close if any leftover */
#profile-modal > .modal-window > .close-btn { display: none !important; }

/* —— Mobile: push / pop from the right —— */
@media (max-width: 899px) {
  .prof-shell { display: block; }
  .prof-pane-menu,
  .prof-pane-detail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }
  .prof-pane-menu {
    transform: translateX(0);
  }
  .prof-pane-detail {
    transform: translateX(100%);
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
  }
  #profile-modal.prof-detail-open .prof-pane-detail {
    transform: translateX(0);
  }
  .prof-close-detail { display: none !important; }
  .prof-nav h3 { text-align: left; }
}

/* —— Large screens: ~30% / ~70% split —— */
@media (min-width: 900px) {
  .prof-pane-menu {
    width: 30%;
    max-width: 360px;
    flex: 0 0 30%;
    border-right: 1px solid #1c1c1e;
    height: 100%;
  }
  .prof-pane-detail {
    flex: 1 1 70%;
    width: 70%;
    height: 100%;
    transform: none !important;
  }
  .prof-back-btn { display: none !important; }
  .prof-nav h3 { text-align: left; padding-left: 4px; }
  .prof-close-detail { display: none !important; } /* menu has close */
  .prof-row-chevron { display: none; } /* desktop sidebar: no chevron */
  .prof-avatar-wrap { width: 96px; height: 96px; }
}

@media (min-width: 1280px) {
  .prof-pane-menu { max-width: 400px; }
  .prof-avatar-wrap { width: 112px; height: 112px; }
}


/* —— Profile light mode (明亮模式) —— */
[data-theme="light"] #profile-modal.modal-overlay {
  background: #f2f2f7;
}
[data-theme="light"] #profile-modal .modal-window.prof-settings-window,
[data-theme="light"] #profile-modal .prof-settings-window {
  background: #f2f2f7;
  color: #1d1d1f;
}
[data-theme="light"] .prof-shell,
[data-theme="light"] .prof-pane-menu,
[data-theme="light"] .prof-pane-detail {
  background: #f2f2f7;
}
[data-theme="light"] .prof-menu-top,
[data-theme="light"] .prof-nav {
  border-bottom-color: #d1d1d6;
}
[data-theme="light"] .prof-menu-top h3,
[data-theme="light"] .prof-nav h3,
[data-theme="light"] .prof-row,
[data-theme="light"] .prof-username,
[data-theme="light"] .prof-row-label,
[data-theme="light"] .prof-row-icon,
[data-theme="light"] .prof-points-btn,
[data-theme="light"] .prof-points-val {
  color: #1d1d1f;
}
[data-theme="light"] .prof-close-btn,
[data-theme="light"] .prof-back-btn {
  background: #e5e5ea;
  color: #1d1d1f;
}
[data-theme="light"] .prof-close-btn:active,
[data-theme="light"] .prof-back-btn:active { background: #d1d1d6; }
[data-theme="light"] .prof-row:hover { background: #e8e8ed; }
[data-theme="light"] .prof-row:active,
[data-theme="light"] .prof-row.active { background: #e5e5ea; }
[data-theme="light"] .prof-row-static {
  background: #ffffff;
  border-color: #d1d1d6;
}
[data-theme="light"] .prof-row-static:hover { background: #ffffff; }
[data-theme="light"] .prof-row-chevron { color: #8e8e93; }
[data-theme="light"] .prof-row-help,
[data-theme="light"] .prof-section-title,
[data-theme="light"] .prof-points-hint,
[data-theme="light"] .prof-link-btn {
  color: #6e6e73;
}
[data-theme="light"] .prof-overview-card {
  background: #ffffff;
  border-color: #d1d1d6;
}
[data-theme="light"] .prof-avatar-wrap {
  background: #e5e5ea;
  border-color: #c7c7cc;
}
[data-theme="light"] .prof-avatar-placeholder { color: #8e8e93; }
[data-theme="light"] .prof-avatar-edit {
  background: rgba(255,255,255,0.85);
  color: #1d1d1f;
}
[data-theme="light"] .prof-points-btn {
  background: #e5e5ea;
  border-color: #c7c7cc;
  color: #1d1d1f;
}
[data-theme="light"] #profile-modal .prof-settings-window input[type="text"],
[data-theme="light"] #profile-modal .prof-settings-window input[type="password"],
[data-theme="light"] #profile-modal .prof-settings-window input[type="number"],
[data-theme="light"] #profile-modal .prof-detail-scroll input[type="text"],
[data-theme="light"] #profile-modal .prof-detail-scroll input[type="password"],
[data-theme="light"] #profile-modal .prof-detail-scroll input[type="number"] {
  background: #ffffff !important;
  border: 1px solid #c7c7cc !important;
  color: #1d1d1f !important;
}
@media (min-width: 900px) {
  [data-theme="light"] .prof-pane-menu {
    border-right-color: #d1d1d6;
  }
}

.prof-empty-state {
  padding: 28px 16px;
  border-radius: 14px;
  border: 1px solid #1c1c1e;
  background: #111;
  text-align: center;
}
.prof-empty-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #f5f5f7;
}
.prof-empty-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #8e8e93;
}
[data-theme="light"] .prof-empty-state {
  background: #ffffff;
  border-color: #d1d1d6;
}
[data-theme="light"] .prof-empty-title { color: #1d1d1f; }
[data-theme="light"] .prof-empty-body { color: #6e6e73; }


.player-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.35);
  vertical-align: middle;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.player-avatar.sm { width: 26px; height: 26px; }
.player-avatar.lg { width: 48px; height: 48px; }
.player-avatar.xl { width: 64px; height: 64px; border-width: 2px; }

.lobby-welcome-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.lobby-welcome-row .player-avatar {
  width: 36px; height: 36px;
}
.host-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 6px 4px;
}
.host-player-row .host-player-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 650;
}
.host-player-row .host-player-left .player-avatar {
  width: 36px; height: 36px;
}

@media (min-width: 900px) {
  .player-avatar { width: 40px; height: 40px; }
  .player-avatar.sm { width: 32px; height: 32px; }
  .player-avatar.lg { width: 56px; height: 56px; }
  .player-avatar.xl { width: 80px; height: 80px; }
  .lobby-welcome-row .player-avatar,
  .host-player-row .host-player-left .player-avatar { width: 48px; height: 48px; }
  .friend-dm-avatar { width: 44px !important; height: 44px !important; }
  .prof-avatar-wrap { width: 96px; height: 96px; }
  .prof-avatar-placeholder { font-size: 42px; }
  #circle-login-btn.has-avatar,
  #circle-login-btn {
    width: 64px;
    height: 64px;
  }
  #friend-circle-btn { width: 64px; height: 64px; font-size: 24px; }
  #cm-scoreboard .player-avatar { width: 36px; height: 36px; }
}

@media (min-width: 1280px) {
  .player-avatar { width: 46px; height: 46px; }
  .player-avatar.sm { width: 36px; height: 36px; }
  .player-avatar.lg { width: 64px; height: 64px; }
  .player-avatar.xl { width: 96px; height: 96px; }
  .lobby-welcome-row .player-avatar,
  .host-player-row .host-player-left .player-avatar { width: 56px; height: 56px; }
  .prof-avatar-wrap { width: 112px; height: 112px; }
  #circle-login-btn.has-avatar,
  #circle-login-btn,
  #friend-circle-btn {
    width: 72px;
    height: 72px;
  }
}

.friend-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--glass-border);
}
.friend-item:last-child { border-bottom: none; }
.friend-item-main { flex: 1; min-width: 0; }
.friend-item-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.friend-name { font-weight: 700; font-size: 14px; }
.friend-status {
  font-size: 10px; padding: 2px 6px; border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.friend-status.online {
  color: #34c759; border-color: rgba(52,199,89,0.4);
  background: rgba(52,199,89,0.08);
}
.friend-status.offline { opacity: 0.7; }
.friend-snippet {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.friend-actions {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.friend-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.2;
}
.friend-chip.danger { color: #ff3b30; border-color: rgba(255,59,48,0.45); }
.friend-unread {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30; color: #fff;
  font-size: 10px; font-weight: 700;
}
/* legacy header hooks kept as aliases — real layout below in friend-dm shell */
.friend-dm-header {
  display: flex; align-items: center; gap: 10px;
}
.friend-dm-title-wrap {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.friend-dm-avatar { width: 36px !important; height: 36px !important; border-radius: 50%; }
.friend-dm-compose { display: flex; gap: 8px; align-items: center; }
.friend-dm-compose input { margin: 0; }
.friend-req-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px; border-bottom: 1px solid var(--glass-border);
}
.lobby-welcome-row {
  display: inline-flex; align-items: center; gap: 8px;
  justify-content: center; flex-wrap: wrap;
}


.prof-points-balance { font-size: 14px; margin: 0 0 4px; color: var(--text-muted); }
.prof-history-list {
  max-height: min(50vh, 320px);
  overflow-y: auto;
  padding: 4px 0;
  border-radius: 10px;
}
.prof-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  font-size: 13px;
}
.prof-history-msg { text-align: left; color: var(--text-main, #fff); flex: 1; }
.prof-history-chg { font-weight: 700; font-variant-numeric: tabular-nums; }
.prof-history-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.prof-update-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.08));
}
.prof-update-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.prof-update-deploy {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary, #00ff9d);
  font-size: 12px;
  line-height: 1.35;
}
.prof-update-commit {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.9;
}
.prof-update-note {
  color: var(--text-main, #fff);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}


/* ---- Avatar crop overlay ---- */
.avatar-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.avatar-crop-panel {
  width: min(360px, 100%);
  background: rgba(22, 24, 32, 0.96);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.15));
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  color: #fff;
}
.avatar-crop-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}
.avatar-crop-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0c;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.avatar-crop-viewport:active { cursor: grabbing; }
.avatar-crop-img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform-origin: center center;
  pointer-events: none;
  will-change: transform;
}
.avatar-crop-frame {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(245, 245, 247, 0.55);
  pointer-events: none;
}
.avatar-crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px;
  font-size: 13px;
  opacity: 0.9;
}
.avatar-crop-zoom-row input[type="range"] {
  flex: 1;
  accent-color: #8e8e93;
}
.avatar-crop-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.avatar-crop-btn {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.avatar-crop-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.avatar-crop-btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}
.avatar-crop-btn.primary {
  background: #3a3a3c;
  color: #f5f5f7;
  border-color: #636366;
}


/* Cloud prefs toggle (綁定帳號) */
.prof-row-cloud-prefs {
  align-items: flex-start;
  gap: 14px;
}
.prof-row-cloud-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prof-row-help {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted, #9a9a9a);
  font-weight: 400;
}
.gh-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.gh-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.gh-switch-slider {
  position: absolute;
  inset: 0;
  background: #2c2c2e;
  border: 1.5px solid #8e8e93;
  border-radius: 999px;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s;
}
.gh-switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 50%;
  margin-top: -10px;
  border-radius: 50%;
  background: #f5f5f7;
  border: 1.5px solid #aeaeb2;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.gh-switch input:checked + .gh-switch-slider {
  background: #3a3a3c;
  border-color: #d1d1d6;
}
.gh-switch input:checked + .gh-switch-slider::before {
  transform: translateX(18px);
  background: #f5f5f7;
  border-color: #f5f5f7;
}
body.no-glass .gh-switch-slider {
  background: #2a2a2a;
  border: 1.5px solid #8e8e93;
}



/* =========================================================
   觀賞模式 (View Mode) - 極簡純觀賞
   ========================================================= */
.view-mode-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
.view-mode-overlay[hidden] { display: none !important; }
.view-mode-overlay > * { pointer-events: auto; }

.vm-highlights {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.vm-highlight-marker {
  position: absolute;
  pointer-events: none;
  background: rgba(0, 200, 255, 0.18);
  border: 1px solid rgba(0, 200, 255, 0.7);
  border-radius: 10px;
  color: #00c8ff;
  font-size: 12px;
  padding: 4px 8px;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.35);
  transform: translate(-50%, -120%);
  text-shadow: 0 1px 2px #000;
}

.vm-back-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.4s ease, transform 0.3s;
}
.vm-back-btn.vm-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.vm-glass-obj {
  position: absolute;
  width: 180px;
  height: 180px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 18px;
  box-shadow: var(--glass-inner-glow), 0 8px 32px rgba(0,0,0,0.25);
  cursor: grab;
  touch-action: none;
  z-index: 5;
  transition: width 0.15s, height 0.15s, border-radius 0.2s, clip-path 0.2s, backdrop-filter 0.15s;
}
.vm-glass-obj:active { cursor: grabbing; }
.vm-glass-obj.shape-square { border-radius: 18px; clip-path: none; }
.vm-glass-obj.shape-circle { border-radius: 50%; clip-path: none; }
.vm-glass-obj.shape-star {
  border-radius: 0;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.vm-glass-obj.shape-heart {
  border-radius: 0;
  clip-path: path("M50,30 C50,15 30,5 20,20 C10,35 25,50 50,75 C75,50 90,35 80,20 C70,5 50,15 50,30 Z");
  /* fallback approximate if path not supported */
  clip-path: polygon(50% 25%, 20% 10%, 5% 30%, 15% 55%, 50% 85%, 85% 55%, 95% 30%, 80% 10%);
}

.vm-adjust-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(20,20,24,0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.35s cubic-bezier(0.2,0.8,0.2,1), opacity 0.3s;
}
.vm-adjust-bar.vm-collapsed {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
.vm-bar-collapse {
  align-self: center;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 12px;
  padding: 4px 16px;
  font-size: 12px;
}
.vm-bar-content {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 13px;
  color: #eee;
}
.vm-bar-content label { display: flex; align-items: center; gap: 6px; }
.vm-bar-content input[type=range] { width: 90px; }
.vm-shapes { display: flex; gap: 6px; }
.vm-shape-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
}
.vm-shape-btn.active {
  background: rgba(0,200,255,0.3);
  border-color: #00c8ff;
  color: #00c8ff;
}

.vm-expand-btn {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 16px;
  padding: 6px 18px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.4s;
}
.vm-expand-btn.vm-hidden, .vm-expand-btn[hidden] {
  opacity: 0;
  pointer-events: none;
}


/* 觀賞模式：隱藏原有大廳 UI（須蓋過 .active-view { display:flex !important }） */
body.vm-active #portal-home,
body.vm-active #portal-home.portal-home,
body.vm-active #portal-home.portal-home.active-view,
body.vm-active #hv-main,
body.vm-active #hv-main.active-view,
body.vm-active #gate-view,
body.vm-active #gate-view.active-view,
body.vm-active #wusper-desktop,
body.vm-active .login-gate-wrapper,
body.vm-active .login-gate-wrapper.active-view,
body.vm-active #login-gate,
body.vm-active #login-gate.active-view,
body.vm-active #system-controls,
body.vm-active #circle-buttons,
body.vm-active .circle-btn,
body.vm-active .sidebar,
body.vm-active .chat-area,
body.vm-active .hv-mode-howto,
body.vm-active #hv-mode-howto,
body.vm-active #hv-mode-howto.active-view,
body.vm-active .card-center.active-view {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
/* overlay 本體不攔截風景；互動交給子元件 */
body.vm-active .view-mode-overlay {
  pointer-events: none;
}
body.vm-active .view-mode-overlay .vm-back-btn,
body.vm-active .view-mode-overlay .vm-glass-obj,
body.vm-active .view-mode-overlay .vm-adjust-bar,
body.vm-active .view-mode-overlay .vm-expand-btn {
  pointer-events: auto;
}


/* —— 意見回饋 / GM 反饋處理 —— */
.prof-fb-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 14px;
}
.prof-fb-type {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  color: #f5f5f7;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}
.prof-fb-type:has(input:checked) {
  border-color: #f5f5f7;
  background: #2c2c2e;
}
.prof-fb-type input {
  accent-color: #f5f5f7;
  width: 18px;
  height: 18px;
  margin: 0;
}
.prof-fb-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 140px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #2c2c2e;
  background: #1c1c1e;
  color: #f5f5f7;
  font-size: 15px;
  line-height: 1.45;
  font-family: inherit;
}
.prof-fb-textarea:focus {
  outline: none;
  border-color: #8e8e93;
}
.prof-fb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.prof-fb-count {
  font-size: 13px;
  color: #8e8e93;
}
.prof-fb-submit {
  min-width: 96px;
  margin: 0;
}
.prof-gm-fb-btn {
  position: relative;
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
}
.prof-badge-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a87868;
  box-shadow: 0 0 0 2px #000;
  pointer-events: none;
}
.prof-badge-dot.hidden { display: none !important; }
#circle-login-btn {
  overflow: visible;
}
.circle-login-fb-dot {
  top: 2px;
  right: 2px;
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.55);
}

#feedback-inbox-modal.modal-overlay {
  align-items: stretch;
  justify-content: stretch;
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  z-index: 260000;
}
#feedback-inbox-modal.modal-overlay.show {
  display: flex !important;
  opacity: 1 !important;
}
/* Inbox is fullscreen (not split-pane): never hide its top-left back, even on ≥900px */
#feedback-inbox-modal .prof-back-btn,
#feedback-inbox-modal .fb-inbox-back {
  display: inline-flex !important;
  pointer-events: auto;
  z-index: 2;
  position: relative;
}

#feedback-inbox-modal .fb-inbox-window {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  color: #f5f5f7;
  display: flex;
  flex-direction: column;
  border: none;
  box-shadow: none;
}
.fb-inbox-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  border-bottom: 1px solid #1c1c1e;
  flex-shrink: 0;
}
.fb-inbox-nav h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}
.fb-inbox-counts {
  font-size: 13px;
  color: #8e8e93;
  white-space: nowrap;
}
.fb-inbox-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fb-card {
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  border-radius: 14px;
  padding: 14px;
  color: #f5f5f7;
}
.fb-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #8e8e93;
}
.fb-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #3a3a3c;
  color: #f5f5f7;
  font-size: 12px;
}
.fb-card-body {
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 12px;
}
.fb-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fb-card-actions .btn {
  margin: 0;
  flex: 1 1 auto;
  min-width: 64px;
  padding: 8px 10px;
  font-size: 13px;
}
.fb-card-reply {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2c2c2e;
  font-size: 13px;
  color: #aeaeb2;
  white-space: pre-wrap;
  word-break: break-word;
}
.fb-inbox-empty {
  text-align: center;
  color: #8e8e93;
  padding: 48px 12px;
  font-size: 15px;
}
.fb-reply-sheet {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 3;
  padding: 16px;
}
.fb-reply-sheet.hidden { display: none !important; }
.fb-reply-sheet-inner {
  width: 100%;
  max-width: 560px;
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  border-radius: 16px;
  padding: 16px;
}
.fb-reply-sheet-inner h4 {
  margin: 0 0 8px;
  font-size: 17px;
}

[data-theme="light"] .prof-fb-type {
  background: #f2f2f7;
  border-color: #d1d1d6;
  color: #1d1d1f;
}
[data-theme="light"] .prof-fb-type:has(input:checked) {
  border-color: #1d1d1f;
  background: #e5e5ea;
}
[data-theme="light"] .prof-fb-textarea {
  background: #fff;
  border-color: #d1d1d6;
  color: #1d1d1f;
}
[data-theme="light"] .prof-fb-count,
[data-theme="light"] .fb-inbox-counts,
[data-theme="light"] .fb-inbox-empty { color: #6e6e73; }
[data-theme="light"] #feedback-inbox-modal.modal-overlay,
[data-theme="light"] #feedback-inbox-modal .fb-inbox-window { background: #f2f2f7; color: #1d1d1f; }
[data-theme="light"] .fb-inbox-nav { border-bottom-color: #d1d1d6; }
[data-theme="light"] .fb-card {
  background: #fff;
  border-color: #d1d1d6;
  color: #1d1d1f;
}
[data-theme="light"] .fb-card-tag { border-color: #c7c7cc; color: #1d1d1f; }
[data-theme="light"] .fb-card-reply { border-top-color: #e5e5ea; color: #6e6e73; }
[data-theme="light"] .fb-reply-sheet-inner {
  background: #fff;
  border-color: #d1d1d6;
}
[data-theme="light"] .prof-badge-dot { box-shadow: 0 0 0 2px #f2f2f7; }


/* —— 個人中心好友：橫向長方卡片 —— */
.prof-friend-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.prof-friend-add-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #2c2c2e;
  background: #1c1c1e;
  color: #f5f5f7;
  font-size: 15px;
  font-family: inherit;
}
.prof-friend-add-input:focus {
  outline: none;
  border-color: #8e8e93;
}
.prof-friend-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.prof-friend-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #1c1c1e;
  border: none;
  box-shadow: none;
  color: #f5f5f7;
}
.prof-friend-card .player-avatar,
.prof-friend-card img.player-avatar {
  width: 44px !important;
  height: 44px !important;
  flex-shrink: 0;
  border-radius: 50%;
}
.prof-friend-card-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prof-friend-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.prof-friend-card-name {
  font-weight: 650;
  font-size: 15px;
  color: #f5f5f7;
}
.prof-friend-card-snippet {
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prof-friend-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.prof-friend-card-actions .friend-chip,
.prof-friend-card-actions .btn {
  margin: 0;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #2c2c2e;
  border: 1px solid #3a3a3c;
  color: #f5f5f7;
  cursor: pointer;
}
.prof-friend-card-actions .friend-chip.danger {
  color: #c4a090;
  border-color: rgba(138,112,96,0.65);
}
.prof-friend-empty {
  padding: 18px 12px;
  text-align: center;
  color: #8e8e93;
  font-size: 14px;
  border-radius: 14px;
  border: none;
  background: transparent;
}
#prof-page-friends .friend-status {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #3a3a3c;
  color: #8e8e93;
}
#prof-page-friends .friend-status.online {
  color: #34c759;
  border-color: rgba(52,199,89,0.45);
  background: rgba(52,199,89,0.1);
}
[data-theme="light"] .prof-friend-add-input {
  background: #fff;
  border-color: #d1d1d6;
  color: #1d1d1f;
}
[data-theme="light"] .prof-friend-card {
  background: #fff;
  border: none;
  box-shadow: none;
  color: #1d1d1f;
}
[data-theme="light"] .prof-friend-card-name { color: #1d1d1f; }
[data-theme="light"] .prof-friend-card-snippet,
[data-theme="light"] .prof-friend-empty { color: #6e6e73; border: none; }
[data-theme="light"] .prof-friend-card-actions .friend-chip,
[data-theme="light"] .prof-friend-card-actions .btn {
  background: #f2f2f7;
  border-color: #d1d1d6;
  color: #1d1d1f;
}

/* Device & login cards — same flat horizontal style as friends */
.prof-device-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #3a3a3c;
  color: #8e8e93;
  flex-shrink: 0;
}
.prof-device-badge.current {
  color: #34c759;
  border-color: rgba(52,199,89,0.45);
  background: rgba(52,199,89,0.1);
}
.prof-device-meta {
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prof-device-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #2c2c2e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f5f5f7;
}
[data-theme="light"] .prof-device-badge {
  border-color: #d1d1d6;
  color: #6e6e73;
}
[data-theme="light"] .prof-device-badge.current {
  color: #248a3d;
  border-color: rgba(52,199,89,0.5);
  background: rgba(52,199,89,0.12);
}
[data-theme="light"] .prof-device-meta { color: #6e6e73; }
[data-theme="light"] .prof-device-ico {
  background: #f2f2f7;
  color: #1d1d1f;
}

/* —— 好友私訊：全螢幕 iOS 黑白扁平（對齊個人中心） —— */
#friend-modal.modal-overlay {
  align-items: stretch;
  justify-content: stretch;
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  /* Always layout height — never 100dvh (fights IME / visualViewport). */
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  z-index: 260000;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
  will-change: transform, opacity;
}
#friend-modal.modal-overlay.gh-kb-open .friend-dm-shell {
  transition: none !important;
  padding-bottom: var(--kb-inset, 0px);
}
/* Legacy native root pad only (html.wusper-native-ime / wusper-ime-resize):
   keep --kb-inset 0; do NOT double-pad. M139+ uses html.wusper-ime-webview + --kb-inset. */
html.wusper-native-ime #friend-modal.modal-overlay,
html.wusper-native-ime #friend-modal.modal-overlay.gh-kb-open,
html.wusper-ime-resize #friend-modal.modal-overlay,
html.wusper-ime-resize #friend-modal.modal-overlay.gh-kb-open {
  height: 100% !important;
  max-height: 100% !important;
}
html.wusper-native-ime #friend-modal .friend-dm-shell,
html.wusper-ime-resize #friend-modal .friend-dm-shell {
  padding-bottom: 0 !important;
  transition: none !important;
}
/* App M139+ WebView-owns (1.1.77/76): compositor lift via compose translate3d ONLY.
   Shell padding-bottom forced 0 — never layout thrash mid-IME. Browser keeps pad below.
   Later .friend-dm-compose rules must NOT override transform with padding fights. */
html.wusper-ime-webview #friend-modal.modal-overlay.gh-kb-open .friend-dm-shell,
html.wusper-ime-webview #friend-modal .friend-dm-shell {
  padding-bottom: 0 !important;
  transition: none !important;
}
html.wusper-ime-webview #friend-modal .friend-dm-compose,
html.wusper-ime-webview #friend-modal.gh-kb-open .friend-dm-compose,
html.wusper-ime-webview #friend-modal.modal-overlay .friend-dm-compose,
html.wusper-ime-webview #friend-modal.modal-overlay.gh-kb-open .friend-dm-compose {
  transform: translate3d(0, calc(-1 * var(--kb-inset, 0px)), 0) !important;
  will-change: transform;
  transition: none !important;
  /* Isolated compositor layer — avoid promoting height/padding. */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: layout style;
}
#friend-modal.modal-overlay.show {
  display: flex !important;
  opacity: 1 !important;
  transform: translateX(0);
}
#friend-modal.modal-overlay.show.gh-dm-exit {
  opacity: 0 !important;
  transform: translateX(100%);
  pointer-events: none;
}
#friend-modal .friend-dm-pane.gh-dm-pane-in {
  animation: ghDmPaneIn 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes ghDmPaneIn {
  from { transform: translateX(18%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #friend-modal.modal-overlay {
    transition: none !important;
    transform: none !important;
    opacity: 1;
  }
  #friend-modal .friend-dm-pane.gh-dm-pane-in {
    animation: none !important;
  }
}
body.gh-dm-open #unsplash-attr,
body.gh-dm-open #lobby-privacy-link,
body:has(#friend-modal.show) #unsplash-attr,
body:has(#friend-modal.show) #lobby-privacy-link {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
#friend-modal .prof-back-btn,
#friend-modal .friend-dm-close {
  display: inline-flex !important;
  pointer-events: auto;
  z-index: 2;
  position: relative;
}
#friend-modal .friend-dm-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  padding: 0;
  /* Browser: --kb-inset / VK env(). App M139+ zeros this (compose translateY). Legacy native-ime forces 0. */
  padding-bottom: var(--kb-inset, 0px);
  padding-bottom: env(keyboard-inset-height, var(--kb-inset, 0px));
  box-sizing: border-box;
  overflow: hidden;
  background: #000;
  color: #f5f5f7;
  display: flex;
  flex-direction: column;
  border: none;
  box-shadow: none;
  transition: none;
}
#friend-modal .friend-dm-pane {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#friend-modal .friend-dm-pane.hidden { display: none !important; }
.friend-dm-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  border-bottom: 1px solid #1c1c1e;
  flex-shrink: 0;
}
.friend-dm-nav h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-dm-nav-link {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #3a3a3c;
  background: #1c1c1e;
  color: #f5f5f7;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.friend-dm-title-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.friend-dm-title-text h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-dm-sub {
  font-size: 12px;
  color: #8e8e93;
}
.friend-dm-sub.is-online { color: #34c759; }

.friend-dm-conv-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 12px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.friend-dm-conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 10px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.friend-dm-conv-row:active,
.friend-dm-conv-row:focus-visible {
  background: #1c1c1e;
  outline: none;
}
.friend-dm-conv-row .player-avatar,
.friend-dm-conv-row img.player-avatar {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50%;
  flex-shrink: 0;
}
.friend-dm-conv-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.friend-dm-conv-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.friend-dm-conv-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 650;
  color: #f5f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-dm-conv-time {
  flex-shrink: 0;
  font-size: 12px;
  color: #8e8e93;
}
.friend-dm-conv-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.friend-dm-conv-snippet {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-dm-conv-snippet.has-unread {
  color: #f5f5f7;
  font-weight: 600;
}
.friend-dm-empty {
  padding: 48px 20px;
  text-align: center;
  color: #8e8e93;
  font-size: 14px;
  line-height: 1.5;
}
.friend-dm-empty strong {
  display: block;
  color: #f5f5f7;
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 8px;
}

.friend-dm-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #000;
}
.friend-dm-day {
  align-self: center;
  margin: 6px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1c1c1e;
  color: #8e8e93;
  font-size: 11px;
  font-weight: 600;
}
.friend-dm-bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 82%;
  width: fit-content;
}
.friend-dm-bubble.mine { align-self: flex-end; align-items: flex-end; }
.friend-dm-bubble.theirs { align-self: flex-start; align-items: flex-start; }
.friend-dm-bubble-body {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  border: none;
}
.friend-dm-bubble.mine .friend-dm-bubble-body {
  background: #2c2c2e;
  color: #f5f5f7;
  border-bottom-right-radius: 6px;
}
.friend-dm-bubble.theirs .friend-dm-bubble-body {
  background: #1c1c1e;
  color: #f5f5f7;
  border-bottom-left-radius: 6px;
}
.friend-dm-bubble-time {
  font-size: 11px;
  color: #8e8e93;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.friend-dm-bubble-clock { font-size: 11px; }
.friend-dm-status-dot {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 1em;
  height: 1em;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  color: #0a84ff; /* sent = blue */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.friend-dm-status-dot.is-pending,
.friend-dm-status-dot.is-failed { color: #ff3b30; }
.friend-dm-status-dot.is-sent { color: #0a84ff; }
.friend-dm-status-dot.is-read { color: #34c759; }
.friend-dm-status-tip {
  position: fixed;
  z-index: 400000;
  background: rgba(28, 28, 30, 0.94);
  color: #f5f5f7;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  white-space: nowrap;
}
[data-theme="light"] .friend-dm-status-tip {
  background: rgba(255,255,255,.96);
  color: #1d1d1f;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.friend-dm-msgs-empty {
  margin: auto;
  padding: 24px 16px;
  text-align: center;
  color: #8e8e93;
  font-size: 14px;
  line-height: 1.5;
}

.friend-dm-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #1c1c1e;
  background: #000;
}
/* Browser: drop home-indicator pad while keyboard open (avoid gap above IME). */
#friend-modal.gh-kb-open .friend-dm-compose {
  padding-bottom: 10px;
}
#friend-modal.gh-kb-open .friend-dm-msgs {
  padding-bottom: 12px;
}
/* Legacy native root pad: compose padding fixed. M139+ uses shell --kb-inset instead. */
html.wusper-native-ime #friend-modal .friend-dm-compose,
html.wusper-ime-resize #friend-modal .friend-dm-compose {
  padding-bottom: 10px;
}
/* 1.1.77/76: re-assert App compose transform AFTER base .friend-dm-compose padding rules. */
html.wusper-ime-webview #friend-modal .friend-dm-compose,
html.wusper-ime-webview #friend-modal.gh-kb-open .friend-dm-compose {
  transform: translate3d(0, calc(-1 * var(--kb-inset, 0px)), 0) !important;
  will-change: transform;
  transition: none !important;
}
.friend-dm-compose input,
.friend-dm-compose #friend-dm-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border-radius: 22px;
  border: 1px solid #2c2c2e;
  background: #1c1c1e;
  color: #f5f5f7;
  font-size: 15px;
  font-family: inherit;
}
.friend-dm-compose input:focus {
  outline: none;
  border-color: #8e8e93;
}
.friend-dm-send-btn,
#friend-dm-send-btn.friend-dm-send-btn {
  margin: 0;
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #3a3a3c;
  background: #f5f5f7;
  color: #000;
  font-size: 14px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.friend-dm-send-btn:active { opacity: 0.85; }

[data-theme="light"] #friend-modal.modal-overlay,
[data-theme="light"] #friend-modal .friend-dm-shell,
[data-theme="light"] .friend-dm-msgs,
[data-theme="light"] .friend-dm-compose {
  background: #f2f2f7;
  color: #1d1d1f;
}
[data-theme="light"] .friend-dm-nav {
  border-bottom-color: #d1d1d6;
}
[data-theme="light"] .friend-dm-nav-link {
  background: #fff;
  border-color: #d1d1d6;
  color: #1d1d1f;
}
[data-theme="light"] .friend-dm-conv-name { color: #1d1d1f; }
[data-theme="light"] .friend-dm-conv-time,
[data-theme="light"] .friend-dm-conv-snippet,
[data-theme="light"] .friend-dm-sub,
[data-theme="light"] .friend-dm-empty,
[data-theme="light"] .friend-dm-msgs-empty,
[data-theme="light"] .friend-dm-bubble-time {
  color: #6e6e73;
}
[data-theme="light"] .friend-dm-empty strong { color: #1d1d1f; }
[data-theme="light"] .friend-dm-conv-snippet.has-unread { color: #1d1d1f; }
[data-theme="light"] .friend-dm-conv-row:active,
[data-theme="light"] .friend-dm-conv-row:focus-visible {
  background: #fff;
}
[data-theme="light"] .friend-dm-day {
  background: #e5e5ea;
  color: #6e6e73;
}
[data-theme="light"] .friend-dm-bubble.mine .friend-dm-bubble-body {
  background: #1d1d1f;
  color: #fff;
}
[data-theme="light"] .friend-dm-bubble.theirs .friend-dm-bubble-body {
  background: #fff;
  color: #1d1d1f;
}
[data-theme="light"] .friend-dm-compose {
  border-top-color: #d1d1d6;
}
[data-theme="light"] .friend-dm-compose input,
[data-theme="light"] .friend-dm-compose #friend-dm-input {
  background: #fff;
  border-color: #d1d1d6;
  color: #1d1d1f;
}
[data-theme="light"] .friend-dm-send-btn,
[data-theme="light"] #friend-dm-send-btn.friend-dm-send-btn {
  background: #1d1d1f;
  color: #fff;
  border-color: #1d1d1f;
}



/* —— 個人中心通知：橫向長方卡片 —— */
.prof-notif-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #1c1c1e;
  border: none;
  box-shadow: none;
  color: #f5f5f7;
}
.prof-notif-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #2c2c2e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f5f5f7;
}
.prof-notif-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prof-notif-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.prof-notif-title {
  font-weight: 650;
  font-size: 15px;
  color: #f5f5f7;
}
.prof-notif-type {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #3a3a3c;
  color: #8e8e93;
  flex-shrink: 0;
}
.prof-notif-body {
  font-size: 13px;
  color: #aeaeb2;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.prof-notif-time {
  font-size: 12px;
  color: #8e8e93;
}
[data-theme="light"] .prof-notif-card {
  background: #fff;
  color: #1d1d1f;
}
[data-theme="light"] .prof-notif-ico {
  background: #f2f2f7;
  color: #1d1d1f;
}
[data-theme="light"] .prof-notif-title { color: #1d1d1f; }
[data-theme="light"] .prof-notif-type {
  border-color: #d1d1d6;
  color: #6e6e73;
}
[data-theme="light"] .prof-notif-body,
[data-theme="light"] .prof-notif-time { color: #6e6e73; }


/* Profile range / info polish */
#profile-modal .prof-range,
#profile-modal input.prof-range,
#profile-modal input[type="range"] {
  width: 100%;
  accent-color: #f5f5f7;
  height: 28px;
}
[data-theme="light"] #profile-modal .prof-range,
[data-theme="light"] #profile-modal input[type="range"] {
  accent-color: #1d1d1f;
}

/* Compact profile rows */
#profile-modal.prof-compact .prof-row,
#profile-modal.prof-compact .prof-row-static {
  padding-top: 10px;
  padding-bottom: 10px;
  margin-top: 3px;
  margin-bottom: 3px;
}
#profile-modal.prof-compact .prof-row-label { font-size: 15px; }
#profile-modal.prof-compact .prof-section { margin-bottom: 14px; }

/* Accessibility: site-wide (html.gh-* from personal center) */
html.gh-reduce-motion *,
html.gh-reduce-motion *::before,
html.gh-reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0ms !important;
}
html.gh-reduce-motion #profile-modal .prof-pane-detail,
html.gh-reduce-motion #profile-modal * {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
}
html.gh-reduce-motion #friend-modal.modal-overlay,
html.gh-reduce-motion #friend-modal .friend-dm-pane.gh-dm-pane-in,
html.gh-reduce-motion #cyber-toast,
html.gh-reduce-motion #prof-open-morph {
  transition: none !important;
  animation: none !important;
}

/* Larger text — lobby, profile, tools chrome, toasts */
html.gh-large-text {
  --gh-a11y-font-boost: 1.12;
  font-size: 112%;
}
html.gh-large-text #profile-modal .prof-row-label { font-size: 1.125rem; }
html.gh-large-text #profile-modal .prof-row-help { font-size: 0.875rem; }
html.gh-large-text #profile-modal .prof-section-title { font-size: 0.95rem; }
html.gh-large-text #profile-modal .prof-nav h3,
html.gh-large-text #profile-modal .prof-menu-top h3 { font-size: 1.2rem; }
html.gh-large-text #hv-main .hv-mode-section-title,
html.gh-large-text #hv-main .hv-mode-label,
html.gh-large-text .hub-menu-btn,
html.gh-large-text .btn,
html.gh-large-text #cyber-toast,
html.gh-large-text .system-controls,
html.gh-large-text .circle-btn { font-size: 1.08em; }

/* High contrast — borders / buttons / cards across shell */
html.gh-hi-contrast #profile-modal .prof-row-static,
html.gh-hi-contrast #profile-modal .prof-overview-card,
html.gh-hi-contrast #profile-modal .prof-empty-state,
html.gh-hi-contrast .hub-menu-btn,
html.gh-hi-contrast .btn,
html.gh-hi-contrast .modal-overlay .modal-card,
html.gh-hi-contrast #cyber-toast {
  border-color: #f5f5f7 !important;
  border-width: 2px !important;
  border-style: solid !important;
}
html.gh-hi-contrast[data-theme="light"] #profile-modal .prof-row-static,
html.gh-hi-contrast[data-theme="light"] #profile-modal .prof-overview-card,
html.gh-hi-contrast[data-theme="light"] #profile-modal .prof-empty-state,
html.gh-hi-contrast[data-theme="light"] .hub-menu-btn,
html.gh-hi-contrast[data-theme="light"] .btn,
html.gh-hi-contrast[data-theme="light"] .modal-overlay .modal-card {
  border-color: #1d1d1f !important;
}
html.gh-hi-contrast .hub-menu-btn,
html.gh-hi-contrast .btn,
html.gh-hi-contrast .gh-switch-slider {
  outline: 1px solid rgba(255,255,255,0.55);
}
html.gh-hi-contrast[data-theme="light"] .hub-menu-btn,
html.gh-hi-contrast[data-theme="light"] .btn {
  outline-color: rgba(0,0,0,0.55);
}
html.gh-hi-contrast {
  --text-muted: #c7c7cc;
}
html.gh-hi-contrast[data-theme="light"] {
  --text-muted: #3a3a3c;
}

/* Larger tap targets — profile + lobby + chrome */
html.gh-large-targets #profile-modal .prof-row,
html.gh-large-targets #profile-modal .prof-row-static {
  min-height: 52px;
  padding-top: 12px;
  padding-bottom: 12px;
}
html.gh-large-targets .hub-menu-btn,
html.gh-large-targets .btn,
html.gh-large-targets .circle-btn,
html.gh-large-targets .system-controls button {
  min-height: 44px;
  min-width: 44px;
  padding-left: 14px;
  padding-right: 14px;
}
html.gh-large-targets .gh-switch {
  transform: scale(1.12);
  transform-origin: right center;
}
html.gh-large-targets .hv-mode-label,
html.gh-large-targets [data-gate] {
  min-height: 44px;
}

/* Stronger focus ring — keyboard / AT */
html.gh-focus-ring *:focus-visible {
  outline: 3px solid #5ac8fa !important;
  outline-offset: 3px !important;
}
html.gh-focus-ring button:focus-visible,
html.gh-focus-ring a:focus-visible,
html.gh-focus-ring input:focus-visible,
html.gh-focus-ring select:focus-visible,
html.gh-focus-ring textarea:focus-visible,
html.gh-focus-ring [role="button"]:focus-visible,
html.gh-focus-ring .hub-menu-btn:focus-visible,
html.gh-focus-ring .gh-switch input:focus-visible + .gh-switch-slider {
  box-shadow: 0 0 0 3px rgba(90,200,250,0.45);
}
html.gh-focus-ring .gh-switch input:focus-visible + .gh-switch-slider {
  outline: 3px solid #5ac8fa;
  outline-offset: 2px;
}

/* Colorblind-safe cues — icons/patterns, not color alone */
html.gh-colorblind .hv-mode-section-title[data-group="action"]::before,
html.gh-colorblind .hv-mode-section[data-group="action"] .hv-mode-section-title::before {
  content: "◆ ";
}
html.gh-colorblind .hv-mode-section[data-group="classic"] .hv-mode-section-title::before {
  content: "○ ";
}
html.gh-colorblind .hv-mode-section[data-group="casual"] .hv-mode-section-title::before,
html.gh-colorblind .hv-mode-section[data-group="versus"] .hv-mode-section-title::before {
  content: "△ ";
}
html.gh-colorblind .friend-chip.danger,
html.gh-colorblind .btn.danger,
html.gh-colorblind [data-danger="1"] {
  text-decoration: underline;
  text-decoration-style: wavy;
}
html.gh-colorblind .gh-switch input:checked + .gh-switch-slider::after {
  content: "✓";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #fff;
}
html.gh-colorblind .online-dot,
html.gh-colorblind .friend-online,
html.gh-colorblind [data-online="1"]::before {
  box-shadow: inset 0 0 0 2px currentColor;
}
html.gh-colorblind .online-dot::after,
html.gh-colorblind [data-online="1"]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid currentColor;
  margin-left: 2px;
  vertical-align: middle;
}
html.gh-colorblind #cyber-toast.show {
  border-left: 4px solid #5ac8fa;
}

/* DM delivery status: glyph shapes, not color alone */
html.gh-colorblind .friend-dm-status-dot {
  font-size: 0;
  width: 1.1em;
  height: 1.1em;
}
html.gh-colorblind .friend-dm-status-dot::before {
  font-size: 12px;
  line-height: 1;
}
html.gh-colorblind .friend-dm-status-dot.is-pending::before,
html.gh-colorblind .friend-dm-status-dot.is-failed::before {
  content: "△";
}
html.gh-colorblind .friend-dm-status-dot.is-sent::before {
  content: "○";
}
html.gh-colorblind .friend-dm-status-dot.is-read::before {
  content: "●";
}
html.gh-colorblind .friend-dm-status-dot.is-pending,
html.gh-colorblind .friend-dm-status-dot.is-failed {
  text-decoration: underline wavy;
}
html.gh-colorblind #hub-timer {
  border-bottom: 2px dashed #5ac8fa;
  padding-bottom: 2px;
}
html.gh-colorblind #leave-hub-btn {
  border: 2px dashed currentColor;
  text-decoration: underline;
}
html.gh-colorblind .friend-chip:not(.danger)::after {
  content: "";
}
html.gh-hi-contrast .br-hud-text,
html.gh-hi-contrast #br-hud,
html.gh-hi-contrast #pl-status-text,
html.gh-hi-contrast #hub-timer,
html.gh-hi-contrast #leave-hub-btn {
  border-width: 2px !important;
  border-style: solid !important;
  border-color: #f5f5f7 !important;
}
html.gh-hi-contrast[data-theme="light"] .br-hud-text,
html.gh-hi-contrast[data-theme="light"] #br-hud,
html.gh-hi-contrast[data-theme="light"] #leave-hub-btn {
  border-color: #1d1d1f !important;
}


/* Readable spacing — letter/line spacing site-wide shell */
html.gh-readable-type #profile-modal,
html.gh-readable-type #hv-main,
html.gh-readable-type #portal-home,
html.gh-readable-type #login-gate,
html.gh-readable-type #cyber-toast,
html.gh-readable-type .modal-overlay {
  letter-spacing: 0.045em;
  line-height: 1.55;
  word-spacing: 0.06em;
}
html.gh-readable-type body {
  letter-spacing: 0.02em;
  line-height: 1.45;
}

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

/* Skip link (keyboard) when focus-ring a11y on */
html.gh-focus-ring #gh-skip-main {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 100000;
  padding: 8px 12px;
  background: #000;
  color: #fff;
  border-radius: 8px;
  transform: translateY(-120%);
  transition: transform 0.15s ease;
}
html.gh-focus-ring #gh-skip-main:focus {
  transform: translateY(0);
  outline: 3px solid #5ac8fa;
}

[data-theme="light"] #profile-modal .prof-range + .prof-row-help,
[data-theme="light"] #profile-modal #prof-bgm-vol-val,
[data-theme="light"] #profile-modal #prof-look-sens-val,
[data-theme="light"] #profile-modal #glass-blur-val {
  color: #6e6e73;
}


/* Profile: switches hug the far right; natural accents */
#profile-modal .prof-row-static {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
#profile-modal .prof-row-static > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
#profile-modal .prof-row-static > .gh-switch,
#profile-modal .prof-row-static > label.gh-switch,
#profile-modal .prof-row-static > .btn {
  margin-left: auto;
  flex-shrink: 0;
}
#profile-modal .gh-switch-slider {
  border: 1.5px solid #aeaeb2;
  background: #1c1c1e;
}
#profile-modal .gh-switch-slider::before {
  border: 1.5px solid #8e8e93;
}
#profile-modal .gh-switch input:checked + .gh-switch-slider {
  background: #48484a;
  border-color: #e5e5ea;
}
#profile-modal .gh-switch input:checked + .gh-switch-slider::before {
  border-color: #ffffff;
  background: #ffffff;
}
[data-theme="light"] #profile-modal .gh-switch-slider,
[data-theme="light"] .gh-switch-slider {
  background: #e5e5ea;
  border-color: #636366;
}
[data-theme="light"] #profile-modal .gh-switch-slider::before,
[data-theme="light"] .gh-switch-slider::before {
  background: #ffffff;
  border-color: #8e8e93;
}
[data-theme="light"] #profile-modal .gh-switch input:checked + .gh-switch-slider,
[data-theme="light"] .gh-switch input:checked + .gh-switch-slider {
  background: #3a3a3c;
  border-color: #1d1d1f;
}
[data-theme="light"] #profile-modal .gh-switch input:checked + .gh-switch-slider::before,
[data-theme="light"] .gh-switch input:checked + .gh-switch-slider::before {
  background: #f5f5f7;
  border-color: #f5f5f7;
}

/* Muted terracotta danger inside profile / inbox (not bright red) */
#profile-modal .friend-chip.danger,
#profile-modal .prof-friend-card-actions .friend-chip.danger,
#feedback-inbox-modal .friend-chip.danger {
  color: #c4a090 !important;
  border-color: rgba(138, 112, 96, 0.65) !important;
  background: rgba(138, 112, 96, 0.12) !important;
}
.prof-badge-dot {
  background: #a87868 !important;
}
[data-theme="light"] .prof-badge-dot {
  background: #9a6b5c !important;
  box-shadow: 0 0 0 2px #f2f2f7;
}
#profile-modal .prof-fb-submit,
#feedback-inbox-modal .prof-fb-submit,
#profile-modal .btn.prof-fb-submit {
  background: #3a3a3c !important;
  border: 1px solid #636366 !important;
  color: #f5f5f7 !important;
}
[data-theme="light"] #profile-modal .prof-fb-submit,
[data-theme="light"] #feedback-inbox-modal .prof-fb-submit {
  background: #2c2c2e !important;
  border-color: #1d1d1f !important;
  color: #f5f5f7 !important;
}
#feedback-inbox-modal .fb-card-actions .btn {
  background: #2c2c2e;
  border: 1px solid #3a3a3c;
  color: #f5f5f7;
}
[data-theme="light"] #feedback-inbox-modal .fb-card-actions .btn {
  background: #e5e5ea;
  border-color: #c7c7cc;
  color: #1d1d1f;
}
#profile-modal #bind-btn-microsoft {
  background: #1c1c1e !important;
  border: 1px solid #3a3a3c !important;
  color: #f5f5f7 !important;
}
[data-theme="light"] #profile-modal #lan-logout-btn,
[data-theme="light"] #profile-modal #prof-withdraw-consent-btn,
[data-theme="light"] #profile-modal button[onclick="executeDeleteAccount()"] {
  color: #7a5648 !important;
  border-color: #a87868 !important;
}


#profile-modal .friend-unread {
  background: #a87868;
  color: #f5f5f7;
}


/* Profile accent text: no leftover iOS blue from --primary */
#profile-modal .prof-accent,
#profile-modal h4.prof-accent,
#feedback-inbox-modal .prof-accent {
  color: #f5f5f7 !important;
}
[data-theme="light"] #profile-modal .prof-accent,
[data-theme="light"] #profile-modal h4.prof-accent,
[data-theme="light"] #feedback-inbox-modal .prof-accent {
  color: #1d1d1f !important;
}
#profile-modal .prof-gm-fb-btn {
  background: #3a3a3c !important;
  border: 1px solid #636366 !important;
  color: #f5f5f7 !important;
  box-shadow: none !important;
}
[data-theme="light"] #profile-modal .prof-gm-fb-btn {
  background: #2c2c2e !important;
  border-color: #1d1d1f !important;
  color: #f5f5f7 !important;
}
---

/* ==========================================
   Control-end split (a = touch, c = kbm)
   Tip sits lower-center so it cannot cover 左上角個人中心.
   ========================================== */
.wusper-control-end-tip {
    position: fixed;
    left: 50%;
    bottom: 18%;
    transform: translate(-50%, 12px);
    max-width: min(440px, 86vw);
    padding: 14px 22px;
    border-radius: 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    color: var(--toast-text);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    line-height: 1.45;
    z-index: 99990; /* below #circle-login-btn (99999) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}
.wusper-control-end-tip.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
/* c.: hide mobile on-screen pads / virtual keys (collapse, no blank hole) */
html.wusper-end-c .wusper-touch-only,
html.wusper-end-c #cm-joy-base,
html.wusper-end-c #cm-joy-knob,
html.wusper-end-c #cm-action-area,
html.wusper-end-c .cm-btn,
html.wusper-end-c #acxC-joy-base,
html.wusper-end-c #acxC-joy-knob,
html.wusper-end-c #acxC-action-area,
html.wusper-end-c .acxC-btn,
html.wusper-end-c [id^="pl-joy-"],
html.wusper-end-c #oi-touch-layer,
html.wusper-end-c #oi-btn-jump,
html.wusper-end-c #oi-btn-crouch,
html.wusper-end-c #oi-btn-place,
html.wusper-end-c #oi-btn-dig,
html.wusper-end-c #oi-touch-hint,
html.wusper-end-c #oi-layout-tip,
html.wusper-end-c #sw-joystick-area,
html.wusper-end-c #sw-joystick-base,
html.wusper-end-c #sw-joystick-knob,
html.wusper-end-c #sw-skill-1,
html.wusper-end-c #sw-skill-2,
html.wusper-end-c #bk-dpad,
html.wusper-end-c #btn-bk-left,
html.wusper-end-c #btn-bk-right,
html.wusper-end-c #btn-bk-down,
html.wusper-end-c #btn-bk-rotl,
html.wusper-end-c #btn-bk-rotr,
html.wusper-end-c #btn-bk-hard,
html.wusper-end-c #btn-bk-reset-pref,
html.wusper-end-c #s_pad,
html.wusper-end-c #s_act,
html.wusper-end-c #sdpad-up,
html.wusper-end-c #sdpad-down,
html.wusper-end-c #sdpad-left,
html.wusper-end-c #sdpad-right,
html.wusper-end-c #sdpad-center,
html.wusper-end-c #b_pad,
html.wusper-end-c #b_act,
html.wusper-end-c #dpad-up,
html.wusper-end-c #dpad-down,
html.wusper-end-c #dpad-left,
html.wusper-end-c #dpad-right,
html.wusper-end-c #dpad-center,
html.wusper-end-c #pls-pad-left,
html.wusper-end-c #pls-pad-right,
html.wusper-end-c .pls-pad,
html.wusper-end-c #ft-stick,
html.wusper-end-c #ft-stick-knob,
html.wusper-end-c #ft-controls .ft-move,
html.wusper-end-c #ft-controls button[data-btn],
html.wusper-end-c #parkour-pad,
html.wusper-end-c .pls-pads,
html.wusper-end-c .pls-stick-vis,
html.wusper-end-c #cm-hud-layout-section,
html.wusper-end-c #cm-settings-pane-view,
html.wusper-end-c #cm-settings-tabs [data-pane="view"],
html.wusper-end-c #cm-dual-fire-row,
html.wusper-end-c label:has(>#cm-dual-fire) {
    display: none !important;
    pointer-events: none !important;
}

/* c.: full-size FT overlay must not swallow canvas mouse aim */
html.wusper-end-c #ft-controls {
    pointer-events: none !important;
}
html.wusper-end-c #ft-controls button {
    pointer-events: auto !important;
}
/* c.: keep the top-left leave/exit tappable in fullscreen; do not un-hide pads */
html.wusper-end-c .wusper-hud-leave,
html.wusper-end-c [data-ufw="solo_ui_leave"],
html.wusper-end-c [data-ufw="h_5a36e351"],
html.wusper-end-c [data-ufw="h_dd644441"],
html.wusper-end-c [data-ufw="sm_ui_back"],
html.wusper-end-c #oi-btn-exit,
html.wusper-end-c #sm-btn-back,
html.wusper-end-c #pls-btn-leave,
html.wusper-end-c #pl-exit-btn,
html.wusper-end-c #btn-bk-exit,
html.wusper-end-c #parkour-exit,
html.wusper-end-c #fc-exit,
html.wusper-end-c #brb-exit,
html.wusper-end-c #ft-exit-btn,
html.wusper-end-c #cm-exit-btn,
html.wusper-end-c #acx-exit-btn,
html.wusper-end-c #sw-exit-btn,
html.wusper-end-c #ft-controls button:not([data-btn]) {
    display: inline-block !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    touch-action: manipulation;
}
/* a.: hide keyboard/mouse settings (keep 切換控制端 and touch-relevant prefs) */
html.wusper-end-a .wusper-kbm-only,
html.wusper-end-a #cm-keymap-section,
html.wusper-end-a #cm-kbm-sens-section,
html.wusper-end-a #cm-settings-modal div:has(>#cm-sens-view),
html.wusper-end-a #cm-settings-modal div:has(>#cm-sens-ads),
html.wusper-end-a #cm-settings-modal div:has(>#cm-sens-fire),
html.wusper-end-a #cm-settings-modal .cm-set-slider:has(>#cm-sens-view),
html.wusper-end-a #cm-settings-modal .cm-set-slider:has(>#cm-sens-ads),
html.wusper-end-a #cm-settings-modal .cm-set-slider:has(>#cm-sens-fire),
html.wusper-end-a .cm-key-hint,
html.wusper-end-a .acxC-key-hint,
html.wusper-end-a #pl-desktop-settings,
html.wusper-end-a #oi-kbm-binds,
html.wusper-end-a #oi-kbm-sens,
html.wusper-end-a #o_kb,
html.wusper-end-a #o_kbr,
html.wusper-end-a #o_sr,
html.wusper-end-a #oi-btn-sens,
html.wusper-end-a #o_sp,
html.wusper-end-a #prof-look-sens-row,
html.wusper-end-a .prof-row:has(#prof-look-sens-range) {
    display: none !important;
}


/* =========================================================
   COMG in-match tactical settings (#cm-settings-modal only)
   Charcoal sheet, ice/cyan accent, landscape-first tabs.
   ========================================================= */
#cm-settings-modal.modal-overlay {
    padding: 8px 10px;
    background: rgba(4, 6, 8, 0.64);
}
#cm-settings-modal .modal-window.cm-settings-sheet {
    display: flex;
    flex-direction: column;
    width: min(840px, 96vw);
    max-width: 96vw;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #16181c;
    border: 1px solid rgba(126, 224, 234, 0.28);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#cm-settings-modal .modal-window.cm-settings-sheet::before,
#cm-settings-modal .modal-window.cm-settings-sheet::after {
    display: none !important;
    content: none !important;
}

#cm-settings-modal .cm-settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 10px 4px 16px;
}
#cm-settings-modal .cm-settings-head h3 {
    margin: 0;
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #e8eef0;
    background: none;
    -webkit-text-fill-color: #e8eef0;
    -webkit-background-clip: unset;
    background-clip: unset;
    text-shadow: none;
}
#cm-settings-modal .cm-settings-head .close-btn {
    position: static;
    top: auto;
    right: auto;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    font-size: 22px;
    color: #9aa4aa;
}

#cm-settings-modal .cm-settings-tabs {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin: 0 12px 4px;
    padding: 3px;
    background: #0f1114;
    border: 1px solid rgba(126, 224, 234, 0.16);
    border-radius: 10px;
}
#cm-settings-modal .cm-settings-tab {
    flex: 1 1 0;
    min-height: 36px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: #8b959a;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    touch-action: manipulation;
}
#cm-settings-modal .cm-settings-tab.is-active {
    background: rgba(126, 224, 234, 0.16);
    color: #e8fbff;
    box-shadow: inset 0 0 0 1px rgba(126, 224, 234, 0.35);
}

#cm-settings-modal .cm-settings-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px 10px;
}
#cm-settings-modal .cm-settings-pane[hidden] {
    display: none !important;
}

#cm-settings-modal .cm-settings-footer {
    flex-shrink: 0;
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(126, 224, 234, 0.16);
    background: #141618;
}
#cm-settings-modal .cm-settings-save,
#cm-settings-modal .cm-settings-hud-btn {
    width: 100%;
    margin: 0;
    min-height: 42px;
    padding: 8px 12px;
    background: rgba(126, 224, 234, 0.12);
    border: 1px solid rgba(126, 224, 234, 0.45);
    color: #d7f7fa;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    touch-action: manipulation;
}
#cm-settings-modal .cm-settings-hud-btn {
    margin-top: 8px;
    background: transparent;
}

#cm-settings-modal .cm-set-card {
    background: #1c1f24;
    border: 1px solid rgba(126, 224, 234, 0.12);
    border-radius: 10px;
    padding: 6px 10px;
    margin: 0 0 8px;
}
#cm-settings-modal .cm-set-card:last-child {
    margin-bottom: 0;
}
#cm-settings-modal .cm-set-card-title {
    display: block;
    margin: 2px 0 4px;
    color: #d6dce0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
#cm-settings-modal .cm-set-help {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #8b959a;
}

#cm-settings-modal .cm-set-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin: 0;
    padding: 2px 0;
    color: #e4eaee;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
}
#cm-settings-modal .cm-set-switch-label {
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.3;
}

/* Kill generic glass text-input chrome on switches / sliders */
#cm-settings-modal input[type="checkbox"],
#cm-settings-modal input[type="range"],
#cm-settings-modal input[type="checkbox"]:focus,
#cm-settings-modal input[type="range"]:focus {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-align: left;
    font-weight: inherit;
    padding: 0;
    margin: 0;
}

#cm-settings-modal .cm-set-switch input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #2a2d32;
    border: 1px solid rgba(160, 220, 230, 0.28);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
#cm-settings-modal .cm-set-switch input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #c8d0d4;
    transition: transform 0.15s ease, background 0.15s ease;
}
#cm-settings-modal .cm-set-switch input[type="checkbox"]:checked {
    background: rgba(80, 200, 210, 0.38);
    border-color: #7ee0ea;
}
#cm-settings-modal .cm-set-switch input[type="checkbox"]:checked::after {
    transform: translateX(20px);
    background: #b8f3f8;
}
#cm-settings-modal .cm-set-switch input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 2px rgba(126, 224, 234, 0.45);
}

#cm-settings-modal .cm-set-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
}
#cm-settings-modal .cm-set-slider-label {
    flex: 0 0 72px;
    margin: 0;
    color: #d6dce0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
}
#cm-settings-modal input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: auto;
    flex: 1 1 auto;
    height: 22px;
    cursor: pointer;
}
#cm-settings-modal input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #2c3136;
    border-radius: 2px;
    border: 0;
}
#cm-settings-modal input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border-radius: 50%;
    background: #c9f4f8;
    border: 2px solid #16181c;
    box-shadow: 0 0 0 1px rgba(126, 224, 234, 0.55);
}
#cm-settings-modal input[type="range"]::-moz-range-track {
    height: 4px;
    background: #2c3136;
    border-radius: 2px;
    border: 0;
}
#cm-settings-modal input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c9f4f8;
    border: 2px solid #16181c;
    box-shadow: 0 0 0 1px rgba(126, 224, 234, 0.55);
}
#cm-settings-modal .cm-set-val {
    flex: 0 0 48px;
    min-width: 48px;
    padding: 3px 0;
    text-align: center;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: #c8f4f8;
    background: rgba(126, 224, 234, 0.1);
    border: 1px solid rgba(126, 224, 234, 0.3);
    border-radius: 999px;
}
#cm-settings-modal #cm-sens-view-val,
#cm-settings-modal #cm-gyro-look-val,
#cm-settings-modal .cm-set-val-look { color: #ffcc00; }
#cm-settings-modal #cm-sens-fire-val,
#cm-settings-modal #cm-gyro-fire-val,
#cm-settings-modal .cm-set-val-fire { color: #ff8a80; }
#cm-settings-modal #cm-sens-ads-val,
#cm-settings-modal #cm-gyro-ads-val,
#cm-settings-modal .cm-set-val-ads { color: #7ee0c4; }

#cm-settings-modal #cm-gyro-section.cm-set-aim {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 20px;
    align-items: start;
}

#cm-settings-modal #cm-keymap-list .cm-keymap-capture,
#cm-settings-modal #cm-keymap-list .cm-mousebtn-select {
    background: rgba(126, 224, 234, 0.08) !important;
    border: 1px solid rgba(126, 224, 234, 0.28) !important;
    color: #d7f6f8 !important;
    border-radius: 8px !important;
}

@media (orientation: landscape) and (min-width: 520px) {
    #cm-settings-modal #cm-gyro-section.cm-set-aim {
        grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.9fr);
        align-items: center;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    #cm-settings-modal .modal-window.cm-settings-sheet {
        width: min(920px, 98vw);
        max-height: calc(100vh - 8px);
        max-height: calc(100dvh - 8px);
        border-radius: 10px;
    }
    #cm-settings-modal .cm-settings-head {
        padding: 4px 6px 2px 12px;
    }
    #cm-settings-modal .cm-settings-head h3 { font-size: 14px; }
    #cm-settings-modal .cm-settings-head .close-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    #cm-settings-modal .cm-settings-tabs { margin: 0 10px 2px; }
    #cm-settings-modal .cm-settings-tab { min-height: 32px; }
    #cm-settings-modal .cm-settings-body { padding: 6px 10px 8px; }
    #cm-settings-modal .cm-settings-footer { padding: 6px 10px 8px; }
    #cm-settings-modal .cm-settings-save,
    #cm-settings-modal .cm-settings-hud-btn { min-height: 38px; }
    #cm-settings-modal .cm-set-switch,
    #cm-settings-modal .cm-set-slider { min-height: 34px; }
    #cm-settings-modal .cm-set-card { padding: 4px 8px; margin-bottom: 6px; }
    #cm-settings-modal #cm-gyro-section.cm-set-aim {
        grid-template-columns: minmax(0, 1.25fr) minmax(200px, 0.9fr);
        gap: 2px 16px;
    }
}
