:root {
  --rose: #ff5f9f;
  --gold: #ffc85c;
  --mint: #4fcfe2;
  --berry: #c53b71;
  --hud-bg: rgba(28, 5, 30, 0.64);
  --hud-border: rgba(255, 200, 130, 0.26);
  --hud-text: rgba(255, 249, 252, 0.97);
  --hud-blur: blur(16px);
  --hud-glow: 0 0 10px rgba(255, 95, 159, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  background: #0e0416;
  font-family: "Noto Sans TC", sans-serif;
}

button {
  font: inherit;
}

/* ═══ 外框 ═══ */
.game-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 90% 80% at 50% 55%, #27093a, #0a0216);
}

/* 全螢幕容器，canvas 直接填滿視窗 */
.playfield {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffe6ef;
  touch-action: none;
}

/* ═══ 頂部 HUD ═══ */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px 56px;
  background: linear-gradient(180deg, rgba(14, 3, 18, 0.86) 0%, transparent 100%);
  pointer-events: none;
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: var(--hud-blur);
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  box-shadow: 0 0 12px rgba(255, 95, 159, 0.6), 0 0 24px rgba(255, 200, 92, 0.3);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.brand-name {
  font-family: "Fredoka", "Noto Sans TC", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--hud-text);
  text-shadow: var(--hud-glow);
  white-space: nowrap;
}

.stat-strip {
  display: flex;
  gap: 7px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 16px 6px;
  border-radius: 999px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: var(--hud-blur);
  min-width: 68px;
}

.stat-chip span {
  font-family: "Fredoka", sans-serif;
  font-size: 0.64rem;
  font-weight: 600;
  color: rgba(255, 200, 150, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.stat-chip strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--hud-text);
  line-height: 1.1;
  text-shadow:
    0 0 7px rgba(255, 200, 120, 0.75),
    0 0 16px rgba(255, 95, 159, 0.4);
}

.hud-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
  pointer-events: auto;
}

#pause-button {
  cursor: pointer;
  border: 1px solid var(--hud-border);
  min-height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--hud-text);
  background: var(--hud-bg);
  backdrop-filter: var(--hud-blur);
  font-weight: 800;
  font-size: 0.88rem;
  text-shadow: var(--hud-glow);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

#pause-button:hover {
  background: rgba(255, 95, 159, 0.28);
  box-shadow: 0 0 16px rgba(255, 95, 159, 0.3);
}

#save-status {
  color: rgba(255, 190, 140, 0.65);
  font-size: 0.68rem;
  text-align: right;
}

/* ═══ Boss HUD（右上） ═══ */
.boss-hud {
  position: absolute;
  right: 14px;
  top: 64px;
  width: min(300px, calc(100% - 28px));
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--hud-bg);
  border: 1px solid rgba(255, 80, 140, 0.38);
  backdrop-filter: var(--hud-blur);
  box-shadow: 0 0 28px rgba(255, 60, 120, 0.18);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.boss-hud.hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.boss-hud span,
.boss-hud b {
  display: block;
  color: rgba(255, 200, 220, 0.94);
  font-weight: 800;
}

.boss-hud span {
  margin-bottom: 7px;
  font-size: 0.85rem;
  text-shadow: 0 0 8px rgba(255, 95, 159, 0.7);
}

.boss-hud b {
  margin-top: 5px;
  font-size: 0.75rem;
  text-align: right;
  opacity: 0.72;
}

.boss-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.boss-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4f8e, #ffc85c);
  box-shadow: 0 0 10px rgba(255, 79, 142, 0.7);
  transition: width 0.15s ease;
}

/* ═══ 左下 HUD 容器 ═══ */
.bottom-left-hud {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(360px, calc(100% - 28px));
  pointer-events: none;
}

.build-strip {
  position: absolute;
  left: 14px;
  bottom: 80px;
  width: min(360px, calc(100% - 28px));
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: var(--hud-blur);
  pointer-events: none;
}

.build-strip span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 95, 159, 0.13);
  color: rgba(255, 225, 238, 0.92);
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 95, 159, 0.2);
}

.vitals {
  display: grid;
  gap: 7px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: var(--hud-blur);
}

