/* HUD Top-Left */
#hud {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  pointer-events: none;
}

#charPortrait {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #2a1a0a, #1a0a00);
  border: 2px solid var(--gold-dim);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 12px rgba(200, 162, 85, 0.3);
}
#charPortrait .avatar { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
#charPortrait .lv-badge {
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--gold), #b8860b);
  color: #1a0a00;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 8px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  white-space: nowrap;
}

.hud-info { display: flex; flex-direction: column; gap: 2px; position: relative; padding-top: 2px; padding-right: 34px; }
#charName { font-size: 13px; font-weight: bold; color: var(--gold); text-shadow: 1px 1px 2px #000; }
#bars { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.bar-row { display: flex; align-items: center; gap: 6px; }
.bar-icon { font-size: 12px; width: 16px; text-align: center; }
.bar-container {
  flex: 1; height: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.2s ease;
  position: relative;
}
.bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
  border-radius: 2px 2px 0 0;
}
.bar-text {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}
#hpBar .bar-fill { background: linear-gradient(to bottom, #ff3333, #aa0000); }
#mpBar .bar-fill { background: linear-gradient(to bottom, #3388ff, #0044aa); }
#expBar .bar-fill { background: linear-gradient(to bottom, #33dd33, #008800); }

#statsRow {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: #ccc;
  margin-top: 2px;
}
#statsRow span { text-shadow: 1px 1px 1px #000; cursor: help; }

/* Right HUD Panel */
#rightPanel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 188px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 12px 12px 16px;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(to left, rgba(6, 5, 8, 0.88) 0%, rgba(8, 7, 10, 0.72) 60%, rgba(10, 10, 12, 0) 100%);
  border-left: 1px solid rgba(200, 162, 85, 0.18);
  box-shadow: inset 12px 0 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
#rightPanel > * {
  pointer-events: auto;
  flex-shrink: 0;
}

/* Score Panel */
#scorePanel {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 4px 12px;
  box-shadow: none;
  backdrop-filter: none;
  border-bottom: 1px solid rgba(200, 162, 85, 0.15);
}
#scorePanel .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 5px;
  line-height: 1.3;
}
#scorePanel .row:last-child { margin-bottom: 0; }
#scorePanel .label { color: rgba(255, 255, 255, 0.55); font-size: 11px; }
#scorePanel .value { color: var(--gold); font-weight: bold; }
#scorePanel .value.combo { color: #ff6644; }
#scorePanel .value.wave { color: #88ccff; }
#scorePanel .wave-countdown { display: none; }
#scorePanel .wave-countdown.active { display: flex; }
#scorePanel .wave-countdown .value { color: #ffaa66; }

/* Pause Button */
#pauseBtn {
  position: absolute;
  top: 0; right: 0;
  width: 28px;
  height: 28px;
  background: rgba(30, 20, 10, 0.75);
  border: 1px solid rgba(200, 162, 85, 0.35);
  border-radius: 5px;
  color: var(--gold);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  pointer-events: auto;
  z-index: 20;
}
#pauseBtn:hover {
  background: rgba(200, 162, 85, 0.22);
  border-color: var(--gold);
  transform: scale(1.08);
}
#pauseBtn:active {
  transform: scale(0.95);
}

/* Skill Bar */
#skillBar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
}

