:root {
  --bg: #fef8f1;
  --surface: #ffffff;
  --ink: #2a2340;
  --ink2: #5b5470;
  --muted: #8b84a3;
  --accent: #f48b5c;
  --rose: #c94673;
  --mint: #2e9d70;
  --sky: #4e7ed6;
  --lilac: #7b5dc4;
  --border: rgba(42, 35, 64, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding: 24px;
}
.container { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 38px; font-weight: 900; margin: 0; }
.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 24px; padding: 22px 26px; box-shadow: 0 10px 30px rgba(42,35,64,0.06); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 900px) { .theme-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.theme-swatch {
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform .15s, border-color .15s;
}
.theme-swatch:hover { transform: translateY(-2px); }
.theme-swatch.is-active { border-color: var(--rose); box-shadow: 0 8px 24px rgba(201,70,115,0.22); }

.btn {
  border: none; border-radius: 12px; padding: 10px 16px; font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer; background: #f2eef9; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, #f48b5c, #c94673); color: #fff; }
.btn-good { background: var(--mint); color: #fff; }
.btn-bad { background: var(--rose); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }

label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin-bottom: 5px; }
input[type="text"], input[type="number"], input[type="password"], input[type="url"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border);
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink);
}

.cat-card { border-radius: 22px; background: var(--surface); border: 1.5px solid var(--border); padding: 18px 22px; margin-bottom: 14px; }
.q-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #faf7f2; border: 1px solid var(--border); margin-top: 10px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(42,35,64,0.75); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal-backdrop.is-open { display: flex; }
.modal { background: #fff; border-radius: 24px; padding: 24px 28px; width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; }
.pin-overlay { position: fixed; inset: 0; background: rgba(42,35,64,0.92); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 80; }
.pin-card { background: #fff; border-radius: 26px; padding: 28px; width: 100%; max-width: 360px; text-align: center; }

/* TV Stage Question Preview Overlay */
.tv-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(16, 13, 28, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tv-preview-shell {
  width: min(1220px, 95vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tv-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tv-preview-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tv-preview-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.tv-preview-tab.is-active {
  background: #fff;
  color: #1e1830;
  border-color: #fff;
}
.tv-preview-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tv-preview-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.tv-preview-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 110px);
  border-radius: 20px;
  overflow: hidden;
  background: #0e0b18;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.18);
}
.tv-preview-stage iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
