/* ==========================================================================
   Reino de Colombia — DiplomaticaMC rebuild
   Design tokens + shared components + Hero
   Order: tokens → reset/base → layout helpers → buttons → header → hero
   Later sections append below in the same order as the markup.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #07080b;
  --surface: #0e1015;
  --surface-raised: #14161d;

  /* Gold */
  --gold: #d4a017;
  --gold-bright: #f0c14b;
  --gold-line: rgba(212, 160, 23, 0.22);
  --gold-line-strong: rgba(212, 160, 23, 0.45);
  --gold-glow: rgba(212, 160, 23, 0.14);

  /* Text */
  --text: #ece5d8;
  --text-muted: #9d968a;

  /* Type */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape + shadow */
  --radius: 14px;
  --shadow-card: 0 18px 40px -22px rgba(0, 0, 0, 0.8);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Reset / base ---------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
}

p { margin: 0; }

img { max-width: 100%; display: block; }

a { color: inherit; }

::selection {
  background: rgba(212, 160, 23, 0.35);
  color: #fff;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.75rem 1.25rem;
  background: var(--gold);
  color: #14100a;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- 3. Layout helpers -------------------------------------------- */
.container {
  width: min(1160px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

/* Entrance animation helper (JS adds .is-in when element enters view) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001s !important; }
}

/* ---------- 4. Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 0.95rem/1 var(--font-sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: #17120a;
  box-shadow: 0 10px 26px -12px rgba(212, 160, 23, 0.55);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px rgba(240, 193, 75, 0.6);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--gold-line-strong);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
  background: rgba(212, 160, 23, 0.08);
}

.btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* ---------- 5. Header ------------------------------------------------------*/
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s var(--ease-out),
              border-color 0.35s var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--gold-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.brand-crest {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gold-line-strong);
  /* tricolor dot so the brand still reads Colombian without an image */
  background: linear-gradient(180deg,
    var(--gold-bright) 0 50%,
    #2d5da8 50% 75%,
    #c23b33 75% 100%);
  box-shadow: 0 0 12px var(--gold-glow);
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- 6. Hero --------------------------------------------------------*/
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(7.5rem, 14vh, 10rem) 0 clamp(4rem, 6vh, 5rem);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2.5rem, 5vh, 4rem);
}

/* ---------- Homepage entrance animation (index page only) ----------------
   Soft, calm fade-and-rise. The whole hero starts slightly faded and a few
   pixels lower, then eases into place. The flag / coat of arms card appears
   first, followed by a light stagger: title, tagline, buttons, live bar,
   then the stats strip. No bounce, no spin. */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-home .hero-item {
  animation: heroRise 0.8s var(--ease-out) both;
}
/* Crest (flag + coat of arms) leads the entrance */
.page-home .hero-item-crest   { animation-delay: 0.05s; }
/* Then the copy, in a gentle staggered order */
.page-home .hero-item-kicker  { animation-delay: 0.18s; }
.page-home .hero-item-title   { animation-delay: 0.28s; }
.page-home .hero-item-tagline { animation-delay: 0.40s; }
.page-home .hero-item-actions { animation-delay: 0.52s; }
.page-home .hero-item-livebar { animation-delay: 0.64s; }
/* Stats close out the sequence */
.page-home .hero-item-stats   { animation-delay: 0.78s; }
@media (prefers-reduced-motion: reduce) {
  .page-home .hero-item { animation: none; }
}

/* Atmosphere: two soft gold lights + engraved contour lines */
.hero-atmos { position: absolute; inset: 0; pointer-events: none; }

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.glow-a {
  width: 55vw; height: 55vw;
  right: -12vw; top: -18vw;
  background: radial-gradient(circle, rgba(212, 160, 23, 0.16), transparent 65%);
}
.glow-b {
  width: 44vw; height: 44vw;
  left: -14vw; bottom: -10vw;
  background: radial-gradient(circle, rgba(240, 193, 75, 0.09), transparent 65%);
}

.contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: rgba(212, 160, 23, 0.10);
  stroke-width: 1.2;
}

/* Grid: copy left, crest right */
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.hero-title {
  font-size: clamp(3.1rem, 8.5vw, 6.2rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  margin: 1.1rem 0 1.25rem;
  background: linear-gradient(105deg, #fdf6e3 20%, var(--gold-bright) 55%, #b9870f 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  max-width: 46ch;
  color: var(--text-muted);
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.1rem;
}

/* Crest panel: dark card, gold hairline, flag band across the top */
.crest-panel {
  position: relative;
  justify-self: center;
  width: min(340px, 82vw);
  padding: 3.2rem 2rem 1.9rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), 0 0 60px -18px var(--gold-glow);
  text-align: center;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.crest-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 0 80px -14px rgba(212, 160, 23, 0.28);
}

.flag-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  display: flex;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
}
.flag-yellow { flex: 2; background: #fcd116; }
.flag-blue   { flex: 1; background: #003893; }
.flag-red    { flex: 1; background: #ce1126; }

.crest-frame {
  width: 210px;
  height: 210px;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line-strong);
  background: radial-gradient(circle at 50% 42%, rgba(212, 160, 23, 0.12), transparent 70%);
}
.crest-img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}

.crest-caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--text-muted);
}
.crest-caption::before,
.crest-caption::after {
  content: "";
  display: inline-block;
  width: 34px;
  height: 1px;
  background: var(--gold-line-strong);
  vertical-align: middle;
  margin: 0 0.8rem;
}

