:root { --light: #e9d8c3; --dark: #a77d5a; --accent: #E86CA8; --bg: #231E33; --fg: #f5f0ff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: system-ui, sans-serif; }
body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; }
header { text-align: center; }
h1 { margin: 4px 0; font-size: 1.3rem; color: var(--accent); }
h1 small { color: #aaa; font-weight: normal; font-size: 0.7em; }
.modes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.modes button { background: #3a3352; color: var(--fg); border: 2px solid transparent; border-radius: 6px; padding: 6px 10px; font-size: 0.9rem; }
.modes button.active { border-color: var(--accent); }
#seats { font-size: 0.9rem; opacity: 0.85; }
#board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(92vw, 70vh, 480px); aspect-ratio: 1; border: 4px solid #3a3352; }
.sq { position: relative; border: none; margin: 0; padding: 0; font-size: clamp(22px, 7vw, 44px); line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #111; }
.sq.light { background: var(--light); }
.sq.dark { background: var(--dark); }
.sq.last { background-image: linear-gradient(rgba(232,108,168,.35), rgba(232,108,168,.35)); }
.sq.selected { box-shadow: inset 0 0 0 4px var(--accent); }
.sq.check { background: #e5484d !important; }
.sq.target::after { content: ''; width: 28%; height: 28%; border-radius: 50%; background: rgba(0,0,0,.25); position: absolute; }
.sq.capture::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 4px solid rgba(0,0,0,.3); }
.coord { position: absolute; font-size: 10px; font-family: monospace; opacity: .6; }
.coord.rank { top: 2px; left: 3px; }
.coord.file { bottom: 2px; right: 3px; }
#status { min-height: 1.4em; margin: 4px 0; font-size: 0.95rem; text-align: center; }
.piece { width: 88%; height: 88%; pointer-events: none; }

dialog#terms { background: #2c2642; color: var(--fg); border: 2px solid var(--accent); border-radius: 10px; max-width: min(92vw, 460px); padding: 16px; }
dialog#terms::backdrop { background: rgba(0,0,0,.7); }
dialog#terms h2 { margin: 0 0 8px; color: var(--accent); font-size: 1.15rem; }
.terms-body { font-size: 0.85rem; line-height: 1.45; max-height: 50vh; overflow-y: auto; }
.terms-body a { color: var(--accent); }
#accept { margin-top: 12px; width: 100%; padding: 10px; border: none; border-radius: 6px; background: var(--accent); color: #231E33; font-weight: 600; font-size: 0.95rem; }
