/* CS-Manager "Classic Manager" theme (ARCHITECTURE.md 15.1). Views add their own css/views.css, css/tactics.css. */
:root {
  --c-page: #b9c9e1; --c-head: #7b97c8; --c-nav: #41649f; --c-nav-section: #567dbb; --c-nav-active: #e21200;
  --c-bar: #567db9; --c-bar2: #4a6aae; --c-content: #ffffff; --c-row: #ffffff; --c-row-alt: #e6ebf5;
  --c-info: #ffefcd; --c-info-border: #e6ddc4;
  --c-tab: #eeeeee; --c-tab-help: #fee5ab; --c-tab-stats: #d9f9d9;
  --c-link: #1f3fbf; --c-skill: #ff6c00; --c-skill-track: #d9e1ed; --c-fitness: #007f00;
  --c-ok: #6aa121; --c-yes: #0a9a1a; --c-no: #e21200; --c-t: #ff4040; --c-ct: #99ccff; --c-ct-ink: #3f7fc7; /* T/CT = CS:S scoreboard colours; -ink = readable text on white */
  --c-border: #9fb2d6; --c-text: #1d2433; --c-dark: #1f3566;
  --p1: #f7a530; --p2: #5aaaf0; --p3: #f2e02a; --p4: #e8503a; --p5: #7ccf6a;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--c-page); color: var(--c-text); font: 12px/1.4 Verdana, Tahoma, Geneva, sans-serif; min-height: 100vh; }
a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 6px; }
h2 { font-size: 14px; } h3 { font-size: 12px; }
p { margin: 0 0 8px; }
code { font-family: Consolas, monospace; background: #eef1f8; padding: 0 3px; }

/* ---- frame ---- */
.frame { width: 1300px; max-width: 100%; margin: 0 auto; background: var(--c-page); }
.csm-head { height: 72px; background: var(--c-head); border: 1px solid var(--c-border); border-top: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 14px; }
.csm-head .logo { display: block; line-height: 0; }
.csm-head canvas { image-rendering: pixelated; }
.head-btns { align-self: flex-end; margin-bottom: 6px; display: flex; gap: 6px; }
.btn-help, .btn-logout { display: inline-block; padding: 3px 14px; color: #fff; font-weight: bold; border: 1px solid rgba(0,0,0,.35); }
.btn-help { background: var(--c-nav-active); }
.btn-logout { background: var(--c-dark); }
.btn-help:hover, .btn-logout:hover { text-decoration: none; filter: brightness(1.15); }
.cols { display: grid; grid-template-columns: 180px 1fr 200px; gap: 10px; margin-top: 10px; align-items: start; }
.center { min-width: 0; }
#content { min-height: 400px; }
#content.bare { padding: 14px 0; min-height: 0; }
.frame:not(.full) #content { margin-top: 10px; }

/* ---- nav (left) ---- */
.left { background: var(--c-nav); border: 1px solid var(--c-border); }
.nav-title, .side-title { background: var(--c-nav-section); color: #fff; font-weight: bold; font-size: 11px; letter-spacing: 1px; padding: 4px 8px; }
.nav-item { display: block; color: #fff; padding: 4px 8px 4px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-item:hover { background: #4f74b4; text-decoration: none; }
.nav-item.active { background: var(--c-nav-active); font-weight: bold; }
.nav-item::before { content: '• '; }

/* ---- right aside ---- */
.right { background: var(--c-nav); border: 1px solid var(--c-border); color: #fff; }
.right a { color: #fff; }
.side-sec { padding-bottom: 6px; }
.side-sec > summary { cursor: pointer; }
.side-sec > a { display: block; padding: 3px 8px; }
.side-kv { width: 100%; border-collapse: collapse; }
.side-kv td { padding: 2px 8px; vertical-align: top; }
.side-kv td:first-child { color: #c8d6ee; width: 70px; }
.step .chk { font-size: 14px; }
.step:hover { background: rgba(255,255,255,.12); text-decoration: none; }

/* ---- top line ---- */
.topline { background: var(--c-content); border: 1px solid var(--c-border);
  padding: 6px 10px; margin-bottom: 8px; }
.crumbs { font-size: 14px; font-weight: bold; }

/* ---- sections ---- */
.section { margin-bottom: 12px; border: 1px solid var(--c-border); background: var(--c-content); }
.sec-bar { display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 14px; font-weight: bold;
  background: linear-gradient(#567db9, #4a6aae); padding: 4px 8px; }
.sec-bar a { color: #fff; font-size: 11px; font-weight: normal; }
.sec-actions { font-size: 11px; font-weight: normal; }
.sec-body { padding: 8px; }
.sec-body > :last-child { margin-bottom: 0; }

/* ---- info box ---- */
.infobox { background: var(--c-info); border: 1px solid var(--c-info-border); padding: 8px 10px; margin-bottom: 10px; }
.infobox p { margin: 4px 0 0; }
.task { color: var(--c-link); font-weight: bold; }

/* ---- tables ---- */
table { border-collapse: collapse; }
table.kv { width: 100%; }
table.kv th { background: var(--c-row-alt); text-align: right; font-weight: bold; padding: 4px 8px; width: 30%; border: 1px solid var(--c-border); vertical-align: top; }
table.kv td { background: #fff; padding: 4px 8px; border: 1px solid var(--c-border); }
table.grid { width: 100%; }
table.grid th { background: var(--c-row-alt); font-weight: bold; text-align: center; padding: 4px 6px; border: 1px solid var(--c-border); }
table.grid th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.grid th.sortable:hover { background: #dbe4f3; }
table.grid td { padding: 3px 6px; border: 1px solid #d3dcee; background: var(--c-row); }
table.grid tbody tr:nth-child(even) td { background: var(--c-row-alt); }
table.grid tr.me td, table.grid tr.user td, table.grid tr.mine td { background: #ffe9a8 !important; font-weight: bold; }
table.grid tr[onclick], table.grid tr.clickable { cursor: pointer; }
table.grid td.empty { text-align: center; color: #777; padding: 10px; }
table.grid td.num, td.num { text-align: right; }

/* ---- bars ---- */
.bar { display: inline-block; width: 150px; height: 10px; background: var(--c-skill-track); border: 1px solid var(--c-border); vertical-align: middle; position: relative; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c-skill); }
.segbar { display: inline-flex; gap: 1px; vertical-align: middle; }
.segbar i { display: block; width: 12px; height: 10px; background: var(--c-skill-track); border: 1px solid var(--c-border); }
.segbar i.on { background: var(--c-skill); }
.stars { color: #e0a000; letter-spacing: 1px; font-size: 14px; }
.icons { color: var(--c-nav); letter-spacing: 1px; }
.ico-stats { display: inline-flex; align-items: flex-end; gap: 1px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.ico-stats i { display: block; width: 2px; background: currentColor; }
.ico-stats i:nth-child(1) { height: 4px; }
.ico-stats i:nth-child(2) { height: 7px; }
.ico-stats i:nth-child(3) { height: 10px; }
.yes { color: var(--c-yes); font-weight: bold; } .no { color: var(--c-no); font-weight: bold; }
.pos { color: var(--c-yes); font-weight: bold; } .neg { color: var(--c-no); font-weight: bold; }
.muted { color: #666; }
.imp-banner { background: var(--c-tab-help, #fee5ab); border-bottom: 1px solid var(--c-border, #9fb2d6); padding: 4px 10px; text-align: center; font-size: 12px; }

/* ---- tabs ---- */
.tabs { display: flow-root; margin: 0 0 8px; border-bottom: 1px solid var(--c-border); padding-left: 4px; }
.tab { display: inline-block; background: var(--c-tab); color: var(--c-text); padding: 3px 12px; margin-right: 2px; border: 1px solid var(--c-border); border-bottom: 0; border-radius: 3px 3px 0 0; }
.tab:hover { text-decoration: none; background: #f7f7f7; }
.tab.active { background: #fff; font-weight: bold; position: relative; top: 1px; padding-bottom: 4px; }
.tab-help { background: var(--c-tab-help); float: right; margin-right: 4px; }
.tab-stats { background: var(--c-tab-stats); }

/* ---- modal ---- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 30, 60, .55); display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; z-index: 100; }
.modal { background: #fff; border: 1px solid var(--c-dark); min-width: 320px; max-width: 560px; max-height: 80vh; overflow: auto; box-shadow: 3px 3px 0 rgba(0,0,0,.3); }
.modal .modal-x { color: #fff; font-size: 14px; }
.modal-body { padding: 12px; }
.modal-btns { padding: 0 12px 12px; display: flex; justify-content: flex-end; gap: 6px; }

/* ---- flash ---- */
.flash { padding: 6px 10px; margin-bottom: 8px; font-weight: bold; color: #fff; }
.flash-ok { background: var(--c-ok); }
.flash-error { background: var(--c-no); }

/* ---- buttons / forms ---- */
.btn { font: inherit; font-weight: bold; padding: 4px 14px; background: #e8edf7; color: var(--c-text); border: 1px solid var(--c-border); cursor: pointer; border-radius: 0; }
.btn:hover { background: #d8e1f2; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--c-nav); color: #fff; border-color: var(--c-dark); }
.btn.primary:hover { background: #4f74b4; }
.btn.danger { background: var(--c-no); color: #fff; border-color: #900; }
input[type=text], input[type=password], input[type=number], input:not([type]), select, textarea {
  font: inherit; padding: 3px 5px; border: 1px solid var(--c-border); background: #fff; color: var(--c-text); border-radius: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8fb0e8; outline-offset: 0; }
label { font-weight: bold; }
.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-row > label { width: 110px; text-align: right; flex: none; }
.form-row .hint, .hint { color: #666; font-size: 11px; font-weight: normal; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }

/* ---- login / token ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.token-box { background: var(--c-info); border: 2px solid var(--c-info-border); padding: 12px; margin: 8px 0; }
.token-box .token { display: block; font: bold 15px/1.5 Consolas, 'Courier New', monospace; word-break: break-all; background: #fff; border: 1px solid var(--c-info-border); padding: 8px; margin: 8px 0; user-select: all; }
.token-box .warn { color: var(--c-no); font-weight: bold; }
.token-input { width: 100%; font-family: Consolas, monospace; }

/* ---- generic helpers used by help pages / views ---- */
.help h2 { background: var(--c-row-alt); border-left: 4px solid var(--c-nav); padding: 3px 8px; margin: 14px 0 8px; }
.help ul, .help ol { margin: 0 0 8px; padding-left: 20px; }
.help table { margin-bottom: 8px; }
.help th, .help td { border: 1px solid var(--c-border); padding: 3px 8px; }
.help th { background: var(--c-row-alt); }
.help pre.ascii { font: 12px/1.2 Consolas, 'Courier New', monospace; background: #1f2b44; color: #dfe8ff; padding: 8px 10px; overflow-x: auto; }
.help .diagram { display: grid; gap: 1px; width: max-content; margin: 6px 0 10px; background: #8a96ad; border: 1px solid #8a96ad; }
.help .diagram i { display: block; width: 22px; height: 22px; background: #e9dfc0; font-style: normal; text-align: center; line-height: 22px; font-size: 11px; font-weight: bold; }
.help .diagram i.w { background: #4b5568; } .help .diagram i.t { background: var(--c-t); color: #fff; }
.help .diagram i.c { background: var(--c-ct); color: #10305a; } .help .diagram i.s { background: #b8b8b8; } .help .diagram i.f { background: #fff6a8; }
.help .note { background: var(--c-info); border: 1px solid var(--c-info-border); padding: 6px 10px; margin-bottom: 8px; }
.team-t { color: var(--c-t); font-weight: bold; } .team-ct { color: var(--c-ct-ink); font-weight: bold; }

/* ---- news / dashboard (own views) ---- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 6px 4px; border-bottom: 1px solid #d3dcee; }
.news-list li:last-child { border-bottom: 0; }
.news-list .when { color: #777; font-size: 11px; display: block; }
.news-list .sub { margin: 4px 0 0 14px; font-size: 11px; color: #444; }
.step-list { margin: 6px 0; padding: 0; list-style: none; }
.step-list li { padding: 2px 0; }
.versus { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 14px; font-weight: bold; margin: 8px 0; }
.versus .vs { color: #888; font-weight: normal; }
.versus .str { display: block; font-size: 11px; font-weight: normal; color: #555; text-align: center; }
.result-line { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted #c9d3e8; }
.result-line.win { border-left: 4px solid var(--c-yes); padding-left: 6px; }
.result-line.loss { border-left: 4px solid var(--c-no); padding-left: 6px; }
.result-line.draw { border-left: 4px solid #999; padding-left: 6px; }

@media print { .left, .right, .csm-head { display: none; } }

/* ---- multiplayer additions ---- */
.dim { color: #666; font-size: 11px; }
.new-badge { background: var(--c-no); color: #fff; font-size: 10px; font-weight: bold; padding: 0 4px; margin-right: 4px; }
.digest { background: var(--c-info); border: 1px solid var(--c-info-border); padding: 8px 10px; margin-bottom: 10px; }
.digest ul { margin: 4px 0 0; padding-left: 18px; }
.cd { font-variant-numeric: tabular-nums; font-weight: bold; }
.banner { padding: 6px 10px; margin-bottom: 8px; border: 1px solid var(--c-info-border); background: var(--c-info); }
.banner.warn { background: #ffe9a8; }
.banner.live { background: #d9f0d9; border-color: var(--c-yes); }

/* ---- "?" help links (js/views/help.js helpIcon) ---- */
.qmark { display: inline-block; width: 13px; height: 13px; margin-left: 4px; border-radius: 50%; background: var(--c-nav); color: #fff !important; font: bold 10px/13px Verdana, sans-serif;
  text-align: center; vertical-align: middle; cursor: help; }
.qmark:hover { background: var(--c-nav-active); text-decoration: none; }
.help-hit { outline: 3px solid var(--c-nav-active); outline-offset: 2px; background: var(--c-info); }
