/* noomings：壳 + 菜单/弹窗/编辑器；仅 #screen-game 对局舞台保留原视觉 */

html {
  color-scheme: light;
}

body.page-container.star-duo-root {
  background-color: var(--color-canvas);
  background-image: var(--bg-canvas-grid);
  background-size: var(--bg-grid-size) var(--bg-grid-size);
  color: var(--color-body);
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* 说明：这里原有一组 .shell-active 变体（.xd-app 宽度约束、舞台定位）。
   页面从未添加 shell-active 类（只有 xd-immersive / shell-chrome-hidden），
   这组规则始终不生效，故删除；菜单屏宽度由下方 #screen-select 等规则控制。 */

body.star-duo-root.xd-immersive {
  overflow: hidden;
  height: 100%;
  background: #0b0908;
  background-image: none;
}

body.star-duo-root.xd-immersive .star-duo-chrome {
  display: none !important;
}

body.star-duo-root.xd-immersive.shell-active {
  padding-left: 0 !important;
  padding-top: 0 !important;
  max-width: none;
}

body.star-duo-root.xd-immersive #screen-game.active,
body.star-duo-root.xd-immersive #editor-panel.active {
  position: fixed;
  inset: 0;
  z-index: 50;
  margin: 0;
  padding: 0;
  max-width: none;
  width: 100%;
}

body.star-duo-root.xd-immersive .site-footer {
  display: none !important;
}

body.star-duo-root .xd-app .screen.active {
  max-height: none;
}

/* —— 菜单屏（board-game-chrome + 流式壳） —— */
body.star-duo-root .xd-menu-screen.active {
  display: block;
  position: relative;
  inset: auto;
  max-width: none;
  margin: 0 auto 32px;
  padding: 0 16px 24px;
  color: var(--color-body);
  color-scheme: light;
  background: transparent;
}

.star-duo-root .xd-menu-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.star-duo-root .xd-menu-meta {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.star-duo-root .xd-menu-screen .panel {
  box-shadow: var(--shadow-card-float);
}

.star-duo-root .panel--xd-home {
  border-top: 4px solid var(--color-theme);
  padding-top: 18px;
}

.star-duo-root .panel__head--menu {
  justify-content: flex-end;
  margin-bottom: 4px;
}

.star-duo-root .menu-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 0 14px;
}

.star-duo-root .menu-btns .btn {
  flex: 1 1 46%;
  min-width: min(100%, 200px);
  grid-column: auto;
}

.star-duo-root .menu-btns .btn-primary {
  grid-column: auto;
}

.star-duo-root .xd-menu-screen .panel__head .panel__title {
  margin-bottom: 0;
  flex: 1;
  text-align: center;
  text-transform: none;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--color-ink);
}

.star-duo-root .xd-diff-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.star-duo-root .xd-diff-list > .btn {
  width: 100%;
  box-sizing: border-box;
}

.star-duo-root .xd-diff-list .diff-btn {
  width: 100%;
  max-width: none;
  padding: 14px 18px;
  border-radius: 0;
  border: 1px solid var(--line-ins);
  background: var(--color-card);
  color: var(--color-ink);
  letter-spacing: 0.04em;
  filter: none;
  transform: none;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

/* 未选中：浅底色 + 左侧色条区分难度，仍保持 noomings 可读性 */
.star-duo-root .xd-diff-list .diff-btn.easy:not(.is-active) {
  background: #f3faf5;
  border-color: #cfe8d8;
  border-left: 3px solid #5a9a6e;
}

.star-duo-root .xd-diff-list .diff-btn.normal:not(.is-active) {
  background: var(--color-theme-wash);
  border-color: #e5dea8;
  border-left: 3px solid var(--color-theme-deep);
}

.star-duo-root .xd-diff-list .diff-btn.hard:not(.is-active) {
  background: #fff6ee;
  border-color: #ecd9c4;
  border-left: 3px solid #b87840;
}

.star-duo-root .xd-diff-list .diff-btn.hell:not(.is-active) {
  background: #fff5f7;
  border-color: #f0d0d6;
  border-left: 3px solid #c45c6a;
}

.star-duo-root .xd-diff-list .diff-btn:not(.is-active):hover {
  filter: none;
  border-color: var(--color-theme-deep);
  box-shadow: var(--shadow-ins);
}

.star-duo-root .xd-diff-list .diff-btn .diff-btn-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.star-duo-root .xd-diff-list .diff-btn .diff-btn-desc {
  font-size: 0.75rem;
  line-height: 1.45;
  margin-top: 6px;
  color: var(--color-ink-muted);
  letter-spacing: 0.02em;
  opacity: 1;
}

.star-duo-root .xd-diff-list .diff-btn.is-active {
  background: var(--selected-fill);
  color: var(--color-ink);
  border: 2px solid var(--color-theme-deep);
  box-shadow: none;
  transform: none;
}

.star-duo-root .xd-diff-list .diff-btn.is-active .diff-btn-desc {
  color: var(--color-ink-muted);
}

/* 弹窗 */
.star-duo-root .overlay {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
}

.star-duo-root .overlay .btn {
  border-radius: 0;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-ink);
  background: var(--surface-2);
  border: 2px solid var(--border);
  box-shadow: none;
}

.star-duo-root .overlay .btn:hover:not(:disabled) {
  background: var(--brand);
  color: var(--brand-ink);
}

.star-duo-root .overlay .btn.small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.78rem;
}

.star-duo-root .overlay .btn.light {
  background: var(--surface);
}

