/* 潇洒割草机 - HUD / 弹窗 / 升级面板 UI */

/* ---------------- HUD ---------------- */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 12px;
}

.hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hud-left { flex: 0 1 300px; }

.bar-block { display: grid; gap: 6px; }

.bar {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(3, 16, 12, .66);
  border: 1px solid rgba(255, 255, 255, .14);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
}

.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .18s ease-out;
}

.bar-hp i { background: linear-gradient(90deg, #ff7a7a, #ff4d4d); }
.bar-xp { height: 14px; }
.bar-xp i { background: linear-gradient(90deg, #7ee0a8, #c8ffdf); }

.bar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #04140f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.hud-center { text-align: center; flex: 1; }

.timer {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #eafff5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7), 0 0 22px rgba(126, 224, 168, .4);
  font-variant-numeric: tabular-nums;
}

.weapon-tag {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(214, 255, 235, .8);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

.weapon-tag b { color: var(--green); font-weight: 700; }

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.kill-box {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #d6ffea;
  background: rgba(4, 18, 14, .6);
  border: 1px solid rgba(126, 224, 168, .3);
  white-space: nowrap;
}

.kill-box b { color: var(--gold); font-size: 14px; }

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  max-width: min(70%, 620px);
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: #dfffef;
  background: rgba(4, 18, 14, .6);
  border: 1px solid rgba(126, 224, 168, .28);
  backdrop-filter: blur(3px);
}

.skill-chip i { font-style: normal; color: var(--gold); }

.skill-chip b {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #06211a;
  background: var(--green);
  font-weight: 800;
}

.skill-chip.empty { color: rgba(214, 255, 235, .55); border-style: dashed; }

/* 顶部中央横幅提示 */
.banner {
  position: absolute;
  left: 50%;
  top: 96px;
  transform: translate(-50%, -8px);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #06211a;
  background: linear-gradient(180deg, #b9ffd7, #6fe0a4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.banner.show { animation: bannerPop 2.2s ease forwards; }

@keyframes bannerPop {
  0% { opacity: 0; transform: translate(-50%, -14px) scale(.94); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(.98); }
}

/* ---------------- 弹窗通用 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 12, 9, .74);
  backdrop-filter: blur(4px);
  animation: modalFade .18s ease both;
  overflow-y: auto;
}

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(560px, 94vw);
  margin: auto;
  padding: 24px 22px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(17, 46, 37, .98), rgba(8, 24, 19, .99));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: cardPop .24s cubic-bezier(.2, .9, .3, 1.2) both;
}

.modal-card.small { width: min(380px, 94vw); text-align: center; }

@keyframes cardPop {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.modal-title {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: 2px;
  text-align: center;
  color: #eafff5;
}

.modal-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-dim);
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.modal-actions.wrap { flex-wrap: wrap; }

/* ---------------- 升级三选一 ---------------- */
.levelup-card { width: min(720px, 96vw); }

.choice-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  transition: opacity .12s ease;
}

.choice-list.picked { opacity: .45; }

.upgrade-card {
  position: relative;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: center;
  padding: 16px 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28, 68, 54, .9), rgba(10, 30, 24, .95));
  border: 1px solid rgba(126, 224, 168, .26);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background .14s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 176px;
}

.upgrade-card:hover,
.upgrade-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(42, 96, 74, .95), rgba(14, 40, 32, .98));
  box-shadow: 0 16px 34px rgba(0, 0, 0, .45), 0 0 0 1px rgba(126, 224, 168, .4) inset;
  outline: none;
}

.up-icon {
  font-size: 26px;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 209, 102, .5);
}

.upgrade-card h4 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 1px;
  color: #eafff5;
}

.upgrade-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-dim);
  flex: 1;
}

.up-level {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .5px;
  color: #06211a;
  background: var(--green);
  font-weight: 800;
  align-self: center;
}

/* ---------------- 结算 ---------------- */
.result-title {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: 3px;
  text-align: center;
}

