:root {
  --ink: #f4ede1;
  --ink-dim: #b9ad9a;
  --bg: #1b1613;
  --card: rgba(30, 24, 20, 0.92);
  --line: rgba(244, 237, 225, 0.14);
  --accent: #e8a33d;
  font-family: "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 10; }
.overlay[hidden] { display: none; }
#entry { background: radial-gradient(ellipse at center, rgba(27,22,19,0.55), rgba(27,22,19,0.92)); }

.entry-card, .panel-card {
  width: min(420px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.entry-eyebrow, .panel-eyebrow { font-size: 12px; letter-spacing: 0.28em; color: var(--accent); font-weight: 700; }
.entry-logo { display: block; height: 30px; width: auto; }
.entry-card h1 { margin: 6px 0 8px; font-size: 40px; letter-spacing: -0.02em; }
.entry-sub { margin: 0 0 22px; color: var(--ink-dim); line-height: 1.5; }
#entry-form { display: grid; gap: 14px; }
#nickname {
  font: inherit; font-size: 17px; padding: 13px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--ink); outline: none;
}
#nickname:focus { border-color: var(--accent); }
#entry-form > button[type=submit], .panel-card .btn {
  font: inherit; font-weight: 700; font-size: 16px; padding: 13px; border-radius: 10px; border: 0;
  background: var(--accent); color: #241a0e; cursor: pointer;
}
.entry-help { margin: 18px 0 0; font-size: 12px; color: var(--ink-dim); text-align: center; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#zone-name {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  font-size: 13px; letter-spacing: 0.18em; color: var(--ink-dim); text-transform: uppercase;
}
#prompt {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  pointer-events: auto; font: inherit; font-size: 15px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
}
#prompt kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; margin-right: 8px; border-radius: 5px;
  background: var(--accent); color: #241a0e; font-family: inherit; font-weight: 800;
}
#help {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--ink-dim); white-space: nowrap;
}
#joystick {
  position: absolute; left: 28px; bottom: 28px; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line); pointer-events: auto; touch-action: none;
}
#stick {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(244,237,225,0.5);
}

#panel { background: rgba(0,0,0,0.35); z-index: 20; }
.panel-card { position: relative; }
.panel-card h2 { margin: 6px 0 12px; font-size: 26px; }
#panel-body { color: var(--ink-dim); line-height: 1.6; }
#panel-body p { margin: 0 0 12px; }
#panel-body .soon {
  display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); margin-bottom: 12px;
}
#panel-close {
  position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-dim); font-size: 24px; cursor: pointer;
}
#panel-close:hover { background: rgba(255,255,255,0.08); color: var(--ink); }

