/* Pocket Terrarium: a small glasshouse of soft squares. First-party CSS only, no images, no animation.
   Piece colours are fixed so they read the same in Meadow and Dusk; the frame follows the theme. */
/* The shared readable layer sets a dark --muted on :root, which would hide hint text in Dusk. Restore Dusk's own value here. */
html[data-calm-theme="dusk"] { --muted: #A9B8B8; }
.hint { color: var(--muted); font-size: .95rem; }
.notice { padding: .6rem .8rem; border: var(--line) dashed var(--border); border-radius: var(--radius-sm); background: var(--note); }
.confirm { margin-top: .75rem; padding: .6rem .8rem; border: var(--line) solid var(--border); border-radius: var(--radius-sm); background: var(--note); }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.game-footer { margin-top: 1.5rem; }
.game-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; }

/* Square size is set from the screen width, not the newer ratio property, so it also works on iOS Safari 14.
   72px covers the page and panel padding; glasshouses are 3, 4 or 5 squares wide and squares never go under 44px at 320px. */
.board { --n: 4; --gap: 2px; --tile: min(5.5rem, calc((100vw - 72px - (var(--n) - 1) * var(--gap)) / var(--n))); display: grid; gap: var(--gap); width: max-content; max-width: 100%; margin: .75rem auto 0; padding: var(--gap); border: var(--line) solid var(--border); border-radius: var(--radius); background: var(--border); box-shadow: var(--shadow); }
.board-row { display: grid; grid-template-columns: repeat(var(--n), var(--tile)); gap: var(--gap); }
.tile { position: relative; display: flex; align-items: center; justify-content: center; width: var(--tile); height: var(--tile); min-width: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 4px; box-shadow: none; background: #dfeee6; font: inherit; line-height: 1; color: #12261a; cursor: pointer; }
.tile:active { transform: none; box-shadow: none; }
.tile:focus { outline: 4px solid var(--focus); outline-offset: -4px; z-index: 1; }
.piece { display: flex; align-items: center; justify-content: center; width: 70%; height: 70%; font-size: 1.4rem; font-weight: 700; pointer-events: none; }
/* Each piece has its own shape and its own mark, so colour is never the only clue. */
.piece.leaf { background: #6fa57a; border-radius: 0 100% 0 100%; }
.piece.stone { background: #b8b4aa; border-radius: 50%; }
.piece.water { background: #7fb7c9; border-radius: 40% 40% 50% 50% / 30% 30% 70% 70%; }

.status { min-height: 1.7rem; margin: .75rem 0; }
.actions { margin-top: .5rem; }
.panel.board-panel { padding-left: .75rem; padding-right: .75rem; }

.tools, .sizes { border: 0; margin: 0; padding: 0; }
.tools legend, .sizes legend { font-weight: 700; padding: 0; margin-bottom: .5rem; }
.tool-option, .size-option { display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: .4rem .9rem; border: var(--line) solid var(--border); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.tool-option input, .size-option input { width: 1.5rem; height: 1.5rem; flex: none; }
@media (forced-colors: active) { .tile, .piece { border: 1px solid CanvasText; } }