.result-title.win { color: var(--gold); text-shadow: 0 0 24px rgba(255, 209, 102, .45); }
.result-title.lose { color: #ff8f8f; text-shadow: 0 0 24px rgba(255, 107, 107, .4); }

.result-stats {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(126, 224, 168, .12);
}

.stat-row span { color: var(--ink-dim); }

.stat-row strong {
  margin-left: auto;
  font-size: 15px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.stat-row em {
  font-style: normal;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #06211a;
  background: var(--gold);
  font-weight: 800;
}

.result-unlock {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  color: #06211a;
  background: linear-gradient(180deg, #ffe6a3, #ffd166);
}

.result-skills-title {
  margin: 16px 0 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-dim);
  text-align: center;
}

.result-skill-list {
  justify-content: center;
  max-width: 100%;
  align-self: stretch;
}

/* ---------------- 操作说明 ---------------- */
.help-list {
  margin: 14px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.9;
  color: #d9f6e8;
}

.help-list b { color: var(--green); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .choice-list { grid-template-columns: 1fr; }
  .upgrade-card { min-height: auto; flex-direction: row; align-items: center; text-align: left; gap: 10px; padding: 12px 14px; }
  .upgrade-card p { margin: 0; }
  .up-icon { font-size: 22px; }
  .up-level { align-self: center; margin-left: auto; }
  .upgrade-card h4 { font-size: 14px; }
  .upgrade-card { flex-wrap: wrap; }
  .upgrade-card p { flex-basis: 100%; }
  .timer { font-size: 20px; }
  .hud { padding: 8px; }
  .hud-left { flex-basis: 46vw; }
  .kill-box { padding: 4px 9px; font-size: 11px; }
  .btn-icon { width: 34px; height: 30px; font-size: 13px; }
  .banner { top: 74px; font-size: 12px; padding: 6px 14px; max-width: 88vw; overflow: hidden; text-overflow: ellipsis; }
  .modal-card { padding: 18px 16px 16px; }
  .result-title { font-size: 20px; }
  .skill-chip { font-size: 10px; padding: 3px 7px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .upgrade-card { min-height: 130px; padding: 10px 10px 8px; }
  .up-icon { font-size: 20px; }
  .modal-card { padding: 14px; }
  .banner { top: 62px; }
}

/* ================= v1.1 新增：必杀按钮 / 稀有度卡 / 设置 / 存档 ================= */

/* 角色标签 */
.char-tag {
  font-size: 10.5px;
  color: rgba(214, 255, 235, 0.75);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  margin-top: 2px;
}
.char-tag b { color: var(--green); }

/* HUD 底部：技能 + 必杀 */
.hud-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.special-btn {
  position: relative;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
  font-family: inherit;
  color: rgba(214, 255, 235, 0.55);
  background: rgba(4, 18, 14, 0.72);
  border: 2px solid rgba(126, 224, 168, 0.3);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  transition: transform .12s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.special-btn .special-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, rgba(126, 224, 168, .45), rgba(85, 201, 140, .22));
  transition: height .12s linear;
  pointer-events: none;
}

.special-btn .special-icon {
  position: relative;
  font-size: 20px;
  line-height: 1;
  font-style: normal;
}

.special-btn .special-label {
  position: relative;
  font-size: 9.5px;
  letter-spacing: .5px;
  margin-top: 2px;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-btn .special-cd {
  position: relative;
  font-size: 9px;
  font-weight: 800;
  color: rgba(214, 255, 235, .7);
}

.special-btn.ready {
  color: #06211a;
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(185, 255, 215, .95), rgba(111, 224, 164, .9));
  box-shadow: 0 0 0 3px rgba(126, 224, 168, .22), 0 8px 22px rgba(85, 201, 140, .35);
  animation: readyPulse 1.6s ease-in-out infinite;
}

.special-btn.ready .special-cd { color: #06211a; }

.special-btn:active { transform: scale(.94); }

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(126, 224, 168, .22), 0 8px 22px rgba(85, 201, 140, .3); }
  50% { box-shadow: 0 0 0 7px rgba(126, 224, 168, .1), 0 8px 26px rgba(85, 201, 140, .5); }
}

/* 稀有度卡片 */
.upgrade-card { position: relative; }

.up-rarity {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 2px 7px;
  border-radius: 999px;
  color: rgba(214, 255, 235, .85);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
}

.upgrade-card.rarity-rare {
  border-color: rgba(143, 208, 255, .75);
  background: linear-gradient(180deg, rgba(30, 62, 96, .9), rgba(10, 28, 42, .95));
  box-shadow: 0 0 0 1px rgba(143, 208, 255, .3) inset, 0 10px 26px rgba(0, 0, 0, .4);
}
.upgrade-card.rarity-rare .up-rarity {
  color: #06202e;
  background: linear-gradient(180deg, #cdeaff, #8fd0ff);
  border-color: transparent;
}

.upgrade-card.rarity-shiny {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(74, 62, 24, .92), rgba(30, 26, 12, .96));
  box-shadow: 0 0 0 1px rgba(255, 209, 102, .45) inset, 0 0 26px rgba(255, 209, 102, .28);
}
.upgrade-card.rarity-shiny .up-rarity {
  color: #2b1f00;
  background: linear-gradient(180deg, #fff0bd, #ffd166);
  border-color: transparent;
}
.upgrade-card.rarity-shiny .up-icon {
  animation: shinySpin 3s linear infinite;
}

@keyframes shinySpin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.12) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* 屏蔽按钮 */
.up-ban {
  margin-top: 6px;
  align-self: stretch;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: .5px;
  padding: 5px 8px;
  border-radius: 8px;
  color: rgba(214, 255, 235, .7);
  background: rgba(0, 0, 0, .3);
  border: 1px dashed rgba(255, 255, 255, .18);
  transition: all .14s ease;
}
.up-ban:hover {
  color: #ffdada;
  border-color: rgba(255, 107, 107, .6);
  background: rgba(255, 107, 107, .16);
}

.levelup-pending {
  margin: 2px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
  min-height: 14px;
}

/* 进化弹窗 */
.evo-card { text-align: center; border-color: rgba(255, 209, 102, .5); }
.evo-stars {
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--gold);
  margin-bottom: 6px;
  text-shadow: 0 0 16px rgba(255, 209, 102, .7);
}
.evo-name {
  margin: 10px 0 6px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(255, 209, 102, .55);
}

