:root {
  --bg: #15100b;
  --bg-2: #1e1710;
  --surface: #241b13;
  --surface-2: #2e2318;
  --line: #3d2f22;
  --text: #f8efe4;
  --muted: #b9a693;
  --amber: #ffb320;
  --amber-2: #ffd36b;
  --tomato: #ff5b37;
  --basil: #7fcf72;
  --radius: 20px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 179, 32, 0.18), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(255, 91, 55, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 460px; margin: 0 auto; min-height: 100%; padding: 18px 18px 32px; display: flex; flex-direction: column; }

/* Header */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
}
.brand-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.day-tag { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }

/* Screens */
.screen { display: none; flex: 1; flex-direction: column; animation: rise 0.35s ease both; }
.screen.active { display: flex; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h1.hero {
  font-size: clamp(46px, 14vw, 64px); line-height: 0.92; margin: 6px 0 14px;
  font-weight: 900; font-style: italic; letter-spacing: -0.035em;
  color: var(--amber);
  text-shadow: 3px 3px 0 var(--tomato);
}
h1.hero span { display: block; color: var(--text); text-shadow: 3px 3px 0 rgba(255, 91, 55, 0.6); }
h2 { font-size: 26px; line-height: 1.1; margin: 4px 0 8px; font-weight: 800; letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 16px; margin: 0 0 6px; }
.tagline { font-weight: 700; margin: 10px 0 22px; }
.tagline b { color: var(--amber); }

/* Card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* Form */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.02em; }
.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font: 600 17px var(--font); outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--amber); }
.phone-wrap { display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; transition: border-color 0.15s; }
.phone-wrap:focus-within { border-color: var(--amber); }
.phone-wrap .cc { padding: 0 4px 0 14px; color: var(--muted); font-weight: 700; }
.phone-wrap .input { border: 0; background: transparent; padding-left: 6px; }
.field-note { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.35; color: var(--muted); opacity: 0.85; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 4px 0 18px; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--amber); flex: none; }
.consent a { color: var(--amber-2); }
.form-error { color: var(--tomato); font-size: 14px; font-weight: 600; min-height: 20px; margin: -6px 0 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 56px; border-radius: 16px; border: 0; cursor: pointer;
  font: 800 18px var(--font); letter-spacing: -0.01em; text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--amber); color: #1b1206; box-shadow: 0 6px 0 #b9770a, 0 12px 30px rgba(255, 179, 32, 0.25); }
.btn-primary:active { box-shadow: 0 3px 0 #b9770a; transform: translateY(3px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn + .btn, .btn-row + .btn, .btn + .btn-row { margin-top: 12px; }
.link-btn { background: none; border: 0; color: var(--muted); font: 600 14px var(--font); text-decoration: underline; cursor: pointer; padding: 10px; }

/* Chat bubbles (echoes the WhatsApp feel) */
.bubble {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px; padding: 12px 14px; margin-bottom: 10px;
  max-width: 92%; font-size: 16px;
}
.bubble.me { margin-left: auto; border-radius: 18px 18px 6px 18px; background: #3a2a0f; border-color: #5a4115; }

/* Recorder */
.recorder { display: flex; flex-direction: column; align-items: center; padding: 18px 0 8px; }
.mic-wrap { position: relative; width: 196px; height: 196px; margin: 8px 0 14px; }
.mic-wrap svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.mic-wrap .ring-bg { stroke: var(--line); }
.mic-wrap .ring-fg { stroke: var(--tomato); transition: stroke-dashoffset 0.1s linear; }
.mic-btn {
  position: absolute; inset: 18px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, var(--amber-2), var(--amber) 55%, #e08e00);
  box-shadow: 0 10px 40px rgba(255, 179, 32, 0.35), inset 0 -6px 0 rgba(0, 0, 0, 0.15);
  display: grid; place-items: center; color: #1b1206;
  transition: transform 0.12s ease;
}
.mic-btn:active { transform: scale(0.96); }
.mic-btn svg { width: 64px; height: 64px; }
.mic-btn.recording { background: radial-gradient(circle at 35% 30%, #ff8a6e, var(--tomato) 60%, #d63b19); animation: pulse 1.1s ease-in-out infinite; color: #fff; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 91, 55, 0.55); } 50% { box-shadow: 0 0 0 18px rgba(255, 91, 55, 0); } }
.timer { font: 800 28px var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.timer small { font-size: 15px; color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: 14px; margin-top: 4px; text-align: center; min-height: 20px; }
canvas.wave { width: 100%; height: 56px; display: block; margin: 14px 0 4px; }

.preview { display: none; margin-top: 10px; }
.preview.show { display: block; }
.preview audio { width: 100%; height: 44px; margin-bottom: 14px; filter: invert(0.9) hue-rotate(180deg) saturate(0.6); border-radius: 12px; }

/* Analyzing */
.cooking { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.pot { font-size: 84px; animation: wobble 0.9s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-6px); } }
.steam { display: flex; gap: 6px; height: 16px; margin-bottom: 4px; }
.steam i { width: 6px; height: 16px; border-radius: 6px; background: var(--muted); opacity: 0.4; animation: steam 1.2s ease-in-out infinite; }
.steam i:nth-child(2) { animation-delay: 0.2s; } .steam i:nth-child(3) { animation-delay: 0.4s; }
@keyframes steam { 0%, 100% { transform: translateY(4px); opacity: 0.1; } 50% { transform: translateY(-6px); opacity: 0.6; } }

/* Result */
.report-head { text-align: center; margin: 6px 0 16px; }
.report-head .kicker { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.vibe { font-size: 30px; font-weight: 900; line-height: 1.05; letter-spacing: -0.025em; margin: 8px 0 4px; color: var(--amber); }
.total { display: inline-flex; align-items: baseline; gap: 4px; margin-top: 6px; padding: 6px 14px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 800; }
.total b { font-size: 22px; color: var(--text); }
.total span { color: var(--muted); font-size: 14px; }

.score { margin-bottom: 14px; }
.score:last-child { margin-bottom: 0; }
.score .row { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.score .row b { font-variant-numeric: tabular-nums; }
.bar { height: 12px; border-radius: 999px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar.drama i { background: linear-gradient(90deg, #ff8a3d, var(--tomato)); }
.bar.surprise i { background: linear-gradient(90deg, var(--amber-2), var(--amber)); }
.bar.funny i { background: linear-gradient(90deg, #a8e59c, var(--basil)); }

.roast { font-size: 19px; font-weight: 700; line-height: 1.3; margin: 16px 2px 18px; }
.roast::before { content: "“"; color: var(--amber); font-size: 30px; line-height: 0; vertical-align: -10px; margin-right: 2px; }
.entered { border-color: #5a4115; background: linear-gradient(180deg, #2f2210, var(--surface)); margin-bottom: 16px; }
.entered p { margin: 0 0 6px; }
.entered p:last-child { margin: 0; color: var(--muted); font-size: 14px; }

/* Reject / error */
.center-msg { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.big-emoji { font-size: 72px; margin-bottom: 4px; }

.foot { margin-top: auto; padding-top: 22px; text-align: center; color: var(--muted); font-size: 12px; }
.foot a { color: var(--muted); }
.mock-banner { background: #3b2a0a; border: 1px dashed var(--amber); color: var(--amber-2); font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 10px; text-align: center; margin-bottom: 12px; display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
