/* Blitzpot */
:root {
  --bg: #0b0b0b;
  --box: #121212;
  --hover: #181818;
  --ink: #ededed;
  --ink-2: #a0a0a0;
  --ink-3: #6b6b6b;
  --line: #1f1f1f;
  --line-2: #2c2c2c;
  --sq-light: #ebebe7;
  --sq-dark: #b6b6b0;
  --r: 10px;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 72px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: #fff; color: #000; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.sm { font-size: 13px; }
.wrap { max-width: 1052px; margin: 0 auto; padding: 0 24px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: transparent; color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--hover); border-color: #3a3a3a; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.btn-solid { background: var(--ink); color: #0b0b0b; border-color: var(--ink); }
.btn.btn-solid:hover:not(:disabled) { background: #fff; border-color: #fff; }
.btn.block { width: 100%; height: 42px; }
.btn.btn-ghost { border-color: transparent; color: var(--ink-2); padding: 0 10px; }
.btn.btn-ghost:hover { color: var(--ink); background: var(--hover); border-color: transparent; }
.btn:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11,11,11,.97); border-bottom: 1px solid var(--line); will-change: transform; }
.top-in { display: flex; align-items: center; gap: 28px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.links { display: flex; gap: 20px; color: var(--ink-2); }
.links a:hover { color: var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ca { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: none; color: var(--ink-2); font-size: 12px; cursor: pointer; transition: color .12s, border-color .12s; }
.ca:hover { color: var(--ink); border-color: #3a3a3a; }
.ca svg { opacity: .7; }

/* app layout: board left, everything else right */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "board round" "board game" "board live"; grid-template-rows: auto auto 1fr;
  gap: 16px 24px; justify-content: center; align-items: start; padding: 24px 0 0; }
.round { grid-area: round; }
.board-col { grid-area: board; }
.game { grid-area: game; }
.live { grid-area: live; }

.box { background: var(--box); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.box-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; letter-spacing: -.01em; }
.box-head .right { margin-left: auto; color: var(--ink-3); font-size: 12px; font-weight: 400; }

/* round */
.round-top { display: flex; justify-content: space-between; color: var(--ink-2); }
.round-top b { color: var(--ink); font-weight: 500; font-family: var(--sans); }
.pot { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.pot .mono { font-family: var(--sans); font-size: 42px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.pot .unit { color: var(--ink-2); font-size: 14px; }
.pot-label { margin: 8px 0 14px; color: var(--ink-3); font-size: 13px; }
.bar { height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 1s linear; }
.round-stats { display: flex; gap: 16px; margin-top: 12px; color: var(--ink-3); font-size: 13px; }
.round-stats b { color: var(--ink); font-weight: 600; font-family: var(--sans); }

/* board */
.board-col { display: grid; gap: 10px; width: 100%; max-width: min(640px, calc(100vh - 180px)); min-width: 0; }
.board-frame { position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px #1c1c1c, 0 30px 70px -30px rgba(0,0,0,.9); }
.board { width: 100%; aspect-ratio: 1; }
.cm-chessboard.cf .board .square.white { fill: var(--sq-light); }
.cm-chessboard.cf .board .square.black { fill: var(--sq-dark); }
.cm-chessboard.cf.border-type-none .board .border { stroke-width: 0; fill: var(--sq-dark); }
.cm-chessboard.cf .coordinates { pointer-events: none; user-select: none; }
.cm-chessboard.cf .coordinates .coordinate { font-size: 10px !important; font-weight: 600; font-family: var(--sans); }
@media (max-width: 600px) { .cm-chessboard.cf .coordinates .coordinate { font-size: 8px !important; } }
.cm-chessboard.cf .coordinates .coordinate.black { fill: #f7f7f4; }
.cm-chessboard.cf .coordinates .coordinate.white { fill: #8d8d87; }
.cm-chessboard .markers .marker.marker-last { fill: rgba(0, 0, 0, .12); opacity: 1; }
.cm-chessboard .markers .marker.marker-sel { fill: rgba(0, 0, 0, .28); opacity: 1; }
.cm-chessboard .markers .marker.marker-dot { fill: rgba(0, 0, 0, .26); opacity: 1; }
.cm-chessboard .markers .marker.marker-cap { stroke: rgba(0, 0, 0, .26); stroke-width: 5px; fill: none; opacity: 1; }
.cm-chessboard .markers .marker.marker-check { fill: rgba(0, 0, 0, .45); opacity: 1; }

.overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 24px;
  background: rgba(11, 11, 11, .82); animation: fade .2s ease-out; }
.overlay h3 { margin: 0; font-size: 32px; letter-spacing: -.03em; font-weight: 600; }
.overlay h3 em { font-style: normal; }
.overlay p { margin: 0; color: var(--ink-2); }
.overlay .actions { display: flex; gap: 8px; margin-top: 14px; }
@keyframes fade { from { opacity: 0; } }
.searching { display: grid; place-items: center; gap: 14px; }
.searching .spin { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #333; border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pbar { display: flex; justify-content: space-between; align-items: center; }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.who b { display: block; font-weight: 600; letter-spacing: -.01em; }
.who small { display: block; color: var(--ink-3); font-size: 12px; }
.pfp { width: 32px; height: 32px; border-radius: 7px; flex: none; background: linear-gradient(135deg, #1d1d1d, #111); border: 1px solid var(--line-2); }
.clock { font-family: var(--sans) !important; font-size: 22px; font-weight: 600; letter-spacing: -.02em; height: 40px; display: grid; place-items: center end; padding: 0 14px; border-radius: 8px; background: var(--box); border: 1px solid var(--line-2); min-width: 92px; color: var(--ink-2); }
.clock.active { background: var(--ink); color: #0b0b0b; border-color: var(--ink); }
.clock.low { background: var(--ink); color: #0b0b0b; border-color: var(--ink); animation: lowtime 1s steps(2) infinite; }
@keyframes lowtime { 50% { background: var(--box); color: var(--ink); } }

/* game */
.tag { font: 500 11px var(--sans); padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.tag.rated { color: #0b0b0b; background: var(--ink); border-color: var(--ink); }
.status { margin: 0 0 14px; min-height: 42px; color: var(--ink-2); line-height: 1.5; }
.moves { list-style: none; margin: 0 0 14px; padding: 6px 0; height: 140px; overflow-y: auto; display: grid; grid-template-columns: 36px 1fr 1fr; align-content: start;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.moves li { padding: 3px 8px; }
.moves li.n { color: var(--ink-3); padding-left: 0; }
.moves li.last { background: var(--hover); border-radius: 4px; }
.moves:empty { display: grid; place-items: center; }
.moves:empty::before { content: 'Moves will appear here'; grid-column: 1 / -1; color: var(--ink-3); font-family: var(--sans); font-size: 13px; }
.actions { display: grid; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font: 13px var(--mono); }
.feed li:first-child { border-top: 0; padding-top: 2px; }
.feed li.empty { color: var(--ink-3); font-family: var(--sans); padding: 6px 0; }
.feed .vs { color: var(--ink-3); margin: 0 6px; }
.feed .tx { text-decoration: underline; text-underline-offset: 3px; }
.watch { height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2); background: none; color: var(--ink-2); font: 500 12px var(--sans); cursor: pointer; }
.watch:hover { color: var(--ink); }

/* lower sections */
.sect { padding-top: 72px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.block-head h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.03em; }

.standings { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.table { background: var(--box); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) 52px 52px 52px 64px; gap: 8px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); }
.tr > span:nth-child(n+3) { text-align: right; }
.th { border-top: 0; font-size: 12px; color: var(--ink-3); }
.th > span { font-family: var(--sans) !important; }
.lb-row:hover { background: var(--hover); }
.lb-row .rank { color: var(--ink-3); }
.lb-row.first .rank { color: var(--ink); }
.lb-row .addr { display: flex; gap: 10px; align-items: center; min-width: 0; font-family: var(--mono); font-size: 13px; }
.lb-row .addr .pfp { width: 22px; height: 22px; border-radius: 5px; }
.lb-row.me .addr { text-decoration: underline; text-underline-offset: 4px; }
.lb-row.out { opacity: .45; }
.lb-row .pts { font-weight: 600; }
.badge { font: 500 10px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-3); white-space: nowrap; }
.badge.review { color: var(--ink); border-color: var(--ink); }
.empty { padding: 28px 16px; color: var(--ink-3); text-align: center; }

.history h3, .prose h3 { margin: 24px 0 8px; font-size: 14px; font-weight: 600; }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv > div:first-child { padding-top: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-family: var(--sans) !important; font-weight: 500; }

.marquee { overflow: hidden; margin-top: 12px; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: inline-flex; gap: 8px; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.res-chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 5px; border-radius: 6px; border: 1px solid var(--line); font: 12px var(--mono); color: var(--ink-2); white-space: nowrap; }
.res-chip b { color: var(--ink); font-weight: 500; }
.res-chip .pfp { width: 20px; height: 20px; border-radius: 4px; }

.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; counter-reset: r; }
.rules li { counter-increment: r; position: relative; padding: 16px 0 16px 34px; border-top: 1px solid var(--line); color: var(--ink-2); line-height: 1.6; }
.rules li::before { content: counter(r, decimal-leading-zero); position: absolute; left: 0; top: 19px; color: var(--ink-3); font: 12px var(--mono); }
.rules b { color: var(--ink); font-weight: 600; }
@media (max-width: 700px) { .rules { grid-template-columns: 1fr; } }
.prose-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.prose { max-width: 520px; }
.prose h3 { margin-top: 0; }
.prose p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.65; }
.prose b { color: var(--ink); font-weight: 500; }

/* footer */
.foot { margin-top: 96px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.foot-in { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; }
.foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; border-radius: 8px; background: var(--ink); color: #0b0b0b; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: fade .2s ease-out; }
.toast.err { background: var(--box); color: var(--ink); border: 1px solid var(--line-2); }

/* responsive */
@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "round" "board" "game" "live"; grid-template-rows: none; }
  .board-col { max-width: 640px; justify-self: center; }
  .standings, .prose-cols { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 14px; }
  .top-in { gap: 12px; }
  .links, .ca { display: none; }
  .app { padding-top: 14px; gap: 12px; }
  .pot .mono { font-size: 34px; }
  .tr { grid-template-columns: 28px minmax(0, 1fr) 26px 26px 26px 36px; padding: 10px 12px; gap: 6px; }
  .sect { padding-top: 56px; }
}

/* entrance + curtain from the homepage */
.curtain-in { position: fixed; inset: 0; z-index: 100; background: #0a0a0a; pointer-events: none; animation: curtainUp .8s cubic-bezier(.76,0,.24,1) .1s forwards; }
@keyframes curtainUp { to { transform: translateY(-100%); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.top { animation: fade .6s ease-out both; }
.app > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.app > .round { animation-delay: .15s; }
.app > .board-col { animation-delay: .25s; }
.app > .game { animation-delay: .35s; }
.app > .live { animation-delay: .45s; }
.sect { animation: rise .8s cubic-bezier(.2,.7,.2,1) .55s both; }
.box { transition: border-color .2s; }
.box:hover { border-color: var(--line-2); }

/* links */
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--ink-2); transition: color .12s, background .12s; }
.icon-btn:hover { color: var(--ink); background: var(--hover); }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
@media (max-width: 600px) { .top-right .icon-btn, .top-right [data-link="buy"], .top-right .div { display: none; } }
