:root {
  --bg: #0a1512;
  --bg-2: #10201b;
  --line: #1f3a31;
  --text: #eaf6f0;
  --muted: #93b3a6;
  --coral: #ff7a5c;
  --camo: #6fe0b0;
  --alert: #ff5a5a;
  --firefly: #ffe27a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #17352b 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: var(--firefly); }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(10, 21, 18, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .5px;
  text-decoration: none;
}

.logo .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 14px var(--coral);
}

.top nav { display: flex; gap: clamp(10px, 3vw, 28px); }
.top nav a { color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; }
.top nav a:hover { color: var(--text); }

@media (max-width: 420px) {
  .top nav a:first-child { display: none; }
}

@media (max-width: 560px) {
  .top nav a[href="#about"] { display: none; }
}

/* Stage */
.play { padding: clamp(10px, 2.5vw, 24px) clamp(8px, 3vw, 28px) 8px; }
.play-title { margin: 0 0 12px; font-size: 22px; line-height: 1.2; text-align: center; }

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  width: min(100%, 680px, calc(100svh - 268px));
  min-width: min(100%, 320px);
  padding: 8px;
  border-radius: 20px;
  background: #07120f;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  user-select: none;
  -webkit-user-select: none;
  font-variant-numeric: tabular-nums;
}

#game {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  touch-action: none;
  cursor: crosshair;
}

/* HUD */
.hud-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 8px;
}

.hud-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.score { font-size: 24px; font-weight: 800; }
.round { color: var(--muted); font-weight: 700; }
.round b { color: var(--text); margin-left: 2px; }

.hearts { display: flex; gap: 4px; }
.hearts i {
  width: 14px;
  height: 14px;
  background: var(--coral);
  clip-path: path("M7 13.2 1.4 7.6A3.4 3.4 0 0 1 7 3a3.4 3.4 0 0 1 5.6 4.6Z");
  transition: opacity .3s, transform .3s;
}
.hearts i.lost { opacity: .18; transform: scale(.8); }

.timer {
  min-width: 2.4em;
  padding: 2px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--firefly);
}
.timer.urgent { color: var(--alert); border-color: var(--alert); }

.hud-actions { display: flex; justify-content: flex-end; gap: 6px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .cross { display: none; }
.icon-btn.muted .wave { display: none; }
.icon-btn.muted .cross { display: inline; }

.hud-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  padding: 10px 4px 2px;
}

.meter { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.meter .bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; }
.meter em { font-style: normal; min-width: 3ch; text-align: right; }
.meter.camo i { background: var(--camo); }
.meter.alert i { background: linear-gradient(90deg, #ffb24e, var(--alert)); }
.meter.alert.hot .bar { box-shadow: 0 0 10px var(--alert); }

.hint {
  grid-column: 1 / -1;
  min-height: 1.5em;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.hint[data-tone="good"] { color: var(--camo); }
.hint[data-tone="warn"] { color: var(--coral); }
.hint[data-tone="bad"] { color: var(--alert); }

.stage.is-attract .hud-top > *,
.stage.is-attract .hud-bottom > * { visibility: hidden; }

/* Overlay */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: inherit;
  text-align: center;
  background: rgba(7, 18, 15, .6);
  transition: opacity .25s;
}

.stage.is-attract .overlay {
  justify-content: flex-end;
  padding-bottom: 12%;
  background: linear-gradient(to bottom, rgba(7, 18, 15, 0) 40%, rgba(7, 18, 15, .85));
}

.overlay.hidden { opacity: 0; pointer-events: none; }
.stage.is-attract .overlay .ov-title { letter-spacing: .12em; text-indent: .12em; }

.overlay .ov-title {
  margin: 0;
  font-size: clamp(30px, 7vw, 56px);
  line-height: 1.1;
  letter-spacing: .04em;
  text-indent: .04em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .6);
}

.overlay p { margin: 0; color: var(--muted); }
.overlay .best { font-size: 14px; margin-top: 4px; }
.overlay .best b { color: var(--firefly); }

.btn {
  margin-top: 14px;
  padding: 12px 38px;
  border: 0;
  border-radius: 99px;
  background: var(--coral);
  color: #1a0b08;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(255, 122, 92, .45);
  transition: transform .12s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn-ghost {
  padding: 8px 24px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text); }

/* Sections */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 32px) 8px;
}

.section h2 { margin: 0 0 20px; font-size: 26px; }

.section .lead {
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--text);
}

.section p { color: var(--muted); }
.section .lead { color: var(--text); }

