/* Chik Live Quiz — "Psychedelic Editorial" design system v1.0 */
:root {
  --color-primary: #F15A29;   /* Burnt Orange */
  --color-secondary: #EE6CA7; /* Flower Pink */
  --color-accent: #FFD94F;    /* Sunshine Yellow */
  --color-success: #249C61;   /* Botanical Green */
  --color-ink: #342B1B;       /* Earth Brown */
  --color-background: #FFF8E8;/* Vintage Cream */
  --color-surface: #FFFFFF;
  --color-muted: #7A6E5A;
  --color-line: #E8DCC2;
  --brand-accent: var(--color-primary); /* overridden per client session */

  --font-display: "Fraunces", "Recoleta", Georgia, "Songti SC", "Noto Serif SC", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --space-unit: 4px;
  --shadow-card: 0 4px 16px rgba(52, 43, 27, .10);
  --focus-ring: 3px solid #342B1B;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; margin: 0; line-height: 1.05; }
p { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* ---------- Brand mark ---------- */
.mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.mark svg { width: 30px; height: 30px; flex: none; }
.mark small { font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); display: block; }
.client-logo { max-height: 44px; max-width: 180px; object-fit: contain; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius-pill); padding: 14px 28px; cursor: pointer;
  font-weight: 700; font-size: 17px; background: var(--color-primary); color: var(--color-ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
  box-shadow: 0 3px 0 rgba(52,43,27,.9);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(52,43,27,.9); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(52,43,27,.9); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.pink { background: var(--color-secondary); }
.btn.yellow { background: var(--color-accent); }
.btn.green { background: var(--color-success); color: var(--color-background); }
.btn.dark { background: var(--color-ink); color: var(--color-background); box-shadow: 0 3px 0 var(--color-primary); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--color-ink); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--color-ink); background: rgba(52,43,27,.06); }
.btn.big { font-size: 22px; padding: 18px 40px; }
.btn.small { font-size: 14px; padding: 8px 16px; box-shadow: none; }
.btn.small:hover { box-shadow: none; }
.btn.small.ghost, .btn.small.ghost:hover { box-shadow: inset 0 0 0 2px var(--color-ink); }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--color-muted); }
input[type=text], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; background: var(--color-background); border: 2px solid var(--color-line);
  border-radius: var(--radius-md); padding: 14px 16px; font-size: 17px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--color-ink); box-shadow: 0 0 0 1px var(--color-ink); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; min-height: 160px; resize: vertical; }

/* ---------- Cards ---------- */
.card { background: var(--color-surface); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-card); }
.card.cream { background: var(--color-background); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-pill); font-weight: 700; background: var(--color-surface); }

/* ---------- Segmented toggle ---------- */
.seg { display: inline-flex; background: var(--color-line); border-radius: var(--radius-pill); padding: 4px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: var(--radius-pill); font-weight: 700; cursor: pointer; font-size: 14px; }
.seg button[aria-pressed=true] { background: var(--color-ink); color: var(--color-background); }

/* ---------- Answer shapes / colours ---------- */
.ans-0 { --ans: var(--color-primary); --ans-ink: var(--color-ink); }
.ans-1 { --ans: var(--color-secondary); --ans-ink: var(--color-ink); }
.ans-2 { --ans: var(--color-accent); --ans-ink: var(--color-ink); }
.ans-3 { --ans: var(--color-success); --ans-ink: var(--color-background); }
.shape { width: 1em; height: 1em; flex: none; fill: currentColor; }

/* ---------- Decorative blooms (brand layer only) ---------- */
.bloom { position: absolute; pointer-events: none; z-index: 0; }
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.17  0 0 0 0 0.1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.pop { animation: pop .45s cubic-bezier(.2,.9,.3,1.2) both; }
.rise { animation: rise .5s ease both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--color-ink); color: var(--color-background); padding: 12px 20px; border-radius: var(--radius-pill);
  font-weight: 600; box-shadow: var(--shadow-card);
}
.conn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--color-accent);
  color: var(--color-ink); padding: 6px 14px; border-radius: var(--radius-pill); font-weight: 700; font-size: 13px; }
