:root {
  --ink: #edf1ee;
  --muted: #98a49e;
  --amber: #f0a92c;
  --green: #6fd08c;
  --red: #e2594a;
  --panel: rgba(11, 14, 13, 0.64);
  --panel-solid: rgba(14, 18, 17, 0.93);
  --line: rgba(237, 241, 238, 0.16);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0f0e;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.tabular {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.app {
  position: fixed;
  inset: 0;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================ HUD ============================ */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 13px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 11px;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.hud__top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.hud__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-self: center;
  min-width: 0;
}

.panel--mission {
  min-width: 128px;
  justify-self: start;
}

.panel--mission .big {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--amber);
}

.panel--mission .sub {
  font-size: 11px;
  color: var(--muted);
}

.panel--mission.is-urgent .big {
  color: var(--red);
  animation: pulse 1s steps(2, end) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.panel--map {
  padding: 8px;
  width: 200px;
}

#minimap {
  display: block;
  width: 176px;
  height: 176px;
  border-radius: 2px;
}

.map__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

#bearingText {
  color: var(--ink);
}

.killfeed {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 190px;
  max-width: 260px;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.killfeed li {
  background: rgba(11, 14, 13, 0.72);
  border-left: 2px solid var(--amber);
  border-radius: 3px;
  padding: 4px 9px;
  font-size: 12px;
  animation: feedIn 0.18s ease-out;
}

.killfeed li.is-elite {
  border-left-color: var(--red);
}

.killfeed li.is-info {
  border-left-color: var(--green);
  color: var(--green);
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hud__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.crosshair {
  position: relative;
  width: 42px;
  height: 42px;
  --gap: 9px;
}

.crosshair .ch {
  position: absolute;
  background: rgba(240, 245, 242, 0.88);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.75);
}

.crosshair .ch--t {
  width: 2px;
  height: 9px;
  left: calc(50% - 1px);
  top: calc(50% - var(--gap) - 9px);
}

.crosshair .ch--b {
  width: 2px;
  height: 9px;
  left: calc(50% - 1px);
  top: calc(50% + var(--gap));
}

.crosshair .ch--l {
  width: 9px;
  height: 2px;
  top: calc(50% - 1px);
  left: calc(50% - var(--gap) - 9px);
}

.crosshair .ch--r {
  width: 9px;
  height: 2px;
  top: calc(50% - 1px);
  left: calc(50% + var(--gap));
}

.crosshair .ch__dot {
  position: absolute;
  width: 2px;
  height: 2px;
  left: calc(50% - 1px);
  top: calc(50% - 1px);
  background: rgba(240, 245, 242, 0.55);
}

.crosshair.is-ads .ch {
  background: rgba(240, 169, 44, 0.95);
}

.hitmarker {
  position: absolute;
  width: 26px;
  height: 26px;
  opacity: 0;
  background:
    linear-gradient(45deg, transparent 45%, var(--ink) 45%, var(--ink) 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, var(--ink) 45%, var(--ink) 55%, transparent 55%);
  transform: scale(0.7);
  transition: opacity 0.09s linear, transform 0.09s ease-out;
}

.hitmarker.is-on {
  opacity: 1;
  transform: scale(1);
}

.hitmarker.is-kill {
  filter: hue-rotate(-20deg) saturate(2);
}

.prompt {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(11, 14, 13, 0.78);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 13px;
  font-size: 13px;
  transform: translateY(56px);
  position: absolute;
}

.prompt__key {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--amber);
  color: #1a1206;
  font-weight: 700;
  font-size: 12px;
}

.prompt__bar {
  display: block;
  width: 96px;
  height: 5px;
  border-radius: 3px;
  background: rgba(237, 241, 238, 0.18);
  overflow: hidden;
}

.prompt__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
}

.cuetext {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 288px);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  color: var(--amber);
  animation: cueIn 0.25s ease-out;
}

