@font-face { font-family: Geist; src: url(/fonts/geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/fonts/geist-mono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --page: #0B0F1A; --surface: #121828; --raised: #1A2236; --hover: #222C44; --line: #263049;
  --text: #EEF1F7; --muted: #9AA4BA; --accent: #B8F26B; --ink: #0B0F1A; --danger: #FF8A7A;
  --t0: #B8F26B; --t1: #8DE39A; --t2: #62CDB6; --t3: #5BB0D9; --t4: #7D9BD3; --t5: #8B93A7;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 15px/1.5 Geist, sans-serif; font-feature-settings: 'ss01'; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: #5C6782; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.muted { color: var(--muted); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; }
.mark svg { width: 22px; height: 22px; }
.top nav { display: flex; gap: 20px; font-size: 14px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--raised); color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none; transition: background .15s var(--ease), color .15s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: #CBF78F; }
.btn.quiet { background: transparent; color: var(--muted); padding: 0 10px; }
.btn.quiet:hover { color: var(--text); background: var(--raised); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.ico { display: inline-flex; } .ico svg { width: 18px; height: 18px; flex: none; }

.field { display: grid; gap: 6px; }
.field label, .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--page); border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s var(--ease); }
.input:hover { border-color: #3A4766; }
.input:focus { border-color: var(--accent); outline: none; }
textarea.input { resize: vertical; line-height: 1.55; }
.err { color: var(--danger); font-size: 14px; min-height: 0; }
.err:empty { display: none; }

/* home */
.hero { padding: 48px 0 36px; display: grid; gap: 28px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); max-width: 15ch; }
.hero p.lede { font-size: 18px; color: var(--muted); max-width: 54ch; }
.create { background: var(--surface); border-radius: 12px; padding: 20px; display: grid; gap: 16px; }
.create .row { display: grid; gap: 16px; }
.create .foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.create .count { font-size: 13px; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.quick button { min-height: 36px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--raised); cursor: pointer; font-size: 14px; }
.quick button:hover { background: var(--hover); }
@media (min-width: 860px) {
  .create .row { grid-template-columns: 1fr 1.4fr; align-items: start; }
  .create textarea { min-height: 188px; }
}

.section { padding: 44px 0; border-top: 1px solid var(--line); }
.section > h2 { font-size: 24px; margin-bottom: 20px; }
.section > .sub { color: var(--muted); margin: -12px 0 22px; max-width: 60ch; }
.steps { display: grid; gap: 12px; counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--surface); border-radius: 12px; padding: 18px 20px; display: grid; gap: 6px; }
.steps li::before { counter-increment: s; content: '0' counter(s); font-family: var(--mono); color: var(--accent); font-size: 13px; }
.steps b { font-weight: 600; font-size: 16px; }
.steps p { color: var(--muted); }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.tgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(160px, 45%), 1fr)); }
.tgrid a { display: grid; gap: 4px; padding: 14px 16px; background: var(--surface); border-radius: 12px; text-decoration: none; transition: background .15s var(--ease); }
.tgrid a:hover { background: var(--raised); }
.tgrid b { font-weight: 600; }
.tgrid span { font-size: 13px; color: var(--muted); }
.faq { display: grid; gap: 0; max-width: 760px; }
.faq dt { font-weight: 600; padding-top: 18px; }
.faq dd { margin: 4px 0 0; color: var(--muted); padding-bottom: 18px; border-bottom: 1px solid var(--line); }

/* board */
.board { display: grid; gap: 6px; }
.tier { display: grid; grid-template-columns: 56px 1fr; min-height: 60px; background: var(--surface); border-radius: 12px; overflow: hidden; transition: background .15s var(--ease); }
.tier .letter { display: flex; align-items: center; justify-content: center; font: 600 24px/1 var(--mono); color: var(--ink); background: var(--tc); border: 0; cursor: pointer; padding: 0; }
.tier .letter:disabled { cursor: default; }
.tier .items { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 8px; min-height: 60px; }
.tier.target { background: var(--raised); }
.tier.drop { background: var(--hover); }
.tier[data-t="0"] { --tc: var(--t0); } .tier[data-t="1"] { --tc: var(--t1); } .tier[data-t="2"] { --tc: var(--t2); }
.tier[data-t="3"] { --tc: var(--t3); } .tier[data-t="4"] { --tc: var(--t4); } .tier[data-t="5"] { --tc: var(--t5); }
@media (min-width: 760px) { .tier { grid-template-columns: 72px 1fr; min-height: 68px; } .tier .letter { font-size: 28px; } }

