/* Layout: a nav bar over a blurred, darkened hero with the burning pixel title, the flyover, a gallery of the land, a footer.
   Matches the launcher: ash black, bone text, aged gold frames, ember-brown buttons, EB Garamond italic for the voice of the interface. */
:root {
  --bg: #0a0807; --bg-2: #14100d; --panel: rgba(14,11,9,.82);
  --fg: #e8dcc4; --fg-2: #a5967e; --fg-3: #7a6d5b;
  --line: #3a2e22; --bronze: #78603a; --inner: #5a4628;
  --gold: #d6aa5c; --gold-edge: #c9a45c;
  --ember-edge: #e69646; --ember-fill: #5c3414; --ember-fill-2: #74431b;
  --error: #e66e64; --ok: #9cb46e;
  --body: "EB Garamond", Garamond, "Palatino Linotype", Georgia, serif;
  --shadow: 0 24px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 19px; line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--body); font-style: italic; font-weight: 500; margin: 0; text-wrap: balance; line-height: 1.1; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--fg); }
p { margin: 0; max-width: 60ch; }
.wrap { width: min(1140px, 100%); margin-inline: auto; padding-inline: 20px; }
.rule { display: flex; align-items: center; gap: 1rem; color: var(--gold); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-edge), transparent); opacity: .7; }
.rule span { font-size: .85rem; font-style: italic; letter-spacing: .12em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* THE PIXEL TITLE (title.js): the game's bitmap letters on a canvas. The text stays for screen readers and as the no-script fallback. */
.pixel-title { position: relative; display: inline-block; width: var(--title-w); height: var(--title-h); font-size: 0 !important; color: transparent !important; text-shadow: none !important; line-height: 0; }
.pixel-title canvas { position: absolute; pointer-events: none; image-rendering: pixelated; }

/* HERO: an in-game shot, blurred and graded dark like the launcher, with a dark column behind the centred text */
.hero { position: relative; isolation: isolate; min-height: 720px; display: grid; align-items: center; overflow: hidden; }
.hero > img { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); max-width: none; object-fit: cover; object-position: 50% 40%; z-index: -2;
  filter: blur(8px) saturate(.75) brightness(.6); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10,8,7,.45) 0%, transparent 14%, transparent 72%, rgba(10,8,7,.8) 90%, var(--bg) 100%),
    linear-gradient(90deg, transparent 8%, rgba(10,8,7,.55) 30%, rgba(10,8,7,.84) 50%, rgba(10,8,7,.55) 70%, transparent 92%),
    rgba(50,28,20,.2); }
.hero .wrap { padding-block: 9rem 6rem; display: grid; gap: 1.3rem; justify-items: center; text-align: center; }
.hero h1 { font-size: clamp(3.2rem, 9vw, 6.5rem); color: var(--fg); text-shadow: 0 2px 0 rgba(0,0,0,.3), 0 12px 40px rgba(0,0,0,.6); }
.hero h1.pixel-title { margin-block: 1.2rem .4rem; }
.hero .sub { font-style: italic; font-size: clamp(1.2rem, 2.1vw, 1.55rem); color: var(--fg-2); max-width: 44ch; }
.hero .rule { width: min(360px, 70%); }

