/* games.beacon.land */

:root {
  --blue:      #1b3fd4;
  --blue-dark: #12299a;
  --blue-pale: #f2f5ff;
  --ink:       #14181d;
  --muted:     #6b7280;
  --line:      #e5e8ee;
  --bg:        #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

body {
  margin: 0 auto;
  max-width: 760px;
  padding: clamp(2.5rem, 8vw, 5rem) 1.5rem 3rem;
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }

/* ── header ─────────────────────────────────────────── */
header { margin-bottom: 2.5rem; }
header h1 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}
header h1 a { color: var(--ink); text-decoration: none; }
header h1::before { content: "> "; color: var(--blue); }
header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 56ch;
}
header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 1rem;
  font-size: 0.8rem;
}
header nav a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
header nav a:hover { border-bottom-color: var(--blue); }

/* ── the game list ──────────────────────────────────── */
.empty {
  margin: 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.game {
  display: grid;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 640px) {
  .game { grid-template-columns: 240px 1fr; gap: 1.5rem; }
}

.shot {
  display: block;
  border: 1px solid var(--line);
  background: var(--blue-pale);
  aspect-ratio: 4 / 3;
  transition: border-color 0.12s;
}
a.shot:hover { border-color: var(--blue); }
.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.meta h2 { font-size: 0.95rem; font-weight: 700; margin: 0; }
.meta h2 a { color: var(--ink); text-decoration: none; }
.meta h2 a:hover { color: var(--blue); }
.meta > p { margin: 0.7rem 0 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem !important;
  font-size: 0.72rem;
}
.tags span {
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.05rem 0.45rem;
}

/* the little spec table under each game */
.stat {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}
.stat > div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; }
.stat dt { color: var(--muted); }
.stat dd { margin: 0; }

.soon .meta h2, .soon .meta p { color: var(--muted); }
.soon .shot { background: repeating-linear-gradient(45deg, #f7f8fb 0 8px, #eef1f7 8px 16px); }

/* ── buttons ────────────────────────────────────────── */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.2rem !important;
}
.btn {
  display: inline-block;
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.28rem 0.7rem;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.btn::after { content: " →"; color: var(--muted); }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn:hover::after { color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary::after { color: rgba(255,255,255,0.7); }
.btn.primary::before { content: "▶ "; font-size: 0.85em; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.dead { color: var(--muted); border-style: dashed; cursor: default; }
.btn.dead::after { content: ""; }

/* ── a game, playing ────────────────────────────────── */
body.playing {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.bar a { text-decoration: none; }
.bar a::before { content: "← "; }
.bar a:hover { text-decoration: underline; }
.bar span { color: var(--ink); font-weight: 700; }

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--blue-pale);
}
.stage canvas {
  display: block;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}
.hint {
  margin: 0;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── inner pages ────────────────────────────────────── */
.back { margin: 1rem 0 0; font-size: 0.8rem; }
.back a { text-decoration: none; }
.back a::before { content: "← "; }
.back a:hover { text-decoration: underline; }

.page-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.page-lead { margin: 0.7rem 0 0; color: var(--muted); max-width: 60ch; }

.stat.wide {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}
@media (min-width: 620px) {
  .stat.wide { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
}

figure { margin: 0 0 1.5rem; border: 1px solid var(--line); }
figure:last-of-type { margin-bottom: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: var(--blue-pale);
}
figcaption {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--muted);
}

.group { margin-top: 2.25rem; }
.group h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.group p { margin: 0 0 0.85rem; }
.group p:last-child { margin-bottom: 0; }

.controls {
  padding: 0.9rem 1rem;
  background: var(--blue-pale);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.3rem 1rem;
  font-size: 0.76rem;
  color: var(--muted);
}
kbd {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ccd3e6;
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0.02rem 0.3rem;
  margin-right: 0.15rem;
}

pre {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--ink);
  color: #e8ecf5;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.7;
}
pre code { font: inherit; }
p code {
  background: var(--blue-pale);
  padding: 0.05rem 0.3rem;
  font-size: 0.92em;
}

/* ── footer ─────────────────────────────────────────── */
footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.cols { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 620px) {
  .cols { grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
}
footer h3 {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 0 0 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
footer p { margin: 0; font-size: 0.8rem; color: var(--muted); max-width: 42ch; }
footer ul { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; }
footer li { color: var(--muted); padding: 0.1rem 0; }
footer li a { text-decoration: none; }
footer li a:hover { text-decoration: underline; }

.bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.25rem !important;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  max-width: none !important;
  font-size: 0.74rem;
}

::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.copy {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.copy:hover { color: var(--blue); }
