:root {
  --bg: #160e06;
  --panel: rgba(26, 16, 8, 0.82);
  --panel-solid: #20140c;
  --line: rgba(255, 146, 61, 0.18);
  --text: #f6efe8;
  --muted: #a8927e;
  --cyan: #ff8c3a;
  --cyan-2: #e56b14;
  --cyan-dim: rgba(255, 140, 58, 0.14);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

button, input { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 650;
  font-size: 14px;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, #ffb056, #e56b14);
  color: #2a1406;
  box-shadow: 0 8px 24px rgba(229, 107, 20, 0.32);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-soft {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-block { width: 100%; }
.btn.danger {
  background: #e35d5d;
  color: #fff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.field { display: grid; gap: 8px; }
.field > span,
.panel-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}
.field-row, .join-row, .code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.join-row .btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.field-row, input {
  background: rgba(16, 10, 4, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.field-row { padding: 0 12px; }
.field-icon { color: var(--muted); }
input {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}
.field-row input {
  border: 0;
  background: transparent;
  padding: 12px 8px;
}
input:focus { border-color: rgba(255, 140, 58, 0.55); }
.counter { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* HOME */
body.home { overflow: hidden; }
.home-bg {
  position: fixed;
  inset: 0;
  background:
    url("/fundo.png")
    center / cover no-repeat;
  filter: saturate(0.95) brightness(0.72);
  transform: scale(1.04);
}
.home-vignette {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 20% 40%, rgba(120, 52, 8, 0.22), transparent 55%),
    linear-gradient(90deg, rgba(14, 8, 4, 0.42) 0%, rgba(14, 8, 4, 0.22) 48%, rgba(14, 8, 4, 0.38) 100%);
}
.home-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 12px;
  margin: 0 0 18px;
}
.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.brand-sub {
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
  text-transform: lowercase;
}
.home-copy h1 {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
}
.home-copy h1 em {
  font-style: normal;
  color: #ffd4a8;
}
.lead {
  max-width: 440px;
  color: #ddd5c5;
  line-height: 1.55;
  margin: 0 0 28px;
}
.bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  color: #ece4d5;
}
.bullets li { display: flex; gap: 10px; align-items: center; }
.home-copy .btn-discord {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.btn-discord {
  background: linear-gradient(180deg, #ffb056, #e56b14);
  color: #2a1406;
  box-shadow: 0 8px 24px rgba(229, 107, 20, 0.32);
}
.btn-discord:hover { filter: brightness(1.08); }
.chip-discord {
  text-decoration: none;
  background: linear-gradient(180deg, #ffb056, #e56b14);
  border-color: transparent;
  color: #2a1406;
}
.ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cyan-dim);
  color: var(--cyan);
  font-size: 13px;
}

.auth-card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 6px; font-size: 22px; }
.hint { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.or {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  margin: 16px 0;
  position: relative;
}
.or::before, .or::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--line);
}
.or::before { left: 0; }
.or::after { right: 0; }
.home-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: #99897f;
  font-size: 12px;
  z-index: 1;
}

/* ROOM */
body.room {
  height: 100vh;
  display: grid;
  grid-template-rows: 56px 1fr 72px;
  background: #140e07;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #1c1408;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.pill, .chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text);
}
.chip-ok { color: #8ef0c8; }
.chip-live { min-width: 36px; text-align: center; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ee0a0;
  display: inline-block;
  margin-right: 6px;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: #181008;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.panel.grow { flex: 1; min-height: 0; overflow: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.code-row strong {
  font-size: 20px;
  letter-spacing: 0.08em;
  flex: 1;
}
.members { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.member {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffb056, #c85a10);
  color: #2a1406;
  font-weight: 800;
  font-size: 12px;
}
.you {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
}
.member-name { flex: 1; min-width: 0; }
.kick-btn {
  width: 28px;
  height: 28px;
  margin-left: auto;
  font-size: 12px;
  color: #ffb3a0;
}
.kick-btn:hover { background: rgba(227, 93, 93, 0.16); }
.host-tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--cyan);
}
.gate-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(227, 93, 93, 0.14);
  border: 1px solid rgba(227, 93, 93, 0.35);
  color: #ffc4b8;
  font-size: 13px;
}
.admin-panel .join-row { margin-top: 4px; }
.tiny { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.field.compact input { padding: 10px 12px; }

.stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 50% 30%, rgba(120, 52, 8, 0.2), transparent 60%);
}
.empty { text-align: center; max-width: 420px; padding: 24px; }
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 22px;
}
.empty h3 { margin: 0 0 8px; }
.empty p { margin: 0 0 18px; color: var(--muted); }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.tiles {
  width: 100%;
  height: 100%;
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: center;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.tile {
  position: relative;
  background: #0f0a05;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  min-height: 220px;
}
.tile video, .tile iframe {
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: min(70vh, 720px);
  object-fit: contain;
  background: #000;
  border: 0;
  display: block;
}
.tile-name {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.tile-stop {
  position: absolute;
  right: 10px;
  top: 10px;
}

.dock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #1c1408;
}
.dock-btn { width: 44px; height: 44px; border-radius: 12px; }

.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: #332812;
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 20;
}

.nick-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(14, 8, 4, 0.72);
  padding: 24px;
}
.nick-gate .auth-card { width: min(420px, 100%); }

@media (max-width: 900px) {
  .home-wrap { grid-template-columns: 1fr; padding-top: 72px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { max-height: 42vh; }
}