.bar-row {
  display: grid;
  grid-template-columns: 44px 1fr 76px;
  gap: 9px;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(255, 235, 248, 0.9);
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), #ff9c7a);
  box-shadow: 0 0 7px rgba(255, 95, 159, 0.65);
  transition: width 0.18s ease;
}

.bar.xp i {
  background: linear-gradient(90deg, var(--gold), var(--mint));
  box-shadow: 0 0 7px rgba(255, 200, 92, 0.6);
}

/* ═══ 歌詞（右下） ═══ */
@keyframes lyric-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 18px rgba(255, 117, 181, 0.46),
      0 0 36px rgba(255, 212, 105, 0.22),
      inset 0 0 12px rgba(255, 117, 181, 0.08);
  }
  50% {
    box-shadow:
      0 0 32px rgba(255, 117, 181, 0.72),
      0 0 58px rgba(255, 212, 105, 0.42),
      0 0 80px rgba(255, 95, 159, 0.24),
      inset 0 0 18px rgba(255, 117, 181, 0.14);
  }
}

@keyframes lyric-appear {
  from { opacity: 0; transform: translateY(7px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0);   }
}

.lyrics-box {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: min(520px, calc(100% - 36px));
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 18px 28px;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 120, 0.52);
  background:
    linear-gradient(135deg, rgba(86, 31, 76, 0.52), rgba(255, 122, 176, 0.28)),
    rgba(255, 251, 246, 0.1);
  backdrop-filter: blur(12px);
  pointer-events: none;
  animation: lyric-glow-pulse 2.4s ease-in-out infinite;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.lyrics-box.hidden {
  opacity: 0;
  transform: translateY(10px);
  animation: none;
}

.lyrics-box span {
  color: #fff9fc;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Segoe UI", sans-serif;
  font-size: 1.58rem;
  font-weight: 900;
  line-height: 1.55;
  text-align: right;
  letter-spacing: 0.03em;
  text-shadow:
    0 0 3px rgba(80, 12, 55, 0.98),
    0 0 8px rgba(255, 95, 159, 1),
    0 0 18px rgba(255, 95, 159, 0.9),
    0 0 34px rgba(255, 203, 93, 0.78),
    0 0 54px rgba(255, 140, 200, 0.46);
}

.lyrics-box span.lyric-fresh {
  animation: lyric-appear 0.38s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* ═══ Title overlay（全螢幕三大卡片） ═══ */
.title-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-top: max(env(safe-area-inset-top, 0), 1vh);
  padding-bottom: max(env(safe-area-inset-bottom, 0), 2vh);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  z-index: 20;
  background: url("assets/dessert-world-night-bg.png") center / cover no-repeat;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.title-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 卡片底部漸層（配合夜晚紫色調） */
.title-overlay::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52%;
  background: linear-gradient(
    to top,
    rgba(12, 4, 28, 0.80) 0%,
    rgba(20, 6, 42, 0.55) 45%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* 隱藏標題畫面時不需要的 HUD */
.playfield.title-mode .hud-top,
.playfield.title-mode .bottom-left-hud,
.playfield.title-mode .build-strip,
.playfield.title-mode .boss-hud,
.playfield.title-mode .strategy-bar {
  display: none !important;
}

.title-logo-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  width: 100%;
  padding: 0 12px;
}

.title-logo-main {
  width: min(680px, 90vw);
  max-height: 52vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 32px rgba(197, 59, 113, 0.55));
}

.title-kicker {
  margin: 2px 0 0;
  color: rgba(255, 200, 130, 0.95);
  font: 700 clamp(0.72rem, 2.2vw, 1.05rem) "Fredoka", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  text-shadow: 0 2px 10px rgba(255, 200, 92, 0.45);
}

/* ── 三大卡片行 ── */
.title-cards {
  display: flex;
  gap: clamp(8px, 2vw, 28px);
  padding: 0 clamp(10px, 3vw, 40px);
  width: 100%;
  max-width: 1000px;
  justify-content: center;
  align-items: flex-end;
  flex-shrink: 0;
}

.title-card {
  flex: 1;
  max-width: clamp(150px, 22vw, 260px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}

.title-card:hover { transform: translateY(-6px); filter: brightness(1.08); }
.title-card:active { transform: translateY(-2px); filter: brightness(0.95); }

.card-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
  transition: filter 0.18s ease;
}

