: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;
  }
}