/* ============================================================
 * 管线塔防 · 网页版（浅色极简主题）
 * ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e7ed;
  --border-2: #d3d9e2;
  --ink: #2f3542;
  --ink-2: #5b6472;
  --muted: #98a0ad;
  --good: #2f9e44;
  --gold: #f08c00;
  --blue: #1c7ed6;
  --danger: #e03131;
  --shadow: 0 6px 20px rgba(24, 32, 44, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  user-select: none;
}

#app { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------- 顶部信息行（flex 自适应，自动换行，永不互相遮挡） ---------------- */
#top-bar {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  z-index: 10; pointer-events: none;
}
#top-bar > * { pointer-events: auto; }

#hud-top {
  display: flex; gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 10px;
  backdrop-filter: blur(6px);
}
#hud-top .stat {
  display: flex; flex-direction: column; align-items: center;
  min-width: 62px; padding: 0 8px;
}
#hud-top .stat + .stat { border-left: 1px solid var(--border); }
#hud-top .k { font-size: 10px; color: var(--muted); letter-spacing: .5px; }
#hud-top b { font-size: 17px; font-weight: 700; line-height: 1.25; }
#hud-top b.hp { color: var(--good); }
#hud-top b.gold { color: var(--gold); }
#hud-top b.up { color: var(--blue); }

/* ---------------- 右上角控制（空间不足自动换行，不会左移压住数据栏） ---------------- */
#hud-ctrl {
  display: flex; gap: 6px; row-gap: 6px;
  margin-left: auto; flex-wrap: wrap; justify-content: flex-end;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink); font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.icon-btn:hover { border-color: var(--border-2); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 难度按钮：加宽放两个字，按难度着色（绿=简单 / 橙=中等 / 红=困难） */
#btn-diff {
  width: auto; min-width: 54px; padding: 0 10px;
  font-size: 12.5px; letter-spacing: 1px;
}
#btn-diff[data-d='easy']   { color: #2f9e44; }
#btn-diff[data-d='normal'] { color: #e8590c; }
#btn-diff[data-d='hard']   { color: #e03131; }

/* ---------------- 玩法说明（下移避开右上按钮换行后的第二行） ---------------- */
#help {
  position: absolute; top: 84px; right: 10px; width: 320px; max-width: calc(100vw - 20px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; z-index: 12; font-size: 12.5px; line-height: 1.7; color: var(--ink-2);
  max-height: calc(100vh - 220px); overflow: auto;
}
#help h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
#help ol { margin: 0; padding-left: 18px; }
#help li { margin-bottom: 5px; }
#help b { color: var(--ink); }
#help .tip { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 11.5px; }

/* ---------------- 波次状态条（位于顶部 flex 行内，不再绝对定位） ---------------- */
#wave-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 7px 10px; font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow); backdrop-filter: blur(6px);
}

/* ---------------- 放置基地阶段提示条 ---------------- */
#place-bar {
  position: absolute; bottom: 116px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 10px 14px; z-index: 12; max-width: calc(100vw - 24px);
  animation: toastIn .2s ease-out;
}
#place-bar #place-text { font-size: 13px; font-weight: 600; color: var(--ink); }
#place-bar .mini-btn { padding: 8px 16px; font-size: 13px; }

/* ---------------- 新手引导 ---------------- */
#tutorial {
  position: absolute; top: 108px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff;
  border-radius: 12px; padding: 10px 12px 10px 16px;
  font-size: 13px; font-weight: 600; z-index: 12;
  box-shadow: 0 8px 24px rgba(24, 32, 44, 0.18);
  max-width: calc(100vw - 24px);
}

