/*
 * 登录后大厅。
 *
 * 页面保留原有基地背景，
 * 主要内容收在一组有留白的透明卡片里，动效只服务于层次和操作反馈。
 */

body.dashboard-open {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
  color: #fbf4e9;
  background: #211e1a;
  color-scheme: dark;
  scrollbar-width: none;
}

html:has(body.dashboard-open) { scrollbar-width: none; }
html:has(body.dashboard-open)::-webkit-scrollbar,
body.dashboard-open::-webkit-scrollbar { display: none; }

body.dashboard-open .topbar {
  display: none;
}

body.dashboard-open .site-noise {
  z-index: 2;
  opacity: .075;
}

body.dashboard-open #appView {
  position: relative;
  min-height: 100dvh;
  background: transparent;
}

/* 原有基地图片，复用登录页的视差、浮尘和光影动效。 */
#dashboardScene {
  display: none;
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #29241e;
}

body.dashboard-open #dashboardScene {
  display: block;
}

#dashboardScene picture,
#dashboardScene img {
  display: block;
  width: 100%;
  height: 100%;
}

#dashboardScene picture {
  transform: translate3d(var(--scene-x, 0px), var(--scene-y, 0px), 0) scale(1.035);
  transform-origin: center;
  animation: dashboard-scene-breathe 32s ease-in-out infinite alternate;
  will-change: transform;
  transition: transform .7s ease-out;
}

#dashboardScene img {
  object-fit: cover;
  object-position: 50% 48%;
}

#dashboardScene .landing-atmosphere {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 21, 23, .58), rgba(27, 24, 22, .12) 58%, rgba(18, 21, 23, .28)),
    linear-gradient(0deg, rgba(15, 18, 20, .83), transparent 30%, transparent 70%, rgba(22, 22, 22, .4));
}

#dashboardScene .landing-dust {
  position: absolute;
  inset: 0;
}

#dashboardScene .landing-dust i {
  position: absolute;
  left: 17%;
  top: 62%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffdb9f;
  box-shadow: 0 0 10px #f7cb8b;
  opacity: 0;
  animation: dashboard-dust-drift 12s linear infinite;
}

#dashboardScene .landing-dust i:nth-child(2) {
  left: 33%;
  top: 80%;
  animation-delay: -4s;
  animation-duration: 16s;
}

#dashboardScene .landing-dust i:nth-child(3) {
  left: 45%;
  top: 49%;
  animation-delay: -8s;
}

#dashboardScene .landing-dust i:nth-child(4) {
  left: 63%;
  top: 70%;
  animation-delay: -2s;
  animation-duration: 19s;
}

#dashboardScene .landing-dust i:nth-child(5) {
  left: 76%;
  top: 90%;
  animation-delay: -11s;
}

#dashboardScene .landing-dust i:nth-child(6) {
  left: 90%;
  top: 65%;
  animation-delay: -5s;
  animation-duration: 17s;
}

#dashboardScene[data-motion="paused"] picture,
#dashboardScene[data-motion="paused"] .landing-dust i {
  animation-play-state: paused;
}

/* 聚光效果：landing.js 只负责把鼠标位置写到变量里，样式本身不依赖 React。 */
#dashboardView .dashboard-spotlight {
  position: relative;
  isolation: isolate;
}

#dashboardView .dashboard-spotlight::before {
  position: absolute;
  z-index: 2;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(
    circle 180px at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(255, 231, 186, .9),
    rgba(168, 217, 209, .24) 45%,
    transparent 75%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

#dashboardView .dashboard-spotlight::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      circle 210px at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(255, 224, 178, .2),
      rgba(213, 195, 163, .06) 35%,
      transparent 72%
    );
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  mix-blend-mode: screen;
}

#dashboardView .dashboard-spotlight:hover::before,
#dashboardView .dashboard-spotlight:hover::after,
#dashboardView .dashboard-spotlight:focus-visible::before,
#dashboardView .dashboard-spotlight:focus-visible::after {
  opacity: 1;
}

#dashboardView .dashboard-spotlight > * {
  position: relative;
  z-index: 1;
}

/* 三列各自承载内容，中央留给正在继续的棋局。 */
#dashboardView.lobby-page {
  --lobby-edge-space: clamp(28px, 4.5vh, 54px);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(100%, 1500px);
  max-width: none;
  height: auto;
  max-height: none;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--lobby-edge-space) clamp(24px, 4vw, 72px);
  overflow: visible;
  background: transparent;
}

