/* Readable layer for the games. Loaded last, so it calms the look without touching the game rules.
   Plain sans-serif, 18px body text, short lines, left-aligned, no italics or all-caps, one clear main button. */
:root {
  --muted: #2a2a2a;
}
[data-theme="autumn"] { --muted: #4a3624; }
[data-theme="moonlight"] { --muted: #d6daf0; }
body { font-size: 1.1875rem; line-height: 1.6; text-align: left; letter-spacing: .01em; }
h1, h2, h3, legend, summary, button, .button { text-transform: none; letter-spacing: 0; }
h1 { font-size: 2.1rem; line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.55rem; line-height: 1.3; margin: 0 0 .75rem; }
h3 { font-size: 1.3rem; }
p, li, label, summary, legend, td, th, caption, .hint, .tagline, .optional-note, .notice, .confirm, .game-footer { font-size: 1.1875rem; }
p { margin: 0 0 1rem; max-width: 36rem; }
em, i, cite, address { font-style: normal; }
.hint, .tagline { color: var(--muted); }
.plain-list, .howto ol { margin: 0 0 1rem; padding-left: 1.4rem; max-width: 36rem; }
.plain-list li, .howto li { margin-bottom: .5rem; }

/* Calm, uncluttered layout: one column, plenty of space. */
.game-shell { max-width: 40rem; padding: 1.25rem 1rem 5rem; }
.game-header { margin-bottom: 1.5rem; }
.game-header > :last-child { margin-bottom: 0; }
.game-header .leave { min-height: 48px; margin-bottom: 1rem; font-weight: 700; }
.optional-note { margin-bottom: 0; padding: .85rem 1rem; border: 1px solid var(--chrome-line); border-radius: var(--chrome-radius); }
.panel { margin: 0 0 1.5rem; padding: 1.25rem; border: 1px solid var(--chrome-line); border-radius: var(--chrome-radius); box-shadow: var(--chrome-shadow); }
.howto { margin: 0 0 1.5rem; }
.howto > summary { font-weight: 700; font-size: 1.3rem; }
.howto[open] > summary { margin-bottom: .5rem; }

/* One button style everywhere: outlined, or solid green for the one main action. Same size, same shape, no shadow. */
button, .button, select, input[type="number"], input[type="file"]::file-selector-button {
  font-size: 1.1875rem; font-weight: 600; min-height: 48px; padding: .6rem 1.1rem;
  border: 1px solid currentColor; border-radius: var(--chrome-btn-radius); box-shadow: none; text-decoration: none;
}
select, input[type="number"] { border-color: var(--chrome-field); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button[aria-disabled="true"] { border-style: dashed; border-color: var(--chrome-field); }
input[type="number"] { width: 5.5rem; box-shadow: none; }
button[aria-disabled="true"] { box-shadow: none; }
input[type="checkbox"], input[type="radio"] { width: 1.5rem; height: 1.5rem; accent-color: var(--accent); }
.row { gap: .75rem; margin-bottom: .75rem; }
.row:last-child { margin-bottom: 0; }
.check, .calm-check { font-size: 1.125rem; }
summary { font-size: 1.125rem; }

/* Phone: buttons fill the line so a thumb can hit them anywhere. */
@media (max-width: 560px) {
  .row > button, .row > a.button, .row > label.button { flex: 1 1 100%; justify-content: center; text-align: center; }
  .row > label:not(.button):not(.check) { flex: 1 1 100%; }
  .row select { width: 100%; }
  h1 { font-size: 1.9rem; }
}

/* Little Haven */
.tile-label { font-size: .8rem; line-height: 1.1; }
.sun-count { font-size: 1.6rem; margin: 0; }
.mode-card { border-width: var(--line); border-radius: var(--radius); padding: 1rem; }
.mode-card:has(input:checked) { background: var(--pop-yellow); color: var(--pop-ink); border-width: 4px; }
#tile-actions button, #expansions button { text-align: left; }

/* Meadow Circle: the moving buttons come right after the meadow, with Pause under them. */
body[data-screen="play"] .comfort-group:first-child, body[data-screen="play"] .tagline, body[data-screen="play"] .optional-note, body[data-screen="play"] .howto { display: none; }
#play { display: flex; flex-direction: column; }
#play > * { order: 6; }
#play > .hud { order: 1; margin-bottom: 1rem; }
#pause-panel, #leave-panel { order: 2; }
#play > .arena-wrap { order: 3; }
#play > .controls { order: 4; }
#play > .actions { order: 5; }
.arena-wrap { width: 100%; max-width: 30rem; }
.controls { grid-template-columns: repeat(3, minmax(0, 5rem)); gap: .6rem; margin-bottom: 1.25rem; }
.dpad { height: 4.5rem; font-size: 1.7rem; }
.actions { justify-content: stretch; }
.actions > button { flex: 1 1 8rem; }
#pause { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.you-mark, .bot-num { font-size: .7rem; font-weight: 700; }
.summary-table th, .summary-table td { padding: .5rem .75rem; }
.a11y-grid, .a11y-grid caption { font-size: 1rem; }

@media (forced-colors: active) { .panel, button, .optional-note, .mode-card { border-color: CanvasText; } }

/* Phone, during play: keep the meadow, arrows and Pause on one screen so one thumb can reach them. */
@media (max-width: 560px) {
  .arena-wrap { max-width: 17rem; }
  body[data-screen="play"] .comfort-bar { padding: .5rem; }
  body[data-screen="play"] .comfort-root { margin-bottom: .75rem; }
  .hud { padding: .5rem 1rem; margin-bottom: .75rem; }
  .controls { margin-bottom: .75rem; }
  .dpad { height: 3.5rem; }
  /* One row of four arrows, then Pause: short enough that the meadow, arrows and Pause fit one phone screen. */
  .controls { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "left up down right"; gap: .5rem; justify-content: stretch; }
  body[data-screen="play"] .game-header { display: none; }
}
.game-footer a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
