@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Noto+Sans+JP:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #0c0b12;
  --panel: #15131d;
  --panel-strong: #1a1722;
  --line: #302c38;
  --muted: #aaa5b2;
  --text: #f4f1f7;
  --pink: #f04b9f;
  --cyan: #49dce8;
  --yellow: #e6d66c;
  --green: #73d6a8;
  --danger: #ee6b83;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Noto Sans JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  background: var(--bg);
}

button { color: inherit; font: inherit; }

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.site-header::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 88px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan) 0 48%, transparent 48% 52%, var(--pink) 52% 100%);
  content: "";
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--bg);
  background: var(--text);
  font: 800 14px/1 var(--display);
}

.brand strong {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: .11em;
}

.screen {
  display: none;
  min-height: calc(100vh - 112px);
  padding: 28px 0 40px;
}

.screen.is-active { display: block; animation: enter .16s ease-out both; }
@keyframes enter { from { opacity: 0; } }

.mode-screen.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-number,
.chart-data-label {
  color: var(--cyan);
  font: 700 11px/1 var(--display);
  letter-spacing: .16em;
}

.mode-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  position: relative;
  display: grid;
  grid-template-columns: 116px 1fr 32px;
  min-height: 164px;
  padding: 20px;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.mode-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cyan);
  content: "";
}

.mode-card-effector::before { background: var(--pink); }
.mode-card:hover { border-color: var(--cyan); background: var(--panel-strong); transform: translateX(4px); }
.mode-card-effector:hover { border-color: var(--pink); }
.mode-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.mode-card-effector:focus-visible { outline-color: var(--pink); }

.mode-visual {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  border: 1px solid var(--line);
  background: #111019;
}

