:root {
  --ink: #16181d;
  --muted: #5c6472;
  --paper: #fffaf3;
  --panel: #ffffff;
  --line: #e5ddd1;
  --orange: #ff6a1a;
  --coral: #ee3f57;
  --blue: #116d8f;
  --green: #2f7d54;
  --shadow: 0 24px 70px rgba(22, 24, 29, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 106, 26, 0.2), transparent 28rem),
    radial-gradient(circle at 80% 18%, rgba(17, 109, 143, 0.16), transparent 26rem),
    var(--paper);
}

button,
a {
  font: inherit;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(20px, 5vw, 64px);
}

.intro {
  display: grid;
  gap: 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}

.brand-row p,
.lede,
.series,
.why,
.copy-status {
  margin: 0;
}

.sound-bars {
  width: 54px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  align-items: end;
  padding: 7px;
  border-radius: 8px;
  background: var(--ink);
}

.sound-bars span {
  display: block;
  border-radius: 999px 999px 2px 2px;
  background: var(--orange);
}

.sound-bars span:nth-child(1) {
  height: 42%;
}

.sound-bars span:nth-child(2) {
  height: 78%;
  background: var(--coral);
}

.sound-bars span:nth-child(3) {
  height: 58%;
  background: var(--green);
}

.sound-bars span:nth-child(4) {
  height: 92%;
  background: #ffd166;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1;
}

h1 {
  max-width: 8ch;
  font-size: clamp(3.8rem, 10vw, 7.5rem);
}

.intro-copy {
  display: grid;
  gap: 20px;
}

.lede {
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.55;
}

.profile-card {
  position: relative;
  width: min(100%, 380px);
  overflow: hidden;
  border: 1px solid rgba(22, 24, 29, 0.14);
  border-radius: 8px;
  background: var(--ink);
  box-shadow: 0 20px 54px rgba(22, 24, 29, 0.18);
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(0deg, rgba(22, 24, 29, 0.88), transparent);
  pointer-events: none;
}

.profile-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.profile-copy {
  position: absolute;
  inset: auto 18px 18px;
  z-index: 1;
  display: grid;
  gap: 3px;
  color: #fff;
}

.profile-copy span {
  color: #ffd166;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-copy strong {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1;
}

.quiz-panel {
  width: 100%;
  min-height: 620px;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

#quiz-root {
  min-height: 556px;
  display: flex;
  flex-direction: column;
}

.progress-wrap {
  display: grid;
  gap: 10px;
}

.progress-meta,
.quiz-actions,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-meta,
.quiz-actions {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #ede6dc;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--coral), var(--blue));
  transition: width 180ms ease;
}

.question-block {
  flex: 1;
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 30px 0;
}

.question-block h2,
.results-header h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
}

.answer-grid {
  display: grid;
  gap: 12px;
}

.answer-button {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border: 1px solid #d9cec0;
  border-radius: 8px;
  color: var(--ink);
  background: #fffdfa;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.answer-button:hover {
  outline: none;
  transform: translateY(-1px);
  border-color: var(--orange);
  background: #fff3e9;
  box-shadow: 0 12px 30px rgba(255, 106, 26, 0.14);
}

.answer-button.no-hover:hover {
  transform: none;
  border-color: #d9cec0;
  background: #fffdfa;
  box-shadow: none;
}

.answer-button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.answer-button.selected {
  border-color: var(--orange);
  background: #fff3e9;
  box-shadow: 0 12px 30px rgba(255, 106, 26, 0.14);
}

.ghost-button,
.primary-button,
.listen-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fffdfa;
}

.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-button,
.listen-link {
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
}

.results-header {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.results-brand {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
}

.results-brand img {
  width: 64px;
  height: 64px;
  border: 3px solid var(--orange);
  border-radius: 8px;
  object-fit: cover;
}

.results-header p {
  margin: 0;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.results-header span {
  color: var(--muted);
  font-weight: 700;
}

.results-list {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.rank-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--orange);
  font-weight: 900;
}

.series {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-card h3 {
  margin-top: 4px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.08;
}

.why {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.detail-grid div {
  min-width: 0;
}

dt {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.listen-link {
  width: 100%;
}

.result-actions {
  margin-top: 18px;
}

.copy-status {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 780px) {
  .app-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px;
  }

  .intro {
    gap: 14px;
    padding-top: 10px;
  }

  .profile-card {
    width: 100%;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.78);
  }

  .profile-card::after {
    display: none;
  }

  .profile-card img {
    width: 92px;
    height: 92px;
    border-radius: 7px;
  }

  .profile-copy {
    position: static;
    color: var(--ink);
  }

  .profile-copy span {
    color: var(--orange);
  }

  .profile-copy strong {
    font-size: 1.55rem;
  }

  h1 {
    max-width: none;
    font-size: clamp(3rem, 16vw, 4.45rem);
    overflow-wrap: normal;
  }

  .quiz-panel {
    min-height: auto;
    padding: 18px;
  }

  #quiz-root {
    min-height: 540px;
  }

  .question-block {
    align-content: start;
    padding: 24px 0;
  }

  .question-block h2,
  .results-header h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .rank-badge {
    width: max-content;
    min-width: 46px;
    padding: 0 13px;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
