/* リカイド スタイル — 明るいポップ系・モバイルファースト */
:root {
  --ink: #3d2e2a;
  --muted: #9a837b;
  --bg: #fff6ec;
  --card: #ffffff;
  --line: #ffe7da;
  --accent: #ff5e7e;
  --accent2: #ff9d5c;
  --grad: linear-gradient(135deg, #ff5e7e, #ff9d5c);
  --ok: #22c55e;
  --ng: #e11d48;
  --track: #ffe3d0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.7;
  min-height: 100vh;
}
.bg-blob {
  position: fixed; border-radius: 50%; filter: blur(70px); opacity: .35; z-index: 0; pointer-events: none;
}
.blob1 { width: 340px; height: 340px; background: #ffc9d8; top: -80px; right: -100px; }
.blob2 { width: 300px; height: 300px; background: #ffe0b8; bottom: -60px; left: -110px; }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 0 14px 40px; }
.topbar { display: flex; justify-content: center; padding: 14px 0 10px; }
.logo { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; text-decoration: none; color: var(--ink); }
.logo-cat { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 2px 10px rgba(255, 94, 126, .25); }

/* ワードマーク: 「リカイド」の濁点を♡に */
.wordmark { font-weight: 900; font-size: 21px; letter-spacing: .06em; line-height: 1.2; }
.wm-do { position: relative; display: inline-block; margin-right: .5em; }
.wm-hearts {
  position: absolute; top: -.36em; right: -.66em;
  font-size: .52em; letter-spacing: -.22em; color: var(--accent);
  transform: rotate(-14deg); white-space: nowrap; pointer-events: none;
}
.hero-cat {
  width: 92px; height: 92px; border-radius: 24px; margin: 0 auto 12px; display: block;
  box-shadow: 0 8px 22px rgba(255, 94, 126, .22);
}
.hero-mark { display: block; font-size: 38px; margin-bottom: 10px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 26px; }
.foot p { margin: 0; }
.foot-links { margin-top: 4px; opacity: .85; }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

.screen { display: none; }
.screen.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: 0 8px 28px rgba(255, 94, 126, .08);
}
.card h2 { font-size: 17px; font-weight: 900; margin-bottom: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
.sub { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.note { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* ボタン */
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none; text-align: center;
  font-family: inherit; font-weight: 900; font-size: 16px; color: #fff;
  border-radius: 999px; padding: 14px 22px; transition: transform .12s ease, box-shadow .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--grad); box-shadow: 0 8px 20px rgba(255, 94, 126, .35); }
.btn.big { display: block; width: 100%; padding: 16px 20px; font-size: 17px; margin-top: 6px; }
.btn.sub-btn { background: #fff; color: var(--accent); border: 2px solid var(--accent); font-size: 14px; padding: 10px 20px; margin-top: 10px; }
.btn.line { background: #06c755; }
.btn.xshare { background: #111; }
.share-row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.share-row .btn { flex: 1; font-size: 14px; padding: 12px 8px; }
.ghost-btn {
  background: none; border: none; color: var(--muted); font-family: inherit; font-size: 13.5px;
  cursor: pointer; margin-top: 14px; display: inline-block; text-decoration: underline; text-underline-offset: 3px;
}
.ghost-btn.swap { color: var(--accent2); font-weight: 700; margin-top: 12px; }

/* トップ */
.hero { text-align: center; padding: 28px 20px 26px; }
.hero-title { font-size: 22px; font-weight: 900; line-height: 1.5; margin-bottom: 10px; }
.hero-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 18px; }
.chip {
  display: inline-block; font-size: 12.5px; font-weight: 700; padding: 4px 12px;
  border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
}
/* 累計カウンター */
.stat-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.stat {
  background: #fff4ec; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 8px 18px; display: flex; flex-direction: column; align-items: center; min-width: 8em;
}
.stat b { font-size: 20px; font-weight: 900; color: var(--accent); line-height: 1.25; }
.stat b small { font-size: 12px; font-weight: 700; margin-left: 1px; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 700; }

.how { padding-left: 22px; }
.how li { margin-bottom: 6px; font-size: 14px; }
.my-quiz-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 8px;
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14.5px;
}
.my-quiz-go { color: var(--accent); font-size: 13px; white-space: nowrap; }

/* つくった人のほかのコンテンツ */
.promo-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 8px;
  text-decoration: none; color: var(--ink); background: #fffdfb;
  transition: transform .1s ease;
}
.promo-row:last-child { margin-bottom: 0; }
.promo-row:active { transform: scale(.98); }
.promo-icon { font-size: 24px; }
.promo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.promo-body b { font-size: 14px; font-weight: 900; }
.promo-body span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.promo-go { color: var(--accent); font-weight: 900; }

/* 名前入力 */
#inp-name {
  width: 100%; font-family: inherit; font-size: 17px; font-weight: 700; text-align: center;
  padding: 14px; border: 2.5px solid var(--line); border-radius: 16px; margin-bottom: 14px;
  outline: none; background: #fffdfb; color: var(--ink);
}
#inp-name:focus { border-color: var(--accent2); }

/* 問題数選択 */
.count-grid { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.count-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  font-family: inherit; color: var(--ink); background: #fffdfb;
  border: 2.5px solid #ffd9c9; border-radius: 16px; padding: 13px 16px; cursor: pointer;
  transition: transform .1s ease, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.count-btn:active { transform: scale(.97); }
.count-btn b { font-size: 19px; font-weight: 900; width: 3.4em; }
.count-desc { flex: 1; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.count-rec { font-size: 10.5px; font-weight: 900; color: #fff; background: var(--grad); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

/* 広告枠 */
.ad-slot { margin-top: 4px; text-align: center; }
.ad-note { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }

/* クイズ画面 */
.quiz-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.quiz-top .back { margin: 0; font-size: 18px; text-decoration: none; }
.progress { flex: 1; height: 10px; background: var(--track); border-radius: 999px; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: var(--grad); border-radius: 999px; transition: width .25s ease; }
.q-count { font-size: 13px; font-weight: 900; color: var(--muted); white-space: nowrap; }
.q-card { text-align: center; padding-top: 18px; }
.chip.genre { border-width: 1.5px; font-size: 13px; }
.q-for { color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 12px; }
.q-text { font-size: 21px; font-weight: 900; line-height: 1.5; margin: 6px 0 18px; }
.opts { display: flex; flex-direction: column; gap: 4px; }
.opt {
  width: 100%; font-family: inherit; font-size: 17px; font-weight: 700; color: var(--ink);
  background: #fffdfb; border: 2.5px solid #ffd9c9; border-radius: 18px; padding: 18px 14px;
  cursor: pointer; transition: transform .1s ease, border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.opt:active { transform: scale(.97); }
.opt.correct { border-color: var(--ok); background: #eafbf1; }
.opt.wrong { border-color: var(--ng); background: #fdecef; animation: shake .35s ease; }
.opt.dim { opacity: .45; }
.opt:disabled { cursor: default; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.vs { font-size: 12px; font-weight: 900; color: var(--accent); margin: 2px 0; }
.feedback { margin-top: 14px; font-size: 17px; font-weight: 900; animation: popIn .25s ease; }
.feedback.ok { color: var(--ok); }
.feedback.ng { color: var(--ng); }
.combo {
  display: inline-block; margin-top: 8px; padding: 4px 14px; border-radius: 999px;
  background: var(--grad); color: #fff; font-size: 13px; font-weight: 900; animation: popIn .25s ease;
}
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* シェア */
.big-emoji { font-size: 46px; margin-bottom: 6px; }
.link-box {
  background: #fff4ec; border: 2px dashed #ffc9ab; border-radius: 14px; padding: 10px 12px;
  font-size: 12.5px; word-break: break-all; user-select: all; color: #7a5c4e;
}
.test-banner {
  background: #fff3c4; color: #8a6d00; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; margin-bottom: 12px;
}

/* 挑戦者ランディング */
.intro-lead { color: var(--accent); font-weight: 900; font-size: 13px; letter-spacing: .1em; }
.intro-name-line { font-size: 22px; font-weight: 900; line-height: 1.55; margin: 8px 0 10px; }

/* 結果 */
.res-lead { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.score-circle {
  width: 168px; height: 168px; border-radius: 50%; margin: 0 auto 14px;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), var(--track) 0);
  display: flex; align-items: center; justify-content: center;
}
.score-inner {
  width: 136px; height: 136px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-num { font-size: 40px; font-weight: 900; line-height: 1.1; }
.score-total { font-size: 16px; color: var(--muted); margin-left: 2px; }
.score-pct { font-size: 14px; font-weight: 900; color: var(--accent); }
.res-title { font-size: 24px; font-weight: 900; margin-bottom: 4px; }
.best-callout {
  display: inline-block; margin-top: 8px; padding: 8px 18px; border-radius: 999px;
  background: #fff1e6; border: 1.5px solid #ffc9ab; font-weight: 900; font-size: 14.5px;
}

/* レーダーチャート＋平均比較 */
.radar-wrap svg { display: block; width: 100%; max-width: 340px; margin: 0 auto; height: auto; }
.radar-legend { display: flex; gap: 16px; justify-content: center; margin: 4px 0 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); flex-wrap: wrap; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.cmp-head, .cmp-row { display: flex; align-items: center; gap: 8px; }
.cmp-head { font-size: 11px; color: var(--muted); font-weight: 700; }
.cmp-row { padding: 8px 0; border-top: 1px dashed var(--line); font-size: 13.5px; }
.cmp-label { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-val { width: 4.2em; text-align: right; font-weight: 900; }
.cmp-avg { width: 3.6em; text-align: right; font-weight: 700; color: var(--muted); }
.cmp-badge, .cmp-badge-slot { width: 4.4em; text-align: center; flex-shrink: 0; }
.cmp-badge { font-size: 11.5px; font-weight: 900; border-radius: 999px; padding: 3px 0; }
.cmp-badge.up { background: #ffe1e8; color: #e0335c; }
.cmp-badge.down { background: #e8eef3; color: #5c7a8f; }
.cmp-badge.even { background: #fff1e0; color: #a67c52; }

/* ジャンルバー */
.genre-bars { display: flex; flex-direction: column; gap: 10px; }
.gb-row { display: flex; align-items: center; gap: 10px; }
.gb-label { width: 8.5em; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-track { flex: 1; height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.gb-fill { height: 100%; border-radius: 999px; }
.gb-val { width: 3.4em; text-align: right; font-size: 12.5px; font-weight: 900; color: var(--muted); white-space: nowrap; }
.insight { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

/* ランキング */
.board-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; margin-bottom: 4px; font-size: 14.5px;
}
.board-row.me { background: #fff1e6; border: 1.5px solid #ffc9ab; }
.board-rank { width: 2.2em; text-align: center; font-weight: 900; font-size: 15px; }
.board-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-score { font-weight: 900; white-space: nowrap; }
.board-score small { color: var(--muted); font-weight: 700; margin-left: 4px; }
.board-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 10px 0; }

.dash-count { color: var(--accent); font-weight: 900; font-size: 16px; }

/* NEWバナー */
.news-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid #ffc9ab; border-radius: 16px;
  padding: 12px 14px; margin-bottom: 14px; text-decoration: none; color: var(--ink);
  font-size: 13px; font-weight: 700; box-shadow: 0 6px 20px rgba(255, 94, 126, .10);
}
.news-badge { background: var(--grad); color: #fff; font-size: 10.5px; font-weight: 900; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

/* みんなの2択統計 */
.stats-title { font-size: 23px; font-weight: 900; margin-bottom: 8px; }
.stats-chips { margin-top: 10px; }
.stats-chips .chip { cursor: pointer; font-weight: 900; font-family: inherit; }
.stats-chips .chip.active { background: var(--grad); border-color: transparent; color: #fff; }
.stat-q { padding: 13px 0; border-top: 1px dashed var(--line); }
.stat-q:first-child { border-top: none; padding-top: 2px; }
.stat-q-text { font-weight: 900; font-size: 14.5px; margin-bottom: 8px; }
.vs-labels { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
.vs-labels .win-a { color: var(--accent); font-weight: 900; }
.vs-labels .win-b { color: #3b82f6; font-weight: 900; }
.vs-labels .lose { color: var(--muted); }
.vs-labels .even-side { color: #a67c52; font-weight: 900; }
.vs-bar { display: flex; height: 13px; border-radius: 999px; overflow: hidden; background: var(--track); }
.vs-a { background: var(--accent); }
.vs-b { background: #3b82f6; border-left: 2px solid #fff; }
.stat-n { text-align: right; font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* 挑戦ログ（管理用） */
.log-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-top: 1px dashed var(--line); text-decoration: none; color: var(--ink);
}
.log-when { width: 6.8em; font-size: 11.5px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.log-who { flex: 1; font-size: 13.5px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-score { font-weight: 900; font-size: 13.5px; white-space: nowrap; }
.log-badge { font-size: 11px; font-weight: 900; color: var(--accent); background: #ffe9ef; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chart-wrap svg { display: block; width: 100%; height: auto; }

/* スピナー */
.spinner {
  width: 42px; height: 42px; margin: 10px auto 14px; border-radius: 50%;
  border: 5px solid var(--track); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 560px) {
  body { font-size: 16px; }
  .hero-title { font-size: 25px; }
  .hero-mark { font-size: 44px; }
  .q-text { font-size: 23px; }
}