.evo-burst { animation: evoFlash .9s ease both; }
@keyframes evoFlash {
  0% { background: rgba(255, 209, 102, .7); }
  60% { background: rgba(3, 12, 9, .74); }
  100% { background: rgba(3, 12, 9, .74); }
}

/* 存档区块 */
.save-block {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(126, 224, 168, .14);
}
.save-block-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--green);
  margin-bottom: 6px;
}
.save-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.modal-actions.left { justify-content: flex-start; margin-top: 0; }
.hidden-file { display: none; }

/* 设置 */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px;
  font-size: 13px;
  border-bottom: 1px solid rgba(126, 224, 168, .1);
}
.setting-row label { color: #d9f6e8; }

.field-select {
  padding: 8px 10px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  color: #d9fff0;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(126, 224, 168, .25);
  outline: none;
}

.switch { position: relative; width: 46px; height: 26px; cursor: pointer; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(126, 224, 168, .25);
  transition: background .18s ease;
}
.switch i::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #cfe9dd;
  transition: transform .18s ease;
}
.switch input:checked + i { background: linear-gradient(180deg, #8ef0b8, #4fbf87); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(20px); background: #06211a; }

/* 小屏适配补充 */
@media (max-width: 640px) {
  .special-btn { width: 60px; height: 60px; }
  .special-btn .special-icon { font-size: 16px; }
  .special-btn .special-label { font-size: 8px; max-width: 54px; }
  .up-rarity { position: static; align-self: flex-start; margin-bottom: 2px; }
  .up-ban { margin-left: auto; align-self: center; }
  .upgrade-card { align-items: flex-start; }
  .hud-bottom { align-items: flex-end; }
  .save-block { padding: 10px; }
  .modal-actions.left { flex-direction: row; }
  .modal-actions.left .btn { width: auto; flex: 1; }
}
