/* GridZed website. Colours are the game's own (src/view/ui/UiColors.gd, Grit B palette). */
:root {
  --bg: #16171f;
  --bg-2: #1b1c27;
  --panel: #24252e;
  --panel-2: #2a2b35;
  --line: #3a3d4c;
  --line-2: #586070;
  --text: #e3e1d1;
  --dim: #b9b9a8;
  --mute: #828880;
  --accent: #d17c3d;
  --accent-2: #e9a55e;
  --gold: #e8cf86;
  --blood: #8a2f2d;
  --danger: #b04731;
  --moss: #586b4e;
  --sky: #57839e;
  --pixel: "Silkscreen", "Courier New", monospace;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --wrap: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  /* The grid in GridZed: faint 32 px tile lines, like the map editor. */
  background-image:
    linear-gradient(rgba(88, 96, 112, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 96, 112, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-2); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.2; margin: 0 0 0.6em; letter-spacing: 0.02em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.8rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, kbd {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.4em;
}
kbd { border-bottom-width: 3px; color: var(--gold); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
main { flex: 1; }

/* ------------------------------------------------------------------ header -- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(22, 23, 31, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.logo {
  font-family: var(--pixel); font-size: 1.45rem; color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.logo:hover { color: var(--text); }
.logo b { color: var(--accent); font-weight: 400; }
.logo-mark { width: 28px; height: 28px; image-rendering: pixelated; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--dim); text-decoration: none; padding: 6px 12px; border-radius: 4px;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--gold); background: var(--panel); }
.nav a.soon { color: var(--mute); }
.nav a.soon::after {
  content: "soon"; font-family: var(--pixel); font-size: 0.6rem; margin-left: 6px;
  color: var(--mute); border: 1px solid var(--line); padding: 0 4px; border-radius: 3px; vertical-align: 2px;
}
.nav a.play-link { color: #1b1c27; background: var(--accent); font-weight: 600; }
.nav a.play-link:hover { background: var(--accent-2); color: #1b1c27; }

/* ---------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--pixel); font-size: 1.05rem; text-decoration: none;
  color: #1b1c27; background: var(--accent);
  border: 0; border-bottom: 4px solid #8a4f25; border-radius: 4px;
  padding: 12px 26px; cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
.btn:hover { background: var(--accent-2); color: #1b1c27; }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn:disabled { background: var(--line-2); border-bottom-color: var(--line); color: var(--panel); cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); border-bottom-width: 3px; }
.btn.ghost:hover { border-color: var(--dim); }
.btn.small { font-size: 0.85rem; padding: 8px 14px; }

/* ------------------------------------------------------------------- hero -- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-art {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  image-rendering: pixelated; filter: saturate(0.85) brightness(0.55);
}
.hero::after {
  /* Night closes in from the edges, like the game's vision mask. */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(22, 23, 31, 0.85) 0%, rgba(22, 23, 31, 0.55) 45%, rgba(22, 23, 31, 0.2) 75%),
    radial-gradient(ellipse at 70% 45%, transparent 25%, rgba(22, 23, 31, 0.7) 75%, var(--bg) 100%),
    linear-gradient(transparent 60%, var(--bg));
}
.hero .wrap { position: relative; z-index: 1; padding-top: clamp(60px, 12vw, 130px); padding-bottom: clamp(60px, 10vw, 110px); }
.hero h1 { text-shadow: 0 3px 0 #000, 0 0 24px rgba(0, 0, 0, 0.8); }
.hero h1 b { color: var(--accent); font-weight: 400; }
.tagline { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--dim); max-width: 34em; text-shadow: 0 2px 6px #000; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--dim);
  background: rgba(36, 37, 46, 0.85); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 14px 4px 10px; margin-top: 18px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mute); flex: none; }
.dot.on { background: #7fbf5a; box-shadow: 0 0 8px #7fbf5a; }
.dot.off { background: var(--danger); }
.dot.wait { background: var(--gold); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* --------------------------------------------------------------- sections -- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }
.lead { color: var(--dim); max-width: 40em; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px;
}
.card h3 { color: var(--gold); }
.card p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- news -- */
.news { display: grid; gap: 16px; }
.post {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 4px; padding: 20px 22px;
}
.post time { font-family: var(--pixel); font-size: 0.8rem; color: var(--mute); }
.post h3 { margin: 4px 0 10px; font-size: 1.15rem; color: var(--text); }
.post p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ steps -- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps > li {
  counter-increment: step; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 18px 20px 18px 74px;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 18px; top: 16px;
  width: 38px; height: 38px; display: grid; place-items: center;
  font-family: var(--pixel); font-size: 1.2rem; color: #1b1c27; background: var(--gold); border-radius: 4px;
}
.steps h3 { margin-bottom: 6px; }
.steps p:last-child { margin-bottom: 0; }

.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 24px; margin: 0; }
.keys div { display: flex; gap: 12px; align-items: baseline; border-bottom: 1px dashed var(--line); padding: 6px 0; }
.keys dt { min-width: 90px; }
.keys dd { margin: 0; color: var(--dim); }

.note {
  background: rgba(88, 107, 78, 0.18); border: 1px solid var(--moss); border-radius: 6px;
  padding: 14px 18px; color: var(--dim);
}
.note.warn { background: rgba(176, 71, 49, 0.14); border-color: var(--danger); }
.note p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- play page -- */
.play-shell { padding-top: 24px; padding-bottom: 40px; }
.play-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.play-bar h1 { font-size: 1.6rem; margin: 0; }
.play-bar .spacer { flex: 1; }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 170px);
  background: #000; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden;
}
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.stage-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 24px;
  background-size: cover; background-position: center; image-rendering: pixelated;
}
.stage-cover::before { content: ""; position: absolute; inset: 0; background: rgba(16, 17, 23, 0.72); }
.stage-cover > * { position: relative; }
.stage-cover .btn { font-size: 1.4rem; padding: 16px 44px; }
.stage-cover small { color: var(--dim); max-width: 34em; }
.server-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--dim); font-size: 0.92rem; margin-top: 12px; }
.server-row input {
  flex: 1; min-width: 220px; max-width: 420px;
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 10px;
}
.server-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
details.more summary { cursor: pointer; color: var(--dim); }
details.more[open] summary { margin-bottom: 8px; }
.only-small { display: none; }
@media (max-width: 720px), (pointer: coarse) {
  .only-small { display: block; }
}

/* ----------------------------------------------------------------- footer -- */
.site-foot { border-top: 1px solid var(--line); padding: 26px 0; color: var(--mute); font-size: 0.9rem; }
.site-foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.site-foot a { color: var(--dim); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-head .wrap { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .nav { margin-left: 0; width: 100%; }
  .nav a { padding: 4px 8px; }
  .steps > li { padding-left: 64px; }
}