@keyframes cueIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hud__bottom {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.panel--vitals {
  width: 232px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bar {
  display: grid;
  grid-template-columns: 40px 1fr 34px;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.bar__label {
  color: var(--muted);
}

.bar__track {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: rgba(237, 241, 238, 0.15);
  overflow: hidden;
}

.bar__track i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transition: transform 0.14s linear;
}

.bar--hp .bar__track i {
  background: linear-gradient(90deg, #cf4636, #e8724f);
}

.bar--armor .bar__track i {
  background: linear-gradient(90deg, #4f7fa8, #7fb6cc);
}

.bar--stamina .bar__track i {
  background: linear-gradient(90deg, #7a8a52, #b9c47a);
}

.bar--stamina {
  grid-template-columns: 40px 1fr;
}

.bar__value {
  text-align: right;
  font-size: 12px;
}

.gear {
  display: flex;
  gap: 12px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.gear b {
  color: var(--ink);
  font-family: var(--mono);
}

.panel--objectives {
  min-width: 190px;
}

.panel--objectives ul {
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.panel--objectives li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.panel--objectives li::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid var(--muted);
  border-radius: 1px;
}

.panel--objectives li.is-done {
  color: var(--green);
  text-decoration: line-through;
}

.panel--objectives li.is-done::before {
  background: var(--green);
  border-color: var(--green);
}

.panel--weapon {
  min-width: 200px;
  text-align: right;
  display: grid;
  gap: 2px;
  justify-items: end;
}

.weapon__name {
  font-size: 12px;
  color: var(--muted);
}

.weapon__mode {
  font-size: 11px;
  color: var(--amber);
}

.weapon__ammo {
  font-size: 15px;
  color: var(--muted);
}

.weapon__ammo b {
  font-size: 27px;
  color: var(--ink);
  font-weight: 700;
}

.weapon__ammo.is-empty b {
  color: var(--red);
}

.weapon__slots {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.weapon__slots i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
  font-style: normal;
  color: var(--muted);
}

.weapon__slots i.is-active {
  background: rgba(240, 169, 44, 0.2);
  border-color: var(--amber);
  color: var(--amber);
}

.weapon__reload {
  font-size: 11px;
  color: var(--amber);
}

.lootbar {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(11, 14, 13, 0.62);
  border: 1px solid var(--line);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  font-size: 11px;
  color: var(--muted);
}

.lootbar b {
  color: var(--amber);
  font-size: 14px;
}

.lootbar__sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.keydebug {
  position: absolute;
  left: 18px;
  top: 100px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: min(300px, 46vw);
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(11, 14, 13, 0.84);
  border: 1px solid var(--line);
}

.keydebug[hidden] {
  display: none;
}

.keydebug b {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 2px 6px;
}

.keydebug b.is-on {
  color: #17120f;
  background: var(--amber);
  border-color: var(--amber);
}

.toasts {
  position: absolute;
  left: 50%;
  bottom: 32%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.toast {
  background: rgba(11, 14, 13, 0.8);
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: 3px;
  padding: 5px 11px;
  font-size: 12px;
  animation: toastIn 0.2s ease-out;
}

.toast b {
  color: var(--amber);
}

.toast--good {
  border-left-color: var(--green);
}

.toast--bad {
  border-left-color: var(--red);
}

.toast--gone {
  opacity: 0;
  transition: opacity 0.35s;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 受击反馈 */

.vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease-out;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(160, 30, 20, 0.55) 100%);
}

.vignette--low {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(120, 16, 12, 0.62) 100%);
}

.dmg-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin: -70px 0 0 -14px;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 22px solid var(--red);
  opacity: 0;
  transition: opacity 0.5s;
}

.dmg-arrow--n {
  transform: rotate(0deg) translateY(-96px);
}

.dmg-arrow--e {
  transform: rotate(90deg) translateY(-96px);
}

.dmg-arrow--s {
  transform: rotate(180deg) translateY(-96px);
}

.dmg-arrow--w {
  transform: rotate(-90deg) translateY(-96px);
}

.dmg-arrow.is-on {
  opacity: 0.9;
  transition: opacity 0.05s;
}

/* ============================ 屏幕层 ============================ */

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(6, 8, 8, 0.62), rgba(6, 8, 8, 0.84));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow: auto;
  z-index: 6;
}

.shell {
  width: min(760px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.shell--narrow {
  width: min(460px, 100%);
}

.kicker {
  margin: 0;
  font-size: 12px;
  color: var(--amber);
}

.title {
  margin: 4px 0 6px;
  font-size: 38px;
  font-weight: 800;
}

.verdict {
  margin: 4px 0 10px;
  font-size: 26px;
}

.lede {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.field {
  margin-bottom: 12px;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--amber);
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0 8px;
}

.chip--mode {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 9px 11px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}

.chip--mode b {
  font-size: 13px;
}

.chip--mode span {
  font-size: 11px;
  color: var(--muted);
}

.chip--mode.is-active {
  border-color: var(--amber);
  background: rgba(240, 169, 44, 0.14);
}

.chip--mode.is-active span {
  color: #dfbd80;
}

.note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}

.setting {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.setting b {
  color: var(--ink);
}

.setting input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
}

.setting--switch {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.setting--switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
}

.keys {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px 12px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  font-size: 12px;
  color: var(--muted);
}

.keys b {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
}

.btn {
  display: inline-grid;
  place-items: center;
  padding: 11px 18px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  width: 100%;
  background: linear-gradient(180deg, #f5b640, #dd9520);
  border-color: #f7c463;
  color: #1c1305;
  font-weight: 700;
  font-size: 15px;
}

.btn--ghost {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.meta-row b {
  color: var(--amber);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 10px;
}

.score-big span:first-child {
  font-size: 42px;
  font-weight: 800;
  color: var(--amber);
}

.score-big__unit {
  font-size: 13px;
  color: var(--muted);
}

.rating {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 4px;
  border: 1px solid var(--amber);
  background: rgba(240, 169, 44, 0.14);
  color: var(--amber);
  font-size: 24px;
  font-weight: 800;
}

.quip {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
}

.stat span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.stat b {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-family: var(--mono);
}

.board {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  counter-reset: rank;
}

.board li {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
}

.board li::before {
  counter-increment: rank;
  content: counter(rank);
  font-family: var(--mono);
  color: var(--muted);
}

.board li.is-top {
  border-color: rgba(240, 169, 44, 0.6);
  background: rgba(240, 169, 44, 0.08);
}

.board li.is-top::before {
  color: var(--amber);
}

.board b {
  font-family: var(--mono);
  color: var(--amber);
}

.board i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

/* ============================ 触屏 ============================ */

.touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.touch__look {
  position: absolute;
  right: 0;
  top: 0;
  width: 58%;
  height: 100%;
  pointer-events: auto;
}

.touch__stick {
  position: absolute;
  left: 22px;
  bottom: 92px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 1px solid rgba(237, 241, 238, 0.22);
  background: rgba(11, 14, 13, 0.32);
  pointer-events: auto;
}

.touch__stick i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(240, 169, 44, 0.32);
  border: 1px solid rgba(240, 169, 44, 0.6);
}

.touch__actions {
  position: absolute;
  right: 18px;
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  pointer-events: auto;
}

.tbtn {
  min-width: 62px;
  padding: 12px 10px;
  border-radius: 6px;
  border: 1px solid rgba(237, 241, 238, 0.24);
  background: rgba(11, 14, 13, 0.55);
  color: var(--ink);
  font-size: 12px;
  font-family: inherit;
}

.tbtn.is-on {
  background: rgba(240, 169, 44, 0.28);
  border-color: var(--amber);
}

.tbtn--fire {
  grid-column: span 3;
  background: rgba(226, 89, 74, 0.32);
  border-color: rgba(226, 89, 74, 0.7);
  font-weight: 700;
  font-size: 14px;
}

.rotate-hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 14, 13, 0.7);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  z-index: 8;
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0d0f0e;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  z-index: 9;
}

/* ============================ 响应式 ============================ */

@media (max-width: 900px) {
  .panel--objectives,
  .killfeed {
    display: none;
  }

  .panel--map {
    width: 156px;
  }

  #minimap {
    width: 132px;
    height: 132px;
  }

  .cuetext {
    top: calc(max(12px, env(safe-area-inset-top)) + 240px);
  }
}

@media (max-width: 640px) {
  .title {
    font-size: 30px;
  }

  .hud__top {
    gap: 8px;
  }

  .panel--mission .big {
    font-size: 22px;
  }

  .lootbar {
    font-size: 10px;
    padding: 5px 10px;
  }

  .panel--vitals {
    width: 176px;
  }

  .panel--weapon {
    min-width: 132px;
  }

  .weapon__ammo b {
    font-size: 22px;
  }

  .modes {
    grid-template-columns: 1fr;
  }

  .hud__bottom {
    bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@media (max-height: 520px) {
  .lootbar {
    display: none;
  }
}
