:root {
  color-scheme: light;
  font: 16px/1.45 system-ui, sans-serif;
  background: #e8d8b9;
  color: #242d29;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 990px; margin: auto; padding: 18px clamp(12px, 4vw, 42px) 28px; }
header, .scoreboard, .actions, .mode-label { display: flex; align-items: center; gap: .6rem; }
header, .scoreboard { justify-content: space-between; }
header a { color: #254c40; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.mode-label { font-size: .88rem; }
button, select, input { font: inherit; }
select, button { border: 1px solid #486254; border-radius: 8px; color: #253f36; background: #fffaf0; cursor: pointer; }
select { min-height: 44px; padding: .3em .45em; }
button { min-height: 44px; padding: .5rem .85rem; }
button:disabled, select:disabled, input:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #a64410; outline-offset: 2px; }
h1, h2 { font: normal 1.65rem/1.08 Georgia, serif; }
h1 { margin: .35em 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.045em; }
h2, #score { margin: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, 1fr); gap: 22px; align-items: start; }
#board { width: 100%; height: auto; display: block; border-radius: 18px; box-shadow: 0 4px 14px #51361d33; touch-action: pinch-zoom; user-select: none; }
.panel { padding: clamp(14px, 2vw, 26px); border-radius: 16px; border: 1px solid #41443844; background: #fffaf0; }
.scoreboard { align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; }
#score { font-size: .9rem; font-weight: 700; }
#message { min-height: 2.9em; margin: .65em 0; color: #3c493e; }
.sliders { display: grid; gap: .35rem; }
.sliders label { font-weight: 650; font-size: .92rem; }
.sliders input { display: block; width: 100%; min-width: 0; height: 30px; margin: 0; accent-color: #295342; }
.actions { margin-top: .4rem; flex-wrap: wrap; }
.primary { background: #264e40; color: white; font-weight: 700; }
details { margin-top: 1rem; border-top: 1px solid #998d75; }
summary { padding: .65rem 0; cursor: pointer; font-weight: 650; }
details p { max-width: 65ch; margin: .25rem 0 1rem; }
@media (max-width: 650px) {
  main { padding: 6px 12px 22px; }
  .layout { grid-template-columns: 1fr; gap: 8px; }
  .table { width: min(100%, 48svh); justify-self: center; }
  h1 { margin: .14em 0 .22em; }
  .panel { padding: 8px 12px 10px; }
  h2 { font-size: 1.23rem; }
  #score { font-size: .79rem; }
  #message { font-size: .88rem; margin: .35em 0; min-height: 2.9em; }
  .sliders { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
  .sliders label { font-size: .81rem; }
  .sliders input { height: 34px; }
  .actions { margin-top: 2px; }
  .actions button { flex: 1; }
  details { margin-top: .55rem; }
}
