:root {
  --bg: #080b14;
  --bg-2: #0d1220;
  --card: #121828;
  --card-2: #171f33;
  --border: #232c45;
  --text: #e7ecf6;
  --muted: #8a94ad;
  --muted-2: #5d6780;
  --grad-1: #6366f1;
  --grad-2: #8b5cf6;
  --grad-3: #d946ef;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(800px 600px at 15% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, rgba(217, 70, 239, 0.12), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(139, 92, 246, 0.14), transparent 60%);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 32px;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hidden { display: none !important; }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}

/* INTRO */
.intro-card { text-align: left; }

.badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 24px;
}

h1 {
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.grad {
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2), var(--grad-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lead {
  color: var(--muted);
  font-size: 16.5px;
  margin: 18px 0 30px;
  max-width: 560px;
}

.dims {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.dim {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
}

.dim-letter {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.dim-sep { color: var(--muted-2); font-weight: 400; }
.dim-name { font-weight: 700; font-size: 13.5px; margin-top: 4px; }
.dim-desc { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }

/* Buttons */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 15.5px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 15px 26px;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(99, 102, 241, 0.55);
}
.btn-primary:hover { box-shadow: 0 14px 40px -8px rgba(99, 102, 241, 0.7); }

.btn-ghost {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: #3a4564; }

.hint { color: var(--muted-2); font-size: 13px; margin-top: 18px; }

/* TEST */
.test-wrap { display: flex; flex-direction: column; gap: 18px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ghost-btn {
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.ghost-btn:hover { color: var(--text); border-color: #3a4564; }

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  border-radius: 999px;
  transition: width 0.25s ease;
}
.counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

.q-card { text-align: center; }

.q-axis {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.q-text {
  font-size: clamp(20px, 3.4vw, 27px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  min-height: 70px;
}

.q-instruction { color: var(--muted); font-size: 14px; margin-top: 12px; }

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.scale-btn {
  font-family: inherit;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 12px;
  padding: 14px 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  transition: all 0.15s ease;
}
.scale-btn span {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.scale-btn:hover { border-color: #3a4564; color: var(--text); transform: translateY(-2px); }
.scale-btn:active { transform: translateY(0) scale(0.97); }
.scale-btn.selected {
  background: linear-gradient(180deg, rgba(99,102,241,0.22), rgba(139,92,246,0.16));
  border-color: var(--grad-2);
  color: #fff;
}

.kbd-hint { color: var(--muted-2); font-size: 12.5px; margin-top: 22px; }
kbd {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
}

/* RESULTS */
.result-card { animation: rise 0.5s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-head { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }

.result-code {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1;
}

.result-name { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.result-title { color: var(--muted); font-size: 15px; margin-top: 3px; }

.result-desc { color: #c2cadd; font-size: 16px; line-height: 1.65; margin-bottom: 30px; }

.bars { display: flex; flex-direction: column; gap: 16px; margin-bottom: 30px; }
.bar-row { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 12px; }
.bar-label { font-weight: 800; font-size: 16px; text-align: center; }
.bar-label.dim { text-align: right; }
.bar-track {
  height: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-pct { font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; }

.result-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 30px;
}
.strengths, .watchout {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: left;
}
.strengths h3, .watchout h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
}
.strengths ul { list-style: none; }
.strengths li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 14.5px;
  color: #c2cadd;
}
.strengths li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--grad-2);
  font-weight: 800;
}
.watchout p { font-size: 14.5px; color: #c2cadd; }

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.copied-msg { color: #6ee7b7; font-size: 13.5px; margin-top: 14px; }

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
  padding: 0 20px 24px;
}

@media (max-width: 600px) {
  .card { padding: 26px 20px; }
  .dims { grid-template-columns: repeat(2, 1fr); }
  .result-head { flex-direction: column; text-align: center; gap: 8px; }
  .result-grid { grid-template-columns: 1fr; }
  .scale { gap: 6px; }
  .scale-btn { font-size: 11px; padding: 12px 3px; }
  .scale-btn span { font-size: 15px; }
}