#dashboardView.lobby-page::before { content: none; }

#dashboardView .lobby-layout {
  display: grid;
  grid-template-columns: minmax(260px, 308px) minmax(0, 1fr) minmax(300px, 350px);
  align-items: stretch;
  gap: clamp(24px, 3vw, 46px);
  width: 100%;
  max-width: 1356px;
  height: auto;
  min-height: calc(100dvh - var(--lobby-edge-space) * 2);
  max-height: none;
  min-width: 0;
  margin: 0 auto;
}

#dashboardView .lobby-left-column,
#dashboardView .lobby-right-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

#dashboardView .lobby-right-column {
  justify-content: space-between;
  gap: 40px;
}

/* 只把布阵与匹配入口下移，底部手册继续由自动留白定位。 */
@media (min-width: 1081px) {
  #dashboardView .lobby-left-column {
    padding-top: clamp(24px, 4dvh, 42px);
  }
}

/* 手册占据左栏底部的空白，不再增加一块面板。 */
#dashboardView .home-manual-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 28px;
  margin-top: auto;
  padding: 0 2px;
  color: #f1e6d1;
  text-decoration: none;
  text-shadow: 0 2px 9px #090e0f;
  white-space: nowrap;
}

#dashboardView .home-manual-english {
  color: #edc58c;
  font-family: "Yibu Orbitron", "Bahnschrift", sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .04em;
  line-height: 1.5;
}

#dashboardView .home-manual-title {
  font-size: 12px;
  letter-spacing: .06em;
}

#dashboardView .home-manual-link:hover { color: #fff8e9; }

#dashboardView .lobby-board-card {
  position: relative;
  order: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  padding: clamp(15px, 1.6vw, 21px);
  overflow: visible;
  border: 1px solid rgba(255, 225, 177, .22);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(26, 29, 29, .78), rgba(13, 18, 19, .82)),
    rgba(18, 22, 23, .3);
  box-shadow:
    0 26px 68px rgba(0, 0, 0, .26),
    inset 0 1px 0 rgba(255, 248, 229, .12);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  backdrop-filter: blur(12px) saturate(112%);
}

#dashboardView .lobby-board-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

#dashboardView .lobby-board-heading h1 {
  margin: 0;
  color: #fbf4e9;
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: clamp(24px, 2vw, 31px);
  font-weight: 650;
  letter-spacing: .035em;
  line-height: 1.15;
  text-shadow: 0 4px 22px rgba(8, 9, 9, .3);
}

#dashboardView .lobby-board-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(243, 200, 131, .28);
  border-radius: 999px;
  color: rgba(255, 237, 206, .88);
  background: rgba(85, 61, 33, .22);
  font-size: 10px;
  white-space: nowrap;
}

#dashboardView .lobby-board-workspace {
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  height: auto;
  max-height: none;
}

#dashboardView .home-board-frame {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  max-height: none;
  aspect-ratio: auto;
  flex: none;
}

#dashboardView .home-board-scroller {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 178, .13);
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(186, 148, 89, .15), transparent 68%),
    linear-gradient(145deg, rgba(12, 20, 21, .31), rgba(9, 13, 14, .14));
  box-shadow:
    inset 0 0 70px rgba(0, 0, 0, .16),
    0 13px 30px rgba(0, 0, 0, .14);
}

#dashboardView .home-board-grid {
  display: block;
  width: 100% !important;
  height: auto;
  aspect-ratio: auto;
  min-width: 0 !important;
  min-height: 0;
  margin: 0;
  transform: none;
}

#dashboardView .home-board-grid .board-svg {
  display: block;
  width: 100% !important;
  height: auto;
  min-width: 0 !important;
  max-width: 100%;
  margin: 0;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .28));
}

#dashboardView .home-board-empty {
  display: grid;
  place-items: center;
  align-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 9px;
  color: rgba(236, 226, 207, .68);
  text-align: center;
}

#dashboardView .home-board-empty .empty-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 224, 178, .32);
  border-radius: 50%;
  color: #ffe0a5;
  font-family: var(--serif);
  font-size: 22px;
}

#dashboardView .home-board-empty p {
  margin: 0;
  font-size: 10px;
  line-height: 1.7;
}

#dashboardView .formation-tools {
  position: relative;
  inset: auto;
  z-index: 2;
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  margin: 13px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#dashboardView .formation-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

