@font-face { font-family: Geist; src: url(/fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --text: #1c2321;
  --muted: #5d6a66;
  --line: #dde3e0;
  --brand: #2c72ff;
  --brand-dark: #1d5ae0;
  --brand-soft: #eaf1ff;
  --warn: #b54708;
  --bad: #c0362c;
  --good: #157a45;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--brand); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 28px; height: 28px; color: var(--brand); flex: none; }
.nav a { margin-left: 18px; color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 12px 22px; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn:disabled { opacity: .5; cursor: default; }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0 0 28px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; margin-bottom: 16px; }

section { padding: 40px 0; }
h2 { font-size: 28px; letter-spacing: -0.01em; margin: 0 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card a.more { display: inline-block; margin-top: 10px; font-weight: 600; text-decoration: none; }

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; margin-top: 40px; }
.site-footer a { color: var(--muted); margin-right: 14px; }

/* Article (guides) */
.article { max-width: 760px; padding: 40px 16px; margin: 0 auto; }
.article h1 { font-size: clamp(28px, 4.5vw, 38px); line-height: 1.2; letter-spacing: -0.02em; }
.article h2 { font-size: 23px; margin-top: 36px; }
.article code { font-family: var(--mono); background: #eef1ef; padding: 1px 6px; border-radius: 4px; font-size: .92em; }
.article pre { background: #1c2321; color: #e8efe9; padding: 14px; border-radius: 8px; overflow-x: auto; font-family: var(--mono); font-size: 14px; }
.callout { background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 14px 18px; border-radius: 6px; margin: 24px 0; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* Test app */
.test-shell { padding: 24px 0 40px; }
.test-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.progress { font-weight: 600; color: var(--muted); }
.timer { font-family: var(--mono); font-weight: 700; font-size: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }
.timer.low { color: var(--bad); border-color: var(--bad); }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }

.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.q-skill { font-size: 13px; font-weight: 600; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .05em; }
.q-title { font-size: 19px; margin: 6px 0 16px; }

.sheet-scroll { overflow-x: auto; border: 1px solid #c8d0cc; border-radius: 6px; }
table.sheet { border-collapse: collapse; font-size: 14px; min-width: 100%; background: #fff; }
table.sheet th, table.sheet td { border: 1px solid #dfe4e1; padding: 0 8px; height: 30px; white-space: nowrap; }
table.sheet thead th, table.sheet tbody th { background: #f1f3f2; color: #66706c; font-weight: 500; font-size: 12px; text-align: center; min-width: 34px; }
table.sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sheet tr.header-row td { font-weight: 700; background: #fafbfa; }
table.sheet td.target { background: #fff8db; outline: 2px solid var(--brand); outline-offset: -2px; font-weight: 600; min-width: 110px; }

.formula-bar { display: flex; align-items: stretch; margin: 16px 0 10px; border: 1px solid #c8d0cc; border-radius: 6px; overflow: hidden; background: #fff; }
.formula-bar .addr { font-family: var(--mono); font-weight: 700; padding: 0 12px; display: flex; align-items: center; background: #f1f3f2; border-right: 1px solid #c8d0cc; }
.formula-bar .fx { font-style: italic; color: var(--muted); padding: 0 10px; display: flex; align-items: center; border-right: 1px solid #c8d0cc; }
.formula-bar input { flex: 1; border: 0; font-family: var(--mono); font-size: 16px; padding: 10px 12px; outline: none; min-width: 0; }

.q-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 15px; display: none; }
.feedback.show { display: block; }
.feedback.ok { background: #e7f5ec; color: var(--good); }
.feedback.no { background: #fdecea; color: var(--bad); }
.feedback.hint { background: #fff4e5; color: var(--warn); }

.result { text-align: center; padding: 30px 20px; }
.score-big { font-size: 64px; font-weight: 800; color: var(--brand); line-height: 1; }
.review { text-align: left; margin-top: 24px; }
.review-item { border-top: 1px solid var(--line); padding: 12px 0; font-size: 15px; }
.review-item code { font-family: var(--mono); background: #eef1ef; padding: 1px 6px; border-radius: 4px; }
.mark-ok { color: var(--good); font-weight: 700; }
.mark-no { color: var(--bad); font-weight: 700; }

@media (max-width: 600px) {
  .nav a:not(.btn) { display: none; }
  .hero { padding: 40px 0 28px; }
}
.nav a.btn { color: #fff; }

/* Dashboard-style sizing: one scale for every page, everything left-aligned. */
body { font-size: 15px; line-height: 1.55; }
.wrap { max-width: 1200px; }
.site-header .wrap { height: 56px; }
.logo { font-size: 15px; font-weight: 600; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a { margin-left: 0; font-size: 14px; padding: 0 10px; }

.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 14px; font-size: 14px; font-weight: 500;
  border-radius: 6px; line-height: 1; white-space: nowrap;
}
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f1f3f5; }
.nav a.btn { padding: 0 14px; }

.hero { padding: 40px 0 24px; }
.hero h1 { font-size: 32px; letter-spacing: -0.015em; }
.hero p.lead { font-size: 16px; margin-bottom: 20px; }
.badge { font-size: 12px; font-weight: 500; }
section { padding: 24px 0; }
h2 { font-size: 20px; margin-bottom: 14px; }
.card { padding: 16px 18px; border-radius: 8px; }
.card h3 { font-size: 15px; font-weight: 600; }
.card p { font-size: 14px; }
.card a.more { font-size: 14px; font-weight: 500; }
.faq details { padding: 12px 16px; border-radius: 8px; }
.faq summary { font-weight: 500; }

.article { max-width: 1200px; margin: 0 auto; padding: 32px 16px; }
.article > * { max-width: 760px; }
.article .grid3 { max-width: 1200px; }
.article h1 { font-size: 28px; margin: 8px 0 14px; }
.article h2 { font-size: 20px; margin-top: 28px; }
.article pre { font-size: 13px; }

.test-shell { padding: 24px 16px 40px; }
.test-shell h1 { font-size: 28px; margin: 0 0 6px; }
.q-card { border-radius: 8px; padding: 18px; }
.q-title { font-size: 16px; }
.result { text-align: left; padding: 24px; }
.score-big { font-size: 44px; }
.timer { font-size: 15px; height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 6px; }
.formula-bar input { font-size: 14px; height: 36px; padding: 0 12px; }
.feedback { font-size: 14px; }
.site-footer { font-size: 13px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .article h1, .test-shell h1 { font-size: 24px; }
}

/* FAQ: chevron instead of the native triangle; points down when open. */
.faq summary { list-style: none; display: flex; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ""; width: 16px; height: 16px; flex: none; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5 10.5 8 6 12.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5 10.5 8 6 12.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s;
}
.faq details[open] summary::before { transform: rotate(90deg); }
.faq details p { margin: 8px 0 0 26px; color: var(--muted); font-size: 14px; }

/* ---------- Game layer ---------- */
.me-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text) !important; font-size: 13px; text-decoration: none; }
.me-pill:hover { border-color: var(--brand); }
.me-pill .flame { filter: grayscale(1); opacity: .5; transition: .3s; }
.me-pill .flame.lit { filter: none; opacity: 1; }
.me-pill .gem { color: var(--brand); font-size: 11px; }
.me-pill .sep { width: 1px; height: 14px; background: var(--line); }
.me-pill.bump { animation: bump .6s ease; }
@keyframes bump { 30% { transform: scale(1.18); } 60% { transform: scale(.96); } }

.pop { position: absolute; transform: translate(-50%, 0); font-weight: 700; font-size: 18px; color: var(--brand); pointer-events: none; z-index: 60; animation: pop 1.4s ease-out forwards; text-shadow: 0 1px 0 #fff; white-space: nowrap; }
.pop.big { font-size: 26px; color: #f59e0b; }
.pop.muted { font-size: 13px; color: var(--muted); font-weight: 500; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -14px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: calc(100vw - 32px); }
.toast { background: #111827; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: toastIn .35s cubic-bezier(.2,.9,.3,1.3); transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-flame { display: inline-block; animation: flicker 1s infinite alternate; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes flicker { to { transform: scale(1.2) rotate(-6deg); } }

.nick-modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fade .2s; }
.nick-card { background: var(--surface); border-radius: 12px; padding: 24px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: toastIn .3s cubic-bezier(.2,.9,.3,1.3); }
.nick-card h3 { margin: 6px 0 4px; font-size: 18px; }
.nick-card p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.nick-card input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; font: inherit; font-size: 14px; }
.nick-card input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.nick-emoji { font-size: 32px; }
.nick-err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 4px 0; }
@keyframes fade { from { opacity: 0; } }

.lb { margin-top: 8px; }
.lb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lb-head h2 { margin: 0; }
.lb-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.lb-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 16px 18px; }
.lb-card:nth-child(2) { border-left-color: #f59e0b; }
.lb-card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dark); display: flex; align-items: center; gap: 8px; }
.lb-card:nth-child(2) h3 { color: #b45309; }
.lb-ic { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 14px; background: var(--brand-soft); }
.lb-ic.st { background: #fff4e0; }
.lb-card ol { list-style: none; margin: 0; padding: 0; }
.lb-card li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; border-bottom: 1px dashed var(--line); animation: rowIn .35s both; }
.lb-card li:nth-child(2) { animation-delay: .05s; } .lb-card li:nth-child(3) { animation-delay: .1s; } .lb-card li:nth-child(4) { animation-delay: .15s; } .lb-card li:nth-child(5) { animation-delay: .2s; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } }
.lb-card li.top .nm { font-weight: 600; }
.lb-card li.empty { color: var(--muted); justify-content: center; border: 0; padding: 14px 0; }
.rk { width: 24px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl { font-variant-numeric: tabular-nums; color: var(--muted); }
.lb-me { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.lb-me b { font-size: 20px; color: var(--brand); font-variant-numeric: tabular-nums; }
.lb-card:nth-child(2) .lb-me b { color: #f59e0b; }
.lb-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.lb-loading { color: var(--muted); font-size: 14px; padding: 20px 0; }
.board-after { margin-top: 24px; }

/* Daily challenge */
.daily-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, #2c72ff, #6a5cff); color: #fff; border-radius: 12px; padding: 22px 24px; margin-bottom: 16px; }
.daily-hero h1 { margin: 0 0 4px; font-size: 26px; color: #fff; }
.daily-hero p { margin: 0; opacity: .9; font-size: 14px; }
.daily-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.18); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.daily-done { display: none; background: #e7f5ec; color: var(--good); border-radius: 8px; padding: 14px 16px; margin-top: 12px; font-size: 14px; }
.daily-done.show { display: block; animation: toastIn .35s; }
@media (max-width: 600px) {
  .nav a.me-pill { display: inline-flex; }
  .logo { font-size: 14px; }
}
@media (max-width: 420px) {
  .nav a.btn { display: none; }
}

/* No bold anywhere: body text 400, headings, labels and emphasis 500 at most. */
*, *::before, *::after { font-weight: 400 !important; }
h1, h2, h3, h4, b, strong, th, summary, .btn, .logo, .badge, .q-skill, .progress, .timer,
.score-big, .lb-card h3, .lb-me, .lb-me b, .me-pill b, .pop, .chip, .formula-bar .addr,
table.sheet tr.header-row td, table.sheet td.target, .mark-ok, .mark-no { font-weight: 500 !important; }

/* Flat icons */
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.btn .ic, .chip .ic { margin-right: 6px; }
.flame-ic { color: #f97316; display: inline-flex; }
.me-pill .ic { width: 14px; height: 14px; }
.me-pill .flame { color: #f97316; filter: grayscale(1); opacity: .45; display: inline-flex; }
.me-pill .flame.lit { filter: none; opacity: 1; }
.me-pill .gem { color: var(--brand); display: inline-flex; font-size: 0; }
.me-pill .gem .ic { width: 12px; height: 12px; }
.lb-ic { color: var(--brand); }
.lb-ic .ic { width: 15px; height: 15px; }
.lb-ic.st { color: #f97316; }
.medal { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; color: #fff; }
.medal.gold { background: #f5b301; }
.medal.silver { background: #a3acb9; }
.medal.bronze { background: #cd7f45; }
.nick-emoji { width: 44px; height: 44px; border-radius: 12px; background: #fff4e0; color: #f59e0b; display: grid; place-items: center; }
.nick-emoji .ic { width: 26px; height: 26px; }
.toast .ic { width: 16px; height: 16px; vertical-align: -3px; }
.toast-flame { color: #fb923c; display: inline-flex; }
.inline-ic { width: 15px; height: 15px; vertical-align: -3px; }
.ok-ic, .daily-done .inline-ic { color: var(--good); }
.review-item .ic { width: 15px; height: 15px; vertical-align: -3px; }
.mark-ok { color: var(--good); }
.mark-no { color: var(--bad); }
.chip { display: inline-flex; align-items: center; }
.chip .ic { margin-right: 6px; width: 15px; height: 15px; }
.chip .lvl { color: #fff; }
