:root {
  color-scheme: dark;
  --bg: linear-gradient(135deg, #09111f 0%, #111827 45%, #172554 100%);
  --panel: rgba(15, 23, 42, 0.88);
  --panel-2: rgba(30, 41, 59, 0.8);
  --line: rgba(148, 163, 184, 0.18);
  --text: #eff6ff;
  --muted: #cbd5e1;
  --accent: #38bdf8;
  --white: #f8fafc;
  --black: #0f172a;
  --light-square: #f1d6a5;
  --dark-square: #8b5e34;
  --highlight: rgba(56, 189, 248, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 18px 48px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: stretch;
}

.hero-card,
.board-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 8px;
}

h1, h2 { margin: 0; }

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.05;
}

.lead {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 12px;
}

.feature-list {
  margin: 18px 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.board-header,
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.status-row {
  margin-top: 14px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.pill-accent { color: #e0f2fe; background: rgba(56, 189, 248, 0.12); }

.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.ghost-btn:hover { background: rgba(56, 189, 248, 0.12); transform: translateY(-1px); }

.board {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 2px solid #5b4630;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.square {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  font-weight: 700;
  font-size: 0.95rem;
  user-select: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.square.light { background: var(--light-square); color: #5b4630; }
.square.dark { background: var(--dark-square); color: #fff7ed; }
.square.selected { outline: 3px solid #facc15; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35); }
.square.highlight { background: rgba(34, 197, 94, 0.28); }
.square:hover { transform: scale(1.01); }

.piece {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  border: 2px solid rgba(255,255,255,0.45);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
  cursor: pointer;
}

.piece.white { background: linear-gradient(145deg, #ffffff, #dbeafe); color: #0f172a; }
.piece.black { background: linear-gradient(145deg, #1f2937, #111827); color: #f8fafc; }
.piece.king::after {
  content: '♔';
  font-size: 0.85rem;
  position: absolute;
  top: 6px;
  right: 6px;
  color: #fbbf24;
}

.hint-text {
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { padding: 18px 12px 32px; }
  .hero-card, .board-card { padding: 18px; border-radius: 18px; }
  .piece { font-size: 1rem; }
}
