:root {
  --bg: #f2f6f8;
  --ink: #102028;
  --muted: #5d707a;
  --card: #ffffff;
  --line: #d8e2e7;
  --brand: #0f8c7c;
  --brand-deep: #0c5f72;
  --danger: #b43d3d;
  --shadow: 0 14px 40px rgba(16, 32, 40, 0.14);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% -10%, #d8f2ed 0, transparent 40%),
    radial-gradient(circle at 90% 0%, #d5eaf7 0, transparent 36%),
    var(--bg);
}

h1,
h2,
h3,
.eyebrow,
.tab,
.btn,
.code,
.pill {
  font-family: "Outfit", sans-serif;
}

.hidden {
  display: none !important;
}

.bg-orb {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.orb-a {
  width: 320px;
  height: 320px;
  left: -80px;
  top: -80px;
  background: rgba(15, 140, 124, 0.25);
}

.orb-b {
  width: 380px;
  height: 380px;
  right: -90px;
  top: -100px;
  background: rgba(12, 95, 114, 0.2);
}

.site-header,
.layout {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 2.2rem));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-top: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--brand-deep);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.5rem);
  line-height: 1.06;
}

.subhead {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 74ch;
  font-size: 1.05rem;
}

.auth-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 0.5rem 0.6rem 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.layout {
  display: grid;
  gap: 16px;
  margin-top: 1.2rem;
  padding-bottom: 2.1rem;
}

.status-banner {
  border-radius: var(--radius);
  border: 1px solid color-mix(in oklab, var(--brand) 28%, white);
  background: color-mix(in oklab, var(--brand) 12%, white);
  padding: 0.8rem 1rem;
  font-weight: 600;
}

.panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.5rem;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-subtitle,
.inline-help {
  margin: 0.15rem 0 0.75rem;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 0.72rem;
}

label {
  display: grid;
  gap: 0.33rem;
  font-weight: 600;
  font-size: 0.96rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid color-mix(in oklab, var(--brand) 35%, white);
  border-color: color-mix(in oklab, var(--brand) 60%, white);
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.6rem 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, background-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(130deg, var(--brand-deep), var(--brand));
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-danger {
  background: color-mix(in oklab, var(--danger) 90%, white);
  color: #fff;
}

.tab-row {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 0.35rem 0 0.7rem;
}

.tab {
  border: none;
  background: #fff;
  padding: 0.56rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  background: color-mix(in oklab, var(--brand) 12%, white);
  color: var(--brand-deep);
}

.pill {
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--brand) 40%, white);
  background: color-mix(in oklab, var(--brand) 15%, white);
  color: var(--brand-deep);
  padding: 0.18rem 0.58rem;
  font-weight: 700;
}

.creator-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}

.host-panel {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
}

.section-head h3 {
  margin: 0;
  font-size: 1rem;
}

.stack {
  display: grid;
  gap: 10px;
}

.stack.compact {
  gap: 7px;
}

.question-item,
.assignee-item,
.quiz-item,
.player-row,
.assignment-row {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.72rem;
}

.question-item header,
.assignee-item header,
.quiz-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.6rem;
}

.question-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.quiz-actions,
.row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.triple-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
}

.host-top-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.code {
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.08em;
  margin: 0.2rem 0 0.5rem;
  font-weight: 800;
}

.meta-label {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

.qr-wrap {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.5rem;
}

.qr-wrap img {
  width: 180px;
  height: 180px;
  display: block;
}

.realtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 0.8rem;
}

.join-panel {
  max-width: 760px;
  margin-inline: auto;
}

.live-state {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem;
  margin-top: 0.7rem;
}

.status-text {
  margin: 0;
  font-weight: 700;
}

.timer-text {
  margin: 0.35rem 0 0;
  color: var(--brand-deep);
  font-weight: 700;
}

.question-card {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: #fff;
}

.option-list {
  display: grid;
  gap: 8px;
  margin-top: 0.6rem;
}

.option-list button {
  text-align: left;
}

.assignment-row.complete {
  border-color: color-mix(in oklab, var(--brand) 40%, white);
  background: color-mix(in oklab, var(--brand) 10%, white);
}

@media (max-width: 1024px) {
  .creator-grid {
    grid-template-columns: 1fr;
  }

  .host-panel {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .triple-grid,
  .realtime-grid,
  .host-top-grid {
    grid-template-columns: 1fr;
  }

  .qr-wrap img {
    width: min(220px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
}
