:root {
  --bg: #050814;
  --panel: #0a1024;
  --card: #0e1630;
  --card-2: #121c3d;
  --border: #1f2c57;
  --text: #eef1fb;
  --muted: #93a0c4;
  --accent: #2f7bff;
  --accent-2: #7a3cff;
  --cyan: #26c6f9;
  --accent-ink: #ffffff;
  --danger: #ff6b7d;
  --live: #ff3b5c;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--cyan); }
h1, h2, h3 { margin: 0; line-height: 1.2; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* ---- logo ---- */
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: 0.3px; }
.logo b { color: var(--cyan); font-weight: 800; }
.logo-mark { width: 30px; height: 30px; color: var(--accent-2); stroke-width: 2.4; }

/* ---- shared controls ---- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 16px; font: inherit; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: linear-gradient(135deg, var(--accent), #2456ff); border-color: transparent; color: var(--accent-ink); font-weight: 700; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.1); }
button.danger { color: var(--danger); }
button.ghost { background: transparent; }
button.small, .small-btn { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { padding: 8px; }

input, select, textarea {
  width: 100%; background: #070c1d; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 15px;
}
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; }
input:disabled { opacity: 0.5; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); flex: 1 1 160px; min-width: 0; }
label.grow { flex: 2 1 240px; }
label.narrow { flex: 0 1 90px; }
form > label { flex: 0 0 auto; }
form { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row.end { justify-content: flex-end; }
.field-error { color: var(--danger); font-size: 12px; min-height: 0; }

.card { background: linear-gradient(180deg, var(--card), var(--panel)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill.on { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.pill.off { background: rgba(147, 160, 196, 0.14); color: var(--muted); }
.pill.warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.pill.live { background: var(--live); color: #fff; letter-spacing: 0.5px; }
.pill.upcoming { background: rgba(147, 160, 196, 0.2); color: var(--text); }
.pill.genre { background: rgba(122, 60, 255, 0.2); border-color: rgba(122, 60, 255, 0.6); color: #d9c9ff; }
.pill.lang { background: rgba(38, 198, 249, 0.14); border-color: rgba(38, 198, 249, 0.5); color: #b6ecff; }
.pill.plain { border-color: var(--border); color: var(--muted); }

.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.error { color: var(--danger); font-size: 14px; margin: 0; min-height: 1em; }

/* ---- guest landing ---- */
.guest { min-height: 100vh; background: radial-gradient(900px 500px at 70% -10%, rgba(122, 60, 255, 0.25), transparent), radial-gradient(700px 400px at 10% 10%, rgba(47, 123, 255, 0.18), transparent); }
.guest-top { display: flex; justify-content: space-between; align-items: center; padding: 16px; }
.guest-main { max-width: 980px; margin: 0 auto; padding: 16px 16px 48px; }
.hero { text-align: center; padding: 28px 0 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin-bottom: 12px; }
.lead { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 17px; }
.card.auth { max-width: 420px; margin: 0 auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { flex: 1; background: transparent; }
.tab.active { border-color: var(--cyan); color: var(--cyan); }
.btn.wide { display: flex; background: #fff; color: #1f1f1f; border-color: #fff; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---- app shell ---- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0a1230, #060a1a); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 15px; }
a.nav:hover { background: rgba(47, 123, 255, 0.12); }
.nav.active { background: linear-gradient(135deg, var(--accent), #3a2bd6); font-weight: 600; }
.nav.soon { color: #5d6a91; cursor: default; }
.nav-later { margin: 14px 12px 2px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #5d6a91; }
.motto { margin-top: auto; color: #6f7fb3; font-style: italic; font-size: 17px; padding: 0 12px; }

.content { min-width: 0; background: radial-gradient(900px 420px at 80% -10%, rgba(122, 60, 255, 0.2), transparent), radial-gradient(700px 380px at 30% -5%, rgba(47, 123, 255, 0.14), transparent); background-repeat: no-repeat; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
#menu-toggle { display: none; }
.search { display: flex; flex-direction: row; align-items: center; gap: 8px; flex: 1 1 220px; max-width: 440px; background: #0a1128; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.search input { border: 0; background: transparent; padding: 10px 0; }
.search input:focus-visible { outline: none; }
.search:focus-within { border-color: var(--cyan); }
.search.big { max-width: none; flex: none; padding-right: 6px; }
.topbar .pill { margin-left: auto; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }

main#main { padding: 24px 20px 56px; max-width: 1320px; margin: 0 auto; }
main#main:focus { outline: none; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; }
.page-head h1 em { font-style: normal; color: var(--cyan); }
.sub { color: var(--muted); margin: 6px 0 0; font-size: 16px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255, 107, 125, 0.12); border: 1px solid var(--danger); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }

/* ---- home ---- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.home-side { display: flex; flex-direction: column; gap: 16px; }
.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cta { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); color: var(--text); text-decoration: none; min-height: 118px; }
.cta-create { background: linear-gradient(135deg, #0e2a6b, #0c1a45); }
.cta-find { background: linear-gradient(135deg, #2b1670, #170f47); }
.cta:hover { border-color: var(--cyan); }
.cta-icon { width: 64px; height: 64px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cta-create .cta-icon { background: linear-gradient(135deg, #2f9bff, #2456ff); }
.cta-find .cta-icon { background: linear-gradient(135deg, #8a4bff, #5a2be0); }
.cta-icon svg { width: 34px; height: 34px; stroke-width: 2.2; }
.cta-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cta-text strong { font-size: 20px; }
.cta-text small { color: #b9c4e6; font-size: 14px; }
.cta-arrow { margin-left: auto; color: var(--muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-head h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section-head h2 svg { color: var(--cyan); width: 24px; height: 24px; }
.section-head h2 .live-ico { color: var(--live); }
.section-head a { text-decoration: none; font-size: 15px; }

.promo { border-radius: var(--radius); border: 1px solid var(--border); padding: 22px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; background: radial-gradient(260px 160px at 85% 20%, rgba(122, 60, 255, 0.7), transparent), linear-gradient(160deg, #1b1260, #0b0f2e); }
.promo strong { font-size: 22px; line-height: 1.2; }
.promo span { color: #c5cbea; }

.devices { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; font-size: 14px; }
.devices dt { color: var(--muted); }
.devices dd { margin: 0; overflow-wrap: anywhere; }

/* ---- session cards ---- */
.cover { position: relative; overflow: hidden; }
.cover::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 14px); }
.cover-0 { background: linear-gradient(135deg, #7a2a12, #c2571a 55%, #2a0f1e); }
.cover-1 { background: linear-gradient(135deg, #3b1a8f, #a23bd6 60%, #150a3a); }
.cover-2 { background: linear-gradient(135deg, #0b3a7a, #1f8fe0 55%, #071634); }
.cover-3 { background: linear-gradient(135deg, #0e5a4a, #1fbf8f 55%, #06231f); }
.cover-4 { background: linear-gradient(135deg, #7a1238, #e0457a 55%, #2a0718); }
.cover-5 { background: linear-gradient(135deg, #6b5a0e, #d6b23b 55%, #241d06); }

.live-card { border-radius: var(--radius); border: 1px solid var(--border); padding: 22px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; color: #fff; }
.live-card > * { position: relative; z-index: 1; }
.live-card h3 { font-size: 30px; font-weight: 800; overflow-wrap: anywhere; }
.live-card .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: auto; }
.live-card .bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.count-pill { background: rgba(0, 0, 0, 0.45); color: #fff; }
/* on a coloured cover the tag colours need a dark backing to stay readable */
.live-card .session-tags .pill { background: rgba(5, 8, 20, 0.6); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.live-card .session-tags { margin-top: 0; }
.join-big { padding: 14px 34px; font-size: 17px; border-radius: 12px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.session { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: linear-gradient(180deg, var(--card), var(--panel)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; padding-right: 14px; }
.session .cover { align-self: stretch; min-height: 84px; }
.session .cover .pill { position: absolute; top: 8px; left: 8px; z-index: 1; }
.session-main { min-width: 0; padding: 10px 0; }
.session-name { display: inline-block; font-weight: 700; font-size: 17px; overflow-wrap: anywhere; color: var(--text); text-decoration: none; }
a.session-name:hover { color: var(--cyan); text-decoration: underline; }
.session-meta { color: var(--muted); font-size: 13px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.session-meta span { display: inline-flex; align-items: center; gap: 5px; }
.session-meta svg { width: 15px; height: 15px; }
.session-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.session-actions { display: flex; gap: 8px; }

.empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); }
.empty a { display: inline-block; margin-top: 8px; }
.skeleton { border-radius: 12px; min-height: 84px; background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton.tall { min-height: 220px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---- search / create / detail ---- */
.filters { margin-bottom: 14px; }
.segmented { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.segmented legend { font-size: 12px; color: var(--muted); padding: 0 0 5px; float: left; width: 100%; }
.segmented label { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; color: var(--text); cursor: pointer; background: #070c1d; }
.segmented input { position: absolute; opacity: 0; }
.segmented label:has(input:checked) { background: linear-gradient(135deg, var(--accent), #3a2bd6); border-color: transparent; font-weight: 600; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }

.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.switch-row { flex-direction: row; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; color: var(--text); font-size: 15px; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch-row input { width: 44px; height: 24px; appearance: none; background: #26335e; border-radius: 999px; position: relative; padding: 0; border: 0; cursor: pointer; flex: none; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { left: 23px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; background: #070c1d; border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.chips button { padding: 0 8px; border-radius: 999px; font-size: 16px; line-height: 1.4; }
.preview { position: sticky; top: 16px; }
.preview .live-card { min-height: 180px; margin-top: 12px; }
.preview .live-card h3 { font-size: 22px; }

.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; margin-bottom: 14px; }
.detail .live-card { min-height: 240px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; margin-top: 16px; }
.detail-actions { display: flex; flex-direction: column; gap: 10px; }
.detail p { white-space: pre-wrap; overflow-wrap: anywhere; }

.checks { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #3b4670; margin-top: 5px; flex: none; }
li.ok .dot { background: var(--ok); }
li.bad .dot { background: var(--warn); }
.tips { color: var(--muted); font-size: 14px; margin: 16px 0 0; padding-left: 18px; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .home-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .promo { display: none; }
  .create-grid { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 20; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55); }
  #menu-toggle { display: inline-flex; }
  .cta-row { grid-template-columns: minmax(0, 1fr); }
  main#main { padding: 18px 16px 48px; }
  .topbar { padding: 12px 16px; }
  #user-name { display: none; }
  .session { grid-template-columns: 72px minmax(0, 1fr); padding-right: 0; }
  .session-actions { grid-column: 1 / -1; padding: 0 12px 12px; }
  .session-actions > * { flex: 1; }
  .live-card h3 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .switch-row input::after { transition: none; } }

.field-error:empty { display: none; }

/* errors appear under a field without pushing its neighbours around */
#create-form .row { align-items: flex-start; }
#create-form .row > button { margin-top: 23px; }
#create-form .row.end { align-items: center; }