.skill-slot {
  width: 52px; height: 58px;
  background: linear-gradient(to bottom, rgba(30,30,40,0.9), rgba(15,15,25,0.95));
  border: 1.5px solid #444;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 2px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  cursor: pointer;
}
.skill-slot.ready {
  border-color: var(--gold-dim);
  box-shadow: 0 0 8px rgba(200, 162, 85, 0.3);
}
.skill-slot.ready:hover {
  box-shadow: 0 0 14px rgba(200, 162, 85, 0.5);
  transform: translateY(-2px);
}
.skill-slot .key {
  position: absolute;
  top: 2px; left: 4px;
  font-size: 9px;
  color: #888;
  font-weight: bold;
}
.skill-slot .icon { width: 34px; height: 34px; object-fit: cover; border-radius: 3px; }
.skill-slot .sname { font-size: 8px; color: #999; white-space: nowrap; }
.skill-slot .cd-ring {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 5px;
  pointer-events: none;
}
.skill-slot .mp-cost {
  position: absolute;
  bottom: 1px; right: 3px;
  font-size: 8px;
  color: #4488ff;
}
.skill-tooltip {
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-bg);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 6px 10px;
  white-space: nowrap;
  display: none;
  z-index: 20;
  pointer-events: none;
}
.skill-slot:hover .skill-tooltip { display: block; }
.skill-tooltip .t-name { font-size: 13px; font-weight: bold; color: var(--gold); }
.skill-tooltip .t-desc { font-size: 11px; color: #aaa; margin-top: 2px; }
.skill-tooltip .t-info { font-size: 10px; color: #888; margin-top: 2px; }

/* Dodge */
#dodgeIndicator {
  position: absolute;
  bottom: 14px; left: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #aaa;
  pointer-events: none;
}
#dodgeIndicator .dodge-icon {
  width: 36px; height: 36px;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid #444;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
}
#dodgeIndicator .dodge-icon.ready { border-color: #88aaff; }
#dodgeIndicator .dodge-cd {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
}

/* Kill Log */
#killLog {
  position: relative;
  max-height: 110px;
  min-height: 40px;
  overflow: hidden;
  text-align: right;
  padding: 8px 4px;
  pointer-events: none;
  border-bottom: 1px solid rgba(200, 162, 85, 0.12);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0));
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#killLog::-webkit-scrollbar { display: none; }
.kill-item {
  font-size: 11px;
  color: #ffaa66;
  text-shadow: 1px 1px 2px #000;
  margin-bottom: 3px;
  transition: opacity 0.5s;
  animation: fadeIn 0.3s ease;
}

/* Equipment Sidebar */
#equipSidebar {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 10px 2px;
  box-shadow: none;
  backdrop-filter: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-bottom: 1px solid rgba(200, 162, 85, 0.12);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#equipSidebar::-webkit-scrollbar { display: none; }
#equipSidebar .es-title {
  font-size: 11px;
  color: var(--gold);
  font-weight: bold;
  text-align: left;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(200, 162, 85, 0.18);
  text-shadow: 1px 1px 2px #000;
}
#equipSidebar .es-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#equipSidebar .es-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 5px 7px;
  transition: background 0.15s, border-color 0.15s;
}
#equipSidebar .es-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(200, 162, 85, 0.22);
}
#equipSidebar .es-icon {
  width: 32px; height: 32px;
  object-fit: contain;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(200, 162, 85, 0.2);
  flex-shrink: 0;
}
#equipSidebar .es-empty {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0.3;
  flex-shrink: 0;
}
#equipSidebar .es-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#equipSidebar .es-name {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#equipSidebar .es-type {
  font-size: 9px;
  color: #999;
}

/* Minimap */
#minimapWrap {
  position: relative;
  margin-top: auto;
  padding-top: 10px;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: transparent;
  pointer-events: auto;
}
#minimap {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(200, 162, 85, 0.2);
  background: rgba(0, 0, 0, 0.4);
}
#minimapLabel {
  position: absolute;
  top: 14px; left: 8px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  text-shadow: 1px 1px 2px #000;
}

/* Combo */
#comboDisplay {
  position: absolute;
  top: 35%; left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  text-align: center;
  pointer-events: none;
}
#comboDisplay .combo-num {
  font-size: 52px;
  font-weight: bold;
  color: #ff4422;
  text-shadow: 0 0 20px rgba(255, 68, 34, 0.6), 2px 2px 4px #000;
  line-height: 1;
}
#comboDisplay .combo-label {
  font-size: 18px;
  color: #ffcc44;
  text-shadow: 1px 1px 3px #000;
}
#comboDisplay.milestone {
  display: block;
  animation: pulse 0.6s ease;
}

