/*
 * Snake League for ChatGPT - site styling.
 *
 * Monochrome, minimal and system-native: white canvas, black type, thin rules
 * and generous spacing. No colour gradients, no glow; colour is reserved for
 * meaning (errors / destructive actions only).
 */

:root {
  --canvas: #ffffff;
  --soft: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5e7;
  --line-strong: #d2d2d7;
  --danger: #b3261e;
  --radius: 10px;
  --wrap: 980px;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--text);
  position: relative;
  flex: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px 5px 8px 5px;
  border-radius: 2px;
  background: #fff;
}

.brand-text small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  /* Keep "for ChatGPT" as one unit: it wraps as a whole, never mid-phrase. */
  white-space: nowrap;
}

.badge {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.hero {
  padding: 48px 20px 40px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 32px;
}

.hero-cta-link {
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 7vw, 54px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0 0 32px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 16px;
}

.score-hero {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.score-hero-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.score-hero-value {
  margin: 4px 0 0;
  font-size: clamp(48px, 12vw, 84px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.score-hero-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.notice {
  margin-top: 24px;
  padding: 12px 14px;
  background: var(--soft);
  border-radius: var(--radius);
  font-size: 14px;
}

.notice p {
  margin: 0;
}

.notice-quiet {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* -------------------------------------------------------------- sections */

.section {
  padding: 44px 20px;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.section h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.section-head h2 {
  margin-bottom: 0;
}

.section-note {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------ leaderboard */

.tabs {
  display: inline-flex;
  gap: 14px;
}

.tab {
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.board-status {
  padding: 22px 0;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.board-table th,
.board-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.board-table thead th {
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.col-rank,
.col-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-rank {
  width: 56px;
  color: var(--muted);
}

.col-score {
  width: 90px;
  font-weight: 600;
}

.col-date {
  width: 120px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.board-table tbody tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------------- install */

.install-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 32px;
}

.install-card {
  padding: 18px;
  background: var(--soft);
  border-radius: var(--radius);
}

.install-card-pending {
  background: transparent;
  border: 1px solid var(--line);
}

.install-card-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.install-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.button {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  opacity: 0.88;
}

.button-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.install-step-title {
  margin: 0 0 14px;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.steps > li {
  padding-left: 34px;
  position: relative;
  counter-increment: step;
}

.steps {
  counter-reset: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  line-height: 21px;
  text-align: center;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.steps-compact > li {
  padding-left: 30px;
}

/* ---------------------------------------------------------------- prose */

.prose p {
  margin: 0 0 14px;
  max-width: 62ch;
}

.facts {
  margin: 0 0 18px;
  display: grid;
  gap: 14px;
}

.facts dt {
  font-weight: 600;
  font-size: 14px;
}

.facts dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 62ch;
}

.check-list {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}

.check-list li {
  margin-bottom: 4px;
}

/* -------------------------------------------------------------- details */

.details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.details summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  list-style: none;
}

.details summary::-webkit-details-marker {
  display: none;
}

.details summary::before {
  content: "＋";
  display: inline-block;
  width: 16px;
  color: var(--muted);
}

.details[open] summary::before {
  content: "−";
}

.details > *:not(summary) {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.details-quiet {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: 14px;
}

details.details > p a {
  color: var(--text);
}

/* ------------------------------------------------------------------ doc */

.doc {
  padding-top: 44px;
  padding-bottom: 56px;
  max-width: 720px;
}

.doc h1 {
  font-size: clamp(26px, 6vw, 38px);
  margin-bottom: 8px;
}

.doc h2 {
  margin: 40px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 600;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.doc p,
.doc li {
  color: var(--text);
  font-size: 15px;
}

.doc .lede,
.doc li {
  color: var(--muted);
}

.doc-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.doc-back {
  margin-top: 32px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 14px;
}

.doc-table th,
.doc-table td {
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

/* --------------------------------------------------------------- footer */

.site-footer {
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0 0 10px;
  max-width: 68ch;
}

.site-footer strong {
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
}

/* ----------------------------------------------------------- responsive */

@media (min-width: 700px) {
  .install-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    padding-top: 76px;
  }

  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .tab {
    transition: opacity 120ms ease-out, border-color 120ms ease-out;
  }
}
