/* Checkers — club table: walnut board, felt backdrop, enamel pieces. */
:root {
  --felt: #1e4d33;
  --dark-sq: #7a4a24;
  --light-sq: #ecd9b5;
  --frame: #3d2412;
  --red-piece: #b0262a;
  --red-edge: #7c1518;
  --black-piece: #262626;
  --black-edge: #0a0a0a;
  --hint: #f4c430;
  --paper: #f6efe0;
  --ink: #241a10;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--felt);
  color: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header { text-align: center; padding: 1.8rem 1rem 0.4rem; }
h1 {
  font-family: 'Graduate', serif;
  font-size: clamp(2.4rem, 8vw, 4rem);
  letter-spacing: 0.18em;
  color: var(--paper);
  text-shadow: 0 3px 0 var(--frame);
}
.tagline { color: #a8c8b4; font-weight: 600; margin-top: 0.3rem; }

main { flex: 1; width: min(620px, 100% - 1.5rem); margin: 1.2rem auto; }
footer { text-align: center; padding: 1rem; color: #a8c8b4; font-size: 0.85rem; }
footer a { color: var(--hint); }

.turn-banner { text-align: center; font-size: 1.1rem; margin-bottom: 0.9rem; min-height: 1.6em; }
.turn-banner strong.b { color: #dcdcdc; } .turn-banner strong.r { color: #ff8a80; }
.turn-banner .forced { color: var(--hint); font-weight: 600; }

.board {
  display: grid; grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1; width: 100%;
  border: 14px solid var(--frame); border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.45), inset 0 0 0 2px rgba(236,217,181,0.3);
}
.sq { position: relative; display: grid; place-items: center; }
.sq.light { background: var(--light-sq); }
.sq.dark { background: var(--dark-sq); }
.sq.target { cursor: pointer; }
.sq.target::after {
  content: ''; width: 34%; height: 34%; border-radius: 50%;
  background: var(--hint); opacity: 0.85; box-shadow: 0 0 10px var(--hint);
}

.piece {
  width: 76%; height: 76%; border-radius: 50%; cursor: default; position: relative;
  display: grid; place-items: center; font-size: clamp(0.9rem, 3.4vw, 1.5rem);
}
.piece.b { background: radial-gradient(circle at 35% 30%, #4d4d4d, var(--black-piece) 60%);
  box-shadow: 0 3px 0 var(--black-edge), inset 0 0 0 4px rgba(255,255,255,0.12); }
.piece.r { background: radial-gradient(circle at 35% 30%, #d8514f, var(--red-piece) 60%);
  box-shadow: 0 3px 0 var(--red-edge), inset 0 0 0 4px rgba(255,255,255,0.18); }
.piece.movable { cursor: pointer; }
.piece.movable:hover, .piece.selected { outline: 3px solid var(--hint); outline-offset: 2px; }
.piece .crown { color: var(--hint); text-shadow: 0 1px 1px rgba(0,0,0,0.6); }

.scoreline { display: flex; justify-content: space-between; margin-top: 0.7rem;
  font-weight: 600; font-size: 0.95rem; }
.scoreline .b { color: #dcdcdc; } .scoreline .r { color: #ff8a80; }

/* ---- win overlay ---- */
.overlay { position: fixed; inset: 0; background: rgba(10, 26, 17, 0.88);
  display: grid; place-items: center; z-index: 10; }
.overlay .box { background: var(--paper); color: var(--ink); border: 4px solid var(--frame);
  border-radius: 16px; padding: 2.5rem; text-align: center; max-width: 90vw; }
.overlay h2 { font-family: 'Graduate', serif; font-size: 2rem; }
.overlay p { margin: 1rem 0; font-size: 1.1rem; }

button {
  font: inherit; font-weight: 600; cursor: pointer; border: none; border-radius: 10px;
  padding: 0.7rem 1.5rem; background: var(--frame); color: var(--paper);
}
button:active { transform: translateY(1px); }
