/* BolivyaKO portal — dark and gold, after the launcher. */
:root {
  --bg: #05070c;
  --bg-2: #0b1220;
  --panel: rgba(11, 18, 32, 0.92);
  --panel-solid: #0c1424;
  --edge: rgba(128, 106, 56, 0.4);
  --edge-soft: rgba(74, 90, 120, 0.45);
  --text: #e6ebf3;
  --muted: #9faabc;
  --gold: #c9a227;
  --amber: #e8b562;
  --gold-hi: #f0d28c;
  --blue: #8fb6e8;
  --ok: #6fcf7f;
  --bad: #ef6b6b;
  --warn: #e8b562;
  --karus: #e0675c;
  --elmo: #6ea3e8;
  --radius: 6px;
  --display: Georgia, "Times New Roman", serif;
  --ui: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--gold-hi); text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: normal; letter-spacing: .02em; margin: 0 0 .6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; color: var(--gold-hi); }
h3 { font-size: 1.1rem; color: var(--amber); }
p { margin: 0 0 1em; }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(5,7,12,.97), rgba(8,12,22,.93));
  border-bottom: 1px solid var(--edge);
}
.site-header .bar { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.brand { font-family: var(--display); font-size: 1.35rem; letter-spacing: .35em; color: #f4f7fb; white-space: nowrap; }
.brand span { color: var(--gold); }
.brand:hover { text-decoration: none; color: #fff; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.nav a, .nav button.linklike {
  color: var(--text); padding: 6px 10px; border-radius: 4px; font-size: .95rem; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button.linklike:hover { background: rgba(32,48,72,.6); text-decoration: none; color: var(--gold-hi); }
.nav a.active { color: var(--gold-hi); }
.nav form { display: inline; margin: 0; }
.menu-toggle { display: none; }
.menu-toggle summary { list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--edge-soft); border-radius: 4px; color: var(--text); }
.menu-toggle summary::-webkit-details-marker { display: none; }

@media (max-width: 760px) {
  .site-header .bar { flex-wrap: wrap; row-gap: 0; }
  .menu-toggle summary { padding: 4px 10px; }
  .nav.desktop { display: none; }
  .menu-toggle { display: block; margin-left: auto; }
  .menu-toggle .nav { display: flex; flex-direction: column; align-items: stretch; margin: 8px 0 0; }
  .menu-toggle[open] { width: 100%; }
  .menu-toggle[open] summary { width: max-content; margin-left: auto; }
}

/* Layout */
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.site-footer { border-top: 1px solid var(--edge-soft); color: var(--muted); font-size: .85rem; }
.site-footer .bar { max-width: 1180px; margin: 0 auto; padding: 16px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

.hero {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--edge);
  background: #05070c url("/img/hero.jpg") center 30% / cover no-repeat;
  min-height: 380px; display: flex; align-items: flex-end; margin-bottom: 24px;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,7,12,.9) 0%, rgba(5,7,12,.45) 55%, rgba(5,7,12,0) 100%), linear-gradient(0deg, rgba(5,7,12,.85), rgba(5,7,12,0) 55%); }