/* Wave Announce */
#waveAnnounce {
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  text-align: center;
  pointer-events: none;
}
#waveAnnounce .wa-num {
  font-size: 36px;
  font-weight: bold;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 2px 2px 4px #000;
}
#waveAnnounce .wa-sub {
  font-size: 16px;
  color: var(--gold-dim);
  margin-top: 4px;
  text-shadow: 1px 1px 2px #000;
}

/* Kill Milestone (xx斩) */
#killMilestone {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  text-align: center;
  pointer-events: none;
  z-index: 25;
}
#killMilestone.active {
  display: block;
  animation: kmBurst 2.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
#killMilestone .km-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 4px solid rgba(255, 215, 0, 0.6);
  transform: translate(-50%, -50%);
  opacity: 0;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), inset 0 0 40px rgba(255, 215, 0, 0.2);
}
#killMilestone.active .km-ring {
  animation: kmRing 1.4s ease-out forwards;
}
#killMilestone.active .km-ring2 {
  animation-delay: 0.25s;
  border-color: rgba(255, 68, 34, 0.55);
  box-shadow: 0 0 50px rgba(255, 68, 34, 0.35), inset 0 0 50px rgba(255, 68, 34, 0.15);
}
#killMilestone .km-text {
  position: relative;
  font-size: 96px;
  font-weight: 900;
  letter-spacing: 8px;
  background: linear-gradient(to bottom, #fff5c8, var(--gold), #ff4422);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.7)) drop-shadow(0 4px 8px rgba(0,0,0,0.8));
  line-height: 1;
  z-index: 2;
}
#killMilestone.active .km-text {
  animation: kmShake 0.5s ease forwards, kmTextGlow 2.4s ease forwards;
}
#killMilestone .km-sub {
  position: relative;
  font-size: 28px;
  font-weight: bold;
  color: #ff6644;
  text-shadow: 0 0 15px rgba(255, 68, 34, 0.6), 2px 2px 4px #000;
  margin-top: 8px;
  opacity: 0;
  z-index: 2;
}
#killMilestone.active .km-sub {
  animation: kmSub 2s ease 0.15s forwards;
}
@keyframes kmTextGlow {
  0% { filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.7)) drop-shadow(0 4px 8px rgba(0,0,0,0.8)); }
  50% { filter: drop-shadow(0 0 60px rgba(255, 215, 0, 1)) drop-shadow(0 0 90px rgba(255, 68, 34, 0.6)) drop-shadow(0 4px 8px rgba(0,0,0,0.8)); }
  100% { filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.7)) drop-shadow(0 4px 8px rgba(0,0,0,0.8)); }
}

/* Pickup Hint */
#pickupHint {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  padding: 8px 16px;
  display: none;
  text-align: center;
  pointer-events: none;
}
#pickupHint .ph-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 6px;
  display: block;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  border: 1px solid rgba(200, 162, 85, 0.3);
}
#pickupHint .ph-name { font-size: 13px; font-weight: bold; text-align: center; }
#pickupHint .ph-stats { font-size: 11px; color: #aaa; margin-top: 3px; text-align: center; }
#pickupHint .ph-compare { font-size: 10px; color: #888; margin-top: 2px; text-align: center; }
#pickupHint .ph-action { font-size: 11px; color: #888; margin-top: 4px; text-align: center; }