.title-card:hover .card-img {
  filter: drop-shadow(0 14px 32px rgba(0,0,0,0.6));
}

.card-continue {
  min-width: 0;
  transform: translateY(-8px);
}
.card-continue:hover { transform: translateY(-14px); }
.card-continue:active { transform: translateY(-10px); }
.card-continue.disabled {
  opacity: 0.38;
  pointer-events: none;
  filter: grayscale(0.45);
}

/* 移除舊的 icon/strong/em 樣式，已改用圖片 */
.card-icon, .title-card strong, .title-card em { display: none; }

.card-icon {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1;
  color: #ffd97a;
  text-shadow: 0 0 20px rgba(255, 200, 80, 0.9), 0 0 40px rgba(255, 200, 80, 0.45);
  display: block;
}

.title-card strong {
  font-family: "Fredoka", "Noto Sans TC", sans-serif;
  font-size: clamp(1.15rem, 3.2vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  line-height: 1.1;
}

.title-card em {
  font-style: normal;
  font-size: clamp(0.62rem, 1.5vw, 0.85rem);
  color: rgba(255, 220, 240, 0.78);
  text-align: center;
  line-height: 1.4;
}

/* ═══ Select modal（難度/角色/世界） ═══ */
.select-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 2, 16, 0.72);
  backdrop-filter: blur(14px);
  z-index: 30;
  padding: 12px;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.select-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.select-panel {
  width: min(540px, calc(100% - 16px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 16px;
  background: rgba(28, 5, 38, 0.96);
  border: 1px solid rgba(255, 200, 130, 0.3);
  box-shadow: 0 24px 72px rgba(0,0,0,0.7), 0 0 50px rgba(255, 95, 159, 0.12);
  display: flex;
  flex-direction: column;
}

.select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 200, 130, 0.15);
}

.select-header h3 {
  font-family: "Fredoka", "Noto Sans TC", sans-serif;
  font-size: 1.25rem;
  color: var(--hud-text);
}

.select-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 130, 0.2);
  background: rgba(255,255,255,0.06);
  color: rgba(255, 220, 238, 0.8);
  cursor: pointer;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}
.select-close-btn:hover { background: rgba(255, 95, 159, 0.2); }

.select-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
}

.sel-tab {
  flex: 1;
  padding: 7px 4px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,0.05);
  color: rgba(255, 210, 228, 0.6);
  font: 700 0.85rem "Noto Sans TC", sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sel-tab.active {
  background: rgba(255, 95, 159, 0.2);
  color: rgba(255, 220, 240, 0.95);
  border-bottom: 2px solid var(--rose);
}

.sel-tab:hover:not(.active) {
  background: rgba(255,255,255,0.09);
}

.select-tab-body {
  padding: 16px 20px 20px;
}

.sel-pane { display: block; }
.sel-pane.hidden { display: none; }

/* difficulty-box inside select modal */
#sel-pane-difficulty .difficulty-box {
  max-width: none;
  margin: 0 0 14px;
}
#sel-pane-difficulty .difficulty-options {
  grid-template-columns: repeat(3, 1fr);
}

/* ═══ 過場影片 ═══ */
.cutscene-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutscene-overlay.hidden {
  display: none;
}

#cutscene-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cutscene-skip {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 10px;
  border-radius: 4px;
  pointer-events: none;
  letter-spacing: 0.03em;
  animation: skip-fade 0.6s ease 1.5s both;
}

@keyframes skip-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ Stage overlay / Game over ═══ */
.stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 8px;
  background: rgba(8, 1, 14, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 20;
}

