* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0b;
  --card: #141416;
  --card-2: #1a1a1d;
  --line: #232326;
  --line-2: #333336;

  --text: #f2f0ec;
  --text-2: #a5a29c;
  --text-3: #6d6b67;

  --amber: #d7a35b;
  --amber-hi: #f0c383;
  --amber-bg: rgba(215, 163, 91, .1);

  --red: #e0574a;
  --green: #57c26a;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --head: 'Manrope', sans-serif;
  --body: 'Golos Text', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  color: var(--text); background: var(--bg); overflow-x: hidden; min-height: 100vh;
  position: relative;
}

a { color: var(--amber-hi); text-decoration: none; }
a:hover { color: #fff; }
b { font-weight: 600; color: var(--text); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }

.stars-field { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.star {
  position: absolute; top: -10px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, .7);
  animation: starfall linear infinite;
}
@keyframes starfall {
  0% { transform: translateY(-10px) translateX(0); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(110vh) translateX(var(--drift, 0px)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .star { animation: none; display: none; } }

.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px; height: 64px;
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; width: 100%; gap: 9px; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--head); font-weight: 800; font-size: 1.1rem; color: var(--text); }
.logo-icon { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
.crumb { color: var(--text-3); font-size: .85rem; }
.pill {
  margin-left: auto; font-family: var(--head); font-weight: 700; font-size: .85rem;
  background: var(--amber); color: #1a1208; padding: 9px 18px; border-radius: 100px;
  transition: background .2s;
}
.pill:hover { background: var(--amber-hi); color: #1a1208; }

main { position: relative; z-index: 1; }
.hero { padding: 64px 24px 32px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .8rem;
  color: var(--amber-hi); background: var(--amber-bg); border: 1px solid rgba(215, 163, 91, .25);
  padding: 6px 14px; border-radius: 100px; margin-bottom: 20px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

h1 { font-family: var(--head); font-weight: 800; font-size: clamp(2rem, 5vw, 2.6rem); margin-bottom: 14px; }
.lead { color: var(--text-2); font-size: 1.02rem; max-width: 520px; margin: 0 auto; }

.section-block { margin-top: 48px; }
.section-tag {
  font-family: var(--mono); font-size: .78rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px;
}

/* ---------- сводка общей ставки ---------- */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.summary-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  text-align: center;
}
.summary-card .sc-val { font-family: var(--head); font-weight: 800; font-size: 1.8rem; color: var(--amber-hi); }
.summary-card .sc-label { color: var(--text-3); font-size: .82rem; margin-top: 4px; }

/* ---------- карточки наций ---------- */
.nation-list { display: flex; flex-direction: column; gap: 10px; }
.nation-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; display: flex; align-items: center; gap: 16px;
  transition: border-color .2s;
}
.nation-card:hover { border-color: var(--line-2); }
.nation-card.at-war { border-color: rgba(224, 87, 74, .4); }
.nation-rank {
  font-family: var(--mono); color: var(--text-3); font-size: .85rem; width: 22px; flex-shrink: 0;
}
.nation-main-badge {
  font-family: var(--mono); font-size: .68rem; color: #1a1208; background: var(--amber);
  padding: 2px 8px; border-radius: 100px; margin-left: 6px; vertical-align: middle;
}
.nation-info { flex: 1; min-width: 0; }
.nation-name { font-family: var(--head); font-weight: 700; font-size: 1.02rem; }
.nation-king { color: var(--text-3); font-size: .82rem; margin-top: 2px; }
.nation-stats { display: flex; gap: 20px; flex-shrink: 0; }
.nation-stat { text-align: right; }
.nation-stat .ns-val { font-family: var(--mono); font-weight: 600; font-size: .95rem; }
.nation-stat .ns-label { color: var(--text-3); font-size: .72rem; }
.nation-stat.rate .ns-val { color: var(--amber-hi); }
.nation-stat.debt .ns-val { color: var(--red); }
.war-tag {
  font-family: var(--mono); font-size: .72rem; color: var(--red);
  border: 1px solid rgba(224, 87, 74, .4); padding: 3px 9px; border-radius: 100px; flex-shrink: 0;
}

.rules-note {
  margin-top: 40px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 24px; color: var(--text-2); font-size: .9rem; line-height: 1.6;
}
.rules-note b { color: var(--amber-hi); }

.empty-state { text-align: center; color: var(--text-3); padding: 40px 0; }

footer { position: relative; z-index: 1; margin-top: 72px; padding: 28px 24px 40px; text-align: center; }
.copy { font-size: .8rem; color: var(--text-3); }

.site-nav { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.site-nav a { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .85rem; font-family: var(--head); font-weight: 600; }
.site-nav a:hover { color: var(--amber-hi); }
.site-nav a.active { color: var(--amber-hi); }
.site-nav svg { width: 16px; height: 16px; }
.site-nav-label { display: none; }

@media (max-width: 640px) {
  .summary-grid { grid-template-columns: 1fr; }
  .nation-card { flex-wrap: wrap; }
  .nation-stats { width: 100%; justify-content: space-between; margin-top: 8px; }
}