/* Equipment Panel */
#equipPanel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel-bg);
  border: 2px solid var(--gold-dim);
  border-radius: 8px;
  padding: 20px;
  display: none;
  z-index: 50;
  pointer-events: auto;
  min-width: min(340px, 90vw);
  max-width: 90vw;
  box-shadow: var(--shadow), 0 0 20px rgba(200, 162, 85, 0.2);
}
#equipPanel h3 {
  text-align: center;
  color: var(--gold);
  font-size: 18px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(200, 162, 85, 0.3);
}
.equip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.equip-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 8px;
  transition: background 0.2s;
}
.equip-slot:hover { background: rgba(255, 255, 255, 0.08); }
.equip-slot .slot-icon { font-size: 20px; width: 30px; text-align: center; }
.equip-slot .slot-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(200, 162, 85, 0.2);
  flex-shrink: 0;
}
.equip-slot .slot-info { flex: 1; }
.equip-slot .slot-name { font-size: 12px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equip-slot .slot-type { font-size: 10px; color: #888; }
.equip-slot .slot-stats { font-size: 10px; color: #aaa; margin-top: 2px; }
#equipPanel .close-hint {
  text-align: center;
  font-size: 11px;
  color: #666;
  margin-top: 12px;
}

/* Level Up Panel */
#levelUpPanel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel-bg);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 24px;
  display: none;
  z-index: 35;
  pointer-events: auto;
  min-width: min(420px, 90vw);
  max-width: 90vw;
  box-shadow: var(--shadow), 0 0 30px rgba(255, 215, 0, 0.3);
}
#levelUpPanel h2 {
  text-align: center;
  color: var(--gold);
  margin-bottom: 18px;
  font-size: 22px;
}
.reward-list {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.reward-card {
  flex: 1;
  max-width: 140px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.reward-card:hover {
  border-color: var(--gold-dim);
  background: rgba(200, 162, 85, 0.12);
  transform: translateY(-3px);
}
.reward-card .reward-icon { font-size: 28px; margin-bottom: 6px; }
.reward-card .reward-name { font-size: 14px; color: var(--gold); font-weight: bold; }
.reward-card .reward-desc { font-size: 11px; color: #aaa; margin-top: 4px; }

/* Pause */
#pauseOverlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(5, 5, 15, 0.78);
  display: none;
  z-index: 40;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: auto;
  backdrop-filter: blur(5px);
  overflow: hidden;
}

.pause-card {
  background: linear-gradient(145deg, rgba(20, 15, 10, 0.95), rgba(10, 8, 5, 0.98));
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 28px 36px;
  min-width: min(640px, 90vw);
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(200, 162, 85, 0.15);
  animation: fadeIn 0.3s ease;
}

.pause-header {
  margin-bottom: 18px;
}

.pause-icon {
  font-size: 48px;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
  animation: pulse 2.5s ease infinite;
}

#pauseOverlay h2 {
  font-size: 28px;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.3), 2px 2px 4px #000;
  margin-bottom: 4px;
  letter-spacing: 4px;
}

.pause-hint {
  font-size: 12px;
  color: #888;
}

.pause-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  text-align: left;
  margin-bottom: 20px;
}

