/* handy.moe show-off wave (Kumiko, 2026-12-03): 3x3 grid maker, place maps, travel bingo. House tokens from site.css. */

/* ---------- 3x3 / grid maker ---------- */
.sg-templates { list-style: none; margin: 0 0 16px; padding: 0 0 6px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.sg-templates li { flex: none; }
.sg-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .sg-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.sg-board { background: var(--bg, #111); color: var(--fg, #fff); padding: 8px; border: 1px solid var(--rule-2); }
.sg-title-view { margin: 4px 0 8px; text-align: center; font-family: var(--f-system); font-weight: 700; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.sg-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gap, 3px); }
.sg-cell { position: relative; display: flex; flex-direction: column; min-width: 0; cursor: grab; outline: none; touch-action: pan-x pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.sg-art { position: relative; aspect-ratio: 1; overflow: hidden; background: color-mix(in srgb, var(--fg, #fff) 10%, var(--bg, #111)); display: grid; place-items: center; }
.sg-grid[data-aspect="poster"] .sg-art { aspect-ratio: 2 / 3; }
.sg-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sg-plus { font-size: 28px; opacity: .35; font-family: var(--f-system); }
.sg-text { padding: 6px; text-align: center; font-family: var(--f-system); font-weight: 700; font-size: clamp(11px, 2.2vw, 18px); line-height: 1.2; overflow-wrap: anywhere; color: var(--fg, #fff); }
.sg-grid .sg-cap { width: 100%; min-height: 0; height: auto; border-radius: 0; box-shadow: none; line-height: 1.3; min-width: 0; border: 0; background: transparent; color: var(--fg, #fff); font-family: var(--f-system); font-size: 12px; text-align: center; padding: 3px 2px; touch-action: auto; }
.sg-grid .sg-cap::placeholder { color: color-mix(in srgb, var(--fg, #fff) 35%, transparent); }
.sg-grid[data-caps="over"] .sg-cell .sg-cap { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); padding-top: 14px; }
.sg-cell.sel .sg-art { outline: 3px solid var(--fire); outline-offset: -3px; }
.sg-cell:focus-visible .sg-art { outline: 3px dashed var(--fire); outline-offset: -3px; }
.sg-cell.target .sg-art { outline: 3px solid var(--ok); outline-offset: -3px; }
.sg-cell.bad .sg-art { outline: 3px solid var(--warn); outline-offset: -3px; }
.sg-cell.lifting { opacity: .35; }
.sg-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; opacity: .9; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); --fg: #fff; --bg: #111; }
.sg-ghost .sg-cap, .sg-grid .sg-ghost .sg-cap { display: none; }
.sg-drop { margin-top: 8px; padding: 12px 16px; }
.sg-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.sg-search { display: flex; gap: 8px; }
.sg-search input { flex: 1; min-width: 0; }
.sg-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; }
.sg-res { display: grid; gap: 2px; width: 100%; padding: 0; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); cursor: pointer; text-align: left; }
.sg-res:hover, .sg-res:focus-visible { border-color: var(--fire); }
.sg-res img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: var(--paper-2); }
.sg-res-t, .sg-res-s { font-family: var(--f-system); font-size: 12px; line-height: 1.25; padding: 0 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sg-res-s { color: var(--ink-3); -webkit-line-clamp: 1; padding-bottom: 4px; }
.sg-opts { border: 1px solid var(--rule); padding: 8px 12px; display: grid; gap: 8px; }
.sg-opts[open] { display: grid; }
.sg-opts > summary { cursor: pointer; color: var(--ink-2); }
.sg-opts .row { gap: 12px; }
.sg-opts input[type="number"] { width: 5em; }

/* ---------- place maps ---------- */
.pm-legend { list-style: none; margin: 16px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pm-leg { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 2px; border: 1px solid var(--rule); }
.pm-leg.active { border-color: var(--fire); background: var(--hl); }
.pm-swatch-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px; font: inherit; }
.pm-swatch { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--rule-2); display: inline-block; }
.pm-swatch.erase { background: repeating-linear-gradient(45deg, var(--ink-3) 0 3px, transparent 3px 7px); }
.pm-count { color: var(--ink-2); font-size: var(--small); }
.pm-edit { margin: 0 0 8px; }
.pm-edit > summary { cursor: pointer; color: var(--ink-3); }
.pm-edit-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pm-edit-list li { display: flex; gap: 6px; align-items: center; }
.pm-edit-list input[type="color"] { width: 32px; height: 32px; padding: 0; border: 0; background: none; }
.pm-rename { width: 9em; }
.pm-total { font-weight: 700; margin: 8px 0; }
.pm-stage { position: relative; border: 1px solid var(--rule-2); background: var(--paper-2); }
.pm-svg { display: block; width: 100%; height: auto; touch-action: pan-x pan-y pinch-zoom; cursor: pointer; user-select: none; }
.pm-svg .pm-regions path { fill: #3a3a3a; stroke: var(--paper); stroke-width: .6; stroke-linejoin: round; transition: fill .12s; }
.pm-svg.fine .pm-regions path { stroke-width: .25; }
.pm-svg .pm-regions path:hover { fill: #5a5a5a; }
.pm-svg .pm-regions path.on:hover { filter: brightness(1.15); }
.pm-svg .pm-overlay { fill: none; stroke: var(--paper); stroke-width: .9; pointer-events: none; }
:root[data-theme="day"] .pm-svg .pm-regions path:not(.on) { fill: #d9d2c3; }
:root[data-theme="day"] .pm-svg .pm-regions path:not(.on):hover { fill: #c4bba8; }
.pm-zoom { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.pm-zoom .btn { background: var(--paper); }
.pm-hover { min-height: 24px; }
.pm-list { display: grid; gap: 8px; margin-top: 8px; }
.pm-group ul { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pm-group li { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- travel bingo ---------- */
.bg-title-view { text-align: center; font-weight: 700; font-size: 20px; font-family: var(--f-system); margin: 16px 0 8px; overflow-wrap: anywhere; }
.bg-grid { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); border: 2px solid var(--ink); max-width: 720px; margin: 0 auto; }
.bg-cell { aspect-ratio: 1; min-width: 0; display: grid; place-items: center; padding: 4px; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); font-family: var(--f-system); font-size: clamp(10px, 2.4vw, 15px); line-height: 1.2; text-align: center; overflow-wrap: anywhere; cursor: pointer; position: relative; }
.bg-cell span { position: relative; z-index: 1; }
.bg-cell.done::after { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: var(--stamp, #e8467c); opacity: .55; }
.bg-cell.win { background: color-mix(in srgb, var(--warn) 22%, var(--card)); }
.bg-cell.free { cursor: default; font-weight: 700; }
textarea.bg-cell { resize: none; cursor: text; min-height: 0; height: auto; border-radius: 0; }
.bg-score { text-align: center; font-weight: 700; margin: 12px 0; }