.section .note {
  margin: 22px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--coral);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-2);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.steps li {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.steps h3 { margin: 12px 0 4px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

.ico { width: 44px; height: 44px; border-radius: 50%; }
.ico-move { background: var(--coral); box-shadow: 0 0 18px var(--coral); }
.ico-blend { border-radius: 10px; background: radial-gradient(circle at 35% 35%, #55895d, #33604a); border: 2px dashed rgba(255, 255, 255, .3); }
.ico-light { border-radius: 0; background: linear-gradient(to top, rgba(255, 226, 122, .95), rgba(255, 226, 122, .1)); clip-path: polygon(50% 100%, 8% 0, 92% 0); }

.keys { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
kbd {
  padding: 1px 7px;
  margin: 0 2px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
}

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 18px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--firefly);
  box-shadow: 0 0 10px var(--firefly);
}
.timeline time { font-weight: 700; color: var(--firefly); font-variant-numeric: tabular-nums; }
.timeline p { margin: 2px 0 0; color: var(--muted); }
.timeline b { color: var(--text); }

details {
  border-bottom: 1px solid var(--line);
  padding: 14px 4px;
}
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }

.foot {
  margin-top: 56px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.foot-updated {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: .02em;
  opacity: .85;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 20px;
  margin: 12px 0 0;
}

.foot-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 4px;
}

.legal { max-width: 800px; padding-bottom: 24px; overflow-wrap: anywhere; }
.legal h1 { margin: 0; font-size: clamp(30px, 6vw, 42px); line-height: 1.2; }
.legal h2 { margin: 32px 0 10px; font-size: 22px; }
.legal p, .legal li { color: var(--muted); }
.legal strong, .legal code { color: var(--text); }
.legal-date { margin: 12px 0 32px; font-size: 14px; }
.legal code { font-size: .9em; }

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

/* Like / share / fullscreen */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: min(100%, 680px);
  margin: 12px auto 0;
}

.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg-2);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.act:hover { color: var(--text); }
.act[hidden] { display: none; }
.act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act-like[data-gf-liked] { color: var(--coral); border-color: var(--coral); }
.act-like[data-gf-liked] svg { fill: currentColor; }
.act-msg { color: var(--camo); font-size: 13px; }
.act-msg:empty { display: none; }

/* Fullscreen: keep the square board inside the screen */
.stage.is-full {
  justify-content: center;
  align-items: center;
  width: 100%;
  border-radius: 0;
  border: 0;
}
.stage.is-full > .hud-top,
.stage.is-full > .hud-bottom,
.stage.is-full #game { width: min(100%, calc(100vh - 110px)); }

/* Comments */
.c-form { display: grid; gap: 10px; }
.c-form input,
.c-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}
.c-form input { max-width: 260px; }
.c-form textarea { resize: vertical; }
.c-form input:focus,
.c-form textarea:focus { outline: 2px solid var(--camo); outline-offset: 1px; }
.c-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.c-replying { margin-right: auto; color: var(--muted); font-size: 14px; }
.btn-sm { margin: 0; padding: 9px 26px; font-size: 16px; box-shadow: none; }
.c-msg { margin: 0; color: var(--camo); font-size: 14px; }
.c-msg:empty { display: none; }
.c-list,
.c-list ul { list-style: none; margin: 0; padding: 0; }
.c-list { margin-top: 20px; }
.c-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.c-list ul { margin-top: 10px; padding-left: 18px; border-left: 2px solid var(--line); }
.c-list ul li { border-top: 0; padding: 8px 0; }
.c-list b { color: var(--text); }
.c-list time { margin-left: 6px; color: var(--muted); font-size: 13px; }
.c-list p { margin: 4px 0 6px; color: var(--text); overflow-wrap: anywhere; }
.c-list [data-gf-c-reply] {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.c-list [data-gf-c-reply]:hover { color: var(--text); }
.c-list [data-gf-owner] > p { padding-left: 10px; border-left: 3px solid var(--camo); }
.c-owner {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--camo);
  color: #07120f;
  font-size: 12px;
  font-weight: 700;
}
.c-owner[hidden] { display: none; }
.c-empty { margin: 20px 0 0; color: var(--muted); }
.c-list:not([data-gf-empty]) + .c-empty,
.comments:has([data-gf-off]) { display: none; }

