/* Tactic list, tactic editor and live match viewer. Variables come from style.css (with fallbacks). */

/* ---- tactic list ---- */
.tac-view.hide-stats table.grid th:nth-child(6), .tac-view.hide-stats table.grid td:nth-child(6),
.tac-view.hide-stats table.grid th:nth-child(7), .tac-view.hide-stats table.grid td:nth-child(7) { display: none; }
.tac-view .acts a { margin-right: 6px; }
.tac-view .dim, .ed .dim, .csm-match .dim { color: #777; }

/* ---- editor ---- */
.ed .flash { position: sticky; top: 0; z-index: 5; }
.ed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; background: var(--c-row-alt, #e6ebf5); }
.ed-chk { white-space: nowrap; }
.ed-mapwrap { background: var(--c-page, #b9c9e1); padding: 6px; text-align: center; line-height: 0; }
.ed-canvas { width: 100%; max-width: 768px; height: auto; image-rendering: pixelated; touch-action: none; background: #bccae1; }
.ed-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: linear-gradient(#567db9, #4a6aae); }
.ed-pbtn { font: bold 12px Verdana, Tahoma, sans-serif; color: #1b1b1b; padding: 5px 12px; min-width: 90px; border: 2px solid #2f4a82; border-radius: 6px; cursor: pointer; opacity: .8; }
.ed-pbtn.on { opacity: 1; border-color: #fff; box-shadow: 0 0 0 2px #1b2a4a; }
.ed-pbtn.ed-all { background: #c9c9c9; margin-left: auto; }
.ed-hint { margin: 6px 8px; color: #555; font-size: 11px; }
.ed-side { min-width: 0; }
.frame.csm-wide .ed-body { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 8px; align-items: start; }
.frame.csm-wide .ed-canvas { max-width: min(100%, calc(100vh - 220px)); }
.frame.csm-wide .ed-panel .kv th { width: 120px; }
.ed-hint.active { color: #b00; font-weight: bold; }
.ed-panel { padding: 0 8px 8px; }
.ed-panel .kv { width: 100%; margin-bottom: 8px; }
.ed-panel .kv th { width: 200px; text-align: right; vertical-align: top; }
.ed-ptitle { margin: 6px 0; padding: 4px 8px; font-weight: bold; border-left: 8px solid #999; background: var(--c-row-alt, #e6ebf5); }
.ed-prim { margin: 0 0 4px; padding-left: 20px; }
.ed-nade { display: inline-block; margin-right: 12px; }
.ed-nade .btn { min-width: 22px; padding: 0 4px; }
.ed-over { color: #e21200; font-weight: bold; }
.ed-dot { display: inline-block; width: 10px; height: 10px; border: 1px solid #2b2b2b; }
.ed-errors { margin: 8px; color: #e21200; }
.ed-errors ul { margin: 4px 0 0 18px; padding: 0; }
.ed-menu { position: fixed; z-index: 1000; display: flex; flex-direction: column; min-width: 210px; background: #fff; border: 1px solid #2f4a82; box-shadow: 2px 2px 6px rgba(0,0,0,.35); }
.ed-menu button { font: 12px Verdana, Tahoma, sans-serif; text-align: left; padding: 5px 10px; border: 0; background: #fff; cursor: pointer; }
.ed-menu button:hover:not(:disabled) { background: #dfe8f7; }
.ed-menu button:disabled { color: #aaa; cursor: default; }

/* ---- match viewer ---- */
.mv-info { padding: 4px 8px; font-weight: bold; }
.mv-tools { padding: 4px 8px 6px; }
.mv-msg { padding: 6px 8px; min-height: 8px; }
.csm-match { padding: 0 4px 4px; }
/* narrow layout: map on top over the full width, team panels below */
.csm-match .csm-hud { grid-template-columns: 1fr 1fr; }
.csm-match .csm-center { grid-column: 1 / 3; grid-row: 1; }
.csm-match .csm-hud > .csm-panel:nth-child(1) { grid-column: 1; grid-row: 2; }
.csm-match .csm-hud > .csm-panel:nth-child(3) { grid-column: 2; grid-row: 2; }
.csm-match.wide .csm-hud { grid-template-columns: 200px 1fr 200px; }
.csm-match.wide .csm-center { grid-column: 2; grid-row: 1; }
.csm-match.wide .csm-hud > .csm-panel:nth-child(1) { grid-column: 1; grid-row: 1; }
.csm-match.wide .csm-hud > .csm-panel:nth-child(3) { grid-column: 3; grid-row: 1; }
.frame.csm-wide { width: 100%; max-width: none; }
.frame.csm-wide .left, .frame.csm-wide .right { display: none; }
.frame.csm-wide .cols { grid-template-columns: minmax(0, 1fr); }   /* else the content falls into the 180px nav column and vanishes */
.csm-stage canvas { height: auto; }
.mv-ov { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20, 40, 100, .6); line-height: 1.3; z-index: 3; }
.mv-box { background: #fff; border: 1px solid #2f4a82; padding: 12px 18px; text-align: center; font: 13px Verdana, Tahoma, sans-serif; color: #1b2a4a; max-width: 90%; }
.mv-box.inter { min-width: 320px; }
.mv-box.plan .btn { display: block; margin: 4px auto; }
.mv-box h3 { margin: 0 0 6px; }
.mv-score { font: bold 18px Verdana, sans-serif; margin: 6px 0 10px; }
.mv-tn { display: inline-block; padding: 1px 8px; color: #fff; font-size: 14px; }
.mv-tn.t { background: var(--c-t, #ff4040); } .mv-tn.ct { background: var(--c-ct, #99ccff); color: #10305a; }
.mv-win { margin: -12px -18px 8px; padding: 6px 12px; color: #fff; font-weight: bold; font-size: 15px; }
.mv-win.t { background: var(--c-t, #ff4040); } .mv-win.ct { background: var(--c-ct, #99ccff); color: #10305a; }
.mv-box.board { min-width: 560px; }
.mv-box.board table { margin-top: 4px; }
.mv-cols { display: flex; gap: 12px; justify-content: center; }
.mv-team { flex: 1; padding: 6px 10px; border-top: 4px solid; text-align: left; }
.mv-team.t { border-color: var(--c-t, #ff4040); }
.mv-team.ct { border-color: var(--c-ct, #99ccff); }
