:root { --bg: #15171c; --panel: #1e2128; --panel2: #262a33; --line: #2c3039; --fg: #e6e6e6; --muted: #9aa0ab; --dim: #6b717c;
	--accent: #d9a441; --sand: #e0cfa3; --good: #5bb974; --bad: #d65c5c; --me: #4a93d1; --opp: #d46e42; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
header .brand { display: flex; align-items: center; gap: 12px; color: inherit; }
header .brand img { width: 34px; height: 34px; }
header h1 { margin: 0; font-size: 17px; }
header .tag { color: var(--muted); font-size: 13px; }
header .search { display: flex; gap: 6px; margin-left: auto; }
header nav a { margin-left: 16px; }
input, button { font: inherit; background: #0f1115; color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; }
button { cursor: pointer; background: var(--panel2); }
button:hover { background: #313644; }
main { max-width: 1040px; margin: 0 auto; padding: 16px 24px 48px; }
footer { color: var(--muted); font-size: 13px; max-width: 1040px; margin: 0 auto; padding: 20px 24px 32px; border-top: 1px solid var(--line); }
footer p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 13px; }
.dim { color: var(--dim); }
.error { color: var(--bad); }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.notice { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 6px 0 14px; }
.hero h1 { margin: 2px 0 4px; font-size: 28px; display: flex; align-items: center; gap: 10px; }
.status { text-align: right; flex-shrink: 0; }
.seasons a, .seasons b { margin-right: 4px; }
.flag { width: 24px; height: 12px; vertical-align: -1px; margin-right: 6px; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.flag.big { width: 40px; height: 20px; margin-right: 0; }
.side { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }
.attribution { color: var(--dim); font-size: 12px; margin-top: 28px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 24px; font-weight: 600; line-height: 1.2; margin: 2px 0; }
.tile .delta { font-size: 12px; color: var(--muted); }

/* advice */
section { margin: 18px 0; }
section h2, details summary { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
#advice-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
#advice-list li { background: var(--panel); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 0 4px 4px 0; }
#advice-list li b { color: var(--accent); margin-right: 8px; text-transform: capitalize; font-weight: 600; }

/* at a glance */
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.card h3 { margin-top: 0; }
.card table { font-size: 13px; }
.card td, .card th { padding: 3px 5px; }
.card td:first-child { white-space: normal; }
.card table { table-layout: auto; }

/* collapsible detail sections */
details { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); margin: 8px 0; }
details summary { padding: 10px 14px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details summary::before { content: "+"; display: inline-block; width: 14px; color: var(--muted); }
details[open] summary::before { content: "\2212"; }
details summary .muted { font-weight: 400; margin-left: auto; }
details .body { padding: 2px 14px 14px; border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.more { display: inline-block; margin-top: 6px; font-size: 13px; cursor: pointer; color: var(--accent); background: none; border: none; padding: 0; }

/* tables */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; font-size: 12px; }
th:first-child, td:first-child { text-align: left; }
tr.good td:first-child { color: var(--good); }
tr.poor td:first-child { color: var(--bad); }
tr.sel td { background: var(--panel2); }
tr.clickable { cursor: pointer; }
td .flag { margin-right: 6px; }
.map { display: inline-flex; align-items: center; gap: 7px; color: inherit; }
.map-name { font-variant: small-caps; letter-spacing: .04em; font-weight: 600; color: var(--sand); }
.map-n { color: var(--dim); font-size: 12px; margin-left: 4px; }
a.map:hover .map-name { color: var(--accent); }
a.map:hover { text-decoration: none; }
.thumb { width: 38px; height: 24px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); flex-shrink: 0; }
.card .thumb { width: 32px; height: 20px; }
.card .map-n { display: none; }
.map-n { white-space: nowrap; }

/* paired bars: you on top, opponents below, 2px gap, direct labels in text ink */
.bars { display: grid; grid-template-columns: 110px 1fr 90px; gap: 3px 10px; align-items: center; font-size: 13px; }
.bar { position: relative; height: 16px; background: #0f1115; border-radius: 3px; overflow: hidden; }
.bar span { position: absolute; left: 0; height: 7px; border-radius: 0 3px 3px 0; }
.bar .me { top: 0; background: var(--me); }
.bar .op { top: 9px; background: var(--opp); }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
canvas { max-width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; margin: 10px 14px 0; }
#army-legend { padding: 6px 14px 12px; }
.list td, .list th { white-space: normal; }

@media (max-width: 700px) { header nav a { margin-left: 10px; } .hero { flex-direction: column; } .status { text-align: left; } .bars { grid-template-columns: 90px 1fr 80px; } }
