:root{
  --bg0:#060813;
  --bg1:#090d1f;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);

  --card: rgba(255,255,255,.05);
  --card2: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.10);

  --neon1:#7c5cff;
  --neon2:#2de2e6;
  --danger:#ff3d6e;

  --radius: 22px;
  --shadow: 0 18px 70px rgba(0,0,0,.55);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
               "PingFang SC","Hiragino Sans","Microsoft YaHei", sans-serif;
  background:
    radial-gradient(900px 600px at 12% 10%, rgba(124,92,255,.24), transparent 60%),
    radial-gradient(900px 600px at 88% 22%, rgba(45,226,230,.18), transparent 60%),
    radial-gradient(700px 500px at 50% 95%, rgba(255,61,110,.12), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* animated background haze */
.bg{
  position:fixed;
  inset:-20%;
  background:
    radial-gradient(700px 500px at 20% 20%, rgba(124,92,255,.12), transparent 55%),
    radial-gradient(800px 600px at 80% 25%, rgba(45,226,230,.10), transparent 58%),
    radial-gradient(800px 600px at 50% 85%, rgba(255,61,110,.08), transparent 58%);
  filter: blur(20px);
  opacity:.9;
  animation: float 10s ease-in-out infinite alternate;
  pointer-events:none;
}
@keyframes float{
  from{ transform: translate3d(-10px, -6px, 0) scale(1.02); }
  to{ transform: translate3d(12px, 10px, 0) scale(1.05); }
}

.app{
  width:min(1220px, 100%);
  margin:0 auto;
  padding:22px;
  position:relative;
  z-index:1;
}

.top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:14px;height:14px;border-radius:50%;
  background: linear-gradient(135deg, var(--neon1), var(--neon2));
  box-shadow: 0 0 0 7px rgba(124,92,255,.14), 0 0 30px rgba(45,226,230,.20);
}
.title{
  margin:0;
  font-size:18px;
  letter-spacing:.6px;
}
.sub{ margin-top:6px; color:var(--muted); font-size:13px; }

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn, .sel{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  font-weight: 900;
  font-size: 13px;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  user-select:none;
  outline:none;
}
.btn:hover, .sel:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}
.btn:active{ transform: translateY(0px) scale(.99); }

.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(45,226,230,.16));
  border-color: rgba(45,226,230,.22);
  box-shadow: 0 0 0 2px rgba(45,226,230,.08), 0 12px 44px rgba(124,92,255,.12);
}
.btn.danger{
  background: rgba(255,61,110,.10);
  border-color: rgba(255,61,110,.28);
}
.btn.small{ padding:8px 10px; border-radius: 12px; }

.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  margin-left: 6px;
  white-space:nowrap;
}

.layout{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:16px;
}
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
}

.card{
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow:hidden;
  backdrop-filter: blur(12px);
  position:relative;
  padding:16px;
}
.card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: conic-gradient(from 180deg,
    rgba(124,92,255,.35),
    rgba(45,226,230,.28),
    rgba(255,61,110,.22),
    rgba(124,92,255,.35)
  );
  filter: blur(18px);
  opacity:.20;
  animation: spin 9s linear infinite;
  z-index:0;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.card > *{ position:relative; z-index:1; }

/* HUD */
.hud{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.status{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  min-width: 260px;
}
.dot{
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--neon1);
  box-shadow: 0 0 0 6px rgba(124,92,255,.16), 0 0 24px rgba(124,92,255,.18);
}
.turn{ font-weight:1000; letter-spacing:.2px; }
.hint{ font-size:12px; color:var(--muted); margin-top:4px; }
.pill{
  font-size:12px;
  font-weight:1000;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--muted);
}

.boardShell{
  padding:14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(124,92,255,.12), transparent 65%),
    radial-gradient(900px 600px at 80% 20%, rgba(45,226,230,.09), transparent 65%),
    rgba(255,255,255,.02);
  box-shadow:
    0 0 0 2px rgba(124,92,255,.12),
    0 18px 70px rgba(45,226,230,.10);
}

/* Board container: SVG will fill it */
#board{
  width: min(900px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 18px;
  overflow:hidden;
}

/* mini tip */
.miniTip{
  margin-top:12px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.tag{
  font-size:12px;
  font-weight:1000;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--muted);
}
.muted{ color:var(--muted); font-size:13px; }

/* Moves */
.side h3{ margin:0; font-size:14px; letter-spacing:.2px; }
.panelHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.moves{
  max-height: 560px;
  overflow:auto;
  padding-right: 6px;
}
.moves::-webkit-scrollbar{ width:8px; }
.moves::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.14); border-radius: 999px; }
.moveItem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  margin-bottom:8px;
  font-size: 13px;
}
.moveItem small{ color:var(--muted); }

/* Modal */
.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:22px;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(10px);
  z-index:999;
}
.modal.show{ display:flex; }
.modalBox{
  width:min(560px, 100%);
  border-radius: 24px;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  box-shadow: 0 18px 80px rgba(0,0,0,.55);
  padding:18px;
}
.modalTitle{ font-size:18px; font-weight:1000; }
.modalDesc{ margin-top:6px; color:var(--muted); font-size:13px; line-height:1.5; }
.modalActions{ margin-top:14px; display:flex; gap:10px; justify-content:flex-end; }
/* ====== FIX: native select dropdown dark theme ====== */
:root{
  color-scheme: dark; /* 关键：让表单控件走暗色系（影响下拉面板） */
}

.sel{
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px; /* 给右侧箭头留空间 */
  background-image:
    linear-gradient(135deg, rgba(124,92,255,.20), rgba(45,226,230,.12)),
    radial-gradient(12px 10px at 86% 50%, rgba(45,226,230,.35), transparent 60%),
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.75) 50%),
    linear-gradient(135deg, rgba(255,255,255,.75) 50%, transparent 50%);
  background-size:
    auto,
    auto,
    7px 7px,
    7px 7px;
  background-position:
    0 0,
    0 0,
    calc(100% - 16px) 55%,
    calc(100% - 11px) 55%;
  background-repeat: no-repeat;
}

/* 下拉面板里的每一项（部分浏览器支持） */
.sel option{
  background: #0b1224;     /* 深色背景 */
  color: rgba(255,255,255,.92);
}

/* 被选中项（部分浏览器支持） */
.sel option:checked{
  background: #13224a;
}

/* focus 更赛博一点 */
.sel:focus{
  border-color: rgba(45,226,230,.35);
  box-shadow: 0 0 0 3px rgba(45,226,230,.10), 0 0 24px rgba(45,226,230,.12);
}


:root{ color-scheme: dark; }
.sel option{ background:#0b1224; color:rgba(255,255,255,.92); }
.sel:focus{
  border-color: rgba(45,226,230,.35);
  box-shadow: 0 0 0 3px rgba(45,226,230,.10), 0 0 24px rgba(45,226,230,.12);
}