.stage-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-panel {
  width: min(520px, calc(100% - 36px));
  padding: 28px;
  text-align: center;
  border-radius: 14px;
  background: rgba(28, 5, 38, 0.9);
  border: 1px solid rgba(255, 200, 130, 0.28);
  backdrop-filter: blur(22px);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 95, 159, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ending-art.hidden {
  display: none;
}

.ending-art {
  display: block;
  width: min(540px, 94%);
  max-height: 280px;
  object-fit: cover;
  margin: -8px auto 16px;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.overlay-kicker {
  margin: 0 0 8px;
  color: rgba(255, 200, 130, 0.9);
  font: 700 0.84rem "Fredoka", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h2 {
  font-family: "Fredoka", "Noto Sans TC", sans-serif;
  font-size: 2rem;
  line-height: 1.05;
  color: var(--hud-text);
  text-shadow:
    0 0 12px rgba(255, 95, 159, 0.45),
    0 0 32px rgba(255, 200, 92, 0.2);
}

.overlay-panel p:not(.overlay-kicker) {
  margin: 12px auto 0;
  max-width: 390px;
  color: rgba(255, 210, 228, 0.72);
  line-height: 1.7;
  font-size: 0.94rem;
}

.difficulty-box {
  display: grid;
  gap: 8px;
  max-width: 300px;
  margin: 18px auto 0;
}

.difficulty-box > span {
  color: rgba(255, 200, 130, 0.9);
  font-weight: 800;
  font-size: 0.9rem;
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.difficulty {
  min-height: 38px;
  border: 1px solid rgba(255, 95, 159, 0.28);
  border-radius: 999px;
  color: rgba(255, 220, 238, 0.88);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-weight: 900;
  backdrop-filter: blur(6px);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.difficulty:hover {
  background: rgba(255, 95, 159, 0.16);
}

.difficulty.active {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(255, 95, 159, 0.45);
}

.mechanics-hint {
  margin: 14px auto 0;
  max-width: 370px;
  padding: 10px 14px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 200, 130, 0.13);
  text-align: left;
}

.hint-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hint-list li {
  color: rgba(255, 210, 230, 0.68);
  font-size: 0.81rem;
  line-height: 1.5;
}

.hint-list b { font-weight: 700; }
.hint-list .c-attack { color: #ff9fcf; }
.hint-list .c-manual { color: #ffd77a; }

kbd {
  display: inline-block;
  padding: 1px 7px 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 200, 130, 0.26);
  color: rgba(255, 218, 155, 0.92);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.overlay-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

#overlay-button {
  min-width: 128px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 95, 159, 0.42);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

#overlay-button:hover {
  box-shadow: 0 12px 36px rgba(255, 95, 159, 0.6);
  transform: translateY(-1px);
}

#new-game-button,
#title-button {
  min-width: 108px;
  min-height: 44px;
  border: 1px solid var(--hud-border);
  border-radius: 999px;
  color: rgba(255, 225, 238, 0.9);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.18s ease;
}

#new-game-button:hover,
#title-button:hover {
  background: rgba(255, 95, 159, 0.18);
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.upgrade-card {
  display: grid;
  gap: 7px;
  min-height: 108px;
  padding: 14px 12px;
  border-radius: 10px;
  color: rgba(255, 235, 248, 0.92);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 95, 159, 0.2);
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.upgrade-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 95, 159, 0.13);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 0 22px rgba(255, 95, 159, 0.22);
}

.upgrade-card span {
  font-size: 1.7rem;
  color: var(--rose);
  text-shadow: 0 0 10px rgba(255, 95, 159, 0.7);
}

.upgrade-card strong {
  font-size: 1rem;
  color: var(--hud-text);
}

.upgrade-card em {
  color: rgba(255, 210, 228, 0.68);
  font-style: normal;
  font-size: 0.85rem;
  line-height: 1.45;
}

/* ═══ 成長策略選擇器 ═══ */
.strategy-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 4, 28, 0.72);
  border: 1px solid rgba(255, 200, 130, 0.22);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  z-index: 15;
  white-space: nowrap;
  pointer-events: auto;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.strategy-bar.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  pointer-events: none;
}

.strategy-label {
  color: rgba(255, 200, 130, 0.6);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 4px;
}

.strat-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 225, 245, 0.45);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.strat-btn .strat-icon {
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1;
}

