:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

button.focusable { font-family: inherit; -webkit-appearance: none; appearance: none; }

/* ---------- Secondary header bar ---------- */
.cbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.iconbtn {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-tertiary); color: #fff;
  font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ctitle { font-size: 15px; font-weight: 700; letter-spacing: 2px; color: var(--text-secondary); flex: 1; }
.chips { display: flex; gap: 6px; }
.chip {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 6px 9px; border-radius: 20px;
  background: var(--bg-tertiary); color: var(--text-muted);
  border: 1px solid transparent;
}
.chip.ok { color: var(--accent); border-color: rgba(0, 212, 255, 0.4); }
.chip.live { color: var(--accent-secondary); border-color: rgba(0, 255, 136, 0.4); }

/* ---------- Home ---------- */
.hbar { padding: 24px 22px 6px; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: 3px; color: #fff; display: flex; align-items: center; gap: 10px; }
.logo { color: var(--accent); }
.sub { color: var(--text-secondary); font-size: 14px; letter-spacing: 1px; margin-top: 4px; }
.hbody { flex: 1; display: flex; flex-direction: column; padding: 16px 22px 22px; gap: 16px; }
.hpreview {
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.hp-label { font-size: 11px; letter-spacing: 2px; color: var(--text-muted); font-weight: 700; }
.hp-name { font-size: 23px; font-weight: 700; color: #fff; margin-top: 5px; }
.hp-meta { font-size: 15px; color: var(--accent); margin-top: 3px; font-variant-numeric: tabular-nums; }
.menu { display: flex; flex-direction: column; gap: 12px; }
.mitem {
  display: flex; align-items: center; gap: 14px;
  min-height: 88px; padding: 0 18px;
  border-radius: 14px; background: var(--bg-tertiary); text-align: left;
}
.mi-ic { font-size: 26px; color: var(--accent); width: 34px; text-align: center; }
.mi-tx { display: flex; flex-direction: column; }
.mi-tx b { font-size: 19px; color: #fff; font-weight: 700; }
.mi-tx i { font-style: normal; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Compass dial ---------- */
.dialwrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.dial {
  position: relative; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(20, 20, 31, 0.55) 0%, rgba(10, 10, 15, 0.35) 60%, rgba(10, 10, 15, 0) 73%);
  box-shadow: inset 0 0 30px rgba(0, 212, 255, 0.08);
}
.rose, .arrow { position: absolute; inset: 0; transition: transform 0.25s ease-out; will-change: transform; }
.rose { z-index: 1; }
.arrow { z-index: 2; }
.tick {
  position: absolute; top: 50%; left: 50%;
  width: 2px; height: 10px; background: rgba(160, 160, 176, 0.5);
  transform-origin: center;
}
.tick.major { height: 16px; background: rgba(0, 212, 255, 0.85); }
.lab {
  position: absolute; top: 50%; left: 50%;
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  transform-origin: center;
}
.lab.inter { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.lab.n { color: var(--danger); }

.needle-line {
  position: absolute; left: 50%; top: 46px;
  width: 4px; height: 104px; transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--accent-secondary), rgba(0, 255, 136, 0.05));
  border-radius: 2px;
}
.needle-tip {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 24px solid var(--accent-secondary);
  filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.7));
}
.hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 122px; height: 122px; border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 10, 15, 0.94), rgba(10, 10, 15, 0.78));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.25), inset 0 0 18px rgba(0, 0, 0, 0.6);
  z-index: 3;
}
.hdg { font-size: 34px; font-weight: 800; letter-spacing: 1px; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.hdgc { font-size: 14px; color: var(--accent); font-weight: 700; margin-top: 5px; letter-spacing: 3px; }
.lubber {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid var(--accent);
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.8));
  z-index: 4;
}

/* ---------- Compass info / controls ---------- */
.info {
  background: linear-gradient(to top, var(--bg-primary), rgba(10, 10, 15, 0.85));
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(0, 212, 255, 0.15);
}
.tgt { font-size: 20px; font-weight: 700; text-align: center; color: #fff; }
.hint { text-align: center; color: var(--accent-secondary); font-size: 15px; font-weight: 600; margin-top: 3px; min-height: 18px; }
.metrics { display: flex; gap: 10px; justify-content: center; align-items: center; color: var(--text-secondary); font-size: 15px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.metrics .dot { color: var(--text-muted); }
.controls { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.ctrl {
  min-width: 64px; height: 56px; border-radius: var(--radius-md);
  background: var(--bg-tertiary); color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ctrl.wide { min-width: 84px; font-size: 15px; letter-spacing: 1px; color: var(--accent); }

/* ---------- Targets ---------- */
.tlist { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.trow { display: flex; gap: 8px; }
.trow-sel {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start;
  min-height: 64px; justify-content: center; padding: 8px 14px;
  border-radius: 12px; background: var(--bg-tertiary); text-align: left;
}
.trow-sel.active { box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.45); }
.trow-name { font-size: 18px; font-weight: 700; color: #fff; }
.trow-meta { font-size: 13px; color: var(--text-secondary); margin-top: 3px; font-variant-numeric: tabular-nums; }
.trow-del { width: 56px; border-radius: 12px; background: var(--bg-secondary); color: var(--danger); font-size: 20px; font-weight: 700; }
.empty { color: var(--text-muted); text-align: center; padding: 36px 20px; font-size: 16px; }
.tfoot { padding: 12px 14px 16px; }
.addbtn { width: 100%; min-height: 56px; border-radius: 12px; background: var(--bg-tertiary); color: var(--accent); font-size: 17px; font-weight: 700; }

/* ---------- Add target ---------- */
.addbody { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bigbtn {
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: 80px; justify-content: center; padding: 12px 16px;
  border-radius: 14px; background: var(--bg-tertiary); text-align: left; gap: 4px;
}
.bigbtn b { font-size: 19px; color: #fff; }
.bigbtn i { font-style: normal; font-size: 13px; color: var(--text-secondary); }
.sectlbl { font-size: 11px; letter-spacing: 2px; color: var(--text-muted); font-weight: 700; margin: 8px 4px 2px; }
.presets { display: flex; flex-direction: column; gap: 8px; }
.preset {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 54px; padding: 0 16px; border-radius: 12px; background: var(--bg-secondary);
}
.preset span { font-size: 17px; color: #fff; font-weight: 600; }
.preset em { font-style: normal; font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- About ---------- */
.aboutbody { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.aboutbody p { font-size: 15px; line-height: 1.5; color: var(--text-primary); }
.aboutbody ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.aboutbody li { font-size: 14px; line-height: 1.4; color: var(--text-secondary); }
.aboutbody b { color: #fff; }
.aboutbody .dim { color: var(--text-muted); font-size: 13px; }
