﻿* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #0a0a0e;
  color: #c0c0c0;
  font-family: 'Segoe UI', sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
}
/** Тактика: без боковых полей от центрирования и max-width — карта на всю ширину окна */
body.tacticalScreen {
  align-items: stretch;
}
body.tacticalScreen #mainArea {
  max-width: none;
  width: 100%;
}
/** Канвас на всю область между колонками; object-fit: contain — без лишних полей от flex-center */
body.tacticalScreen #canvasWrap .canvasContainer {
  align-items: stretch;
  justify-content: stretch;
}
body.tacticalScreen #canvasWrap canvas.canvasMain {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
#ui {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  background: #1a1a24;
  border-bottom: 1px solid #2a2a38;
  width: 100%;
  max-width: 1600px;
  flex-wrap: wrap;
  align-items: center;
}
#ui.statusOnly #uiRight {
  margin-left: 0;
  width: 100%;
}
#uiRight {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#uiLocationWrap {
  display: none;
  align-items: center;
  gap: 0.35rem;
}
#uiLocationWrap.visible { display: flex; }
#uiLocationWrap select {
  background: #2a2a38;
  color: #c0c0c0;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
}
#ui button {
  padding: 0.4rem 0.8rem;
  background: #2a2a38;
  color: #c0c0c0;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
#ui button:hover { background: #3a3a4a; }
#ui button.primary { background: #1a3a2a; border-color: #2a5a3a; }
#ui button.primary:hover { background: #2a5a3a; }
#playHudTurnBar button {
  padding: 0.35rem 0.45rem;
  width: 100%;
  background: #2a2a38;
  color: #c0c0c0;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
}
#playHudTurnBar button:hover { background: #3a3a4a; }
#playHudTurnBar button.primary { background: #1a3a2a; border-color: #2a5a3a; }
#mainArea {
  display: flex;
  width: 100%;
  max-width: 1600px;
  flex: 1;
  min-height: 0;
  gap: 0;
}
#canvasWrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}
#canvasWrap .canvasContainer {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12121a;
}
#canvasWrap canvas.canvasMain {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
#tacticalSidebar {
  width: 200px;
  padding: 0.4rem 0.45rem;
  background: #1a1a24;
  border-left: 1px solid #2a2a38;
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
  overflow-y: auto;
}
#tacticalSidebar.visible { display: flex; }
#playLeftColumn {
  width: 120px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #1a1a24;
  border-right: 1px solid #2a2a38;
  padding-bottom: 10px;
  box-sizing: border-box;
}
#playLeftColumn .playLeftColumnLabel {
  margin: 0 0 0.25rem 0;
  font-size: 0.78rem;
  color: #9090a0;
}
#globalSquadIcons {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100vh - 10rem);
  max-height: calc(100dvh - 10rem);
  overflow-y: auto;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}