.hero .content { position: relative; z-index: 1; padding: 32px; max-width: 560px; }
.hero h1 { font-size: 2.6rem; letter-spacing: .3em; margin-bottom: .2em; color: #f4f7fb; }
.hero h1 small { display: block; font-size: .9rem; letter-spacing: .9em; color: var(--muted); margin-top: .3em; }
.hero p { color: #e2e7ef; font-size: 1.05rem; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
@media (max-width: 600px) {
  .hero { min-height: 300px; }
  .hero .content { padding: 20px; }
  .hero h1 { font-size: 1.8rem; }
}

.grid { display: grid; gap: 18px; }
main > .grid, main > section, main > .panel, main > .table-wrap, main > nav.tabs + .grid, main > article { margin-bottom: 18px; }
pre { white-space: pre-wrap; margin: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.three, .grid.sidebar { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .value { font-size: 1.35rem; }
  .panel { padding: 14px; }
  h1 { font-size: 1.6rem; }
  .site-header .bar { padding: 8px 16px; }
  .brand { font-size: 1.1rem; letter-spacing: .25em; }
}

.panel {
  background: linear-gradient(180deg, rgba(11,18,32,.95), rgba(7,12,23,.97));
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px; min-width: 0;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel.narrow { max-width: 480px; margin: 0 auto; }
.panel.tight { padding: 14px; }
.stack > * + * { margin-top: 18px; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .value { font-family: var(--display); font-size: 1.9rem; color: #f4f7fb; line-height: 1.1; }
.stat .value small { font-size: .9rem; color: var(--amber); margin-left: 4px; }
.stat .label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(111,207,127,.6); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 .98rem var(--ui); color: #2a1e08; cursor: pointer; text-decoration: none;
  padding: 9px 20px; border-radius: 4px; border: 1px solid #e8ce8a;
  background: linear-gradient(180deg, #e3c077 0%, #c79a4a 55%, #a87c33 100%);
}
.btn:hover { background: linear-gradient(180deg, #f0d28c 0%, #d6a854 55%, #b98a3c 100%); color: #2a1e08; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.big { font-size: 1.15rem; padding: 14px 34px; }
.btn.secondary { color: var(--text); border-color: var(--edge-soft); background: rgba(16,24,40,.8); }
.btn.secondary:hover { background: rgba(32,48,72,.9); color: var(--gold-hi); }
.btn.danger { color: #fff; border-color: #a33; background: linear-gradient(180deg, #c44 0%, #922 100%); }
.btn.small { padding: 5px 12px; font-size: .85rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

form.form .field { margin-bottom: 14px; }
label { display: block; color: var(--muted); font-size: .88rem; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], input[type=datetime-local], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 4px; border: 1px solid var(--edge-soft);
  background: #0a111e; color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,162,39,.25); }
textarea { min-height: 140px; resize: vertical; }
input.code { font-family: Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 1.1rem; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
.check input { width: auto; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 160px; }
.field-validation-error, .text-danger { color: var(--bad); font-size: .85rem; }

.alert { padding: 12px 14px; border-radius: 4px; border: 1px solid; margin-bottom: 16px; }
.alert.ok { border-color: rgba(111,207,127,.5); background: rgba(40,90,50,.25); }
.alert.bad { border-color: rgba(239,107,107,.5); background: rgba(110,30,30,.3); }
.alert.info { border-color: rgba(143,182,232,.45); background: rgba(30,50,90,.3); }
.alert.warn { border-color: rgba(232,181,98,.5); background: rgba(100,70,20,.3); }
.secret { font-family: Consolas, monospace; font-size: 1.15rem; letter-spacing: .1em; padding: 10px; background: #0a111e; border: 1px dashed var(--gold); border-radius: 4px; word-break: break-all; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--edge-soft); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(74,90,120,.25); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; background: rgba(12,20,36,.9); white-space: nowrap; }
tbody tr:hover { background: rgba(32,48,72,.35); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.rank { font-family: var(--display); color: var(--amber); width: 48px; }
tr.top1 td.rank { color: #ffd76a; } tr.top2 td.rank { color: #d9e1ec; } tr.top3 td.rank { color: #e0a36a; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--edge); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; }
.tabs a:hover { color: var(--gold-hi); text-decoration: none; }
.tabs a.active { color: var(--gold-hi); border-color: var(--edge); background: rgba(12,20,36,.9); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pills a { padding: 5px 12px; border: 1px solid var(--edge-soft); border-radius: 999px; color: var(--muted); font-size: .9rem; }
.pills a.active, .pills a:hover { color: #2a1e08; background: var(--amber); border-color: var(--amber); text-decoration: none; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--edge-soft); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(111,207,127,.5); }
.badge.bad { color: var(--bad); border-color: rgba(239,107,107,.5); }
.badge.warn { color: var(--warn); border-color: rgba(232,181,98,.5); }
.badge.gold { color: var(--gold-hi); border-color: var(--gold); }
.nation-karus { color: var(--karus); }
.nation-elmorad { color: var(--elmo); }

dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.item { border: 1px solid var(--edge-soft); border-radius: 4px; padding: 7px 9px; background: rgba(10,17,30,.8); font-size: .88rem; min-width: 0; }
.item .slot { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.item .name { color: var(--text); overflow-wrap: anywhere; }
.item .meta { color: var(--muted); font-size: .78rem; }
.item.empty-slot .name { color: #4a5568; }

.progress { height: 10px; border-radius: 5px; background: rgba(18,27,43,.9); border: 1px solid rgba(96,127,168,.3); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(180deg, #f0c173, #d08f32); transition: width .3s; }

.news-item + .news-item { border-top: 1px solid var(--edge-soft); padding-top: 14px; margin-top: 14px; }
.news-item .date { color: var(--muted); font-size: .82rem; }
.qr { background: #fff; padding: 10px; border-radius: 6px; width: 220px; height: 220px; }
.qr img { width: 200px; height: 200px; display: block; image-rendering: pixelated; }
.code-list { columns: 2; font-family: Consolas, monospace; }
@media (max-width: 600px) { .code-list { columns: 1; } }
.download-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.download-card .os { font-family: var(--display); font-size: 1.3rem; color: var(--gold-hi); }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.cf-turnstile { margin-bottom: 14px; }
