:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --panel-2: #181c22;
  --line: #252a33;
  --text: #e9ebee;
  --muted: #8a93a2;
  --accent: #ffb224;
  --accent-ink: #1a1200;
  --live: #ff4d4d;
  --radius: 10px;
  --gutter: clamp(16px, 3vw, 32px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- top bar ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px var(--gutter);
  background: rgba(11, 13, 16, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; fill: var(--accent); }
.brand-word {
  font-weight: 800;
  font-style: italic;
  font-size: 19px;
  letter-spacing: .04em;
}
.brand-word b { color: var(--accent); font-weight: 800; }

.nav { display: flex; gap: 20px; margin-left: 8px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
}
.nav a:hover { color: var(--text); }

.modes {
  margin-left: auto;
  display: flex;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.mode {
  border: 0;
  background: none;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.mode.is-on { background: var(--accent); color: var(--accent-ink); }

/* ---- stage ---- */
.stage {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  padding: 20px var(--gutter) 36px;
  align-items: start;
}

.rail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rail-head h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 77, 77, .6);
  animation: pulse 2s infinite;
  flex: none;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 77, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  html { scroll-behavior: auto; }
}

.chips { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 10px 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
}
.chip:hover { border-color: var(--line); background: var(--panel-2); }
.chip.is-on { border-color: var(--accent); background: var(--panel-2); }
.chip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chip-row { display: flex; gap: 4px; }
.chip-row .chip { flex: 1; min-width: 0; }
.chip-remove {
  flex: none;
  width: 34px;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}
.chip-remove:hover { color: var(--text); background: var(--panel-2); }

.tag {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag:empty { display: none; }

.add { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.add label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.add-row { display: flex; gap: 6px; }
.add input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.add input::placeholder { color: #5d6573; }
.add button {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}
.add-error { margin: 8px 0 0; font-size: 12px; color: #ff8a8a; }

.theatre {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  min-width: 0;
}
.theatre.no-chat { grid-template-columns: minmax(0, 1fr); }
.theatre.no-chat .chat { display: none; }

.screen-wrap { min-width: 0; }
.screen, .tile-screen, .station-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.screen iframe, .chat iframe, .tile-screen iframe, .station-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.screen-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 0;
}
.now { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.now-label { font-size: 12px; color: var(--muted); }
.now strong { font-size: 17px; }
.screen-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.ghost:hover { background: var(--panel-2); }

.chat {
  position: relative;
  min-height: 420px;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---- wall ---- */
.wall {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wall[hidden] { display: none; }
.tile-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 2px 0; }
.tile-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- bands ---- */
.band { padding: 36px var(--gutter); border-top: 1px solid var(--line); }
.band-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 18px; }
.band-head h2 { margin: 0; font-size: 22px; font-style: italic; font-weight: 800; letter-spacing: .02em; }
.band-head p { margin: 0; color: var(--muted); }

.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.station-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}
.station-play img { width: 100%; height: 100%; object-fit: cover; opacity: .75; display: block; }
.station-play:hover img { opacity: 1; }
.station-play span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}
.station h3 { margin: 10px 2px 0; font-size: 15px; }
.station p { margin: 2px 2px 0; font-size: 13px; color: var(--muted); }

.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 32px; max-width: 1100px; }
.about-grid p { margin: 0; color: #b9c0cb; }
.about-grid em { color: var(--text); font-style: normal; font-weight: 600; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 20px var(--gutter) 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.noscript { padding: 16px var(--gutter); color: var(--accent); }

/* ---- small screens ---- */
@media (max-width: 1100px) {
  .theatre { grid-template-columns: minmax(0, 1fr); }
  .chat { min-height: 380px; }
}
@media (max-width: 820px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .wall { grid-column: 1; }
  .rail { order: 2; }
  .chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .nav { display: none; }
}
@media (max-width: 520px) {
  .wall { grid-template-columns: minmax(0, 1fr); }
  .top { gap: 12px; }
  .brand-word { font-size: 17px; }
  .mode { padding: 6px 12px; }
}
@media (max-width: 360px) {
  .brand-word { font-size: 15px; }
  .mode { padding: 6px 10px; }
}