#globalSquadIcons.visible { display: flex; }
#globalSquadIcons .squadIcon {
  width: 100%;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 2px solid #3a3a4a;
  background: #2a3540;
  color: #b0b0c0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  text-align: center;
}
#globalSquadIcons .squadIcon:hover { background: #3a4550; border-color: #4a5a6a; }
#globalSquadIcons .squadIcon.selected { border-color: #6ab04c; background: #2a4035; color: #8ac09a; }
#globalSquadIcons .squadIcon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.squadConfirmOverlay {
  position: fixed;
  inset: 0;
  z-index: 1106;
  background: rgba(0, 0, 0, 0.88);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.squadConfirmPanel {
  background: #1a1a24;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  padding: 1.1rem 1.25rem 1rem;
  max-width: min(96vw, 400px);
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.squadConfirmHeading {
  font-size: 0.95rem;
  color: #b8c0d0;
  margin-bottom: 0.65rem;
}
.squadConfirmMessage {
  font-size: 0.88rem;
  color: #9090a0;
  line-height: 1.45;
  margin: 0 0 1rem;
}
.squadConfirmActions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
.squadConfirmBtn {
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  background: #2a2a38;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  color: #c0c0c0;
  cursor: pointer;
}
.squadConfirmBtn:hover {
  background: #3a3a4a;
}
.squadConfirmBtnPrimary {
  background: #1a3a2a;
  border-color: #2a5a3a;
}
.squadConfirmBtnPrimary:hover {
  background: #2a5a3a;
}

.squadRosterOverlay {
  position: fixed;
  inset: 0;
  z-index: 1095;
  background: rgba(0, 0, 0, 0.88);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.squadRosterPanel {
  background: #1a1a24;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  padding: 1rem 1.1rem 1rem;
  max-width: min(96vw, 420px);
  width: 100%;
  max-height: min(88vh, 560px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.squadRosterHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.squadRosterHeading {
  font-size: 1rem;
  font-weight: 600;
  color: #b8c0d0;
  margin: 0;
}
.squadRosterCloseBtn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: #2a2a38;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  color: #9090a0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.squadRosterCloseBtn:hover {
  background: #3a3a4a;
  color: #c0c0c0;
}
.squadRosterLocation {
  font-size: 0.84rem;
  color: #98a0b0;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}
.squadRosterIntro {
  font-size: 0.82rem;
  color: #707080;
  line-height: 1.4;
  margin: 0 0 0.75rem;
}
.squadRosterList {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 2px;
}
.squadRosterEmpty {
  margin: 0.5rem 0;
  font-size: 0.88rem;
  color: #808090;
}
.squadRosterRow {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  background: #16161e;
  border: 1px solid #2a2a38;
  border-radius: 6px;
  color: #c0c0c0;
  cursor: pointer;
  font: inherit;
}
.squadRosterRow:hover {
  border-color: #3a4a5a;
  background: #1a1a22;
}
.squadRosterFigure {
  flex-shrink: 0;
  width: 56px;
  height: 68px;
  background: #222230;
  border: 2px solid #3a3a4a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a7a88;
  overflow: hidden;
}
.squadRosterMeta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.squadRosterName {
  font-size: 0.92rem;
  color: #c8c8d0;
  font-weight: 500;
}
.squadRosterRowHint {
  font-size: 0.75rem;
  color: #606070;
  white-space: pre-line;
}
.squadRosterFooter {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid #2a2a38;
}
.squadRosterChooseBtn {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: #1a3a2a;
  border: 1px solid #2a5a3a;
  border-radius: 4px;
  color: #c0d0c8;
  cursor: pointer;
}
.squadRosterChooseBtn:hover {
  background: #2a5a3a;
}
#tacticalUnitIcons {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}
#tacticalUnitIcons.visible { display: flex; }
#playHudTurnBar {
  flex-shrink: 0;
  padding: 0.4rem 0.45rem 0.35rem;
  border-top: 1px solid #2a2a38;
  border-bottom: 1px solid #2a2a38;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#playHudFooter {
  flex-shrink: 0;
  padding: 0.4rem 0.45rem 0.35rem;
  border-top: 1px solid #2a2a38;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#playHudFooter #timeOfDayDisplay {
  font-size: 1.5rem;
  color: #a8a8b8;
  line-height: 1.2;
}
#playHudFooter #uiLocationWrap {
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
}
#playHudFooter #uiLocationWrap select {
  width: 100%;
  max-width: 100%;
  font-size: 0.72rem;
  padding: 0.2rem 0.35rem;
}
#playHudFooter #tacticalLocationLabel,
#playHudFooter #tacticalSubLabel {
  font-size: 1.44rem;
  line-height: 1.25;
  word-break: break-word;
}
/** Кнопка-индикатор этажа многоэтажности (tactical-input-floors.js). Над локацией и временем суток. */
#playHudFooter #btnTacticalFloor {
  align-self: flex-start;
  font-size: 0.95rem;
  line-height: 1.1;
  padding: 0.3rem 0.55rem;
  background: #2a2a38;
  color: #d8d8e8;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 0.15rem;
}
#playHudFooter #btnTacticalFloor:hover {
  background: #353548;
  border-color: #4a4a5a;
}
#playHudFooter #btnTacticalFloor:active {
  background: #1f1f2c;
}
/** На тактике отряд скрыт — убираем верхнюю границу у полосы «Закончить ход» */
#globalSquadIcons:not(.visible) + #playHudTurnBar {
  border-top: none;
}
/** Глобальная карта: иконки персонажей скрыты — локация и время прижаты к низу колонки */
#tacticalUnitIcons:not(.visible) ~ #playHudFooter {
  margin-top: auto;
}
#tacticalUnitIcons .unitIcon {
  width: 100%;
  min-height: 40px;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 2px solid #3a3a4a;
  background: #2a3540;
  color: #b0b0c0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#tacticalUnitIcons .unitIcon:hover { background: #3a4550; border-color: #4a5a6a; }
#tacticalUnitIcons .unitIcon.selected { border-color: #6ab04c; background: #2a4035; color: #8ac09a; }
#tacticalUnitIcons .unitIcon.otherSub { opacity: 0.7; border-style: dashed; }
#tacticalUnitIcons .unitIcon.spent { opacity: 0.55; color: #707890; background: #1e2430; border-color: #2a2a38; }
#tacticalUnitIcons .unitIcon.unitIcon--psychLock { opacity: 0.6; cursor: not-allowed; border-style: dotted; }
#tacticalSidebar .label { font-size: 0.78rem; color: #9090a0; margin-bottom: 0.15rem; }
#tacticalSidebar .dirGrid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
#tacticalSidebar .dirRow { display: flex; gap: 1px; }
#tacticalSidebar .dirBtn {
  width: 16px;
  height: 16px;
  padding: 0;
  background: #2a2a38;
  color: #c0c0c0;
  border: 1px solid #3a3a4a;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.6rem;
  line-height: 1;
}
#tacticalSidebar .dirBtn:hover { background: #3a3a4a; }
#tacticalActionRow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
  box-sizing: border-box;
}
#tacticalActionRow > * { min-width: 0; max-width: 100%; }
/** Ближний бой — 2/3 ширины сетки; Привести в чувство — на всю ширину */
#tacticalActionRow #meleeBtnWrap {
  grid-column: span 2;
  max-width: none;
}
#tacticalActionRow #btnSnapOut {
  grid-column: span 3;
  max-width: none;
}
#shootingBtnWrap, #meleeBtnWrap {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
}
#tacticalActionRow #shootingBtnWrap > button,
#tacticalActionRow #meleeBtnWrap > button {
  flex: 1;
  min-width: 0;
}
#btnPistol, #meleeBtnWrap #btnMelee, #btnMakeNoise, #btnJump, #btnDash, #btnRest, #btnOverwatch, #btnLoot, #btnSnapOut, #btnReload, #btnMedkit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.45rem 0.15rem;
  background: #2a2a38;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  color: #c0c0c0;
  cursor: pointer;
  font-size: 0.62rem;
  line-height: 1.68;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#btnPistol span,
