/* «Тактика»: лобби (templates/pages/tactics.html) и комната (tactics_room.html). */

.clan-empty { padding: 40px 16px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.tc-danger:hover { color: var(--loss); border-color: var(--loss); }
.tc-input {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel2); color: var(--hi); font: 500 14px var(--fb); min-width: 0;
}
.tc-input:focus { outline: none; border-color: var(--acc); }

/* ── Лобби ── */
.tc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; }
.tc-steps li {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.tc-steps i { grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--acc-soft); color: var(--acc); }
.tc-steps b { color: var(--hi); font-size: 14px; }
.tc-steps span { color: var(--dim); font-size: 12.5px; }
.tc-guest { padding: 22px 18px; text-align: left; }
.tc-guest i { color: var(--acc); margin-right: 6px; }

.tc-create { margin-bottom: 24px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tc-create__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.tc-create__head .section-title { margin: 0; border: 0; padding: 0; }
.tc-create__row { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; justify-content: flex-end; }
.tc-create__row .tc-input { flex: 1 1 240px; max-width: 360px; }
.tc-create__search { min-width: 200px; }
.tc-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; max-height: 360px; overflow-y: auto; padding: 2px; }
.tc-map {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid transparent; border-radius: var(--radius-sm);
  background: var(--panel2); cursor: pointer; text-align: left; color: var(--text); font: 500 12.5px var(--fb);
}
.tc-map:hover { border-color: var(--line); color: var(--hi); }
.tc-map.is-selected { border-color: var(--acc); color: var(--hi); background: var(--acc-soft); }
.tc-map img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--bg); }
.tc-map span { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tc-map__tag { font-style: normal; font-size: 10.5px; padding: 0 5px; border-radius: 4px; background: var(--panel); color: var(--dim); }
.tc-error { margin: 12px 0 0; color: var(--loss); font-weight: 600; }

.tc-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.tc-hint { margin: -6px 0 10px; font-size: 12.5px; color: var(--dim); }
.tc-list { display: flex; flex-direction: column; gap: 8px; }
.tc-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.tc-item__map { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.tc-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-item__body b { color: var(--hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-item__body span { font-size: 12.5px; color: var(--dim); }
.tc-item__actions { display: flex; gap: 6px; flex-shrink: 0; }
.tc-item__actions .btn { height: 34px; }

/* ── Комната ── */
.tc-room-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.tc-room-head__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tc-room-head h1 { margin: 0; font: var(--fh-w) 20px var(--fh); color: var(--hi); }
.tc-room-head__sub { font-size: 13px; color: var(--dim); }
.tc-room-head__sub b { color: var(--text); }
.tc-room-head__actions { display: flex; align-items: center; gap: 12px; }
.tc-back { width: 36px; height: 36px; padding: 0; justify-content: center; }
.tc-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--dim); }
.tc-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--mid); }
.tc-status.is-ok i { background: var(--win); box-shadow: 0 0 0 3px rgba(86, 179, 127, .2); }
.tc-status.is-off i { background: var(--loss); }
.tc-banner { margin-bottom: 10px; padding: 9px 14px; border-radius: var(--radius-sm); background: var(--acc-soft); color: var(--hi); font-size: 13.5px; }
.tc-banner i { color: var(--acc); margin-right: 6px; }

.tc-room { display: grid; grid-template-columns: auto minmax(0, 1fr) 270px; gap: 14px; align-items: start; }

.tc-tools {
  position: sticky; top: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.tc-tools hr { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line2); }
.tc-tool {
  width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font-size: 15px; cursor: pointer;
}
.tc-tool:hover { background: var(--panel2); color: var(--hi); }
.tc-tool.is-active { background: var(--acc); color: var(--acc-ink); }

