:root {
  --bg-top: #0b1030;
  --bg-bottom: #1b2a6b;
  --ink: #f4f6ff;
  --ink-dim: #a9b4e6;
  --glass: rgba(16, 22, 58, 0.62);
  --panel: rgba(12, 17, 46, 0.92);
  --line: rgba(169, 180, 230, 0.16);
  --accent: #7a1fff;
  --on-accent: #ffffff;
  --gutter: 16px;
}

* { box-sizing: border-box; }

/* Slim scrollbars that stay out of the way: a faint thumb on no track, a little brighter while the pointer is over the list. */
* { scrollbar-width: thin; scrollbar-color: rgba(169, 180, 230, 0.16) transparent; }
*:hover { scrollbar-color: rgba(169, 180, 230, 0.4) transparent; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-top);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  overflow: hidden;
}

/* ---- Layout: artists | globe | pin information ---- */

#app {
  --left-w: 300px;
  --right-w: 360px;
  display: grid;
  /* A collapsed panel sets its track to 0 (features.css). */
  grid-template-columns: var(--left-track, var(--left-w)) minmax(0, 1fr) var(--right-track, var(--right-w));
  height: 100dvh;
  overflow: hidden;
}

.stage {
  position: relative;
  min-width: 0;
  container: stage / inline-size;
  background: radial-gradient(ellipse at 50% 42%, var(--bg-bottom) 0%, var(--bg-top) 72%);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 18px 16px;
  background: var(--panel);
  overflow: hidden;
}

.panel-left { border-right: 1px solid var(--line); }
.panel-right { border-left: 1px solid var(--line); padding: 0; }

.panel-empty { margin: 0; padding: 12px 4px; font-size: 14px; line-height: 1.5; color: var(--ink-dim); }

/* ---- Artist list ---- */

.search {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}

.search::placeholder { color: var(--ink-dim); }
.search:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }

.artist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0;
  /* Push the scrollbar into the panel's own padding so it does not hug the cards. */
  margin-right: -10px; padding-right: 10px; }

.artist {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  border: 2px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  padding: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.artist:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.artist.active { border-color: var(--artist); background: rgba(255, 255, 255, 0.12); }
.artist:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.artist-dot { flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: var(--artist); box-shadow: 0 0 10px var(--artist); }
.artist-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.artist-name { font-size: 16px; font-weight: 800; }
.artist-meta { font-size: 12px; color: var(--ink-dim); }
.artist-next { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink); }
.artist-next.none { color: var(--ink-dim); font-weight: 600; }

/* ---- Tabs ---- */

.tabs { display: flex; gap: 4px; padding: 14px 14px 0; border-bottom: 1px solid var(--line); }

.tab {
  appearance: none;
  flex: 1;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 3px solid #fff; outline-offset: -3px; border-radius: 8px; }

.tabpanel { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.tabpanel[hidden] { display: none; }

.detail-head { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--accent); padding-left: 12px; }
.detail-progress { margin: 0 0 4px; font-size: 12px; color: var(--ink-dim); }
.detail-city { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; }
.detail-venue { margin: 4px 0 0; font-size: 14px; color: var(--ink-dim); }

.facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 4px; }
.facts dt { margin-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.facts dd { margin: 0; font-size: 15px; line-height: 1.5; }

.date-list, .source-list, .show-list { list-style: none; margin: 0; padding: 0; }
.date-list { display: flex; flex-direction: column; gap: 6px; }
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-variant-numeric: tabular-nums; }
.source-list { display: flex; flex-direction: column; gap: 6px; }
.source-list li { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }

/* ---- Left column tabs (Artists | Shows) and the show list ---- */

.panel-left .tabs { margin: -4px -16px 0; padding: 0 16px; }

/* Data credit (Wikipedia, OpenStreetMap): small, but always visible under the artist list. */
.credits {
  flex: none;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.credits a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.credits a:hover { color: var(--ink); }
.credits a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 3px; }
.side-pane { display: flex; flex-direction: column; gap: 12px; flex: 1 1 0; min-height: 0; }
.side-pane[hidden] { display: none; }

.show-list { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; margin-right: -10px; padding-right: 10px; }