#dashboardView .formation-action {
  position: relative;
  min-width: 0;
  min-height: 43px;
  padding: 7px 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 178, .25);
  border-radius: 10px;
  color: #fbf4e9;
  background:
    linear-gradient(145deg, rgba(255, 234, 199, .1), rgba(31, 39, 38, .56)),
    rgba(18, 24, 24, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  font-size: 11px;
  font-weight: 650;
  transition: transform .24s ease, border-color .24s ease, background .24s ease, box-shadow .24s ease;
}

#dashboardView .formation-action:hover {
  transform: translateY(-2px);
  border-color: rgba(243, 200, 131, .66);
  background: rgba(117, 83, 45, .34);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .15);
}

#dashboardView .formation-status {
  display: block;
  min-height: 0;
  padding-top: 8px;
  color: rgba(236, 226, 207, .68);
  font-size: 10px;
}

/* 匹配入口紧接布阵；两种操作有各自清楚的点击范围。 */
#dashboardView .home-match-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: none;
  gap: 10px;
  margin: 0;
}

#dashboardView .home-match-button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 6px 16px;
  box-sizing: border-box;
  width: 100%;
  min-height: 80px;
  padding: 15px 20px;
  overflow: hidden;
  border: 1px solid rgba(239, 220, 183, .26);
  border-radius: 14px;
  color: #fff3de;
  background: linear-gradient(120deg, rgba(55, 60, 57, .8), rgba(20, 29, 29, .74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 25px rgba(0, 0, 0, .12);
  text-align: left;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

#dashboardView .home-match-button.featured {
  border-color: rgba(255, 211, 140, .46);
  background: linear-gradient(110deg, rgba(148, 109, 61, .94), rgba(86, 66, 43, .87));
}

#dashboardView .home-match-button > span {
  grid-column: 1;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .08em;
}

#dashboardView .home-match-button > small {
  grid-column: 1;
  color: rgba(249, 235, 214, .66);
  font-size: 11px;
  line-height: 1.5;
}

#dashboardView .home-match-button > i {
  grid-column: 2;
  grid-row: 1 / 3;
  position: static;
  color: #f7d59d;
  font-size: 26px;
  font-style: normal;
  transition: transform .22s ease;
}

#dashboardView .home-match-button:hover {
  transform: translateY(-3px);
  border-color: #d6b77c;
  box-shadow: 0 15px 30px rgba(0, 0, 0, .2);
}

#dashboardView .home-match-button:hover > i { transform: translate(2px, -2px); }
/* 标题只保留功能名称，内容直接放在背景上。 */
#dashboardView .home-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
}

#dashboardView .home-section-heading h2 {
  margin: 0;
  color: #f8f1e5;
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.5;
}

#dashboardView .home-section-heading h2 > button {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}

#dashboardView .home-section-meta {
  color: rgba(245, 228, 200, .56);
  font-size: 10px;
  line-height: 1.6;
  text-align: right;
}

#dashboardView .home-section-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 32px;
  margin: 0;
  padding: 4px 0 4px 8px;
  border: 0;
  color: #d9c59e;
  background: transparent;
  font-size: 11px;
}

#dashboardView .home-section-link i { font-size: 17px; font-style: normal; }
#dashboardView .home-section-link:hover { color: #ffe2ad; }

#dashboardView .home-current-games-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: end;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0 0 clamp(24px, 4vh, 48px);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#dashboardView .home-current-games-slot {
  position: relative;
  display: block;
  flex: none;
  width: 100%;
  height: clamp(302px, 42vh, 346px);
  min-height: 302px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 18px;
  background: transparent;
  scrollbar-gutter: auto;
}

#dashboardView .home-sidebar-games {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0;
  padding: 0;
}

#dashboardView .home-games-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 12px;
  width: min(100%, 360px);
  margin: 12px auto 0;
  text-align: center;
}

#dashboardView .home-games-footer h2 { margin: 0; }
#dashboardView .home-games-footer .home-section-meta {
  color: #cbbfa8;
  text-align: center;
  text-shadow: 0 2px 7px #09100f;
}
#dashboardView #homeGamesNavigation { justify-self: center; }

#dashboardView .home-empty-games {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 260px;
  gap: 16px;
  color: rgba(244, 233, 213, .64);
  text-align: center;
}

#dashboardView .home-empty-games > span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 90px;
  border: 1px solid rgba(228, 202, 156, .3);
  border-radius: 15px;
  color: #d8bd88;
  background: linear-gradient(135deg, rgba(234, 216, 180, .11), rgba(22, 29, 27, .6));
  box-shadow: 8px -8px 0 -1px rgba(28, 35, 32, .65), 8px -8px 0 0 rgba(228, 202, 156, .18);
  font-family: var(--serif);
  font-size: 32px;
  transform: rotate(-7deg);
}