@media (pointer: coarse) { #help { display: none; } }

/* ---------- 2단계: 추천 패널 ---------- */
.panel-card.wide { width: min(580px, calc(100vw - 24px)); }
.panel-card { max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
#panel-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
#panel-body a { color: var(--accent); }
.panel-card .btn:disabled { opacity: 0.5; cursor: default; }
.back {
  align-self: flex-start; font: inherit; font-size: 14px; border: 0; background: none; color: var(--ink-dim);
  cursor: pointer; padding: 0;
}
.back:hover { color: var(--ink); }
.list { display: flex; flex-direction: column; gap: 6px; }
.status, .empty { font-size: 14px; color: var(--ink-dim); }
.empty { padding: 28px 0; text-align: center; }
.searchbox { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.search, .note-input {
  font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px; width: 100%;
  border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--ink); outline: none; resize: none;
}
.search:focus, .note-input:focus { border-color: var(--accent); }
.track {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
  padding: 7px 8px; border-radius: 10px; background: rgba(255,255,255,0.03);
}
.track.pickable { cursor: pointer; }
.track.pickable:hover { background: rgba(232,163,61,0.14); }
.track .cover { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background: #000; }
.track .meta { min-width: 0; }
.track .title { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .artist { font-size: 13px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .note { font-size: 13px; color: var(--ink); margin-top: 2px; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.track .note-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .note .by { color: var(--ink-dim); }
.track .stats { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--ink-dim); margin-top: 5px; }
.track .tag { color: #fff6e8; padding: 1px 7px; border-radius: 4px; font-weight: 700; font-size: 11px; }
.play {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0,0,0,0.3);
  color: var(--ink); font-size: 13px; cursor: pointer;
}
.play.on, .play:hover { background: var(--accent); color: #241a0e; border-color: var(--accent); }
.like {
  font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
  background: none; color: var(--ink-dim); cursor: pointer;
}
.like.on { color: #f2786b; border-color: #f2786b; }

#now-playing {
  position: fixed; right: 16px; bottom: 16px; z-index: 15; width: min(380px, calc(100vw - 32px));
  display: grid; grid-template-columns: 44px 1fr auto auto; gap: 8px 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
}
#now-playing[hidden] { display: none; }
#now-playing img { width: 44px; height: 44px; border-radius: 4px; }
#now-playing .np-meta { min-width: 0; }
#now-playing .title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#now-playing .artist { font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#now-playing .bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
#now-playing .bar i { display: block; height: 100%; width: 0; background: var(--accent); }
#now-playing button {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.08);
  color: var(--ink); cursor: pointer; font-size: 13px;
}
#toast {
  position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 30;
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: #241a0e; font-weight: 700;
}
#toast[hidden] { display: none; }
@media (pointer: coarse) { #now-playing { bottom: 160px; } }

/* 아래 줄: 왼쪽 출처 문구, 오른쪽 Apple Music 공식 배지.
   배지 규칙(Apple Music Identity Guidelines): Apple 제공 그림 그대로, 화면 높이 30px 이상, 둘레 여백 배지 높이의 1/10 이상,
   곡 정보 아래·오른쪽에 두고 주인공보다 작게. 효과·회전·변형 금지 */
#now-playing .am-row, #room-playing .am-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
#now-playing .credit, #room-playing .credit { font-size: 10px; line-height: 1.25; color: var(--ink-dim); min-width: 0; }
.am-badge { flex: 0 0 auto; display: block; padding: 4px; line-height: 0; border-radius: 8px; }
.am-badge img, #now-playing .am-badge img, #room-playing .am-badge img { display: block; height: 30px; width: auto; border-radius: 0; }   /* 커버용 img 규칙(정사각·둥근 모서리)이 배지에 걸리지 않게 */
.am-badge:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.track .sub { color: var(--ink-dim); }
.track .actions { display: flex; gap: 8px; align-items: center; }

/* ---------- 3단계: 실시간 ---------- */
#social {
  position: absolute; top: 12px; right: 14px; display: flex; gap: 8px; align-items: center; pointer-events: auto;
}
#social[hidden] { display: none; }
#online { font-size: 12px; color: var(--ink-dim); margin-right: 4px; }
#social button {
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
#social button:hover { border-color: var(--accent); }
#social button[hidden] { display: none; }
#inbox-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px;
  background: #f2786b; color: #fff; font-size: 11px; text-align: center;
}
#inbox-count[hidden] { display: none; }
#chat { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); pointer-events: auto; width: min(420px, calc(100vw - 32px)); }
#chat[hidden] { display: none; }
#chat input {
  width: 100%; font: inherit; font-size: 15px; padding: 12px 16px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--card); color: var(--ink); outline: none;
}
.panel-card .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.panel-card .btn.small { font-size: 12px; padding: 6px 12px; }
.hint { font-size: 12px; color: var(--ink-dim); margin: 0; }
.inbox-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mail { padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.04); display: flex; flex-direction: column; gap: 8px; }
.mail .track { background: rgba(0,0,0,0.2); }
.mail-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.mail-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.mail-head .when { margin-left: auto; font-size: 12px; color: var(--ink-dim); }
.mail-text { color: var(--ink); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.mail-actions { display: flex; gap: 14px; }
button.link { font: inherit; font-size: 13px; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
button.link:disabled { color: var(--ink-dim); cursor: default; }
#toast.clickable { cursor: pointer; pointer-events: auto; }

/* ---------- 리스닝 룸 · 배경음악 · 반응 ---------- */
#social { position: absolute; }
#react-picker {
  position: fixed; transform: translate(-50%, -100%); display: flex; gap: 6px; padding: 8px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); pointer-events: auto; z-index: 6;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
#react-picker[hidden] { display: none; }
#react-picker button { font-size: 26px; padding: 6px 10px; border: 0; background: rgba(255,255,255,0.06); border-radius: 10px; cursor: pointer; }
#react-picker button.txt { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); }
#react-picker button:hover { background: var(--accent); }
#ambient {
  position: absolute; left: 14px; top: 12px; display: flex; gap: 8px; align-items: center; pointer-events: auto;
  max-width: min(46vw, 460px); font-size: 12px; color: var(--ink-dim);
}
#ambient[hidden] { display: none; }
#ambient span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ambient b { color: var(--ink); font-weight: 700; }
#mute-btn { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 14px; }
.booth-now { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.05); }
.booth-now img { width: 88px; height: 88px; border-radius: 6px; }
.booth-now .label { font-size: 11px; letter-spacing: 0.2em; color: var(--accent); font-weight: 700; }
.booth-now .title { color: var(--ink); font-weight: 700; font-size: 17px; margin-top: 2px; }
.booth-now .artist { font-size: 13px; }
.booth-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 10px; overflow: hidden; }
.booth-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.booth-mine { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--accent); color: var(--ink); font-size: 14px; }
.booth-q-title { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.1em; }
.booth-q { display: grid; grid-template-columns: 20px 40px 1fr; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,0.03); }
.booth-q .num { color: var(--ink-dim); font-size: 13px; text-align: center; }
.booth-q img { width: 40px; height: 40px; border-radius: 4px; }
.booth-q .title { color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booth-q .artist { font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 리스닝 룸·청음 테이블에서 같이 듣는 곡 카드 (미리듣기 카드와 같은 모양) */
#room-playing {
  position: fixed; right: 16px; bottom: 16px; z-index: 15; width: min(380px, calc(100vw - 32px));
  display: grid; grid-template-columns: 52px 1fr; gap: 8px 10px; align-items: center;
  padding: 9px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--accent);
}
#room-playing[hidden] { display: none; }
#room-playing img { width: 52px; height: 52px; border-radius: 4px; }
#room-playing .np-meta { min-width: 0; }
#room-playing .where { font-size: 10px; letter-spacing: 0.12em; color: var(--accent); font-weight: 700; }
#room-playing .title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#room-playing .artist { font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#room-playing .bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
#room-playing .bar i { display: block; height: 100%; width: 0; background: var(--accent); }
@media (pointer: coarse) { #room-playing { bottom: 160px; } }

/* ---------- 매장 안 UI: 입장 창과 같은 밝은 반투명 유리 ---------- */
:root {
  --ink: #1c1712;
  --ink-dim: rgba(28, 23, 18, 0.62);
  --card: rgba(252, 249, 244, 0.62);
  --line: rgba(28, 23, 18, 0.1);
  --fill: rgba(255, 250, 242, 0.45);   /* 카드 안쪽 칸 */
  --fill-2: rgba(28, 23, 18, 0.05);    /* 살짝 눌린 칸 */
  --accent-ink: #a5601a;               /* 밝은 바탕 위 주황 글자 */
  --glass: blur(22px) saturate(1.3);
}
.panel-card, #now-playing, #room-playing, #react-picker, #prompt, #social button, #mute-btn, #chat input {
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
#panel { background: rgba(12, 9, 7, 0.28); }
.panel-card {
  width: min(420px, calc(100vw - 32px)); padding: 28px; border-radius: 20px; color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.panel-card.wide { width: min(580px, calc(100vw - 24px)); }
.panel-card h2 { font-size: 24px; letter-spacing: -0.02em; }
.panel-eyebrow, .booth-now .label, #room-playing .where { color: var(--accent-ink); }
#panel-body a, button.link { color: var(--accent-ink); }
#panel-body .soon { border-color: var(--accent-ink); color: var(--accent-ink); }
#panel-close:hover { background: var(--fill-2); }
.panel-card .btn { border-radius: 12px; }
.panel-card .btn.ghost { background: var(--fill); border-color: rgba(255, 255, 255, 0.55); }

.search, .note-input { border-radius: 12px; background: var(--fill); border-color: rgba(255, 255, 255, 0.55); }
.search::placeholder, .note-input::placeholder { color: rgba(28, 23, 18, 0.4); }
.track { background: var(--fill); }
.track.pickable:hover { background: rgba(232, 163, 61, 0.2); }
.track .cover { background: #ddd3c4; }
.play { background: var(--fill); border-color: var(--line); }
.mail { background: var(--fill-2); }
.mail .track { background: var(--fill); }
.booth-now { background: var(--fill); }
.booth-q { background: var(--fill); }
.booth-mine { border-color: var(--accent-ink); }

/* 떠 있는 카드들: 둥글고 가장자리 흰 테 */
#now-playing, #room-playing { border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); }
#room-playing { border-color: var(--accent); }
#now-playing button { background: var(--fill-2); }
#react-picker { border-color: rgba(255, 255, 255, 0.6); }
#react-picker button { background: var(--fill); }
#prompt, #social button, #mute-btn { border-color: rgba(255, 255, 255, 0.6); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
#chat input { color: var(--ink); }

/* 매장 화면 위에 바로 얹힌 글자: 배경이 어두우니 밝은 글자 + 그림자 유지 */
#zone-name, #help, #online { color: rgba(255, 248, 238, 0.85); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
#ambient {
  padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--card); color: var(--ink-dim);
  border: 1px solid rgba(255, 255, 255, 0.6); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
#ambient #mute-btn { box-shadow: none; background: var(--fill); }
#joystick { background: rgba(252, 249, 244, 0.25); border-color: rgba(255, 255, 255, 0.5); }
#stick { background: rgba(252, 249, 244, 0.75); }

/* ---------- 사연 게시판 ---------- */
.story { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--fill-2); }
.story-text {
  color: var(--ink); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 4px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.story-text.open { display: block; }
.story-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 4px; font-size: 12px; color: var(--ink-dim); }
.story-input { min-height: 160px; line-height: 1.6; }
.count { margin-top: -4px; text-align: right; font-size: 12px; color: var(--ink-dim); }

/* ---------- 굿즈 돌려 보기 ---------- */
.product-view { display: block; width: 100%; height: 280px; border-radius: 16px; cursor: grab; background: radial-gradient(ellipse at 50% 45%, rgba(255, 250, 242, 0.75), rgba(255, 250, 242, 0.25)); }
.product-view:active { cursor: grabbing; }
.product-view.tall { height: clamp(280px, 46vh, 400px); }   /* 폰케이스는 세로로 길어서 화면을 높인다 */
.product-hint { margin: -4px 0 0; text-align: center; }
.product-info { display: flex; justify-content: space-between; align-items: baseline; }
.product-sub { font-size: 14px; color: var(--ink-dim); }
.product-price { font-size: 20px; font-weight: 700; color: var(--ink); }
.product-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.product-actions .btn { text-align: center; text-decoration: none; }
.product-actions .btn.on { color: #c0392b; }
.swatches { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: -2px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px rgba(28, 23, 18, 0.2); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px #1c1712; }
.swatch-name { font-size: 12px; color: var(--ink-dim); margin-left: 4px; }
.product-actions.three { grid-template-columns: 1fr 1fr 1.3fr; }
.product-actions.one { grid-template-columns: 1fr; }
.product-actions .btn.wear.on { color: var(--accent-ink); }

/* ---------- 주인장 대화 ---------- */
.npc-a { color: var(--ink); font-size: 15px; line-height: 1.65; margin: 0; }
.npc-q-echo { margin: 0; font-size: 13px; color: var(--ink-dim); }
.npc-qs { display: grid; gap: 8px; }
.npc-q { text-align: left; }

/* 폰케이스 벽: 칸 고르기 */
.case-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 8px; }
.case-pick-item { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 12px; background: var(--fill, rgba(255,255,255,.6)); cursor: pointer; font: inherit; color: inherit; text-align: left; }
.case-pick-item:hover { border-color: var(--accent, #c8743a); }
.case-pick-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: #eee; }
.case-pick-name { font-weight: 700; font-size: 13px; }
.case-pick-price { font-size: 12px; color: var(--ink-dim, #776); }

/* =====================================================================
   흑백 UI (2026-11): 흰 단색 카드 · 검정 글씨 · 알약 모양 조작 부품 · 스프링 모션
   레퍼런스: 한 덩어리가 크기·둥글기만 바꾸며 상태가 넘어가고, 내용은 짧은 블러로 바뀐다.
   그라데이션·글로우·통통 튀는 효과는 쓰지 않는다. 포인트 색 없이 흑백.
   ===================================================================== */
:root {
  --ink: #111111;
  --ink-dim: #6b6b6b;
  --card: #ffffff;
  --line: rgba(17, 17, 17, 0.1);
  --fill: rgba(17, 17, 17, 0.04);
  --fill-2: rgba(17, 17, 17, 0.06);
  --accent: #111111;
  --accent-ink: #111111;
  --glass: none;
  --spring: cubic-bezier(.2, .9, .25, 1);   /* src/motion.js가 스프링 곡선(linear())으로 바꾼다 */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 20px 50px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.16);
  font-family: "Geist", "Pretendard", -apple-system, "Apple SD Gothic Neo", sans-serif;
}
button, input, textarea { font-family: inherit; }

/* ---------- 떠 있는 카드: 흰 단색, 유리 효과 없음 ---------- */
.panel-card, #now-playing, #room-playing, #react-picker, #prompt, #social button, #mute-btn, #chat input, #ambient {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
#panel, #entry { background: rgba(10, 8, 6, 0.32); }
.panel-card {
  background: var(--card); border: 0; border-radius: 24px; box-shadow: var(--shadow); padding: 28px 26px 24px;
}
.panel-card h2 { font-weight: 700; letter-spacing: -0.02em; }
.panel-eyebrow { font-size: 11px; letter-spacing: 0.14em; font-weight: 600; color: var(--ink-dim); }
#panel-body { color: var(--ink-dim); }
#panel-close { color: var(--ink-dim); border-radius: 999px; }

/* 열릴 때: 살짝 작고 흐린 상태에서 스프링으로 제자리 */
#panel:not([hidden]) { animation: m-fade .2s ease both; }
#panel:not([hidden]) .panel-card { animation: m-pop .5s var(--spring) both; }
@keyframes m-fade { from { opacity: 0; } }
@keyframes m-pop { from { opacity: 0; transform: scale(.94) translateY(8px); filter: blur(6px); } }

/* ---------- 버튼: 알약 모양, 누르면 살짝 눌린다 ---------- */
.panel-card .btn {
  height: 48px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .35s var(--spring), background .2s;
}
.panel-card .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.panel-card .btn.small { height: 34px; font-size: 12.5px; padding: 0 14px; }
.panel-card .btn:active:not(:disabled), #prompt:active, #social button:active, .play:active, #now-playing button:active, .e2-btn:active, .e2-arrow:active, .swatch:active, .case-pick-item:active { transform: scale(.96); }
.product-actions .btn.on, .product-actions .btn.wear.on { color: #fff; background: var(--ink); border-color: var(--ink); }

/* ---------- 입력 칸: 알약 (여러 줄은 둥근 사각) ---------- */
.search, #chat input { border-radius: 999px; padding: 0 20px; height: 48px; background: var(--fill); border: 1px solid transparent; color: var(--ink); }
.note-input, .story-input { border-radius: 16px; background: var(--fill); border: 1px solid transparent; color: var(--ink); }
.search:focus, .note-input:focus, #chat input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.07); outline: none; }
.search::placeholder, .note-input::placeholder { color: rgba(17, 17, 17, 0.38); }
#chat input { background: var(--card); box-shadow: var(--shadow-sm); }

/* ---------- 목록 줄: 카드 안 칸은 카드보다 작게 둥글게 ---------- */
.track { border-radius: 14px; background: var(--fill); transition: background .2s; }
.track.pickable:hover { background: var(--fill-2); }
.track .cover { border-radius: 8px; background: #e9e9e9; }
.track .tag { border-radius: 999px; }
.play { border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); transition: transform .35s var(--spring), background .2s, color .2s; }
.play.on, .play:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.like { border-radius: 999px; }
.like.on { color: #fff; background: var(--ink); border-color: var(--ink); }
.mail, .story { border-radius: 16px; background: var(--fill); }
.mail .track { background: var(--card); }
.booth-now, .booth-q { border-radius: 14px; background: var(--fill); }
.booth-now img, .booth-q img, #now-playing img, #room-playing img { border-radius: 8px; }
.booth-mine { border-radius: 14px; border: 1px dashed rgba(17, 17, 17, 0.3); }
.booth-bar i, #now-playing .bar i, #room-playing .bar i { background: var(--ink); }
#panel-body .soon { border-color: var(--ink); color: var(--ink); }
#panel-body a, button.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 화면 아래 'E 둘러보기' 알약: 검정 알약, 나타날 때 스프링 ---------- */
#prompt {
  background: var(--ink); color: #fff; border: 0; box-shadow: var(--shadow-sm); padding: 0 18px 0 8px; height: 44px;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px;
  transition: transform .35s var(--spring);
}
#prompt kbd { margin: 0; min-width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; font-size: 12px; padding: 0 8px; }
#prompt:not([hidden]) { animation: m-pill .45s var(--spring) both; }
@keyframes m-pill { from { opacity: 0; transform: translateX(-50%) scale(.85); filter: blur(4px); } to { transform: translateX(-50%); } }
#prompt:active { transform: translateX(-50%) scale(.96); }

/* ---------- 알림: 검정 알약이 위에서 스프링으로 ---------- */
#toast { background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; padding: 11px 18px; box-shadow: var(--shadow-sm); }
#toast:not([hidden]) { animation: m-toast .45s var(--spring) both; }
@keyframes m-toast { from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.92); filter: blur(4px); } to { transform: translateX(-50%); } }

/* ---------- 오른쪽 아래 재생 카드들 ---------- */
#now-playing, #room-playing { background: var(--card); border: 0; border-radius: 20px; box-shadow: var(--shadow-sm); color: var(--ink); }
#room-playing { box-shadow: 0 0 0 1.5px var(--ink), var(--shadow-sm); }
#room-playing .where { color: var(--ink-dim); }
#now-playing button { background: var(--fill-2); color: var(--ink); border-radius: 999px; transition: transform .35s var(--spring); }
/* 재생 카드는 흐림 효과 없이 올라온다 (안에 있는 Apple Music 배지에 효과를 주지 않게) */
#now-playing:not([hidden]), #room-playing:not([hidden]) { animation: m-rise-card .5s var(--spring) both; }
@keyframes m-rise-card { from { opacity: 0; transform: translateY(12px); } }
@keyframes m-rise { from { opacity: 0; transform: translateY(12px) scale(.97); filter: blur(4px); } }

/* ---------- 위쪽 버튼들 · 배경음악 표시 ---------- */
#social button { background: var(--card); color: var(--ink); border: 0; box-shadow: var(--shadow-sm); height: 36px; padding: 0 14px; transition: transform .35s var(--spring); }
#social button:hover { border-color: transparent; }
#inbox-count { background: var(--ink); color: #fff; }
#ambient { background: var(--card); border: 0; box-shadow: var(--shadow-sm); color: var(--ink-dim); }
#ambient b { color: var(--ink); }
#mute-btn { border: 0; background: var(--fill-2); }
#react-picker { background: var(--card); border: 0; border-radius: 999px; box-shadow: var(--shadow-sm); padding: 6px; }
#react-picker:not([hidden]) { animation: m-pop .4s var(--spring) both; }
#react-picker button { border-radius: 999px; background: transparent; transition: transform .35s var(--spring), background .2s; }
#react-picker button:hover { background: var(--fill-2); }
#react-picker button.txt { color: var(--ink); }

/* ---------- 상품 창 ---------- */
.product-view { border-radius: 16px; background: var(--fill); }
.product-price { color: var(--ink); }
.swatch { border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); transition: transform .35s var(--spring), box-shadow .25s; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.case-pick-item { border: 0; border-radius: 16px; background: var(--fill); transition: transform .35s var(--spring), background .2s; }
.case-pick-item:hover { background: var(--fill-2); border-color: transparent; }
.case-pick-item img { border-radius: 10px; }

/* ---------- 모션 공용 (src/motion.js) ---------- */
.m-out { animation: m-out .14s ease forwards; }
.m-in { animation: m-in .3s var(--spring) both; }
@keyframes m-out { to { opacity: 0; filter: blur(5px); transform: translateY(-3px); } }
@keyframes m-in { from { opacity: 0; filter: blur(5px); transform: translateY(4px); } }
.m-seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill-2); border-radius: 999px; padding: 4px; }
.m-seg button { position: relative; z-index: 1; border: 0; background: none; font-weight: 500; font-size: 14px; color: var(--ink-dim); padding: 11px 0; cursor: pointer; border-radius: 999px; transition: color .25s; }
.m-seg button.on { color: #fff; }
.m-seg .knob { position: absolute; top: 4px; bottom: 4px; left: 0; right: 0; background: var(--ink); border-radius: 999px; opacity: 0; }
.m-seg.small button { font-size: 12.5px; padding: 8px 0; }
.fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .55s var(--spring), margin-top .55s var(--spring), opacity .25s ease, filter .25s ease; }
.fold > div, .fold > form { overflow: hidden; min-height: 0; }
.fold.closed { grid-template-rows: 0fr; opacity: 0; filter: blur(6px); pointer-events: none; }

/* ---------- 입장 화면 (src/entry.js) ---------- */
/* (닉네임 칸은 옛 어두운 테마의 #nickname 규칙보다 우선하도록 #nickname도 같이 지정한다) */
#entry { transition: opacity .25s ease; }
#entry.leaving { opacity: 0; }
.entry2 { width: min(380px, calc(100vw - 32px)); border-radius: 24px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); color: var(--ink); transition: height .55s var(--spring); }
#entry:not([hidden]) .entry2 { animation: m-pop .55s var(--spring) both; }
.entry2-inner { padding: 26px 24px 24px; display: flex; flex-direction: column; }
.entry2-inner > * + * { margin-top: 18px; }
.entry2-inner > .fold.closed { margin-top: 0; }
.e2-head { display: grid; gap: 6px; }
.e2-logo { height: 22px; justify-self: start; filter: grayscale(1) brightness(0); }
.e2-title { font-weight: 700; font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; margin: 0; }
.e2-desc { font-size: 13px; line-height: 1.5; color: var(--ink-dim); margin: 0; }
.e2-chip { display: inline-flex; align-items: center; gap: 6px; justify-self: start; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 10px; font-weight: 500; font-size: 12.5px; background: var(--card); cursor: pointer; color: var(--ink); }
.e2-chip svg { width: 12px; height: 12px; }
.e2-stack { display: grid; gap: 14px; }
.e2-viewport { position: relative; height: 320px; border-radius: 16px; background: var(--fill); }
.e2-viewport canvas { width: 100%; height: 100%; display: block; }
.e2-arrow { position: absolute; top: 50%; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform .35s var(--spring); }
.e2-arrow svg { width: 14px; height: 14px; }
.e2-arrow.l { left: 10px; } .e2-arrow.r { right: 10px; }
.e2-btn { position: relative; height: 50px; width: 100%; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; overflow: hidden; justify-self: center; transition: transform .35s var(--spring), width .5s var(--spring); }
.e2-btn .txt { transition: opacity .15s; }
.e2-btn .spin { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.e2-btn .spin svg { width: 20px; height: 20px; animation: m-rot .8s linear infinite; }
.e2-btn.loading { width: 50px; }
.e2-btn.loading .txt { opacity: 0; }
.e2-btn.loading .spin { opacity: 1; }
.e2-btn.done .spin svg { animation: none; }
@keyframes m-rot { to { transform: rotate(360deg); } }
.e2-who { display: flex; align-items: center; gap: 12px; }
.e2-face { width: 52px; height: 52px; border-radius: 50%; background: var(--fill-2); overflow: hidden; flex: none; }
.e2-face canvas { width: 100%; height: 100%; display: block; }
.e2-who b { display: block; font-weight: 600; font-size: 14px; }
.e2-link { border: 0; background: none; padding: 0; font-size: 12px; color: var(--ink-dim); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.e2-field { position: relative; }
.e2-field input, .e2-field #nickname { width: 100%; height: 52px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); padding: 0 56px 0 20px; font-weight: 500; font-size: 16px; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .35s var(--spring); }
.e2-field input:focus, .e2-field #nickname:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.07); }
.e2-count { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-dim); }
.e2-err { margin: -6px 0 0 6px; font-size: 12px; color: var(--ink); min-height: 0; }
.e2-err:empty { display: none; }
#prompt[hidden] { display: none; }                         /* 위에서 inline-flex로 바꿔서 hidden이 무시되지 않게 */
#panel-body a.btn { color: #fff; text-decoration: none; }  /* 링크 밑줄 규칙이 검정 버튼 글씨를 덮지 않게 */
#panel-body a.btn.ghost { color: var(--ink); }

/* 배경음악 표시: 상자 없이 흰 글씨만, 소리 켜기/끄기만 버튼 */
#ambient { background: none; box-shadow: none; padding: 0; color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }
#ambient b { color: #fff; }
#ambient #mute-btn {
  width: 34px; height: 34px; border-radius: 999px; border: 0; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; padding: 0; text-shadow: none; transition: transform .35s var(--spring);
}
#ambient #mute-btn:active { transform: scale(.92); }
#ambient #mute-btn svg { width: 16px; height: 16px; }

/* 화면 위에 바로 얹힌 흰 글씨: 밝은 벽(굿즈샵) 위에서도 읽히게 그림자를 진하게 */
#zone-name, #online, #help, #ambient { text-shadow: 0 0 2px rgba(0, 0, 0, 0.55), 0 1px 8px rgba(0, 0, 0, 0.6); }
/* 케이스 고르기: 개수가 적으면 가운데로 */
.case-pick { grid-template-columns: repeat(auto-fit, minmax(140px, 180px)); justify-content: center; }
#online { color: #fff; font-weight: 600; }   /* 밝은 벽(굿즈샵) 앞에서도 접속자 수가 읽히게 */

/* 화면 위 구역 이름·접속자 수: 번지는 큰 그림자 대신 또렷한 흰 글씨 + 얇은 그림자 */
#zone-name { color: #fff; font-weight: 600; text-shadow: 0 0 1px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.55); -webkit-font-smoothing: antialiased; }
#online { text-shadow: 0 0 1px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.55); }

/* ---------- 사연 게시판 (카드 격자 → 사연 하나) ---------- */
.sb-head { display: flex; align-items: center; gap: 12px; }
#panel-body .sb-head p { margin: 0; flex: 1; font-size: 13px; }
.sb-write { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 12px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; transition: transform .35s var(--spring); }
.sb-write:active { transform: scale(.95); }
.sb-write svg { width: 13px; height: 13px; }
.sb-list { display: grid; gap: 12px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sb-card { position: relative; border: 0; padding: 0; text-align: left; background: var(--fill); border-radius: 16px; overflow: hidden; cursor: pointer; color: var(--ink); font: inherit; transition: transform .35s var(--spring); }
.sb-card:active { transform: scale(.97); }
.sb-cover { position: relative; display: block; }
.sb-cover img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--fill-2); }
.sb-pin { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: #fff; font-size: 10.5px; font-weight: 600; padding: 3px 8px 3px 6px; border-radius: 999px; }
.sb-pin .ico svg, .sb-heart .ico svg, .sb-pill .ico svg { width: 11px; height: 11px; display: block; }
.sb-meta { padding: 10px 12px 12px; display: grid; gap: 4px; }
.sb-meta .t { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-meta .x { font-size: 12px; line-height: 1.45; color: var(--ink-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.sb-meta .f { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; }
.sb-heart { display: inline-flex; align-items: center; gap: 4px; }
.sb-one { display: grid; gap: 16px; color: var(--ink); }
.sb-top, .sb-nav { display: flex; justify-content: space-between; align-items: center; }
.sb-count { font-size: 12.5px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.sb-round { width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--fill-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform .35s var(--spring); }
.sb-round:active { transform: scale(.92); }
.sb-round svg { width: 15px; height: 15px; }
.sb-track { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: end; }
.sb-track img { width: 128px; height: 128px; border-radius: 12px; object-fit: cover; }
.sb-track b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.sb-artist { display: block; font-size: 12.5px; color: var(--ink-dim); overflow-wrap: anywhere; }
.sb-cover-wrap { position: relative; width: 128px; height: 128px; }
.sb-cover-play { position: absolute; right: 8px; bottom: 8px; width: 42px; height: 42px; border-radius: 999px; border: 0; background: rgba(17, 17, 17, 0.88); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); transition: transform .35s var(--spring); }
.sb-cover-play:active { transform: scale(.92); }
.sb-cover-play svg { width: 15px; height: 15px; }
.sb-hint { font-size: 12px; color: var(--ink-dim); margin-top: 8px; }
.sb-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--fill-2); color: var(--ink); font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; transition: transform .35s var(--spring), background .2s, color .2s; }
.sb-pill.on { background: var(--ink); color: #fff; }
.sb-pill:active { transform: scale(.95); }
#panel-body .sb-text { margin: 0; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.sb-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--ink-dim); }
.sb-meta .t, .sb-meta .x { overflow-wrap: anywhere; }
.sb-card:focus-visible, .sb-round:focus-visible, .sb-pill:focus-visible, .sb-cover-play:focus-visible, .sb-write:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sb-cover-play:focus-visible { outline-color: #fff; box-shadow: 0 0 0 4px var(--ink); }
.sb-one { touch-action: pan-y; }

/* ---------- 좁은 화면(폰): 위·아래 HUD가 겹치지 않게 줄인다 ---------- */
@media (max-width: 760px) {
  #zone-name { display: none; }                       /* 장소 이름은 아래 'E' 알약에 이미 나온다 */
  .hud-more { display: none; }                        /* '2명 접속 중' → '2명', 배경음악은 곡 제목만, 쪽지함은 아이콘만 */
  #ambient { left: 10px; top: 10px; max-width: calc(100vw - 150px); font-size: 12px; }
  #social { top: 10px; right: 10px; gap: 6px; }
  #social button { height: 36px; padding: 0 12px; font-size: 14px; }
  #online { font-size: 12px; margin-right: 0; }
}
@media (pointer: coarse) {
  /* 'E' 알약: 왼쪽 아래 조이스틱과 겹치지 않게 오른쪽 아래로 */
  #prompt { left: auto; right: 14px; bottom: 44px; transform: none; max-width: calc(100vw - 190px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 16px; }
  #prompt:not([hidden]) { animation: m-pill-r .45s var(--spring) both; }
  #prompt:active { transform: scale(.96); }
  /* 재생 카드: 조이스틱 위로, 작게 */
  #now-playing, #room-playing { left: 10px; right: 10px; width: auto; bottom: 168px; padding: 8px; gap: 8px; border-radius: 18px; }
  #now-playing img, #room-playing img { width: 40px; height: 40px; }
  #now-playing button { width: 34px; height: 34px; }
}
@keyframes m-pill-r { from { opacity: 0; transform: scale(.85); filter: blur(4px); } to { transform: none; } }

/* 폰: 버튼을 빨리 여러 번 눌러도 화면이 확대되지 않게 (두 번 탭 확대 끄기), 누를 때 회색 번쩍임 없애기 */
html, body, #hud, #panel, button, a, input, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#scene { touch-action: none; }

/* ---------- 폰: 미리듣기 카드는 위쪽 배경음악 자리에, '전체 듣기'는 카드를 눌러야 펼쳐진다 ---------- */
@media (pointer: coarse) {
  /* 둥근 사각 카드 + 정사각 커버, 폭은 화면의 약 3분의 2. 살짝 비치는 유리(뒤가 흐리게 보이는 반투명) */
  #now-playing { top: 8px; bottom: auto; left: 8px; right: auto; width: min(66vw, 270px); grid-template-columns: 36px 1fr auto auto; gap: 6px 8px; padding: 6px; border-radius: 16px;
    background: rgba(255, 255, 255, 0.55); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 6px 20px rgba(0, 0, 0, 0.18); }
  #now-playing img { width: 36px; height: 36px; border-radius: 8px; }
  #now-playing button { background: rgba(255, 255, 255, 0.5); }
  #now-playing .bar { background: rgba(17, 17, 17, 0.12); }
  #now-playing .title { font-size: 13px; }
  #now-playing .artist { font-size: 11px; }
  #now-playing .bar { margin-top: 3px; }
  #now-playing button { width: 30px; height: 30px; }
  /* 폰에서도 출처·배지 줄은 늘 보인다 (카드를 누르지 않아도) */
  #now-playing { width: min(calc(100vw - 110px), 300px); }
  #now-playing .credit, #room-playing .credit { font-size: 9.5px; }
  /* 반응 고르기: 폰에서는 작게 */
  #react-picker { padding: 4px; gap: 2px; }
  #react-picker button { font-size: 20px; padding: 4px 7px; }
  #react-picker button.txt { font-size: 12px; white-space: nowrap; padding: 4px 9px; }
}

/* 사연 하나 보기: 왼쪽 위 ‹ (닫기 ×와 같은 크기·높이) */
#panel-back, .panel-back {
  position: absolute; top: 12px; left: 14px; width: 34px; height: 34px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-dim); cursor: pointer; display: grid; place-items: center; padding: 0;
}
#panel-back svg, .panel-back svg { width: 18px; height: 18px; }
#panel-back:hover, .panel-back:hover { background: var(--fill-2); color: var(--ink); }
.panel-card.has-back .panel-eyebrow { padding-left: 30px; }

/* ---------- UI 다듬기 ---------- */
/* 검색창: 결과가 많아도 눌리지 않게 */
.search { flex: 0 0 auto; }
/* 검색 중 빈 줄 모양 */
.sk-row { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 7px 8px; border-radius: 12px; background: var(--fill); }
.sk-row i { width: 48px; height: 48px; border-radius: 8px; background: var(--fill-2); }
.sk-row span { display: grid; gap: 8px; }
.sk-row b, .sk-row em { display: block; height: 10px; border-radius: 6px; background: var(--fill-2); }
.sk-row b { width: 46%; } .sk-row em { width: 28%; }
.sk-row i, .sk-row b, .sk-row em { animation: sk-pulse 1.1s ease-in-out infinite alternate; }
@keyframes sk-pulse { from { opacity: .45; } to { opacity: 1; } }
/* 상품 창: 스토어로 가는 버튼만 진하게. 착용 버튼은 연하게, 착용 중이면 테두리만 */
.product-actions .btn.on, .product-actions .btn.wear.on { color: var(--ink); background: var(--fill); border: 1.5px solid var(--ink); }
/* 조작 안내 한 줄은 안내 창(?)으로 옮겼다 */
#help { display: none; }
/* 왼쪽 위 음악 표시: 곡 제목만 보이고, 누르면 가수·출처가 펼쳐진다 */
#ambient-text { cursor: pointer; }
#ambient:not(.open) #ambient-text .hud-more { display: none; }
#ambient.open #ambient-text .hud-more { display: inline; }
/* 매장 안내 창 */
#guide-btn { width: 36px; padding: 0; font-weight: 700; }
.guide h3 { margin: 6px 0 2px; font-size: 13px; letter-spacing: .08em; color: var(--ink-dim); font-weight: 600; }
.guide-keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; font-size: 15px; color: var(--ink); }
.guide-keys kbd { font: inherit; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: var(--fill); white-space: nowrap; justify-self: start; }
.guide-places { display: grid; gap: 8px; }
.guide-place { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.guide-place i { font-style: normal; font-size: 20px; text-align: center; }
.guide-place b { display: block; color: var(--ink); font-size: 15px; }
.guide-place span { font-size: 13px; color: var(--ink-dim); }
.empty small { display: block; margin-top: 6px; font-size: 13px; opacity: .8; }

/* 주인장 대화: 제목 자리에 로고 */
.panel-logo { display: block; height: 15px; width: auto; margin: -12.5px 0 8.5px; }   /* 닫기 ×와 같은 줄에, 작게 */
.npc-hello { margin: 0 0 18px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; color: var(--ink); }   /* 예전 제목 '주인장'과 같은 크기 */
.panel-card.has-back .panel-logo { margin-left: 26px; }                               /* 뒤로 ‹ 바로 옆 */
/* 제목 없는 화면에서 ‹ 버튼과 글이 겹치지 않게 */
.panel-card.no-head.has-back #panel-body { padding-top: 46px; }
/* 링크 미리보기 카드 */
.link-card { display: block; margin-top: 6px; border-radius: 14px; overflow: hidden; border: 1px solid var(--fill-2); text-decoration: none; color: var(--ink); transition: transform 0.15s; }
.link-card:hover { transform: translateY(-1px); }
.link-card .lc-img { background: #fff; height: 120px; display: grid; place-items: center; border-bottom: 1px solid var(--fill-2); }
.link-card .lc-img img { height: 40px; width: auto; }
.link-card .lc-text { display: grid; gap: 3px; padding: 12px 14px 13px; background: var(--fill-2); }
.link-card strong { font-size: 15px; }
.link-card .lc-desc { font-size: 13px; color: var(--ink-dim); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card .lc-url { font-size: 12px; color: var(--ink-dim); text-decoration: underline; }
#panel-body .link-card, #panel-body .link-card strong, #panel-body .link-card .lc-desc { text-decoration: none; }
#panel-body .link-card .lc-url { text-decoration: underline; }
#panel-body p.npc-a { font-size: 15px; color: var(--ink); }
.npc-para { display: block; }
.npc-para + .npc-para { margin-top: 14px; }
#panel-body p.npc-a { word-break: keep-all; }
.npc-items { display: grid; gap: 8px; }
.npc-item { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: baseline; }
.npc-item b { font-weight: 700; color: var(--ink); }
#panel-body p.npc-hello:has(+ .npc-sub) { margin-bottom: 6px; }
#panel-body p.npc-sub { margin: 0 0 18px; font-size: 14px; color: var(--ink-dim); }
/* 주인장 대답 화면: ‹ 와 × 사이 가운데에 누른 질문을 작게 */
.panel-crumb { position: absolute; top: 12px; left: 56px; right: 56px; height: 34px; display: grid; place-items: center; font-size: 13px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
#ambient-text:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }
/* 창 위쪽 한 줄 맞추기: 작은 글씨(eyebrow)의 가운데를 닫기 ×·뒤로 ‹ 의 가운데(창 위에서 29px)에 맞춘다 */
.panel-card .panel-eyebrow { line-height: 34px; margin: -16px 0 -6px; }
/* 위쪽 동그란 아이콘 버튼: 안내(i) · 쪽지함(편지) */
#social button.hud-icon { position: relative; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
#social button.hud-icon svg { width: 19px; height: 19px; }
#social button.hud-icon #inbox-count { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; line-height: 16px; margin: 0; }
/* 큰 제목 줄 오른쪽 버튼 (사연 쓰기 등): 제목과 같은 높이 가운데 */
.panel-card .panel-action { position: absolute; top: 43px; right: 26px; }
#panel-body p.sb-desc { margin: 0 0 4px; font-size: 13.5px; word-break: keep-all; }
.sb-empty { padding: 40px 0 28px; }
.sb-empty b { display: block; color: var(--ink); font-size: 15px; font-weight: 700; }
/* 창 맨 아래 고정 버튼 칸 */
.panel-footer { flex: none; padding-top: 14px; }
.panel-footer .btn { width: 100%; }
.sb-write-wide { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sb-write-wide svg { width: 14px; height: 14px; }

/* 곡 검색 화면: 제목과 띄우고, 돋보기, 부드러운 포커스, 안내 글은 입력 글자와 같은 줄에서 시작 */
.searchbox { margin-top: 14px; display: flex; flex-direction: column; }
.searchbox .search {
  padding-left: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23111' stroke-opacity='.4' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='5.5'/%3E%3Cpath d='m13.2 13.2 3.3 3.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 18px center; background-size: 18px;
}
.searchbox .search:focus { background-color: #fff; border-color: rgba(17, 17, 17, 0.18); box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.04); }
.searchbox .search::-webkit-search-cancel-button { cursor: pointer; }
.searchbox > .status { padding: 5px 0 0 46px; font-size: 12.5px; }
.searchbox > .status:empty { display: none; }
.searchbox > .list { margin-top: 12px; }
.searchbox > .list:empty { display: none; }
/* 창 크기가 스프링으로 바뀌는 동안 본문 칸들이 눌려 찌그러지지 않게 (검정 버튼이 얇아졌다 굵어지던 것) */
#panel-body > * { flex-shrink: 0; }
/* 리스닝 룸 신청곡 창: 지금 곡 안내 → 규칙(가운데, 짧게 끊어서) → 신청 버튼 → 다음 곡 한 줄 */
#panel-body .booth-empty { padding: 22px 0 0; }
#panel-body p.booth-rules { margin: 0 0 6px; text-align: center; line-height: 1.7; font-size: 12.5px; word-break: keep-all; }
.booth-q-title .booth-q-none { letter-spacing: 0; }
/* 리스닝 룸 신청곡 창 (우선순위 정리) */
#panel-body .booth-empty { padding: 30px 0 18px; }
.booth-empty b { display: block; color: var(--ink); font-size: 15px; font-weight: 700; }
.panel-footer .booth-rule { margin: 8px 0 0; text-align: center; font-size: 12px; }
.panel-footer .booth-mine { border-style: solid; border-color: transparent; background: var(--fill); padding: 12px 16px; }
.booth-mine .m { display: grid; gap: 2px; min-width: 0; }
.booth-mine .m small { font-size: 11.5px; color: var(--ink-dim); }
.booth-mine .m b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booth-q.me { box-shadow: inset 0 0 0 1.5px rgba(17, 17, 17, 0.2); }
.e2-tag { margin: 2px 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.e2-head { gap: 0; }
.e2-logo { height: 15px; margin-bottom: 14px; }
.e2-title { font-size: 24px; line-height: 1.3; }
.e2-desc { margin-top: 8px; }
/* 접속 인원 = 채널 고르기 버튼 (다른 위쪽 버튼과 같은 흰 알약) */
#social button#online { font-size: 13px; font-weight: 600; color: var(--ink); text-shadow: none; margin-right: 0; cursor: pointer; white-space: nowrap; }
/* 채널 목록 */
.ch-list { display: grid; gap: 8px; }
.ch-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: transform .35s var(--spring); }
.ch-row:active:not(:disabled) { transform: scale(.98); }
.ch-row.here { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); cursor: default; }
.ch-dot { width: 36px; height: 36px; border-radius: 50%; display: block; }
.ch-ocean { background: linear-gradient(#5b6fa3, #f0a070 55%, #ffc98a 60%, #7c8fa6); }
.ch-city { background: linear-gradient(#0d0f19, #3a2a22 60%, #d9a85a 62%, #14110f); }
.ch-forest { background: linear-gradient(#4a88cc, #b4d4ea 45%, #e9eef0 50%, #5d9a44 62%); }
.ch-christmas { background: linear-gradient(#0b0f22, #3a2c2a 55%, #b7a596 60%, #8c7b6e); }
.ch-meta { display: grid; gap: 1px; }
.ch-meta b { font-size: 15px; } .ch-meta small { font-size: 12.5px; color: var(--ink-dim); }
.ch-n { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.ch-n em { font-style: normal; font-weight: 600; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: #fff; }
/* 채널 옮기는 순간의 막 */
.ch-curtain { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 6px; background: rgba(12, 10, 9, 0.86); color: #fff; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.ch-curtain.on { opacity: 1; pointer-events: auto; }
.ch-curtain .ch-dot { width: 64px; height: 64px; margin-bottom: 10px; transform: scale(.85); transition: transform .6s var(--spring); }
.ch-curtain.on .ch-dot { transform: none; }
.ch-curtain b { font-size: 22px; letter-spacing: -0.02em; }
.ch-curtain small { font-size: 13.5px; opacity: .7; }
/* 신고 */
.link.report { color: var(--ink-dim); font-size: 12px; opacity: .75; }
.note .link.report { margin-left: 8px; }
.sb-report, .peer-report { text-align: right; margin-top: -4px; }
.peer-sub { display: flex; justify-content: center; gap: 18px; margin-top: 2px; }
.peer-sub .link { font-size: 12.5px; color: var(--ink-dim); }
.peer-sub .link.report { font-size: 12.5px; opacity: 1; }
#panel-body p.peer-hint { text-align: center; margin: 0; }
/* 코너 창: 오늘 꽂힌 LP 한 줄 */
#panel-body p.crate-today { margin: -4px 0 2px; font-size: 13.5px; color: var(--ink-dim); display: flex; align-items: center; gap: 6px; min-height: 20px; }
.crate-today b { color: var(--ink); margin: 0 -3px 0 -2px; }
.crate-today i { width: 7px; height: 7px; border-radius: 50%; background: #e8554a; display: block; }
/* 좁은 화면에서 한글이 낱말 중간에서 끊기지 않게 ('보세/요' 같은 줄바꿈 방지). 긴 영어·주소는 넘치지 않게 꺾는다 */
#panel-body, .panel-footer, .e2-desc { word-break: keep-all; overflow-wrap: anywhere; }
/* 폰: 화면을 노치·주소줄 밑까지 꽉 채우고, 버튼들은 가려지지 않는 안쪽(안전 영역)에 둔다 */
html, body { background: #2a1712; }
#scene { height: 100%; min-height: 100dvh; }
#hud { inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.panel-card { max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
/* 자판이 올라왔을 때: 창을 보이는 영역 안에 맞춘다 */
html.kbd #panel, html.kbd #entry { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100%); align-items: flex-start; padding-top: max(10px, env(safe-area-inset-top, 0px)); }
html.kbd .panel-card { max-height: calc(var(--vvh, 100vh) - 20px - env(safe-area-inset-top, 0px)); }
html.kbd .entry2 { max-height: calc(var(--vvh, 100vh) - 20px - env(safe-area-inset-top, 0px)); overflow-y: auto; }
/* 홈 화면에 추가해 연 화면: 맨 아래(홈 막대 자리)까지 그림을 채운다 */
html.standalone, html.standalone body { height: 100vh; height: 100lvh; }
html.standalone #scene { height: 100vh; height: 100lvh; }
/* 안내 창 (짧은 판) */
.guide-keys { grid-template-columns: auto 1fr; gap: 8px 14px; }
#panel-body p.guide-more { margin: 12px 0 14px; font-size: 12.5px; }
.guide-list { display: grid; border-top: 1px solid var(--fill-2); }
.guide-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--fill-2); align-items: baseline; }
.guide-list b { color: var(--ink); font-size: 14.5px; white-space: nowrap; }
/* 매장 안내 맨 아래: 음악 출처·상표 고지 (작게) */
.guide-legal { margin: 14px 2px 0; font-size: 10.5px; line-height: 1.5; color: var(--ink-dim); word-break: keep-all; }
.guide-list span { color: var(--ink-dim); font-size: 13px; text-align: right; }
/* 처음 입장: 화면 위쪽 조작 한 줄 */
#first-hint { position: absolute; top: 62px; left: 50%; transform: translate(-50%, -6px); display: flex; gap: 14px; padding: 9px 16px; border-radius: 999px; background: rgba(17, 14, 12, 0.72); color: #fff; font-size: 13px; white-space: nowrap; opacity: 0; transition: opacity .4s ease, transform .4s ease; pointer-events: none; backdrop-filter: blur(6px); }
#first-hint.on { opacity: 1; transform: translate(-50%, 0); }
#first-hint span { display: inline-flex; align-items: center; gap: 6px; }
#first-hint kbd { font: inherit; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.18); }
@media (max-width: 480px) { #first-hint { gap: 10px; padding: 8px 12px; font-size: 12px; } }
/* 안내 창: 조작 세 칸 (자판 그림) */
.guide-ctrls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.guide-ctrl { display: grid; justify-items: center; gap: 8px; padding: 12px 6px 10px; border-radius: 14px; background: var(--fill); font-size: 13px; color: var(--ink); font-weight: 600; }
.gc-v { height: 58px; display: grid; place-items: center; }
.guide-ctrl kbd { font: inherit; font-size: 12px; font-weight: 700; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center; border-radius: 7px; background: #fff; box-shadow: 0 1px 0 1px rgba(17, 17, 17, 0.12); }
.guide-ctrl kbd.wide { padding: 0 9px; font-size: 11.5px; white-space: nowrap; }
.wasd { display: grid; grid-template-columns: repeat(3, 26px); gap: 4px; }
.wasd kbd.w { grid-column: 2; }
.wasd kbd:nth-child(2) { grid-column: 1; }
/* 약도 */
.guide-map { margin: 2px 0 6px; }
.guide-map svg { display: block; width: 100%; height: auto; }
.guide-map .rm { fill: var(--fill); }
.guide-map .bins rect { fill: rgba(17, 17, 17, 0.12); }
.guide-map .mark { fill: var(--ink); }
.guide-map .me { fill: #e8554a; }
.guide-map text { font-size: 11.5px; paint-order: stroke; stroke: #f4f4f2; stroke-width: 3px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.guide-map text.sm { font-size: 9px; font-weight: 500; fill: var(--ink-dim); }
.guide-map text.e { text-anchor: end; } .guide-map text.s { text-anchor: start; }
.guide-map text.v { writing-mode: vertical-rl; }

/* ---------- 긴 곡 제목이 옆으로 흐른다 (음악 앱처럼) ---------- */
.mq { overflow: hidden; text-overflow: clip !important; }
.mq-in { display: inline-flex; white-space: nowrap; }
.mq-in > span { flex: none; }
.mq.mq-on { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent); }
.mq.mq-on .mq-in > span { padding: 0 32px 0 10px; }
.mq.mq-on .mq-in > span + span { padding-left: 0; padding-right: 42px; }
.mq.mq-on .mq-in { margin-left: -10px; animation: mq-roll 10s linear infinite; }
@keyframes mq-roll { 0%, 18% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mq.mq-on .mq-in { animation: none; } }

/* ---------- 폰: 곡 카드는 위쪽 버튼 줄 바로 아래, 작게 (캐릭터·버튼·조이스틱을 가리지 않게) ---------- */
@media (pointer: coarse) {
  #ambient { max-width: calc(var(--topbar-free, 60vw) - 20px); }
  html.card-on #ambient-text { display: none; }
  #ambient { transition: padding .2s; }
  html.card-on #ambient { padding-right: 4px; }
  #now-playing, #room-playing {
    top: calc(var(--topbar-bottom, 56px) + 8px); bottom: auto; left: 8px; right: auto; width: fit-content; min-width: min(calc(100vw - 16px), 250px); max-width: min(calc(100vw - 16px), 290px);   /* 제목 길이만큼만 (긴 제목은 흐른다). 최소 폭은 출처·배지 줄이 들어가게 */
    gap: 6px 8px; padding: 6px; border-radius: 16px;
    background: rgba(255, 255, 255, 0.62); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    border: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 6px 20px rgba(0, 0, 0, 0.18);
  }
  #room-playing { grid-template-columns: 36px 1fr; }
  #room-playing img { width: 36px; height: 36px; border-radius: 8px; }
  #room-playing .where { font-size: 10px; letter-spacing: 0.02em; line-height: 1.2; }
  #room-playing .title { font-size: 13px; }
  #room-playing .artist { font-size: 11px; }
  #room-playing .bar { margin-top: 3px; background: rgba(17, 17, 17, 0.12); }
}

/* ---------- 재생 카드 다듬기: 한 덩어리로 보이게 ----------
   위: 커버 · 제목/가수 · 재생(검정 원) · 닫기(옅게)
   가운데: 얇은 진행 막대
   아래: 가는 선으로 나눈 출처 줄 (왼쪽 문구, 오른쪽 Apple Music 배지) */
#now-playing { grid-template-columns: 48px 1fr auto auto; gap: 0 10px; padding: 12px 12px 10px; width: min(340px, calc(100vw - 32px)); }
#room-playing { gap: 0 10px; padding: 12px 12px 10px; width: min(340px, calc(100vw - 32px)); }
#now-playing img { width: 48px; height: 48px; border-radius: 10px; }
#room-playing img { border-radius: 10px; }
#now-playing .title, #room-playing .title { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
#now-playing .artist, #room-playing .artist { font-size: 12.5px; line-height: 1.3; margin-top: 1px; }
#now-playing .bar, #room-playing .bar { height: 3px; margin-top: 8px; border-radius: 999px; background: rgba(17, 17, 17, 0.09); }
#now-playing .bar i, #room-playing .bar i { border-radius: 999px; }

#now-playing button { display: grid; place-items: center; padding: 0; border: 0; }
#now-playing button svg { display: block; }
#now-playing .toggle { width: 38px; height: 38px; background: var(--ink); color: #fff; }
#now-playing .stop { width: 28px; height: 28px; background: transparent; color: var(--ink-dim); }
#now-playing .stop:hover { background: var(--fill-2); color: var(--ink); }
/* 마우스로 누른 뒤 남는 파란 테두리는 없애고, 키보드로 옮겨 다닐 때만 검정 테두리 */
#now-playing button:focus { outline: none; }
#now-playing button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

#now-playing .am-row, #room-playing .am-row { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
#now-playing .credit, #room-playing .credit { font-size: 11px; letter-spacing: 0; color: rgba(17, 17, 17, 0.45); }
.am-badge { padding: 3px; margin-right: -3px; }   /* 배지 둘레 여백(높이의 1/10)은 지키면서 카드 오른쪽 끝선에 맞춘다 */

@media (pointer: coarse) {
  #now-playing { grid-template-columns: 36px 1fr auto auto; padding: 8px 8px 6px; gap: 0 8px; }
  #room-playing { padding: 8px 8px 6px; gap: 0 8px; }
  #now-playing img { width: 36px; height: 36px; border-radius: 8px; }
  #now-playing .title, #room-playing .title { font-size: 13px; }
  #now-playing .artist, #room-playing .artist { font-size: 11px; }
  #now-playing .bar, #room-playing .bar { margin-top: 5px; }
  #now-playing .toggle { width: 32px; height: 32px; background: var(--ink); }
  #now-playing .stop { width: 26px; height: 26px; background: transparent; }
  #now-playing .am-row, #room-playing .am-row { margin-top: 7px; padding-top: 5px; border-top-color: rgba(17, 17, 17, 0.08); }
  #now-playing .credit, #room-playing .credit { font-size: 10px; }
}
/* 출처 문구 위 '30초 미리듣기' */
#now-playing .credit .pv, #room-playing .credit .pv { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--ink); }
@media (pointer: coarse) { #now-playing .credit .pv, #room-playing .credit .pv { font-size: 11px; margin-bottom: 1px; } }

/* ---------- 내 목록 (+ 로 담기) ---------- */
/* + 버튼: ▶ 버튼과 같은 동그라미, 조금 작게. 담긴 곡은 ✓ 로 채운다 */
.add { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; padding: 0; cursor: pointer; transition: transform .35s var(--spring), background .2s, color .2s; }
.add.on { background: var(--fill-2); color: var(--ink); border-color: transparent; }
.add:active { transform: scale(.94); }
.sb-add { margin-top: 8px; }
.track .am-link { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--ink-dim); text-decoration: none; }
.track .am-link:hover { color: var(--ink); text-decoration: underline; }
#social button.hud-icon .hud-count { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; line-height: 16px; margin: 0; background: var(--ink); color: #fff; font-weight: 700; }
#social button.hud-icon .hud-count[hidden] { display: none; }
.searchbox .suggest-title { font-size: 12px; font-weight: 700; color: var(--ink-dim); margin: 2px 2px 4px; }

/* ---------- 리스닝 룸: 이번 추천 앨범 ---------- */
.lr-album { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.lr-album img { width: 96px; height: 96px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); background: #e9e9e9; }
.lr-album-meta { min-width: 0; }
.lr-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-dim); }
.lr-title { margin-top: 3px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.25; overflow-wrap: anywhere; }
.lr-artist { margin-top: 2px; font-size: 13px; color: var(--ink-dim); }
#panel-body a.lr-am, .lr-am { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--ink-dim); text-decoration: none; }
#panel-body a.lr-am:hover { color: var(--ink); text-decoration: underline; }
.lr-note { margin: 14px 0 4px; padding: 11px 14px; border-radius: 14px; background: var(--fill); font-size: 13px; line-height: 1.55; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.lr-note b { font-weight: 700; }
.lr-list { margin-top: 10px; }
.lr-row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.lr-reacts { display: flex; gap: 4px; }
.lr-react {
  display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-dim); font: inherit; font-size: 12px; cursor: pointer;
  transition: transform .35s var(--spring), background .2s;
}
.lr-react span { font-size: 13px; line-height: 1; }
.lr-react b { font-weight: 600; font-variant-numeric: tabular-nums; }
.lr-react:hover { background: var(--fill-2); }
.lr-react.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.lr-react:active { transform: scale(.94); }
.lr-react:focus { outline: none; }
.lr-react:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lr-listening { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); font-weight: 600; }
.lr-listening i { width: 7px; height: 7px; border-radius: 50%; background: #e8554a; animation: lr-pulse 1.4s ease-in-out infinite; }
@keyframes lr-pulse { 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .lr-listening i { animation: none; } }
.lr-rule { margin: 0; text-align: center; }
@media (pointer: coarse) {
  .lr-album { grid-template-columns: 72px 1fr; gap: 12px; }
  .lr-album img { width: 72px; height: 72px; border-radius: 10px; }
  .lr-title { font-size: 16px; }
  .lr-react { height: 28px; padding: 0 9px; }
}
/* 같은 앨범이라 곡마다 커버를 반복하지 않고 곡 번호를 보여 준다 */
.lr-list { counter-reset: lr; margin-top: 6px; }
.lr-list .track { counter-increment: lr; grid-template-columns: 26px 1fr auto; }
.lr-list .track .cover { display: none; }
.lr-list .track::before { content: counter(lr); align-self: start; padding-top: 2px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
#panel-body .lr-note { margin: 2px 0 0; }
#panel-body .lr-list { margin-top: 2px; }

/* 한글이 낱말 중간에서 끊기지 않게 (예: '다/니며'). 어디서든 띄어쓰기에서만 줄을 바꾸고, 줄 길이는 고르게 */
body { word-break: keep-all; overflow-wrap: break-word; }
#toast { max-width: min(440px, calc(100vw - 32px)); width: max-content; text-align: center; text-wrap: balance; line-height: 1.45; }
#prompt, #first-hint, .ch-curtain, .empty, .hint, .status { text-wrap: balance; }

/* ---------- 폰: 재생 카드를 한 줄짜리 작은 바로 (화면을 덜 가리게) ----------
   [커버] 제목 / 가수 / 30초 미리듣기 · Provided courtesy of iTunes   [Apple Music 배지] [▶]   (×는 모서리)
   출처 문구와 배지는 작아져도 늘 보인다 (iTunes 미리듣기 이용 조건). 진행 막대는 카드 아래 가장자리에 얇게 */
@media (pointer: coarse) {
  #now-playing, #room-playing {
    left: 8px; right: 8px; width: auto; min-width: 0; max-width: none;
    padding: 6px 8px 7px 6px; gap: 0; border-radius: 14px; align-items: center; overflow: visible;
  }
  /* 가운데: 1줄 제목 / 2줄 가수 · 30초 미리듣기 / 3줄 Provided courtesy of iTunes */
  #now-playing { grid-template-columns: 46px auto 1fr auto auto; grid-template-areas: "cv t t b g" "cv a p b g" "cv c c b g"; }
  #room-playing { grid-template-columns: 46px auto 1fr auto; grid-template-areas: "cv w w b" "cv t t b" "cv a p b" "cv c c b"; }
  #now-playing .np-meta, #room-playing .np-meta, #now-playing .am-row, #room-playing .am-row, #now-playing .credit, #room-playing .credit { display: contents; }
  #now-playing > img, #room-playing > img { grid-area: cv; width: 38px; height: 38px; border-radius: 8px; align-self: center; margin-right: 8px; }
  #now-playing .title, #room-playing .title { grid-area: t; min-width: 0; font-size: 12.5px; line-height: 1.25; }
  #now-playing .artist, #room-playing .artist { grid-area: a; min-width: 0; font-size: 11px; line-height: 1.25; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #room-playing .where { grid-area: w; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #now-playing .credit .src, #room-playing .credit .src { grid-area: c; min-width: 0; font-size: 9.5px; line-height: 1.3; margin-top: 1px; color: rgba(17, 17, 17, 0.5); }
  #now-playing .credit .pv, #room-playing .credit .pv { grid-area: p; justify-self: start; display: block; white-space: nowrap; font-size: 10.5px; line-height: 1.25; font-weight: 600; margin: 0; color: var(--ink); }
  #now-playing .credit .pv::before, #room-playing .credit .pv::before { content: ' · '; white-space: pre; font-weight: 400; color: var(--ink-dim); }
  #now-playing .am-badge, #room-playing .am-badge { grid-area: b; align-self: center; margin: 0 0 0 6px; }
  #now-playing .am-badge { margin-right: 6px; }
  #now-playing .toggle { grid-area: g; width: 34px; height: 34px; align-self: center; }
  /* 끄기(×): 카드 오른쪽 위 모서리에 작은 동그라미로 (자리를 차지하지 않게) */
  #now-playing .stop { position: absolute; top: -7px; right: -5px; width: 22px; height: 22px; background: #fff; color: var(--ink); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22); }
  #now-playing .stop svg { width: 9px; height: 9px; }
  /* 진행 막대: 카드 아래 가장자리 안쪽에 얇게 */
  #now-playing .bar, #room-playing .bar { position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; margin: 0; }
}

/* 폰: 곡 카드를 덜 복잡하게. '30초 미리듣기'는 빼고 (진행 막대가 길이를 보여 준다) 제목·가수·출처·배지만 */
@media (pointer: coarse) {
  #now-playing .credit .pv, #room-playing .credit .pv { display: none; }
}

/* 카페에 앉아 있을 때: 곡 카드를 더 비치게 해서 창밖 풍경이 잘 보이게 (글씨·배지는 그대로 또렷하게) */
html.seated #now-playing, html.seated #room-playing {
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(5px) saturate(1.3); backdrop-filter: blur(5px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: background .4s, box-shadow .4s;
}
html.seated #now-playing .am-row, html.seated #room-playing .am-row { border-top-color: rgba(17, 17, 17, 0.1); }
/* 배경이 비치는 만큼 흐린 글씨는 진하게 (출처 문구는 늘 읽혀야 한다) */
html.seated #now-playing .artist, html.seated #room-playing .artist, html.seated #room-playing .where { color: rgba(17, 17, 17, 0.78); }
html.seated #now-playing .credit, html.seated #room-playing .credit, html.seated #now-playing .credit .src, html.seated #room-playing .credit .src { color: rgba(17, 17, 17, 0.72); }

/* ---------- 곡 한 줄 (폰에서 버튼이 자리를 덜 차지하게) ---------- */
/* ▶는 커버 위에, 좋아요·저장은 테두리 없는 작은 아이콘. 제목·가수는 조금 작게, 길면 옆으로 흘러간다 */
.track { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 7px 8px 7px 7px; }
.track .cover { width: 44px; height: 44px; }
.cover-wrap { position: relative; width: 44px; height: 44px; }
.cover-wrap .cover { display: block; }
.play.on-cover { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: rgba(17, 17, 17, .62); color: #fff; font-size: 10px; display: grid; place-items: center; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.play.on-cover.on, .play.on-cover:hover { background: var(--ink); color: #fff; }
.track .title { font-size: 14px; line-height: 1.35; }
.track .artist { font-size: 12px; line-height: 1.4; }
.track .actions { gap: 2px; }
.track .actions .add { width: 32px; height: 32px; border: 0; background: none; }
.track .actions .add.on { background: none; color: var(--ink); }
.track .actions .like { display: inline-flex; align-items: center; gap: 3px; height: 32px; min-width: 32px; justify-content: center; padding: 0 6px; border: 0; border-radius: 999px; background: none; color: var(--ink-dim); font-size: 15px; }
.track .actions .like b { font-size: 12px; font-weight: 600; }
.track .actions .like.on { background: none; color: #e8554a; }
.track .note-preview { font-size: 12px; color: var(--ink-dim); }
/* 누르면 펼쳐지는 더 보기: 추천한 사람 수 · 한마디 전부 */
.track.expandable { cursor: pointer; }
.track.expandable:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.track .more { grid-column: 1 / -1; display: none; margin: 2px 2px 2px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.track.open .more { display: block; }
.track.open .note-preview { display: none; }
.more-stat { font-size: 12px; color: var(--ink-dim); margin-bottom: 4px; }
.more-note { padding: 3px 0; overflow-wrap: anywhere; }
.more-note .by { color: var(--ink-dim); }
.more-note .report { margin-left: 6px; font-size: 11px; }
/* 컴퓨터(마우스) 화면: 곡 줄 글자·커버를 조금 크게 */
@media (pointer: fine) and (min-width: 700px) {
  .track { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; padding: 8px 10px 8px 8px; }
  .track .cover, .cover-wrap { width: 52px; height: 52px; }
  .track .title { font-size: 16px; }
  .track .artist { font-size: 13.5px; }
  .track .note-preview, .more-stat { font-size: 13px; }
  .track .more { font-size: 14px; }
  .play.on-cover { width: 30px; height: 30px; font-size: 11px; }
}
/* 폰: 커버 전체를 누를 수 있게 (보이는 동그라미 크기는 그대로) */
@media (pointer: coarse) {
  .play.on-cover { width: 100%; height: 100%; border-radius: 8px; background: radial-gradient(circle, rgba(17,17,17,.62) 14px, transparent 15px); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .play.on-cover.on { background: radial-gradient(circle, var(--ink) 14px, transparent 15px); }
}

/* ---------- 케이스 고르기 (벽 한 면·CD 선반·에어팟 진열대의 케이스 전부) ----------
   컴퓨터: 격자를 아래로 넘긴다. 폰: 두 줄을 옆으로 넘긴다 (옆 칸이 살짝 보여서 넘길 수 있다는 걸 알게) */
.case-pick.swipe {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); justify-content: stretch; gap: 12px;
  max-height: min(62vh, 620px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 8px; margin: 4px -4px 0;
}
.case-pick.swipe .case-pick-item { min-width: 0; }
.case-pick.swipe .case-pick-item img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
.case-pick.swipe .case-pick-item.model img { aspect-ratio: 1 / 1; object-fit: contain; background: var(--fill-2, #eee); }
.case-pick.swipe .case-pick-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (pointer: coarse) {
  .case-pick.swipe {
    grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 42%;
    max-height: none; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; gap: 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y;   /* 옆으로 넘기기 + 창 위아래 스크롤 둘 다 */
  }
  .case-pick.swipe::-webkit-scrollbar { display: none; }
  .case-pick.swipe .case-pick-item { scroll-snap-align: start; padding: 6px; gap: 2px; }
  .case-pick.swipe .case-pick-item img { max-height: 25vh; }
  .case-pick.swipe .case-pick-name { font-size: 12px; }
  .case-pick.swipe .case-pick-price { font-size: 11px; }
}

/* 폰: 에어팟 케이스 3D 미리보기 칸도 조금 낮게 */
@media (pointer: coarse) { .product-view:not(.tall) { height: 230px; } }
/* 4개 이하(에어팟 케이스): 넘기지 않고 창 폭에 맞춘다 (컴퓨터는 한 줄에 4개, 폰은 2×2) */
.case-pick.swipe.few { grid-template-columns: repeat(4, 1fr); grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto; max-height: none; overflow: visible; }
@media (pointer: coarse) { .case-pick.swipe.few { grid-template-columns: 1fr 1fr; } }
.case-pick.swipe.few .case-pick-item img { max-height: none; }

/* 창 오른쪽 위, 닫기(×) 바로 왼쪽에 붙는 작은 아이콘 버튼 (쪽지함의 쪽지 받기 켜기/끄기) */
.panel-side-btn {
  position: absolute; top: 12px; right: 52px; width: 34px; height: 34px; border: 0; border-radius: 999px; padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--ink); cursor: pointer;
}
.panel-side-btn:hover { background: var(--fill-2); }
.panel-side-btn.off { color: var(--ink-dim); }
.panel-side-btn svg { display: block; }
#panel-body .inbox-hint { margin: 0; }
