:root {
  --bg: #080c16;
  --panel: #101828;
  --line: #1d2940;
  --text: #e9eefa;
  --muted: #93a2bd;
  --accent: #f97316;
  --accent-2: #38bdf8;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(800px 460px at 82% -6%, rgba(249, 115, 22, 0.16), transparent 60%),
    radial-gradient(700px 480px at 6% 102%, rgba(56, 189, 248, 0.14), transparent 60%),
    linear-gradient(170deg, #0c1220, var(--bg));
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex; align-items: center; gap: 10px;
  max-width: 1040px; margin: 0 auto; padding: 18px 22px;
}
.mark {
  width: 24px; height: 24px; border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent-2), #a78bfa, var(--accent));
}
.brand { font-weight: 700; letter-spacing: 0.3px; font-size: 15px; }

main { max-width: 1040px; margin: 0 auto; padding: 0 22px 40px; }

/* ---------- intro ---------- */

.intro { text-align: center; padding: 22px 0 10px; }

h1 {
  font-size: clamp(34px, 7vw, 62px);
  line-height: 1.04;
  margin: 0 0 16px;
  letter-spacing: -1.5px;
  background: linear-gradient(115deg, #ffffff 35%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 26px;
}

.ask { max-width: 520px; margin: 0 auto; text-align: left; }
.ask label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.ask-row { display: flex; gap: 10px; }

input[type="text"] {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 17px;
  font-family: inherit;
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #fb7185);
  color: #1a0d04;
  border-color: transparent;
}

.suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 18px auto 0; max-width: 620px;
}
.suggestions button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.suggestions button:hover { color: var(--text); border-color: var(--accent-2); }

/* ---------- result ---------- */

.result { margin-top: 30px; }

.frame {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  justify-content: center;
}

canvas#art {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 74vh;
  border-radius: 10px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.facts > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.facts dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 17px; font-weight: 650; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.actions .btn { flex: 1 1 auto; }

.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 0; min-height: 20px; }

/* ---------- how ---------- */

.how { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 24px; }
.how h2 { font-size: 18px; margin: 0 0 10px; }
.how p { color: var(--muted); font-size: 14.5px; line-height: 1.7; margin: 0 0 12px; max-width: 700px; }
.note { color: #64748b; font-size: 13px; }

footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 22px 36px; }
footer a { color: var(--accent-2); margin-left: 8px; }
