/* NovaStars: тёмная тема в цветах интерфейса игры */
:root {
  --bg: #06070b; --panel: #11131a; --panel2: #171a23; --line: #2a2f3b;
  --text: #dde1e8; --muted: #8e97a5; --head: #f3f4f6;
  --accent: #e39a3b; --accent2: #f4b860; --violet: #8b6cf0; --green: #4fae62; --red: #e06666;
  --physics: #a78bfa; --drives: #60a5fa; --industry: #f59e0b; --life: #4ade80; --intel: #22d3ee; --military: #f87171;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 73% 9%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 63%, #ffd9a088 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 47%, #cfe3ff88 50%, transparent 51%),
    radial-gradient(1px 1px at 24% 81%, #fff5 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 62% 31%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 86%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #bcd4ff77 50%, transparent 51%),
    radial-gradient(900px 500px at 80% -10%, #e39a3b14, transparent 70%),
    radial-gradient(800px 600px at -10% 110%, #6d44c914, transparent 70%);
  background-size: 420px 420px, 380px 380px, 520px 520px, 460px 460px, 340px 340px, 600px 600px, 300px 300px, 480px 480px, 100% 100%, 100% 100%;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 0 28px; height: 60px;
  background: #0a0c12e6; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--head); font-weight: 600; font-size: 20px; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; }
.menu a { color: var(--muted); padding: 6px 14px; border-radius: var(--radius); font-size: 15px; }
.menu a:hover { color: var(--head); background: var(--panel2); text-decoration: none; }
.menu a.on { color: #14100a; background: var(--accent); }
.ver { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 28px 56px; }
.bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 28px; color: var(--muted);
  font-size: 13px; border-top: 1px solid var(--line); background: #0a0c12; }

h1, h2, h3 { color: var(--head); line-height: 1.25; font-weight: 600; }
h1 { font-size: 34px; margin: 0 0 16px; }
h2 { font-size: 26px; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h3 { font-size: 20px; margin: 28px 0 8px; }
h2 small, h3 small { color: var(--muted); font-size: 14px; font-weight: 400; }
p, ul, ol { margin: 0 0 14px; }
.lead { font-size: 18px; color: #c4cad4; }
.doc blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--panel); color: #c9ced8; border-radius: 0 var(--radius) var(--radius) 0; }
.doc blockquote p:last-child { margin: 0; }
code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 13px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.doc table, .grid { border-collapse: collapse; margin: 0 0 18px; font-size: 15px; width: 100%; }
.doc th, .doc td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.doc thead th { background: var(--panel2); color: var(--head); font-weight: 600; }
.doc tbody tr:nth-child(odd) td { background: #ffffff05; }
.table-wrap { overflow-x: auto; }
.grid td, .grid tfoot td { text-align: center; }
.grid tfoot th, .grid tfoot td { background: var(--panel2); }

/* главная */
.hero { position: relative; display: grid; grid-template-columns: 1fr 1.25fr; gap: 36px; align-items: center; margin: 8px 0 40px; }
.hero h1 { font-size: 44px; margin: 8px 0 12px; }
.kicker { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--accent2); font-size: 22px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
.hero .shot img { border-color: #e39a3b66; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-block; padding: 10px 22px; border-radius: var(--radius); font-weight: 600; border: 1px solid var(--line); color: var(--head); background: var(--panel2); }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.main { background: var(--accent); color: #14100a; border-color: var(--accent); }
.btn.main:hover { background: var(--accent2); }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-top: 2px solid var(--accent); }
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: #c1c7d1; font-size: 15px; }
.feature.v { border-top-color: var(--violet); } .feature.g { border-top-color: var(--green); }
.recent { list-style: none; padding: 0; }
.recent li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.recent time { color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 8px; }

/* вики */
.wiki { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }
.side { position: sticky; top: 84px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; max-height: calc(100vh - 110px); overflow: auto; }
.side-title { color: var(--accent); text-transform: uppercase; font-size: 12px; letter-spacing: .12em; margin: 0 8px 8px; }
.side ul { list-style: none; padding: 0; margin: 0; }
.side a { display: block; padding: 5px 10px; border-radius: 4px; color: var(--text); font-size: 15px; }
.side a:hover { background: var(--panel2); text-decoration: none; }
.side a.on { background: #e39a3b22; color: var(--accent2); }
.side .sub a { padding-left: 24px; font-size: 14px; color: var(--muted); }
.side .sub a.on { color: var(--accent2); }
.doc { min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { padding: 3px 10px; border: 1px solid var(--line); border-radius: 20px; font-size: 14px; color: var(--text); background: var(--panel); }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.filter { width: 100%; max-width: 520px; padding: 9px 12px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.filter:focus { outline: none; border-color: var(--accent); }

.area-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0 20px; }
.area-card { display: block; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--accent)); border-radius: var(--radius); color: var(--head); }
.area-card:hover { text-decoration: none; background: var(--panel2); }
.area-card span { display: block; font-weight: 600; }
.area-card small { color: var(--muted); }
.area-physics { --c: var(--physics); } .area-drives { --c: var(--drives); } .area-industry { --c: var(--industry); }
.area-life { --c: var(--life); } .area-intel { --c: var(--intel); } .area-military { --c: var(--military); }
.grid th[class^="area-"] { border-left: 4px solid var(--c); }

.techs { display: grid; gap: 6px; }
.tech { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--violet); border-radius: var(--radius); }
.tech.kind-upgrade { border-left-color: var(--drives); } .tech.kind-theory { border-left-color: var(--physics); }
.tech.kind-civil { border-left-color: var(--green); } .tech.kind-discovery { border-left-color: var(--accent); }
.tech summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 52px 1fr auto; gap: 2px 12px; padding: 9px 14px; }
.tech summary::-webkit-details-marker { display: none; }
.tech summary:hover { background: var(--panel2); }
.tech[open] summary { border-bottom: 1px solid var(--line); }
.tid { color: var(--muted); font: 13px/1.9 Consolas, monospace; }
.tname { color: var(--head); font-weight: 600; }
.tmeta { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.tgives { grid-column: 2 / 4; color: #b9c0cb; font-size: 14px; }
.tbody { padding: 10px 14px 4px 78px; font-size: 15px; }
.tech:target { box-shadow: 0 0 0 1px var(--accent); }

.civ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.civ { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-top: 2px solid var(--accent); }
.civ h3 { margin: 0; }
.civ .keeper { color: var(--accent2); font-size: 14px; margin: 2px 0 10px; }
.civ dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 10px; font-size: 14px; }
.civ dt { color: var(--muted); } .civ dd { margin: 0; }
.plus { color: #7fd08e; font-size: 14px; margin: 0 0 4px; } .minus { color: #ef8a8a; font-size: 14px; margin: 0; }
.neutral { color: var(--muted); font-size: 14px; margin: 0; }

/* галерея */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.shot a:hover img { border-color: var(--accent); transform: translateY(-2px); }
.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.shot figcaption b { color: var(--text); font-weight: 600; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: #000000e6; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: var(--radius); border: 1px solid var(--line); }
.lightbox p { color: var(--text); margin: 12px 0 0; }

/* история */
.day h3 { color: var(--accent2); }
.log { list-style: none; padding: 0; margin: 0 0 8px; border-left: 2px solid var(--line); }
.log li { position: relative; padding: 6px 0 6px 18px; font-size: 15px; }
.log li::before { content: ""; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.log code { margin-left: 6px; }

/* скачивание */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 12px 0 24px; }
.dl-card { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; }
.dl-card h3 { margin: 0 0 6px; }
.dl-card .soon { color: var(--muted); font-size: 14px; margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .wiki { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .top { gap: 12px; padding: 0 14px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .ver { display: none; }
  main { padding: 20px 14px 40px; }
  .tech summary { grid-template-columns: 1fr; }
  .tmeta { text-align: left; } .tgives { grid-column: auto; }
  .tbody { padding-left: 14px; }
}
.hero .gallery { grid-template-columns: 1fr; }
.features { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .wiki .side { order: 2; } .menu a { padding: 6px 10px; } }
