/* ===== Colors used everywhere (change these to rebrand) ===== */
:root {
  --blue: #0b6fb8;
  --blue-dark: #084f85;
  --aqua: #22c1e6;
  --bg: #eef5fb;
  --card: #ffffff;
  --text: #13212e;
  --muted: #5b6b7a;
  --border: #d5e2ee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1620;
    --card: #16222f;
    --text: #e8f0f7;
    --muted: #93a4b5;
    --border: #2a3b4d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  background: linear-gradient(135deg, var(--blue), var(--aqua));
  color: #fff;
  padding: 18px 16px 14px;
  text-align: center;
}
.topbar h1 { margin: 0; font-size: 1.5rem; }
.topbar p { margin: 4px 0 0; opacity: 0.9; }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step {
  background: var(--blue);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.9rem;
}

.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; }

.field {
  display: block;
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}
.field input[type="text"],
.field select,
.field textarea,
#postText {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font-size: 16px; /* 16px stops phones from zooming in */
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.field input[type="range"] { width: 100%; margin-top: 8px; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  flex: 1;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn.primary { background: #16a34a; }
.btn.secondary { background: var(--bg); color: var(--blue); border: 2px solid var(--blue); }
.btn.ghost { background: transparent; color: var(--muted); flex: 0; }
.btn.full { width: 100%; margin-top: 4px; }
.btn.recording { background: #dc2626; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

/* ===== Template choice ===== */
.choice-row { display: flex; gap: 10px; }
.choice { flex: 1; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: block;
  text-align: center;
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-weight: 600;
}
.choice input:checked + span {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

/* ===== Uploads ===== */
.upload-pair { display: flex; gap: 10px; }
.upload { flex: 1; }
.upload input { display: none; }
.thumb {
  aspect-ratio: 9 / 16;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.gallery .item { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; }
.gallery .item img, .gallery .item video { width: 100%; height: 100%; object-fit: cover; }
.gallery .item button {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.6); color: #fff;
}

/* ===== Preview ===== */
.stage {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
#canvas {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  height: auto;
  display: block;
}
#resultVideo {
  width: 100%;
  max-height: 60vh;
  background: #000;
  border-radius: 12px;
  margin-top: 10px;
}
audio { width: 100%; margin-top: 10px; }

.status { color: var(--muted); min-height: 1.2em; margin: 10px 0 0; }
.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding-bottom: 24px; }