.crumbs { margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* Screenshots */
.shot { width: min(100%, 340px); margin: 24px auto; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}


/* Blog */
.eyebrow {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--coral);
}
.article h1 { margin: 0 0 10px; font-size: clamp(30px, 5.6vw, 40px); line-height: 1.18; letter-spacing: -0.01em; text-wrap: balance; }
.post-meta { margin: 0 0 28px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.article h2 { margin: 36px 0 10px; font-size: 23px; line-height: 1.25; color: var(--text); }
.article h3 { margin: 24px 0 6px; font-size: 17.5px; line-height: 1.3; color: var(--text); }
.article p, .article li { color: var(--muted); text-wrap: pretty; }
.article p { margin: 0 0 14px; max-width: 68ch; }
.article strong { color: var(--text); }
.article ol, .article ul { margin: 0 0 16px; padding-left: 22px; max-width: 68ch; }
.article li { margin: 6px 0; }
.article a { text-decoration: underline; text-underline-offset: 3px; }
.article .cta { margin: 34px 0 14px; }
.article .cta a { display: inline-block; text-decoration: none; }
.post-list { list-style: none; margin: 8px 0 0; padding: 0; }
.post-list li { padding: 18px 0; border-top: 1px solid var(--line); }
.post-list time { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-list a { color: var(--text); font-size: 18px; font-weight: 700; text-decoration: none; }
.post-list a:hover { color: var(--firefly); }
.post-list p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }


/* Article + blog list */
.article, .blog { max-width: 760px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 28px) 72px; }
.article .crumbs, .blog .crumbs { margin: 0 0 26px; font-size: 13px; color: var(--muted); }
.article .crumbs a, .blog .crumbs a { color: var(--muted); text-decoration: none; }
.article .crumbs a:hover, .blog .crumbs a:hover { color: var(--text); }
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--coral); }
.article h1, .blog h1 { margin: 0 0 14px; font-size: clamp(28px, 5.4vw, 40px); line-height: 1.14; letter-spacing: -.015em; text-wrap: balance; }
.article .meta, .blog .meta { margin: 0 0 30px; font-size: 13px; color: var(--muted); }
.blog .lede, .article .lede { margin: 0 0 10px; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 60ch; }
.prose { font-size: 17px; line-height: 1.75; max-width: 68ch; }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin: 42px 0 12px; font-size: clamp(21px, 3.6vw, 26px); line-height: 1.25; letter-spacing: -.01em; }
.prose h3 { margin: 28px 0 8px; font-size: 19px; }
.prose p { margin: 0; text-wrap: pretty; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; }
.prose li + li { margin-top: 9px; }
.prose strong { color: #fff; font-weight: 700; }
.prose a { color: var(--firefly); text-underline-offset: 3px; }
.prose blockquote { margin: 24px 0 0; padding: 14px 18px; border-left: 3px solid var(--camo); background: var(--bg-2); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.prose tr { transition: background .15s ease; }
.prose tbody tr:hover { background: rgba(111, 224, 176, .06); }
.pick td { background: rgba(255, 122, 92, .1); color: var(--text); }
@media (max-width: 640px) { .prose { font-size: 16px; line-height: 1.7; } .prose table { font-size: 13.5px; } .prose th, .prose td { padding: 8px 6px; } }


/* FAQ, CTA, related, post list */
.post-faq { margin-top: 48px; border-top: 1px solid var(--line); }
.post-faq h2 { margin: 26px 0 4px; font-size: 22px; letter-spacing: -.01em; }
.post-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.post-faq summary { cursor: pointer; font-weight: 700; list-style-position: outside; }
.post-faq summary::marker { color: var(--coral); }
.post-faq details p { margin: 10px 0 2px; color: var(--muted); max-width: 66ch; }
.post-cta { margin-top: 44px; padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.post-cta h2 { margin: 0 0 8px; font-size: 20px; }
.post-cta p { margin: 0 0 18px; color: var(--muted); font-size: 15px; max-width: 56ch; }
.post-cta .btn { display: inline-block; padding: 0 22px; height: 44px; line-height: 44px; border-radius: 99px; background: var(--coral); color: #180a06; font-weight: 700; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.post-cta .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255, 122, 92, .3); }
.post-cta a.plain { margin-left: 16px; font-size: 15px; color: var(--firefly); text-decoration: none; }
.post-cta a:focus-visible { outline: 2px solid var(--camo); outline-offset: 2px; }
.post-related { margin-top: 40px; }
.post-related h2, .post-related h3 { margin: 0 0 4px; font-size: 17px; color: var(--muted); font-weight: 600; }
.post-related ul { margin: 0; padding: 0; list-style: none; }
.post-related li { padding: 14px 0; border-top: 1px solid var(--line); }
.post-related a { color: var(--firefly); text-decoration: none; font-weight: 600; }
.post-related a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-related span { display: block; margin-top: 3px; font-size: 14px; color: var(--muted); max-width: 62ch; }
.post-list { margin: 30px 0 0; padding: 0; list-style: none; }
.post-card { padding: 22px 0; border-top: 1px solid var(--line); }
.post-card h2 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.post-card a { color: var(--text); text-decoration: none; }
.post-card a:hover { color: var(--firefly); }
.post-card p { margin: 0 0 8px; font-size: 15px; color: var(--muted); max-width: 64ch; }
.post-card .meta { margin: 0; font-size: 13px; }
@media (max-width: 480px) { .post-cta a.plain { display: block; margin: 14px 0 0; } }
@media (prefers-reduced-motion: reduce) { .post-cta .btn, .prose tr { transition: none; } }
