/* 🎨 전국 픽셀 캔버스 (2026-10-10) — act/pixel.php 전용 */
#px-wrap {
    --px-bg: #ffffff; --px-panel: #f4f6fb; --px-line: #dfe3ec; --px-text: #1d2433; --px-muted: #6b7486;
    --px-accent: #ff4f7b; --px-accent2: #6d5dfc; --px-stage: #e7eaf1; --px-chip-ring: #1d2433;
    width: 100%; max-width: none; margin: 0 auto 8px; box-sizing: border-box; color: var(--px-text);
}
html[data-theme="dark"] #px-wrap {
    --px-bg: #171b24; --px-panel: #1f2430; --px-line: #2f3646; --px-text: #e8ecf4; --px-muted: #9aa3b5;
    --px-stage: #0f1218; --px-chip-ring: #ffffff;
}
#px-wrap *, #px-wrap *::before, #px-wrap *::after { box-sizing: border-box; }
#px-wrap button { font-family: inherit; }

#px-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 0 0 8px; }
.px-stat { font-size: 13px; color: var(--px-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.px-stat b { color: var(--px-text); font-variant-numeric: tabular-nums; }
.px-livedot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: px-pulse 1.8s infinite; flex: none; }
@keyframes px-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.px-me { display: flex; align-items: center; gap: 8px; font-size: 13px; }
#px-nickbtn { border: 1px solid var(--px-line); background: var(--px-panel); color: var(--px-text); border-radius: 999px; padding: 6px 11px; min-height: 34px; font-size: 13px; font-weight: 700; cursor: pointer; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-mycount { color: var(--px-muted); white-space: nowrap; }
.px-mycount b { color: var(--px-accent); }
#px-nickform { display: flex; gap: 6px; width: 100%; }
#px-nickform[hidden] { display: none; }
#px-nickform input { flex: 1; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid var(--px-line); background: var(--px-bg); color: var(--px-text); padding: 0 12px; font-size: 15px; }
#px-nickform button { height: 40px; border: 0; border-radius: 10px; padding: 0 16px; background: var(--px-accent2); color: #fff; font-weight: 800; cursor: pointer; }
#px-blocked { margin: 0 0 8px; padding: 9px 12px; border-radius: 10px; background: #fee2e2; color: #991b1b; font-size: 13px; font-weight: 700; }
html[data-theme="dark"] #px-blocked { background: #3b1414; color: #fecaca; }

#px-stage { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: var(--px-stage); border: 1px solid var(--px-line); box-shadow: 0 10px 28px rgba(20, 30, 60, .12); }
#px-canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; touch-action: none; cursor: crosshair; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: none; }
#px-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--px-accent2); }
#px-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--px-muted); font-weight: 700; pointer-events: none; }
#px-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 2px; background: rgba(15, 20, 30, .72); border-radius: 12px; padding: 3px; }
#px-zoom button { width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: #fff; font-size: 18px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#px-zoom button:hover { background: rgba(255,255,255,.14); }
#px-zoomv { color: #cbd5e1; font-size: 11px; font-weight: 700; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
#px-info { position: absolute; z-index: 5; max-width: 260px; padding: 8px 11px; border-radius: 10px; background: rgba(15, 20, 30, .92); color: #f1f5f9; font-size: 12.5px; line-height: 1.5; pointer-events: auto; box-shadow: 0 6px 18px rgba(0,0,0,.25); word-break: break-all; }
#px-info[hidden] { display: none; }
#px-info code { font-size: 11px; color: #fde68a; }
#px-info .px-ia { margin: 4px 4px 0 0; }
.px-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; border: 1px solid rgba(255,255,255,.5); }
#px-toast { position: absolute; left: 50%; top: 10px; transform: translate(-50%, -8px); max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 999px; background: rgba(15, 20, 30, .88); color: #fff; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center; word-break: keep-all; }
#px-toast.on { opacity: 1; transform: translate(-50%, 0); }

