* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  background: #0b1020; overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
#game-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
#game-container canvas {
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}
.hidden { display: none !important; }
#banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0, 0, 0, .55); color: #ffe08a;
  padding: 8px 18px; border-radius: 20px; font-size: 14px;
  z-index: 20; backdrop-filter: blur(4px); white-space: nowrap;
  transition: opacity .8s ease;
}
#banner.fade { opacity: 0; pointer-events: none; }
#progress-toggle {
  float: right; background: rgba(255,255,255,.1); color: #e8ecf8;
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  width: 26px; height: 22px; cursor: pointer; font-size: 13px; line-height: 1;
}
#progress-toggle:hover { background: rgba(255,255,255,.22); }
#progress-fab {
  position: fixed; top: 12px; right: 12px; z-index: 20;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(10, 14, 30, .85); border: 1px solid rgba(255,255,255,.15);
  font-size: 20px; cursor: pointer; backdrop-filter: blur(6px);
}
#progress-fab:hover { background: rgba(30, 38, 70, .9); }
#progress-panel {
  position: fixed; top: 12px; right: 12px;
  width: 300px; max-height: calc(100vh - 24px); overflow-y: auto;
  background: rgba(10, 14, 30, .85);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px; color: #e8ecf8;
  padding: 14px 14px 10px; z-index: 20;
  backdrop-filter: blur(6px);
}
#progress-panel h3 { font-size: 15px; margin-bottom: 6px; }
#build-info { font-size: 11px; color: #9aa3c0; margin-bottom: 10px; }
#build-ver { color: #7ee2a8; font-family: monospace; }
#task-list { list-style: none; }
.task {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px; border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: 13px;
}
.task:last-child { border-bottom: none; }
.task .t-name { flex: 1; line-height: 1.4; }
.task .t-eta { font-size: 11px; color: #9aa3c0; white-space: nowrap; }
.task.done .t-name { color: #7ee2a8; }
.task.doing .t-name { color: #ffd166; font-weight: 600; }
.task.todo .t-name { color: #8b93ad; }
@media (max-width: 900px) {
  #progress-panel { width: 230px; }
  #banner { font-size: 12px; }
}

/* ---- 进入界面遮罩 ---- */
#entry-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 26, .72);
  backdrop-filter: blur(6px);
}
#entry-overlay.hidden { display: none; }
.entry-card {
  width: 380px; max-width: calc(100vw - 40px);
  background: linear-gradient(160deg, #1b2547, #121a36);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px; padding: 28px 28px 22px;
  color: #eef1fb; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.entry-card h1 { font-size: 24px; margin-bottom: 6px; }
.entry-sub { font-size: 13px; color: #9aa3c0; margin-bottom: 18px; }
.field { text-align: left; margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: #aab3d4; margin-bottom: 8px; }
.name-row { display: flex; gap: 8px; }
#entry-name {
  flex: 1; font-size: 16px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07); color: #fff; outline: none;
}
#entry-name:focus { border-color: #7ec8f7; }
#entry-dice {
  font-size: 20px; width: 46px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08);
}
#entry-dice:hover { background: rgba(255, 255, 255, .16); }
.species-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.species-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 4px; font-size: 13px; color: #dfe5f7; cursor: pointer;
  border-radius: 12px; border: 2px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
}
.species-card .sp-emoji { width: 44px; height: 44px; object-fit: contain; }
.species-card.selected { border-color: #7ec8f7; background: rgba(126, 200, 247, .16); }
.color-row { display: flex; gap: 10px; justify-content: flex-start; }
.color-dot {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; outline: 2px solid rgba(255, 255, 255, .18);
}
.color-dot.selected { outline: 3px solid #fff; transform: scale(1.12); }
#entry-go {
  width: 100%; margin-top: 8px; padding: 13px; font-size: 17px; font-weight: 700;
  border: none; border-radius: 12px; cursor: pointer;
  color: #10203a; background: linear-gradient(90deg, #7ee2a8, #7ec8f7);
}
#entry-go:disabled { opacity: .55; cursor: default; }
.entry-tip { margin-top: 12px; font-size: 11px; color: #7c86a8; }

/* ---- 连接中 ---- */
#loading {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #ffe08a; background: rgba(8, 12, 26, .6);
}
#loading.hidden { display: none; }