.tc-board-wrap { min-width: 0; }
.tc-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 8px; }
.tc-colors, .tc-widths, .tc-icons { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tc-icons[hidden] { display: none; }
.tc-swatch {
  min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 6px; border: 2px solid transparent;
  border-radius: 6px; background: none; cursor: pointer; color: var(--text);
}
.tc-swatch:hover { background: var(--panel2); }
.tc-swatch.is-active { border-color: var(--acc); background: var(--panel2); }
.tc-colors .tc-swatch i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.tc-widths .tc-swatch i { width: 20px; border-radius: 4px; background: var(--hi); }
.tc-icons .tc-swatch b { font-size: 12.5px; color: var(--hi); }

.tc-board {
  position: relative; width: min(100%, calc(100vh - var(--topbar-h) - 150px)); min-width: 320px; aspect-ratio: 1;
  border-radius: var(--radius); overflow: hidden; background: #0b0d10; border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
}
.tc-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; outline: none; cursor: crosshair; }
.tc-board[data-tool="select"] .tc-svg { cursor: default; }
.tc-board[data-tool="select"] .tc-obj { cursor: move; }
.tc-board[data-tool="eraser"] .tc-obj { cursor: not-allowed; }
.tc-board[data-tool="eraser"] .tc-obj:hover { opacity: .45; }
.tc-svg.is-readonly { cursor: default; }
.tc-hit { stroke: transparent; stroke-width: 22; fill: none; stroke-linecap: round; }
.tc-obj.is-selected { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
.tc-label { paint-order: stroke; stroke: rgba(0, 0, 0, .75); stroke-width: 4px; stroke-linejoin: round; }
.tc-svg__grid line { stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.tc-svg__grid text { fill: rgba(255, 255, 255, .7); font-size: 15px; font-weight: 700; paint-order: stroke; stroke: rgba(0, 0, 0, .6); stroke-width: 3px; }
.tc-ping__wave { animation: tc-ping 1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes tc-ping { from { transform: scale(1); opacity: 1; } to { transform: scale(5); opacity: 0; } }

.tc-side { display: flex; flex-direction: column; gap: 12px; }
.tc-card { padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tc-card__title { margin-bottom: 10px; font: 600 14px var(--fb); color: var(--hi); }
.tc-card__title i { color: var(--acc); }
.tc-card__title span { color: var(--dim); font-weight: 500; }
.tc-people { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.tc-people li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.tc-people li i { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tc-people li.is-me span { color: var(--hi); font-weight: 600; }
.tc-tag { margin-left: auto; padding: 0 6px; border-radius: 4px; background: var(--acc-soft); color: var(--acc); font-size: 11px; }
.tc-tag.is-me { margin-left: 0; background: var(--panel2); color: var(--dim); }
.tc-link { border: 0; background: none; padding: 0; color: var(--acc); font: 500 12.5px var(--fb); cursor: pointer; }
.tc-link i { margin-right: 6px; }
.tc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 12.5px; color: var(--dim); }
.tc-field .tc-input { width: 100%; cursor: pointer; }
.tc-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tc-row .btn { flex: 1 1 auto; justify-content: center; height: 34px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
.tc-switch { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.tc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tc-switch i { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--line); flex-shrink: 0; transition: background .15s; }
.tc-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.tc-switch input:checked + i { background: var(--acc); }
.tc-switch input:checked + i::after { left: 19px; }
.tc-switch input:focus-visible + i { outline: 2px solid var(--acc); outline-offset: 2px; }
.tc-help ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--dim); }
.tc-help b { color: var(--text); }

@media (max-width: 1100px) {
  .tc-room { grid-template-columns: auto minmax(0, 1fr); }
  .tc-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
  .tc-room { grid-template-columns: minmax(0, 1fr); }
  .tc-tools { position: static; flex-direction: row; flex-wrap: wrap; }
  .tc-tools hr { display: none; }
  .tc-board { min-width: 0; width: 100%; }
}

/* Кто рисует, запреты, курсоры */
#tr-commander-title { color: var(--hi); font-weight: 600; }
.tc-note { margin: -4px 0 12px; font-size: 12px; color: var(--dim); }
.tc-people li { flex-wrap: wrap; }
.tc-people li.is-banned span { color: var(--dim); text-decoration: line-through; }
.tc-drawing { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 11.5px; color: var(--win); animation: tc-blink 1s ease-in-out infinite; }
.tc-drawing i { font-size: 10px; }
@keyframes tc-blink { 50% { opacity: .45; } }
.tc-tag.is-banned { margin-left: 0; background: rgba(224, 106, 104, .15); color: var(--loss); }
.tc-ban {
  margin-left: auto; width: 26px; height: 26px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--dim); cursor: pointer; font-size: 11.5px;
}
.tc-ban:hover { color: var(--loss); border-color: var(--loss); }
.tc-ban .fa-pen { color: var(--win); }
.tc-people li .tc-tag + .tc-ban, .tc-people li .tc-tag ~ .tc-ban { margin-left: 4px; }
.tc-cursor { transition: transform .08s linear, opacity .4s; pointer-events: none; }
.tc-cursor.is-fading { opacity: 0; }

/* Лобби: активные комнаты (администратор) */
.tc-live { margin-bottom: 24px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--acc); border-radius: var(--radius); }
.tc-live__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.tc-live__head h2 { margin: 0; font: 600 15px var(--fb); color: var(--hi); }
.tc-live__head h2 i { color: var(--acc); margin-right: 6px; }
.tc-live__head span { font-size: 12.5px; color: var(--dim); }
.tc-live .tc-item { background: var(--panel2); }
.tc-live-people { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--text); }
.tc-live-people i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: 0; }
.tc-live-people .is-drawing { color: var(--win); font-weight: 600; }