.chip { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 8px 12px; border-radius: 8px; border: 0; background: var(--raised); color: var(--text); font-size: 14px; line-height: 1.25; text-align: left; cursor: grab; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; transition: background .15s var(--ease), box-shadow .15s var(--ease), opacity .15s var(--ease); }
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: var(--hover); }
.chip.ghost { position: fixed; z-index: 50; pointer-events: none; box-shadow: inset 0 0 0 2px var(--accent); background: var(--hover); }
.chip.lifted { opacity: .3; }
.chip.static { cursor: default; min-height: 36px; }
.chip.static:hover { background: var(--raised); }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.dock .wrap { display: grid; gap: 10px; }
.dock .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.dock .pool { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; min-height: 44px; }
.dock .pool .chip { flex: none; max-width: 70vw; }
.dock .hint { font-size: 13px; color: var(--muted); }
.lockin { display: flex; gap: 8px; align-items: center; }
.lockin .input { flex: 1; min-width: 0; }
.progress { height: 3px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s var(--ease); }
@media (min-width: 860px) { .dock .pool { flex-wrap: wrap; overflow: visible; max-height: 152px; overflow-y: auto; } .dock .pool .chip { max-width: 320px; } }

/* list page */
.lhead { display: grid; gap: 14px; padding: 20px 0 22px; }
.lhead .kicker { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lhead h1 { font-size: clamp(26px, 4.6vw, 42px); overflow-wrap: anywhere; }
.lhead .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dot { color: #5C6782; }
.state { padding: 80px 0; text-align: center; display: grid; gap: 16px; justify-items: center; }
body.ranking main { padding-bottom: 260px; }
.panel { background: var(--surface); border-radius: 12px; padding: 18px 20px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.panel h2 .mono { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }

.dash { display: grid; gap: 24px; padding-bottom: 48px; }
.dash .side { display: grid; gap: 12px; align-content: start; }
@media (min-width: 980px) { .dash { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }

.strip { display: inline-grid; grid-template-columns: repeat(6, 1fr); gap: 2px; width: 84px; height: 14px; flex: none; }
.strip i { border-radius: 2px; background: var(--raised); position: relative; overflow: hidden; }
.strip i b { position: absolute; left: 0; right: 0; bottom: 0; background: var(--tc); }
.strip i:nth-child(1) { --tc: var(--t0); } .strip i:nth-child(2) { --tc: var(--t1); } .strip i:nth-child(3) { --tc: var(--t2); }
.strip i:nth-child(4) { --tc: var(--t3); } .strip i:nth-child(5) { --tc: var(--t4); } .strip i:nth-child(6) { --tc: var(--t5); }
.spread { font-family: var(--mono); font-size: 12px; color: var(--muted); font-feature-settings: 'tnum'; min-width: 3.4em; text-align: right; }

.rchip { display: inline-grid; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--raised); font-size: 14px; line-height: 1.25; min-width: 0; max-width: 100%; }
.rchip .meta { display: flex; align-items: center; gap: 8px; }
.rchip .meta .strip { width: 66px; height: 10px; }
.rchip .strip i, .panel .strip i { background: #273149; }

.split { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.split:first-of-type { border-top: 0; padding-top: 0; }
.split .name { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 500; }
.split .who { display: grid; gap: 4px; font-size: 13px; }
.split .who div { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: baseline; }
.split .who .t { font-family: var(--mono); font-weight: 600; color: var(--tc); }
.stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: baseline; }
.stat:first-of-type { border-top: 0; padding-top: 0; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-weight: 500; }
.stat .n { font: 600 22px/1 var(--mono); font-feature-settings: 'tnum'; grid-row: span 2; align-self: center; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--mono); font-feature-settings: 'tnum'; color: var(--muted); width: 2.4em; }
.table .tl { font-family: var(--mono); font-weight: 600; width: 2em; }
.table .it { overflow-wrap: anywhere; }
.table .r { text-align: right; padding-right: 0; }
.tl[data-t="0"] { color: var(--t0); } .tl[data-t="1"] { color: var(--t1); } .tl[data-t="2"] { color: var(--t2); }
.tl[data-t="3"] { color: var(--t3); } .tl[data-t="4"] { color: var(--t4); } .tl[data-t="5"] { color: var(--t5); }
@media (max-width: 520px) { .table .hide-s { display: none; } }

.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 10px; min-height: 36px; border-radius: 8px; background: var(--raised); font-size: 14px; }
.person .x { min-height: 36px; min-width: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.person .x:hover { color: var(--text); background: var(--hover); }
.person.solo { padding-right: 10px; }

dialog { background: var(--surface); color: var(--text); border: 0; border-radius: 12px; padding: 22px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 8, 15, .7); }
dialog h2 { font-size: 20px; margin-bottom: 6px; }
dialog .qr { background: #fff; border-radius: 8px; padding: 12px; width: 180px; margin: 14px 0; }
dialog .qr svg { display: block; width: 100%; height: auto; }
dialog .row { display: flex; gap: 8px; margin-top: 12px; }
dialog .row .input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
dialog .close { margin-top: 14px; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise .2s var(--ease); }
  .fade { animation: fade .2s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; z-index: 60; opacity: 0; transition: opacity .18s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; }
body.ranking .toast { bottom: 200px; }

/* prose / template pages */
.prose { max-width: 720px; padding: 32px 0 56px; display: grid; gap: 16px; }
.prose h1 { font-size: clamp(30px, 5vw, 44px); }
.prose h2 { font-size: 20px; margin-top: 16px; }
.prose p, .prose li { color: #C8CFDD; }
.prose ul, .prose ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.titems { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-cta { display: flex; gap: 10px; flex-wrap: wrap; }

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: space-between; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }
body.ranking footer { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
