:root {
  color-scheme: dark;
  --bg: #09090d;
  --surface: #111116;
  --surface-2: #17171f;
  --border: #282833;
  --purple: #9568ff;
  --blue: #477dff;
  --text: #f5f5f8;
  --muted: #9696a3;
  --success: #65d9a0;
  --danger: #ff7777;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.site-header {
  min-height: 72px;
  padding: 0 clamp(18px, 7vw, 100px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--purple); border-radius: 10px;
  color: var(--purple); font-size: 21px; font-weight: 800;
}
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.brand-name b { color: var(--purple); }
.header-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; letter-spacing: 2px; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.page-shell { width: min(100% - 36px, 1050px); margin: 0 auto; }
.home-screen { padding: 100px 0 75px; text-align: center; }
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 11px; color: var(--purple); font-size: 10px; font-weight: 700; letter-spacing: 2.2px; }
.eyebrow > span { width: 28px; height: 1px; background: var(--purple); }
h1 { margin: 29px 0 0; font-size: clamp(43px, 8vw, 76px); line-height: 1.08; letter-spacing: -3px; }
h1 span, .result-heading span { color: var(--purple); }
.intro { max-width: 540px; margin: 22px auto 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.stats-row { display: flex; align-items: center; justify-content: center; gap: 32px; margin: 45px 0; }
.stat { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; }
.stat strong { color: var(--text); font-size: 25px; }
.stat-separator { height: 36px; width: 1px; background: var(--border); }
.start-card { width: min(100%, 470px); margin: 0 auto; padding: 25px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; }
.start-card label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }
.start-card input { width: 100%; height: 54px; padding: 0 15px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; outline: none; font-size: 14px; }
.start-card input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px #9568ff20; }
.primary-button, .secondary-button { min-height: 52px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 18px; border: 0; color: white; background: linear-gradient(100deg, var(--purple), var(--blue)); transition: transform .18s ease, opacity .18s ease; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); }
.primary-button:disabled { opacity: .4; cursor: not-allowed; }
.start-card .primary-button { width: 100%; margin-top: 14px; }
.button-arrow { font-size: 22px; line-height: 1; }
.form-message { margin: 15px 0 0; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.5; }
.form-message.error { color: var(--danger); }

.roles-section { margin: 100px auto 0; text-align: left; }
.section-kicker { color: var(--purple); font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.roles-section h2 { margin: 14px 0 0; font-size: 30px; letter-spacing: -1px; }
.roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 28px; }
.role-card { min-height: 145px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; transition: border-color .2s, transform .2s; }
.role-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.role-card > span { color: var(--purple); font-size: 10px; }
.role-card h3 { margin: 15px 0 8px; font-size: 15px; }
.role-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.quiz-screen, .result-screen { width: min(100%, 760px); margin: 0 auto; padding: 72px 0 95px; animation: appear .28s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.quiz-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; letter-spacing: 1.2px; }
.progress-track { height: 5px; margin-top: 18px; overflow: hidden; background: var(--border); border-radius: 10px; }
.progress-bar { width: 10%; height: 100%; background: linear-gradient(90deg, var(--purple), var(--blue)); border-radius: inherit; transition: width .25s ease; }
.quiz-content { margin-top: 58px; }
.question-title { margin: 17px 0 0; font-size: clamp(27px, 5vw, 39px); line-height: 1.25; letter-spacing: -1.2px; }
.question-hint { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.answer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.answer-option { min-height: 105px; padding: 17px; display: flex; align-items: flex-start; gap: 12px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13px; line-height: 1.55; transition: background .15s, border-color .15s; }
.answer-option:hover { border-color: #7655c8; background: var(--surface-2); }
.answer-option.selected { border-color: var(--purple); background: #9568ff16; }
.answer-box { width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-items: center; border: 1px solid #555563; border-radius: 6px; color: white; font-size: 12px; }
.answer-option.selected .answer-box { border-color: var(--purple); background: var(--purple); }
.selection-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 10px; }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }
.secondary-button { padding: 0 19px; color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.secondary-button:disabled { opacity: .35; cursor: not-allowed; }
.next-button { min-width: 145px; }

.result-screen { text-align: center; }
.result-heading { margin: 24px 0 0; font-size: clamp(38px, 7vw, 58px); line-height: 1.08; letter-spacing: -2px; }
.result-nickname { margin: 14px 0 27px; color: var(--muted); font-size: 13px; }
.result-card { margin-top: 15px; padding: 26px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.primary-result { border-color: #9568ff80; }
.result-label { color: var(--purple); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.result-card h3 { margin: 15px 0 0; font-size: 26px; }
.match-percent { margin-top: 17px; color: var(--purple); font-size: 47px; font-weight: 800; }
.match-caption { margin-top: 0; color: var(--muted); font-size: 10px; }
.result-card p { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.restart-button { width: min(100%, 420px); margin: 25px auto 0; }
.result-footnote { margin-top: 17px; color: var(--muted); font-size: 10px; }
.site-footer { min-height: 65px; padding: 20px clamp(18px, 7vw, 100px); display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.app-status { position: fixed; right: 10px; bottom: 10px; z-index: 5; padding: 7px 10px; color: #b7f5d2; background: #10251c; border: 1px solid #24533c; border-radius: 7px; font-size: 10px; opacity: .9; }

@media (max-width: 650px) {
  .site-header { min-height: 64px; padding: 0 18px; }
  .header-status { font-size: 8px; letter-spacing: 1.2px; }
  .home-screen { padding: 76px 0 65px; }
  h1 { letter-spacing: -2px; }
  .intro { max-width: 440px; font-size: 13px; }
  .stats-row { gap: 17px; margin: 37px 0; }
  .stat { font-size: 10px; }
  .stat strong { font-size: 22px; }
  .start-card { padding: 21px; }
  .roles-section { margin-top: 75px; }
  .roles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .role-card { min-height: 140px; padding: 15px; }
  .role-card h3 { font-size: 13px; }
  .role-card p { font-size: 11px; }
  .quiz-screen, .result-screen { padding: 55px 0 75px; }
  .quiz-content { margin-top: 43px; }
  .answer-list { grid-template-columns: 1fr; gap: 9px; margin-top: 24px; }
  .answer-option { min-height: 72px; align-items: center; padding: 15px; }
  .quiz-actions { margin-top: 25px; }
  .quiz-actions > button { flex: 1; }
  .result-card { padding: 22px; }
  .site-footer { flex-direction: column; align-items: center; text-align: center; }
}
@media (max-width: 360px) {
  .roles-grid { grid-template-columns: 1fr; }
  .header-status { letter-spacing: .5px; }
  .brand-name { font-size: 12px; }
  .stats-row { gap: 11px; }
}
