:root { --bg: #0b0d12; --card: #151821; --line: #2a2f3d; --text: #e8eaf0; --muted: #9aa1b2; --accent: #8b5cf6; --accent2: #22d3ee; --light: #ecd9b9; --dark: #a77b58; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 600px at 80% -10%, #1f1638 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: 8px; align-items: center; }
.logo { font-size: 24px; }
.by { color: var(--muted); font-size: 14px; }
.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; }
.seg { display: inline-flex; background: #0e1016; border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); padding: 7px 10px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 14px; }
.seg button.on { background: var(--accent); color: #fff; 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 { background: linear-gradient(135deg, var(--accent), #6d28d9); color: #fff; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; }
.btns button, #joinForm button, #copy { background: #232838; color: var(--text); border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.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; flex-direction: column; align-items: center; gap: 6px; }
.tag { width: min(100%, calc(100vh - 170px)); color: var(--muted); font-size: 14px; min-height: 20px; }
.board { width: min(100%, calc(100vh - 170px)); aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr); border-radius: 10px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.5); user-select: none; }
.sq { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; container-type: size; }
.sq.l { background: var(--light); } .sq.d { background: var(--dark); }
.sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(250, 204, 21, .38); }
.sq.sel::before { content: ""; position: absolute; inset: 0; background: rgba(34, 211, 238, .45); }
.sq.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(239,68,68,.95) 0%, rgba(239,68,68,.35) 55%, transparent 75%); }
.sq.dot::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(20, 20, 30, .28); }
.sq.ring::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid rgba(20, 20, 30, .28); }
.pc { position: relative; z-index: 1; font-size: 78cqh; line-height: 1; font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", serif; }
.pc.w { color: #fff; text-shadow: 0 0 1px #000, 0 1px 1px #000, 0 -1px 1px #000, 1px 0 1px #000, -1px 0 1px #000, 0 3px 4px rgba(0,0,0,.35); }
.pc.b { color: #15131a; text-shadow: 0 1px 0 rgba(255,255,255,.25), 0 3px 4px rgba(0,0,0,.35); }
.coord { position: absolute; font-size: 16cqh; font-weight: 600; opacity: .7; z-index: 1; }
.coord.f { right: 4%; bottom: 2%; } .coord.r { left: 4%; top: 2%; }
.sq.l .coord { color: var(--dark); } .sq.d .coord { color: var(--light); }
.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; }
.promo { color: var(--muted); font-size: 14px; }
.promo select { background: #0b0d12; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font: inherit; }
.moves { margin: 0; padding: 8px 8px 8px 36px; max-height: 260px; overflow: auto; background: #0f1218; border: 1px solid var(--line); border-radius: 12px; font: 14px/1.7 ui-monospace, Menlo, monospace; columns: 1; }
.moves li span { display: inline-block; width: 70px; }
.moves:empty { display: none; }
.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; }
.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; } .board, .tag { width: 100%; } }
