* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a1218; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e8f0ec; user-select: none; touch-action: none;
}
#stage { position: fixed; inset: 0; }
#game { width: 100%; height: 100%; display: block; }

#stick {
  position: fixed; left: 24px; bottom: 24px; width: 108px; height: 108px; z-index: 30;
  border-radius: 50%; background: rgba(20,36,40,.5); border: 2px solid rgba(160,200,140,.35);
}
#knob {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px;
  border-radius: 50%; background: rgba(180,210,150,.75); border: 2px solid #cef;
}
.fab {
  position: fixed; right: 20px; bottom: 28px; z-index: 30;
  padding: 12px 18px; background: rgba(30,50,40,.9); border: 1px solid #5a8a60;
  color: #dff; font-weight: 700; font-family: inherit; cursor: pointer;
}
#btn-interact:not([hidden]) { display: none; }
@media (pointer: coarse) {
  #btn-interact:not([hidden]) { display: block; }
}

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#hud-top {
  display: flex; gap: 14px; padding: 10px 14px;
  background: linear-gradient(180deg, rgba(8,16,14,.88), transparent);
  font-size: 13px; font-weight: 700;
}
#hud-map { color: #b8e080; }
#hud-gold { color: #e8d080; }
#hud-herb { color: #80d0a0; }
#hud-party {
  padding: 0 14px; font-size: 12px; color: #a8c4b8;
}

.panel-float {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(520px, 94vw); z-index: 40; pointer-events: auto;
  background: rgba(12,20,24,.92); border: 1px solid #3a5a48; border-top: 3px solid #7ab060;
  padding: 12px 14px;
}
.panel-float.battle { bottom: 12px; }
#dialog-spk { color: #b8e080; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
#dialog-text { font-size: 14px; line-height: 1.7; color: #d0e4d8; min-height: 44px; }
#dialog-choices, #battle-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#battle-turn { color: #e8d080; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
#battle-log { font-size: 12px; color: #8ab098; max-height: 72px; overflow: hidden; line-height: 1.5; }
.dlg-btn {
  padding: 8px 12px; background: #1a3028; border: 1px solid #3a5a48; color: #dff;
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.dlg-btn.primary { background: #2a6040; border-color: #7ab060; }

.overlay[hidden] { display: none; }
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(30,50,40,.85), rgba(6,10,12,.96));
  overflow-y: auto; padding: 16px;
}
.panel {
  width: min(520px, 94vw); background: #101820; border: 1px solid #2a4a40;
  border-top: 3px solid #7ab060; padding: 24px 28px;
}
.logo {
  font-size: clamp(24px, 5vw, 34px); font-weight: 900; letter-spacing: .06em;
  background: linear-gradient(90deg, #b8e080, #70c0a0); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.logo.sm { font-size: 22px; }
.sub { color: #6a9a78; font-size: 13px; margin: 4px 0 12px; letter-spacing: .08em; }
.intro { font-size: 13.5px; line-height: 1.85; color: #a8c4b0; margin-bottom: 14px; }
.menu-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn {
  padding: 9px 16px; font-size: 13px; font-weight: 700; background: #1e3030; color: #e0f0ec;
  border: 1px solid #3a5a50; cursor: pointer; text-decoration: none; display: inline-block; font-family: inherit;
}
.btn.primary { background: #2a6040; border-color: #7ab060; }
.btn.ghost { background: transparent; }
.help-body { font-size: 13.5px; line-height: 1.9; color: #a8c4b0; }
.help-body b { color: #b8e080; }
.help-body p { margin-bottom: 8px; }
.board { margin: 8px 0; max-height: 150px; overflow-y: auto; }
.board-row { display: flex; gap: 8px; padding: 4px 6px; font-size: 12px; border-bottom: 1px solid #1a2830; }
.board-rank { color: #7ab060; font-weight: 800; width: 28px; }
.board-score { margin-left: auto; color: #ffd257; font-weight: 700; }
.board-empty { color: #5a6a70; font-size: 12px; padding: 8px; }
.submit-row { display: flex; gap: 8px; margin: 10px 0 4px; }
#player-name {
  flex: 1; padding: 10px; background: #182028; border: 1px solid #2a4a50; color: #e8f0f4; font-family: inherit;
}
#submit-status { font-size: 12px; color: #6a9a98; min-height: 18px; }
