:root {
  --bg: #09060f;
  --bg2: #130d1f;
  --card: rgba(19, 13, 31, 0.78);
  --card-strong: rgba(28, 18, 46, 0.92);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f8f2ff;
  --muted: #baaed1;
  --purple: #b06cff;
  --pink: #ff5ab8;
  --orange: #ff8f53;
  --green: #44d19d;
  --yellow: #f7c96d;
  --red: #ff6565;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(176,108,255,0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(255,90,184,0.18), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: radial-gradient(rgba(255,255,255,0.9) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}
.shell {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero {
  padding: 28px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
  margin: 16px 0 0;
}
.chips, .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips { margin-top: 20px; }
.chips span, .tag-list span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #f3ddff;
  font-size: 0.86rem;
}
.composer {
  padding: 22px;
}
.composer label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
}
textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(7, 6, 13, 0.72);
  color: var(--text);
  padding: 18px;
  font: 500 0.96rem/1.65 'JetBrains Mono', monospace;
}
textarea:focus {
  outline: none;
  border-color: rgba(176,108,255,0.7);
  box-shadow: 0 0 0 4px rgba(176,108,255,0.16);
}
textarea::placeholder { color: #8e7da7; }
.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 2px 0;
}
.hint, .count, .subtext { color: var(--muted); }
.hint { font-size: 0.9rem; line-height: 1.5; }
.count { font-size: 0.84rem; }
.turnstile {
  display: flex;
  justify-content: center;
  margin: 20px 0 14px;
}
.analyze-btn {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 18px;
  font: 800 1rem/1 'Inter', sans-serif;
  color: white;
  background: linear-gradient(135deg, var(--purple), var(--pink) 60%, var(--orange));
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
  box-shadow: 0 14px 30px rgba(176,108,255,0.34);
}
.analyze-btn:hover:not(:disabled) { transform: translateY(-1px); }
.analyze-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.analyze-btn.loading { color: transparent; position: relative; }
.analyze-btn.loading::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.28);
  border-top-color: white;
  animation: spin .7s linear infinite;
}
.error {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #ffd7e1;
  background: rgba(255, 101, 101, 0.14);
  border: 1px solid rgba(255, 101, 101, 0.28);
}
.results { margin-top: 18px; }
.grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.verdict {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.verdict h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  letter-spacing: -0.03em;
}
.verdict.neutral { background: linear-gradient(135deg, rgba(33,25,49,0.95), rgba(18,14,30,0.95)); }
.verdict.safe { background: linear-gradient(135deg, rgba(18,56,46,0.95), rgba(15,27,25,0.95)); }
.verdict.warn { background: linear-gradient(135deg, rgba(81,52,20,0.95), rgba(29,20,13,0.95)); }
.verdict.hot { background: linear-gradient(135deg, rgba(91,24,49,0.95), rgba(28,13,24,0.95)); }
.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.score-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  background: radial-gradient(circle at center, rgba(9,6,15,0.95) 54%, transparent 55%), conic-gradient(var(--pink), var(--orange), var(--purple));
}
.score-label { color: var(--muted); font-size: 0.84rem; text-transform: uppercase; letter-spacing: .12em; }
.metric-card, .list-card, .prose-card { padding: 20px; }
.meter {
  margin-top: 12px;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--yellow), var(--orange), var(--red));
  transition: width .5s ease;
}
.meter-fill.cool { background: linear-gradient(90deg, #5eead4, #60a5fa, #b06cff); }
ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f6eeff;
}
li + li { margin-top: 10px; }
.prose-card p {
  margin: 12px 0 0;
  line-height: 1.75;
  color: #f5eeff;
}
.response-card p { font-size: 1.04rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 820px) {
  .grid.two { grid-template-columns: 1fr; }
  .verdict { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .shell { padding: 18px 14px 60px; }
  .hero, .composer, .verdict, .metric-card, .list-card, .prose-card { padding: 18px; }
  textarea { min-height: 180px; }
  .composer-meta { flex-direction: column; }
}
