/* Dying Star page: the game's own look — charcoal and navy, one amber accent,
   cream "official notice" paper — sitting inside the studio site. */
@font-face { font-family: "Cinzel"; src: url("/fonts/cinzel-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/fonts/cinzel-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }

body.game {
  --night: #0d1018;
  --panel: #151a26;
  --line: #262d3d;
  --ink: #ece7dc;
  --muted: #9aa0b0;
  --amber: #ffb547;
  --ember: #ff5a36;
  --paper: #ece4d2;
  --paper-ink: #2a2622;
  background: var(--night);
}
.game .top { position: static; background: var(--night); border-bottom: 1px solid var(--line); }
.game .badge { box-shadow: 0 0 8px var(--ember), inset 0 0 6px rgba(255, 90, 54, .4); border-color: var(--ember); text-shadow: 0 0 6px var(--ember); }
.game .top nav a { text-shadow: none; color: var(--muted); }
.game .top nav a:hover { color: #fff; }
.game a { color: var(--amber); }
.game a:hover { color: #fff; }

/* ---------- Banner ---------- */
.ds-hero { position: relative; isolation: isolate; overflow: hidden; }
.ds-hero picture img { display: block; width: 100%; height: clamp(360px, 62vh, 620px); object-fit: cover; object-position: center 40%; }
.ds-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(13, 16, 24, 0) 30%, rgba(13, 16, 24, .75) 72%, var(--night) 100%);
}
.ds-hero .wrap { position: absolute; left: 0; right: 0; bottom: 34px; z-index: 2; }
.ds-hero .ident { display: flex; align-items: center; gap: 20px; }
.ds-hero .ident img { width: 84px; height: 84px; border-radius: 18px; box-shadow: 0 0 0 1px #3a2214, 0 0 30px rgba(255, 90, 54, .5); }
.ds-title {
  font-family: "Cinzel", Georgia, serif; font-weight: 900;
  font-size: clamp(2.5rem, 8.5vw, 6rem); line-height: 1; margin: 0; color: #fff3df;
  letter-spacing: .05em;
  text-shadow: 0 2px 0 #000, 0 0 40px rgba(255, 90, 54, .55);
}
.ds-tag { font-size: clamp(1.1rem, 2.6vw, 1.4rem); margin: 18px 0 16px; max-width: 34ch; }
.ds-hero .status { color: var(--amber); border-color: rgba(255, 181, 71, .6); background: rgba(13, 16, 24, .6); }

/* ---------- Contents ---------- */
.toc { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 22px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.toc ul::-webkit-scrollbar { display: none; }
.toc a { display: block; padding: 13px 0; color: var(--muted); text-decoration: none; font-size: .97rem; }
.toc a:hover { color: #fff; }

/* ---------- Body ---------- */
.ds section { padding: 72px 0; border-top: 1px solid var(--line); }
.ds section:first-of-type { border-top: 0; }
.ds h2 {
  font-family: "Cinzel", Georgia, serif; font-weight: 700;
  font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.15;
  color: #fff3df; text-shadow: none; margin: 0 0 28px; letter-spacing: .03em;
}
/* An engraved rule under each heading: line, diamond, line */
.ds h2::after {
  content: ""; display: block; width: 132px; height: 10px; margin-top: 14px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22132%22%20height%3D%2210%22%3E%3Cg%20fill%3D%22%23ffb547%22%3E%3Crect%20x%3D%220%22%20y%3D%224.5%22%20width%3D%2256%22%20height%3D%221%22/%3E%3Crect%20x%3D%2276%22%20y%3D%224.5%22%20width%3D%2256%22%20height%3D%221%22/%3E%3Crect%20x%3D%2261.5%22%20y%3D%220.5%22%20width%3D%229%22%20height%3D%229%22%20transform%3D%22rotate%2845%2066%205%29%22/%3E%3C/g%3E%3C/svg%3E") no-repeat; opacity: .85;
}
.ds h3 { font-size: 1.2rem; margin: 0 0 6px; color: #fff; }
.ds p, .ds li { max-width: 66ch; }
.ds .lead { font-size: 1.2rem; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }

/* Official notice: the satirical voice of the empire, on cream paper */
.notice {
  background: var(--paper); color: var(--paper-ink); border-radius: 4px; padding: 26px 28px 22px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); transform: rotate(-1deg); position: relative;
  max-width: 440px;
  background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 5px 5px;
}
.notice h3 { color: var(--paper-ink); font-family: "Cinzel", Georgia, serif; font-weight: 900; font-size: 1.25rem; letter-spacing: .04em; margin-bottom: 12px; padding-right: 56px; }
.notice p { margin: 0 0 10px; }
.notice .stamp {
  display: inline-block; margin-top: 6px; padding: 3px 10px; border: 2px solid #b0321c; color: #b0321c;
  font-weight: 700; transform: rotate(-4deg); border-radius: 3px;
}
.notice img.seal-mini { position: absolute; right: -22px; top: -26px; width: 84px; height: 84px; border-radius: 50%; transform: rotate(8deg); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }

/* Generator ladder: a real sequence, so it's numbered */
.ladder { list-style: none; counter-reset: tier; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ladder li { counter-increment: tier; background: var(--panel); padding: 20px 22px; }
.ladder li::before { content: "Tier " counter(tier); display: block; color: var(--amber); font-size: .9rem; margin-bottom: 4px; }
.ladder strong { display: block; font-size: 1.1rem; color: #fff; }
.ladder span { color: var(--muted); font-size: .97rem; }

/* Integrity meter illustrating the two decay layers */
.meter { margin: 26px 0 8px; max-width: 520px; }
.meter .bar { height: 14px; border-radius: 999px; background: #0a0c12; border: 1px solid var(--line); overflow: hidden; }
.meter .fill { height: 100%; width: 38%; background: linear-gradient(90deg, #7a1410, var(--ember) 60%, var(--amber)); box-shadow: 0 0 16px rgba(255, 90, 54, .6); }
@media (prefers-reduced-motion: no-preference) {
  .meter .fill { animation: drain 14s linear infinite; }
}
@keyframes drain { from { width: 100%; } to { width: 6%; } }
.meter .legend { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin-top: 6px; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.dir { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; border-top: 3px solid var(--c); }
.dir.austerity { --c: #8fb3ff; }
.dir.expansion { --c: var(--amber); }
.dir.extraction { --c: var(--ember); }
.dir h3 { color: var(--c); font-family: "Cinzel", Georgia, serif; font-weight: 900; font-size: 1.35rem; letter-spacing: .05em; }
.dir p { margin: 0; color: var(--ink); }

.facts { margin: 22px 0 0; padding: 0; list-style: none; }
.facts li { padding: 12px 0 12px 26px; border-bottom: 1px solid var(--line); position: relative; }
.facts li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 8px; height: 8px; background: var(--amber); transform: rotate(45deg); }

.ds table { border-collapse: collapse; width: 100%; margin-top: 22px; font-size: 1rem; }
.ds th, .ds td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ds th { color: #fff; font-weight: 700; }
.ds td:first-child { color: #fff; white-space: nowrap; }

.events { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
.event { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.event h3, .ladder strong { font-family: "Cinzel", Georgia, serif; font-weight: 700; letter-spacing: .02em; }
.event .when { color: var(--amber); font-size: .95rem; margin: 0 0 6px; }
.event p { margin: 0; }

details { border-bottom: 1px solid var(--line); max-width: 760px; }
summary { cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 1.08rem; list-style: none; color: #fff; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--amber); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "\2212"; }
details p { margin: 0 0 18px; color: var(--ink); }

.back { display: inline-block; margin-top: 8px; }

@media (max-width: 860px) {
  .two { grid-template-columns: 1fr; gap: 36px; }
  .ladder { grid-template-columns: 1fr 1fr; }
  .cards3, .events { grid-template-columns: 1fr; }
  .notice { margin: 0 14px 0 4px; }
}
@media (max-width: 520px) {
  .ladder { grid-template-columns: 1fr; }
  .ds-hero .ident img { width: 64px; height: 64px; border-radius: 14px; }
  .ds td:first-child { white-space: normal; }
}
