/* =========================================================
  Mobile-first / シンプルで学習に集中できるUI
========================================================= */

:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);

  --primary: #4f8cff;
  --primary-hover: #2f74ff;

  --ok: #35d07f;
  --ng: #ff5a6a;

  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: radial-gradient(1200px 700px at 20% 0%, rgba(79,140,255,.22), transparent 55%),
              radial-gradient(900px 600px at 90% 10%, rgba(53,208,127,.16), transparent 60%),
              var(--bg);
  color: var(--text);
}

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(10px);
  text-align: center;
}
.brand {
  font-weight: 800;
  letter-spacing: .02em;
}

.main {
  display: grid;
  place-items: center;
  padding: 18px;
}

.footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.10);
  text-align: center;
}

.card {
  width: min(760px, 100%);
  margin: 0 auto;
  background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.05));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 18px;
}

.title {
  margin: 8px 0 12px;
  font-size: clamp(22px, 3.8vw, 34px);
  line-height: 1.15;
}

.lead {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.muted { color: var(--muted); }
.note { margin-top: 12px; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.actions-split {
  justify-content: space-between;
  align-items: center;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: rgba(255,255,255,0.10); }
.btn:active { transform: translateY(1px); }
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-primary {
  border-color: rgba(79,140,255,.45);
  background: rgba(79,140,255,.22);
}
.btn-primary:hover { background: rgba(79,140,255,.30); }
.btn-primary:active { background: rgba(79,140,255,.34); }

.btn-ghost {
  background: transparent;
}

/* Screens */
.screen { display: none; width: 100%; }
.screen.is-active { display: block; }

/* Quiz */
.quiz-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.progress {
  width: 100%;
  max-width: 430px;
}
.progressbar {
  height: 10px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progressbar-fill {
  height: 100%;
  width: 0%;
  background: rgba(79,140,255,.9);
}

.score { white-space: nowrap; }

.qblock { margin-top: 10px; }
.qmeta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.qtext {
  margin: 10px 0 14px;
  font-size: clamp(18px, 2.8vw, 22px);
  line-height: 1.6;
}

/* Choices */
.choices {
  display: grid;
  gap: 10px;
}

.choice {
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  padding: 12px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background .15s ease, transform .06s ease, border-color .15s ease;
}
.choice:hover {
  background: rgba(255,255,255,0.10);
}
.choice:active { transform: translateY(1px); }

.choice.is-disabled {
  opacity: .78;
  cursor: not-allowed;
}

.choice.is-correct {
  border-color: rgba(53,208,127,.55);
  background: rgba(53,208,127,.16);
}
.choice.is-wrong {
  border-color: rgba(255,90,106,.55);
  background: rgba(255,90,106,.14);
}

.choice-label {
  font-weight: 900;
  margin-right: 10px;
}
.choice-text { color: var(--text); }

/* Feedback */
.feedback {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  min-height: 0;
}
.feedback.is-hidden { display: none; }

.feedback-title {
  font-weight: 900;
  margin: 0 0 6px;
}
.feedback-title.ok { color: var(--ok); }
.feedback-title.ng { color: var(--ng); }

.explain {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.score-big {
  font-size: 42px;
  line-height: 1.1;
}

/* Mode selector */
.mode-box {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.mode-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  user-select: none;
}

.mode-item:hover {
  background: rgba(255,255,255,0.10);
}

.mode-item input[type="radio"] {
  width: 18px;
  height: 18px;
}

.mode-text {
  display: grid;
  gap: 2px;
}

.mode-title {
  font-weight: 900;
}

.mode-sub {
  font-size: 12px;
  color: var(--muted);
}

.affiliate-links {
  display: grid;
  grid-template-columns: 1fr 1fr; /* PC: 2列 */
  gap: 12px;
  margin-top: 14px;
}

.affiliate-link {
  display: block;
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
  color: inherit;
  text-align: center;
  font-weight: 900;
}

.affiliate-link:hover {
  background: rgba(255,255,255,0.10);
}

/* Mobile: 1列 */
@media (max-width: 560px) {
  .affiliate-links {
    grid-template-columns: 1fr;
  }
}

