/* TERRA // BORDER WAR (static/js/games/terra.js). The map canvas fills the stage; the HUD floats
   over it in hub-panel glass (solid, no backdrop-filter: the canvas repaints every frame). */
.tr-stage { position: relative; padding: 0; overflow: hidden; height: min(74vh, 760px); min-height: 420px; background: #08121c; user-select: none; }
.tr-stage.gfull { position: fixed; inset: 0; z-index: 45; height: auto; margin: 0; border: 0; border-radius: 0; }
#terra-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.tr-hud { position: absolute; z-index: 2; background: rgba(6, 10, 18, .84); border: 1px solid var(--holo-dim); border-radius: 6px; font-family: var(--mono); font-size: 12px; color: #dfe8ee; }
.tr-hud .label { font-size: 10px; letter-spacing: .12em; color: var(--holo); margin: 2px 0 4px; }
.tr-top { top: 8px; left: 8px; right: 150px; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 10px; }
.tr-top:empty, .tr-log:empty { display: none; }
.tr-stat { display: flex; flex-direction: column; min-width: 74px; }
.tr-stat .label { margin: 0; }
.tr-stat b { font-size: 16px; color: var(--amber, #ffb020); line-height: 1.2; }
.tr-troops { min-width: 150px; }
.tr-bar { position: relative; height: 5px; background: #1a2430; border-radius: 3px; margin-top: 3px; }
.tr-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #2bd6b8, #7dff8a); border-radius: 3px; }
.tr-bar em { position: absolute; top: -2px; bottom: -2px; width: 1px; background: #ffcc66; }
.tr-tools { top: 8px; right: 8px; display: flex; gap: 4px; padding: 4px; }
.tr-tools button { min-width: 30px; padding: 5px 7px; font-size: 12px; }
.tr-left { left: 8px; bottom: 8px; width: 230px; padding: 8px 10px; max-height: calc(100% - 90px); overflow: auto; }
.tr-left input[type=range] { width: 100%; accent-color: var(--holo); }
#tr-ratio-v { color: #fff; letter-spacing: 0; }
.tr-build { display: flex; gap: 6px; margin: 8px 0; }
.tr-build button { flex: 1; padding: 6px 4px; font-size: 12px; }
.tr-build button.on { outline: 2px solid var(--holo); background: rgba(79, 227, 255, .18); }
.tr-build button:disabled { opacity: .45; }
.tr-ops { display: flex; flex-direction: column; gap: 3px; }
.tr-op { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 6px; align-items: center; }
.tr-op i, .tr-na i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.tr-op span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-op button { padding: 0 5px; font-size: 11px; line-height: 16px; }
.tr-op.bad { color: #ffb4a8; }
.tr-right { right: 8px; top: 52px; width: 230px; padding: 8px 10px; max-height: calc(100% - 200px); overflow: auto; }
.tr-na { display: grid; grid-template-columns: 10px 1fr auto 46px; gap: 6px; align-items: center; padding: 1px 0; }
.tr-na span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-na em { font-style: normal; color: #8ea0ad; text-align: right; font-size: 11px; }
.tr-na.you span { color: #7dffe6; font-weight: 700; }
.tr-na.dead { opacity: .4; text-decoration: line-through; }
.tr-log { right: 8px; bottom: 8px; width: 330px; padding: 6px 10px; font-size: 11px; pointer-events: none; }
.tr-ev { padding: 1px 0; color: #c7d2da; }
.tr-ev span { color: #6f8494; }
.tr-ev.warn { color: #ffb4a8; } .tr-ev.fall { color: #ffcc66; } .tr-ev.good { color: #9dffb0; } .tr-ev.sea { color: #9fdcff; }
.tr-tip { position: absolute; z-index: 3; left: 50%; top: 64px; transform: translateX(-50%); background: rgba(6, 10, 18, .9); border: 1px solid var(--holo-dim); border-radius: 5px; padding: 5px 10px; font: 12px var(--mono); color: #dfe8ee; pointer-events: none; text-align: center; }
.tr-tip .bad { color: #ff8a7a; } .tr-act { color: var(--holo); }
.tr-tip.hidden, .tr-menu.hidden { display: none; }
.tr-menu { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(3, 6, 12, .5); padding: 16px; }
.tr-card { max-width: 520px; width: 100%; padding: 18px 20px; }
.tr-card p { line-height: 1.5; }
.tr-modes { margin: 10px 0; }
.tr-opts { display: flex; gap: 14px; margin: 10px 0; font: 11px var(--mono); letter-spacing: .08em; color: var(--holo); }
.tr-opts select { margin-left: 6px; }
.tr-go { width: 100%; padding: 12px; font: 700 15px var(--mono); letter-spacing: .14em; margin: 8px 0; }
.tr-keys { color: #8ea0ad; }
.tr-under { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tr-row { display: grid; grid-template-columns: 1fr auto 44px; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(79, 227, 255, .08); font-family: var(--mono); font-size: 12px; }
.tr-row.you span { color: var(--holo); font-weight: 700; }
.tr-row em { font-style: normal; color: #8ea0ad; text-align: right; }
.tr-me { margin-top: 8px; }
@media (max-width: 820px) {
  .tr-stage { height: 76vh; min-height: 380px; }
  .tr-top { right: 8px; top: 46px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 0 8px; padding: 4px 8px; }
  .tr-stat, .tr-troops { min-width: 0; }
  .tr-stat .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tr-stat .tiny { display: none; }
  .tr-stat b { font-size: 13px; }
  .tr-tools { top: 6px; left: 8px; right: auto; }
  .tr-right { display: none; }
  .tr-log { left: 8px; right: 8px; bottom: auto; top: 98px; width: auto; overflow: hidden; }
  .tr-ev:not(:nth-last-child(-n+2)) { display: none; }
  .tr-left { width: auto; right: 8px; max-height: 38%; }
  .tr-tip { top: auto; bottom: 46%; }
  .tr-under { grid-template-columns: 1fr; }
}
/* CAREER shop swatches for the TERRA cosmetics */
.cr-item i.cr-glyph { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 15px; color: #ffe9a8; background: #182230; }
.cr-item i.cr-bo { background: #2a3a2c; box-shadow: inset 0 0 0 3px #2bd6b8; }
.cr-item i.cr-bo-dash { box-shadow: none; outline: 3px dashed #2bd6b8; outline-offset: -3px; }
.cr-item i.cr-bo-glow { box-shadow: inset 0 0 0 2px #7dffe6, 0 0 8px #2bd6b8; }
.cr-item i.cr-bo-gold { box-shadow: inset 0 0 0 3px #ffd36a, 0 0 6px #ffb020; }
/* v2: ports, the guns, seasons, diplomacy, squad signals, the campaign and replays */
.tr-left.hidden, .tr-signals.hidden, .tr-pop.hidden { display: none; }
.tr-build button { min-width: 0; }
.tr-strike { width: 100%; padding: 6px 4px; font-size: 12px; margin-bottom: 8px; }
.tr-strike.on { outline: 2px solid #ffb347; background: rgba(255, 179, 71, .18); }
.tr-strike:disabled { opacity: .5; }
.tr-sea b { font-size: 12px; color: #dfe8ee; }
.tr-stat .bad { color: #ff8a7a; }
.tr-sup { font-style: normal; font-size: 10px; color: #7dffe6; }
.tr-sup.low { color: #ffb347; }
.tr-na { cursor: pointer; }
.tr-na:hover span { color: var(--holo); }
.tr-na small { color: #9fb0bd; }
.tr-gov { display: block; margin-top: 6px; font: 10px var(--mono); letter-spacing: .1em; color: var(--holo); }
.tr-gov select { margin-left: 6px; }
.tr-signals { left: 50%; transform: translateX(-50%); top: 52px; display: flex; gap: 4px; padding: 4px; }
.tr-signals button { padding: 5px 8px; font-size: 12px; }
.tr-pop { position: absolute; z-index: 4; right: 248px; top: 52px; width: 270px; padding: 10px 12px; background: rgba(6, 10, 18, .94); font: 12px var(--mono); color: #dfe8ee; }
.tr-pop-h { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.tr-pop-h i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.tr-pop-h button { padding: 0 6px; }
.tr-pop .quick { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tr-pop .bad { color: #ff8a7a; }
.tr-modes { display: flex; flex-wrap: wrap; gap: 4px; }
.tr-modes button { flex: 1 1 auto; font-size: 11px; padding: 6px 6px; }
.tr-resume { width: 100%; padding: 9px; margin: 6px 0; font: 700 13px var(--mono); letter-spacing: .08em; border-color: #7dff8a; color: #c9ffd0; }
.tr-wait { color: #ffcc66; margin-top: 4px; }
.tr-note { color: #9dffb0; margin-top: 4px; }
.tr-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tr-person { border: 1px solid var(--holo-dim); border-radius: 4px; padding: 3px 8px; font: 12px var(--mono); }
.tr-row button { padding: 0 8px; font-size: 11px; line-height: 18px; }
.tr-card .tr-row { grid-template-columns: 1fr auto auto; align-items: center; }
#tr-board .tr-row { grid-template-columns: 1fr auto 44px 26px; }
.tr-report { margin: 6px 0; padding: 6px 8px; border-left: 2px solid var(--holo-dim); }
.tr-card { max-height: calc(100% - 24px); overflow: auto; }
.tr-under { grid-template-columns: 1fr 1fr 1.4fr; }
@media (max-width: 820px) {
  .tr-pop { right: 8px; left: 8px; width: auto; top: 140px; }
  .tr-signals { top: auto; bottom: 40%; }
  .tr-signals button { padding: 2px 6px; font-size: 10px; }
  .tr-sea { display: none; }
  .tr-under { grid-template-columns: 1fr; }
}
/* v2.1: the WorldBox-style toolbar (build tools snap to the nearest spot that takes them) */
.tr-toolbar { left: 250px; right: 8px; bottom: 8px; display: flex; justify-content: center; gap: 6px; padding: 6px; background: transparent; border: 0; pointer-events: none; }
.tr-toolbar.hidden { display: none; }
.tr-toolbar button { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 6px 8px 5px; border: 2px solid #2b3a4a; border-radius: 8px;
  background: linear-gradient(#1b2633, #111a24); box-shadow: 0 3px 0 #070b10, inset 0 1px 0 rgba(255, 255, 255, .08); color: #e8eef2; font: 700 10px var(--mono); letter-spacing: .08em; }
.tr-toolbar button b { font-size: 20px; line-height: 22px; }
.tr-toolbar button em { font-style: normal; font-weight: 400; color: #ffd36a; font-size: 10px; }
.tr-toolbar button.on { border-color: #7dffe6; background: linear-gradient(#1f4a4a, #133236); box-shadow: 0 3px 0 #0a2a28, 0 0 10px rgba(125, 255, 230, .35); }
.tr-toolbar button.poor em { color: #ff8a7a; }
.tr-toolbar button:disabled { opacity: .45; }
.tr-log { bottom: 86px; }
@media (max-width: 820px) {
  .tr-toolbar { left: 4px; right: 4px; bottom: 4px; gap: 3px; padding: 0; }
  .tr-toolbar button { min-width: 0; flex: 1; padding: 4px 2px; }
  .tr-toolbar button b { font-size: 16px; line-height: 18px; }
  .tr-toolbar button span { font-size: 8px; }
  .tr-left { bottom: 72px; }
}
