:root {
  --bg: #0a0d09;
  --panel: rgba(14, 18, 12, 0.88);
  --panel-solid: #10150e;
  --line: rgba(190, 205, 155, 0.14);
  --line-strong: rgba(206, 220, 170, 0.26);
  --text: #e8e5d2;
  --dim: #969b83;
  --gold: #d9b76a;
  --gold-soft: rgba(217, 183, 106, 0.16);
  --green: #8fbf6a;
  --red: #d2705b;
  --amber: #d9a441;
  --teal: #4fb3a8;
  --violet: #a47fd4;
  --rust: #d2705b;
  --f0: #d9a441;
  --f1: #4fb3a8;
  --f2: #a47fd4;
  --f3: #d2705b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, 0.5));
  z-index: 2;
}

.sigil {
  font-size: 44px;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(217, 183, 106, 0.55);
  line-height: 1;
}
.sigil.small { font-size: 26px; }

/* boot */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #151c12 0%, #080a07 70%);
  transition: opacity 0.7s ease;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot h1 {
  margin: 14px 0 8px;
  font-size: 34px;
  letter-spacing: 0.36em;
  font-weight: 500;
  color: #efe9cf;
}
.boot p { color: var(--dim); letter-spacing: 0.12em; font-size: 12px; text-transform: uppercase; }

/* topbar */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: linear-gradient(to bottom, rgba(8, 10, 7, 0.94), rgba(8, 10, 7, 0.72) 70%, rgba(8, 10, 7, 0));
  border-bottom: 1px solid transparent;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 214px; }