#dashboardView .home-empty-games p { margin: 0; font-size: 13px; line-height: 1.8; }
#dashboardView .home-leaderboard-card,
#dashboardView .home-account-section {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 10px 0 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: #f5ecdc;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#dashboardView .home-leaderboard-card:hover {
  border-color: transparent;
  background: transparent;
}

#dashboardView .home-account-section {
  display: grid;
  grid-template-columns: minmax(116px, .9fr) minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  isolation: isolate;
  margin-top: auto;
}

/* 柔和暗部只衬托文字，边缘完全融入背景，不恢复外框。 */
#dashboardView .home-account-section::before {
  position: absolute;
  z-index: -1;
  inset: 0 -6%;
  background: radial-gradient(ellipse at 50% 55%, rgba(5, 13, 14, .76), rgba(5, 13, 14, .38) 43%, transparent 72%);
  content: "";
  pointer-events: none;
}

#dashboardView .home-account-section .home-section-heading {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px #09100e, 0 0 22px rgba(5, 10, 9, .9);
}
#dashboardView .home-account-section .home-section-heading h2 { font-weight: 600; }

#dashboardView .home-ranking-list {
  position: relative;
  box-sizing: border-box;
  height: clamp(250px, 35vh, 340px);
  min-height: 250px;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}

#dashboardView .home-ranking-list::-webkit-scrollbar { display: none; }

#dashboardView .home-ranking-status {
  display: grid;
  place-items: center;
  min-height: 80px;
  margin: 0;
  color: rgba(238, 222, 198, .62);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

#dashboardView .home-ranking-status[hidden] { display: none; }
#dashboardView .home-ranking-me {
  margin: 10px 0 0;
  padding: 9px 1px 0;
  border-top: 1px solid rgba(238, 218, 184, .12);
  color: #c9bba3;
  font-size: 11px;
  line-height: 1.7;
}

#dashboardView .home-settings-wheel {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 176px;
  overflow: hidden;
}

#dashboardView .home-setting-detail {
  min-width: 0;
  padding: 3px 0 3px 14px;
  border-left: 1px solid rgba(235, 201, 143, .3);
  color: #e5d4b6;
  text-shadow: 0 2px 7px #10100c;
}

#dashboardView .home-setting-detail p {
  margin: 0;
  font-size: 12px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

/* 所有设置详情使用同一块居中的琥珀色液态玻璃。 */
#dashboardView #homeContentPanel,
#dashboardView #accountSettingsDialog {
  --ink: #fff5d9;
  --ink-soft: #e2cc9e;
  --ink-faint: #c9b58b;
  --panel: rgba(47, 30, 10, .4);
  --paper-deep: rgba(100, 65, 15, .35);
  --line: rgba(255, 218, 139, .18);
  --line-strong: rgba(255, 218, 139, .32);
  --gold: #f8ce76;
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(900px, calc(100vw - 48px));
  height: fit-content;
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: clamp(22px, 3vw, 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 222, 146, .55);
  border-radius: 22px;
  color: var(--ink);
  color-scheme: dark;
  background:
    radial-gradient(ellipse at 12% 8%, rgba(255, 216, 111, .24), transparent 58%),
    radial-gradient(ellipse at 86% 92%, rgba(255, 183, 64, .17), transparent 58%),
    linear-gradient(120deg, transparent 25%, rgba(255, 233, 172, .09) 47%, transparent 68%),
    linear-gradient(145deg, rgba(132, 88, 25, .82), rgba(44, 29, 12, .88));
  background-size: 140% 140%, 145% 145%, 250% 250%, 100% 100%;
  background-position: 0% 0%, 100% 100%, 100% 50%, 0% 0%;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, .4),
    0 0 36px rgba(228, 170, 53, .08),
    inset 0 1px 0 rgba(255, 245, 201, .4),
    inset 0 0 32px rgba(255, 202, 91, .05);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  backdrop-filter: blur(22px) saturate(1.15);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 212, 121, .5) transparent;
  animation: lobby-dialog-liquid 14s ease-in-out infinite alternate;
}

#dashboardView #homeContentPanel.settings-panel-open {
  width: min(720px, calc(100vw - 48px));
}