.show-row {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.show-row:hover { background: rgba(255, 255, 255, 0.1); }
.show-row.current { border-color: var(--accent); }
.show-row.focused { background: rgba(255, 255, 255, 0.16); }
.show-row:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.show-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.show-dates { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.show-city { font-size: 15px; font-weight: 800; }
.show-venue { font-size: 12px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip-status, .chip-confidence {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.chip-status.statusUpcoming { background: rgba(110, 231, 160, 0.2); color: #8bf0b4; }
.chip-status.statusToday { background: rgba(255, 190, 70, 0.22); color: #ffd27a; }
.chip-status.statusPast { color: var(--ink-dim); }
.chip-confidence { display: inline-block; font-size: 12px; }
.chip-confidence.high { background: rgba(110, 231, 160, 0.2); color: #8bf0b4; }
.chip-confidence.medium { background: rgba(255, 190, 70, 0.22); color: #ffd27a; }
.chip-confidence.low { background: rgba(255, 110, 130, 0.22); color: #ff9fae; }

/* ---- Comments ---- */

.tab-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.comments[hidden] { display: none; }
.comments-title { margin: 0; font-size: 18px; font-weight: 800; }
.comments-note { margin: 6px 0 14px; font-size: 12px; line-height: 1.5; color: var(--ink-dim); }

.comment-form { display: flex; flex-direction: column; gap: 8px; }

.comment-nickname, .comment-text {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
}

.comment-text { resize: vertical; min-height: 76px; line-height: 1.5; }
.comment-nickname::placeholder, .comment-text::placeholder { color: var(--ink-dim); }
.comment-nickname:focus-visible, .comment-text:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }

.comment-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-counter { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

.comment-submit {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 20px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.comment-submit:hover:not(:disabled) { transform: translateY(-1px); }
.comment-submit:disabled { opacity: 0.4; cursor: default; }
.comment-submit:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.comment-error { margin: 0; min-height: 1em; font-size: 12px; color: #ff9fae; }

.comment-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comment { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.comment-empty { padding: 14px 4px; font-size: 14px; color: var(--ink-dim); }
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-author { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-time { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }

.comment-delete {
  appearance: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.comment-delete:hover { color: #ff9fae; text-decoration: underline; }
.comment-delete:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 4px; }
.comment-body { margin: 6px 0 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Related videos (past shows only) ---- */

.videos { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.videos-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.video-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.video-card {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease;
}

.video-card:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.video-card:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.video-thumb-frame { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; }
.video-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.15s ease; }
.video-card:hover .video-thumb { opacity: 0.82; }

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(12, 16, 40, 0.78);
  color: #fff;
  font-size: 18px;
  padding-left: 3px;
}

.video-meta { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.video-title { font-size: 13px; font-weight: 700; line-height: 1.4; }
.video-channel { font-size: 12px; color: var(--ink-dim); }
.video-cue { margin-top: 2px; font-size: 12px; font-weight: 700; color: #9db4ff; }

.video-search {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #9db4ff;
  text-decoration: none;
}

.video-search:hover { text-decoration: underline; }
.video-search:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* ---- Video layer popup ---- */

.video-modal {
  width: min(960px, 94vw);
  max-width: none;
  max-height: 94dvh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.video-modal::backdrop { background: rgba(5, 8, 24, 0.8); backdrop-filter: blur(4px); }
.video-modal[open] { animation: modal-in 0.18s ease-out; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.video-modal-box { border-radius: 16px; overflow: hidden; background: #0b1030; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }
.video-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px; }
.video-modal-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; }

.video-modal-close {
  appearance: none;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.video-modal-close:hover { background: rgba(255, 255, 255, 0.24); }
.video-modal-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.video-modal-player { aspect-ratio: 16 / 9; background: #000; }
.video-modal-frame { display: block; width: 100%; height: 100%; border: 0; }
.video-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px 14px; font-size: 13px; }
.video-modal-channel { color: var(--ink-dim); }
.video-modal-link { font-weight: 700; color: #9db4ff; text-decoration: none; }
.video-modal-link:hover { text-decoration: underline; }
.video-modal-link:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* ---- Globe overlays ---- */

.stage-tools {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang { display: block; }

/* On a narrow globe the tools wrap into a second row instead of running over the artist name at the top left. */
@container stage (max-width: 560px) {
  .stage-tools { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 136px); }
}

/* Night theme: a warmer, almost black sky so the sparks are the brightest thing on the screen. */
:root[data-theme="nakhwa"] { --bg-top: #04050c; --bg-bottom: #131838; }

.lang select {
  appearance: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--glass);
  backdrop-filter: blur(8px);
  padding: 8px 28px 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.lang select option { color: #101640; background: #fff; }
.lang select:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.now-playing {
  position: absolute;
  top: var(--gutter);
  left: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  /* Above the pin labels, so the date and artist are never drawn over. */
  z-index: 2;
}

/* The artist being played, in its colour; hidden while a popup shows several artists at once. */
.now-artist {
  /* Narrow enough to stay clear of the tool buttons on the right, with an ellipsis for long names. */
  max-width: 38cqw;
  margin: 0;
  padding-left: 18px;
  overflow: hidden;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: radial-gradient(circle, var(--accent) 4.5px, transparent 5.5px) left center / 10px 10px no-repeat;
}
.now-artist[hidden], .now-artist:empty { display: none; }

.ticker {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.ticker-year { font-size: 14px; letter-spacing: 0.3em; color: var(--ink-dim); margin-bottom: 4px; }
.ticker-md { font-size: clamp(20px, 2.1vw, 26px); font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

/* Lowest of the globe overlays: pin labels go under the readout, the controls, the toast and the edge tabs. */
.labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.label {
  appearance: none;
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(12, 16, 40, 0.86);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
  /* Opacity is set every frame from the pin's angle to the camera (js/label-fade.js), so it is not eased here. */
  transition: background 0.15s ease;
}

.label:hover { background: rgba(12, 16, 40, 1); }
.label.current { background: var(--accent); color: var(--on-accent); }
.label.focused { box-shadow: 0 0 0 2px #fff; }
.label.hidden { pointer-events: none; }
.label:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%) translateY(8px);
  margin: 0;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #101640;
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show { opacity: 1; transform: translateX(-50%); }

.controls {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* Always above the pin labels, so the playback buttons are never covered. */
  z-index: 3;
  /* The row spans the whole globe width: let clicks through to the panel tabs in the corners. */
  pointer-events: none;
}
.controls > *, .options > * { pointer-events: auto; }

/* One big button plays, pauses and resumes; the row under it picks the direction and the speed. */
.main-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.main-btn svg { grid-area: 1 / 1; width: 28px; height: 28px; fill: currentColor; }
.main-btn .icon-play { margin-left: -2px; }
.main-btn .icon-pause, .main-btn[data-state="playing"] .icon-play { display: none; }
.main-btn[data-state="playing"] .icon-pause { display: block; }
.main-btn:hover { transform: scale(1.05); }
.main-btn:active { transform: scale(0.95); }

.options { display: contents; }
/* Wide: one row, the direction on the left of the main button and the speed on its right. */
.seg-direction { order: 1; }
.main-btn { order: 2; }
.options > .seg:not(.seg-direction) { order: 3; }
.icon-btn { order: 4; }
/* Narrow (phones): the main button on top, the other controls in a row under it. */
@container stage (max-width: 620px) {
  .controls { flex-direction: column; flex-wrap: nowrap; gap: 12px; }
  .main-btn { order: -1; }
  .options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
}
.seg-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.seg-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.seg-btn:hover { color: var(--ink); }
.seg-btn:active { transform: scale(0.96); }
.seg-btn.active { color: var(--ink); background: rgba(255, 255, 255, 0.2); }
.seg-direction .seg-btn.active { background: var(--accent); color: var(--on-accent); }

.icon-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.12s ease;
}
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }

.main-btn:focus-visible, .seg-btn:focus-visible, .icon-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Narrower screens ---- */

@media (max-width: 1180px) {
  #app { --left-w: 240px; --right-w: 300px; }
  .panel-left { padding: 16px 12px; }
  .panel-left .tabs { margin: -4px -12px 0; padding: 0 12px; }
}

@media (max-width: 860px) {
  html, body { overflow: auto; }
  #app { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; overflow: visible; }
  .stage { order: 1; height: 68dvh; min-height: 440px; }
  .panel-left { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .panel-right { order: 3; border-left: 0; border-top: 1px solid var(--line); }
  .artist-list { max-height: 240px; }
  .side-pane { flex: none; }
  .show-list { max-height: 360px; }
  .tabpanel { max-height: 420px; }
  .toast { bottom: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .artist, .tab, .show-row, .main-btn, .seg-btn, .icon-btn, .toast, .label, .video-card { transition: none; }
  .video-modal[open] { animation: none; }
}

/* Alpha password gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: linear-gradient(var(--bg-top), var(--bg-bottom));
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
}
.gate-title { margin: 0 0 4px; font-size: 22px; text-align: center; }
.gate-form input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  color: var(--ink);
  font: inherit;
}
.gate-form button {
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.gate-form button:disabled { opacity: 0.6; cursor: default; }
.gate-error { min-height: 1.2em; margin: 0; color: #ff8aa0; font-size: 14px; text-align: center; }

/* Comment sign-in bar */
.comment-auth { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.comment-auth-text { flex: 1 1 100%; margin: 0; color: var(--ink-dim); font-size: 13px; }
.comment-signin, .comment-signout {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.comment-signin { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.comment-signin:disabled { opacity: 0.6; cursor: default; }
.comment-auth .comment-error { flex: 1 1 100%; }
.comment-auth[hidden] { display: none; }
