/* 공통 요소(글꼴·버튼·입력칸), 입장 화면, 앱 틀 (화면 스타일은 public/css/의 파일 여러 개를 index.html이 이 순서로 불러온다: theme.css → base.css → stage.css → playlist.css → side.css → dialogs.css → misc.css) */
/* ---------- 공통 요소 ---------- */
.logo {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.logo b { color: var(--accent); font-weight: 700; }
.logo-sm { font-size: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { border-color: var(--line-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn.is-on { border-color: var(--accent); color: var(--accent); }

.count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--overlay);
  font-variant-numeric: tabular-nums;
}
.count:empty { display: none; }
.btn-primary .count { background: rgba(0, 0, 0, 0.18); }

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  resize: vertical;
}
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--accent); }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.avatar { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.avatar-xs { width: 18px; height: 18px; flex: none; }
/* 그림(도트) 아바타: 얼굴 네모는 작게 줄여 보여서 부드럽게, 전신은 크기를 글에서 정한다(app.js paintAvatar) */
.avatar.is-sprite:not(.is-body), .avatar.is-smooth { image-rendering: auto; }
.avatar-sm { width: 27px; height: 27px; }
.avatar-md { width: 72px; height: 72px; } /* 플로어. 9칸 아바타가 칸마다 8px로 또렷하게 */
.avatar-lg { width: 90px; height: 90px; }

/* ---------- 입장 화면 ---------- */
.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px var(--gutter);
  background:
    radial-gradient(ellipse at 50% 120%, var(--glow), transparent 60%),
    var(--bg);
}
.gate-card {
  width: min(100%, 340px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.gate-card .logo { text-align: center; margin-bottom: 6px; }
.gate-card .avatar { align-self: center; margin-block: 4px 4px; }
.gate-hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.gate-hint:empty { display: none; }
.gate-ready, .auth-form { display: flex; flex-direction: column; gap: 12px; }
.gate-who { margin: 0 0 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gate-who b { font-size: 17px; }
.gate-who .muted { font-size: 12px; }
.link-btn {
  align-self: center;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--fg); }
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
}
.seg button {
  padding: 7px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.seg button[aria-selected="true"] { background: var(--panel-2); color: var(--fg); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label .muted { font-weight: 400; letter-spacing: 0; }
.auth-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--meh) 14%, transparent);
  color: var(--danger-text);
  font-size: 13px;
}

/* ---------- 앱 틀 ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}
.now { flex: 1 1 auto; min-width: 0; }
.now-title {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.now-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.top-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.vol { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.vol svg { width: 16px; height: 16px; }
.vol input { width: 90px; accent-color: var(--accent); }
.me-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  cursor: pointer;
  font-size: 13px;
  max-width: 160px;
}
.me-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  min-height: 0;
}
