:root { --bg: #0b0d12; --card: #151821; --line: #2a2f3d; --text: #e8eaf0; --muted: #9aa1b2; --accent: #e0a85c; --accent2: #22d3ee; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 600px at 20% -10%, #2a1d0e 0%, transparent 60%), var(--bg); color: var(--text); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; display: flex; flex-direction: column; }
a { color: var(--accent2); text-decoration: none; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.brand { color: var(--text); font-weight: 700; font-size: 20px; display: flex; gap: 6px; align-items: center; }
.by { color: var(--muted); font-size: 14px; }
.stone { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; }
.stone.b { background: radial-gradient(circle at 35% 35%, #555, #000 70%); }
.stone.w { background: radial-gradient(circle at 35% 35%, #fff, #c9c9c9 75%); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.lobby { max-width: 920px; margin: 24px auto; padding: 32px; }
.lobby h1 { margin: 0 0 4px; font-size: 34px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.row { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.row label { color: var(--muted); }
.seg { display: inline-flex; background: #0e1016; border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; font: inherit; }
.seg button.on { background: var(--accent); color: #1b1307; font-weight: 600; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.modes section { background: #0f1218; border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modes h2 { margin: 0; font-size: 18px; }
.modes p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
button { font: inherit; }
.go, .btns button, #joinForm button, #copy { background: linear-gradient(135deg, var(--accent), #c7803a); color: #1b1307; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; }
.btns button, #joinForm button, #copy { background: #232838; color: var(--text); font-weight: 500; }
.btns button:hover, #joinForm button:hover { background: #2d3347; }
#joinForm { display: flex; gap: 6px; }
#joinForm input, .share input { flex: 1; min-width: 0; background: #0b0d12; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit; text-transform: uppercase; }
.share input { text-transform: none; font-size: 13px; }
.game { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 0 24px 24px; max-width: 1280px; width: 100%; margin: 0 auto; align-items: start; }
.boardWrap { display: flex; justify-content: center; }
canvas#board { width: min(100%, calc(100vh - 120px)); aspect-ratio: 1; border-radius: 10px; box-shadow: 0 30px 60px rgba(0,0,0,.5); cursor: pointer; touch-action: manipulation; }
.side { padding: 20px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.mode { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.status { font-size: 20px; font-weight: 600; min-height: 30px; }
.status.err { color: #f87171; font-size: 15px; }
.caps div { padding: 4px 0; }
.caps i { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 4px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.chk { color: var(--muted); font-size: 14px; }
.rules { color: var(--muted); font-size: 12px; margin: 0; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }
@media (max-width: 820px) { .modes { grid-template-columns: 1fr; } .game { grid-template-columns: 1fr; padding: 0 10px 20px; } .side { position: static; } }