.radar-mini svg { width: 82px; height: 82px; overflow: visible; }
.radar-mini-base { fill: #242941; stroke: #68738d; stroke-width: 1.5; }
.radar-mini-axes { fill: none; stroke: rgba(213,220,246,.28); stroke-width: 1; }
.radar-mini-data { fill: url("#radar-mini-gradient"); stroke: #50dbe3; stroke-width: 1.5; }

.credit-mini {
  align-content: center;
  justify-items: start;
  padding: 16px;
  border-color: #593247;
  background: linear-gradient(145deg, #17121a, #25131f);
  font-family: var(--display);
}

.credit-mini span { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.credit-mini strong { color: var(--pink); font-size: 30px; line-height: .9; letter-spacing: -.03em; }
.mode-card-copy { display: grid; gap: 8px; min-width: 0; }
.mode-card-copy strong { font-size: 20px; }
.mode-card-copy > span:last-child { color: var(--muted); font-size: 11px; line-height: 1.6; }
.mode-card-effector .mode-number { color: var(--pink); }
.mode-arrow { color: var(--muted); font: 700 24px/1 var(--display); }

.start-screen.is-active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.filter-panel {
  width: min(820px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel-heading,
.detail-heading,
.start-row,
.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h1 { margin: 5px 0 0; font-size: 19px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.quiz-home-button {
  display: inline-flex;
  height: 32px;
  padding: 0 11px;
  align-items: center;
  gap: 8px;
  border: 1px solid #514a59;
  color: #d5d0da;
  background: #111019;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.quiz-home-button:hover { border-color: var(--cyan); color: var(--text); }
.quiz-home-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.filter-section { padding: 20px 0 14px; }

.filter-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
}

.level-chip { position: relative; }
.level-chip input { position: absolute; opacity: 0; pointer-events: none; }

.level-chip span {
  display: grid;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  color: #c3bec9;
  background: transparent;
  cursor: pointer;
  font: 700 14px/1 var(--display);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.level-chip:hover span { border-color: #5a5464; }
.level-chip input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.level-chip input:checked + span {
  border-color: var(--cyan);
  color: #0c1517;
  background: var(--cyan);
}

.detail-filter {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #111019;
}

.detail-heading { margin-bottom: 12px; }

.detail-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.detail-heading strong { font: 800 23px/1 var(--display); }
.detail-heading small { color: var(--muted); font-size: 9px; }
.group-actions { display: flex; gap: 6px; }

.group-actions button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.group-actions button:hover { border-color: #6a6372; color: var(--text); }

.decimal-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}

.decimal-grid .level-chip span { height: 32px; font-size: 12px; }

.detail-filter[data-group="19"] .level-chip input:checked + span {
  border-color: var(--pink);
  color: #180d13;
  background: var(--pink);
}

.start-row { align-items: flex-end; margin-top: 20px; }

.validation-message {
  min-height: 30px;
  max-width: 430px;
  margin: 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.55;
}

.primary-button,
.next-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: border-color .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}

.primary-button {
  display: flex;
  min-width: 190px;
  height: 50px;
  padding: 0 18px 0 22px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: var(--bg);
  background: var(--text);
}

.primary-button:hover:not(:disabled) { background: var(--cyan); }
.primary-button:disabled { cursor: not-allowed; opacity: .28; }

.quiz-screen { padding-top: 24px; }

.quiz-topline h1 {
  margin: 0;
  font-size: clamp(25px, 2.7vw, 34px);
  line-height: 1.2;
}

.progress-copy { display: flex; align-items: baseline; font-family: var(--display); }
.progress-copy strong { font-size: 30px; }
.progress-copy span { color: var(--muted); font-size: 15px; }

.progress-track {
  height: 2px;
  margin: 14px 0 18px;
  background: var(--line);
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--cyan);
  transition: width .25s ease;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(350px, .9fr) minmax(500px, 1.1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.radar-stage {
  display: grid;
  min-height: 410px;
  padding: 12px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
}

.radar-chart {
  display: grid;
  width: min(100%, 384px);
  aspect-ratio: 1;
  place-items: center;
}

.radar-chart svg { width: 100%; height: 100%; overflow: visible; }
.radar-base { fill: url(#radar-base-fill); stroke: none; }
.radar-grid { fill: none; stroke: rgba(198, 207, 236, .32); stroke-width: 1.2; }
.radar-grid.is-reference { stroke: rgba(225, 231, 255, .72); stroke-width: 2; }
.radar-axis { stroke: rgba(213, 220, 246, .3); stroke-width: 1.1; }
.radar-shape { fill: url(#radar-fill); stroke: rgba(178, 135, 255, .68); stroke-width: 1.6; }
.radar-center { fill: rgba(255,255,255,.9); }

.radar-label {
  font: 800 16px var(--display);
  letter-spacing: .045em;
  paint-order: stroke;
  stroke: rgba(8, 7, 18, .96);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.radar-label.label-0 { fill: #2df5dc; }
.radar-label.label-1 { fill: #ff416d; }
.radar-label.label-2 { fill: #ff3fc5; }
.radar-label.label-3 { fill: #eef33b; }
.radar-label.label-4 { fill: #a94cff; }
.radar-label.label-5 { fill: #4ce5a8; }

.chart-stage {
  display: grid;
  min-height: 410px;
  padding: clamp(20px, 3vw, 34px);
  grid-template-rows: auto 1fr;
  gap: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.radar-stage[hidden] { display: none; }

.chart-stage[hidden] { display: none; }
.chart-jacket-frame { position: relative; width: min(100%, 240px); overflow: hidden; border: 1px solid #4a3442; }
.chart-jacket-frame img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #111019; }
.chart-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,255,255,.035) 5px 6px);
}

.chart-data { align-self: end; min-width: 0; }
.chart-data-label { margin: 0 0 8px; color: var(--pink); }
.chart-data h2 { margin: 0; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.25; overflow-wrap: anywhere; }
.chart-artist { margin: 7px 0 18px; color: var(--muted); font-size: 12px; }
.chart-spec { display: flex; flex-wrap: wrap; gap: 7px; }
.chart-spec > span {
  padding: 7px 10px;
  border: 1px solid #553042;
  color: #f6bad8;
  background: rgba(240,75,159,.07);
  font: 700 12px/1 var(--display);
  letter-spacing: .06em;
}

.answer-area { min-width: 0; }

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 132px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}

.choice:hover:not(:disabled) { border-color: var(--cyan); background: var(--panel-strong); }
.choice:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.choice:disabled { cursor: default; }

.choice img {
  width: 112px;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
  background: #111019;
}

.choice-copy {
  display: flex;
  min-width: 0;
  padding: 14px;
  align-items: center;
}

.choice-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.choice.is-correct { border-color: var(--green); background: rgba(115,214,168,.1); }
.choice.is-wrong { border-color: var(--danger); background: rgba(238,107,131,.09); }
.choice.is-muted { opacity: .4; }

.choices.is-effector { grid-template-columns: 1fr; }
.choice.choice-effector {
  display: flex;
  min-height: 72px;
  padding: 0 18px;
  align-items: center;
  gap: 16px;
}

.choice-effector .choice-index {
  flex: 0 0 28px;
  color: var(--pink);
  font: 800 18px/1 var(--display);
}

.choice-effector .choice-copy { padding: 13px 0; }
.choice-effector .choice-title { display: block; overflow: visible; font-size: 14px; -webkit-line-clamp: unset; }

.answer-feedback {
  min-height: 58px;
  margin: 12px 0 8px;
  padding-left: 12px;
  border-left: 2px solid transparent;
  font-size: 12px;
  line-height: 1.6;
}

.answer-feedback.is-correct { border-color: var(--green); color: var(--green); }
.answer-feedback.is-wrong { border-color: var(--danger); color: #f392a5; }
.answer-feedback strong { display: block; color: var(--text); font-size: 14px; }

.next-button {
  display: none;
  width: 100%;
  height: 48px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  color: var(--bg);
  background: var(--text);
}

.next-button.is-visible { display: flex; }
.next-button:hover { background: var(--cyan); }

.result-screen { padding-top: 48px; text-align: center; }
.result-screen h1 { margin: 0; font-size: 24px; }

.score-ring {
  display: flex;
  width: 190px;
  height: 190px;
  margin: 24px auto 30px;
  padding-top: 44px;
  align-items: baseline;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-family: var(--display);
}

.score-ring span { font-size: 78px; font-weight: 800; line-height: 1; }
.score-ring small { color: var(--muted); font-size: 22px; }
.result-actions { display: flex; justify-content: center; gap: 10px; }

.secondary-button {
  min-width: 190px;
  height: 50px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: transparent;
}

.secondary-button:hover { border-color: #6a6372; }

footer {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
  color: #77717f;
  font-size: 9px;
}

@media (max-width: 980px) {
  .quiz-layout { grid-template-columns: 1fr; }
  .radar-stage { min-height: 366px; }
  .radar-chart { width: min(100%, 340px); }
  .chart-stage { min-height: 0; grid-template-columns: minmax(160px, 230px) 1fr; grid-template-rows: none; align-items: end; }
}

@media (max-width: 640px) {
  .site-header,
  main,
  footer { width: min(100% - 28px, 1120px); }

  .site-header { height: 56px; }
  .brand-mark { width: 32px; height: 32px; font-size: 12px; }
  .brand strong { font-size: 16px; }

  .screen { min-height: calc(100vh - 104px); padding: 20px 0 32px; }
  .mode-grid { grid-template-columns: 1fr; gap: 8px; }
  .mode-card { grid-template-columns: 82px 1fr 18px; min-height: 118px; padding: 14px; gap: 14px; }
  .mode-visual { width: 82px; height: 82px; }
  .radar-mini svg { width: 62px; height: 62px; }
  .credit-mini { padding: 11px; }
  .credit-mini strong { font-size: 23px; }
  .mode-card-copy { gap: 5px; }
  .mode-card-copy strong { font-size: 16px; }
  .mode-card-copy > span:last-child { font-size: 10px; }
  .filter-panel { padding: 18px 14px; }
  .panel-heading { padding-bottom: 14px; }
  .panel-heading h1 { font-size: 17px; }
  .level-grid { grid-template-columns: repeat(6, 1fr); }
  .decimal-grid { grid-template-columns: repeat(5, 1fr); }
  .detail-filter { padding: 14px; }

  .start-row { display: block; }
  .validation-message { min-height: 24px; }
  .primary-button { width: 100%; }

  .quiz-screen { padding-top: 10px; }
  .quiz-topline h1 { font-size: 23px; }
  .progress-copy strong { font-size: 26px; }
  .progress-track { margin: 7px 0 9px; }
  .quiz-layout { gap: 8px; }

  .radar-stage { min-height: 290px; padding: 8px; }
  .radar-chart { width: min(100%, 272px); }
  .radar-label { font-size: 15px; stroke-width: 4.5px; }

  .chart-stage { grid-template-columns: 108px 1fr; gap: 14px; padding: 14px; }
  .chart-data h2 { font-size: 18px; }
  .chart-artist { margin: 5px 0 10px; font-size: 10px; }
  .chart-spec > span { padding: 6px 8px; font-size: 10px; }

  .choices { grid-template-columns: 1fr 1fr; gap: 6px; }
  .choice { grid-template-columns: 72px 1fr; min-height: 86px; }
  .choice img { width: 72px; min-height: 86px; }
  .choice-copy { padding: 8px 9px; }
  .choice-title { font-size: 13px; line-height: 1.35; -webkit-line-clamp: 4; }
  .choice.choice-effector { min-height: 58px; padding: 0 12px; }
  .choice-effector .choice-copy { padding: 10px 0; }
  .answer-feedback { min-height: 50px; margin-top: 10px; }

  .result-screen { padding-top: 36px; }
  .result-actions { flex-direction: column; }
  .result-actions .primary-button,
  .secondary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
