:root {
  --paper: #f7f3ea;
  --paper-deep: #efe8da;
  --ink: #172033;
  --ink-soft: #475569;
  --muted: #7c8798;
  --line: #e3dccd;
  --card: #fffdf8;
  --navy: #14213d;
  --navy-2: #1e2f52;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --teal: #0f766e;
  --blue: #2563eb;
  --rose: #be123c;
  --green: #15803d;
  --red: #b91c1c;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08), 0 2px 8px rgba(23, 32, 51, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(217, 119, 6, 0.1), transparent 28%),
    radial-gradient(circle at 94% 8%, rgba(15, 118, 110, 0.1), transparent 26%),
    var(--paper);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", "Meiryo", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
}

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 0 0 10px 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

:where(button, select, summary, a):focus-visible {
  outline: 3px solid rgba(217, 119, 6, 0.45);
  outline-offset: 2px;
}

/* ---------- header ---------- */

.site-header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 0%, rgba(56, 189, 248, 0.16), transparent 34%),
    radial-gradient(circle at 8% 100%, rgba(245, 158, 11, 0.2), transparent 38%),
    linear-gradient(135deg, #14213d 0%, #1b2b4d 55%, #1e3a5f 100%);
  border-bottom: 3px solid var(--accent);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0,
    transparent 22px,
    rgba(255, 255, 255, 0.05) 22px,
    rgba(255, 255, 255, 0.05) 23px
  );
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 16px;
  color: var(--navy);
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 8px 20px rgba(0, 0, 0, 0.22);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 31px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.brand-text h1 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.brand-text p {
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.header-stats {
  display: flex;
  gap: 8px;
}

.header-stat {
  min-width: 78px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  backdrop-filter: blur(4px);
}

.header-stat span {
  display: block;
  color: #fde68a;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.header-stat small {
  display: block;
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---------- controls ---------- */

.app {
  padding: 26px 0 52px;
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.mode-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #ded5c4;
  border-radius: 999px;
  background: #e9e1d2;
}

.mode-tab {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b5563;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.mode-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.mode-tab.is-active {
  color: #fff;
  background: var(--navy);
  box-shadow: 0 5px 14px rgba(20, 33, 61, 0.22);
}

.control-right {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.segmented button {
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease;
}

.segmented button:hover:not(.is-active) {
  background: #f8fafc;
  color: var(--ink);
}

.segmented button.is-active {
  color: #92400e;
  background: #fff3d6;
  box-shadow: inset 0 0 0 1px #f3d39a;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: #64748b;
  font-size: 12px;
}

.select-wrap > span {
  font-weight: 700;
  white-space: nowrap;
}

.select-wrap select {
  max-width: 142px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.icon-button:hover {
  border-color: #d6b98c;
  background: #fff7e6;
  transform: translateY(-1px);
}

/* ---------- quiz layout ---------- */

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.quiz-card {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.quiz-card.is-entering {
  animation: cardIn 0.35s ease both;
}

@keyframes cardIn {
  from {
    opacity: 0.62;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-topline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pill--ghost {
  border: 1px solid #f5e2b8;
  background: #fff8e7;
  color: #92400e;
}

.question-head h2 {
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.question-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.chart-shell {
  margin: 20px 0 18px;
  padding: 12px;
  border: 1px solid #e3eaf1;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f8fafc);
}

.chart-area {
  min-height: 0;
}

.chart-area svg,
.chart-choice__graph svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-area svg {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.chart-shell--target {
  border-color: #243b63;
  background:
    radial-gradient(circle at 82% 18%, rgba(56, 189, 248, 0.18), transparent 34%),
    linear-gradient(135deg, #14213d, #1e3a5f);
}

.target-card {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 220px;
  padding: 20px 24px;
  color: #fff;
}

.target-card__globe {
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  flex: none;
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 50%;
  color: #fbbf24;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.03);
}

.target-card__globe svg {
  width: 58px;
  height: 58px;
}

.target-card__kicker {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.target-card__name {
  margin: 4px 0 2px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.target-card__place {
  color: #e2e8f0;
  font-size: 14px;
}

.target-card__place span {
  color: #94a3b8;
}

.target-card__meta {
  margin-top: 7px;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.chart-svg {
  overflow: visible;
  font-family: inherit;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  color: #000;
  font-size: 11px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-bar {
  width: 14px;
  height: 10px;
  border-radius: 0;
  background: #000;
}

.legend-line {
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 0;
  background: #000;
}

.legend-line::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -3px;
  width: 7px;
  height: 7px;
  border: 2px solid #000;
  border-radius: 0;
  background: #fff;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border: 2px solid #000;
  border-radius: 0;
  background: #000;
}

.legend-loop {
  width: 18px;
  height: 10px;
  border: 2px solid #000;
  border-radius: 0;
}

/* ---------- answers ---------- */

.answer-area {
  margin-top: 2px;
}

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

.answer-grid--cities {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answer-grid--charts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answer-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 14px 14px 12px 42px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.answer-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #fffbeb;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.12);
  transform: translateY(-1px);
}

.choice-key {
  position: absolute;
  top: 13px;
  left: 13px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.answer-button .choice-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.answer-button .choice-country {
  color: var(--muted);
  font-size: 11px;
}

.answer-button.is-correct,
.chart-choice.is-correct {
  border-color: #16a34a;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.answer-button.is-wrong,
.chart-choice.is-wrong {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.answer-button.is-correct .choice-key {
  background: #16a34a;
  color: #fff;
}

.answer-button.is-wrong .choice-key {
  background: #dc2626;
  color: #fff;
}

.chart-choice {
  position: relative;
  padding: 10px 8px 6px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.chart-choice:hover:not(:disabled) {
  border-color: var(--teal);
  background: #f7fffd;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.chart-choice .choice-key {
  z-index: 2;
  top: 8px;
  left: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
}

.chart-choice__graph {
  display: block;
  width: 100%;
}

.chart-choice.is-correct .choice-key {
  background: #16a34a;
  color: #fff;
}

.chart-choice.is-wrong .choice-key {
  background: #dc2626;
  color: #fff;
}

/* ---------- climate select ---------- */

.climate-answer {
  padding: 18px;
  border: 1px solid #e3eaf1;
  border-radius: 16px;
  background: #f8fafc;
}

.climate-label {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.select-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.climate-select {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.climate-select.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.climate-select.is-locked {
  background: #f1f5f9;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(180, 83, 9, 0.22);
  transition: filter 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.primary-button:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.primary-button .key-hint {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- feedback ---------- */

.feedback {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid;
  border-radius: 18px;
  animation: feedbackIn 0.3s ease both;
}

@keyframes feedbackIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback.is-correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.feedback.is-wrong {
  border-color: #fed7aa;
  background: #fff7ed;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feedback-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.is-correct .feedback-icon {
  background: #16a34a;
}

.is-wrong .feedback-icon {
  background: #ea580c;
}

.feedback-head h3 {
  font-size: 20px;
  line-height: 1.3;
}

.correct-answer {
  margin-top: 2px;
  color: #334155;
  font-size: 14px;
}

.correct-answer b {
  color: #0f172a;
  font-size: 18px;
}

.answer-city {
  color: var(--muted);
  font-size: 12px;
}

.selected-note {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #9a3412;
  font-size: 13px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.fact-grid > div {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.fact-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.fact-grid strong {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
}

.fact-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.fact-small {
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

.code-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  background: color-mix(in srgb, var(--group-color) 12%, white);
  color: var(--group-color);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.boundary-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
}

.climate-summary {
  margin-top: 12px;
  color: #475569;
  font-size: 12px;
}

.data-details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.data-details summary {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

.month-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  border-radius: 10px;
  background: #fff;
  font-size: 11px;
  overflow: hidden;
}

.month-table th,
.month-table td {
  padding: 6px 7px;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
  white-space: nowrap;
}

.month-table thead th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
}

.month-table .row-label {
  position: sticky;
  left: 0;
  background: #f8fafc;
  color: #475569;
  text-align: left;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ---------- side panel ---------- */

.side-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.panel h2 {
  color: #334155;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.panel-kicker {
  color: var(--muted);
  font-size: 10px;
}

.big-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.big-stats > div {
  padding: 10px 6px;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.big-stats strong {
  display: block;
  color: var(--navy);
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.big-stats span {
  color: var(--muted);
  font-size: 10px;
}

.streak-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
}

.streak-row strong {
  color: #b45309;
  font-size: 20px;
  line-height: 1;
}

.streak-row .muted {
  margin-left: auto;
  color: #a16207;
  font-size: 10px;
}

.mode-breakdown {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 4px 8px;
  align-items: center;
}

.breakdown-label {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: #475569;
  font-size: 10px;
}

.breakdown-label small {
  color: var(--muted);
}

.breakdown-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.breakdown-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  transition: width 0.4s ease;
}

.breakdown-pct {
  color: #475569;
  font-size: 10px;
  text-align: right;
}

.text-button {
  margin-top: 14px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
}

.tips-panel h3 {
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
}

.tip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 16px;
  color: #475569;
  font-size: 11px;
}

.tip-list li::marker {
  color: var(--accent);
}

.tip-note {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #ccfbf1;
  border-radius: 10px;
  background: #f0fdfa;
  color: var(--teal);
  font-size: 11px;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.footer-brand span {
  color: #b45309;
}

.site-footer .muted {
  max-width: 760px;
  font-size: 10px;
}

.muted {
  color: var(--muted);
}

/* ---------- help dialog ---------- */

.help-dialog {
  width: 100%;
  max-width: min(940px, calc(100% - 32px));
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
}

.help-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.help-dialog__inner {
  max-height: 88vh;
  padding: 26px;
  overflow: auto;
}

.help-dialog__head {
  position: sticky;
  top: -26px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: -26px -26px 18px;
  padding: 26px 26px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: var(--card);
}

.eyebrow {
  color: #b45309;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.help-dialog h2 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 26px;
  letter-spacing: 0.04em;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 26px;
}

.help-grid section {
  min-width: 0;
}

.help-grid h3 {
  margin-bottom: 7px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 13px;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding-left: 17px;
  color: #475569;
  font-size: 11.5px;
}

.help-class-section {
  grid-column: 1 / -1;
}

#help-class-table {
  max-height: 310px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.class-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.class-table th,
.class-table td {
  padding: 5px 7px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.class-table th {
  color: #64748b;
  font-size: 10px;
}

.class-table td:last-child,
.class-table th:last-child {
  text-align: right;
}

.help-dialog__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.help-dialog__foot .muted {
  font-size: 11px;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.noscript {
  padding: 20px;
  color: #991b1b;
  text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-stats {
    width: 100%;
  }

  .header-stat {
    flex: 1;
    min-width: 0;
  }

  .control-bar {
    align-items: stretch;
  }

  .mode-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .mode-tab {
    flex: 1;
  }

  .control-right {
    justify-content: space-between;
  }

  .quiz-card {
    padding: 18px;
    border-radius: 20px;
  }

  .answer-grid--cities {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-grid--charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-column {
    grid-template-columns: 1fr;
  }

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

  .help-class-section {
    grid-column: auto;
  }

  .help-dialog__inner {
    padding: 20px;
  }

  .help-dialog__head {
    top: -20px;
    margin: -20px -20px 18px;
    padding: 20px 20px 12px;
  }

  #help-class-table {
    max-height: 240px;
  }
}

@media (max-width: 520px) {
  .brand-text p {
    font-size: 10px;
  }

  .control-right {
    gap: 6px;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .select-wrap {
    flex: 1;
    justify-content: space-between;
  }

  .chart-choice {
    padding: 6px 4px 2px;
  }

  .answer-grid--charts {
    grid-template-columns: 1fr;
  }

  .chart-choice__graph {
    max-width: 300px;
    margin: 0 auto;
  }

  .target-card {
    flex-direction: column;
    gap: 12px;
    padding: 20px 14px;
    text-align: center;
  }

  .target-card__globe {
    width: 72px;
    height: 72px;
  }

  .target-card__globe svg {
    width: 46px;
    height: 46px;
  }

  .select-row {
    flex-direction: column;
  }

  .climate-answer .primary-button {
    width: 100%;
  }

  .feedback {
    padding: 16px;
  }

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

  .help-dialog h2 {
    font-size: 22px;
  }

  .help-dialog__foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