.strat-btn[data-strategy="attack"].active  { background: rgba(255,95,159,0.22); border-color: rgba(255,95,159,0.52); color: #ff9fcf; }
.strat-btn[data-strategy="attack"]:hover:not(.active)   { background: rgba(255,95,159,0.12); color: #ff9fcf; }

.strat-btn[data-strategy="defense"].active { background: rgba(79,207,226,0.2);  border-color: rgba(79,207,226,0.5);  color: #7ae4f4; }
.strat-btn[data-strategy="defense"]:hover:not(.active)  { background: rgba(79,207,226,0.1);  color: #7ae4f4; }

.strat-btn[data-strategy="recovery"].active{ background: rgba(92,214,122,0.2);  border-color: rgba(92,214,122,0.5);  color: #80eba0; }
.strat-btn[data-strategy="recovery"]:hover:not(.active) { background: rgba(92,214,122,0.1);  color: #80eba0; }

.strat-btn[data-strategy="manual"].active  { background: rgba(255,200,92,0.2);  border-color: rgba(255,200,92,0.5);  color: #ffd77a; }
.strat-btn[data-strategy="manual"]:hover:not(.active)   { background: rgba(255,200,92,0.1);  color: #ffd77a; }

/* ═══ 手動配點面板（策略列上方） ═══ */
.upgrade-bottom {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: min(490px, calc(100% - 30px));
  z-index: 15;
  pointer-events: auto;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.upgrade-bottom.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(14px);
  pointer-events: none;
}

.upgrade-bottom-content {
  padding: 12px 14px 14px;
  border-radius: 14px;
  background: rgba(22, 4, 32, 0.84);
  border: 1px solid rgba(255, 200, 130, 0.28);
  backdrop-filter: blur(20px);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4), 0 0 32px rgba(255,95,159,0.08);
}

.upgrade-bottom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.upgrade-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upgrade-header-info .overlay-kicker { margin: 0; }

.upgrade-pending-label {
  color: rgba(255,200,130,0.88);
  font-size: 0.8rem;
  font-weight: 700;
}

.upgrade-pending-label strong {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255,200,92,0.7);
}

.upgrade-dismiss-btn {
  padding: 4px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,200,130,0.25);
  background: rgba(255,255,255,0.06);
  color: rgba(255,220,238,0.72);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s ease;
}

.upgrade-dismiss-btn:hover { background: rgba(255,95,159,0.18); }

.upgrade-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.upgrade-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,95,159,0.18);
  color: rgba(255,235,248,0.92);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.upgrade-choice:hover {
  transform: translateY(-2px);
  background: rgba(255,95,159,0.14);
  box-shadow: 0 8px 22px rgba(0,0,0,0.28), 0 0 18px rgba(255,95,159,0.2);
}

.upgrade-choice span {
  font-size: 1.4rem;
  color: var(--rose);
  text-shadow: 0 0 10px rgba(255,95,159,0.7);
  line-height: 1;
}

.upgrade-choice strong {
  font-size: 0.88rem;
  color: var(--hud-text);
}

.upgrade-choice em {
  color: rgba(255,210,228,0.65);
  font-style: normal;
  font-size: 0.74rem;
  line-height: 1.38;
}

/* ═══ 待配點徽章（手動模式） ═══ */
.upgrade-badge {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,95,159,0.85), rgba(255,200,92,0.76));
  border: 1px solid rgba(255,220,150,0.48);
  backdrop-filter: blur(12px);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  z-index: 15;
  white-space: nowrap;
  font-family: inherit;
  animation: badge-pulse 1.8s ease-in-out infinite;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.upgrade-badge.hidden { display: none; }

.upgrade-badge:hover {
  box-shadow: 0 6px 28px rgba(255,95,159,0.65);
  transform: translateX(-50%) scale(1.04);
}

.upgrade-badge span { font-size: 1rem; }
.upgrade-badge strong { font-size: 1.1rem; text-shadow: 0 0 8px rgba(255,255,200,0.6); }

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(255,95,159,0.42); }
  50% { box-shadow: 0 4px 28px rgba(255,95,159,0.78), 0 0 44px rgba(255,200,92,0.3); }
}

/* ═══ 小螢幕備用 ═══ */
@media (max-width: 540px) {
  .brand-name { display: none; }
  .stat-chip { min-width: 52px; padding: 4px 10px 5px; }
  .stat-chip strong { font-size: 1.1rem; }
  .upgrade-grid { grid-template-columns: 1fr; }
}

/* ═══ 旋轉提示（直向手機顯示） ═══ */
.rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0e0416;
  color: rgba(255, 230, 245, 0.95);
  font-family: "Noto Sans TC", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}