#dashboardView #accountSettingsDialog {
  width: min(620px, calc(100vw - 48px));
  padding: 0;
}

#dashboardView #homeContentPanel::backdrop,
#dashboardView #accountSettingsDialog::backdrop {
  background: rgba(16, 12, 6, .48);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

body.dashboard-open:has(#homeContentPanel[open], #accountSettingsDialog[open]),
html:has(body.dashboard-open #homeContentPanel[open], body.dashboard-open #accountSettingsDialog[open]) {
  overflow: hidden;
}

#dashboardView #homeContentPanel > .home-panel-heading,
#dashboardView #accountSettingsDialog .settings-dialog-heading {
  position: static;
  margin: 0 0 22px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

#dashboardView #homeContentPanel .home-panel-heading h2,
#dashboardView #accountSettingsDialog .settings-dialog-heading h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(23px, 2.3vw, 28px);
  font-weight: 600;
  letter-spacing: .05em;
}

#dashboardView #accountSettingsDialog .settings-dialog-content {
  padding: clamp(22px, 3vw, 32px);
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) .eyebrow {
  color: #f8ce76;
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) .quiet-button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: rgba(255, 222, 146, .04);
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) .button,
#dashboardView #accountSettingsDialog .settings-tabs button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 217, 124, .14), rgba(255, 209, 105, .05));
  box-shadow: inset 0 1px 0 rgba(255, 239, 185, .08);
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) .button:hover,
#dashboardView :is(#homeContentPanel, #accountSettingsDialog) .quiet-button:hover,
#dashboardView #accountSettingsDialog .settings-tabs button:hover {
  border-color: rgba(255, 224, 152, .66);
  color: #fff9e9;
  background: rgba(255, 210, 107, .2);
}

#dashboardView #accountSettingsDialog .settings-tabs [aria-selected="true"] {
  border-color: #f4cf80;
  color: #2f210c;
  background: linear-gradient(135deg, #f7dc98, #d8ac53);
  box-shadow: 0 3px 16px rgba(231, 177, 61, .12), inset 0 1px 0 rgba(255, 251, 225, .7);
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) :is(input, select, textarea) {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(32, 21, 9, .45);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .08);
  accent-color: #f4cd7d;
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) select option {
  color: #fff5d9;
  background: #3d2c13;
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) input::placeholder {
  color: var(--ink-faint);
}

#dashboardView :is(#homeContentPanel, #accountSettingsDialog) :focus-visible {
  outline: 2px solid #ffe1a0;
  outline-offset: 3px;
}

#dashboardView #homeContentPanel :is(.settings-profile-card, .settings-category, .home-feature-card, .home-setting-row, .home-empty-panel) {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 218, 137, .04);
}

#dashboardView #homeContentPanel .home-setting-row small {
  color: var(--ink-soft);
}

#dashboardView #homeContentPanel .settings-switch-track {
  background: rgba(15, 11, 5, .5);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

#dashboardView #homeContentPanel [aria-checked="true"] > .settings-switch-track {
  background: linear-gradient(135deg, #f6d98a, #c69a41);
}

#dashboardView #homeContentPanel .settings-switch-track::before {
  background: #fff5d7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

#dashboardView #homeContentPanel .home-record-strip {
  flex-wrap: wrap;
  color: var(--ink-soft);
  border-color: var(--line);
}

#dashboardView #homeContentPanel .home-record-strip strong {
  color: var(--ink);
}

@keyframes lobby-dialog-liquid {
  to { background-position: 65% 40%, 30% 65%, 0% 50%, 0% 0%; }
}

@media (max-width: 600px) {
  #dashboardView #homeContentPanel,
  #dashboardView #homeContentPanel.settings-panel-open,
  #dashboardView #accountSettingsDialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }

  #dashboardView #homeContentPanel { padding: 20px; }
  #dashboardView #accountSettingsDialog .settings-dialog-content { padding: 20px; }
  #dashboardView #accountSettingsDialog .settings-tabs { flex-wrap: wrap; }
  #dashboardView #accountSettingsDialog .settings-tabs button { flex-basis: 110px; }
}

#dashboardView .home-current-games-slot:focus-visible,
#dashboardView .home-ranking-list:focus-visible,
#dashboardView .home-settings-wheel:focus-visible,
#dashboardView .home-section-heading button:focus-visible,
#dashboardView .home-match-button:focus-visible,
#dashboardView .home-manual-link:focus-visible,
#dashboardView .formation-action:focus-visible {
  outline: 2px solid #ffe0a5;
  outline-offset: 3px;
}

