:root {
  color-scheme: dark;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background: #110e15;
  color: #f6f1fb;
  --muted: #b9adbf;
  --edge: #3a2b42;
  --accent: #d5abff;
  --surface: #1c1621;
  --deep: #151018;
  --radius: 1rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 6rem; }
body { margin: 0; min-width: 290px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .pill-button {
  display: inline-flex; justify-content: center; align-items: center;
  border: 1px solid transparent; border-radius: .6rem; background: var(--accent);
  color: #251235; font-weight: 760; padding: .67rem .9rem; cursor: pointer;
}
button:hover:not(:disabled), .pill-button:hover { filter: brightness(1.12); }
button.secondary { color: #f6ecff; background: #251b2c; border-color: #503c5f; }
button.danger { background: #51253a; color: #ffe2ee; border-color: #734055; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #edd8ff; outline-offset: 3px; }
.topbar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: clamp(1rem, 3vw, 3.5rem);
  min-height: 4.35rem; padding: .7rem max(1.25rem, calc((100% - 1320px) / 2));
  background: #140f19; border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; font-size: 1.3rem; font-weight: 850; letter-spacing: -.045em; white-space: nowrap; }
.brand > span:last-child { color: var(--accent); }
.brand-icon {
  display: grid; place-items: center; width: 2rem; height: 2rem; margin-right: .5rem; border: 1px solid #9c62c5;
  border-radius: .55rem; background: #3b2352; color: #f6e2ff; font-size: 1.1rem;
}
nav { display: flex; align-items: center; gap: .85rem; min-width: 0; }
nav a { padding: .55rem .4rem; color: var(--muted); font-size: .9rem; white-space: nowrap; border-bottom: 2px solid transparent; }
nav a[aria-current] { color: #f5e8ff; border-color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: .65rem; margin-left: auto; white-space: nowrap; }
#identity { color: var(--muted); font-size: .88rem; max-width: 13ch; overflow: hidden; text-overflow: ellipsis; }
main { max-width: 1360px; min-height: calc(100vh - 9rem); padding: 1.45rem 1.25rem 3rem; margin: auto; }
footer { display: flex; justify-content: space-between; max-width: 1360px; margin: auto; padding: 1rem 1.25rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--edge); }
h1, h2, h3, p { margin: 0; }
h1 { margin: 0 0 1rem; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.06em; }
h2 { font-size: 1.23rem; letter-spacing: -.03em; margin-bottom: .75rem; }
h3 { font-size: 1.05rem; }
p { line-height: 1.55; color: var(--muted); }
#notice { color: #f0d7ff; border: 1px solid #634877; background: #2b1d36; padding: .65rem .9rem; border-radius: .65rem; margin-bottom: .85rem; }
#notice:empty { display: none; }
.club-hero {
  min-height: clamp(290px, 32vw, 420px); border: 1px solid #654472; border-radius: 1.35rem; display: flex; align-items: center;
  background: linear-gradient(90deg, #110817 4%, #14091be6 24%, transparent 69%), url("/stage.webp") right 52% / cover, #1f1028;
  box-shadow: 0 22px 70px #08050c70; overflow: hidden;
}
.hero-copy { padding: clamp(1.4rem, 5vw, 5.15rem); max-width: 58ch; }
.hero-label { display: flex; align-items: center; gap: .55rem; font-weight: 760; font-size: .7rem; letter-spacing: .19em; color: #f0cafc; }
.hero-label span { background: #f27ac7; width: .55rem; height: .55rem; border-radius: 50%; box-shadow: 0 0 12px #ee74bf; }
.club-hero h1 { font-family: Georgia, serif; font-weight: 600; font-size: clamp(3.2rem, 8vw, 7rem); margin: .7rem 0; letter-spacing: -.08em; }
.club-hero p { max-width: 34ch; color: #f0daff; margin-bottom: 1.3rem; }
.actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.discovery-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .31fr); gap: 1.25rem; align-items: start; margin-top: 2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem; margin-bottom: .85rem; }
.section-heading h2 { font-size: 1.65rem; margin: 0; }
#discoveryCount { font-size: .83rem; color: var(--muted); }
.directory-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .9rem; }
.directory-tabs { display: flex; gap: .35rem; }
.directory-tabs button { background: #211829; border-color: var(--edge); color: var(--muted); padding: .55rem .8rem; }
.directory-tabs button[aria-pressed="true"] { border-color: #9b75bb; background: #3b264d; color: #f8eaff; }
.search-field { flex: 1; min-width: 155px; }
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(205px, 100%), 1fr)); gap: .85rem; }
.room-card { min-width: 0; border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.room-card:hover { border-color: #8b66a5; }
.room-art {
  position: relative; display: grid; place-items: center; min-height: 8.2rem; aspect-ratio: 16 / 9;
  background: radial-gradient(ellipse at 50% 25%, #594068, #2b1d39 55%, #19121f);
}
.room-card:nth-child(3n + 2) .room-art { background: radial-gradient(ellipse at 40% 20%, #673754, #361b35 60%, #1a121d); }
.room-card:nth-child(3n) .room-art { background: radial-gradient(ellipse at 70% 20%, #54417a, #251d42 63%, #1c1528); }
.room-initials { font-family: Georgia, serif; font-size: 2.65rem; color: #f7def6; }
.room-state, .room-audience { position: absolute; top: .65rem; padding: .25rem .48rem; border-radius: .35rem; font-size: .73rem; background: #160f21dd; }
.room-state { left: .65rem; color: #ffabe0; }
.room-audience { right: .65rem; color: #faf0ff; }
.room-audience:empty { display: none; }
.room-card-body { display: grid; gap: .5rem; padding: .85rem; overflow-wrap: anywhere; }
.room-card-body p { font-size: .82rem; }
.room-card-body button { justify-self: start; padding: .45rem .7rem; font-size: .8rem; }
.room-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.room-tags span { color: #e9ccee; font-size: .72rem; border-radius: 999px; border: 1px solid #4b3857; padding: .13rem .45rem; }
.empty-rooms {
  grid-column: 1 / -1; min-height: 12rem; display: grid; place-content: center; text-align: center; gap: .45rem;
  background: #1a1420; border: 1px dashed #513b5c; border-radius: var(--radius); padding: 1.25rem;
}
.empty-rooms strong { font-size: 1.1rem; }
.panel, .player, .stat { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--edge); min-width: 0; }
.panel, .stat, .bar { padding: 1rem; }
.panel h2:not(:first-child) { margin-top: 1.15rem; }
.panel > p, .panel > details { margin-bottom: .75rem; }
.schedule-panel { background: linear-gradient(160deg, #24182d, var(--surface) 68%); }
#scheduleList { color: var(--muted); }
#scheduleList .account-row { padding: .7rem 0; }
.layout, .studio-layout, .room-tools { display: grid; grid-template-columns: minmax(0, 2fr) minmax(235px, 1fr); align-items: start; gap: 1rem; }
#finance .layout { grid-template-columns: minmax(245px, .8fr) minmax(0, 1.5fr); }
.watch-layout { align-items: stretch; }
.room-chat { display: flex; flex-direction: column; min-height: 0; }
.room-tools { margin-top: 1rem; }
.room-heading h1 { margin: .35rem 0; }
.back-link, .bar a, .chat-panel a { color: var(--accent); font-size: .88rem; }
.player { overflow: hidden; }
.stage { position: relative; overflow: hidden; background: #150f1c; }
video { display: block; width: 100%; aspect-ratio: 16 / 9; background: radial-gradient(ellipse at 60% 0%, #352141, #160f1b 80%); }
.stage:fullscreen { display: grid; align-items: center; }
.stage:fullscreen video { max-height: 100vh; }
.mirrored { transform: scaleX(-1); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
#roomStatus { color: var(--muted); }
.studio-title { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.studio-title h1 { margin: 0; }
.status-pill { border: 1px solid var(--edge); border-radius: 999px; padding: .25rem .65rem; color: var(--muted); font-size: .85rem; }
.account-panel, #standaloneWallet { max-width: 35rem; }
.balance { display: block; font-size: 2rem; color: var(--accent); }
.activity { margin: 0; padding-left: 1.25rem; color: var(--muted); line-height: 1.6; }
.tip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
#orders:empty { display: none; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: .7rem; margin: 0 0 1rem; }
.stat small { display: block; color: var(--muted); margin-bottom: .35rem; }
.stat strong { font-size: 1.45rem; }
form { display: grid; gap: .75rem; }
label { display: grid; gap: .3rem; color: var(--muted); font-size: .9rem; }
input, select, textarea { width: 100%; padding: .6rem; background: var(--deep); color: #fbf5ff; border: 1px solid var(--edge); border-radius: .42rem; }
summary { color: var(--accent); cursor: pointer; margin: .5rem 0; }
.ledger { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
td, th { padding: .55rem; border-bottom: 1px solid var(--edge); white-space: nowrap; }
#admin > .panel, #operations > .panel, #creatorOps { margin-bottom: 1rem; }
#profileForm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: .7rem; }
#profileForm button { justify-self: start; }
#performerStatus { margin-bottom: .8rem; }
.studio-metrics { margin-top: 1rem; }
.chat-feed { flex: 1; min-height: 15rem; max-height: 26rem; overflow-y: auto; margin: 0 0 1rem; padding: 0; list-style: none; overflow-wrap: anywhere; }
.chat-feed li { padding: .56rem 0; border-bottom: 1px solid var(--edge); }
.chat-feed strong { color: var(--accent); margin-right: .25rem; }
.chat-feed .chat-tip { color: #ffd98a; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
#studioMembers { margin-top: .75rem; }
.tip-flash { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); padding: .65rem 1rem; background: #fce0a1; color: #292013; border-radius: 999px; font-weight: 800; pointer-events: none; }
.account-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; padding: .7rem .15rem; border-bottom: 1px solid var(--edge); overflow-wrap: anywhere; }
.account-row > span { flex: 1 1 10rem; }
.account-row a { color: var(--accent); }
#operations video { width: min(100%, 46rem); margin-top: .7rem; }
#help textarea { min-height: 7rem; }
#obsDetails { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 920px) {
  .topbar { flex-wrap: wrap; gap: .45rem 1rem; }
  .topbar nav { order: 3; flex-basis: 100%; overflow-x: auto; }
}
@media (max-width: 760px) {
  main { padding: 1rem .85rem 2rem; }
  .topbar { padding-inline: .85rem; }
  .discovery-layout, .layout, .studio-layout, .room-tools, #finance .layout { grid-template-columns: 1fr; }
  .club-hero { background-position: right center; }
  .schedule-panel { grid-row: auto; }
  .room-tools { gap: .75rem; }
}
@media (max-width: 425px) {
  #profileForm { grid-template-columns: 1fr; }
  .hero-copy { padding: 1.25rem; }
  #identity { display: none; }
  .room-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-card-body { padding: .65rem; }
  .room-audience { top: auto; bottom: .5rem; }
}

.auth-layout { display:grid; grid-template-columns:minmax(0, 1fr) minmax(300px, .75fr); align-items:center; gap:clamp(1rem,5vw,5rem); max-width:1080px; margin:4vh auto 0; }
.auth-image { min-height:440px; border-radius:1.35rem; background:#211426 url("/stage.webp") 70% center / cover; border:1px solid var(--edge); }
.auth-card { background:var(--surface); padding:clamp(1.2rem,4vw,2.6rem); border:1px solid var(--edge); border-radius:1.25rem; box-shadow:0 20px 56px #09060d80; }
.auth-card h1 { font-size:clamp(1.8rem,4vw,2.8rem); margin-bottom:.55rem; }
.auth-card form { margin-top:1.4rem; }
.auth-card input { min-height:3rem; }
.auth-switch { width:100%; margin-top:1rem; color:var(--accent); background:transparent; border:1px solid var(--edge); }
#authError { color:#ffc3ce; margin-top:.6rem; }
.creator-banner { min-height:9.5rem; display:flex; align-items:end; padding:1.15rem; border:1px solid var(--edge); border-radius:1.25rem 1.25rem 0 0;
  background:linear-gradient(90deg,#190f22,#190f2238),url("/stage.webp") 70% 54% / cover; }
.creator-identity { display:flex; align-items:center; gap:1rem; }
.creator-identity h1 { margin:0 0 .5rem; }
#studioPhoto { width:5rem; height:5rem; border:3px solid #f0dcff; border-radius:50%; object-fit:cover; }
.studio-tabs { display:flex; gap:.4rem; background:var(--surface); padding:.6rem; margin-bottom:1rem; border:1px solid var(--edge); border-top:0; border-radius:0 0 1rem 1rem; }
.studio-tabs button { color:var(--muted); background:transparent; }
.studio-tabs button[aria-pressed="true"] { background:#41304e; color:#fff; }
.room-art img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
#photoForm { padding-bottom:1rem; margin-bottom:1rem; border-bottom:1px solid var(--edge); }
#fxStatus { margin-bottom:1rem; }
@media (max-width:760px) {
  .auth-layout { grid-template-columns:1fr; max-width:520px; margin-top:.75rem; }
  .auth-image { min-height:125px; background-position:72% 48%; }
  .studio-tabs button { flex:1; min-height:44px; }
  .studio-layout .bar button,.room-tools button { min-height:44px; }
  input,select,textarea { font-size:16px; }
}

.ops-shell { display:grid; grid-template-columns:215px minmax(0,1fr); align-items:start; gap:1.1rem; }
.ops-sidebar { position:sticky; top:5.45rem; border:1px solid var(--edge); border-radius:1rem; background:#1a1520; padding:1rem; }
.ops-sidebar h1 { font-size:1.52rem; margin-bottom:.35rem; }
.ops-sidebar p { margin-bottom:.95rem; font-size:.85rem; }
.ops-navigation { display:grid; gap:.25rem; }
.ops-navigation button { justify-content:flex-start; text-align:left; background:transparent; color:var(--muted); padding:.62rem .65rem; min-height:43px; }
.ops-navigation button[aria-pressed="true"] { background:#382647; border-color:#604875; color:#fff3ff; }
.ops-main { min-width:0; }
.ops-main > section > h2, .ops-main > article > h2 { font-size:1.4rem; }
.ops-main .metrics { grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); }
.queue-toolbar { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 170px); gap:.55rem; margin:.9rem 0; }
.queue-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:start; gap:.8rem; padding:.9rem .15rem; border-top:1px solid var(--edge); }
.queue-row p { margin:.25rem 0 0; overflow-wrap:anywhere; font-size:.87rem; }
.queue-status { padding:.23rem .5rem; border-radius:999px; border:1px solid #645472; color:#ecd8ff; font-size:.75rem; white-space:nowrap; }
.queue-status[data-status="settled"], .queue-status[data-status="active"], .queue-status[data-status="resolved"] { color:#b5ebce; border-color:#46725f; }
.queue-status[data-status="pending"], .queue-status[data-status="open"] { color:#ffe2a2; border-color:#74613e; }
.queue-status[data-status="suspended"], .queue-status[data-status="reversed"] { color:#ffc3d7; border-color:#81455c; }
.queue-actions summary { margin:0; padding:.15rem .25rem; font-size:.87rem; }
.queue-actions > div { display:grid; gap:.35rem; padding:.5rem; margin-top:.3rem; background:var(--deep); border:1px solid var(--edge); border-radius:.6rem; }
.queue-actions button,.queue-actions a { font-size:.8rem; }
.queue-pagination { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:.45rem; border-top:1px solid var(--edge); padding-top:.7rem; color:var(--muted); font-size:.85rem; }
.queue-pagination span { margin-right:auto; }
.queue-pagination button { background:#2b2134; color:#f4e9fd; border-color:var(--edge); }
.queue-empty { padding:1.4rem 0; }
#scheduleForm { margin:1rem 0; max-width:34rem; }
#opsDialog { width:min(94vw, 31rem); max-height:85vh; overflow:auto; border:1px solid #70548a; border-radius:1rem; padding:1.35rem; background:#211826; color:#f6f1fb; }
#opsDialog::backdrop { background:#09060dbd; }
#opsDialog h2 { margin:0; }
#opsDialogLabel { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:760px) {
  .ops-shell { grid-template-columns:1fr; gap:.65rem; }
  .ops-sidebar { position:static; padding:.75rem; }
  .ops-navigation { display:flex; overflow:auto; }
  .ops-navigation button { white-space:nowrap; }
  .queue-row { grid-template-columns:minmax(0,1fr) auto; }
  .queue-actions { grid-column:1 / -1; }
}

#applyOffer { white-space:pre-wrap; }
.checkline { display:flex; gap:.65rem; align-items:flex-start; }
.checkline input { width:auto; flex:none; margin-top:.15rem; }
.creator-page { max-width:45rem; }
#creatorPhoto { width:5rem; height:5rem; object-fit:cover; border-radius:50%; margin-bottom:1rem; }
#creatorBio { white-space:pre-wrap; }
#creatorSchedule, #roomReturn, #rehearsalChecks { margin-block:.75rem; }
#offerForm { max-width:40rem; margin-bottom:.8rem; }
#offerForm textarea { min-height:8rem; }
#recruitingQueue { margin-top:1rem; }

/* Shared surfaces and navigation */
:root {
  background: #101014;
  color: #f6f5fb;
  --muted: #c2becd;
  --edge: #393743;
  --accent: #d5bdff;
  --surface: #1c1b23;
  --deep: #15141b;
  --radius: 1.05rem;
}
body { background: radial-gradient(ellipse at 75% 0%, #21192d, transparent 45rem), #101014; }
.topbar { background: #14131a; }
.skip-link {
  position: fixed; z-index: 10; left: 1rem; top: 1rem; transform: translateY(-200%);
  background: var(--accent); color: #251235; padding: .7rem 1rem; border-radius: .6rem;
}
.skip-link:focus { transform: none; }
button, .pill-button { min-height: 44px; }
.topbar nav a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; }
:focus-visible { outline: 2px solid #ffedaa; outline-offset: 3px; }
#live-lineup, #scheduleSection { scroll-margin-top: 1rem; }

.club-hero {
  min-height: clamp(230px, 26vw, 320px);
  border-color: #635470;
  background: linear-gradient(90deg, #140d20 6%, #150c1eea 37%, #170a2030 85%), url("/stage.webp") 68% 58% / cover;
}
.hero-copy { padding: clamp(1.4rem, 4.5vw, 4rem); }
.club-hero h1 { font-size: clamp(2.65rem, 5vw, 5rem); line-height: .98; max-width: 14ch; }
.club-hero p { margin-top: 1rem; color: #eee9f7; }
.discovery-layout { gap: clamp(1rem, 2vw, 1.65rem); margin-top: 1.55rem; }
.directory-controls {
  padding: .65rem; border: 1px solid var(--edge); border-radius: .95rem; background: var(--surface);
}
.directory-tabs button[aria-pressed="true"] { background: #d5bdff; color: #211530; }
.directory-controls select, .directory-controls input { min-height: 44px; }
.directory-controls select:disabled { opacity: .65; }
.room-list { gap: 1rem; }
.room-card-body { grid-template-columns: 1fr; padding: 1rem; }
.room-card-body h3 { font-size: 1.15rem; }
.room-card-body button { justify-self: stretch; }
.room-art .room-state { color: #fff; background: #38294a; }
.room-card:has([data-live]) .room-state { background: #853361; }
#moreRooms { margin-top: 1rem; }
.schedule-panel { border-top: 3px solid #8b6fad; }
#savedShows { margin-top: 1.1rem; border-top: 1px solid var(--edge); padding-top: 1rem; }
.room-report { color: var(--accent); text-decoration: underline; padding: .55rem .3rem; }
.room-chat .section-heading { margin-bottom: .35rem; }
.room-chat .section-heading h2 { font-size: 1.2rem; }
.ops-sidebar, .creator-banner, .auth-card { background-color: var(--surface); }
.ops-main > section { min-width: 0; }
#placementForm { display: grid; gap: .7rem; margin: 1rem 0; max-width: 38rem; }
#placementForm button { justify-self: start; }
#placementList .queue-actions a { color: var(--accent); text-decoration: underline; }
.account-panel input:not([type=checkbox]), .account-panel textarea { min-height: 44px; }

@media (max-width: 760px) {
  html { scroll-padding-top: 8rem; }
  main { padding-inline: max(.8rem, env(safe-area-inset-left)); }
  .club-hero { min-height: 250px; background-position: 64% 50%; }
  .directory-controls { display: grid; grid-template-columns: minmax(0, 1fr); }
  .directory-controls select { width: 100%; }
  .directory-tabs button { flex: 1; }
  .discovery-layout { margin-top: 1.15rem; }
  .ops-navigation { padding-bottom: .4rem; }
  .queue-row .queue-status { white-space: normal; max-width: 12ch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.latest-chat { margin-block: .4rem; }
#profileForm select, #profileForm input, #signinButton { min-height: 44px; }
@media (max-width: 360px) {
  .room-list { grid-template-columns: minmax(0, 1fr); }
  .club-hero h1 { font-size: 2.55rem; }
}