.rotate-icon {
  font-size: 3rem;
  animation: rotate-spin 2.4s ease-in-out infinite;
}

.rotate-sub {
  font-size: 0.82rem;
  font-weight: 400;
  opacity: 0.55;
}

@keyframes rotate-spin {
  0%, 100% { transform: rotate(0deg); }
  50%       { transform: rotate(90deg); }
}

@media (orientation: portrait) {
  .rotate-hint { display: flex; }
}

/* ═══ 觸控裝置：隱藏鍵盤說明 ═══ */
@media (hover: none) and (pointer: coarse) {
  .mechanics-hint { display: none; }
}

/* ═══ 手機橫向 HUD 重構（≤480px 高，即一般手機橫置） ═══ */
@media (max-height: 480px) {

  /* 頂部 HUD：壓縮 */
  .hud-top { padding: 5px 10px 16px; gap: 5px; }
  .brand-pill { padding: 5px 10px 5px 6px; gap: 6px; }
  .brand-mark { width: 22px; height: 22px; font-size: 0.75rem; }
  .brand-name { font-size: 0.78rem; }
  .stat-chip { min-width: 42px; padding: 2px 7px 3px; }
  .stat-chip span { font-size: 0.5rem; }
  .stat-chip strong { font-size: 0.95rem; }
  #pause-button { min-height: 26px; padding: 0 10px; font-size: 0.74rem; }
  #save-status { font-size: 0.58rem; }

  /* Boss HUD：稍微上移 */
  .boss-hud { top: 48px; padding: 7px 10px; }
  .boss-hud span { font-size: 0.72rem; margin-bottom: 4px; }
  .boss-bar { height: 6px; }

  /* ── 左下：只有血條 ── */
  .bottom-left-hud { width: min(200px, 34vw); bottom: 10px; left: 10px; }
  .vitals { padding: 7px 9px; gap: 4px; }
  .bar-row { font-size: 0.68rem; grid-template-columns: 30px 1fr 48px; gap: 5px; }
  .bar { height: 6px; }

  /* ── 屬性值：中央底部，與策略按鈕同高 ── */
  .build-strip {
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    right: auto;
    width: auto;
    padding: 5px 10px;
    gap: 5px;
  }
  .build-strip span { padding: 3px 9px; font-size: 0.72rem; }

  /* ── 策略選擇器：右下角 ── */
  .strategy-bar { left: auto; right: 10px; bottom: 10px; transform: none; padding: 4px 8px; gap: 3px; }
  .strategy-bar.hidden { transform: translateY(10px); opacity: 0; pointer-events: none; }
  .strategy-label { display: none; }
  .strat-btn { padding: 4px 7px; font-size: 0.68rem; gap: 3px; }
  .strat-btn .strat-icon { font-size: 0.78rem; }

  /* ── 升級面板 / 徽章 ── */
  .upgrade-bottom { bottom: 52px; }
  .upgrade-badge { bottom: 52px; }

  /* ── 歌詞：小型，在屬性值上方中央 ── */
  .lyrics-box {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 46px;
    min-height: 0;
    max-width: 68vw;
    padding: 4px 12px;
  }
  .lyrics-box span { font-size: 0.82rem; }
  .lyrics-box.hidden { transform: translateX(-50%) translateY(8px); }

  /* ── 橫版：標題卡片縮小間距 ── */
  .stage-overlay { justify-content: center; }
  .title-overlay { padding-top: max(env(safe-area-inset-top,0), 0.5vh); padding-bottom: max(env(safe-area-inset-bottom,0), 1vh); }
  .title-logo-main { max-height: 46vh; width: min(500px, 70vw); }
  .title-cards { gap: 6px; padding: 0 6px; }
  .title-card { max-width: clamp(100px, 18vw, 160px); }
  .card-continue { transform: translateY(-6px); }
  .card-continue:hover { transform: translateY(-12px); }
  .ending-art { display: block; width: min(130px, 20vw); max-height: 130px; margin: 0; border-radius: 8px; }
  h2 { font-size: 1.1rem; }
  .overlay-panel p:not(.overlay-kicker) { display: none; }
  .overlay-actions { margin-top: 10px; gap: 6px; }
  .overlay-actions button { min-height: 36px; font-size: 0.84rem; }
}

