/* ===== 色やサイズの設定（ここを変えると全体の雰囲気が変わります） ===== */
:root {
  --bg: #000;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --text: #f5f5f7;
  --muted: #86868b;
  --lime: #c6ff3d;
  --lime-dim: rgba(198, 255, 61, 0.14);
  --red: #ff5a5f;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Hiragino Sans",
          "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 背景：ぼんやり漂う光（煙のイメージ） ===== */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg::after { /* 上下を黒く締める */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #000 0%, transparent 25%, transparent 70%, #000 100%);
}
.glow {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .55;
  animation: drift 18s ease-in-out infinite alternate;
}
.g1 { width: 520px; height: 520px; top: -160px; left: -120px;
      background: radial-gradient(circle, rgba(198,255,61,.35), transparent 70%); }
.g2 { width: 460px; height: 460px; bottom: -140px; right: -100px;
      background: radial-gradient(circle, rgba(120,120,140,.45), transparent 70%);
      animation-duration: 22s; }
.g3 { width: 360px; height: 360px; top: 40%; left: 55%;
      background: radial-gradient(circle, rgba(80,200,160,.18), transparent 70%);
      animation-duration: 26s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-40px, 80px) scale(.95); }
}

/* ===== ヘッダー ===== */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; max-width: 760px; width: 100%; margin: 0 auto;
}
.logo { font-weight: 700; letter-spacing: .12em; font-size: 15px; }
.logo .dot { color: var(--lime); }

.timer {
  position: relative; width: 64px; height: 64px;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px;
}
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: rgba(255,255,255,.08); }
.ring-fg {
  stroke: var(--lime); stroke-linecap: round;
  stroke-dasharray: 119.38; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .3s;
  filter: drop-shadow(0 0 6px rgba(198,255,61,.6));
}
.top-right { display: flex; align-items: center; gap: 12px; }
.btn.end {
  font-size: 14px; padding: 10px 18px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.btn.end:hover { border-color: var(--lime); color: var(--lime); }
.btn[hidden] { display: none; }

/* ===== メイン ===== */
.stage {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 24px 24px 40px; display: flex; align-items: center;
}
.screen { display: none; width: 100%; }
.screen.active { display: block; animation: fadeUp .6s cubic-bezier(.2,.8,.2,1); }

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

.eyebrow {
  color: var(--lime); font-size: 13px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px;
}
.headline {
  font-size: clamp(40px, 9vw, 72px); line-height: 1.08;
  font-weight: 700; letter-spacing: -.02em; margin-bottom: 20px;
}
.accent {
  background: linear-gradient(90deg, var(--lime), #7dffb3 60%, #e8ffc0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); font-size: 17px; line-height: 1.7; margin-bottom: 36px; }

/* ===== ボタン ===== */
.btn {
  font: inherit; font-size: 17px; font-weight: 600;
  border: none; border-radius: 999px; padding: 14px 34px; cursor: pointer;
  transition: transform .2s, box-shadow .3s, background .3s;
}
.btn.primary {
  background: var(--lime); color: #0a0a0a;
  box-shadow: 0 0 0 0 rgba(198,255,61,.5);
  animation: pulse 2.6s ease-in-out infinite;
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(198,255,61,.35); }
.btn:active { transform: scale(.97); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198,255,61,.35); }
  50%      { box-shadow: 0 0 0 12px rgba(198,255,61,0); }
}

/* ===== クイズ ===== */
.quiz-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 14px;
}
.quiz-head .eyebrow { margin-bottom: 0; }
.tally {
  font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
}
.tally.bump { animation: bump .5s; }
@keyframes bump {
  40% { transform: scale(1.12); color: var(--lime); border-color: var(--lime); }
}

.question {
  font-size: clamp(22px, 4.6vw, 32px); line-height: 1.45;
  font-weight: 700; margin-bottom: 28px;
}

.choices { display: grid; gap: 12px; }
.choice {
  font: inherit; color: var(--text); text-align: left; font-size: 17px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: background .25s, border-color .25s, transform .2s, opacity .3s;
}
.choice:hover:not(:disabled) { background: var(--surface-hover); transform: translateX(4px); }
.choice .key {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  border: 1px solid var(--border); color: var(--muted);
}
.choice:disabled { cursor: default; }
.choice.correct { border-color: var(--lime); background: var(--lime-dim); }
.choice.correct .key { background: var(--lime); color: #000; border-color: var(--lime); }
.choice.wrong { border-color: var(--red); background: rgba(255,90,95,.12); animation: shake .4s; }
.choice.dim { opacity: .35; }

@keyframes shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ===== 解説 ===== */
.explain {
  display: none; margin-top: 22px; padding: 22px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.explain.show { display: block; animation: fadeUp .5s cubic-bezier(.2,.8,.2,1); }
.verdict { font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.verdict.ok { color: var(--lime); }
.verdict.ng { color: var(--red); }
.explain-text { color: #d2d2d7; line-height: 1.8; font-size: 15px; margin-bottom: 20px; }

/* ===== 結果 ===== */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 28px;
}
.stat {
  padding: 20px 18px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
}
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value {
  font-size: clamp(30px, 7vw, 48px); font-weight: 700; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-value small { font-size: .45em; color: var(--muted); -webkit-text-fill-color: var(--muted); }

.foot { text-align: center; color: #48484a; font-size: 12px; padding: 20px; }

/* スマホ向けの微調整 */
@media (max-width: 480px) {
  .topbar { padding: 16px; }
  .stage { padding: 16px 16px 32px; }
  .timer { width: 56px; height: 56px; font-size: 14px; }
  .btn.end { padding: 9px 14px; font-size: 13px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:first-child { grid-column: 1 / -1; }
}

/* 動きを減らす設定の人への配慮 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
