:root {
  /* Brand colors, taken from the BlocWar logo */
  --bg: #121419;
  --panel: #1b1e25;
  --line: #2a2e37;
  --text: #f2f0ea;
  --muted: #9a9ca3;
  --accent: #ffc629;
  --good: #3fb950;
  --bad: #f05d5d;
  --link: #79b8ff;
  --accent-text: #ffc629;
  --on-accent: #111318;
  --season-bg: #1d2530;
  --season-build-bg: #1f2a1d;
  --season-build-fg: #b6e3a9;
  --season-end-bg: #2d1f1f;
  --season-end-fg: #f3b5b5;
  --flash-ok-bg: #13261a;
  --flash-ok-line: #2a5a37;
  --flash-err-bg: #2b1616;
  --flash-err-line: #6b2b2b;
  --me-bg: #1d2a3a;
  --input-bg: #0b0e12;
  --tag-edge: rgba(255, 255, 255, 0.35);
  --display: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 14px rgba(0, 0, 0, .18);
  --radius: 10px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  font-size: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 980px; margin: 0 auto; padding: 18px 16px 48px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; }
h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: .01em; margin: 6px 0 12px; }
h2 { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 26px 0 10px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.top-right { display: flex; align-items: center; gap: 10px; }
.account { display: flex; align-items: center; gap: 4px; }
.turns-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.turns-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.turns-chip:hover { border-color: var(--accent); text-decoration: none; }
.turns-chip progress { width: 64px; }
@media (max-width: 560px) { .turns-chip progress { display: none; } .turns-chip { padding: 4px 9px; } .top-right { gap: 4px; } }
.account a, .account button.link { color: var(--text); font-weight: 600; font-size: .92rem; padding: 6px 10px; border-radius: 6px; }
.account a:hover, .account button.link:hover { background: var(--line); text-decoration: none; }
.account a.on { color: var(--accent-text); }
.account a.button { color: var(--on-accent); margin-left: 4px; }
.account a.button:hover { background: var(--accent); filter: brightness(1.08); }
@media (max-width: 460px) { .logo .wordmark { display: none !important; } .account a, .account button.link { padding: 6px 7px; font-size: .88rem; } }
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo img { display: block; }
.logo .wordmark { height: 18px; width: auto; }
.hero-logo { display: block; width: 100%; max-width: 520px; height: auto; margin: 4px 0 14px; }
.hero-h1 { font-size: 1.25rem; margin: 0 0 8px; letter-spacing: 0; }
.season { text-align: center; font-size: 0.78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; background: var(--season-bg); color: var(--muted); }
.season.build { background: var(--season-build-bg); color: var(--season-build-fg); }
.season.endgame { background: var(--season-end-bg); color: var(--season-end-fg); }

.nav { display: flex; gap: 2px; overflow-x: auto; padding: 6px 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; justify-content: safe center; }
.nav a { font-family: var(--display); font-size: .95rem; font-weight: 600; letter-spacing: .03em; padding: 7px 12px; color: var(--muted); white-space: nowrap; border-radius: 7px; }
.nav a:hover { color: var(--text); background: var(--line); text-decoration: none; }
.nav a.on { color: var(--on-accent); background: var(--accent); }
.nav a.sep { margin-left: 13px; position: relative; }
.nav a.sep::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; border-left: 1px solid var(--line); }
.dot { background: var(--accent); color: var(--on-accent); border-radius: 9px; padding: 0 6px; font-size: 0.75rem; font-weight: 700; }
progress { appearance: none; -webkit-appearance: none; height: 8px; width: 90px; border: 0; border-radius: 4px; background: var(--line); overflow: hidden; vertical-align: middle; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
progress.wide { width: 100%; height: 10px; display: block; margin: 6px 0; }

.flash { padding: 12px 14px; border-radius: var(--radius); margin: 12px 0; border: 1px solid; }
.flash.ok { background: var(--flash-ok-bg); border-color: var(--flash-ok-line); }
.flash.err { background: var(--flash-err-bg); border-color: var(--flash-err-line); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.stat b { font-family: var(--display); font-size: 1.45rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat small { color: var(--muted); }
.stat small.bad { color: var(--bad); }

.cols { display: grid; gap: 12px; }
@media (min-width: 720px) { .cols { grid-template-columns: 1fr 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; box-shadow: var(--shadow); }
.card h2 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.hero { padding: 18px 0 4px; }
.hero h1 { font-size: 1.9rem; color: var(--accent-text); }
.hero p { font-size: 1.05rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: var(--me-bg); }
.tag { font-size: 0.75rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--accent-text); }
.pill { background: var(--accent); color: var(--on-accent); border-radius: 10px; padding: 1px 8px; font-size: 0.75rem; font-weight: 700; }

label { display: block; margin: 10px 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 1rem; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: 7px; }
input[type="radio"], input[type="checkbox"] { display: inline-block; width: auto; margin: 0; padding: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.small { width: 6.5em; display: inline-block; padding: 6px 8px; margin-top: 0; text-align: right; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.row label { margin: 0; }
.row input:not(.small) { width: auto; }
.grow { flex: 1; min-width: 160px; }
button { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 7px; padding: 10px 18px; font-family: var(--display); font-size: 1rem; font-weight: 700; letter-spacing: .04em; cursor: pointer; margin-top: 8px; box-shadow: 0 1px 0 rgba(0,0,0,.25); }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button.danger { background: var(--bad); color: #fff; }
button.link { background: none; color: var(--link); padding: 0; font-family: inherit; font-weight: 400; font-size: 0.9rem; letter-spacing: 0; margin: 0; box-shadow: none; }
form.inline { display: inline; }

.events, .chat { list-style: none; padding: 0; margin: 0; }
.events li, .chat li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.events li.new { border-left: 3px solid var(--accent); padding-left: 8px; }
.events li.win::before { content: "▲ "; color: var(--good); }
.events li.loss::before { content: "▼ "; color: var(--bad); }

footer { color: var(--muted); font-size: 0.85rem; padding: 28px 16px 22px; border-top: 1px solid var(--line); background: var(--panel); margin-top: 24px; }
footer a, footer button.link { color: var(--muted); font-size: inherit; }
footer a:hover, footer button.link:hover { color: var(--text); }
.foot-cols { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.foot-cols div { display: flex; flex-direction: column; gap: 6px; }
.foot-cols b { color: var(--text); font-family: var(--display); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.foot-settings { max-width: 980px; margin: 20px auto 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.foot-tag { text-align: center; font-size: .75rem; margin-top: 10px; letter-spacing: .06em; }
@media (max-width: 520px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
label.check input { width: auto; margin-top: 3px; flex: none; }
.cf-turnstile { margin: 8px 0; }
form.flash { display: block; }
textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.btn { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 8px 14px; color: var(--text); font-weight: 600; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.report-body { white-space: pre-wrap; }
select { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 1rem; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: 7px; }
.tag.ai { color: var(--muted); }
.events li.missile::before { content: "✸ "; color: var(--accent-text); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 6px 0 10px; scrollbar-width: none; }
.tabs a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 14px; white-space: nowrap; color: var(--muted); font-size: 0.9rem; }
.tabs a.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.who { display: inline-flex; gap: 8px; align-items: flex-start; }
.flag { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); margin-top: 2px; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 4px 0; }
.badge { display: inline-block; border: 1px solid var(--accent); color: var(--accent-text); border-radius: 12px; padding: 2px 10px; font-size: 0.8rem; margin: 2px 0; }
.bio { font-style: italic; }
.spark { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.small { font-size: 0.8rem; }
.features .stat b { font-size: 1rem; color: var(--accent-text); }
.plan .price { font-size: 1.4rem; font-weight: 800; margin: 4px 0; }
td select, .inline select { display: inline-block; width: auto; min-width: 9em; padding: 6px 8px; margin-top: 0; }
.finder { display: grid; gap: 0 12px; }
@media (min-width: 720px) { .finder { grid-template-columns: 1fr 1fr; } }

/* Premium clan tag colors: filled badges with automatic dark or light letters, readable in both themes */
.tag.tc-red { background: #c8312f; color: #f2f0ea; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 4.7:1 */
.tag.tc-white { background: #f2f2f2; color: #16181d; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 15.9:1 */
.tag.tc-black { background: #1b1b1b; color: #f2f0ea; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 15.1:1 */
.tag.tc-blue { background: #2856b8; color: #f2f0ea; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 5.9:1 */
.tag.tc-green { background: #2f8a3d; color: #000000; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 4.8:1 */
.tag.tc-gold { background: #e0b13a; color: #16181d; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 8.9:1 */
.tag.tc-crimson { background: #8e1330; color: #f2f0ea; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 8.1:1 */
.tag.tc-navy { background: #16244f; color: #f2f0ea; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 13.2:1 */
.tag.tc-teal { background: #14837f; color: #ffffff; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 4.6:1 */
.tag.tc-orange { background: #e2641f; color: #16181d; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 5.1:1 */
.tag.tc-purple { background: #5e2f8c; color: #f2f0ea; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 8.1:1 */
.tag.tc-sky { background: #79b8ff; color: #16181d; border-color: var(--tag-edge); font-weight: 700; }  /* contrast 8.6:1 */

/* Light theme: follows the device setting unless the player picked one in the footer. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #f2f0ea;
  --panel: #ffffff;
  --line: #d9d6cc;
  --text: #16181d;
  --muted: #5f6168;
  --accent: #b98500;
  --accent-text: #8a6300;
  --on-accent: #16181d;
  --good: #1f7a33;
  --bad: #c0362c;
  --link: #1f5fbf;
  --season-bg: #e6e3da;
  --season-build-bg: #dcefd6;
  --season-build-fg: #23552a;
  --season-end-bg: #f6dcd9;
  --season-end-fg: #7d2a22;
  --flash-ok-bg: #e3f3e6;
  --flash-ok-line: #9cc9a6;
  --flash-err-bg: #f8e1df;
  --flash-err-line: #e0a39c;
  --me-bg: #fbf0cf;
  --input-bg: #ffffff;
  --tag-edge: rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .06);
  }
  :root:not([data-theme="dark"]) .on-dark { display: none !important; }
  :root:not([data-theme="dark"]) .on-light { display: block !important; }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f0ea;
  --panel: #ffffff;
  --line: #d9d6cc;
  --text: #16181d;
  --muted: #5f6168;
  --accent: #b98500;
  --accent-text: #8a6300;
  --on-accent: #16181d;
  --good: #1f7a33;
  --bad: #c0362c;
  --link: #1f5fbf;
  --season-bg: #e6e3da;
  --season-build-bg: #dcefd6;
  --season-build-fg: #23552a;
  --season-end-bg: #f6dcd9;
  --season-end-fg: #7d2a22;
  --flash-ok-bg: #e3f3e6;
  --flash-ok-line: #9cc9a6;
  --flash-err-bg: #f8e1df;
  --flash-err-line: #e0a39c;
  --me-bg: #fbf0cf;
  --input-bg: #ffffff;
  --tag-edge: rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .06);
}
:root[data-theme="light"] .on-dark { display: none !important; }
:root[data-theme="light"] .on-light { display: block !important; }
.on-light { display: none !important; }
.theme-switch a.on { color: var(--text); font-weight: 700; }
.flash.notice { background: var(--panel); border-color: var(--accent); }

/* Governments, daily goal, getting started, achievements */
.govs { border: 0; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.gov { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--text); font-weight: 400; background: var(--panel); }
.gov:hover { border-color: var(--muted); }
.gov:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gov input { margin-top: 5px; flex: none; }
.bad { color: var(--bad); }
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.steps { margin: 6px 0; padding-left: 22px; }
.steps li.done, .steps li.done a { color: var(--muted); text-decoration: line-through; }
/* Decorations: a uniform ribbon rack and a medal case */
.rack { display: flex; flex-wrap: wrap; gap: 2px; max-width: calc(4 * 36px + 3 * 2px); margin: 8px 0 14px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.rack svg { display: block; box-shadow: 0 1px 1px rgba(0,0,0,.35); }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 10px 0; }
.medals figure { margin: 0; text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.medals figure svg { filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.medals figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 0.85rem; }
.medals figcaption small { color: var(--muted); }
.medals figure.locked svg { filter: grayscale(1); opacity: 0.3; }
.medals figure.locked figcaption b { color: var(--muted); }

/* Link buttons, secondary buttons, revenge, sharing, notification settings */
a.button { display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 10px 16px; font-weight: 700; text-decoration: none; }
a.button.small { padding: 4px 10px; font-size: 0.85rem; margin-left: 6px; }
a.button.danger { background: var(--bad); color: #fff; }
button.secondary { background: var(--panel); color: var(--text, inherit); border: 1px solid var(--line); }
button[hidden] { display: none; }
.tag.revenge-tag { background: var(--bad); color: #fff; border-color: var(--bad); font-weight: 700; }
.revenge ul.plain { list-style: none; padding: 0; margin: 6px 0; }
.revenge ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.share-card { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); margin: 8px 0; display: block; }
.share-links { margin: 6px 0; }
label.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-weight: 400; }
label.check input { margin-top: 3px; }
.events li.luck { color: var(--accent-text); }

/* Chat menu, system lines, recruiting board */
.chat .msg-menu { display: inline-block; margin-left: 4px; }
.chat .msg-menu summary { cursor: pointer; list-style: none; color: var(--muted); padding: 0 6px; display: inline; }
.chat .msg-menu summary::-webkit-details-marker { display: none; }
.chat .msg-menu[open] { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin: 4px 0; }
.chat .msg-menu form.inline { display: inline; margin-right: 10px; }
.chat li.system { color: var(--accent-text); font-style: italic; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.board .ad { margin: 0; }
.board .who { display: flex; gap: 10px; align-items: center; }
.board .who svg { flex: none; border-radius: 3px; }
.tagpick { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 6px 0; }
.tagpick label.check { margin: 4px 0; }
button.small { padding: 4px 10px; font-size: 0.85rem; }
details.card > summary { cursor: pointer; }
.creator-ribbon { display: flex; align-items: center; gap: 8px; }
.creator-ribbon svg { box-shadow: 0 1px 1px rgba(0,0,0,.35); }
.season.practice { background: var(--panel); color: var(--accent-text); border-bottom: 2px dashed var(--accent); }

/* Season finale and war map */
ol.podium { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
ol.podium li { display: flex; align-items: center; gap: 12px; }
ol.podium li svg { flex: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
ol.podium small { display: block; }
ul.awards li { padding: 6px 0; border-bottom: 1px solid var(--line); }
svg.warmap { width: 100%; height: auto; max-width: 760px; display: block; margin: 8px auto; }
.warmap line { stroke-width: 3; }
.warmap .wm-war { stroke: var(--bad); }
.warmap .wm-ended { stroke: var(--bad); stroke-opacity: .35; stroke-dasharray: 6 6; }
.warmap .wm-ally { stroke: var(--good); }
.warmap .wm-nap { stroke: var(--muted); stroke-dasharray: 4 6; }
.warmap .wm-clan circle { stroke: var(--accent); stroke-width: 2; }
.warmap .wm-clan circle:not([fill]) { fill: var(--panel); }
.warmap .wm-clan:hover circle { stroke-width: 3; }
.warmap .wm-tag { fill: var(--accent-text); font-weight: 700; font-size: 15px; }
.warmap .wm-name { fill: var(--text); font-weight: 600; font-size: 14px; }
.warmap .wm-land { fill: var(--muted); font-size: 12px; }
.legend .wm-key { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin: 0 2px 0 10px; }
.legend .wm-key.war { border-color: var(--bad); }
.legend .wm-key.ended { border-color: var(--bad); border-top-style: dashed; opacity: .5; }
.legend .wm-key.ally { border-color: var(--good); }
.legend .wm-key.nap { border-color: var(--muted); border-top-style: dashed; }
.tag.indep { color: var(--muted); border-style: dashed; font-weight: 400; }

/* Country report */
.advice-list { list-style: none; padding: 0; margin: 0; }
.advice-list li { padding: .5rem .6rem; margin: .35rem 0; border-left: 4px solid var(--muted); background: var(--panel); border-radius: 4px; }
.advice-list li.urgent { border-left-color: var(--bad); }
.advice-list li.tip { border-left-color: var(--accent); }
.advice-list li.good { border-left-color: var(--good); }
.advice-list li b { display: block; margin-bottom: .15rem; }

/* ---------- Shop cosmetics ---------- */
/* Country and HQ themes: an accent color, plus a band behind the page header. */
body.ct-desert, .ct-desert { --accent: #d9893b; --accent-text: #e6a25e; --theme-a: #8a5a2b; --theme-b: #d9b07a; }
body.ct-arctic, .ct-arctic { --accent: #8fd3ff; --accent-text: #8fd3ff; --theme-a: #4b7ea3; --theme-b: #dff3ff; }
body.ct-jungle, .ct-jungle { --accent: #5fbf5a; --accent-text: #74d16f; --theme-a: #1f4d22; --theme-b: #5f8f3a; }
body.ct-nightops, .ct-nightops { --accent: #3ef08a; --accent-text: #3ef08a; --theme-a: #0b0f0d; --theme-b: #1e3a2a; }
body.ct-navy, .ct-navy { --accent: #d6b25e; --accent-text: #e0c27a; --theme-a: #16244f; --theme-b: #2f4a8f; }
body.ct-winter, .ct-winter { --accent: #b9e6ff; --accent-text: #b9e6ff; --theme-a: #5a7a94; --theme-b: #e9f5ff; }
body[class*="ct-"] header.top { border-bottom: 3px solid var(--accent); }
.profile-head[class*="ct-"] { padding: 12px; border-radius: 6px; background: linear-gradient(120deg, var(--theme-a), var(--theme-b)); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.profile-head[class*="ct-"] a { color: #fff; text-decoration: underline; }
.profile-head[class*="ct-"] .muted { color: rgba(255,255,255,.85); }

/* Medal rack frames. */
.rack[class*="mf-"] { border-width: 3px; padding: 8px; }
.rack.mf-laurel { border-color: #3f8a3a; background: linear-gradient(#1c2a1b, #142014); box-shadow: inset 0 0 0 2px #8bc34a55; }
.rack.mf-oak { border-color: #b8c0c8; background: linear-gradient(#2a2f36, #1b1f25); box-shadow: inset 0 0 0 2px #ffffff22; }
.rack.mf-sunburst { border-color: #ffc629; background: radial-gradient(circle at 50% 120%, #ffc62944, transparent 70%), #1d1a10; box-shadow: 0 0 10px #ffc62955; }
.rack.mf-frost { border-color: #b9e6ff; background: linear-gradient(#1c2a36, #121a22); box-shadow: 0 0 10px #b9e6ff55, inset 0 0 0 2px #ffffff22; }
.rack.sample { margin: 0; }

/* Shop listing. */
.shop-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shop-item .preview { width: 120px; display: flex; gap: 4px; align-items: center; justify-content: center; }
.shop-item .buy { min-width: 96px; text-align: right; }
.swatch { width: 110px; height: 56px; border-radius: 4px; display: flex; align-items: center; justify-content: center; background: linear-gradient(120deg, var(--theme-a, #333), var(--theme-b, #555)); color: #fff; font-weight: 700; }
.swatch .dot, .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin: 0 2px; }
.emblem { flex: none; }
fieldset.plans { border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin: 8px 0; }

/* Admin overview chart */
.admin-chart { width: 100%; max-width: 640px; height: auto; display: block; margin: 8px 0; }
.admin-chart rect { fill: var(--accent); }
.admin-chart text { fill: var(--muted); font-size: 10px; }
.admin-chart line { stroke: var(--line); }

/* Ad landing pages and the consent bar */
.hero.welcome { text-align: left; padding: 12px 0; }
.hero.welcome .lead { font-size: 1.15rem; max-width: 46em; }
.consent-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.consent-bar p { margin: 0; flex: 1 1 260px; }

/* Founder's Pack */
.rack.mf-founder { border-color: #ffc629; background: repeating-linear-gradient(45deg, #111 0 8px, #17140a 8px 16px); box-shadow: 0 0 0 1px #000, 0 0 12px #e0b13a66; }
.founder-tag { display: inline-block; font-size: .72em; font-weight: 700; letter-spacing: .04em; color: #111; background: linear-gradient(#f3d27a, #c99a2e); border-radius: 3px; padding: 0 5px; vertical-align: middle; }
.founder-banner { border: 1px solid #ffc629; background: linear-gradient(120deg, #1b160a, #121419); color: #f2f0ea; border-radius: 6px; padding: 12px 14px; margin: 10px 0; }
.founder-banner a { color: #ffd76a; }
.founder-banner b { color: #ffd76a; }
.founder-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.founder-wall .who { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }

/* Regions on the war map, and the war room */
.wm-region polygon { fill: var(--panel); stroke: var(--muted); stroke-width: 2; }
.wm-region.held polygon { fill: #5a4718; stroke: var(--accent); }
.wm-rtag { fill: var(--text); font-size: 12px; font-weight: 700; }
.wm-rname { fill: var(--muted); font-size: 11px; }
.wm-hold { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: .7; }
.war-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.war-side { display: flex; gap: 8px; align-items: center; }
.war-score { font-size: 1.8rem; font-weight: 800; }
.war-vs { font-weight: 800; color: var(--muted); }
progress.war-bar { width: 100%; height: 14px; border-radius: 7px; background: var(--bad); margin: 12px 0; display: block; }
progress.war-bar::-webkit-progress-bar { background: var(--bad); border-radius: 7px; }
progress.war-bar::-webkit-progress-value { background: var(--accent); border-radius: 7px 0 0 7px; }
progress.war-bar::-moz-progress-bar { background: var(--accent); }
.events li.war-a { border-left: 4px solid var(--accent); padding-left: 8px; }
.events li.war-b { border-left: 4px solid var(--bad); padding-left: 8px; }
/* How to play guide */
.guide { max-width: 46em; }
.guide .lead { font-size: 1.1rem; }
.guide h2 { margin-top: 1.6em; scroll-margin-top: 12px; }
.guide .toc ol { columns: 2; margin: 6px 0 0; padding-left: 1.4em; }
.guide table.data { margin: 8px 0 12px; }
.guide .faq dt { font-weight: 600; margin-top: 10px; }
.guide .faq dd { margin: 2px 0 0; }
@media (max-width: 560px) { .guide .toc ol { columns: 1; } }

/* ---------- Page head and quick links (status, profile) ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin: 4px 0 8px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: .95rem; }
.rank-badge { color: var(--text); display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: .9rem; }
.rank-badge b { font-family: var(--display); font-size: 1.2rem; color: var(--accent-text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; padding: 0; list-style: none; }
.chips a, .chips span.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: .88rem; font-weight: 600; }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.chips .chip.info { font-weight: 400; color: var(--muted); }
.chips .chip.warn { border-color: var(--accent); color: var(--accent-text); }
.chips .chip.good { border-color: var(--good); color: var(--good); }
.run-turns { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.run-turns label { margin: 0; flex: 0 1 180px; }
.run-turns button { margin: 0; }

/* ---------- My profile ---------- */
.subnav { display: flex; gap: 6px; margin: 6px 0 4px; flex-wrap: wrap; }
.subnav a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem; }
.subnav a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.form-grid { display: grid; gap: 0 14px; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid.three { grid-template-columns: 1fr 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.form-grid > div > label { margin-bottom: 4px; }
.preview-card { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); }
.preview-card .names { display: flex; flex-direction: column; gap: 2px; }
.preview-card .title { color: var(--accent-text); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.preview-card .name { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
.preview-card[class*="ct-"] { background: linear-gradient(120deg, var(--theme-a), var(--theme-b)); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); border-color: var(--accent); }
.preview-card[class*="ct-"] .title { color: #fff; opacity: .9; }
.section-note { color: var(--muted); font-size: .85rem; margin-top: -4px; }
.swatch svg { display: block; }
.frame-note { margin: 12px 0 4px !important; }
.rank-badge:hover { border-color: var(--accent); text-decoration: none; }

/* Status page: today's to-dos side by side; the Founder's Pack as one line */
.today { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.today .card { margin: 7px 0; }
.today .card h2 { font-size: .9rem; }
.tutorial details summary { cursor: pointer; color: var(--link); margin: 4px 0; }
.founder-banner.strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 14px; }
.founder-banner.strip a.button { color: #111; background: linear-gradient(#f3d27a, #c99a2e); margin: 0; }
.run-turns { padding: 12px 18px; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-fields label { margin: 0; flex: 0 1 200px; }
.inline-fields button { margin: 0; }
.subcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.subcard h3 { margin-top: 0; }
.op-list { margin: 4px 0 12px; padding-left: 18px; }
.op-list li { margin: 2px 0; }
p.muted, .card p.muted { font-size: .9rem; }
.founder-banner.strip > span { flex: 1 1 420px; }

/* Flag and emblem editors: a big live preview next to the choices */
.flag-editor { display: grid; gap: 16px; align-items: start; }
@media (min-width: 640px) { .flag-editor { grid-template-columns: 170px 1fr; } }
.flag-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.flag-stage img { border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.35); max-width: 100%; height: auto; }
.flag-editor > div > label:first-child { margin-top: 0; }
img.emblem-live { flex: none; }
/* Clan HQ tabs */
.hq-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hq-tabs a { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-family: var(--display); font-weight: 700; letter-spacing: .03em; }
.hq-tabs a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.hq-tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hq-tabs .dot { margin-left: 4px; }
.hq-tabs a.on .dot { background: var(--on-accent); color: var(--accent); }
/* Attack: head-to-head */
.target-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.target-head h2 { margin-bottom: 4px; }
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 14px 0 6px; }
.matchup .side { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.matchup .side:last-child { text-align: right; }
.matchup .label { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.matchup .side b { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.matchup .mid { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.verdict { padding: 6px 12px; border-radius: 999px; font-family: var(--display); font-weight: 700; letter-spacing: .03em; white-space: nowrap; border: 1px solid; }
.verdict.win { color: var(--good); border-color: var(--good); }
.verdict.lose { color: var(--bad); border-color: var(--bad); }
.verdict.close { color: var(--accent-text); border-color: var(--accent); }
@media (max-width: 560px) { .matchup { grid-template-columns: 1fr 1fr; } .matchup .mid { grid-column: 1 / -1; order: 3; } }
p.bonus { margin: 6px 0; padding: 8px 12px; border-radius: 8px; border-left: 4px solid currentColor; background: var(--bg); }
p.bonus b { color: inherit; }
.attack-go { margin: 12px 0 8px; }
button.big { font-size: 1.1rem; padding: 12px 26px; }
.btn.small, a.btn.small { padding: 4px 12px; font-size: .85rem; }
/* Chat */
.chat-box { padding: 0; overflow: hidden; }
.chat-box .chat { max-height: min(62vh, 640px); overflow-y: auto; padding: 8px 16px; }
.chat-empty { padding: 16px; margin: 0; }
.chat li.msg { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chat li.msg:last-child { border-bottom: 0; }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.msg-body { margin-top: 2px; overflow-wrap: anywhere; }
.chat li.mine .msg-body { background: color-mix(in srgb, var(--accent) 12%, transparent); display: inline-block; padding: 4px 10px; border-radius: 8px; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; color: #fff; font-size: .95rem; }
.av-0 { background: #b3263e; } .av-1 { background: #2f8a3d; } .av-2 { background: #2856b8; } .av-3 { background: #8a5a2b; }
.av-4 { background: #7a3fb0; } .av-5 { background: #14837f; } .av-6 { background: #c25a1c; } .av-7 { background: #4b5563; }
.av-sys { background: var(--accent); color: var(--on-accent); }
.chat-send { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.chat-send input { margin: 0; flex: 1; }
.chat-send button { margin: 0; }
progress.cap { display: block; width: 90px; height: 5px; margin: 6px 0 0 auto; }
/* Rankings */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 4px 0 6px; }
.seg a { padding: 5px 14px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.on { background: var(--panel); color: var(--text); }
.seg a:hover { text-decoration: none; color: var(--text); }
.place { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-family: var(--display); font-weight: 700; color: #111; }
.place.p1 { background: linear-gradient(#f3d27a, #c99a2e); }
.place.p2 { background: linear-gradient(#e6e8ec, #a7adb6); }
.place.p3 { background: linear-gradient(#e2a76f, #a8652e); }

/* Phone header: keep Shop and My profile clearly apart, on one line */
.account a, .account button.link, .turns-chip { white-space: nowrap; }
@media (max-width: 560px) {
  .top { padding: 8px 10px; gap: 8px; }
  .top-right { gap: 8px; }
  .account { gap: 10px; }
  .account a, .account button.link { padding: 6px 4px; }
  .account a + a { border-left: 1px solid var(--line); padding-left: 12px; border-radius: 0; }
}
@media (max-width: 380px) { .turns-chip .lbl { display: none; } }

/* ---------- Phones: nothing may be wider than the screen ---------- */
@media (max-width: 640px) {
  main { padding: 14px 12px 40px; }
  .card { padding: 14px 12px; }
  /* Wide tables scroll sideways inside their own box instead of stretching the page. */
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table > tbody, table > thead { display: table; width: 100%; }
  th, td { padding: 7px 5px; }
  th { letter-spacing: .03em; font-size: .68rem; }
  input.small { width: 4.6em; padding: 6px; }
  td small { overflow-wrap: anywhere; }
  .shop-item { flex-wrap: wrap; }
  .shop-item .preview { width: 96px; }
  .shop-item .grow { flex: 1 1 150px; min-width: 0; }
  .shop-item .buy { flex: 1 1 100%; text-align: left; min-width: 0; }
  .shop-item .buy button { margin-top: 0; }
  .page-head h1, h1 { font-size: 1.5rem; }
  .preview-card { flex-wrap: wrap; }
  .hq-tabs a { padding: 6px 12px; }
  .stat b { font-size: 1.25rem; }
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.foot-social { border-top: 0; margin-top: 8px; padding-top: 0; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .profile-head { flex-wrap: wrap; }
  .profile-head > div { flex: 1 1 100%; }
}
/* Attack kinds */
.kinds { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 12px; }
.kind-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.kind-card.main { border-color: var(--accent); }
.kind-card p { margin: 0; }
.kind-card form { margin-top: auto; }
.kind-card button { width: 100%; }
.kind-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.kind-head h3 { margin: 0; font-size: 1.15rem; }
.kind-card .matchup { margin: 4px 0; gap: 8px; }
.kind-card .matchup .side { padding: 8px 10px; background: var(--panel); }
.kind-card .matchup .side b { font-size: 1.3rem; }
.kind-card .verdict { font-size: .82rem; padding: 3px 10px; }
.proscons { list-style: none; margin: 0; padding: 0; }
.proscons li { padding-left: 18px; position: relative; }
.proscons li.good::before { content: "+"; position: absolute; left: 2px; font-weight: 700; }
.proscons li.bad::before { content: "−"; position: absolute; left: 2px; font-weight: 700; }
@media (max-width: 560px) { .kind-card .matchup { grid-template-columns: 1fr auto 1fr; } .kind-card .matchup .mid { grid-column: auto; order: 0; } .kinds { grid-template-columns: 1fr; } }
/* Narrow phones with a full turn bank ("120/120"): tighten the header so nothing runs off the edge */
@media (max-width: 400px) {
  .top { padding: 8px; gap: 6px; }
  .top-right { gap: 6px; min-width: 0; }
  .turns-chip { padding: 3px 7px; font-size: .78rem; }
  .account { gap: 4px; font-size: .88rem; }
  .account a, .account button.link { padding: 6px 3px; }
  .account a + a { padding-left: 8px; }
}
@media (max-width: 380px) { .top { padding: 8px 6px; } .account a + a { padding-left: 6px; } .account { gap: 2px; } .turns-chip { padding: 3px 6px; } }

/* Before launch: a calm, clear note that this is a beta and countries reset */
.beta-note { border: 1px solid var(--link); border-left-width: 4px; background: color-mix(in srgb, var(--link) 9%, var(--panel)); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; }
.beta-note.strip { padding: 9px 12px; font-size: .92rem; margin: 10px 0; }

/* Landing: the sign-up card sits beside the pitch on wide screens and right under it on phones */
.hero.split { display: grid; gap: 22px; align-items: center; padding: 18px 0 8px; }
@media (min-width: 880px) { .hero.split { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 36px; } }
.hero.split .hero-logo { max-width: 440px; margin: 0 0 12px; }
.hero.split .hero-h1 { font-size: 1.55rem; line-height: 1.2; margin: 0 0 8px; }
.hero-tag { font-size: 1.1rem; margin: 0 0 12px; }
.hero-points { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.hero-points li { padding-left: 26px; position: relative; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent-text); font-weight: 800; }
.hero-guide { margin: 0; font-size: .95rem; }
.join-card { border: 2px solid var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow); margin: 0; scroll-margin-top: 80px; }
.join-card h2 { font-size: 1.5rem; text-transform: none; letter-spacing: 0; margin: 0 0 2px; color: var(--accent-text); }
.join-sub { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.join-card button.big { width: 100%; font-size: 1.1rem; padding: 13px 18px; margin-top: 12px; }
.join-foot { margin: 10px 0 0; text-align: center; }
.promo-more { margin: 8px 0 2px; font-size: .92rem; }
.promo-more summary { cursor: pointer; color: var(--link); }
#login { scroll-margin-top: 80px; }
.hero.split.welcome h1 { font-size: 1.8rem; line-height: 1.2; }
@media (max-width: 879px) {
  .hero.split { gap: 14px; padding-top: 10px; }
  .hero.split .hero-logo { max-width: 250px; margin-bottom: 8px; }
  .hero.split .hero-h1 { font-size: 1.3rem; }
  .hero-tag { font-size: 1rem; margin-bottom: 4px; }
  .hero-points, .hero-guide { display: none; }   /* the form comes first on a phone; the same points are in the cards below */
  .hero.split.welcome h1 { font-size: 1.45rem; }
  .hero.split.welcome .lead { font-size: 1rem; }
}

/* Shop: items as cards in a grid, with a row of jump links */
.lead-note { color: var(--muted); margin: 0 0 12px; }
.chips.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; }
.chips.jump a.chip { text-decoration: none; color: var(--text); }
.chips.jump a.chip:hover { border-color: var(--accent); }
.gift-strip { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--accent); }
.gift-strip h2 { margin: 0 0 4px; }
.gift-strip p { margin: 0; }
.card.drop { border-color: color-mix(in srgb, var(--link) 60%, var(--line)); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.shop-grid .shop-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.shop-grid .shop-item:hover { border-color: var(--muted); }
.shop-grid .shop-item.owned { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.shop-grid .shop-item .preview { width: auto; min-height: 72px; background: color-mix(in srgb, var(--panel) 70%, transparent); border-radius: 6px; padding: 8px; flex-wrap: wrap; }
.shop-grid .shop-item .grow { min-width: 0; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.shop-grid .shop-item .grow .pill { align-self: flex-start; }
.shop-grid .shop-item .buy { min-width: 0; text-align: left; }
.shop-grid .shop-item .buy button { width: 100%; margin-top: 0; }
.card h3[id], .card[id] { scroll-margin-top: 80px; }

/* Government: one card per government, bonuses as chips */
.govs { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; }
.gov-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gov-body b { font-size: 1.05rem; }
.gov-mods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gov-mods .chip { font-size: .8rem; padding: 2px 9px; }
.gov.static { cursor: default; }
.gov-now { display: flex; flex-direction: column; gap: 4px; border-left: 4px solid var(--accent); }
.gov-now .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.gov-now .gov-name { font-family: var(--display); font-size: 1.6rem; color: var(--accent-text); }

/* Public country, player and clan pages */
.profile-head { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); margin-bottom: 14px; }
.profile-head .grow { flex: 1; min-width: 0; }
.profile-head .chips { margin: 8px 0 0; }
.profile-head .chips a.chip { text-decoration: none; color: var(--text); }
.head-actions { margin: 0; flex: none; }
@media (max-width: 640px) { .head-actions { flex: 1 1 100%; } .head-actions .button, .head-actions .btn { flex: 1; text-align: center; } .shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.gov-mods .chip { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-weight: 600; }
.gov-mods .chip.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.gov-mods .chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }

.gov-body .pill { align-self: flex-start; }
@media (max-width: 640px) {
  .shop-grid .shop-item { flex-wrap: nowrap; }
  .shop-grid .shop-item .preview { width: auto; }
  .shop-grid .shop-item .grow { flex: 1 1 auto; }
  .shop-grid .shop-item .buy { flex: none; }
  .profile-head { align-items: flex-start; }
  .profile-head > svg { flex: none; }
  .profile-head > div.grow { flex: 1 1 60%; }
}

.join-pitch { font-size: 1.5rem; text-transform: none; letter-spacing: 0; margin: 0 0 8px; color: var(--accent-text); }
.guide nav.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.guide nav.toc a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: .88rem; font-weight: 600; color: var(--text); }
.guide nav.toc a:hover { border-color: var(--accent); text-decoration: none; }

.join-inline { max-width: 440px; margin: 12px 0 8px; }