/* ═══ 角色選擇 ═══ */
.char-select-btn {
  background: linear-gradient(135deg, #6a1b9a, #4a148c);
  color: #e1bee7;
  border: 1.5px solid rgba(200, 130, 255, 0.5);
  border-radius: 22px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.char-select-btn:hover { background: linear-gradient(135deg, #7b1fa2, #5c1f99); box-shadow: 0 0 18px rgba(186,104,200,0.5); }
.char-select-btn.hidden { display: none; }

.char-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 4, 20, 0.72);
  backdrop-filter: blur(8px);
  z-index: 60;
}
.char-modal.hidden { display: none; }

.char-panel {
  background: rgba(28, 8, 40, 0.95);
  border: 1.5px solid rgba(200, 130, 255, 0.35);
  border-radius: 20px;
  padding: 28px 32px;
  min-width: 340px;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 8px 48px rgba(150,60,255,0.3);
}
.char-panel h3 {
  color: #e1bee7;
  font-size: 1.25rem;
  margin-bottom: 20px;
  letter-spacing: 0.06em;
}

.char-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.char-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.char-option:hover:not(.locked) { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.28); }
.char-option.selected { border-color: rgba(255,200,100,0.7); background: rgba(255,180,60,0.1); }
.char-option.locked { opacity: 0.45; cursor: default; }
.char-option strong { color: #f5e6ff; font-size: 1rem; display: block; }
.char-option em { color: rgba(220,180,255,0.7); font-size: 0.8rem; font-style: normal; }
.char-badge { font-size: 1.4rem; flex-shrink: 0; width: 28px; text-align: center; }

.char-modal-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  color: rgba(220,180,255,0.8);
  padding: 8px 24px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.char-modal-close:hover { background: rgba(255,255,255,0.14); }

/* ── 角色成長類型標籤 ── */
.char-growth-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

/* ── 角色說明按鈕 ── */
.char-info-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.07);
  color: rgba(220,200,255,0.7);
  font-size: 0.72rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.char-info-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* ── 角色成長說明 Modal ── */
.char-info-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 2, 16, 0.82);
  backdrop-filter: blur(10px);
  z-index: 70;
  padding: 12px;
}
.char-info-modal.hidden { display: none; }

.char-info-panel {
  background: rgba(20, 6, 36, 0.97);
  border: 1.5px solid rgba(180, 130, 255, 0.3);
  border-radius: 18px;
  padding: 18px 22px 20px;
  width: min(480px, calc(100% - 24px));
  max-height: calc(100% - 40px);
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(100,40,200,0.25);
}