#meleeBtnWrap #btnMelee span,
#btnLoot span,
#btnSnapOut span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#btnPistol:hover:not(:disabled), #meleeBtnWrap #btnMelee:hover:not(:disabled), #btnMakeNoise:hover:not(:disabled), #btnJump:hover:not(:disabled), #btnDash:hover:not(:disabled), #btnRest:hover:not(:disabled), #btnOverwatch:hover:not(:disabled), #btnLoot:hover:not(:disabled), #btnSnapOut:hover:not(:disabled), #btnReload:hover:not(:disabled), #btnMedkit:hover:not(:disabled) { background: #3a3a4a; border-color: #4a5a6a; }
#btnPistol:disabled, #meleeBtnWrap #btnMelee:disabled, #btnMakeNoise:disabled, #btnJump:disabled, #btnDash:disabled, #btnRest:disabled, #btnOverwatch:disabled, #btnLoot:disabled, #btnSnapOut:disabled, #btnReload:disabled, #btnMedkit:disabled { opacity: 0.5; cursor: not-allowed; }
#meleeModePopup .meleeModeConfirmBtn { display: block; width: 100%; padding: 0.35rem 0.5rem; background: #2a3a4a; border: 1px solid #3a4a5a; border-radius: 4px; color: #c0c0c0; cursor: pointer; font-size: 0.8rem; text-align: center; }
#meleeModePopup .meleeModeConfirmBtn:hover { background: #3a4a5a; }
#shootingModePopup,
#meleeModePopup {
  left: -10px;
}
/** Р’С‹Р±РѕСЂ СЃС‚СЂРµР»РєРѕРІРѕРіРѕ РѕСЂСѓР¶РёСЏ: РєРѕРјРїР°РєС‚РЅРѕ СЃРїСЂР°РІР° РѕС‚ РєРЅРѕРїРєРё В«РЎС‚СЂРµР»СЊР±Р°В», РєР°Рє Сѓ РїСЂРёС†РµР»СЊРЅРѕРіРѕ/РѕР±С‹С‡РЅРѕРіРѕ РІС‹СЃС‚СЂРµР»Р° */
#rangedWeaponSelectPopup {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 4px;
  z-index: 1011;
  background: #1a1a24;
  border: 1px solid #2a2a38;
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  min-width: 118px;
  max-width: 168px;
}
#rangedWeaponSelectPopup .rangedWeaponPickBtn {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  margin-bottom: 4px;
  background: #2a3a4a;
  border: 1px solid #3a4a5a;
  border-radius: 4px;
  color: #c0c0c0;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: left;
}
#rangedWeaponSelectPopup .rangedWeaponPickBtn:last-child {
  margin-bottom: 0;
}
#rangedWeaponSelectPopup .rangedWeaponPickBtn:hover {
  background: #3a4a5a;
  border-color: #4a5a6a;
}
#shootingOtherTarget:disabled { opacity: 0.5; cursor: not-allowed; background: #1a1a24 !important; border-color: #2a2a38 !important; color: #606070 !important; }
#overwatchRangeWrap .overwatchRangeBtn { padding: 0.25rem 0.4rem; font-size: 0.72rem; background: #2a2a38; border: 1px solid #3a3a4a; border-radius: 4px; color: #c0c0c0; cursor: pointer; }
#overwatchRangeWrap .overwatchRangeBtn:hover { background: #3a3a4a; border-color: #4a5a6a; }
#tacticalSidebar .moveModeBtn { padding: 0.3rem 0.4rem; background: #2a2a38; border: 1px solid #3a3a4a; border-radius: 4px; color: #c0c0c0; cursor: pointer; font-size: 0.75rem; }
#tacticalSidebar .moveModeBtn:hover { background: #3a3a4a; border-color: #4a5a6a; }
#tacticalSidebar .moveModeBtn.active { background: #3a4a5a; border-color: #5a6a7a; color: #e0e8f0; }
