:root {
  color-scheme: dark;
  --text: #f1eadf;
  --muted: #b7ad9f;
  --faint: #7d7468;
  --line: rgba(241, 234, 223, 0.14);
  --amber: #f2b65c;
  --cyan: #70dbd8;
  --green: #94d77d;
  --rose: #eb8799;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(112, 219, 216, 0.16), transparent 29rem),
    radial-gradient(circle at 82% 0%, rgba(242, 182, 92, 0.14), transparent 31rem),
    linear-gradient(180deg, #11151d 0%, #0f131a 48%, #141219 100%);
  line-height: 1.75;
}
body.focus-mode {
  --text: #191c22;
  --muted: #5f625f;
  --faint: #8d887d;
  --line: rgba(20, 24, 31, 0.14);
  color-scheme: light;
  background: linear-gradient(180deg, #f5f0e7 0%, #eee7db 100%);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(241, 234, 223, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 234, 223, 0.024) 1px, transparent 1px);
  background-size: 42px 42px;
}
a { color: inherit; }
button { font: inherit; }
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transform: scaleX(0);
  transform-origin: left;
}
.site-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 100% 5px;
  opacity: 0.36;
}
.site-header, main, .site-footer {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
}
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.brand, .top-nav, .hero-actions, .plain-meta, .note-toolbar, .site-footer, .game-actions, .game-status {
  display: flex;
  align-items: center;
}
.brand {
  gap: 10px;
  text-decoration: none;
  font-weight: 850;
}
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #101319;
  background: var(--cyan);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}
.top-nav {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}
.top-nav a, .button, .theme-toggle, .filter-button {
  min-height: 40px;
  padding: 8px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}
.top-nav a:hover, .button:hover, .theme-toggle:hover, .filter-button:hover, .filter-button.active {
  color: var(--cyan);
}
.theme-toggle { color: var(--text); }
.hero {
  padding: 62px 0 58px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-size: clamp(3.7rem, 12vw, 9rem);
  line-height: 0.88;
  font-weight: 850;
}
h2 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
}
h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
  line-height: 1.35;
  font-weight: 760;
}
.hero-lead {
  max-width: 720px;
  margin-bottom: 26px;
  color: var(--text);
  font-size: clamp(1.04rem, 1.8vw, 1.22rem);
}
.hero-actions { flex-wrap: wrap; gap: 18px; margin-bottom: 22px; }
.button { color: var(--text); font-weight: 760; }
.button.primary { color: var(--amber); border-bottom: 1px solid rgba(242,182,92,0.5); }
.plain-meta { flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 0.9rem; }
.plain-meta span + span::before { content: "/"; margin-right: 14px; color: var(--faint); }
.section { padding: 54px 0; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 24px; }
.section-heading.split {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.58fr);
  gap: 28px;
  align-items: end;
}
.section-note, .plain-copy p, .note-item p, .post-page section p, .post-list, .game-header p:not(.eyebrow) {
  color: var(--muted);
}
.plain-copy { max-width: 720px; }
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 38px;
  align-items: start;
  position: relative;
}
.about-layout::before {
  position: absolute;
  left: -18px;
  top: 4px;
  width: 3px;
  height: 72px;
  content: "";
  background: linear-gradient(var(--cyan), var(--amber));
  border-radius: 999px;
}
.about-prose p:first-child {
  color: var(--text);
  font-size: 1.08rem;
}
.about-prose mark {
  padding: 0 0.18em;
  color: var(--amber);
  background: transparent;
}
.about-facts {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 2px 0 0;
}
.about-facts div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.about-facts dt {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}
.about-facts dd {
  margin: 0;
  color: var(--muted);
}
.about-facts div:nth-child(even) dt {
  color: var(--amber);
}
.note-toolbar { flex-wrap: wrap; gap: 18px; margin: -4px 0 16px; }
.note-list { display: grid; gap: 12px; }
.note-item[hidden] { display: none; }
.note-link {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) 70px;
  gap: 18px;
  align-items: start;
  padding: 16px 0;
  color: inherit;
  text-decoration: none;
}
.note-item time, .note-item span, .post-meta span, .game-status, .collection-grid, .back-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.note-item time { color: var(--faint); font-size: 0.84rem; }
.note-item span { justify-self: end; color: var(--amber); }
.site-footer {
  justify-content: space-between;
  gap: 16px;
  padding: 34px 0 46px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}