@keyframes dashboard-scene-breathe {
  from { filter: brightness(.98) saturate(.98); }
  to { filter: brightness(1.06) saturate(1.06); }
}

@keyframes dashboard-dust-drift {
  0% { opacity: 0; transform: translate3d(0, 20px, 0) scale(.6); }
  18%, 78% { opacity: .55; }
  100% { opacity: 0; transform: translate3d(18px, -100px, 0) scale(1); }
}

@media (max-width: 1200px) {
  #dashboardView.lobby-page { padding-right: 28px; padding-left: 28px; }
  #dashboardView .lobby-layout {
    grid-template-columns: minmax(250px, 280px) minmax(0, 1fr) minmax(260px, 290px);
    gap: 24px;
  }
  #dashboardView .home-leaderboard-card,
  #dashboardView .home-account-section { padding: 10px 0 0; }
}

@media (max-width: 1080px) {
  #dashboardView .lobby-layout {
    grid-template-columns: minmax(260px, 308px) minmax(0, 1fr);
    max-width: 850px;
    gap: 30px;
    min-height: 0;
  }
  #dashboardView .lobby-right-column {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 26px;
  }
  #dashboardView .home-current-games-slot { height: 346px; }
  #dashboardView .home-account-section { margin-top: 0; }
}

@media (max-width: 720px) {
  #dashboardView.lobby-page { padding: 24px 18px; }
  #dashboardView .lobby-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 440px;
    gap: 34px;
  }
  #dashboardView .lobby-left-column { width: min(100%, 340px); margin: 0 auto; gap: 18px; }
  #dashboardView .lobby-board-card { padding: 13px; border-radius: 16px; }
  #dashboardView .lobby-board-heading { align-items: flex-start; margin-bottom: 9px; }
  #dashboardView .lobby-board-heading h1 { font-size: 24px; }
  #dashboardView .lobby-board-status { padding: 5px 8px; font-size: 9px; }
  #dashboardView .formation-tools { margin-top: 10px; }
  #dashboardView .formation-actions { gap: 6px; }
  #dashboardView .formation-action { min-height: 41px; padding: 6px 3px; font-size: 10px; }
  #dashboardView .home-match-button { min-height: 74px; padding: 13px 17px; }
  #dashboardView .home-current-games-section { padding: 0; }
  #dashboardView .home-current-games-slot { height: 330px; min-height: 302px; }
  #dashboardView .home-games-footer { width: min(100%, 340px); }
  #dashboardView .lobby-right-column { display: flex; grid-column: auto; gap: 34px; }
  #dashboardView .home-ranking-list { height: 280px; }
  #dashboardView .home-leaderboard-card,
  #dashboardView .home-account-section { padding: 0; }
}

@media (max-width: 390px) {
  #dashboardView.lobby-page { padding-right: 12px; padding-left: 12px; }
  #dashboardView .lobby-board-heading h1 { font-size: 22px; }
  #dashboardView .home-section-heading h2 { font-size: 18px; }
}

/* 桌面矮窗口先收紧间距和匹配入口；更矮的窗口保留自然滚动。 */
@media (min-width: 1081px) and (max-height: 820px) {
  #dashboardView.lobby-page { --lobby-edge-space: 24px; }
  #dashboardView .lobby-left-column { gap: 16px; padding-top: 24px; }
  #dashboardView .lobby-right-column { gap: 24px; }
  #dashboardView .home-match-button { min-height: 70px; padding: 12px 18px; }
}

@media (min-width: 1201px) and (max-height: 820px) {
  #dashboardView .lobby-layout {
    grid-template-columns: minmax(240px, min(308px, 40dvh)) minmax(0, 1fr) minmax(300px, 350px);
  }
}

@media (min-width: 1081px) and (max-height: 720px) {
  #dashboardView.lobby-page { --lobby-edge-space: 20px; }
  #dashboardView .lobby-left-column { gap: 14px; padding-top: 12px; }
  #dashboardView .home-match-button { min-height: 66px; padding-top: 10px; padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #dashboardScene picture, #dashboardScene .landing-dust i { animation: none; }
  #dashboardView #homeContentPanel,
  #dashboardView #accountSettingsDialog { animation: none; }
  #dashboardView .dashboard-spotlight::before,
  #dashboardView .dashboard-spotlight::after,
  #dashboardView .formation-action,
  #dashboardView .home-match-button,
  #dashboardView .home-match-button > i { transition: none; }
}
