* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: radial-gradient(circle at top left, #eef5ff, #f8fafc 45%, #eef2f7);
}
.app { max-width: 1220px; margin: 0 auto; padding: 32px 18px 48px; }
.hero {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  margin-bottom: 24px; padding: 28px; border-radius: 28px;
  background: rgba(255,255,255,.88); box-shadow: 0 18px 50px rgba(27, 39, 65, .10);
  border: 1px solid rgba(148, 163, 184, .22);
}
.eyebrow { margin: 0 0 8px; color: #2563eb; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 4rem); line-height: .95; }
.subtitle { max-width: 760px; color: #526078; font-size: 1.06rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
button {
  border: 0; padding: 12px 18px; border-radius: 999px; font-weight: 800; cursor: pointer;
  background: #2563eb; color: #fff; box-shadow: 0 12px 28px rgba(37, 99, 235, .22);
}
button.secondary { background: #e8eef8; color: #172033; box-shadow: none; }
.layout { display: grid; grid-template-columns: minmax(320px, 620px) 1fr; gap: 22px; align-items: start; }
.board-card, .panel { border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: 0 18px 50px rgba(27,39,65,.10); border: 1px solid rgba(148,163,184,.22); }
.board-card { padding: 18px; position: sticky; top: 18px; }
.board-header { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.board-header > div { padding: 12px 14px; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 18px; }
.label { margin: 0 0 4px; color: #64748b; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.board {
  width: min(100%, 560px); aspect-ratio: 5 / 8; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(8, 1fr);
  border: 5px solid #26415f; border-radius: 16px; overflow: hidden; background: #26415f;
}
.square {
  position: relative; display: grid; place-items: center; border: 1px solid rgba(38,65,95,.48);
  background: #f8fbff; transition: background .15s ease, transform .15s ease;
}
.square.dark { background: #dfe9f6; }
.square::before { content: attr(data-pos); position: absolute; left: 6px; top: 4px; font-size: .68rem; font-weight: 800; color: rgba(23,32,51,.42); }
.square.selected { outline: 4px solid #f59e0b; outline-offset: -4px; }
.square.legal::after {
  content: ""; width: 28%; aspect-ratio: 1; border-radius: 50%; background: rgba(37,99,235,.26);
  position: absolute;
}
.square.capture::after { background: rgba(239,68,68,.32); width: 68%; border: 3px solid rgba(239,68,68,.62); }
.piece { width: 78%; height: 78%; object-fit: contain; position: relative; z-index: 2; filter: drop-shadow(0 8px 6px rgba(15,23,42,.22)); user-select: none; }
.panel { padding: 18px; display: grid; gap: 14px; }
.status-card { padding: 18px; border-radius: 22px; background: #f8fafc; border: 1px solid #e2e8f0; }
.status-highlight { background: linear-gradient(135deg, #f8fafc, #eef5ff); }
.status-card h2, summary { margin: 0 0 10px; font-size: 1.05rem; font-weight: 900; cursor: pointer; }
.status-card p, li, .move-table span { color: #526078; line-height: 1.55; }
ul, ol { padding-left: 20px; margin: 0; }
.compact-list li { margin-bottom: 8px; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.score-grid div { padding: 12px; border-radius: 16px; background: #fff; border: 1px solid #e2e8f0; }
.score-grid span { display: block; color: #64748b; font-size: .82rem; font-weight: 800; }
.score-grid strong { display: block; margin-top: 4px; font-size: 1.7rem; }
.move-table { display: grid; gap: 10px; }
.move-table div { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; }
.move-table div:last-child { border-bottom: 0; padding-bottom: 0; }
.points-table { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; align-items: center; }
.points-table span { color: #526078; }
.points-table strong { padding: 5px 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; }
.small-note { font-size: .9rem; margin-top: 0; }
.history { margin: 0; padding-left: 22px; max-height: 220px; overflow: auto; color: #526078; }
.history li { margin-bottom: 6px; }
.win { color: #047857 !important; font-weight: 900; }
@media (max-width: 860px) { .hero, .layout { grid-template-columns: 1fr; } .hero { flex-direction: column; align-items: flex-start; } .board-card { position: static; } }
