/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', sans-serif;
  background: #08090e;
  color: #dfe3ed;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

:root {
  --bg: #08090e;
  --text: #dfe3ed;
  --dim: rgba(255, 255, 255, .42);
  --mute: rgba(255, 255, 255, .18);
  --accent: #34d399;
  --accent2: #60a5fa;
  --card: rgba(255, 255, 255, .03);
  --border: rgba(255, 255, 255, .06);
  --success: #34d399;
  --danger: #f87171;
  --warm: #fbbf24;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ─── Canvas: 雷达左半 + 3D Overlay 右半 ─── */
#radarCanvas {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  background: var(--bg);
  touch-action: none;
  z-index: 1;
}

#overlayCanvas {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

/* 显示模式三段切换 */
#layoutSwitch {
  position: fixed;
  top: calc(var(--safe-t) + 50px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 0;
  background: rgba(12, 14, 20, .92);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 3px;
  z-index: 11;
}

#layoutSwitch button {
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 11px;
  cursor: pointer;
  letter-spacing: .5px;
  transition: all .15s;
}

#layoutSwitch button.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #0b1320;
}

#layoutSwitch button:not(.active):hover {
  color: var(--text)
}

/* 中间分割线（可拖拽调整左右比例）*/
#splitter {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 8px;
  margin-left: -4px;
  cursor: col-resize;
  z-index: 9;
  background: linear-gradient(90deg, transparent 0%, rgba(96, 165, 250, .35) 50%, transparent 100%);
  transition: background .15s;
  touch-action: none;
}

#splitter:hover,
#splitter.active {
  background: linear-gradient(90deg, transparent 0%, rgba(96, 165, 250, .85) 50%, transparent 100%);
}