/* BUTTONS: ember-brown with an ember edge, as in the launcher; the plain ones are dark with a bronze rim */
.cta { display: inline-block; margin-top: 1rem; font-family: var(--body); font-style: italic; font-size: 1.2rem; line-height: 1.2; text-decoration: none; color: var(--fg-2);
  padding: .7rem 1.9rem; border: 1px solid var(--bronze); background: rgba(34,27,21,.85); transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.cta:hover { color: var(--fg); border-color: var(--gold-edge); background: rgba(52,40,28,.9); }
.cta.primary { position: relative; color: var(--fg); background: var(--ember-fill); border: 2px solid var(--ember-edge);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 0 18px rgba(224,120,42,.18); animation: smoulder 3.6s ease-in-out infinite; }
.cta.primary:hover { background: var(--ember-fill-2); border-color: #f2b06a; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 0 28px rgba(224,120,42,.45); animation: none; }
@keyframes smoulder { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 0 16px rgba(224,120,42,.16); } 50% { box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 0 24px rgba(224,120,42,.3); } }
.ctas { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* TOP NAV: over the hero */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 10; padding-block: 1.4rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: center; justify-content: space-between; }
.topbar .brand { font-size: 1.3rem; font-style: italic; font-weight: 500; color: var(--gold); text-decoration: none; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.topbar nav { display: flex; gap: 1.8rem; }
.topbar nav a { color: var(--fg-2); text-decoration: none; font-style: italic; font-size: 1.1rem; text-shadow: 0 1px 8px rgba(0,0,0,.7); padding-block: .2rem; border-bottom: 1px solid transparent; }
.topbar nav a:hover { color: var(--gold); }
.topbar nav a[aria-current="page"] { color: var(--gold); border-bottom-color: currentColor; }
@media (max-width: 520px) { .topbar .wrap { justify-content: center; } .topbar nav { gap: 1.2rem; } .topbar nav a { font-size: 1rem; } }

/* SECTIONS */
section { padding-block: 5rem; }
.head { display: grid; gap: .6rem; margin-bottom: 2.2rem; text-align: center; justify-items: center; }
.head p { color: var(--fg-2); font-style: italic; font-size: 1.15rem; }

/* The launcher's panel: 2px gold frame, a thin bronze line inside it */
.frame { position: relative; border: 2px solid var(--gold-edge); padding: 8px; background: var(--bg-2); box-shadow: var(--shadow); }
.frame::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--inner); pointer-events: none; }
.frame img, .frame video { width: 100%; display: block; object-fit: cover; }

.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.2rem; }
.shot { position: relative; overflow: hidden; border: 1px solid var(--bronze); min-width: 0; grid-column: span 12; background: var(--bg); }
.shot::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(201,164,92,.25); pointer-events: none; }
.shot img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; transition: transform .8s ease, filter .8s ease; filter: saturate(.85) brightness(.9); }
.shot:hover img { transform: scale(1.03); filter: saturate(1) brightness(1); }
@media (min-width: 760px) { .shot.w7 { grid-column: span 7; } .shot.w5 { grid-column: span 5; } .shot.w6 { grid-column: span 6; } .shot.w8 { grid-column: span 8; } .shot.w4 { grid-column: span 4; } }

.closing .wrap { display: grid; gap: 1rem; justify-items: center; text-align: center; }
.closing p { color: var(--fg-2); font-style: italic; font-size: 1.15rem; }

footer { border-top: 1px solid var(--line); padding-block: 2.5rem; color: var(--fg-3); font-size: .95rem; font-style: italic; }
footer .wrap { display: flex; justify-content: center; text-align: center; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .cta, .shot img { transition: none; } .cta.primary { animation: none; } }

/* DOWNLOAD PAGE */
.hero.short { min-height: 440px; }
.hero.short .wrap { padding-block: 6.5rem 4rem; }
h3 { font-size: 1.75rem; line-height: 1.15; }
.builds { display: grid; gap: 1.4rem; }
@media (min-width: 760px) { .builds { grid-template-columns: 1fr 1fr; } }
.build { position: relative; display: grid; gap: .9rem; align-content: start; padding: 2rem 1.8rem 1.8rem; border: 1px solid var(--bronze); background: var(--bg-2); min-width: 0; }
.build::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(90,70,40,.6); pointer-events: none; }
.build .os { font-size: 1rem; font-style: italic; color: var(--fg-3); }
.build p { color: var(--fg-2); }
.build .cta { justify-self: start; margin-top: .4rem; position: relative; z-index: 1; }
.build .file { font-size: .9rem; color: var(--fg-3); font-style: italic; overflow-wrap: anywhere; }
.build .badge { display: none; position: absolute; top: -.8rem; left: 1.8rem; z-index: 1; padding: .1rem .8rem; font-size: .9rem; font-style: italic; background: var(--gold); color: var(--bg); }
.build.recommended { border: 2px solid var(--gold-edge); box-shadow: var(--shadow); }
.build.recommended::after { border-color: var(--inner); }
.build.recommended .badge { display: block; }
.detected { text-align: center; color: var(--fg-2); font-style: italic; margin: 0 auto 2rem; min-height: 1.6em; }