.char-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.char-info-header h4 {
  color: #d8c0ff;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.char-info-body { display: flex; flex-direction: column; gap: 12px; }

.char-info-type strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.char-info-type p { color: rgba(220,200,255,0.7); font-size: 0.82rem; line-height: 1.55; }

.char-info-rule {
  color: rgba(200,180,255,0.55);
  font-size: 0.76rem;
  line-height: 1.55;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(180,130,255,0.12);
}

.char-info-table { display: flex; flex-direction: column; gap: 3px; }

.char-info-row {
  display: grid;
  grid-template-columns: 44px 96px 1fr;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(200,180,255,0.55);
}
.char-info-row.passed { color: rgba(160,140,220,0.4); }
.char-info-row.current {
  background: rgba(180,130,255,0.12);
  border: 1px solid rgba(180,130,255,0.3);
  color: rgba(230,210,255,0.9);
  font-weight: 700;
}
.char-info-lv { font-weight: 800; color: rgba(200,170,255,0.8); }
.char-info-thresh { color: rgba(200,180,255,0.5); font-size: 0.72rem; }
.char-info-bonus { color: rgba(230,215,255,0.75); }
.char-info-row.current .char-info-lv { color: #d8a8ff; }
.char-info-row.current .char-info-bonus { color: #e8d0ff; }
.char-info-row.passed .char-info-lv::after { content: " ✓"; font-size: 0.65rem; opacity: 0.7; }

@media (max-height: 480px) {
  .char-info-panel { padding: 12px 14px 14px; }
  .char-info-row { grid-template-columns: 40px 80px 1fr; font-size: 0.72rem; }
}

/* ── 角色卡片：等級顯示 ── */
.char-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.char-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.char-level-badge {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px currentColor;
}
.char-xp-bar-wrap {
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.char-xp-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
}
.char-xp-text {
  font-size: 0.64rem;
  color: rgba(255,220,255,0.5);
  font-weight: 600;
}
.char-stats-preview {
  font-size: 0.7rem;
  color: rgba(255,210,240,0.65);
  letter-spacing: 0.04em;
}
.char-clear-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,100,100,0.3);
  background: rgba(255,80,80,0.08);
  color: rgba(255,160,160,0.75);
  font-size: 0.68rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  align-self: center;
}
.char-clear-btn:hover { background: rgba(255,80,80,0.22); color: #ff9090; }

/* ── 世界選擇 modal ── */
.world-select-btn {
  background: linear-gradient(135deg, #1a3a6b, #0d2244);
  color: #90caf9;
  border: 1.5px solid rgba(100,180,255,0.4);
  border-radius: 22px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.world-select-btn:hover { background: linear-gradient(135deg, #1e4a8a, #122d5c); box-shadow: 0 0 18px rgba(100,180,255,0.4); }
.world-select-btn.hidden { display: none; }

.world-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 2, 14, 0.78);
  backdrop-filter: blur(10px);
  z-index: 60;
  padding: 12px;
}
.world-modal.hidden { display: none; }

.world-panel {
  background: rgba(18, 6, 32, 0.96);
  border: 1.5px solid rgba(100, 180, 255, 0.28);
  border-radius: 18px;
  padding: 20px 24px;
  width: min(820px, calc(100% - 24px));
  box-shadow: 0 8px 48px rgba(30,60,180,0.28);
}

.world-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.world-panel-header h3 {
  color: #c5e3ff;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}
.world-modal-close {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: rgba(200,220,255,0.7);
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.world-modal-close:hover { background: rgba(255,255,255,0.14); }

.world-list {
  display: flex;
  gap: 14px;
}

.world-card {
  flex: 1;
  border-radius: 14px;
  border: 1.5px solid rgba(100,180,255,0.18);
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.world-card:not(.locked):hover {
  transform: translateY(-3px);
  border-color: rgba(100,180,255,0.45);
  box-shadow: 0 10px 28px rgba(30,60,200,0.25);
}
.world-card.active {
  border-color: rgba(100,200,255,0.7);
  box-shadow: 0 0 22px rgba(80,160,255,0.3);
}
.world-card.locked { opacity: 0.4; }

.world-thumb {
  width: 100%;
  aspect-ratio: 16/7;
  background: #0a0418 center / cover no-repeat;
  background-size: 160%;
  background-position: center 30%;
}

.world-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.world-info strong {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.world-wave {
  font-size: 0.75rem;
  color: rgba(200,230,255,0.6);
  font-weight: 600;
}
.world-status {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(200,230,255,0.55);
  letter-spacing: 0.04em;
}

.world-card:not(.locked) {
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.world-card:not(.locked):active {
  transform: scale(0.97);
  border-color: rgba(100,200,255,0.7);
}
.world-card.selected {
  border-color: rgba(100,200,255,0.8);
  box-shadow: 0 0 22px rgba(80,160,255,0.4);
  background: rgba(80,160,255,0.1);
}

/* world-card 在 select-modal 內的簡化佈局 */
#sel-pane-world .world-list {
  flex-direction: column;
  gap: 8px;
}
#sel-pane-world .world-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  overflow: hidden;
}
#sel-pane-world .world-thumb {
  width: 90px;
  flex-shrink: 0;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
}
#sel-pane-world .world-info {
  flex: 1;
  padding: 10px 14px;
}

@media (max-height: 480px) {
  .world-panel { padding: 12px 16px; }
  .world-panel-header { margin-bottom: 10px; }
  .world-list { gap: 10px; }
  .world-thumb { aspect-ratio: 16/6; }
  .world-info { padding: 8px 10px 10px; gap: 4px; }
  .world-info strong { font-size: 0.8rem; }
  .world-wave { font-size: 0.68rem; }
  .world-start-btn { padding: 4px 10px; font-size: 0.7rem; }
  .world-select-btn { padding: 8px 16px; font-size: 0.86rem; }
}
