:root {
  --bg: #f4ead9;
  --ink: #2b1d12;
  --muted: #7a6450;
  --panel: #fffaf1;
  --line: #e2d3bb;
  --wood: #a86b3c;
  --wood-dark: #6e4223;
  --copper: #c8743a;
  --copper-hi: #f0b27a;
  --accent: #b5462b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1510;
    --ink: #f3e7d6;
    --muted: #b49c84;
    --panel: #2a2019;
    --line: #463629;
    --wood: #8a552e;
    --wood-dark: #4d2d16;
    --accent: #e0714f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Inter, system-ui, sans-serif;
}
header, main, footer { max-width: 640px; margin: 0 auto; padding: 0 16px; }
header { text-align: center; padding-top: 32px; }
h1 { font: 900 clamp(2.4rem, 9vw, 3.6rem)/1 Fraunces, Georgia, serif; margin: 0; color: var(--copper); }
h2 { font: 700 1.4rem Fraunces, Georgia, serif; margin: 0 0 12px; }
.tagline { color: var(--muted); margin: 8px 0 24px; }
footer { text-align: center; color: var(--muted); font-size: .9rem; padding-bottom: 32px; }
footer a { color: var(--accent); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
button {
  font: 600 1rem Inter, sans-serif;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  border: 1px solid var(--line);
}
button:disabled { opacity: .4; cursor: default; }
.primary { background: var(--accent); color: #fff; border-color: transparent; min-width: 120px; }
.ghost { background: transparent; color: var(--ink); }
input, select {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.player-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.player-row > input { flex: 1; min-width: 0; }
.bot, .pick { display: flex; gap: 6px; align-items: center; color: var(--muted); white-space: nowrap; }
.x { padding: 6px 12px; }

/* board */
.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: repeating-linear-gradient(100deg, var(--wood) 0 14px, var(--wood-dark) 14px 16px, var(--wood) 16px 30px);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .25);
}
.hole {
  position: relative;
  aspect-ratio: 1 / 1.4;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, .5);
  display: grid;
  place-items: center;
}
.hole .num { position: absolute; top: 6px; color: #fff; font-weight: 800; opacity: .8; }
.hole.six { background: #120b06; }
.hole .drop { position: absolute; bottom: 8px; font-size: .7rem; color: #f3e7d6; opacity: .8; }
.hole.hit { outline: 3px solid #ffd27a; outline-offset: 2px; }
.penny {
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--copper-hi), var(--copper) 55%, #8a4a1f);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
}
.hole.full.hit .penny { animation: drop .3s ease-out; }
@keyframes drop { from { transform: translateY(-40%) scale(1.2); opacity: 0; } }
.penny.mini { width: 14px; display: inline-block; margin-left: 6px; vertical-align: -2px; }

/* play panel */
.play { display: grid; justify-items: center; text-align: center; }
.die {
  width: 72px; height: 72px; padding: 10px;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  background: #fffdf8; border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}
.die.blank { opacity: .35; }
.die span { display: grid; place-items: center; }
.die .pip::after { content: ''; width: 11px; height: 11px; border-radius: 50%; background: #2b1d12; }
.msg { min-height: 3em; margin: 12px 0 0; }
.odds { color: var(--muted); font-size: .85rem; margin: 0; }

.players { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 6px; }
.players li {
  display: flex; justify-content: space-between;
  padding: 10px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
}
.players li.up { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.players li.won { background: var(--copper); color: #fff; }
.players small { color: var(--muted); font-size: .7rem; font-weight: 600; }
.count { font-weight: 800; }