/* Stat strip: one bordered card, three numbers */
.stat-strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 1.3rem 2.2rem 1.15rem;
  background: rgba(14, 16, 21, 0.72);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 84px;
  text-align: center;
}
.stat-label { white-space: nowrap; }
.stat-value {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 44px;
  background: var(--gold-line);
}

.stat-updated {
  position: absolute;
  bottom: -1.7rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.stat-updated:not(:empty)::before {
  content: "● ";
  color: var(--gold);
  font-size: 0.55rem;
  vertical-align: 2px;
}

/* ---------- 6b. Hero responsive -------------------------------------------*/
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-tagline { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .crest-panel { order: -1; width: min(300px, 78vw); }
}

@media (max-width: 560px) {
  .stat-strip {
    gap: 1rem;
    padding: 1.1rem 1.1rem 1rem;
    width: 100%;
    justify-content: space-between;
  }
  .stat { min-width: 0; }
  /* On very narrow screens the long labels may wrap — keep them centered. */
  .stat-label { white-space: normal; text-align: center; }
  .stat-divider { height: 36px; }
}

/* ==========================================================================
   REBUILT CONTENT SECTIONS — the classic Empire stuff (capital, towns,
   map, wiki, cabinet, citizens, grants) restyled in the premium look.
   ========================================================================== */

/* ---------- Shared section scaffolding ---------------------------------- */
.section { padding: clamp(4.5rem, 9vh, 7rem) 0; }
.section.alt { background: var(--surface); }

.container.narrow { width: min(920px, calc(100% - 2.5rem)); }

.section-head { margin-bottom: clamp(2.5rem, 5vh, 3.5rem); max-width: 62ch; }
.section-head.centered { margin-inline: auto; text-align: center; }

.section-title {
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  margin: 0.6rem 0 0.9rem;
}
.section-desc { color: var(--text-muted); font-size: 1.02rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-muted); }

/* Region tag colours, shared across brochure + town cards */
.tag-caribbean { background: #1d4e8a; }
.tag-colombia  { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: #17120a; }
.tag-central   { background: #2a6b6b; }

/* ---------- Nav links + mobile menu -------------------------------------- */
.site-nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 1.6rem); }
.site-nav a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.site-nav a:hover,
.site-nav a.active { color: var(--gold-bright); border-bottom-color: var(--gold-line-strong); }
.site-nav .nav-pill {
  color: #17120a;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  border-bottom: none;
}
.site-nav .nav-pill:hover { color: #17120a; transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 10px;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--gold-bright);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-scrim {
  position: fixed; inset: 0; z-index: 48;
  background: rgba(7, 8, 11, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

@media (max-width: 1080px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 49;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
    width: min(320px, 84vw);
    padding: 6rem 2rem 2rem;
    background: var(--surface-raised);
    border-left: 1px solid var(--gold-line);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease-out);
    overflow-y: auto;
  }
  .site-nav.open { transform: none; }
  .site-nav a { font-size: 1.05rem; color: var(--text); }
}

/* ---------- Live bar (server status / copy IP / Discord) ----------------- */
.live-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}
@media (max-width: 900px) { .live-bar { justify-content: center; } }

