:root {
  --brand: #d81b72;
  --brand-dark: #a50f55;
  --brand-soft: #ffe6f0;
  --gold: #f0a90e;
  --ink: #2b2230;
  --muted: #7b6f82;
  --bg: #fff7fa;
  --card: #ffffff;
  --line: #f1d6e2;
  --ok: #12805a;
  --miss: #5b5563;
  --radius: 14px;
  --font: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #2a84d6; outline-offset: 2px; }

.inner { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---- ヘッダー ---- */
.site-header { background: linear-gradient(100deg, var(--brand-dark), var(--brand) 55%, #ff7aa8); color: #fff; }
.site-header-main { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo { border: 0; background: none; padding: 0; color: #fff; font-size: 28px; font-weight: 800; letter-spacing: .04em; line-height: 1; display: inline-flex; align-items: center; gap: 4px; }
.logo span { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; background: #fff; color: var(--brand-dark); font-size: .92em; box-shadow: 0 0 0 3px var(--gold); }
.tagline { margin: 0; font-size: 12px; opacity: .9; }
.status { margin: 0 0 0 auto; font-size: 13px; background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 4px 14px; white-space: nowrap; }
.status span { margin-left: 12px; }
.status b { font-size: 16px; font-variant-numeric: tabular-nums; }

.site-nav { background: #fff; border-bottom: 3px solid var(--gold); }
.site-nav .inner { display: flex; gap: 4px; overflow-x: auto; }
.site-nav button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -3px; white-space: nowrap; }
.site-nav button[aria-current] { color: var(--brand-dark); border-bottom-color: var(--brand); }

main.inner { padding-top: 18px; padding-bottom: 48px; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0 28px; }
.site-footer p { margin: 0 0 4px; }
.site-footer a { color: inherit; }

/* ---- 共通部品 ---- */
.banner { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.banner.is-notice { background: #fffbe8; border-color: #f3dc8a; font-size: 13.5px; display: block; }

.section-title { margin: 0 0 12px; font-size: 19px; display: flex; align-items: baseline; gap: 10px; border-left: 6px solid var(--brand); padding-left: 10px; line-height: 1.3; }
.section-title span { font-size: 13px; color: var(--muted); font-weight: 600; }

.btn { border: 0; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 700; padding: 10px 22px; white-space: nowrap; box-shadow: 0 2px 0 var(--brand-dark); }
.btn:hover { background: var(--brand-dark); }
.btn.is-ghost { background: #fff; color: var(--brand-dark); box-shadow: inset 0 0 0 2px var(--brand); }
.btn.is-ghost:hover { background: var(--brand-soft); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.stars { position: relative; display: inline-block; font-size: 14px; line-height: 1; letter-spacing: 1px; color: #e6dae0; white-space: nowrap; vertical-align: -1px; }
.stars::before { content: "★★★★★"; }
.stars::after { content: "★★★★★"; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) / 5 * 100%); overflow: hidden; color: var(--gold); }

/* ---- 写真（SVG） ---- */
.photo { display: block; width: 100%; aspect-ratio: 3 / 4; background: var(--brand-soft); }
.face-kanji { font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; font-weight: 800; fill: var(--ink); transform-box: fill-box; transform-origin: center; transition: transform .28s ease-in; }
.face.is-flipping .face-kanji { transform: scaleX(0); }
.photo.is-real .face-kanji { fill: var(--brand-dark); }

/* ---- 一覧 ---- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.card { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 6px rgba(165, 15, 85, .08); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(165, 15, 85, .16); }
.card-photo { position: relative; display: block; }
.ribbon { position: absolute; top: 8px; left: 0; background: var(--gold); color: #3a2a00; font-size: 12px; font-weight: 800; padding: 2px 10px 2px 8px; border-radius: 0 999px 999px 0; }
.stamp { position: absolute; top: 10px; right: 8px; border: 2px solid var(--ok); color: var(--ok); background: rgba(255, 255, 255, .88); font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 6px; transform: rotate(8deg); }
.stamp.is-miss { border-color: var(--miss); color: var(--miss); }
.stamp.is-picked { border-color: var(--brand); color: var(--brand-dark); }
.bonus-chip { position: absolute; right: 8px; bottom: 8px; background: var(--gold); color: #3a2a00; font-size: 13px; font-weight: 800; line-height: 1; padding: 5px 9px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); font-variant-numeric: tabular-nums; }
.potential small { margin-left: 8px; font-size: 12px; }
.card.is-closed { opacity: .55; box-shadow: none; }
.card.is-closed:hover { transform: none; box-shadow: none; }
.section-title .picks-left { margin-left: auto; color: var(--brand-dark); font-weight: 700; }
.pick-note { margin: 0; font-size: 13px; color: var(--muted); }
.result-sub { margin: 22px 0 6px; font-size: 15px; }
.prose h3 small { margin-left: 10px; font-size: 12px; font-weight: 400; color: var(--muted); }
.card-body { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 12px; flex: 1; }
.card-name { font-size: 14px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.card-name b { font-size: 22px; line-height: 1.2; }
.card-name small { margin-left: auto; font-size: 11px; color: var(--muted); }
.card-match { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; font-size: 11px; }
.card-match .label { color: var(--muted); white-space: nowrap; }
.card-match .value { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.card-match b { font-size: 15px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.card-catch { font-size: 12.5px; color: #4d4354; line-height: 1.5; min-height: 3em; }
.card-foot { margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); }
.card-foot b { color: var(--brand-dark); white-space: nowrap; }
.card.is-done { background: #fbf6f8; }
.card.is-done .card-foot b { font-size: 14px; }

/* ---- 詳細 ---- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumbs button { border: 0; background: none; padding: 0; color: var(--brand-dark); text-decoration: underline; }

.detail { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 22px; align-items: start; }
.detail-photo { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 12px; }
.photo-note { margin: 0; padding: 6px 10px; font-size: 12px; color: var(--muted); text-align: center; }
.detail-main { min-width: 0; }
.detail-name { margin: 0; font-size: 18px; display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.detail-name b { font-size: 38px; line-height: 1.1; }
.detail-name small { font-size: 14px; color: var(--brand-dark); }
.detail-catch { margin: 4px 0 12px; color: #4d4354; }

.spec { margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.spec div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.spec dt { font-size: 11px; color: var(--muted); }
.spec dd { margin: 0; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spec dd b { font-size: 20px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.spec dd small { font-size: 11px; color: var(--muted); font-weight: 400; }

.reviews h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.reviews h3 span { font-size: 13px; color: var(--brand-dark); }
.reviews h3 small { font-size: 12px; color: var(--muted); font-weight: 400; }
.reviews ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.review p { margin: 4px 0 0; }
.review-head { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.review-no { margin-left: auto; }
.review.is-locked { padding: 0; border-style: dashed; background: transparent; }
.review.is-locked button { width: 100%; border: 0; background: none; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; color: var(--brand-dark); border-radius: 10px; }
.review.is-locked button:hover:not(:disabled) { background: var(--brand-soft); }
.review.is-locked button:disabled { color: #b9aebe; }
.review.is-locked small { font-weight: 600; font-size: 12px; color: var(--muted); }
.review.is-locked button:disabled small { color: #b9aebe; }

.answer, .outcome { margin-top: 18px; background: var(--card); border: 2px solid var(--brand); border-radius: var(--radius); padding: 14px 16px 16px; }
.potential { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.potential b { font-size: 24px; color: var(--brand-dark); margin: 0 4px; font-variant-numeric: tabular-nums; }
.guess-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.guess-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.guess-row input { width: 5.2em; font-size: 24px; font-weight: 700; text-align: center; padding: 6px 8px; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
.guess-row input::placeholder { font-size: 12px; font-weight: 400; color: #b0a5b5; }
.flash { margin: 8px 0 0; min-height: 1.65em; color: var(--brand-dark); font-weight: 700; }
.tries { margin: 0; font-size: 12px; color: var(--muted); }
.wrongs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.wrongs li { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; font-size: 13px; background: #f7f1f4; border-radius: 8px; padding: 6px 10px; }
.wrongs b { font-size: 16px; }
.wrong-match { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.wrong-match b { color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.wrong-match small { font-size: 11px; }

.outcome-title { margin: 0; font-size: 20px; font-weight: 800; }
.outcome.is-win { border-color: var(--ok); }
.outcome.is-win .outcome-title { color: var(--ok); }
.outcome.is-lose { border-color: var(--miss); }
.outcome.is-lose .outcome-title { color: var(--miss); }
.outcome.is-pending { border-style: dashed; text-align: center; color: var(--muted); }
.outcome-body { margin: 6px 0 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.outcome-body .real { font-size: 40px; line-height: 1.1; color: var(--brand-dark); margin: 0 4px; }
.outcome-body .points { margin-left: auto; font-size: 24px; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.outcome-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ---- 結果・ラボ・遊び方 ---- */
.result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; text-align: center; }
.result-label { margin: 0; color: var(--muted); font-size: 13px; }
.result-score { margin: 0; line-height: 1.1; }
.result-score b { font-size: 68px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.result-score span { margin-left: 6px; color: var(--muted); }
.result-rank { margin: 6px 0 16px; font-size: 16px; }
.result-rank b { font-size: 22px; background: linear-gradient(transparent 62%, #ffe59a 62%); padding: 0 4px; }
.result .actions { justify-content: center; }
.share { display: flex; gap: 8px; justify-content: center; align-items: stretch; flex-wrap: wrap; margin-bottom: 18px; }
.share textarea { width: min(100%, 360px); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: none; background: #fbf6f8; font-size: 13px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: center; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); padding: 6px 4px; }
.table td { border-bottom: 1px solid var(--line); padding: 7px 4px; }
.table .num { font-variant-numeric: tabular-nums; }
.table .num small { margin-left: 4px; font-size: 10px; color: var(--muted); }
.table .pair { white-space: nowrap; }
.table .pair b { font-size: 20px; }
.table .pair span { margin: 0 8px; color: var(--muted); }

.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; }
.prose h3 { margin: 22px 0 8px; font-size: 16px; }
.prose ol { padding-left: 1.4em; margin: 0; display: grid; gap: 8px; }
.prose code { background: #f7f1f4; border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.lab-form { margin: 14px 0; }
.lab-form label { display: grid; gap: 6px; font-weight: 700; }
.lab-form input { width: 3.2em; }

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
  .detail-photo { position: static; max-width: 240px; margin: 0 auto; }
  .tagline { display: none; }
  .logo { font-size: 24px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .result-score b { font-size: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .face-kanji { transition: none; }
}
