/* 픽셀 도화지 */
.cv-card { max-width: 900px; }
.cv-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cv-palette { display: flex; flex-wrap: wrap; gap: 4px; }
.cv-palette button {
  width: 26px; height: 26px; padding: 0; border-radius: 4px; cursor: pointer; border: 1px solid rgba(0, 0, 0, .2);
  background: var(--c);
}
.cv-palette button[aria-checked="true"] { outline: 2px solid var(--fg); outline-offset: 2px; }
.cv-palette button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cv-info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cv-bar .btn { min-width: 36px; justify-content: center; }
#placeBtn { min-width: 150px; }

.cv-view {
  position: relative; overflow: hidden; height: min(68vh, 620px); min-height: 300px; border: 1px solid var(--line); border-radius: 6px;
  background-color: var(--subtle); cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none;
  background-image: linear-gradient(45deg, rgba(128, 128, 128, .08) 25%, transparent 25%, transparent 75%, rgba(128, 128, 128, .08) 75%),
    linear-gradient(45deg, rgba(128, 128, 128, .08) 25%, transparent 25%, transparent 75%, rgba(128, 128, 128, .08) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.cv-view:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cv-view.panning { cursor: grabbing; }
.cv-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.cv-stage canvas { display: block; width: 128px; height: 128px; image-rendering: pixelated; image-rendering: crisp-edges; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); background: #fff; }
/* the selection lives in screen pixels (outside the scaled stage) so its outline stays crisp at any zoom */
.cv-sel { position: absolute; box-sizing: border-box; border: 2px solid #111; box-shadow: 0 0 0 1px #fff, inset 0 0 0 1px #fff; pointer-events: none; }
.cv-sel[hidden] { display: none; }
.cv-sel.flash { animation: cv-flash .6s ease-out; }
@keyframes cv-flash { 0% { transform: scale(1.6); opacity: .4; } 100% { transform: none; opacity: 1; } }
.cv-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.cv-loading[hidden] { display: none; }
@media (max-width: 600px) { .cv-palette button { width: 30px; height: 30px; } .cv-view { height: 60vh; } }
@media (prefers-reduced-motion: reduce) { .cv-sel.flash { animation: none; } }
.cv-colours { gap: 10px; }
.cv-current { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.cv-current i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.cv-current b { font: 600 12px var(--mono, monospace); }
.cv-recent { display: inline-flex; align-items: center; gap: 6px; }
.cv-recent[hidden] { display: none; }
.cv-label { font-size: 12px; color: var(--muted); }
.cv-custom { position: relative; cursor: pointer; }
.cv-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
#eyedrop[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.cv-view.picking { cursor: copy; }
.cv-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-tip {
  position: absolute; z-index: 3; pointer-events: none; padding: 4px 9px; border-radius: 6px; white-space: nowrap;
  background: rgba(24, 24, 27, .9); color: #fff; font-size: 12.5px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.cv-tip[hidden] { display: none; }


/* private canvases: switcher, owner tools, the new-canvas form */
.cv-rooms { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.cv-roomsel { max-width: 240px; height: 32px; }
.cv-owner { margin-top: -4px; }
.cv-owner .danger { color: var(--bad); }
.cv-text { width: 100%; height: 34px; padding: 0 10px; margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 14px; }
.cv-text:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.cv-new .hint { margin-bottom: 14px; }
.cv-new .error { color: var(--bad); margin: -6px 0 10px; font-size: 13px; }
.cv-gone { padding: 40px 16px; text-align: center; }