.status-pill,
.copy-ip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(14, 16, 21, 0.72);
  color: var(--text);
  font: 500 0.82rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.25s var(--ease-out), background-color 0.25s var(--ease-out);
}
.status-pill:hover, .copy-ip-btn:hover { border-color: var(--gold-line-strong); }
.copy-ip-btn.copied { border-color: var(--gold-bright); background: rgba(212, 160, 23, 0.12); }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 8px rgba(157, 150, 138, 0.5);
}
.status-dot.online { background: #3fbf6f; box-shadow: 0 0 8px rgba(63, 191, 111, 0.7); }
.status-dot.offline { background: #d05045; box-shadow: 0 0 8px rgba(208, 80, 69, 0.7); }
.status-dot.discord { background: #5865f2; box-shadow: 0 0 8px rgba(88, 101, 242, 0.7); }

/* ---------- 2. Capital ----------------------------------------------------*/
.capital-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: stretch;
}

.capital-media {
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gold-line);
  box-shadow: var(--shadow-card);
}
.capital-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.6s var(--ease-out);
}
.capital-media:hover img { transform: scale(1.03); }
.capital-badge {
  position: absolute;
  left: 1rem; bottom: 1rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(7, 8, 11, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid var(--gold-line-strong);
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.capital-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.district-tabs { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; }
.district-tab {
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--text-muted);
  font: 600 0.85rem/1 var(--font-sans);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.district-tab:hover { border-color: var(--gold-line-strong); color: var(--text); }
.district-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #17120a;
  border-color: transparent;
}

.district-panel { display: none; }
.district-panel.active { display: block; animation: fadeIn 0.4s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.district-panel h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.district-panel p { color: var(--text-muted); }

@media (max-width: 900px) {
  .capital-split { grid-template-columns: 1fr; }
}

/* ---------- 3. Towns ------------------------------------------------------*/
.towns-footnote {
  margin-top: clamp(2.5rem, 5vh, 3.5rem);
  text-align: center;
  max-width: 60ch;
  margin-inline: auto;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 1.1rem 1.6rem;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(14, 16, 21, 0.55);
}
.towns-footnote a { color: var(--gold-bright); font-weight: 600; text-decoration: none; }
.towns-footnote a:hover { text-decoration: underline; }

.brochure { position: relative; }
.brochure-viewport { overflow: hidden; border-radius: var(--radius); }
.brochure-track {
  display: flex;
  transition: transform 0.55s var(--ease-out);
}
.brochure-slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.brochure-shot { position: relative; min-height: 320px; }
.brochure-shot img { width: 100%; height: 100%; object-fit: cover; }
.brochure-tag {
  position: absolute; top: 1rem; left: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}
.brochure-copy { padding: clamp(1.5rem, 4vw, 2.6rem); display: flex; flex-direction: column; justify-content: center; }
.brochure-copy h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 0.4rem; }
.brochure-meta {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 0.9rem;
}
.brochure-copy > p:last-child { color: var(--text-muted); }

.brochure-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold-line-strong);
  background: rgba(7, 8, 11, 0.7);
  backdrop-filter: blur(4px);
  color: var(--gold-bright);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.brochure-nav:hover { background: var(--gold); color: #17120a; }
.brochure-prev { left: 0.8rem; }
.brochure-next { right: 0.8rem; }

.brochure-dots { display: flex; justify-content: center; gap: 0.6rem; margin-top: 1.4rem; }
.brochure-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--gold-line-strong);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s var(--ease-out);
}
.brochure-dot.active { background: var(--gold-bright); transform: scale(1.25); }

@media (max-width: 780px) {
  .brochure-slide { grid-template-columns: 1fr; }
  .brochure-shot { min-height: 220px; }
}

.town-cards {
  margin-top: clamp(3rem, 6vh, 4.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.6rem;
}
.town-card {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.town-card:hover, .town-card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--gold-line-strong);
  box-shadow: var(--shadow-card), 0 0 50px -18px var(--gold-glow);
}
.town-shot { position: relative; }
.town-shot img { width: 100%; height: 190px; object-fit: cover; }
.region-tag {
  position: absolute; top: 0.8rem; left: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}
.town-body { padding: 1.3rem 1.4rem 1.5rem; }
.town-body h3 {
  font-size: 1.5rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem;
  margin-bottom: 0.5rem;
}
.mayor-line {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: rgba(212, 160, 23, 0.1);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}
.town-body p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0.9rem; }
.town-link {
  color: var(--gold-bright);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.town-link:hover { text-decoration: underline; }

/* ---------- 4. Map --------------------------------------------------------*/
.map-frame {
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 80px -30px var(--gold-glow);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
}
.map-frame-head {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--gold-line);
  background: rgba(212, 160, 23, 0.06);
}
.map-frame-title { font-weight: 600; font-size: 0.92rem; }
.map-frame-coords {
  margin-left: auto;
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
@media (max-width: 640px) { .map-frame-coords { display: none; } }
.map-box { background: var(--surface); }
.map-box iframe { display: block; border: 0; min-height: 420px; }

/* ---------- 5. Wiki widget -------------------------------------------------*/
.wiki-widget {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.wiki-widget-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--gold-line);
  background: rgba(212, 160, 23, 0.06);
}
.wtag {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #17120a;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  padding: 0.3rem 0.8rem; border-radius: 999px;
}
.wlogo { font-size: 0.82rem; color: var(--text-muted); letter-spacing: 0.04em; }
.wiki-widget-body { padding: 1.6rem; display: flex; gap: 1.6rem; align-items: flex-start; }
.wiki-widget-body img {
  width: 180px; border-radius: 10px;
  border: 1px solid var(--gold-line);
  object-fit: cover;
}
.wiki-widget-text h3 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.wiki-widget-text p { color: var(--text-muted); margin-bottom: 1rem; }
.wiki-widget-text a { color: var(--gold-bright); font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.wiki-widget-text a:hover { text-decoration: underline; }
@media (max-width: 640px) { .wiki-widget-body { flex-direction: column; } .wiki-widget-body img { width: 100%; } }

/* ---------- 6. Cabinet -----------------------------------------------------*/
.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.4rem;
}
.gov-pill-wide { grid-column: 1 / -1; max-width: 420px; margin-inline: auto; }