/* ---------------- 按钮通用 ---------------- */
.mini-btn {
  border: none; border-radius: 9px;
  background: var(--blue); color: #fff;
  font-size: 12px; font-weight: 700; padding: 6px 11px;
  cursor: pointer; white-space: nowrap;
}
.mini-btn:active { transform: translateY(1px); }
.mini-btn.ghost { background: rgba(255, 255, 255, 0.2); color: #fff; border: 1px solid rgba(255,255,255,.35); }

/* ---------------- 底部工具栏 ---------------- */
#toolbar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; align-items: flex-end;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow); z-index: 11;
  backdrop-filter: blur(6px);
  max-width: calc(100vw - 20px); overflow-x: auto;
}
#turret-tools { display: flex; gap: 8px; }

.tool {
  width: 62px; padding: 7px 4px 6px;
  border: 1.5px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; font-size: 11px; font-weight: 600;
  transition: border-color .12s, background .12s, transform .08s;
  flex: 0 0 auto;
}
.tool:hover { border-color: var(--border-2); }
.tool:active { transform: translateY(1px); }
.tool.active {
  border-color: var(--good);
  background: rgba(47, 158, 68, 0.08);
  box-shadow: 0 0 0 3px rgba(47, 158, 68, 0.14);
}
.tool.locked { opacity: .42; cursor: not-allowed; }
.tool .t { line-height: 1.2; }
.tool .c { font-size: 10px; color: var(--gold); font-weight: 700; }
.tool.locked .c { color: var(--muted); }

.tool .ico {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--ink-2);
  display: block; position: relative;
}
.tool .ico-box::after {
  content: ''; position: absolute; inset: 4px;
  border-radius: 50%; background: var(--ink-2);
  animation: spin 3s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tool .ico-pipe {
  border-radius: 6px; border-color: #8d97a5; overflow: hidden;
}
.tool .ico-pipe::before {
  content: ''; position: absolute; left: 2px; right: 2px; top: 50%;
  height: 5px; transform: translateY(-50%);
  background: #8d97a5; border-radius: 3px;
}
.tool .ico-pipe::after {
  content: ''; position: absolute; top: 50%; left: 3px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--gold);
  transform: translateY(-50%);
  animation: pipeFlow 1.4s linear infinite;
}
@keyframes pipeFlow { 0% { left: 3px; } 100% { left: 13px; } }

.tool .ico-wall {
  border-radius: 4px; border-color: #6b7480;
  background: linear-gradient(#c2cad6, #b3bcc9);
  overflow: hidden;
}
.tool .ico-wall::before {
  content: ''; position: absolute; left: 3px; right: 3px; top: 3px; height: 4px;
  background: #6b7480; border-radius: 1px;
}
.tool .ico-wall::after {
  content: ''; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 4px;
  background: #6b7480; border-radius: 1px;
}
#turret-tools .tool .ico { border-color: var(--accent, var(--ink-2)); }
#turret-tools .tool .ico::after {
  content: ''; position: absolute; inset: 5px;
  border-radius: 50%; background: var(--accent, var(--ink-2));
}

