/* 그림 쪽(/art/) — 사이트의 다른 쪽과 섞이지 않게 모든 클래스에 art- 머리 */
@view-transition { navigation: auto; }
:root.art-doc {
  --art-bg: #050507;
  --art-ink: rgba(255, 255, 255, .90);
  --art-mute: rgba(255, 255, 255, .70);
  --art-line: rgba(255, 255, 255, .20);
  --art-line-hi: rgba(255, 255, 255, .42);
  --art-glass: rgba(6, 6, 9, .62);
  --art-font: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --art-gx: max(16px, env(safe-area-inset-left));
  --art-gr: max(16px, env(safe-area-inset-right));
  --art-gb: max(14px, env(safe-area-inset-bottom));
  --art-gt: max(12px, env(safe-area-inset-top));
  color-scheme: dark;
  background: var(--art-bg);
}
.art-doc, .art-body { margin: 0; height: 100%; background: var(--art-bg); overflow: hidden; overscroll-behavior: none; }
.art-body { font: 13px/1.5 var(--art-font); color: var(--art-ink); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
.art-body *, .art-body *::before, .art-body *::after { box-sizing: border-box; }
.art-anchor { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: hidden; }
.art-main { position: fixed; inset: 0; }

/* 그림 판 — 화면을 꽉 채우고, 그림의 자리는 art.js 의 화면 틀이 정한다 */
.art-stage { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; background: var(--art-bg);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; view-transition-name: art-stage; cursor: default; }
.art-canvas, .art-dust { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; outline: none; }
.art-canvas-lights { visibility: hidden; }
.art-dust { pointer-events: none; mix-blend-mode: screen; z-index: 2; }
.art-poster, .art-still { position: absolute; left: 50%; top: 50%; width: min(100vw, calc(100vh * 1.41443)); width: min(100vw, calc(100dvh * 1.41443)); height: auto;
  aspect-ratio: 3000 / 2121; transform: translate(-50%, -50%); object-fit: fill; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect; }
.art-poster { z-index: 3; transition: opacity .55s ease; }
.art-poster.art-poster-off { opacity: 0; }
.art-anchor:target ~ .art-main .art-poster { visibility: hidden; }
.art-still { z-index: 4; }
.art-still-lights .art-still { image-rendering: pixelated; }
@media (max-width: 599px) and (orientation: portrait) {
  .art-poster, .art-still { top: 15%; height: 70%; width: auto; max-width: none; left: 50%; transform: translateX(-50%); }
}

/* 화면 글 · 단추 — 4초 쉬면 흐려지고, 움직이면 돌아온다 */
.art-chrome { position: fixed; z-index: 10; transition: opacity 1.1s ease; }
.art-dim .art-chrome { opacity: .14; }
.art-dim .art-chrome:hover, .art-dim .art-chrome:focus-within { opacity: 1; transition-duration: .25s; }
.art-nochrome .art-chrome, .art-nochrome .art-err { display: none !important; }

.art-mark { left: var(--art-gx); top: var(--art-gt); display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px;
  font: 500 13px/1 var(--art-font); letter-spacing: .06em; color: var(--art-mute); text-decoration: none; border-radius: 4px; }
.art-mark:hover { color: var(--art-ink); }

.art-rooms { top: var(--art-gt); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 3px; border-radius: 22px;
  background: var(--art-glass); border: 1px solid rgba(255, 255, 255, .10); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.art-room { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 11px; border: 0; border-radius: 18px; background: transparent;
  color: var(--art-mute); font: 500 13px/1 var(--art-font); letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  transition: color .3s ease, background-color .3s ease; -webkit-tap-highlight-color: transparent; }
.art-room:hover { color: var(--art-ink); }
.art-room[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, .11); }
.art-ic { width: 18px; height: 18px; flex: none; display: block; }

.art-cap { left: var(--art-gx); bottom: var(--art-gb); max-width: min(36rem, calc(100vw - 2 * var(--art-gx) - 300px)); padding: 6px 4px 2px; }
.art-cap::before { content: ""; position: absolute; z-index: -1; left: -60px; right: -80px; top: -40px; bottom: -40px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(5, 5, 7, .72), rgba(5, 5, 7, 0)); }
.art-cap-head { display: flex; align-items: center; gap: 6px; }
.art-cap-title { margin: 0; font: 600 15px/1.3 var(--art-font); letter-spacing: .01em; color: var(--art-ink); }
.art-cap-line { margin: 2px 0 0; font: 400 13px/1.55 var(--art-font); color: var(--art-mute); text-wrap: pretty; }
.art-legend { margin: 0 0 12px; padding: 12px 14px 10px; border-radius: 10px; background: rgba(6, 6, 9, .74); border: 1px solid rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: 30rem; }
.art-legend-line { margin: 0 0 6px; font: 400 13px/1.55 var(--art-font); color: var(--art-ink); text-wrap: pretty; }
.art-legend-line:last-child { margin-bottom: 2px; color: var(--art-mute); }
.art-legend[hidden] { display: none; }