.star-duo-root .overlay .btn.green,
.star-duo-root .overlay .btn:not(.light):not(.small) {
  background: var(--btn-emphasis-bg);
  color: var(--btn-emphasis-fg);
  border-color: var(--btn-emphasis-border);
  box-shadow: none;
}

.star-duo-root .overlay .btn.green:hover:not(:disabled),
.star-duo-root .overlay .btn:not(.light):not(.small):hover:not(:disabled) {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: none;
}

.star-duo-root .overlay .color-btn {
  border-radius: 0;
  border: 2px solid var(--border);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.star-duo-root .overlay .color-btn.black {
  background: var(--color-ink);
  color: var(--color-theme);
}

.star-duo-root .overlay .color-btn.white {
  background: var(--color-card);
  color: var(--color-ink);
}

.star-duo-root .overlay .color-btn.random {
  background: var(--color-theme-wash);
  color: var(--color-ink);
}

.star-duo-root .modal {
  border-radius: 0;
  background: var(--color-card);
  color: var(--color-body);
  border: 1px solid var(--line-ins);
  box-shadow: var(--shadow-card-float);
}

.star-duo-root .modal h3 {
  color: var(--gradient-theme-title);
  letter-spacing: 0.1em;
  font-size: 1.125rem;
}

.star-duo-root .modal input,
.star-duo-root .modal input[type="number"] {
  background: var(--color-canvas);
  color: var(--color-ink);
  border: 1px solid var(--line-hard);
  border-radius: 0;
}

.star-duo-root .modal label {
  color: var(--color-ink);
}

.star-duo-root .modal .modal-copy {
  text-align: left;
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--color-body);
  margin: 0 0 12px;
}

.star-duo-root .modal .modal-copy--field {
  margin-top: 12px;
}

.star-duo-root .modal .modal-copy b {
  color: var(--color-ink);
  font-weight: 600;
}

/* 弹窗内勿沿用对局 HUD 的 .hint 浅色 */
.star-duo-root .modal .hint {
  color: var(--color-body);
}

/* 自定义编辑器：工具栏/侧栏 noomings，棋盘预览区保持原暗色 */
.star-duo-root .editor-panel {
  background: var(--color-canvas);
  background-image: var(--bg-canvas-grid);
  background-size: var(--bg-grid-size) var(--bg-grid-size);
}

.star-duo-root .editor-toolbar {
  background: var(--color-card);
  border-bottom: 1px solid var(--line-ins);
}

.star-duo-root .editor-toolbar .ed-btn:hover {
  background: var(--color-theme-wash);
  border-color: var(--color-theme-deep);
  color: var(--color-ink);
}

.star-duo-root .editor-toolbar .ed-btn.active {
  background: var(--selected-fill);
  border: 2px solid var(--color-theme-deep);
  color: var(--color-ink);
  box-shadow: none;
}

.star-duo-root .editor-toolbar .ed-btn.green {
  background: var(--btn-emphasis-bg);
  border-color: var(--btn-emphasis-border);
}

.star-duo-root .editor-side {
  background: var(--color-card);
  border: 1px solid var(--line-ins);
  border-radius: 0;
  box-shadow: var(--shadow-ins);
}

.star-duo-root .editor-side-title {
  color: var(--color-ink-muted);
}

.star-duo-root .preset-item {
  border-radius: 0;
  background: var(--color-canvas);
  border: 1px solid var(--line-ins);
  color: var(--color-ink);
}

.star-duo-root .preset-item.active,
.star-duo-root .preset-item:hover {
  background: var(--color-theme-wash);
  border-color: var(--color-theme-deep);
  color: var(--color-ink);
  box-shadow: none;
}

.star-duo-root .preset-item.preset-item--custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  margin-bottom: 8px;
  text-align: left;
  cursor: pointer;
}

.star-duo-root .preset-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.star-duo-root .preset-item-delete {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 0;
  border: 1px solid var(--line-hard);
  background: var(--color-card);
  color: var(--color-ink-muted);
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.star-duo-root .preset-item-delete:hover {
  background: rgba(255, 240, 240, 0.35);
  border-color: #e8a0a0;
  color: #a03030;
}

.star-duo-root .preset-item.preset-item--custom.active .preset-item-delete {
  border-color: var(--line-hard);
  background: rgba(255, 255, 255, 0.65);
}

/* 编辑器内棋盘预览：不 noomings 化 */
.star-duo-root .editor-body {
  background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(150deg, #262019, #16120e 55%, #0b0908);
}

/* 对局舞台 #screen-game 内全部由 star-duo.css 原样呈现，此处不覆盖 */

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body.star-duo-root .xd-menu-screen.active {
  color-scheme: dark;
}

html[data-theme="dark"] .star-duo-root .preset-item-delete:hover {
  background: rgba(160, 48, 48, 0.15);
  border-color: #c07070;
  color: #e8a0a0;
}

html[data-theme="dark"] .star-duo-root .xd-diff-list .diff-btn.easy:not(.is-active) {
  background: rgba(90, 154, 110, 0.12);
  border-color: rgba(207, 232, 216, 0.35);
}

html[data-theme="dark"] .star-duo-root .xd-diff-list .diff-btn.normal:not(.is-active) {
  background: var(--color-surface-dim);
  border-color: var(--line-ins);
}

html[data-theme="dark"] .star-duo-root .xd-diff-list .diff-btn.hard:not(.is-active) {
  background: rgba(184, 120, 64, 0.12);
  border-color: rgba(236, 217, 196, 0.25);
}

html[data-theme="dark"] .star-duo-root .xd-diff-list .diff-btn.hell:not(.is-active) {
  background: rgba(196, 92, 106, 0.12);
  border-color: rgba(240, 208, 214, 0.25);
}