/* ---------------- 选中面板 ---------------- */
#panel {
  position: absolute; right: 12px; bottom: 116px; width: 208px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; z-index: 11;
}
#panel-title { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
#panel-stats .row {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--ink-2); padding: 2.5px 0;
}
#panel-stats .row b { color: var(--ink); font-weight: 700; }
#panel-up {
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed var(--border-2);
}
#panel-up.hidden { display: none; }
.up-h { font-size: 11px; font-weight: 700; color: var(--good); margin-bottom: 5px; }
#panel-up .up-row { font-size: 11.5px; color: var(--ink-2); padding: 2px 0; }
#panel-up .up-row i.a { font-style: normal; color: var(--good); margin: 0 3px; font-size: 10px; }
#panel-up .up-row b { color: var(--good); font-weight: 700; }
#panel-up .up-row.down b { color: var(--blue); }
#panel-up .up-row.down i.a { color: var(--blue); }
.panel-btns { display: flex; gap: 6px; margin-top: 10px; }
.act {
  flex: 1; border: none; border-radius: 10px; padding: 9px 8px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.act.primary { background: var(--good); color: #fff; }
.act.danger { background: #fff; color: var(--danger); border: 1px solid #ffc9c9; }
.act:disabled { opacity: .45; cursor: not-allowed; }
.act:active:not(:disabled) { transform: translateY(1px); }

/* ---------------- Toast ---------------- */
#toasts {
  position: absolute; top: 156px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  z-index: 20; pointer-events: none; width: max-content; max-width: calc(100vw - 24px);
}
.toast {
  background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(24, 32, 44, 0.16);
  animation: toastIn .18s ease-out;
  transition: opacity .4s, transform .4s;
}
.toast.good { background: var(--good); }
.toast.warn { background: var(--gold); }
.toast.danger { background: var(--danger); }
.toast.info { background: var(--blue); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------- 结算弹窗 ---------------- */
#modal {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(240, 242, 245, 0.72);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 18px 50px rgba(24, 32, 44, 0.16);
  padding: 26px 28px; text-align: center; min-width: 260px;
}
.modal-box h2 { margin: 0 0 8px; font-size: 20px; }
.modal-box p { margin: 0 0 18px; font-size: 13px; color: var(--ink-2); }
.modal-box .act { width: 100%; padding: 11px; font-size: 13px; }

.hidden { display: none !important; }

/* ---------------- 蓝图高亮（成长货币） ---------------- */
.bp { color: #7048e8; font-weight: 700; }

/* ---------------- 成长按钮红点 ---------------- */
.badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 8px; background: var(--danger);
  border: 2px solid #fff;
  font-size: 9px; line-height: 10px; color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------------- 每日挑战标记 ---------------- */
#daily-tag {
  position: absolute; top: 56px; left: 10px;
  background: rgba(112, 72, 232, 0.12); color: #5f3dc4;
  border: 1px solid #d0bfff; border-radius: 9px;
  padding: 4px 9px; font-size: 11px; font-weight: 700;
  z-index: 10;
}

/* ---------------- 成就即时弹出（与说明框同高，说明打开时让位到其左侧） ---------------- */
#ach-pop {
  position: absolute; top: 84px; right: 10px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 22; pointer-events: none; align-items: flex-end;
}
body.help-open #ach-pop { right: 340px; }
.ach-toast {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid #7048e8;
  border-radius: 11px; box-shadow: var(--shadow);
  padding: 9px 13px; font-size: 12.5px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .2s ease-out;
  transition: opacity .5s, transform .5s;
}
.ach-toast b { font-weight: 700; }
.ach-toast .bp { white-space: nowrap; }
.ach-toast.out { opacity: 0; transform: translateX(12px); }

/* ---------------- 局外成长面板 ---------------- */
.overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(240, 242, 245, 0.72);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.meta-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 18px 50px rgba(24, 32, 44, 0.16);
  width: 360px; max-width: 94vw; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.meta-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.meta-head h2 { margin: 0; font-size: 16px; flex: 1; }
.meta-bp { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.meta-bp b { color: #7048e8; font-size: 15px; }
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; }
.tabs .tab {
  flex: 1; border: none; background: transparent;
  border-radius: 9px 9px 0 0; padding: 8px 4px;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent;
}
.tabs .tab.on { color: var(--ink); border-bottom-color: var(--good); }
#meta-body { padding: 12px; overflow-y: auto; flex: 1; }

.meta-tip { font-size: 11px; color: var(--muted); margin: 12px 2px 0; line-height: 1.6; }
.meta-tip.danger { color: var(--danger); display: flex; }
.mini-btn.ghost {
  background: #fff; color: var(--danger);
  border: 1px solid #ffc9c9; border-radius: 8px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; margin-left: auto;
  cursor: pointer;
}

/* 强化网格 */
.perk-grid { display: flex; flex-direction: column; gap: 9px; }
.perk {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px;
  background: #fbfcfe;
}
.perk.maxed { background: rgba(112, 72, 232, 0.05); border-color: #e5dbff; }
.pk-ico {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
}
.pk-main { flex: 1; min-width: 0; }
.pk-name { font-size: 12.5px; font-weight: 700; }
.pk-lv { color: var(--muted); font-weight: 600; font-size: 11px; }
.pk-desc { font-size: 11px; color: var(--ink-2); margin: 1px 0; }
.pk-cur { font-size: 11px; color: var(--good); }
.pk-cur b { color: var(--good); font-weight: 700; }
.pips { display: flex; gap: 3px; margin-top: 5px; }
.pips i { width: 14px; height: 4px; border-radius: 2px; background: var(--border-2); }
.pips i.on { background: var(--accent); }
.pk-buy {
  flex: 0 0 auto; border: 1px solid var(--border-2); border-radius: 9px;
  background: #fff; color: var(--ink); font-size: 11px; font-weight: 700;
  padding: 8px 10px; cursor: pointer; min-width: 52px;
}
.pk-buy.can { background: var(--good); color: #fff; border-color: var(--good); }
.pk-buy:disabled { opacity: .5; cursor: not-allowed; }

/* 成就网格 */
.ach-head { font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.ach-head b { color: var(--ink); }
.ach-grid { display: flex; flex-direction: column; gap: 7px; }
.ach {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px;
  background: #fbfcfe; opacity: .62;
}
.ach.got { opacity: 1; background: rgba(112, 72, 232, 0.05); border-color: #e5dbff; }
.a-ico { font-size: 18px; flex: 0 0 auto; }
.a-main { flex: 1; min-width: 0; }
.a-name { font-size: 12.5px; font-weight: 700; }
.a-desc { font-size: 11px; color: var(--ink-2); }
.a-bp { font-size: 12px; color: #7048e8; font-weight: 700; flex: 0 0 auto; }

/* 数据页 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st {
  border: 1px solid var(--border); border-radius: 11px; padding: 10px;
  background: #fbfcfe; display: flex; flex-direction: column; gap: 2px;
}
.st span { font-size: 11px; color: var(--muted); }
.st b { font-size: 17px; font-weight: 700; }
.sec-title { font-size: 12.5px; font-weight: 700; margin: 14px 2px 8px; }
.eff-grid { display: flex; flex-direction: column; gap: 6px; }
.ef {
  display: flex; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px;
  background: rgba(47, 158, 68, 0.05); font-size: 12px;
}
.ef b { color: var(--good); font-weight: 700; }

/* 每日挑战卡 */
.daily-card {
  border: 1px solid #e5dbff; border-radius: 13px; padding: 14px;
  background: rgba(112, 72, 232, 0.05);
}
.d-date { font-size: 11px; color: var(--muted); }
.d-name { font-size: 15px; font-weight: 700; margin: 4px 0 2px; color: #5f3dc4; }
.d-desc { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.d-goal { font-size: 12px; color: var(--ink); margin-top: 8px; }
.d-goal b { color: #7048e8; }
.d-mul { font-size: 12px; color: var(--gold); font-weight: 700; margin-top: 4px; }
.d-done { font-size: 12.5px; color: var(--good); font-weight: 700; margin-top: 10px; }
.act.primary { width: 100%; margin-top: 12px; padding: 11px; font-size: 13px; }

/* 结算成就行 */
.modal-ach {
  margin: 12px 0 0; padding: 8px 10px;
  background: rgba(112, 72, 232, 0.07); border: 1px solid #e5dbff;
  border-radius: 10px; font-size: 12px; color: #5f3dc4; font-weight: 600;
}
#modal .bp { color: #7048e8; }
#modal .tip { margin: 12px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 11.5px; line-height: 1.6; }

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 560px) {
  #top-bar { top: calc(6px + env(safe-area-inset-top, 0px)); left: calc(6px + env(safe-area-inset-left, 0px)); right: calc(6px + env(safe-area-inset-right, 0px)); }
  /* 数据栏提到第一行居中，波次条 + 控制按钮第二行，互不遮挡 */
  #hud-top { order: -1; margin-inline: auto; gap: 2px; padding: 6px 4px; }
  #hud-top .stat { min-width: 52px; padding: 0 4px; }
  #hud-top b { font-size: 15px; }
  #hud-ctrl { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; font-size: 13px; border-radius: 9px; }
  #wave-bar { padding: 5px 8px; font-size: 11.5px; }
  #help { width: calc(100vw - 24px); top: 136px; }
  #tutorial { top: 142px; }
  #toasts { top: 190px; }
  #daily-tag { top: 136px; }
  #ach-pop { top: 136px; }
  /* 说明框为全宽时成就弹出让位（隐藏，避免遮挡） */
  body.help-open #ach-pop { display: none; }
  .tool { width: 54px; font-size: 10px; }
  #panel { right: 8px; left: 8px; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); width: auto; padding: 10px; }
  #toolbar { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 8px; right: 8px; transform: none; justify-content: flex-start; }
  #place-bar { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); flex-direction: column; gap: 8px; text-align: center; }
  /* 选中面板打开时提示条抬到面板正上方（面板高度由 JS 写入 --panel-h） */
  body.panel-open #place-bar { bottom: calc(var(--panel-h, 0px) + 124px + env(safe-area-inset-bottom, 0px)); }
  .meta-box { width: 94vw; }
}

/* 平板 / 中屏：工具栏横向铺开，面板略宽 */
@media (min-width: 561px) and (max-width: 1024px) {
  .tool { width: 58px; }
  #panel { width: 220px; }
}

/* 横屏矮屏（手机横放）：压缩顶部与底部间距，避免遮挡 */
@media (max-height: 480px) and (orientation: landscape) {
  #top-bar { top: 4px; }
  #toolbar { bottom: 6px; padding: 6px; }
  #toolbar .tool { width: 50px; }
  #panel { bottom: 94px; width: 180px; padding: 9px; }
  #place-bar { bottom: 94px; }
  #tutorial { top: 66px; }
  #toasts { top: 116px; }
  #help { top: 66px; max-height: calc(100vh - 120px); }
  #ach-pop { top: 66px; }
}

/* ---------------- 深色主题（夜间护眼） ---------------- */
[data-theme="dark"] {
  --bg: #0f1217;
  --surface: #1a1f27;
  --border: #2a323d;
  --border-2: #39424f;
  --ink: #e6e9ef;
  --ink-2: #9aa3b2;
  --muted: #6b7480;
  --good: #51cf66;
  --gold: #ffa94d;
  --blue: #4dabf7;
  --danger: #ff6b6b;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .icon-btn { background: rgba(26, 31, 39, 0.92); color: var(--ink); }
[data-theme="dark"] #hud-top,
[data-theme="dark"] #wave-bar,
[data-theme="dark"] #toolbar,
[data-theme="dark"] #help,
[data-theme="dark"] #place-bar { background: rgba(26, 31, 39, 0.92); }
[data-theme="dark"] .tool { background: #1a1f27; color: var(--ink); }
[data-theme="dark"] .toast { background: #2a323d; }
[data-theme="dark"] #modal,
[data-theme="dark"] .overlay { background: rgba(8, 10, 14, 0.8); }
[data-theme="dark"] .perk,
[data-theme="dark"] .ach,
[data-theme="dark"] .st { background: #161b22; }
[data-theme="dark"] .pk-ico { background: color-mix(in srgb, var(--accent) 18%, #1a1f27); }
[data-theme="dark"] .ef { background: rgba(81, 207, 102, 0.1); }
[data-theme="dark"] .badge { border-color: var(--surface); }
[data-theme="dark"] .daily-card,
[data-theme="dark"] .modal-ach { background: rgba(112, 72, 232, 0.12); }
[data-theme="dark"] #ach-pop .ach-toast { background: #1a1f27; }