.art-ctl { right: var(--art-gr); bottom: var(--art-gb); display: flex; align-items: center; gap: 8px; }
.art-pills { display: flex; gap: 4px; padding: 3px; border-radius: 22px; background: var(--art-glass); border: 1px solid rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.art-pill { height: 30px; padding: 0 13px; border: 0; border-radius: 16px; background: transparent; color: var(--art-mute);
  font: 500 12.5px/1 var(--art-font); cursor: pointer; white-space: nowrap; transition: color .3s ease, background-color .3s ease; -webkit-tap-highlight-color: transparent; }
.art-pill:hover { color: var(--art-ink); }
.art-pill[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, .12); }
.art-icbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14); background: var(--art-glass); color: var(--art-mute); cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: color .3s ease, border-color .3s ease; -webkit-tap-highlight-color: transparent; }
.art-icbtn:hover { color: var(--art-ink); border-color: var(--art-line-hi); }
.art-icbtn[hidden] { display: none; }
.art-legend-btn { width: 30px; height: 30px; background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.art-legend-btn[aria-expanded="true"] { color: #fff; border-color: var(--art-line-hi); }
.art-ic-play { display: none; }
.art-paused .art-ic-pause { display: none; }
.art-paused .art-ic-play { display: block; }

.art-body :focus { outline: none; }
.art-body :focus-visible { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: 2px; }

.art-err { position: fixed; z-index: 11; right: var(--art-gr); top: calc(var(--art-gt) + 44px); max-width: 60vw; margin: 0; padding: 4px 8px; border-radius: 4px;
  background: rgba(5, 5, 7, .8); font: 11px/1.4 ui-monospace, Menlo, monospace; color: #e9a59c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-err[hidden] { display: none; }
.art-nogl .art-ctl .art-icbtn#art-pause { display: none; }

/* 손가락 — 누르는 자리 44 px */
@media (pointer: coarse) {
  .art-room { height: 38px; }
  .art-pill { height: 36px; }
  .art-icbtn { width: 44px; height: 44px; }
  .art-legend-btn { width: 40px; height: 40px; }
}
/* 폰 — 위 줄: 이름(왼쪽) · 방 고르기(오른쪽) / 아래: 글 · 단추 줄 */
@media (max-width: 599px) {
  .art-mark { font-size: 12px; letter-spacing: .04em; min-height: 38px; }
  .art-rooms { left: auto; right: var(--art-gr); transform: none; }
  .art-room { padding: 0 11px 0 9px; gap: 6px; font-size: 12px; }
  .art-ic { width: 16px; height: 16px; }
  .art-cap { left: var(--art-gx); right: var(--art-gr); max-width: none; bottom: calc(var(--art-gb) + 52px); }
  .art-cap-line { font-size: 12.5px; }
  .art-legend { max-width: none; }
  .art-ctl { left: var(--art-gx); right: var(--art-gr); justify-content: flex-end; }
  .art-pills { margin-right: auto; }
}
@media (max-width: 359px) {
  .art-room-name { font-size: 11px; }
  .art-mark { font-size: 11px; }
}

/* 띠 → 첫 화면 이어짐(같은 집 안의 쪽 넘김) */
::view-transition-group(art-stage) { animation-duration: .62s; animation-timing-function: cubic-bezier(.3, 0, .15, 1); }
::view-transition-old(art-stage) { animation-duration: .42s; }
::view-transition-new(art-stage) { animation-duration: .62s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .art-chrome, .art-poster { transition: none; }
}