/* Crown pills sit on their own gold-tinted row above the ministries */
.gov-pill-crown {
  grid-column: span 2;
  border-color: var(--gold-line-strong);
  background:
    radial-gradient(420px 160px at 20% 0%, rgba(212, 160, 23, 0.12), transparent 70%),
    linear-gradient(180deg, var(--surface-raised), var(--surface));
}
.gov-pill-crown h4 { color: var(--gold-bright); }
@media (max-width: 640px) { .gov-pill-crown { grid-column: 1 / -1; } }

/* The Crown row holds exactly two sovereign pills. Force it to two equal
   tracks and cap the row width, then center it with auto margins — same
   pattern as .gov-pill-wide — so it can never sit off to the left. */
.cabinet-grid:has(.gov-pill-crown) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: calc((100% - 1.4rem) / 3 * 2 + 1.4rem); /* ≈ two full-width crown pills */
  margin-inline: auto;
}
@media (max-width: 900px) {
  .cabinet-grid:has(.gov-pill-crown) { max-width: 100%; }
}
@media (max-width: 640px) {
  .cabinet-grid:has(.gov-pill-crown) { grid-template-columns: 1fr; }
}
/* Fallback for browsers without :has(): center the two crown pills by
   capping each at half the row width with auto margins. */
@supports not (selector(:has(*))) {
  .gov-pill-crown { max-width: calc(50% - 0.7rem); margin-inline: auto; }
}

/* Citizen-list "The Crown" section — same clean ordering/centering as the
   Cabinet list: two equal sovereign cards, evenly spaced and centered. */
.leader-grid-crown {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: calc((100% - 1.1rem) / 3 * 2 + 1.1rem); /* ≈ two full-width crown cards */
  margin-inline: auto;
}
@media (max-width: 900px) {
  .leader-grid-crown { max-width: 100%; }
}
@media (max-width: 560px) {
  .leader-grid-crown { grid-template-columns: 1fr; }
}

/* Cabinet citizen-list — four equal minister cards, evenly spaced and
   centered (auto-fit collapses empty tracks so the row stays symmetric). */
.leader-grid-cabinet {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  max-width: 430px; /* two cabinet-style cards + the 1.1rem gap */
  margin-inline: auto;
}
@media (max-width: 560px) {
  .leader-grid-crown { grid-template-columns: 1fr; max-width: 215px; }
}

/* Cabinet citizen-list — four equal minister cards, evenly spaced and
   centered (auto-fit collapses empty tracks so the row stays symmetric). */
.leader-grid-cabinet {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  max-width: 860px;
  margin-inline: auto;
}

.gov-pill {
  position: relative;
  padding: 1.8rem 1.6rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.gov-pill::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(320px circle at var(--sx, 50%) var(--sy, 50%), rgba(212, 160, 23, 0.10), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.gov-pill:hover::before { opacity: 1; }
.gov-pill:hover, .gov-pill:focus-within { transform: translateY(-4px); border-color: var(--gold-line-strong); }
.gov-pill > * { position: relative; }

/* Cabinet tiers — Crown / Senior Ministry / Ministries */
.cabinet-tier {
  display: flex; align-items: center; gap: 1.1rem;
  margin: 2.6rem 0 1.3rem;
}
.cabinet-grid + .cabinet-tier { margin-top: 3rem; }
.cabinet-tier:first-of-type { margin-top: 0; }
.tier-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-bright); white-space: nowrap;
}
.tier-rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--gold-line-strong), transparent);
}
.cabinet-grid-senior { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.gov-pill-senior {
  border-color: rgba(212, 160, 23, 0.35);
  background:
    radial-gradient(420px 160px at 80% 0%, rgba(212, 160, 23, 0.08), transparent 70%),
    linear-gradient(180deg, var(--surface-raised), var(--surface));
}
/* Pills wired to the profile modal (js/sections.js) */
.gov-pill-link { cursor: pointer; }
.gov-pill-link:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.gov-pill-link::after {
  content: "View profile \2192";
  position: absolute; right: 1.4rem; bottom: 1.2rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-bright);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gov-pill-link:hover::after, .gov-pill-link:focus-visible::after { opacity: 0.9; transform: none; }

.medallion {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--gold-line-strong);
  background: radial-gradient(circle at 50% 40%, rgba(212, 160, 23, 0.16), transparent 72%);
  margin-bottom: 1rem;
}
.gov-pill h4 { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; margin: 0 0 0.25rem; }
.minister-name {
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 0.6rem;
}
.gov-pill p:last-child { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- 7. Citizens / roster -------------------------------------------*/
.roster-live-badge {
  display: inline-block;
  margin-left: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  background: rgba(212, 160, 23, 0.1);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  vertical-align: middle;
}

.roster-toolbar { margin-bottom: 2.5rem; }
.roster-search-wrap { position: relative; max-width: 520px; margin: 0 auto 1.3rem; }
.roster-search-icon {
  position: absolute; left: 1.15rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.roster-clear {
  position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid transparent; background: transparent;
  color: var(--text-muted); font-size: 0.8rem; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: all 0.25s var(--ease-out);
}
.roster-clear:hover { color: var(--gold-bright); border-color: var(--gold-line); }
.roster-search-wrap.has-value .roster-clear { display: flex; }
.roster-search {
  width: 100%;
  padding: 0.9rem 3rem 0.9rem 3rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(14, 16, 21, 0.8);
  color: var(--text);
  font: 400 0.95rem/1.4 var(--font-sans);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.roster-search::placeholder { color: var(--text-muted); }
.roster-search:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

.roster-subhead {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.4rem 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gold-line);
}
.roster-subhead:first-of-type { margin-top: 0; }

.leader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.1rem;
}
.citizen-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.4rem;
  padding: 1.4rem 1rem 1.2rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}