/* 左侧：角色状态 */
.pause-left {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(200, 162, 85, 0.12);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pause-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pause-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.pause-title h3 {
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 4px;
}

.pause-title .lv-badge {
  position: static;
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
}

.pause-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pause-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pause-bar .pb-label {
  width: 36px;
  font-size: 12px;
  color: #aaa;
  text-align: right;
}

.pause-bar .pb-track {
  flex: 1;
  height: 18px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.pause-bar .pb-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 0.2s ease;
}

.pause-bar.hp .pb-fill { background: linear-gradient(90deg, #8b0000, #cc3333); }
.pause-bar.mp .pb-fill { background: linear-gradient(90deg, #003366, #3366cc); }
.pause-bar.exp .pb-fill { background: linear-gradient(90deg, #664400, #cc9900); }

.pause-bar .pb-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  font-weight: bold;
}

.pause-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pause-attr {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 162, 85, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pause-attr .pa-label {
  font-size: 12px;
  color: #aaa;
}

.pause-attr .pa-value {
  font-size: 15px;
  font-weight: bold;
  color: var(--gold);
}

.pause-combat {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.pause-stat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 162, 85, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pause-label {
  font-size: 11px;
  color: #888;
}

.pause-value {
  font-size: 16px;
  font-weight: bold;
  color: var(--gold);
}

/* 右侧：装备 */
.pause-right {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(200, 162, 85, 0.12);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.pause-right h3 {
  font-size: 16px;
  color: var(--gold);
  margin-bottom: 12px;
  text-align: center;
}

.pause-equip-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.pause-equip-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(200, 162, 85, 0.1);
  border-radius: 8px;
  padding: 8px;
}

.pause-equip-slot.empty {
  opacity: 0.7;
}

.pause-equip-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  object-fit: contain;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pause-equip-info {
  flex: 1;
  min-width: 0;
}

.pause-equip-name {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pause-equip-type {
  font-size: 11px;
  color: #888;
  margin-bottom: 2px;
}

.pause-equip-stats {
  font-size: 11px;
  color: #aaa;
}

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

.pause-resume {
  min-width: 160px;
  font-size: 16px;
  padding: 12px 24px;
  background: linear-gradient(to bottom, #ffe55c, var(--gold), #b8860b);
  color: #1a0a00;
  border: none;
  border-radius: 24px;
  font-weight: bold;
  transition: all 0.2s ease;
}
.pause-resume:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

.pause-back-chapter {
  min-width: 160px;
  font-size: 15px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-dim);
  border: 1px solid rgba(200, 162, 85, 0.35);
  border-radius: 24px;
  font-weight: bold;
  transition: all 0.2s ease;
}
.pause-back-chapter:hover {
  background: rgba(200, 162, 85, 0.15);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

/* Chapter Select */
#chapterScreen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(8, 6, 4, 0.96), rgba(15, 10, 6, 0.98));
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 35;
  padding: 30px 40px;
  box-sizing: border-box;
  overflow: hidden;
}

.chapter-header {
  text-align: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.chapter-header h2 {
  font-size: 32px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 2px 2px 4px #000;
  margin-bottom: 6px;
  letter-spacing: 4px;
}

.chapter-header p {
  font-size: 13px;
  color: #aaa;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 960px;
  width: 100%;
  align-items: start;
}

.chapter-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(30, 20, 10, 0.9), rgba(15, 10, 5, 0.95));
  border: 1px solid rgba(200, 162, 85, 0.2);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.chapter-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--gold);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(200, 162, 85, 0.2);
}

.chapter-cover-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
}

.chapter-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.35s ease;
}

.chapter-card:hover .chapter-cover {
  transform: scale(1.05);
}

.chapter-info {
  padding: 12px 14px;
  background: rgba(10, 7, 4, 0.95);
}

.chapter-info h3 {
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 4px;
}

.chapter-info p {
  font-size: 11px;
  color: #bbb;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chapter-back {
  margin-top: 24px;
  padding: 10px 28px;
  background: transparent;
  border: 1px solid rgba(200, 162, 85, 0.4);
  color: var(--gold);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .chapter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .chapter-info h3 {
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  #chapterScreen {
    padding: 20px;
    overflow-y: auto;
    justify-content: flex-start;
  }
  .chapter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .chapter-info {
    padding: 10px;
  }
  .chapter-info h3 {
    font-size: 12px;
  }
  .chapter-info p {
    font-size: 10px;
  }
}

.chapter-back:hover {
  background: rgba(200, 162, 85, 0.15);
  border-color: var(--gold);
}

/* Skin Select */
#skinScreen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(200, 162, 85, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(139, 0, 0, 0.12) 0%, transparent 35%),
    linear-gradient(160deg, #0a0705 0%, #110b06 45%, #050302 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 36;
  padding: 40px;
  box-sizing: border-box;
  overflow: hidden;
}

.skin-bg-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255, 215, 0, 0.06) 1.5px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 215, 0, 0.04) 1px, transparent 1px);
  background-size: 64px 64px, 96px 96px;
  animation: skinBgShift 24s linear infinite;
  opacity: 0.7;
}

@keyframes skinBgShift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-64px, -64px); }
}

