:root {
  --navy: #0B0F17; --panel: #141B28; --line: #263147; --gold: #E8B94A; --gold-ink: #1A1205;
  --text: #EEF1F6; --muted: #98A3B8; --light: #E9D8B8; --dark: #A87C55; --water: #2B5876; --bridge: #7A5A3A;
  --wp: #F6EBD3; --bp: #2B2433;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--text); font-family: 'Barlow', system-ui, sans-serif; }
a { color: var(--gold); }
.cm { max-width: 520px; margin: 0 auto; padding: 16px; }
.cm-top { text-align: center; margin-bottom: 10px; }
.cm-brand { font-family: 'Bebas Neue', 'Barlow', sans-serif; font-size: 34px; letter-spacing: 2px; color: var(--gold); line-height: 1; }
.cm-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.cm-players { display: flex; }
.cm-player { display: flex; align-items: center; gap: 8px; padding: 8px 2px; font-weight: 600; min-width: 0; }
.cm-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-badge { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
.cm-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.cm-dot-w { background: var(--wp); }
.cm-dot-b { background: var(--bp); }
.cm-boardwrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.cm-board { display: grid; width: 100%; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; }
.cm-sq { position: relative; }
.cm-sq.l { background: var(--light); }
.cm-sq.d { background: var(--dark); }
.cm-sq.hole { background: transparent; }
.cm-sq.water { background: var(--water); }
.cm-sq.bridge { background: var(--bridge); }
.cm-sq.last::after { content: ''; position: absolute; inset: 0; background: rgba(232, 185, 74, 0.38); }
.cm-pc { position: absolute; inset: 6%; z-index: 1; }
.cm-pc i { position: absolute; inset: 0; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.cm-pc.w i.f { background: var(--wp); } .cm-pc.w i.o { background: var(--bp); }
.cm-pc.b i.f { background: var(--bp); } .cm-pc.b i.o { background: var(--wp); }
.cm-pc.x i.f { background: var(--gold); } .cm-pc.x i.o { background: var(--bp); }
.cm-result { text-align: center; font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 1px; color: var(--gold); min-height: 28px; margin: 6px 0; }
.cm-steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 12px; }
.cm-steps button { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; min-width: 48px; min-height: 44px; font-size: 18px; cursor: pointer; }
.cm-steps button:focus-visible { outline: 2px solid var(--gold); }
.cm-ply { min-width: 72px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-moves { list-style: none; margin: 0; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 4px 6px; max-height: 220px; overflow: auto; }
.cm-moves li { display: inline-flex; gap: 4px; align-items: baseline; }
.cm-moves .n { color: var(--muted); font-size: 13px; }
.cm-moves button { background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.cm-moves button.on { background: var(--gold); color: var(--gold-ink); }
.cm-moves button.aug { color: var(--gold); font-weight: 400; font-size: 13px; }
.cm-cta { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.cm-btn { display: block; text-align: center; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 700; }
.cm-btn-gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.cm-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.cm-missing { text-align: center; padding-top: 80px; }
.cm-missing p { color: var(--muted); }