.citizen-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(200px circle at var(--sx, 50%) var(--sy, 50%), rgba(212, 160, 23, 0.12), transparent 70%);
  opacity: 0; transition: opacity 0.35s ease;
  pointer-events: none;
}
.citizen-card:hover::before, .citizen-card:focus-visible::before { opacity: 1; }
.citizen-card:hover, .citizen-card:focus-visible { transform: translateY(-4px); border-color: var(--gold-line-strong); }
.citizen-card > * { position: relative; }
.citizen-card img {
  width: 64px; height: 64px;
  border-radius: 10px;
  image-rendering: pixelated;
  border: 1px solid var(--gold-line);
}
.citizen-card .name { font-weight: 600; font-size: 0.95rem; }
.citizen-card .role { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.citizen-tier {
  margin-top: 0.15rem;
  padding: 0.18rem 0.6rem;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  color: var(--gold-bright);
  background: rgba(212, 160, 23, 0.08);
}
.citizen-tier-ministry { color: var(--text-muted); background: transparent; }
.leader-grid-crown .citizen-card { border-color: var(--gold-line-strong); }
.leader-grid-crown .citizen-card .role { color: var(--gold-bright); }
.citizen-card.hidden { display: none; }

.towns-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.3rem;
}
.town-roster-card {
  position: relative;
  padding: 1.3rem 1.4rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.35s var(--ease-out);
}
.town-roster-card:hover { border-color: var(--gold-line-strong); }
.town-roster-card::after {
  content: "";
  position: absolute; bottom: 10px; right: 10px;
  width: 14px; height: 14px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  opacity: 0;
  transform: translate(6px, 6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.town-roster-card:hover::after { opacity: 0.6; transform: none; }

.town-roster-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.9rem; }
.town-roster-head h4 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; margin: 0; }
.town-roster-count { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }

.town-mayor-row {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.town-mayor-row:hover, .town-mayor-row:focus-visible {
  background: rgba(212, 160, 23, 0.08);
  border-color: var(--gold-line);
}
.town-mayor-row img { width: 36px; height: 36px; border-radius: 8px; image-rendering: pixelated; }
.mayor-info .name { font-weight: 600; font-size: 0.9rem; }
.mayor-info .tag { font-size: 0.75rem; color: var(--gold-bright); }

.town-residents-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
.resident-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.7rem 0.28rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(14, 16, 21, 0.6);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.resident-chip:hover, .resident-chip:focus-visible { color: var(--text); border-color: var(--gold-line-strong); }
.resident-chip img { width: 20px; height: 20px; border-radius: 50%; image-rendering: pixelated; }
.resident-chip.roster-hidden, .town-roster-card.roster-hidden { display: none; }

.town-no-others { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.7rem; font-style: italic; }
.roster-empty { display: none; text-align: center; color: var(--text-muted); margin-top: 2rem; }
.roster-empty.show { display: block; }

.img-skeleton {
  background: linear-gradient(100deg, var(--surface-raised) 30%, #1b2230 50%, var(--surface-raised) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 8. Grants — premium petition form ------------------------------*/
.grant-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}
@media (max-width: 900px) { .grant-grid { grid-template-columns: 1fr; } }

.grant-terms {
  position: sticky;
  top: 6.5rem;
  padding: clamp(1.8rem, 4vw, 2.4rem);
  background:
    radial-gradient(500px 180px at 30% 0%, rgba(212, 160, 23, 0.12), transparent 70%),
    linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), 0 0 80px -30px var(--gold-glow);
}
@media (max-width: 900px) { .grant-terms { position: static; } }

.grant-terms .grant-amount {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  background: linear-gradient(105deg, #fdf6e3 20%, var(--gold-bright) 55%, #b9870f 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grant-list { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: 0.9rem; }
.grant-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-left: 1.2rem;
  position: relative;
}
.grant-list li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 7px; height: 7px; border-radius: 2px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  transform: rotate(45deg);
}
.grant-list strong { color: var(--text); font-weight: 600; }

.card-premium {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.grant-form {
  padding: clamp(1.6rem, 4vw, 2.4rem);
  border-color: var(--gold-line-strong);
  box-shadow: var(--shadow-card), 0 0 80px -34px var(--gold-glow);
}
.grant-form-title {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.6rem;
}
.grant-form-title h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem; font-weight: 600; margin: 0;
}
.grant-step-badge {
  flex-shrink: 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-bright);
  border: 1px solid var(--gold-line-strong);
  border-radius: 999px;
  background: rgba(212, 160, 23, 0.08);
  white-space: nowrap;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.1rem; min-width: 0; }