.skin-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 36px;
  animation: fadeIn 0.6s ease both;
}

.skin-title-line {
  width: 80px;
  height: 3px;
  margin: 0 auto 14px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.skin-header h2 {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(to bottom, #fff9e0, var(--gold), #b8860b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.35));
  margin-bottom: 8px;
}

.skin-header p {
  font-size: 14px;
  color: var(--gold-dim);
  letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.skin-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px;
  max-width: 720px;
  width: 100%;
  animation: slideUp 0.7s ease 0.1s both;
}

.skin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(35, 25, 15, 0.92), rgba(15, 10, 5, 0.98));
  border: 1px solid rgba(200, 162, 85, 0.18);
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow:
    0 14px 45px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.skin-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(200, 162, 85, 0.55);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 30px rgba(200, 162, 85, 0.12);
}

.skin-card.selected {
  border-color: var(--gold);
  box-shadow:
    0 0 50px rgba(255, 215, 0, 0.22),
    0 14px 45px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.skin-glow {
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 215, 0, 0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.skin-card.selected .skin-glow {
  opacity: 1;
}

.skin-card.selected::after {
  content: '✓';
  position: absolute;
  top: 14px; right: 16px;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #1a0f05;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), 0 0 12px rgba(255,215,0,0.5);
  z-index: 3;
  animation: skinCheckPop 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes skinCheckPop {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.skin-preview-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 85%, rgba(200, 162, 85, 0.18) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 60%);
  box-sizing: border-box;
  overflow: hidden;
}

.skin-preview-wrap::before {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 70%; height: 40%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.45) 0%, transparent 70%);
  z-index: 0;
}

.skin-preview {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.7));
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.skin-card:hover .skin-preview {
  transform: scale(1.08) translateY(-6px);
}

.skin-card.selected .skin-preview {
  filter: drop-shadow(0 0 28px rgba(255, 215, 0, 0.35)) drop-shadow(0 14px 24px rgba(0,0,0,0.7));
}

