:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #07111f;
  color: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 38%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.16), transparent 35%),
    #07111f;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.room-card {
  width: min(100%, 560px);
  padding: 40px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 10px;
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.05;
}

.intro {
  margin: 16px 0 30px;
  color: #b6c2d1;
  line-height: 1.6;
}

#room-form {
  display: grid;
  gap: 20px;
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-group label {
  color: #e2e8f0;
  font-size: 0.94rem;
  font-weight: 650;
}

.form-group label span {
  color: #94a3b8;
  font-weight: 400;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 12px;
  outline: none;
  background: #0b1324;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.form-group input::placeholder {
  color: #64748b;
}

.form-group input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #cbd5e1;
  cursor: pointer;
  line-height: 1.45;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #0ea5e9;
}

#create-room-button {
  width: 100%;
  margin-top: 4px;
  padding: 15px 20px;
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  font-weight: 750;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

#create-room-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.36);
}

#create-room-button:active {
  transform: translateY(0);
}

#form-message {
  min-height: 24px;
  margin: 18px 0 0;
  color: #7dd3fc;
  font-size: 0.92rem;
  text-align: center;
}

@media (max-width: 600px) {
  .app-shell {
    padding: 18px 14px;
  }

  .room-card {
    padding: 28px 20px;
    border-radius: 18px;
  }
}

/* Compact desktop layout — leaves space for ads below */
@media (min-width: 601px) and (min-height: 700px) {
  .app-shell {
    min-height: auto;
    padding: 24px 20px 16px;
  }

  .room-card {
    width: min(100%, 560px);
    padding: 26px 32px;
  }

  .eyebrow {
    margin-bottom: 6px;
  }

  h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
  }

  .intro {
    margin: 10px 0 20px;
    line-height: 1.4;
  }

  #room-form {
    gap: 13px;
  }

  .form-group {
    gap: 5px;
  }

  .form-group input {
    padding: 11px 14px;
  }

  #create-room-button {
    padding: 13px 18px;
  }

  #form-message {
    min-height: 0;
    margin: 10px 0 0;
  }
}

/* Embedded Director workspace */
.director-workspace {
  width: 100%;
  min-height: 100vh;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  background: #111827;
}

.director-workspace[hidden] {
  display: none;
}

.director-panel {
  min-width: 0;
  min-height: calc(100vh - 24px);
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

#director-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 24px);
  border: 0;
  background: #000;
}

.ad-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-slot {
  min-height: 180px;
  padding: 16px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: #1f2937;
  color: #9ca3af;
  font-size: 0.82rem;
  text-align: center;
}

/* Stack ads below the panel on smaller screens */
@media (max-width: 900px) {
  .director-workspace {
    grid-template-columns: 1fr;
  }

  .ad-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ad-slot {
    min-height: 120px;
  }
}

@media (max-width: 600px) {
  .director-workspace {
    padding: 6px;
    gap: 8px;
  }

  .director-panel,
  #director-frame {
    min-height: calc(100vh - 12px);
    height: calc(100vh - 12px);
    border-radius: 6px;
  }

  .ad-rail {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FAQ Accordion
   ========================================================= */

.faq-section {
  width: min(980px, calc(100% - 32px));
  margin: 32px auto 56px;
  scroll-margin-top: 24px;
}

.faq-container {
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(15, 27, 49, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.faq-eyebrow {
  margin: 0 0 8px;
  color: #68d5ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.faq-container h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.2;
}

.faq-intro {
  max-width: 720px;
  margin: 12px 0 26px;
  color: #b8c4d8;
  line-height: 1.7;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(6, 18, 36, 0.72);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.faq-item:hover {
  border-color: rgba(104, 213, 255, 0.42);
  background: rgba(10, 26, 49, 0.92);
}

.faq-item[open] {
  border-color: rgba(104, 213, 255, 0.5);
  background: rgba(10, 26, 49, 0.98);
}

.faq-item summary {
  position: relative;
  padding: 18px 54px 18px 20px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(104, 213, 255, 0.38);
  border-radius: 50%;
  color: #68d5ff;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-50%);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:focus-visible {
  outline: 3px solid rgba(104, 213, 255, 0.55);
  outline-offset: -3px;
}

.faq-answer {
  padding: 0 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.faq-answer p {
  margin: 14px 0 0;
  color: #bdc9da;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .faq-section {
    width: min(100% - 12px, 980px);
    margin-top: 18px;
    margin-bottom: 30px;
  }

  .faq-container {
    padding: 22px 14px;
    border-radius: 16px;
  }

  .faq-item summary {
    padding: 16px 50px 16px 16px;
    font-size: 0.96rem;
  }

  .faq-answer {
    padding: 0 16px 16px;
  }

  .faq-item summary::after {
    right: 14px;
  }
}