:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f9f8ff;
  background: #15131e;
  --accent: #e0ff55;
  --surface: #242133;
  --muted: #c1b8d0;
  --border: #504962;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
a { color: inherit; }

.site-header, main, footer {
  width: min(100% - 2rem, 36rem);
  margin-inline: auto;
}

.site-header, .quiz-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
}

.site-header { padding: 1.4rem 0 1rem; border-bottom: 1px solid var(--border); }
.brand { color: var(--accent); font-weight: 850; font-size: 1.25rem; }
.header-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.header-controls select, .practice-setting select {
  min-height: 2.75rem;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--surface);
  color: inherit;
  font: inherit;
}
.deck-label, .question-number { color: var(--muted); font-size: .875rem; }
main { padding-block: clamp(1.6rem, 6vw, 3.5rem) 1rem; }
.practice { padding-block-start: 1.25rem; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.4rem); line-height: 1; letter-spacing: -.06em; }
.quiz-heading { margin-bottom: 1rem; }
.practice-settings { display: grid; gap: .65rem; margin-top: 1.25rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.practice-setting { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.practice-setting label { cursor: pointer; font-weight: 750; }
.practice-setting input { accent-color: var(--accent); }
#advanced-hint { color: var(--muted); font-size: .875rem; }
.question-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
#correct-status { color: var(--accent); font-weight: 800; }
#correct-status:empty { margin-inline-end: -.5rem; }
:is(:lang(ja), :lang(ko), :lang(zh)) h1 { letter-spacing: normal; }

.weapon-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(8.5rem, 30vw, 13rem);
  border: 1px solid #55438a;
  border-radius: 1.25rem;
  background: radial-gradient(ellipse, #594395, #30244e 70%);
}

img { display: block; object-fit: contain; image-rendering: pixelated; }
.weapon-panel img { width: clamp(6rem, 24vw, 9rem); aspect-ratio: 1; }
.weapon-name {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: .4rem .75rem;
  border-radius: 0 0 1.2rem 1.2rem;
  background: #15131ee8;
  text-align: center;
  font-weight: 750;
}
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .75rem; }
.choice {
  display: grid;
  place-items: center;
  padding: .55rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.choice:hover { background: #342d48; border-color: #ab9cc4; }
.choice-name { min-height: 3.5rem; color: inherit; overflow-wrap: anywhere; }
.choice img { width: clamp(3.25rem, 14vw, 5rem); aspect-ratio: 1; }

.review {
  margin-top: .75rem;
  padding: .9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}
.result {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3.5rem;
  margin: 0 0 .75rem;
  padding: .55rem .75rem;
  border-radius: .65rem;
  background: #ffafbd;
  color: #3c0b19;
  font-size: 1.375rem;
  font-weight: 850;
}
.result[data-correct="true"] {
  background: var(--accent);
  color: #202600;
}
.result-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 2rem;
  height: 2rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
}
.loadout {
  border-block: 1px solid var(--border);
  padding: .5rem 0 .75rem;
}
.loadout-item {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
}
:lang(ja) .loadout-item { grid-template-columns: 5rem minmax(0, 1fr); }
.loadout-item > div {
  display: grid;
  grid-template-columns: clamp(3.25rem, 15vw, 5rem) minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: .55rem;
}
.loadout span { color: var(--muted); font-size: .875rem; }
.loadout img { max-width: 100%; aspect-ratio: 1; }
.loadout-item:first-child img { width: 5rem; }
.loadout-item:last-child img { width: 3.25rem; }
.next {
  width: 100%;
  min-height: 2.75rem;
  margin-top: .75rem;
  border: 0;
  border-radius: .7rem;
  background: var(--accent);
  color: #202600;
  font-weight: 800;
}
.next:hover { background: #efffa4; }
.progress {
  margin-top: 1.25rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
}
.progress h2 { margin: 0; font-size: 1rem; }
.recall-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-top: .65rem; }
.recall-score strong { color: var(--accent); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.score-pending { color: var(--muted); font-size: .875rem; margin: .25rem 0 0; }
.progress dl { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .65rem 0 0; }
.progress dt { color: var(--muted); font-size: .875rem; }
.progress dd { margin: .2rem 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.weapon-stats summary { cursor: pointer; font-weight: 800; }
.weapon-stats p { margin: .65rem 0 0; }
.weapon-stats table { width: 100%; border-collapse: collapse; margin-top: .65rem; font-size: .875rem; }
.weapon-stats th, .weapon-stats td { padding: .45rem .2rem; border-bottom: 1px solid var(--border); }
.weapon-stats thead { color: var(--muted); }
.weapon-stats th:first-child { text-align: left; overflow-wrap: anywhere; }
.weapon-stats td { text-align: center; font-variant-numeric: tabular-nums; }
footer { color: var(--muted); font-size: .8125rem; display: flex; gap: .5rem 1rem; flex-wrap: wrap; padding: .5rem 0 1.4rem; }
.fan-site-notice { flex-basis: 100%; margin: 0; }

.reference-search { display: grid; gap: .4rem; margin-top: 1.2rem; }
.reference-search input {
  width: 100%;
  min-height: 2.75rem;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--surface);
  color: inherit;
  font: inherit;
}
#reference-count { color: var(--muted); }
.reference-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.reference-table th, .reference-table td {
  padding: .65rem .35rem;
  border-bottom: 2px solid #746985;
  text-align: left;
  overflow-wrap: anywhere;
}
.reference-table thead th { color: var(--muted); font-size: .875rem; }
.reference-table th:first-child { width: 38%; }
.reference-item { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .55rem; font-size: .875rem; }
.reference-item img { flex: none; width: 2.5rem; height: 2.5rem; }
.reference-item img[src$="/suminagasheet.png"],
.reference-item img[src$="/ultra_chakuchi.png"] { padding: .2rem; }