.field-half { flex: 1; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.req { color: var(--gold-bright); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--gold-line);
  background: rgba(7, 8, 11, 0.6);
  color: var(--text);
  font: 400 0.95rem/1.5 var(--font-sans);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.field textarea { resize: vertical; min-height: 110px; }
.field select { appearance: none; cursor: pointer; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: #d05045;
  box-shadow: 0 0 0 3px rgba(208, 80, 69, 0.15);
}
.field-error { min-height: 1.2rem; font-size: 0.78rem; color: #e57b70; margin-top: 0.3rem; }

.grant-form-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.4rem; }
.grant-form-note { font-size: 0.85rem; color: var(--text-muted); }
.grant-form-note.error { color: #e57b70; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none !important; }

.grant-success {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(2.2rem, 5vh, 3.2rem) clamp(1.5rem, 5vw, 3rem);
}
.grant-success-mark {
  width: 64px; height: 64px;
  margin: 0 auto 1.2rem;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 1.7rem;
  color: #17120a;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 40px -8px rgba(212, 160, 23, 0.6);
}
.grant-success h3 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.grant-success p { color: var(--text-muted); max-width: 52ch; margin: 0 auto 1.6rem; }
.grant-success-actions { display: flex; justify-content: center; gap: 0.9rem; flex-wrap: wrap; }
.grant-again {
  margin-top: 1.4rem;
  background: none; border: none; cursor: pointer;
  color: var(--gold-bright);
  font: 600 0.85rem var(--font-sans);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ----------------------------------------------------------*/
.site-footer {
  border-top: 1px solid var(--gold-line);
  background: var(--surface);
  padding: 3.5rem 0 3rem;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; text-align: center; }
.footer-brand { font-size: 1.4rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.6rem; max-width: 760px; }
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.25s var(--ease-out);
}
.footer-nav a:hover { color: var(--gold-bright); }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Back to top + toast --------------------------------------------*/
.back-to-top {
  position: fixed;
  right: 1.4rem; bottom: 1.4rem;
  z-index: 40;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold-line-strong);
  background: rgba(14, 16, 21, 0.85);
  backdrop-filter: blur(6px);
  color: var(--gold-bright);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.35s var(--ease-out);
}
.back-to-top.visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--gold); color: #17120a; }

/* ---------- Imperial sound system (site-wide) ----------------------------*/
#sound-toggle {
  position: fixed;
  left: 1.4rem; bottom: 1.4rem;
  z-index: 45;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line-strong);
  background: rgba(14, 16, 21, 0.85);
  backdrop-filter: blur(6px);
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, 0.8);
  transition: all 0.35s var(--ease-out);
}
#sound-toggle:hover { background: var(--gold); color: #17120a; }
#sound-toggle:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
#sound-toggle .snd-icon { display: none; flex-shrink: 0; }
html:not(.is-muted) #sound-toggle .snd-on { display: block; }
html.is-muted #sound-toggle .snd-off { display: block; }
@media (max-width: 560px) {
  #sound-toggle { left: 1rem; bottom: 1rem; padding: 0.55rem 0.8rem; }
  #sound-toggle .snd-label { display: none; }
}

.toast {
  position: fixed;
  left: 50%; bottom: 2rem;
  transform: translate(-50%, 20px);
  z-index: 60;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--gold-line-strong);
  color: var(--text);
  font-size: 0.88rem;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Profile modal ---------------------------------------------------*/
