/*
 * designer-puzzle.css — the custom puzzle designer (partials/designers/puzzle.php, assets/js/designer-puzzle.js):
 * tabs, mode cards, quick texts, fonts, icons, size / grid chips (a grid too small for the size is greyed out:
 * .is-off), the pattern button and the per-letter colour rows of the name puzzle. Scoped to .designer-puzzle.
 */
.designer-puzzle .pz-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 14px 0 2px;
    background: var(--bg-alt); border: 1px solid var(--line); border-radius: 14px; position: sticky; top: 72px; z-index: 4; }
.designer-puzzle .pz-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border: 0; border-radius: 10px;
    background: transparent; color: var(--ink-2); font: inherit; font-weight: 650; font-size: .92rem; cursor: pointer; transition: background .15s, color .15s; }
.designer-puzzle .pz-tab .icon { width: 16px; height: 16px; }
.designer-puzzle .pz-tab:hover { color: var(--accent-text); }
.designer-puzzle .pz-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.designer-puzzle .pz-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.designer-puzzle .pz-panel .opt:first-child { border-top: 0; }
.designer-puzzle [hidden] { display: none !important; }

.designer-puzzle .pz-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.designer-puzzle .pz-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.designer-puzzle .pz-preset { font-size: .8rem; padding: 5px 11px; border-radius: 999px; }
.designer-puzzle .pz-line { margin-bottom: 8px; }
.designer-puzzle .pz-line input { font-size: 1.05rem; font-weight: 650; }
.designer-puzzle .pz-label-row { display: flex; justify-content: space-between; gap: 8px; }
.designer-puzzle .pz-label-row em { font-style: normal; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.designer-puzzle .pz-fonts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .designer-puzzle .pz-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.designer-puzzle .pz-font > span { justify-items: start; text-align: left; padding: 8px 10px; min-height: 64px; align-content: center; overflow: hidden; }
.designer-puzzle .pz-font-sample { font-size: 1.15rem; line-height: 1.15; font-weight: 400; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.designer-puzzle .pz-font input:checked + span .pz-font-sample { color: var(--accent-text); }

.designer-puzzle .pz-icons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .designer-puzzle .pz-icons { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.designer-puzzle .pz-icon > span { padding: 8px 4px 6px; gap: 2px; }
.designer-puzzle .pz-icon canvas { width: 32px; height: 32px; color: var(--accent-text); }
.designer-puzzle .pz-icon-none { display: grid; place-items: center; width: 32px; height: 32px; font-style: normal; font-size: 1.3rem; color: var(--muted); }
.designer-puzzle .pz-icon small { font-size: .74rem; }

.designer-puzzle .pz-sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.designer-puzzle .pz-grids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
@media (max-width: 420px) { .designer-puzzle .pz-grids { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.designer-puzzle .pz-grids .ochip.is-off { opacity: .4; cursor: not-allowed; }
.designer-puzzle .pz-grids .ochip.is-off span { text-decoration: line-through; }
.designer-puzzle .pz-seed-btn { margin-left: auto; font-size: .8rem; padding: 5px 12px; }
.designer-puzzle .pz-seed { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.designer-puzzle .pz-seed input { width: 7em; }
.designer-puzzle [data-pz-gridnote] { display: block; }

.designer-puzzle .pz-schemes { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.designer-puzzle .pz-lc { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 0; border-radius: 10px; }
.designer-puzzle .pz-lc-head { display: flex; flex-direction: column; align-items: center; }
.designer-puzzle .pz-lc-head em { font-size: .68rem; font-style: normal; color: var(--muted); text-align: center; line-height: 1.1; }
.designer-puzzle .pz-letter { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 8px; background: var(--bg-alt); border: 1px solid var(--line);
    font-size: 1.05rem; font-weight: 750; }

.designer-puzzle .pz-warn { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: #fff7ed; color: #9a3412; }
.designer-puzzle .pz-tip { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; }
.designer-puzzle .pz-tip .icon { width: 15px; height: 15px; color: var(--accent-text); flex: none; }
.designer-puzzle [data-pz-color].is-flash { animation: pz-flash 1.2s ease-out; border-radius: 12px; }
@keyframes pz-flash { 0% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }

@media (max-width: 900px) {
    .designer-puzzle .designer-canvas { aspect-ratio: 1 / 1; max-height: 62vh; }
    .designer-puzzle .pz-tabs { top: 64px; }
    .designer-puzzle .designer-buy { position: sticky; bottom: 0; z-index: 5; background: var(--surface); padding: 0 8px 12px; margin: 0 -8px;
        box-shadow: 0 -12px 18px -14px rgba(40, 20, 80, .35); }
}
@media (max-width: 420px) { .designer-puzzle .pz-tab { font-size: .85rem; padding: 9px 4px; } .designer-puzzle .pz-tab .icon { display: none; } }
