:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --surface: #fbfaf7;
  --ink: #16150f;
  --muted: #6b6860;
  --line: #dcd8cd;
  --accent: #d9411e;
  --on-accent: #fff;
  --sq-light: #ebe6d8;
  --sq-dark: #b9b196;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0d;
  --surface: #171714;
  --ink: #ecebe4;
  --muted: #8f8c82;
  --line: #2b2a26;
  --accent: #ff6a3d;
  --on-accent: #16150f;
  --sq-light: #4a483f;
  --sq-dark: #2a2924;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 920px; margin: auto; padding-inline: 24px; }
.top-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; }
.brand { font: 600 17px var(--font-display); letter-spacing: -.02em; }
.brand b { color: var(--accent); font-weight: 600; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .15s, transform .3s; }
.icon-button:hover { border-color: var(--muted); transform: rotate(180deg); }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: 500 13px var(--font-body); cursor: pointer; transition: border-color .15s, background .15s; }
.button:hover:not(:disabled) { border-color: var(--muted); background: var(--surface); }
.button:disabled { opacity: .5; cursor: default; }
.intro { padding-block: 56px 36px; }
.intro h1 { margin: 0; font: 600 clamp(40px, 7vw, 72px)/1 var(--font-display); letter-spacing: -.04em; }
.intro p { margin: 16px 0 20px; color: var(--muted); max-width: 46ch; }
.intro > * { animation: up .6s cubic-bezier(.2,.8,.3,1) both; }
.intro p { animation-delay: .08s; }
.intro .button { animation-delay: .16s; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }

.games { border-top: 1px solid var(--line); }
.game { position: relative; display: grid; grid-template-columns: 40px 1fr 150px 20px; align-items: center; gap: 18px; padding: 24px 4px; border-bottom: 1px solid var(--line); transition: padding .25s, background .25s; animation: up .6s cubic-bezier(.2,.8,.3,1) both; }
.game:nth-child(1) { animation-delay: .2s; } .game:nth-child(2) { animation-delay: .28s; } .game:nth-child(3) { animation-delay: .36s; }
.game:hover, .game:focus-visible, .game.picked { padding-inline: 16px; background: var(--surface); }
.game.picked { outline: 2px solid var(--accent); outline-offset: -2px; }
.game:hover .arrow, .game:focus-visible .arrow { color: var(--accent); transform: translateX(4px); }
.num { color: var(--muted); font: 500 13px var(--font-display); font-variant-numeric: tabular-nums; }
.name { display: block; font: 600 clamp(24px, 4vw, 34px)/1.1 var(--font-display); letter-spacing: -.03em; }
.desc { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.meta { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.arrow { color: var(--muted); transition: transform .25s, color .25s; }

/* Pratinjau mini yang bergerak saat disorot */
.preview { position: relative; display: block; width: 150px; height: 84px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.pv-board { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.pv-board i:nth-child(odd) { background: var(--sq-light); }
.pv-board i:nth-child(even) { background: var(--sq-dark); opacity: .55; }
.pv-board .ladder { position: absolute; left: 62%; bottom: 8%; width: 3px; height: 70%; border-inline: 3px solid var(--ink); transform: rotate(18deg); opacity: .85; }
.pv-board .pawn { position: absolute; left: 8%; bottom: 10%; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); transition: transform .8s cubic-bezier(.5,0,.3,1), left .8s, bottom .8s; }
.game:hover .pv-board .pawn { left: 78%; bottom: 72%; }
.pv-cards b { position: absolute; bottom: 12px; left: 50%; display: grid; place-items: center; width: 40px; height: 56px; margin-left: -20px; border: 2px solid var(--surface); border-radius: 7px; color: #fff; font: 600 18px var(--font-display); transition: transform .45s cubic-bezier(.3,1.3,.5,1); box-shadow: 0 1px 3px #0003; }
.pv-cards .c1 { background: #d94a3a; transform: rotate(-14deg) translateX(-18px); }
.pv-cards .c2 { background: #3a68d4; transform: rotate(0); z-index: 1; }
.pv-cards .c3 { background: #e8b422; color: #1b1b18; transform: rotate(14deg) translateX(18px); }
.game:hover .pv-cards .c1 { transform: rotate(-26deg) translateX(-42px) translateY(-4px); }
.game:hover .pv-cards .c2 { transform: translateY(-12px); }
.game:hover .pv-cards .c3 { transform: rotate(26deg) translateX(42px) translateY(-4px); }
.pv-chess { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }
.pv-chess i:nth-child(8n+1), .pv-chess i:nth-child(8n+3), .pv-chess i:nth-child(8n+6), .pv-chess i:nth-child(8n+8) { background: var(--sq-light); }
.pv-chess i:not(:nth-child(8n+1)):not(:nth-child(8n+3)):not(:nth-child(8n+6)):not(:nth-child(8n+8)) { background: var(--sq-dark); }
.pv-chess .knight { position: absolute; left: 3%; top: 53%; width: 19%; height: 40%; background: var(--ink); border-radius: 42% 58% 40% 40%; transition: left .5s cubic-bezier(.5,0,.3,1) .1s, top .5s cubic-bezier(.5,0,.3,1) .1s; }
.pv-chess .knight::before { content: ""; position: absolute; left: 8%; top: -22%; width: 70%; height: 36%; background: inherit; border-radius: 60% 40% 10% 60%; }
.game:hover .pv-chess .knight { left: 53%; top: 3%; }

.hint { margin: 14px 4px 0; color: var(--muted); font-size: 12px; }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font: 500 11px var(--font-body); }

.stats { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.stats-head { display: flex; justify-content: space-between; align-items: baseline; }
.stats h2 { margin: 0; font: 600 28px var(--font-display); letter-spacing: -.03em; }
.stats h3 { margin: 28px 0 10px; font: 600 14px var(--font-display); letter-spacing: -.01em; }
.link-button { border: 0; background: none; padding: 4px; color: var(--muted); font: 12px var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--accent); }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.figures div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.figures b { font: 600 32px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.figures small { margin-left: 2px; color: var(--muted); font-size: 14px; }
.figures span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.split { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { color: var(--muted); font-weight: 500; text-align: right; }
.table td { text-align: right; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.board-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.board-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 13px; counter-increment: rank; }
.board-list li:not(.empty)::before { content: counter(rank); width: 22px; color: var(--muted); font: 500 12px var(--font-display); }
.board-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list li b { font-weight: 500; color: var(--accent); }
.board-list .empty { color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.badges li { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; opacity: .55; transition: opacity .2s, transform .2s; }
.badges li.on { opacity: 1; border-style: solid; border-color: var(--accent); background: var(--surface); }
.badges li:hover { transform: translateY(-2px); opacity: 1; }
.badges b { display: block; font: 600 14px var(--font-display); }
.badges span { color: var(--muted); font-size: 12px; }
.note { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 36px 4px 40px; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .intro { padding-block: 36px 24px; }
  .game { grid-template-columns: 28px 1fr 20px; padding-block: 20px; }
  .preview { display: none; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