.profile-overlay {
  position: fixed; inset: 0;
  z-index: 70;
  display: none;
  align-items: center; justify-content: center;
  padding: 1.5rem;
  background: rgba(7, 8, 11, 0.8);
  backdrop-filter: blur(4px);
}
.profile-overlay.open { display: flex; }
.profile-modal {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: fadeIn 0.3s var(--ease-out);
}
.profile-head { position: relative; padding: 2.4rem 1.8rem 1.2rem; text-align: center; }
.profile-close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.profile-close:hover { color: var(--gold-bright); border-color: var(--gold-bright); }
.profile-head img {
  width: 96px; height: 96px;
  margin: 0 auto 0.9rem;
  border-radius: 14px;
  image-rendering: pixelated;
  border: 1px solid var(--gold-line-strong);
}
.p-name { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; }
.p-role { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-bright); margin-top: 0.2rem; }
.profile-body { padding: 0 1.8rem 1.8rem; }
.p-bio { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.2rem; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1.2rem; }
.fact { padding: 0.8rem 1rem; border: 1px solid var(--gold-line); border-radius: 10px; background: rgba(14, 16, 21, 0.6); }
.fk { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.fv { font-weight: 600; font-size: 0.92rem; }
.profile-unverified { font-size: 0.72rem; color: var(--text-muted); font-style: italic; }

/* ============================================================
   V. CABINET TIERS (final pass) — Crown / Cabinet, clean hierarchy
   ============================================================ */
/* Four ministries on one even row: four equal tracks, capped width and
   centered — no leftover gap columns, no uneven spacing. */
.cabinet-grid-ministers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1120px;
  margin-inline: auto;
}
@media (max-width: 1100px) { .cabinet-grid-ministers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cabinet-grid-ministers { grid-template-columns: 1fr; } }

/* "Senior" vs regular ministry pills are no longer distinguished — the
   Senior Cabinet labels are gone, so all four minister cards look alike. */
.gov-pill-senior { border-color: var(--gold-line); background: linear-gradient(180deg, var(--surface-raised), var(--surface)); }

/* ============================================================
   VI. DIPLOMACY SUBPAGE — China-only relations, premium cards
   ============================================================ */
