@font-face {
  font-family: "Bolivia No Problem";
  src: url("https://dankin.dev/fonts/BoliviaNoProblem.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c1015;
  --bg2: #10161e;
  --surface: #151b23;
  --ink: #e9eef3;
  --hint: #8494a6;
  --amber: #ffb020;
  --link: #6cb6ff;
  --bad: #f85149;
  --ok: #3fb950;
  --line: color-mix(in srgb, #fff 10%, transparent);
  --font: "Bolivia No Problem", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100svh;
  background:
    radial-gradient(1200px 600px at 12% -10%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, color-mix(in srgb, var(--link) 10%, transparent), transparent 50%),
    linear-gradient(180deg, var(--bg2), var(--bg) 40%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}
.shell--wide {
  width: min(1120px, calc(100% - 32px));
}

.brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--hint);
  margin-bottom: 28px;
}
.brand strong {
  color: var(--amber);
  font-weight: 700;
}

.hero-title {
  font-family: var(--font);
  font-size: clamp(42px, 8vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  font-weight: 400;
}
.hero-title em {
  font-style: normal;
  color: var(--amber);
}
.lead {
  color: var(--hint);
  margin: 0 0 28px;
  max-width: 36ch;
  font-size: 16px;
}

.panel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 22px;
}
.panel + .panel { margin-top: 14px; }

label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 8px;
}
input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0a0e13;
  color: var(--ink);
  font: inherit;
  margin-bottom: 14px;
}
input:focus, select:focus {
  outline: 2px solid color-mix(in srgb, var(--amber) 45%, transparent);
  outline-offset: 1px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 10px; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  background: var(--amber);
  color: #1a1205;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: color-mix(in srgb, #fff 5%, transparent); }
.btn-danger {
  background: color-mix(in srgb, var(--bad) 20%, transparent);
  color: #ffb4b0;
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
}
.btn-sm { padding: 8px 12px; font-size: 14px; }

.muted { color: var(--hint); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 12px; }
.error {
  color: #ffb4b0;
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 28%, transparent);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 14px;
}
.warn {
  color: #ffd58a;
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 14px;
}

.room-list { display: grid; gap: 12px; margin-top: 18px; }
.room-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.room-item h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.invite-url {
  word-break: break-all;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--link);
  margin-top: 4px;
}
.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

/* ── Room stage ── */
body.room-page {
  background: #070a0e;
  overflow: hidden;
  height: 100svh;
}
.stage {
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, #000 35%, transparent);
  backdrop-filter: blur(8px);
}
.stage-top h1 {
  margin: 0;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.stage-main {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}
@media (min-width: 960px) {
  .stage-main.with-side {
    grid-template-columns: 1fr 280px;
  }
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
  padding: 10px;
  min-height: 0;
  overflow: auto;
  align-content: start;
}
.tile {
  position: relative;
  background: #0b0f14;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 140px;
}
.tile.local { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 35%, transparent); }
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.tile .tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, #000 70%, transparent);
  font-size: 12px;
  font-family: var(--mono);
}
.tile .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--hint);
  font-family: var(--font);
  font-size: 28px;
  letter-spacing: -0.02em;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--amber) 18%, transparent), transparent 50%),
    #0b0f14;
}

.side {
  border-left: 1px solid var(--line);
  padding: 14px;
  overflow: auto;
  background: color-mix(in srgb, #0a0e13 92%, transparent);
}
.side h2 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hint);
  font-weight: 650;
}

.dock {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px 22px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, #000 45%, transparent);
  backdrop-filter: blur(10px);
}
.dock .btn {
  min-width: 112px;
}
.dock .btn.is-off {
  background: color-mix(in srgb, var(--bad) 18%, transparent);
  color: #ffb4b0;
  border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
}

.lobby {
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}
.preview-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  background: #0b0f14;
  margin-bottom: 16px;
}
.preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.preview-wrap .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--hint);
  font-family: var(--font);
  font-size: 24px;
}

@media (max-width: 640px) {
  .side { display: none; }
  .stage-main.with-side { grid-template-columns: 1fr; }
  .dock .btn { min-width: 0; flex: 1; }
}
