* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, #1b2440 0%, #0d1220 55%, #070a12 100%);
  color: #e8ecff;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
.hidden { display: none !important; }
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lobby-box, .modal-box {
  width: min(880px, 100%);
  background: rgba(20, 26, 46, .92);
  border: 1px solid #33406b;
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 40px; letter-spacing: 4px; background: linear-gradient(90deg, #ffd166, #ff6b9a, #8be9fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 6px 0 0; color: #9aa7d0; font-size: 14px; letter-spacing: 1px; }
h3 { margin: 26px 0 12px; font-size: 15px; color: #aab6e8; font-weight: 600; letter-spacing: 1px; }
.user-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #aab6e8; }
.card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.card {
  background: #18213c; border: 1px solid #2e3a63; border-radius: 12px; padding: 14px;
  cursor: pointer; transition: .15s; text-align: left; color: inherit; font: inherit;
}
.card:hover { border-color: #6c7cff; transform: translateY(-2px); }
.card.selected { border-color: #ffd166; box-shadow: 0 0 0 1px #ffd166 inset; }
.card.locked { opacity: .55; }
.card .name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.card .desc { font-size: 12px; color: #9aa7d0; line-height: 1.5; }
.card .price { font-size: 12px; color: #ffd166; margin-top: 8px; display: inline-block; }
.wallet { margin: 22px 0 14px; font-size: 14px; color: #aab6e8; display: flex; gap: 18px; flex-wrap: wrap; }
.wallet b { color: #ffd166; font-size: 18px; }
.hint { color: #6f7ba5; font-size: 12px; margin-top: 14px; }
.btn {
  border: 1px solid #4a5a94; background: #243055; color: #e8ecff; border-radius: 10px;
  padding: 10px 18px; cursor: pointer; font: inherit; font-size: 14px; transition: .15s;
}
.btn:hover { background: #31406f; }
.btn.primary { background: linear-gradient(90deg, #5b6cff, #9d6bff); border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.15); }
.btn.big { width: 100%; padding: 15px; font-size: 17px; margin-top: 6px; }
.btn.small { padding: 7px 12px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.game-wrap { position: relative; width: min(960px, 100%); }
#game { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid #3a4778; background: #0b1020; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.hud { position: absolute; left: 12px; right: 12px; top: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.hud-col { background: rgba(8, 12, 24, .68); border-radius: 10px; padding: 8px 12px; min-width: 190px; }
.hud-col.right { text-align: right; }
.hud-text { font-size: 12px; color: #cdd6ff; line-height: 1.6; }
.hud-text.buffs { color: #9be7c4; max-width: 260px; }
.hpbar { width: 180px; height: 9px; background: #3a1e2e; border-radius: 9px; overflow: hidden; margin-bottom: 4px; }
#hpFill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d6d, #ff9f43); transition: width .15s; }
.minimap { position: absolute; right: 12px; bottom: 12px; background: rgba(8, 12, 24, .8); border: 1px solid #3a4778; border-radius: 10px; }
.toast { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); background: rgba(8,12,24,.9); border: 1px solid #6c7cff; padding: 10px 18px; border-radius: 10px; font-size: 14px; pointer-events: none; }
.modal { position: fixed; inset: 0; background: rgba(4, 6, 14, .78); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.modal-box { width: min(820px, 100%); }
.small-box { width: min(420px, 100%); text-align: center; }
.modal-box h2 { margin: 0 0 18px; font-size: 22px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.btn.tab { flex: 1; }
.btn.tab.active { background: #4a5a94; }
label { display: block; text-align: left; font-size: 13px; color: #aab6e8; margin-bottom: 12px; }
input { width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 8px; border: 1px solid #3a4778; background: #0e1428; color: #e8ecff; font: inherit; }
.error { color: #ff6b6b; font-size: 12px; min-height: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.choice { text-align: left; }
.muted { color: #9aa7d0; font-size: 13px; }
.result-body { color: #cdd6ff; line-height: 1.9; white-space: pre-line; }
@media (max-width: 640px) { .lobby-box, .modal-box { padding: 20px; } h1 { font-size: 30px; } }
