:root {
  color-scheme: dark;
  --bg: #0a0713;
  --surface: #171025;
  --surface-2: #1f1530;
  --text: #fff8f5;
  --muted: #b3a3c4;
  --line: rgba(255, 255, 255, 0.1);
  --hot: #ff2e86;
  --hot-soft: rgba(255, 46, 134, 0.14);
  --glow-pink: rgba(255, 46, 166, 0.35);
  --glow-orange: rgba(255, 130, 46, 0.28);
  --glow-violet: rgba(140, 60, 255, 0.3);
  --sans: -apple-system, "SF Pro Rounded", "SF Pro Display", "Segoe UI", ui-rounded, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 88% 0%, var(--glow-pink), transparent 42%),
    radial-gradient(circle at 4% 30%, var(--glow-violet), transparent 40%),
    radial-gradient(circle at 90% 78%, var(--glow-orange), transparent 38%),
    var(--bg);
}
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.app-shell { width: min(100%, 520px); margin: 0 auto; padding: 0 18px 64px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: max(18px, env(safe-area-inset-top)) 1px 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand-icon { width: 30px; height: 30px; display: block; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(255, 61, 110, .5)); }
.private { color: var(--muted); font-size: 11px; }
.private span { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: #5bd49a; border-radius: 50%; box-shadow: 0 0 8px #5bd49a; }

.hero { padding: clamp(46px, 9vh, 80px) 1px 30px; }
.hero h1 {
  margin: 0;
  font: 800 clamp(38px, 10.5vw, 54px)/1.03 var(--sans);
  letter-spacing: -.02em;
  color: #fff;
}
.hero h1 em {
  font-style: normal;
  font-weight: 800;
  background: linear-gradient(96deg, #ffb020 0%, #ff6a2e 35%, #ff2e86 72%, #d928ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin: 18px 0 0; color: var(--muted); font-size: 16px; font-weight: 500; }

.upload-card { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(155deg, rgba(31,21,48,.9), rgba(14,9,22,.96)); border: 1px dashed rgba(255,255,255,.18); border-radius: 26px; box-shadow: 0 30px 70px rgba(0,0,0,.45), 0 0 0 1px rgba(255,46,166,.08) inset; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease; }
.upload-card:hover { border-color: var(--hot); box-shadow: 0 30px 70px rgba(0,0,0,.45), 0 0 40px rgba(255,46,166,.22); }
.upload-icon { width: 68px; height: 68px; display: block; margin-bottom: 6px; object-fit: contain; filter: drop-shadow(0 10px 26px rgba(255, 61, 110, .45)); }
.upload-card strong { font-size: 16px; font-weight: 700; }
.upload-card small { color: var(--muted); font-size: 11px; }
.privacy-note { margin: 15px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

.preview { position: relative; overflow: hidden; padding: 12px 12px 64px; background: #0c0813; border: 1px solid var(--line); border-radius: 25px; }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preview-shot { position: relative; overflow: hidden; aspect-ratio: 9 / 16; background: #17101f; border-radius: 14px; }
.preview-shot img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top; }
.shot-number { position: absolute; top: 7px; left: 7px; width: 23px; height: 23px; display: grid; place-items: center; color: #fff; background: rgba(10,7,19,.82); border-radius: 50%; font-size: 10px; font-weight: 700; }
.change-image { position: absolute; right: 12px; bottom: 12px; padding: 10px 13px; color: var(--text); background: rgba(10,7,19,.86); border: 1px solid var(--line); border-radius: 99px; font-size: 11px; font-weight: 600; cursor: pointer; backdrop-filter: blur(8px); }

.results { padding-top: 50px; }
.results-heading { margin-bottom: 20px; }
.results h2 {
  margin: 0;
  font: 800 clamp(28px, 7.5vw, 36px)/1.08 var(--sans);
  letter-spacing: -.015em;
  color: #fff;
}
.results h2 em {
  font-style: normal;
  font-weight: 800;
  background: linear-gradient(96deg, #ffb020, #ff6a2e 45%, #ff2e86 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.reply-grid { display: grid; gap: 12px; }
.reply-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 108px;
  padding: 18px 20px;
  text-align: left;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.reply-card:active { transform: scale(.98); }
.reply-chip {
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .22);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.reply-sparkle { position: absolute; top: 18px; right: 20px; color: rgba(255,255,255,.75); font-size: 15px; }
.reply-text { margin: 0; color: #fff; font: 700 19px/1.32 var(--sans); letter-spacing: -.01em; }
.reply-copied {
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 7px 13px;
  border-radius: 99px;
  background: rgba(10, 7, 19, .55);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.reply-card.just-copied .reply-copied { opacity: 1; transform: translateY(0); }

.tier-mild { background: linear-gradient(135deg, #b98a2c, #ecc257); box-shadow: 0 18px 40px rgba(236, 194, 87, .22); }
.tier-medium { background: linear-gradient(135deg, #e46a26, #ff9d47); box-shadow: 0 18px 40px rgba(255, 138, 46, .26); }
.tier-hot { background: linear-gradient(135deg, #e2314f, #ff5a6e); box-shadow: 0 18px 40px rgba(255, 61, 94, .3); }
.tier-stupid { background: linear-gradient(135deg, #c522a0, #ff5ad1); box-shadow: 0 18px 40px rgba(255, 46, 166, .32); }

.retry-reply, .copy-fallback { width: 100%; margin-top: 6px; padding: 16px; color: #fff; background: linear-gradient(96deg, #ff6a2e, #ff2e86); border: 0; border-radius: 14px; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 16px 34px rgba(255, 46, 134, .28); }
.start-over { width: 100%; margin-top: 12px; padding: 14px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 14px; font-weight: 600; cursor: pointer; }
.context-request { margin-top: 42px; padding: 24px; background: var(--surface); border: 1px solid rgba(255,46,166,.4); border-radius: 22px; box-shadow: 0 0 40px rgba(255,46,166,.12); }
.reply-label { color: var(--hot); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.context-request h2 { margin: 12px 0 10px; font: 800 32px/1.05 var(--sans); letter-spacing: -.02em; }
.context-request p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }

.loading-screen { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(10,7,19,.92); backdrop-filter: blur(12px); }
.loading-stage { position: relative; display: grid; place-items: center; width: 170px; height: 170px; }
.ignition-logo { position: absolute; width: 118px; height: 118px; object-fit: contain; opacity: 0; transform: scale(.12) translateY(14px); filter: brightness(1.4) saturate(1.25) drop-shadow(0 0 0 rgba(255,61,110,0)); animation: logoIgnite .66s cubic-bezier(.17,.89,.32,1.32) .88s forwards, logoFlicker .22s ease-in-out 1.54s 3 alternate; }
.typing-dots { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; animation: dotsMelt .48s cubic-bezier(.55,.06,.68,.19) .66s forwards; }
.typing-dots span { width: 24px; height: 24px; display: block; border-radius: 50%; background: radial-gradient(circle at 34% 27%, #fff 0 10%, #fff06e 24%, #ff942e 56%, #ff2869 100%); box-shadow: 0 0 12px rgba(255,181,55,.9), 0 0 30px rgba(255,61,110,.55); animation: dotHeat .34s ease-in-out infinite alternate; }
.typing-dots span:nth-child(2) { animation-delay: .11s; }
.typing-dots span:nth-child(3) { animation-delay: .22s; }
@keyframes dotHeat { from { transform: translateY(4px) scale(.76); opacity: .5; filter: brightness(.85); } to { transform: translateY(-4px) scale(1.08); opacity: 1; filter: brightness(1.5); } }
@keyframes dotsMelt { 55% { gap: 0; transform: translateY(-2px) scale(.82); filter: blur(0); } 100% { gap: 0; opacity: 0; transform: translateY(-12px) scale(.12); filter: blur(5px); } }
@keyframes logoIgnite { 55% { opacity: 1; transform: scale(1.08) translateY(-3px); filter: brightness(1.65) saturate(1.35) drop-shadow(0 0 32px rgba(255,61,110,.85)); } 100% { opacity: 1; transform: scale(1) translateY(0); filter: brightness(1.05) saturate(1.1) drop-shadow(0 0 22px rgba(255,61,110,.6)); } }
@keyframes logoFlicker { from { transform: scale(1) rotate(-1deg); filter: brightness(1.02) saturate(1.08) drop-shadow(0 0 18px rgba(255,61,110,.55)); } to { transform: scale(1.035) rotate(1deg); filter: brightness(1.25) saturate(1.25) drop-shadow(0 0 31px rgba(255,151,46,.82)); } }

.error { margin-top: 15px; padding: 14px; color: #ffc3d3; background: rgba(255,46,134,.12); border: 1px solid rgba(255,46,134,.4); border-radius: 14px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30; opacity: 0; transform: translate(-50%, 30px); padding: 11px 17px; color: var(--bg); background: var(--text); border-radius: 99px; font-size: 12px; font-weight: 800; transition: .2s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 390px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .hero { padding-top: 40px; }
  .upload-card { min-height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .typing-dots { display: none; }
  .ignition-logo { animation: none; opacity: 1; transform: none; }
}