#splitter::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 40px;
  margin: -20px 0 0 -1px;
  background: rgba(255, 255, 255, .45);
  border-radius: 1px;
}



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

    :root {
      --bg: #030405;
      --fg: rgba(255, 255, 255, .94);
      --fg2: rgba(255, 255, 255, .52);
      --fg3: rgba(255, 255, 255, .28);
      --danger: #f87171;
      --line: rgba(255, 255, 255, .07);
      --glass: rgba(18, 20, 26, .62);
      --glass2: rgba(255, 255, 255, .06);
      --safe-t: env(safe-area-inset-top, 0px);
      --safe-b: env(safe-area-inset-bottom, 0px);
      --sheet-r: 22px;
    }

    html, body {
      height: 100%;
      overflow: hidden;
      font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', system-ui, sans-serif;
      background: var(--bg);
      color: var(--fg);
      -webkit-font-smoothing: antialiased;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    /* 模拟地图底图 */
    .stage {
      position: fixed;
      inset: 0;
      background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(40, 55, 80, .18), transparent 70%),
        radial-gradient(circle at 20% 80%, rgba(30, 90, 70, .08), transparent 40%),
        var(--bg);
    }
    .stage::after {
      content: '';
      position: absolute;
      inset: 0;
      background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
      background-size: 28px 28px;
      opacity: .25;
      mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, #000 20%, transparent 75%);
    }

    /* 顶栏 */
    .hud {
      position: fixed;
      top: calc(12px + var(--safe-t));
      left: 0; right: 0;
      display: flex;
      justify-content: center;
      z-index: 10;
      padding: 0 16px;
    }
    .hud-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      padding: 7px 16px;
      border-radius: 100px;
      background: rgba(255, 255, 255, .05);
      border: 1px solid rgba(255, 255, 255, .08);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      font-size: 13px;
      font-weight: 500;
      color: var(--fg2);
      letter-spacing: -.01em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .hud-pill:active { background: rgba(255, 255, 255, .08); }

    .hud-bit {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
    }
    .hud-bit strong {
      color: var(--fg);
      font-weight: 600;
      font-variant-numeric: tabular-nums;
    }
    .hud-sep {
      width: 2px;
      height: 2px;
      border-radius: 50%;
      background: rgba(255, 255, 255, .22);
      margin: 0 10px;
      flex-shrink: 0;
    }
    .dot-live {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: rgba(255, 255, 255, .3);
      flex-shrink: 0;
    }
    .hud-pill.is-live .dot-live {
      background: #30d158;
      box-shadow: 0 0 6px rgba(48, 209, 88, .45);
    }
    .hud-pill:not(.is-live) .dot-live {
      background: var(--danger);
      box-shadow: none;
    }

    body[data-game=dfm] .hud-tail { display: none; }

    .game-switch {
      display: flex;
      justify-content: center;
      gap: 6px;
      margin: 10px 0 4px;
    }
    .game-switch button {
      border: 1px solid var(--line);
      background: rgba(255,255,255,.04);
      color: var(--fg2);
      font-size: 11px;
      padding: 5px 12px;
      border-radius: 8px;
      cursor: pointer;
    }
    .game-switch button.active {
      background: rgba(255,255,255,.12);
      color: var(--fg);
    }

    .zoom-hint {
      position: fixed;
      left: 16px;
      bottom: calc(14px + var(--safe-b));
      font-size: 11px;
      font-weight: 500;
      color: var(--fg3);
      font-variant-numeric: tabular-nums;
      z-index: 5;
    }

    /* 遮罩 */
    .scrim {
      position: fixed; inset: 0; z-index: 40;
      background: rgba(0, 0, 0, .42);
      opacity: 0; pointer-events: none;
      transition: opacity .2s ease;
    }
    .scrim.on { opacity: 1; pointer-events: auto; }

    /* 液态玻璃面板 */
    .sheet {
      position: fixed;
      left: 0; right: 0; bottom: 0;
      z-index: 50;
      max-height: min(78vh, 640px);
      display: flex;
      flex-direction: column;
      border-radius: var(--sheet-r) var(--sheet-r) 0 0;
      transform: translate3d(0, 100%, 0);
      transition: transform .26s cubic-bezier(.32, .72, .2, 1);
      padding-bottom: var(--safe-b);
    }
    .sheet.on { transform: translate3d(0, 0, 0); }
    .sheet.on.glass-ready .sheet-glass { backdrop-filter: blur(24px) saturate(1.25); -webkit-backdrop-filter: blur(24px) saturate(1.25); }

    .sheet-glass {
      position: absolute; inset: 0;
      border-radius: inherit;
      background: linear-gradient(165deg, rgba(36, 40, 52, .55) 0%, rgba(10, 11, 15, .78) 55%);
      border-top: 1px solid rgba(255, 255, 255, .14);
      box-shadow: 0 -1px 0 rgba(255, 255, 255, .06) inset, 0 -24px 80px rgba(0, 0, 0, .45);
      pointer-events: none;
      transition: backdrop-filter .15s ease;
    }

    .sheet-inner {
      position: relative;
      display: flex;
      flex-direction: column;
      min-height: 0;
      flex: 1;
    }

    .grab {
      width: 36px; height: 4px; border-radius: 2px;
      background: rgba(255, 255, 255, .22);
      margin: 10px auto 4px;
      flex-shrink: 0;
    }

    .sheet-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 20px 16px;
      flex-shrink: 0;
    }
    .sheet-top h1 {
      font-size: 20px;
      font-weight: 600;
      letter-spacing: -.03em;
    }
    .btn-close {
      width: 32px; height: 32px;
      border: none; border-radius: 50%;
      background: rgba(255, 255, 255, .07);
      color: var(--fg2);
      font-size: 22px; line-height: 1;
      cursor: pointer;
    }

    .scroll,
    .sheet-scroll {
      flex: 1;
      min-height: 0;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 0 16px 20px;
    }

    /* 视图芯片 */
    .view-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 22px;
    }
    .view-chip {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding: 14px 6px 12px;
      border: none;
      border-radius: 16px;
      background: rgba(255, 255, 255, .04);
      color: var(--fg2);
      cursor: pointer;
      transition: background .18s, color .18s, box-shadow .18s;
    }
    .view-chip svg {
      width: 26px; height: 26px;
      stroke: currentColor; fill: none;
      stroke-width: 1.6;
      stroke-linecap: round; stroke-linejoin: round;
      opacity: .75;
    }
    .view-chip span {
      font-size: 12px;
      font-weight: 500;
      letter-spacing: -.02em;
    }
    .view-chip.active {
      background: rgba(255, 255, 255, .1);
      color: var(--fg);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
    }
    .view-chip.active svg { opacity: 1; }

    /* iOS 分组列表 */
    .sec-label {
      font-size: 13px;
      font-weight: 400;
      color: var(--fg3);
      padding: 0 4px 8px;
      letter-spacing: -.01em;
    }
    .group {
      list-style: none;
      background: rgba(255, 255, 255, .05);
      border-radius: 14px;
      margin-bottom: 20px;
      overflow: hidden;
    }
    .group > li + li { border-top: 1px solid var(--line); }

    .cell {
      display: flex;
      align-items: center;
      min-height: 48px;
      min-width: 0;
      padding: 0 16px;
      gap: 12px;
      font-size: 16px;
      letter-spacing: -.02em;
    }
    .cell-label { flex: 1; min-width: 0; color: var(--fg); }
    .cell-value {
      flex: 0 1 auto;
      margin-left: auto;
      min-width: 0;
      max-width: 58%;
      color: var(--fg2);
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      overflow: hidden;
    }
    .cell-value .chev {
      color: var(--fg3);
      font-size: 18px;
      font-weight: 300;
      margin-left: 2px;
    }

    select.cell-select {
      border: none;
      background: transparent;
      color: var(--fg2);
      font: inherit;
      font-size: 16px;
      text-align: right;
      text-align-last: right;
      direction: rtl;
      width: auto;
      max-width: 100%;
      min-width: 0;
      outline: none;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      padding: 0;
    }
    select.cell-select option { color: #111; direction: ltr; text-align: left; }

    /* 缩放步进 */
    .stepper {
      display: inline-flex;
      align-items: center;
      gap: 2px;
      background: rgba(0, 0, 0, .22);
      border-radius: 10px;
      padding: 3px;
    }
    .stepper button {
      width: 36px; height: 32px;
      border: none; border-radius: 8px;
      background: transparent;
      color: var(--fg2);
      font-size: 20px; font-weight: 300;
      cursor: pointer;
    }
    .stepper button:active { background: rgba(255,255,255,.1); color: var(--fg); }
    .stepper output {
      min-width: 44px;
      text-align: center;
      font-size: 15px;
      font-weight: 500;
      font-variant-numeric: tabular-nums;
      color: var(--fg);
    }

    /* iOS 开关 */
  .sw {
      position: relative;
      width: 51px; height: 31px;
      flex-shrink: 0;
    }
    .sw input { opacity: 0; width: 0; height: 0; position: absolute; }
    .sw i {
      position: absolute; inset: 0;
      border-radius: 16px;
      background: rgba(120, 120, 128, .32);
      transition: background .2s;
    }
    .sw i::after {
      content: '';
      position: absolute;
      width: 27px; height: 27px;
      left: 2px; top: 2px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 2px 6px rgba(0,0,0,.28);
      transition: transform .22s cubic-bezier(.4, 0, .2, 1);
    }
    .sw input:checked + i { background: rgba(255, 255, 255, .32); }
    .sw input:checked + i::after { transform: translateX(20px); }

    /* 滑条行 */
    .cell-slider {
      flex-direction: column;
      align-items: stretch;
      padding: 12px 16px 14px;
      gap: 10px;
    }
    .cell-slider-head {
      display: flex;
      justify-content: space-between;
      font-size: 16px;
    }
    .cell-slider-head em {
      font-style: normal;
      font-size: 15px;
      color: var(--fg2);
      font-variant-numeric: tabular-nums;
    }
    .loot-tier-em.loot-tier-green { color: #30D158; }
    .loot-tier-em.loot-tier-blue { color: #0A84FF; }
    .loot-tier-em.loot-tier-purple { color: #BF5AF2; }
    .loot-tier-em.loot-tier-gold { color: #FFD700; }
    .loot-tier-em.loot-tier-red { color: #FF3B30; }
    input[type=range] {
      -webkit-appearance: none;
      width: 100%; height: 4px;
      border-radius: 2px;
      background: rgba(255,255,255,.12);
      outline: none;
    }
    input[type=range]::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 26px; height: 26px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 1px 4px rgba(0,0,0,.35);
      margin-top: -11px;
    }

    /* 手风琴 */
    .acc-trigger {
      width: 100%;
      border: none;
      background: rgba(255, 255, 255, .05);
      border-radius: 14px;
      padding: 14px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: var(--fg);
      font-size: 16px;
      cursor: pointer;
      margin-bottom: 8px;
    }
    .acc-trigger .meta { color: var(--fg3); font-size: 15px; }
    .acc-trigger .arrow {
      color: var(--fg3);
      font-size: 13px;
      transition: transform .22s;
    }
    .acc-trigger[aria-expanded=true] .arrow { transform: rotate(90deg); }
    .acc-body {
      display: grid;
      grid-template-rows: 0fr;
      transition: grid-template-rows .28s ease;
      margin-bottom: 12px;
    }
    .acc-body.open { grid-template-rows: 1fr; }
    .acc-body > ul { overflow: hidden; }

    .foot {
      text-align: center;
      font-size: 11px;
      color: var(--fg3);
      padding: 4px 0 8px;
      font-variant-numeric: tabular-nums;
    }

    /* 按视图隐藏 */
    body[data-view=radar] .only-overlay { opacity: .35; pointer-events: none; }
    body[data-view=overlay] .only-radar { opacity: .35; pointer-events: none; }

    .badge {
      font-size: 11px;
      padding: 2px 7px;
      border-radius: 6px;
      background: rgba(255,255,255,.08);
      color: var(--fg3);
    }

    @media (prefers-reduced-motion: reduce) {
      .sheet, .scrim, .acc-body, .sw i::after { transition: none; }
    }
  

/* boot: 顶栏 / 面板 id 映射 */
#topBar { position:fixed;top:var(--safe-t);left:0;right:0;z-index:10;display:flex;justify-content:center;padding:6px 16px 0;pointer-events:none }
#btnSettings { pointer-events:auto }
#panelOverlay.overlay {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
#panelOverlay.overlay.show {
  opacity: 1;
  pointer-events: auto;
}
#settingsPanel.sheet {
  z-index: 30;
  transform: translate3d(0, 0, 0);
}
#settingsPanel.sheet.hidden {
  transform: translate3d(0, 110%, 0);
  pointer-events: none;
}
#layoutSwitch { position:static;transform:none;display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%;background:transparent;border:none;padding:0;margin:0 0 22px }
#layoutSwitch button { border:none;border-radius:16px;background:rgba(255,255,255,.04);color:var(--fg2,var(--dim));padding:14px 6px 12px;font-size:12px;font-weight:500;display:flex;flex-direction:column;align-items:center;gap:8px;cursor:pointer }
#layoutSwitch button.active { background:rgba(255,255,255,.1);color:var(--fg,var(--text));box-shadow:inset 0 1px 0 rgba(255,255,255,.1) }
body.game-dfm .hud-tail, body.game-dfm #countAI { display:none !important }
body.game-pubg .only-dfm { display:none !important }
body.game-dfm .only-pubg { display:none !important }
.sel { height:32px;padding:0 24px 0 10px;border:1px solid var(--border);border-radius:8px;background:rgba(255,255,255,.03);color:var(--text);font-size:12px }
#settingsPanel .cell { min-width: 0; }
#settingsPanel select.sel,
#settingsPanel select.cell-select {
  height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  color: var(--fg2, var(--text));
  padding: 0;
  width: auto;
  max-width: 100%;
  margin-left: auto;
  text-align: right;
  text-align-last: right;
  direction: rtl;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
#settingsPanel select.cell-select option {
  direction: ltr;
  text-align: left;
}
#settingsPanel .cell-value .stepper { flex-shrink: 0; }
input[type=color] { width:44px;height:28px;border:none;background:transparent }
.debug-text { font-size:9px;line-height:1.6;color:var(--mute,var(--fg3));font-family:'SF Mono',Menlo,monospace }
#bootErr { position:fixed;left:12px;right:12px;top:50%;transform:translateY(-50%);padding:12px;background:rgba(200,40,40,.9);color:#fff;font-size:13px;border-radius:10px;z-index:99;text-align:center }
.stepper .step-reset { font-size:11px;font-weight:600;padding:0 10px;min-width:auto;letter-spacing:0 }
.sheet.on.glass-ready .sheet-glass { backdrop-filter:blur(24px) saturate(1.25);-webkit-backdrop-filter:blur(24px) saturate(1.25) }