.brand-name { font-size: 15px; letter-spacing: 0.32em; color: #efe9cf; }
.brand-sub { font-size: 11px; color: var(--dim); margin-top: 2px; }
.brand-sub .crown { color: var(--gold); }

.stats {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.stat {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  padding: 5px 11px;
  border-left: 1px solid rgba(190, 205, 155, 0.09);
  white-space: nowrap;
}
.stat:first-child { border-left: 0; }
.stat .ico { grid-row: 1 / 3; font-size: 15px; color: var(--gold); width: 16px; text-align: center; }
.stat b { font-size: 14px; font-weight: 600; color: #f0ecd8; line-height: 1.1; }
.stat i { font-size: 9px; font-style: normal; color: var(--dim); letter-spacing: 0.09em; text-transform: uppercase; }
.stat.weather b { font-size: 12px; font-weight: 400; color: #c9c6b2; }

.top-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(20, 25, 17, 0.7);
  border: 1px solid var(--line);
  color: #cfccb8;
  border-radius: 7px;
  font-size: 14px;
  transition: 0.15s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(35, 40, 25, 0.9); }
.icon-btn.tiny { width: 24px; height: 24px; font-size: 15px; border-radius: 5px; }

.speeds {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: rgba(20, 25, 17, 0.7);
}
.speeds button {
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 10.5px;
  padding: 0 9px;
  height: 30px;
  min-width: 30px;
  border-left: 1px solid rgba(190, 205, 155, 0.08);
}
.speeds button:first-child { border-left: 0; }
.speeds button.on { background: var(--gold-soft); color: var(--gold); }
.speeds button:hover { color: var(--text); }

/* panels */
.panel {
  position: fixed;
  z-index: 10;
  top: 72px;
  bottom: 54px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.28s ease, opacity 0.28s;
}
#left { left: 14px; width: 322px; }
#right { right: 14px; width: 356px; }
#left.collapsed { transform: translateX(-112%); opacity: 0; }

.tabs { display: flex; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  padding: 12px 6px 10px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tabs button.on { color: var(--gold); border-bottom-color: var(--gold); background: rgba(217, 183, 106, 0.05); }
.tabs button:hover { color: var(--text); }

.tab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.tab-body.hidden { display: none; }

.log { display: flex; flex-direction: column; gap: 7px; }
.log-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #cbc8b5;
  padding: 6px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  border-left: 2px solid rgba(190, 205, 155, 0.15);
  animation: slideIn 0.3s ease;
}
.log-item .lico { font-size: 12px; opacity: 0.8; text-align: center; }
.log-item.k0 { border-left-color: #8fbf6a; }
.log-item.k1 { border-left-color: #b06050; }
.log-item.k2 { border-left-color: #d9a441; }
.log-item.k3 { border-left-color: #a47fd4; }
.log-item.k4 { border-left-color: #6fbfb4; }
.log-item.k6 { border-left-color: #d9b76a; background: var(--gold-soft); }
.log-item.k7 { border-left-color: #7f9fd4; }
.log-fresh { color: #f1eeda; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.lang-head { margin-bottom: 10px; }
.lang-title { font-size: 16px; color: var(--gold); letter-spacing: 0.04em; margin-bottom: 5px; }
.hint { font-size: 11px; line-height: 1.5; color: var(--dim); }
.search {
  width: 100%;
  background: rgba(5, 8, 4, 0.6);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.search:focus { border-color: rgba(217, 183, 106, 0.55); }
.search.big { padding: 12px; font-size: 14px; margin: 8px 0; }
.dict { margin: 10px 0; max-height: 180px; overflow-y: auto; border-top: 1px solid var(--line); }
.dict-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 3px; border-bottom: 1px solid rgba(190, 205, 155, 0.06); font-size: 12px; }
.dict-row b { color: var(--gold); font-weight: 500; }
.dict-row span { color: var(--dim); }
.translator { margin-top: 10px; }
.translator label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); margin-bottom: 5px; }
.trans-out { margin-top: 7px; padding: 9px; background: rgba(217, 183, 106, 0.06); border: 1px solid rgba(217, 183, 106, 0.16); border-radius: 6px; font-size: 12px; color: #ded9be; min-height: 36px; line-height: 1.5; }
.live-block { margin-top: 14px; }
.live-block > label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); margin-bottom: 6px; }
.live-speech { display: flex; flex-direction: column; gap: 5px; }
.live-line { font-size: 11.5px; line-height: 1.45; padding: 5px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(190, 205, 155, 0.07); }
.live-line b { color: var(--gold); font-weight: 500; }
.live-line i { display: block; font-style: normal; color: var(--dim); font-size: 11px; }
.grammar { margin-top: 12px; font-size: 11px; line-height: 1.6; color: var(--dim); }
.grammar div { padding: 2px 0; border-bottom: 1px dotted rgba(190, 205, 155, 0.08); }

.powers { display: flex; flex-direction: column; gap: 8px; }
.power {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: 0.15s;
  position: relative;
  overflow: hidden;
}
.power:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }
.power.dead { opacity: 0.45; filter: grayscale(0.7); }
.power.me { border-color: rgba(217, 183, 106, 0.4); }
.power::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.power-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.power-name { font-size: 13px; color: #efebd6; letter-spacing: 0.02em; }
.power-pop { font-size: 11px; color: var(--dim); }
.power-sub { font-size: 10.5px; color: var(--dim); margin-top: 4px; display: flex; justify-content: space-between; gap: 8px; }
.power-sub .war { color: var(--red); }
.power-sub .crown { color: var(--gold); }
.power-bar { height: 3px; background: rgba(255, 255, 255, 0.06); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.power-bar span { display: block; height: 100%; background: var(--c); }
.tech-block { margin-top: 14px; }
.tech-block h3 { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin: 0 0 7px; font-weight: 500; }
.tech { display: flex; flex-direction: column; gap: 5px; }
.tech-item { padding: 6px 8px; background: rgba(164, 127, 212, 0.07); border: 1px solid rgba(164, 127, 212, 0.18); border-radius: 6px; font-size: 11px; }
.tech-item b { color: #cbb3e8; font-weight: 500; }
.tech-item span { display: block; color: var(--dim); font-size: 10px; margin-top: 2px; }

/* selection */
.sel-empty { margin: auto; text-align: center; padding: 24px 22px; }
.sel-empty .sigil { font-size: 38px; opacity: 0.55; }
.sel-empty-title { color: #d5d1bd; margin: 12px 0 6px; font-size: 14px; }
.sel { padding: 13px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.sel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sel-name { font-size: 18px; color: #f1edda; letter-spacing: 0.02em; }
.sel-role { font-size: 11px; color: var(--gold); margin-top: 2px; }
.sel-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--dim);
  background: rgba(255, 255, 255, 0.02);
}
.badge.king { color: var(--gold); border-color: rgba(217, 183, 106, 0.4); background: rgba(217, 183, 106, 0.08); }
.badge.war { color: var(--red); border-color: rgba(210, 112, 91, 0.4); background: rgba(210, 112, 91, 0.08); }
.badge.you { color: #9fd4c9; border-color: rgba(111, 191, 180, 0.4); background: rgba(111, 191, 180, 0.08); }
.badge.enemy { color: #e0a294; border-color: rgba(210, 112, 91, 0.3); }

.possess-row { display: flex; gap: 6px; }
.primary, .ghost {
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 12px;
  border: 1px solid transparent;
  transition: 0.15s;
}
.primary { background: linear-gradient(180deg, #e0c079, #c39c4f); color: #1b170c; font-weight: 600; }
.primary:hover { filter: brightness(1.08); }
.ghost { background: rgba(255, 255, 255, 0.03); border-color: var(--line); color: #d5d2be; }
.ghost:hover { border-color: var(--gold); color: var(--gold); }
.primary.wide, .ghost.wide { flex: 1; }
.primary:disabled, .ghost:disabled { opacity: 0.35; cursor: default; }

.bars { display: flex; flex-direction: column; gap: 5px; }
.bar { display: grid; grid-template-columns: 62px 1fr 24px; align-items: center; gap: 7px; font-size: 10px; color: var(--dim); }
.bar b { font-size: 10px; color: #c9c6b2; font-weight: 500; text-align: right; }
.track { height: 5px; background: rgba(255, 255, 255, 0.07); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 3px; transition: width 0.25s; }
.fill.hp { background: linear-gradient(90deg, #8f3f33, #d2705b); }
.fill.food { background: linear-gradient(90deg, #8a7430, #d9b76a); }
.fill.energy { background: linear-gradient(90deg, #3f6f68, #6fbfb4); }
.fill.mood { background: linear-gradient(90deg, #6a5a99, #a47fd4); }

.sel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.sel-stats div { background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(190, 205, 155, 0.08); border-radius: 6px; padding: 5px 7px; }
.sel-stats i { display: block; font-style: normal; font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.sel-stats b { font-size: 11px; font-weight: 500; color: #ddd9c5; }

.order-box { background: rgba(217, 183, 106, 0.07); border: 1px solid rgba(217, 183, 106, 0.18); border-radius: 6px; padding: 7px 9px; }
.order-label { font-size: 8.5px; letter-spacing: 0.14em; color: var(--gold); margin-bottom: 3px; }
#orderText { font-size: 11.5px; color: #e4dfc8; }

.speech-box { background: rgba(8, 12, 7, 0.55); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-height: 50px; }
.speech-con { color: var(--gold); font-size: 13px; line-height: 1.4; word-break: break-word; }
.speech-ru { color: var(--dim); font-size: 11px; margin-top: 3px; line-height: 1.4; }

.brain-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 9.5px; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; margin-top: 3px; }
.brain-legend { display: flex; align-items: center; gap: 5px; font-size: 8.5px; letter-spacing: 0.06em; }
.brain-legend .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.brain-out, .brain-in { display: grid; gap: 3px; }
.brain-out { grid-template-columns: repeat(2, 1fr); }
.brain-in { grid-template-columns: repeat(2, 1fr); }
.brain-mid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 6px; align-items: stretch; }
.brain-hidden { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; align-content: start; background: rgba(255, 255, 255, 0.02); border-radius: 5px; padding: 4px; }
.brain-hidden span { height: 5px; border-radius: 1px; background: #4c5b3f; }
.brain-row { display: flex; align-items: center; gap: 4px; font-size: 8.5px; color: #8d927c; }
.brain-row .meter { flex: 1; height: 5px; background: rgba(255, 255, 255, 0.06); border-radius: 2px; overflow: hidden; }
.brain-row .meter span { display: block; height: 100%; background: linear-gradient(90deg, #6d744f, var(--gold)); }
.brain-row em { font-style: normal; width: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #a2a58f; }
.brain-note { font-size: 9px; color: #777c68; line-height: 1.4; }

.town-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 2px; }
.town-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; padding: 4px 0; border-bottom: 1px dotted rgba(190, 205, 155, 0.09); }
.town-row span { color: var(--dim); }
.town-row b { font-weight: 500; color: #dedac6; text-align: right; }
.town-war { color: var(--red) !important; }
#townPanel { padding: 13px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }

/* footer */
#toolbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 46px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  background: linear-gradient(to top, rgba(8, 10, 7, 0.94), rgba(8, 10, 7, 0.55) 70%, rgba(8, 10, 7, 0));
  font-size: 10.5px;
  color: var(--dim);
}
.hintline { letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.war-status { color: var(--red); font-size: 10.5px; letter-spacing: 0.04em; }
.toggle { background: transparent; border: 1px solid var(--line); color: var(--dim); border-radius: 5px; padding: 4px 8px; font-size: 10px; }
.toggle:hover { color: var(--gold); border-color: rgba(217, 183, 106, 0.4); }
.seed { font-size: 9.5px; color: #6f7462; letter-spacing: 0.08em; }

/* minimap */
.minimap-wrap {
  position: fixed;
  right: 382px;
  bottom: 58px;
  z-index: 9;
  width: 202px;
  padding: 4px;
  background: rgba(10, 14, 9, 0.82);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: opacity 0.25s;
}
.minimap-wrap.hidden { display: none; }
#minimap { width: 192px; height: 192px; display: block; border-radius: 6px; cursor: crosshair; }
.minimap-label { text-align: center; font-size: 8px; letter-spacing: 0.24em; color: #777c68; padding: 4px 0 1px; }

/* tooltip/toast */
.tip {
  position: fixed;
  z-index: 40;
  max-width: 300px;
  pointer-events: none;
  background: rgba(8, 12, 7, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.45;
  color: #dfdbc6;
  box-shadow: var(--shadow);
}
.tip .tcon { color: var(--gold); font-size: 12px; margin-bottom: 2px; }

.toast {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  background: rgba(10, 14, 9, 0.95);
  border: 1px solid rgba(217, 183, 106, 0.35);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 12px;
  color: #ece8d2;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
  max-width: 70vw;
  text-align: center;
}
.toast.warn { border-color: rgba(210, 112, 91, 0.5); color: #f0c9bf; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  background: rgba(220, 235, 255, 0.55);
  opacity: 0;
  transition: opacity 0.2s;
}
.flash.on { opacity: 1; transition: none; }

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(3, 5, 3, 0.72);
  backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-card {
  position: relative;
  width: min(620px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #141a11, #0c100b 70%);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  animation: cardIn 0.25s ease;
}
.modal-card.compact { width: min(460px, 94vw); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-card h2 { font-size: 19px; font-weight: 500; color: #f0ecd8; letter-spacing: 0.05em; margin: 0 0 12px; }
.modal-card p { font-size: 12px; line-height: 1.65; color: #b8b6a2; margin: 0 0 12px; }
.modal-card .close { position: absolute; top: 12px; right: 12px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 6px 0 8px; }
.help-grid h3 { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 12px 0 5px; font-weight: 500; }
.help-grid p { font-size: 11.5px; margin: 0 0 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.over { text-align: center; }
.over .over-sigil { font-size: 44px; color: var(--gold); text-shadow: 0 0 30px rgba(217, 183, 106, 0.4); }
.over h2 { margin-top: 8px; }
.over p { font-size: 13px; }
.over .modal-actions { justify-content: center; }

.cmd-target { font-size: 14px; color: var(--gold); margin-bottom: 4px; }
.suggest { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.suggest button { background: rgba(217, 183, 106, 0.07); border: 1px solid rgba(217, 183, 106, 0.22); color: #d6c89d; font-size: 10.5px; border-radius: 12px; padding: 4px 9px; }
.suggest button:hover { background: rgba(217, 183, 106, 0.16); }
.cmd-trans { min-height: 34px; padding: 8px 10px; border: 1px dashed rgba(190, 205, 155, 0.2); border-radius: 6px; font-size: 12px; color: var(--dim); }
.cmd-trans.ready { border-style: solid; border-color: rgba(217, 183, 106, 0.3); color: var(--gold); background: rgba(217, 183, 106, 0.05); }

.war-list { display: flex; flex-direction: column; gap: 7px; }
.war-summary { font-size: 11px; line-height: 1.55; color: var(--dim); background: rgba(217, 183, 106, 0.05); border: 1px solid rgba(217, 183, 106, 0.16); border-radius: 7px; padding: 8px 10px; margin-bottom: 3px; }
.war-summary b { color: var(--gold); font-weight: 600; }
.war-item.weak .go { color: #c9a05a; }
.war-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c);
  border-radius: 7px;
  transition: 0.15s;
}
.war-item:hover { border-color: var(--line-strong); background: rgba(210, 112, 91, 0.08); }
.war-item b { font-weight: 500; color: #e4dfc9; font-size: 13px; display: block; }
.war-item span { font-size: 10.5px; color: var(--dim); }
.war-item .go { color: var(--rust); font-size: 11px; white-space: nowrap; }

/* ---------------- 3D ---------------- */
#threeWrap { position: fixed; inset: 0; z-index: 20; background: #0a0d09; }
#three { width: 100%; height: 100%; display: block; }
#threeHud { position: absolute; inset: 0; pointer-events: none; z-index: 2; font-family: inherit; }

.t3-top {
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}
.t3-town { font-size: 13px; letter-spacing: 0.14em; color: #efe9d1; text-transform: uppercase; }
.t3-town b { display: block; font-size: 10px; letter-spacing: 0.06em; color: #c9b273; font-weight: 400; margin-top: 2px; }
.t3-keys { margin-top: 8px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; font-size: 9.5px; color: rgba(233, 230, 210, 0.72); }
kbd {
  font-family: inherit;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(15, 20, 12, 0.75);
  border: 1px solid rgba(220, 225, 200, 0.22);
  color: #e5dfc7;
}

.t3-left { position: absolute; left: 24px; bottom: 30px; width: 252px; }
.t3-bars { display: flex; flex-direction: column; gap: 6px; }
.t3-bar { display: flex; align-items: center; gap: 7px; }
.t3-bar i { font-style: normal; font-size: 12px; width: 16px; text-shadow: 0 1px 3px #000; }
.t3-bar > div { flex: 1; height: 7px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 4px; overflow: hidden; }
.t3-bar span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 0.2s; }
.t3-bar:nth-child(1) span { background: linear-gradient(90deg, #8f3f33, #d2705b); }
.t3-bar:nth-child(2) span { background: linear-gradient(90deg, #8a7430, #d9b76a); }
.t3-bar:nth-child(3) span { background: linear-gradient(90deg, #3f6f68, #6fbfb4); }
.t3-order { margin-top: 8px; font-size: 10.5px; color: #d9c48d; text-shadow: 0 1px 4px #000; min-height: 14px; }

.t3-right { position: absolute; right: 24px; bottom: 30px; width: 270px; text-align: right; }
.t3-panel { background: rgba(7, 10, 6, 0.55); border: 1px solid rgba(220, 225, 200, 0.14); border-radius: 8px; padding: 9px 12px; backdrop-filter: blur(4px); }
.t3-city { font-size: 13px; color: #efe9d1; letter-spacing: 0.05em; }
.t3-line { font-size: 10.5px; color: #c3c1ac; margin-top: 3px; }
.t3-line.dim { color: #8f947f; }
.t3-feed { margin-top: 9px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; min-height: 40px; }
.t3-feed div { font-size: 10.5px; color: rgba(235, 230, 210, 0.86); background: rgba(7, 10, 6, 0.45); border-radius: 5px; padding: 3px 7px; max-width: 100%; text-shadow: 0 1px 3px #000; }
.t3-feed div b { color: var(--gold); font-weight: 500; }

.t3-crosshair { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); opacity: 0.8; }
.t3-crosshair::before, .t3-crosshair::after { content: ""; position: absolute; background: rgba(240, 236, 215, 0.85); box-shadow: 0 0 3px #000; }
.t3-crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
.t3-crosshair::after { top: 8px; left: 0; height: 2px; width: 18px; }
.t3-crosshair.hit::before, .t3-crosshair.hit::after { background: #e8b76a; }

.t3-prompt {
  position: absolute;
  left: 50%; top: calc(50% + 24px);
  transform: translateX(-50%);
  font-size: 11.5px;
  color: #f0ead2;
  background: rgba(7, 10, 6, 0.7);
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid rgba(217, 183, 106, 0.25);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  text-shadow: 0 1px 3px #000;
}
.t3-prompt.on { opacity: 1; }
.t3-start {
  position: absolute;
  left: 50%; top: 58%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(240, 236, 215, 0.8);
  background: rgba(7, 10, 6, 0.6);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(240, 236, 215, 0.18);
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.t3-start.off { opacity: 0; }

@media (max-width: 1460px) {
  .stat.weather { display: none; }
  .minimap-wrap { right: 376px; }
}
@media (max-width: 1280px) {
  #left { width: 290px; }
  #right { width: 320px; }
  .stat { padding: 5px 8px; }
  .minimap-wrap { display: none; }
  .brand { min-width: 170px; }
}
@media (max-width: 1050px) {
  .stats .stat:nth-child(5), .stats .stat:nth-child(8) { display: none; }
  .brand-name { font-size: 13px; letter-spacing: 0.22em; }
}
@media (max-width: 860px) {
  #left { display: none; }
  #right { width: 300px; top: 66px; bottom: 50px; }
  .hintline { display: none; }
  .t3-keys { display: none; }
  .t3-right { display: none; }
}