.skin-rarity {
  position: absolute;
  top: 14px; left: 14px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  border-radius: 12px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.skin-rarity.epic {
  background: linear-gradient(135deg, #8a2be2, #4b0082);
  color: #fff;
}

.skin-rarity.legendary {
  background: linear-gradient(135deg, #ff8c00, #ff4500);
  color: #fff;
}

.skin-info {
  position: relative;
  z-index: 1;
  padding: 18px 16px 20px;
  text-align: center;
  background: rgba(8, 5, 3, 0.95);
  border-top: 1px solid rgba(200, 162, 85, 0.1);
}

.skin-info h3 {
  font-size: 20px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.skin-info p {
  font-size: 12px;
  color: #bbb;
  letter-spacing: 0.5px;
}

.skin-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  margin-top: 36px;
  animation: slideUp 0.8s ease 0.2s both;
}

.skin-actions .btn {
  min-width: 180px;
  padding: 14px 44px;
  border: none;
  border-radius: 30px;
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  background-size: 200% 100%;
  animation: skinBtnShine 3s linear infinite;
}

.skin-actions .btn:hover {
  transform: translateY(-3px) scale(1.05);
}

.skin-start {
  background: linear-gradient(90deg, #8b0000, #b8860b, #8b0000);
  box-shadow: 0 6px 22px rgba(139, 0, 0, 0.4), 0 0 18px rgba(200, 162, 85, 0.25);
}

.skin-start:hover {
  box-shadow: 0 10px 30px rgba(139, 0, 0, 0.5), 0 0 28px rgba(200, 162, 85, 0.4);
}

.skin-back {
  background: linear-gradient(90deg, #2a1d10, #5c4325, #2a1d10);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 18px rgba(200, 162, 85, 0.18);
}

.skin-back:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 28px rgba(200, 162, 85, 0.3);
}

@keyframes skinBtnShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 700px) {
  .skin-header h2 { font-size: 32px; }
  .skin-grid {
    gap: 20px;
    max-width: 460px;
  }
  .skin-preview { max-height: 160px; }
  .skin-actions { flex-direction: column; gap: 12px; }
  .skin-actions .btn { width: 220px; padding: 12px; font-size: 15px; }
}

@media (max-width: 420px) {
  #skinScreen { padding: 24px 16px; }
  .skin-grid { grid-template-columns: 1fr; max-width: 280px; }
  .skin-card { max-width: 280px; }
}

/* Chapter 4 Ad Lock */
#adLockOverlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(5, 5, 15, 0.94);
  display: none;
  z-index: 60;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: auto;
  backdrop-filter: blur(4px);
}

.ad-lock-card {
  background: linear-gradient(145deg, rgba(25, 15, 8, 0.98), rgba(12, 8, 4, 0.99));
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 24px 28px;
  width: min(720px, 90vw);
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(200, 162, 85, 0.2);
  animation: fadeIn 0.3s ease;
}

.ad-lock-card h2 {
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 8px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.ad-lock-card > p {
  font-size: 13px;
  color: #bbb;
  margin-bottom: 14px;
}

.ad-frame-wrap {
  width: 100%;
  height: 340px;
  background: #000;
  border: 1px solid rgba(200, 162, 85, 0.3);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

#adFrame {
  width: 100%;
  height: 100%;
  border: none;
}

.ad-fallback {
  font-size: 11px;
  color: #888;
  margin-bottom: 12px;
}

.ad-fallback a {
  color: var(--gold-dim);
  text-decoration: underline;
}

.ad-timer {
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

#adUnlockBtn {
  margin-bottom: 10px;
}

#adUnlockBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.ad-back-btn {
  padding: 8px 24px;
  font-size: 13px;
}

@media (max-width: 520px) {
  .ad-lock-card {
    padding: 18px 16px;
  }
  .ad-frame-wrap {
    height: 240px;
  }
}

/* Dialogue Box */
#dialogueBox {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 92vw);
  background: linear-gradient(145deg, rgba(20, 12, 6, 0.95), rgba(10, 6, 3, 0.98));
  border: 1.5px solid rgba(200, 162, 85, 0.55);
  border-radius: 14px;
  padding: 16px 18px;
  display: none;
  align-items: flex-start;
  gap: 14px;
  z-index: 34;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7), 0 0 24px rgba(200, 162, 85, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: dialogueSlideUp 0.35s ease both;
  user-select: none;
  -webkit-user-select: none;
}

@keyframes dialogueSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dialogue-portrait {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a1a0a, #1a0a00);
  border: 2px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  box-shadow: 0 0 16px rgba(200, 162, 85, 0.25);
}

.dialogue-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dialogue-speaker {
  font-size: 15px;
  font-weight: bold;
  color: var(--gold);
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 1px;
}

.dialogue-text {
  font-size: 15px;
  color: #f0e8dc;
  line-height: 1.6;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  min-height: 44px;
}

.dialogue-continue {
  align-self: flex-end;
  margin-top: 4px;
  padding: 7px 22px;
  background: linear-gradient(135deg, #ffe86e, var(--gold), #b8860b);
  border: none;
  border-radius: 18px;
  color: #1a0a00;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.dialogue-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 215, 0, 0.35);
}

.dialogue-continue:active {
  transform: translateY(0);
}

@media (max-width: 560px) {
  #dialogueBox {
    bottom: 90px;
    padding: 12px 14px;
    gap: 10px;
  }
  .dialogue-portrait {
    width: 54px;
    height: 54px;
    font-size: 28px;
  }
  .dialogue-speaker { font-size: 13px; }
  .dialogue-text { font-size: 13px; min-height: 36px; }
  .dialogue-continue { padding: 6px 16px; font-size: 12px; }
}
