/* The decorate page: the tools, the note, the sheet as it will print, and the pages of a pack.
   The fields take the makers' look (makers.css). */

.decorate { padding: 1.25rem var(--gutter) 0.5rem; overflow-x: clip; }   /* a piece at the sheet's edge never widens the page */
.decorate h1 { font: 500 2.125rem/1.08 var(--serif); font-size: min(2.125rem, 12vw); letter-spacing: -0.018em; margin: 0.25rem 0 0.625rem; }
.decorate .lead { max-width: 40rem; margin: 0 0 1rem; }

/* the tools: buttons, then the fields, then Print; they wrap on a phone */
.decorate-tools { display: grid; gap: 1rem; max-width: 48rem; padding: 1rem 0 0.25rem; border-top: 1px solid var(--hair); }
.tool-buttons, .tool-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.tool-buttons .btn, .tool-actions .btn { flex: 1 1 10rem; min-height: 2.75rem; }
/* a switch's hint, under its label */
.field.check .hint { grid-column: 2; }
.tool-buttons .hint { flex: 1 1 100%; margin: 0; color: var(--stone); font-size: 0.9375rem; line-height: 1.4; }
.tool-buttons .ic, .tool-actions .ic { width: 1.125rem; height: 1.125rem; margin-right: 0.375rem; }
.tool-fields { display: grid; gap: 0.875rem; }
@media (min-width: 44rem) { .tool-fields { grid-template-columns: 1fr 1fr; align-items: start; } }
.field-note { min-height: 0; }
.field-note:empty { display: none; }

.decorate-note { display: flex; align-items: flex-start; gap: 0.5rem; max-width: 48rem; margin: 1rem 0; color: var(--stone); font-size: 0.9375rem; line-height: 1.4; }
.decorate-note .ic { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.125rem; }
.decorate-status { min-height: 1.4em; margin: 0 0 0.75rem; }
.decorate-status.error { color: var(--red, #B83A2E); }
.decorate-kept { margin: 0 0 0.75rem; color: var(--stone); font-size: 0.9375rem; }

/* the sheet: the canvas, white as paper, and over it the pieces, each a box that can be taken hold of */
.sheet { position: relative; width: 100%; max-width: 46rem; margin: 0 0 1rem; box-shadow: 0 1px 4px rgba(26, 25, 23, 0.18); background: #FFFFFF; }
.sheet canvas { display: block; width: 100%; height: auto; }
/* until it is drawn, the sheet keeps a page's room (US Letter): what is below it does not move */
.sheet.waiting { aspect-ratio: 612 / 792; }
.pieces { position: absolute; inset: 0; }

/* a pack's pages */
.pages { display: flex; flex-wrap: wrap; gap: 0.375rem; max-width: 46rem; margin: 0 0 1rem; }
.page-btn { min-width: 2.75rem; min-height: 2.75rem; border: 1px solid var(--stone); border-radius: 6px; background: var(--sheet); color: var(--ink); font: 600 1rem/1 var(--sans); cursor: pointer; }
.page-btn.now { background: var(--ink); color: var(--sheet); }

/* the pickers */
.dlg.pick .dlg-body { display: grid; gap: 1rem; }
.pick-list { display: grid; gap: 1rem; max-height: 60vh; overflow-y: auto; }

/* the advertisement never sits near the sheet or its tools */
.decorate .ad { margin-top: 150px; }

/* a piece's box: clear, with a line round it when it has the focus or was chosen, and its handles */
.piece { position: absolute; box-sizing: border-box; transform-origin: 50% 50%; cursor: move; border: 1px dashed transparent; border-radius: 2px; touch-action: none; }
.piece:hover { border-color: rgba(26, 25, 23, 0.35); }
.piece.chosen, .piece:focus-visible { border: 2px solid var(--ink); outline: 2px solid #FFFFFF; outline-offset: 0; }
.piece .handle { position: absolute; display: none; width: 44px; height: 44px; }
.piece .handle::after { content: ''; position: absolute; inset: 14px; border: 2px solid var(--ink); border-radius: 50%; background: #FFFFFF; }
.piece.chosen .handle, .piece:focus-visible .handle { display: block; }
.piece .handle.turn { top: -50px; left: calc(50% - 22px); cursor: grab; }
.piece .handle.size { right: -22px; bottom: -22px; cursor: nwse-resize; }

/* the chosen piece's buttons, under the sheet */
.piece-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; max-width: 46rem; margin: 0 0 1rem; }
.piece-tools .piece-name { flex: 1 1 100%; margin: 0; color: var(--stone); font-size: 0.9375rem; overflow-wrap: anywhere; }
.piece-tools .btn { flex: 1 1 6rem; min-height: 2.75rem; }

/* the pickers' lists: a group's heading over its buttons; a figure is its drawing */
.pick-group h3 { margin: 0 0 0.5rem; font: 600 1rem/1.3 var(--sans); }
.pick-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick-buttons .btn { flex: 1 1 9rem; min-height: 2.75rem; }
.pick-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); gap: 0.5rem; }
.figure-btn { display: grid; place-items: center; min-width: 2.75rem; min-height: 4.5rem; padding: 0.25rem; border: 1px solid var(--hair); border-radius: 6px; background: #FFFFFF; cursor: pointer; }
.figure-btn:hover, .figure-btn:focus-visible { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 1px; }
.figure-btn .thumb svg { display: block; width: 4rem; height: 4rem; }

/* the game page's link to the decorate page, under its buttons */
.decorate-offer a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* the background's label stands over its buttons as a field's does */
.field-label { font: 600 1.0625rem/1.3 var(--sans); }
.sheet.dropping { outline: 3px dashed var(--ink); outline-offset: 4px; }
