/* Line Rot — the site borrows the game's own palette: cream paper, ink
   outlines, and the green/amber/red the lines age through. Nothing here is
   shared with a sibling project's site. */

:root {
  --paper:  #FFF4E0;
  --ink:    #2B2118;
  --muted:  #7A6A57;
  --green:  #34A853;
  --amber:  #E8A33D;
  --red:    #D2453C;
  --line:   #D9C9AC;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 ui-rounded, "SF Pro Rounded", "Avenir Next", Avenir,
        "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---- top nav: privacy / terms / support live here (开发要求 §4.2) ---- */

header.bar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 244, 224, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 2px solid var(--ink);
}
/* 发行包要求【七】: the bar must NOT stay stuck on a narrow screen. The links
   wrap onto their own row there, and a pinned two-row bar eats a large part of
   a phone viewport. Handled in the <=720px block below. */
.bar .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 66px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; font-size: 15px;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; display: block; }
nav.bar-links { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
nav.bar-links a {
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; border: 2px solid transparent;
}
nav.bar-links a:hover { border-color: var(--ink); }
nav.bar-links a[aria-current="page"] { background: var(--green); color: #fff; }

/* ---- hero ---- */

.hero { padding: 62px 0 30px; text-align: center; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 8vw, 68px);
  letter-spacing: .04em; line-height: 1.02;
}
.hero p.tag {
  margin: 0 auto; max-width: 30ch; color: var(--muted);
  font-size: clamp(16px, 2.6vw, 19px);
}

/* The three ageing states, drawn with borders rather than images. This is
   decoration, not a gameplay diagram — the real board is shown in photos. */
.fuse { display: flex; gap: 8px; justify-content: center; margin: 26px 0 0; }
.fuse i {
  display: block; width: 58px; height: 9px; border-radius: 6px;
  border: 2px solid var(--ink);
}
.fuse i:nth-child(1) { background: var(--green); }
.fuse i:nth-child(2) { background: var(--amber); }
.fuse i:nth-child(3) { background: var(--red); }

/* The eleven symbols, shown as themselves. They are the game's vocabulary, so
   the home page states it outright rather than describing it in prose. */
.glyphs {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  list-style: none; padding: 0; margin: 26px auto 0; max-width: 560px;
}
.glyphs li {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 10px; background: #fff;
  font-size: 17px; font-weight: 700;
}

/* ---- spec list ---- */

.spec { padding: 46px 0 8px; border-top: 2px dashed var(--line); }
.spec h2 { margin: 0 0 18px; font-size: clamp(22px, 3.4vw, 30px); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0; }
.cell {
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 14px; background: #fff;
}
.cell dt { font-weight: 800; font-size: 13px; letter-spacing: .06em;
           text-transform: uppercase; margin-bottom: 5px; }
.cell dd { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---- alternating gameplay rows ---- */

.row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 44px; align-items: center;
  padding: 46px 0; border-top: 2px dashed var(--line);
}
.row:nth-child(even) .shot { order: 2; }
.row h2 { margin: 0 0 10px; font-size: clamp(22px, 3.4vw, 30px); }
.row p { margin: 0 0 10px; color: var(--muted); }
.row .shot img {
  width: 100%; max-width: 330px; display: block; margin: 0 auto;
  border: 3px solid var(--ink); border-radius: 22px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; padding: 0; list-style: none; }
.chips li {
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 4px 11px; font-size: 13px; font-weight: 600; background: #fff;
}

/* ---- facts ---- */

.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  padding: 40px 0 8px; border-top: 2px dashed var(--line);
}
.facts div {
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 16px; text-align: center; background: #fff;
}
.facts b { display: block; font-size: 26px; }
.facts span { color: var(--muted); font-size: 13px; }

/* ---- document pages ---- */

.doc {
  padding: 44px 0 20px;
  /* min() rather than a bare max-width: at 390px, 74ch is wider than the
     viewport, and the text ran off the right edge with words cut mid-line. */
  max-width: min(74ch, 100%);
  overflow-wrap: break-word;
}
.doc h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 6px; }
.doc .updated { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.doc h2 { margin: 30px 0 8px; font-size: 20px; }
.doc p, .doc li { color: #4B3E31; }
.doc ul { padding-left: 20px; }
.doc a { color: var(--green); }

/* Placeholders that must be replaced before publishing (开发要求 §4.2). */
.ph {
  color: var(--red); font-weight: 700;
  background: #FDECEA; border: 1px dashed var(--red);
  border-radius: 5px; padding: 0 5px;
}

footer.foot {
  border-top: 2px solid var(--ink); margin-top: 48px;
  padding: 26px 0 40px; color: var(--muted); font-size: 14px;
}
footer.foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
footer.foot a { color: var(--muted); }
footer.foot .right { margin-left: auto; }

/* ---- responsive: checked at 390 / 600 / 900 / 1300 (开发要求 §4.5) ---- */

@media (max-width: 900px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; gap: 22px; padding: 34px 0; }
  .row:nth-child(even) .shot { order: 0; }
  .hero { padding: 40px 0 20px; }
  /* Not sticky here — see the note above the .bar rule. */
  header.bar { position: static; backdrop-filter: none; background: var(--paper); }
  .bar .wrap { min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
  nav.bar-links { margin-left: 0; width: 100%; }
}
@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .fuse i { width: 44px; }
  .grid { grid-template-columns: 1fr; }
  .glyphs li { width: 38px; height: 38px; font-size: 15px; }
  nav.bar-links a { padding: 6px 10px; font-size: 13px; }
}