.info { display: grid; gap: 3rem; }
@media (min-width: 860px) { .info { grid-template-columns: 1fr 1fr; } }
.info h3 { margin-bottom: 1rem; }
.info p { color: var(--fg-2); }
.info p strong { color: var(--fg); font-weight: 500; }
.info p + p { margin-top: .8rem; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.4rem 1fr; gap: .2rem .8rem; color: var(--fg-2); }
.steps li::before { content: counter(step, upper-roman); grid-row: span 2; font-style: italic; font-size: 1.35rem; color: var(--gold); line-height: 1.2; }
.steps strong { color: var(--fg); font-weight: 500; }
code { font-family: Consolas, "Courier New", monospace; font-size: .85em; padding: .05em .35em; color: var(--fg); background: var(--bg); border: 1px solid var(--line); overflow-wrap: anywhere; }
.platform + .platform { margin-top: 3.5rem; }
.platform > .rule { margin-bottom: 2rem; }
@media (min-width: 1100px) { .builds.servers { grid-template-columns: repeat(4, 1fr); } }
.servers .build { padding: 1.6rem 1.4rem 1.4rem; }
.servers h3 { font-size: 1.5rem; }

/* ACCOUNT PAGE: the launcher's login panel */
.panel { position: relative; width: min(420px, 100%); margin-inline: auto; display: grid; gap: 1.1rem; padding: 2.2rem 2rem 2rem; border: 2px solid var(--gold-edge); background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.panel::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--inner); pointer-events: none; }
.panel > * { position: relative; z-index: 1; }
.panel h3 { text-align: center; color: var(--gold); }
.panel > p { color: var(--fg-2); text-align: center; margin-inline: auto; }
.panel[hidden] { display: none; }
.field { display: grid; gap: .35rem; justify-items: stretch; }
.field label { font-size: 1.05rem; font-style: italic; color: var(--fg-2); }
.field input { font: inherit; font-style: italic; font-size: 1.15rem; text-align: center; color: var(--fg); background: #060504; border: 1px solid var(--bronze); padding: .5rem .8rem; border-radius: 0; width: 100%; caret-color: var(--gold); }
.field input:hover { border-color: var(--gold-edge); }
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px rgba(214,170,92,.25); }
.panel .cta { margin-top: .3rem; justify-self: stretch; text-align: center; cursor: pointer; }
.panel .cta:disabled { opacity: .45; cursor: not-allowed; animation: none; }
.panel .cta:disabled:hover { background: var(--ember-fill); border-color: var(--ember-edge); }
.hint { font-size: 1rem; font-style: italic; color: var(--fg-3); min-height: 1.5em; margin-inline: auto; }
.hint a { color: var(--gold); }
.hint.ok { color: var(--ok); }
.hint.bad, .msg.bad { color: var(--error); }
.msg { text-align: center; font-style: italic; color: var(--fg-2); min-height: 1.6em; margin-inline: auto; }
.current { text-align: center; display: grid; gap: .1rem; }
.current span { font-size: 1.05rem; font-style: italic; color: var(--fg-2); }
.current strong { font-style: italic; font-size: 2.2rem; font-weight: 500; color: var(--fg); overflow-wrap: anywhere; }
.linkish { font: inherit; font-style: italic; background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: center; }
.linkish:hover { color: var(--fg); }
.password-form { display: grid; gap: 1rem; margin-top: .8rem; }
.password-form[hidden] { display: none; }
.password-form > .rule { margin-bottom: .2rem; }