#px-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; }
.px-sel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: var(--px-panel); border: 1px solid var(--px-line); min-height: 52px; }
.px-cur { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--px-line); background: #222; flex: none; }
#px-coord { flex: 1; min-width: 0; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-mini { width: 40px; height: 40px; flex: none; border: 1px solid var(--px-line); border-radius: 10px; background: var(--px-bg); color: var(--px-text); font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.px-mini:disabled { opacity: .4; cursor: default; }
#px-place { position: relative; flex: none; width: 92px; height: 56px; border: 0; border-radius: 14px; cursor: pointer; background: linear-gradient(135deg, var(--px-accent), var(--px-accent2)); color: #fff; font-size: 16px; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 6px 16px rgba(109, 93, 252, .3); }
#px-place:disabled { cursor: default; background: #9aa3b5; box-shadow: none; }
html[data-theme="dark"] #px-place:disabled { background: #3a4253; color: #cbd5e1; }
#px-place.cool { background: #4b5568; }
#px-place svg { position: absolute; left: 6px; top: 50%; width: 30px; height: 30px; margin-top: -15px; transform: rotate(-90deg); display: none; }
#px-place.cool svg { display: block; }
#px-place.cool span { padding-left: 26px; }
.px-ring-bg { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 5; }
.px-ring-arc { fill: none; stroke: #fde68a; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }

#px-palette { display: flex; gap: 7px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.px-chip { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 2px solid rgba(0,0,0,.12); cursor: pointer; position: relative; }
html[data-theme="dark"] .px-chip { border-color: rgba(255,255,255,.14); }
.px-chip.on { outline: 3px solid var(--px-chip-ring); outline-offset: 2px; }
.px-chip.on::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #111; }
.px-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--px-text); font-weight: 600; margin: 2px 0 12px; cursor: pointer; min-height: 32px; }
.px-quick input { width: 18px; height: 18px; }
.px-quick small { color: var(--px-muted); font-weight: 500; font-size: 12px; }

.px-sec { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--px-panel); border: 1px solid var(--px-line); }
.px-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.px-sec h3 { font-size: 15px; font-weight: 800; margin: 0; color: var(--px-text); }
.px-sec h4 { font-size: 13px; font-weight: 800; margin: 12px 0 6px; color: var(--px-text); }
.px-tabs { display: flex; gap: 4px; }
.px-tabs button { border: 1px solid var(--px-line); background: var(--px-bg); color: var(--px-muted); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 32px; }
.px-tabs button.on { background: var(--px-text); color: var(--px-bg); border-color: var(--px-text); }
#px-toplist { list-style: none; margin: 0; padding: 0; }
#px-toplist li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed var(--px-line); font-size: 13.5px; }
#px-toplist li:last-child { border-bottom: 0; }
#px-toplist .n { width: 22px; text-align: center; font-weight: 900; color: var(--px-muted); }
#px-toplist li:nth-child(1) .n { color: #e59500; } #px-toplist li:nth-child(2) .n { color: #8b95a7; } #px-toplist li:nth-child(3) .n { color: #a06a42; }
#px-toplist .nk { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#px-toplist b { font-variant-numeric: tabular-nums; color: var(--px-accent); }
#px-toplist .empty { color: var(--px-muted); justify-content: center; }
.px-gif { display: block; width: 100%; height: auto; border-radius: 10px; image-rendering: pixelated; background: #fff; border: 1px solid var(--px-line); }
.px-muted, .px-amuted { color: var(--px-muted); font-size: 13px; margin: 4px 0; }
.px-snaps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.px-snaps a { display: block; text-decoration: none; color: var(--px-muted); font-size: 11px; text-align: center; }
.px-snaps img { display: block; width: 100%; height: auto; border-radius: 7px; image-rendering: pixelated; border: 1px solid var(--px-line); background: #fff; }

/* 관리자 */
#px-admin { border-color: #f9a8b8; }
.px-arow2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; font-size: 13px; }
.px-arow2 input[type=text] { flex: 1; min-width: 140px; height: 36px; border-radius: 8px; border: 1px solid var(--px-line); background: var(--px-bg); color: var(--px-text); padding: 0 10px; }
.px-arow2 input[type=number] { width: 70px; height: 36px; border-radius: 8px; border: 1px solid var(--px-line); background: var(--px-bg); color: var(--px-text); padding: 0 6px; }
#px-admin button:not(.px-mini), #px-info .px-ia { border: 1px solid var(--px-line); background: var(--px-bg); color: var(--px-text); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; min-height: 32px; }
#px-info .px-ia { background: #334155; color: #fff; border-color: #475569; min-height: 28px; padding: 3px 8px; }
#px-admin .px-danger { background: #e11d48; color: #fff; border-color: #e11d48; }
#px-arectmode.on { background: #fde68a; color: #111; border-color: #e5b800; }
#px-arect { font-variant-numeric: tabular-nums; color: var(--px-muted); }
.px-arow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px dashed var(--px-line); font-size: 12.5px; }
.px-anote { flex: 1; min-width: 150px; word-break: break-all; }
.px-arow code, .px-abk code { font-size: 11px; color: var(--px-muted); }
.px-abk { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px 6px 0; font-size: 12.5px; }

.px-guide { text-align: left; line-height: 1.7; margin-top: 16px; }
.px-guide p, .px-guide li { font-size: .9rem; }
.px-guide h3 { font-size: 1rem; margin: 10px 0 4px; }
.px-guide small { font-size: .8rem; display: block; margin-top: 8px; }

@media (max-width: 380px) {
    #px-place { width: 82px; font-size: 15px; }
    .px-chip { width: 44px; height: 44px; }
    .px-snaps { grid-template-columns: repeat(2, 1fr); }
}