.post-shell, .game-shell {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 80px;
}
.back-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  margin-bottom: 28px;
  padding: 8px 0;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--cyan); }
.post-page { display: grid; gap: 34px; }
.post-hero, .game-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.post-hero h1 { font-size: clamp(2.6rem, 8vw, 5.4rem); line-height: 1; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.post-meta span {
  padding: 5px 9px;
  color: var(--amber);
  border: 1px solid rgba(242, 182, 92, 0.24);
  border-radius: 8px;
  font-size: 0.8rem;
}
.post-page section h2 { margin-bottom: 12px; font-size: clamp(1.45rem, 3vw, 2rem); }
.post-list { display: grid; gap: 8px; margin: 0; padding-left: 1.2rem; }
.code-block {
  margin-top: 12px;
  padding: 18px;
  color: var(--amber);
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
}
.game-board { padding: 34px 0; border-bottom: 1px solid var(--line); }
.game-status { justify-content: space-between; gap: 16px; margin-bottom: 18px; color: var(--muted); }
.game-status span {
  display: grid;
  gap: 2px;
  color: var(--faint);
  text-transform: uppercase;
}
.game-status strong {
  color: var(--text);
  font-weight: 750;
  text-transform: none;
}
.current-buddha {
  min-height: 300px;
  padding: 22px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  position: relative;
  overflow: hidden;
}
.current-buddha::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 50% 16%, rgba(242, 182, 92, 0.18), transparent 34%);
  opacity: 0;
  transition: opacity 220ms ease;
}
.current-buddha.summoned::before {
  opacity: 1;
}
.summon-placeholder {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
}
.game-actions { flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.summon-button {
  min-height: 44px;
  padding: 10px 20px;
  color: #101319;
  background: linear-gradient(135deg, var(--amber), #ffd98f);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 850;
  box-shadow: 0 10px 28px rgba(242, 182, 92, 0.18);
}
.summon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(242, 182, 92, 0.25);
}
.game-actions .button {
  min-height: 44px;
  padding: 10px 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.game-actions .button:hover {
  color: var(--cyan);
  border-color: rgba(112, 219, 216, 0.45);
}
.danger-link { color: var(--rose); }
.game-actions .danger-link {
  color: var(--rose);
  border-color: rgba(235, 135, 153, 0.35);
}
.game-actions .danger-link:hover {
  color: #ff9aad;
  border-color: rgba(235, 135, 153, 0.65);
}
.button:disabled { cursor: not-allowed; opacity: 0.45; }
.collection-section { border-bottom: 0; }
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px 10px;
  font-size: 0.82rem;
}
.collection-grid span { color: var(--faint); }
.collection-grid span.found { color: var(--amber); }
.buddha-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}
pre {
  margin: 0;
  overflow-x: auto;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.2;
}
@media (max-width: 980px) {
  .site-header, .section-heading.split, .about-layout { grid-template-columns: 1fr; }
  .top-nav { justify-content: flex-start; }
}
@media (max-width: 680px) {
  .site-header, main, .site-footer, .post-shell, .game-shell { width: min(100% - 28px, 1120px); }
  .top-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  h1 { font-size: clamp(3.25rem, 21vw, 5.4rem); }
  .note-link { grid-template-columns: 1fr; gap: 9px; }
  .note-item span { justify-self: start; }
  pre, .current-buddha pre { font-size: 7.5px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