.relations-grid-solo { max-width: 860px; margin-inline: auto; display: grid; gap: 1.5rem; }
.relation-card-hero {
  position: relative; overflow: hidden; text-align: left; padding: 2.4rem 2.2rem;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(212,160,23,0.10), rgba(20,22,29,0.9) 45%), #0e1015;
  border: 1px solid rgba(212,160,23,0.45);
  box-shadow: 0 18px 44px -22px rgba(0,0,0,0.8), 0 0 24px rgba(212,160,23,0.08);
}
.relation-card-hero::after {
  content: '\2605'; position: absolute; right: 1.2rem; bottom: -1.4rem; font-size: 7rem;
  color: rgba(212,160,23,0.08); pointer-events: none; line-height: 1;
}
.relation-card-hero h3 { font-size: 2rem; margin: 0.6rem 0 0.7rem; color: #f3e9d7; }
.relation-card-hero p { color: #b7ac97; line-height: 1.7; max-width: 60ch; }
.relation-card-wide {
  text-align: left; padding: 1.8rem 2rem; border-radius: 16px;
  background: linear-gradient(180deg, #14161d, #0e1015);
  border: 1px solid rgba(212,160,23,0.22);
  box-shadow: 0 18px 40px -22px rgba(0,0,0,0.8);
}
.relation-card-wide h3 { font-size: 1.4rem; margin: 0.5rem 0 0.5rem; color: #f3e9d7; }
.relation-card-wide p { color: #9a8f7c; line-height: 1.7; }
.treaty-doc-featured {
  max-width: 760px; margin-inline: auto;
  border: 1px solid rgba(212,160,23,0.45) !important;
  background: linear-gradient(150deg, rgba(212,160,23,0.08), rgba(20,22,29,0.9) 50%), #0e1015 !important;
  box-shadow: 0 22px 50px -24px rgba(0,0,0,0.85), 0 0 26px rgba(212,160,23,0.08);
}
.treaty-doc-featured .treaty-doc-body { padding: 2.2rem; }
.treaty-doc-featured h3 { font-size: 1.7rem; color: #f3e9d7; }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.9rem; margin-top: 1.1rem; display: inline-block; }

/* ==========================================================================
   Sub-page shared chrome — Chronicles + Sports Federation
   Mirrors the main page hero/section styling exactly: same tokens, same
   eyebrow caps, same serif display sizes, same card surfaces.
   ========================================================================== */
.chronicles-hero,
.sports-hero {
  position: relative;
  padding: clamp(7rem, 14vh, 9rem) 0 clamp(3.5rem, 7vh, 4.5rem);
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, var(--gold-glow), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(29, 78, 138, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.chronicles-hero::before,
.sports-hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent 75%);
}
.chronicles-hero-inner,
.sports-hero-inner { position: relative; text-align: center; }

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 1.1rem;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: '\2014'; color: var(--gold-line-strong); margin: 0 0.75em;
}

.chronicles-title,
.sports-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.005em;
  color: var(--text);
  margin: 0 auto 1.2rem;
  max-width: 18ch;
  background: linear-gradient(105deg, #fdf6e3 20%, var(--gold-bright) 55%, #b9870f 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.chronicles-lede,
.sports-lede {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 62ch;
  margin: 0 auto;
}

.sub-strip { height: 12px; width: 100%; opacity: 0.85;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12'%3E%3Cpath fill='%23d4a017' d='M0 6 L8 0 L16 6 L8 12 Z'/%3E%3Cpath fill='%232a6b6b' d='M16 6 L24 0 L32 6 L24 12 Z'/%3E%3Cpath fill='%23b85c38' d='M32 6 L40 0 L48 6 L40 12 Z'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 48px 12px; }

/* Premium sub-page section header (same rhythm as .section-head on index) */
.sub-section { padding: clamp(4.5rem, 9vh, 7rem) 0; }
.sub-section.alt { background: var(--surface); }
.sub-head { margin-bottom: clamp(2.5rem, 5vh, 3.5rem); text-align: center; }
.sub-head .section-title { font-family: var(--font-serif); font-size: clamp(2.1rem, 4.5vw, 3.2rem); margin: 0.4rem 0 0.9rem; color: var(--text); }
.sub-head .section-desc { color: var(--text-muted); font-size: 1.02rem; max-width: 62ch; margin-inline: auto; }

/* Chronicle ledger cards — main-page surface + hairline + shadow language */
.chronicle-list { max-width: 780px; margin: 0 auto; display: grid; gap: 1.4rem; }
.chronicle-card {
  background: linear-gradient(160deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.9rem 2rem;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.chronicle-card:hover {
  border-color: var(--gold-line-strong);
  transform: translateY(-3px);
  box-shadow: 0 22px 48px -20px rgba(0,0,0,0.85), 0 0 24px var(--gold-glow);
}
.chronicle-era {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-bright); margin-bottom: 0.5rem;
}
.chronicle-era::before { content: ''; width: 22px; height: 1px; background: var(--gold-line-strong); }
.chronicle-date { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.chronicle-card h3 { font-family: var(--font-serif); font-size: 1.45rem; color: var(--text); margin-bottom: 0.55rem; }
.chronicle-card p { color: var(--text-muted); font-size: 0.97rem; line-height: 1.7; }

.chronicle-quote {
  text-align: center; max-width: 640px; margin: 3.5rem auto 0; padding: 2.2rem 1.5rem;
  border-top: 1px solid var(--gold-line); border-bottom: 1px solid var(--gold-line);
}
.chronicle-quote p { font-family: var(--font-serif); font-style: italic; font-size: 1.35rem; color: var(--gold-bright); margin-bottom: 0.7rem; }
.chronicle-quote span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }

/* Sports team cards — same premium card language */
.team-grid-premium { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.6rem; }
.team-premium {
  background: linear-gradient(160deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2.6rem 2rem 2.2rem;
  text-align: center;
  position: relative; overflow: hidden;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.team-premium::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold-bright) 50%, var(--gold) 70%, transparent);
  opacity: 0.7;
}
.team-premium:hover {
  border-color: var(--gold-line-strong);
  transform: translateY(-4px);
  box-shadow: 0 24px 52px -20px rgba(0,0,0,0.85), 0 0 28px var(--gold-glow);
}
.team-crest-ring {
  width: 118px; height: 118px; margin: 0 auto 1.5rem; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--gold-line-strong);
  background: radial-gradient(circle at 35% 30%, var(--surface-raised), var(--bg));
  box-shadow: 0 0 0 6px rgba(212,160,23,0.06), 0 10px 26px -12px rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
}
.team-crest-ring img { width: 100%; height: 100%; object-fit: cover; }
.team-premium h3 { font-family: var(--font-serif); font-size: 1.5rem; color: var(--text); margin-bottom: 0.35rem; }
.team-league { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-bright); margin-bottom: 1rem; }
.team-blurb { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; margin-bottom: 1.2rem; }
.team-tag {
  display: inline-block; padding: 0.35rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--gold-line-strong); background: rgba(212,160,23,0.08);
  color: var(--gold-bright); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}

/* Tryouts CTA panel — mirrors the grants/terms card treatment */
.tryouts-panel {
  background: linear-gradient(160deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold-line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), 0 0 32px var(--gold-glow);
  padding: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  max-width: 760px; margin: 0 auto;
}
.tryouts-panel h2 { font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--text); margin: 0.4rem 0 1rem; }
.tryouts-panel p { color: var(--text-muted); font-size: 1.02rem; max-width: 56ch; margin: 0 auto 1.8rem; }

@media (prefers-reduced-motion: reduce) {
  .chronicle-card, .team-premium { transition: none; }
  .chronicle-card:hover, .team-premium:hover { transform: none; }
}
