/* ヘキラボ共通：Q1「研究ノート」。黒地にライム、手書き（Klee One）は主役の周りだけに使う */
:root {
  --bg: #111215; --card: #1b1c21; --ink: #f0efe9; --sub: #9c9aa3; --line: #2c2d34;
  --lime: #c9f25a; --chip: #26282f; --pen: #ff6b4a;
  --hand: "Klee One", "Hiragino Maru Gothic ProN", serif;
  --num: "Oswald", "Arial Narrow", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", sans-serif; font-size: 15px; line-height: 1.7; }
main { max-width: 560px; margin: 0 auto; padding: 0 16px 64px; overflow-x: clip; }
a { color: var(--lime); }
img { max-width: 100%; }
h1 { font-size: 1.5rem; line-height: 1.35; margin: 20px 0 6px; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 900; margin: 0; }
.lead { color: var(--sub); font-size: .9rem; margin: 0 0 20px; }
.note { color: var(--sub); font-size: .82rem; }
.hand { font-family: var(--hand); font-weight: 600; color: var(--pen); }

/* ---- ヘッダー ---- */
.hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.brand, .logo { font-weight: 900; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.brand i, .logo i { font-style: normal; color: var(--lime); }
.r18 { font: 500 11px/1 var(--num); letter-spacing: .05em; color: var(--sub); border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 4px; }
.pills a { font-size: .82rem; font-weight: 700; padding: 5px 13px; border-radius: 999px; background: var(--chip); color: var(--ink); text-decoration: none; }
.pills a[aria-current="page"] { background: var(--lime); color: #111; }

/* ---- 見出し（研究ノートの章） ---- */
.lab-sh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 26px 0 10px; }
.lab-sh .tag { font: 500 11px/1 var(--num); letter-spacing: .12em; color: var(--sub); border: 1px dashed var(--line); border-radius: 3px; padding: 4px 6px; }
.k { font: 500 11px/1 var(--num); letter-spacing: .15em; color: var(--sub); }

/* ---- ボタン ---- */
.btn { display: inline-block; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 11px 18px; font-family: inherit; font-weight: 700; font-size: .95rem; line-height: 1.4; cursor: pointer; text-decoration: none; background: transparent; color: var(--ink); }
.btn.primary { background: var(--lime); border-color: var(--lime); color: #111; }
.btn:disabled { opacity: .35; cursor: default; }
.btn:focus-visible, .icon:focus-visible, .cover:focus-visible, .choice:focus-visible, .seg button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.cta { display: grid; gap: 8px; }
.cta .btn { display: block; }
.share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.share .btn { display: block; padding: 10px 8px; }
.share .btn.wide { grid-column: 1 / -1; }
.skip { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--sub); font: inherit; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.skip:hover { color: var(--ink); }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; }

/* 人数の切り替え */
.seg { display: flex; gap: 6px; align-items: center; }
.seg span { font-size: .85rem; color: var(--sub); margin-right: 4px; }
.seg button { flex: 1; border: 0; border-radius: 8px; padding: 9px; background: var(--chip); color: var(--sub); font-family: inherit; font-weight: 700; font-size: .95rem; line-height: 1.4; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #111; }

input[type="search"] { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1rem; font-family: inherit; }
input[type="search"]:focus { outline: none; border-color: var(--lime); }

/* ---- 一覧 ---- */
ul.list { list-style: none; padding: 0; margin: 8px 0 0; }
ul.list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.list li:last-child { border-bottom: 0; }
.name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; font-size: .92rem; line-height: 1.45; }
.g { display: inline-block; color: #d4d2db; background: var(--chip); font-size: .72rem; font-weight: 400; border-radius: 3px; padding: 0 6px; line-height: 1.7; }
.rank { font: 700 1.15rem/1 var(--num); width: 1.6em; text-align: center; color: var(--ink); flex: none; }
li:first-child > .rank { color: var(--lime); font-size: 1.7rem; }
.icon { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; flex: none; font-family: inherit; }
.icon:disabled { opacity: .25; cursor: default; }
.thumb { width: 44px; height: 62px; object-fit: cover; object-position: right; border-radius: 4px; flex: none; background: var(--chip); }
.result-list li a { color: var(--ink); text-decoration: none; }
.aff { font-size: .78rem; white-space: nowrap; color: var(--lime); flex: none; }
.ogimg { width: 100%; height: auto; border-radius: 8px; display: block; aspect-ratio: 40 / 21; background: var(--card); border: 1px solid var(--line); }

/* ---- トップの表彰台（完成イメージ） ---- */
.podium { position: relative; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 10px; align-items: end; margin-top: 56px; }
.pd { position: relative; min-width: 0; }
.pd .num { position: absolute; z-index: 2; font: 700 30px/1 var(--num); left: 2px; top: -30px; color: var(--ink); }
.pd.first .num { font-size: 104px; left: -8px; top: -52px; color: var(--lime); text-shadow: 0 2px 0 #111; }
.pd .nm { font-size: .78rem; font-weight: 700; margin-top: 6px; line-height: 1.35; overflow-wrap: anywhere; }
.pd .nm .g { margin-top: 3px; }
/* 1位メモは 2位・3位の上の空き（表紙と数字にかからない所）に1行で */
.podium .memo { position: absolute; right: 0; top: -44px; font-size: .85rem; transform: rotate(-3deg); white-space: nowrap; }
.cvbox { display: block; width: 100%; aspect-ratio: 5 / 7; border-radius: 6px; object-fit: cover; object-position: right; background: var(--chip); }
.sample { font: 500 11px/1 var(--num); letter-spacing: .12em; color: var(--sub); }
.feature { display: grid; gap: 10px; }
.feature p { margin: 0; color: #cfcdd6; font-size: .9rem; }

/* ---- 表紙の4択 ---- */
.steps { display: flex; gap: 4px; margin: 12px 0 4px; }
.steps i { flex: 1; min-width: 0; height: 32px; border-radius: 5px; background: var(--chip); font: 500 12px/32px var(--num); text-align: center; color: var(--sub); font-style: normal; white-space: nowrap; overflow: hidden; }
.steps i.done { background: #c9f25a26; color: var(--lime); }
.steps i.now { background: none; border: 1.5px solid var(--lime); color: var(--lime); line-height: 29px; }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 14px 0 10px; }
.pick-head strong { font-weight: 900; font-size: 1.05rem; }
.cover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; margin-top: 8px; }
.cover { position: relative; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; text-align: left; font: inherit; min-width: 0; }
.cover .ph { position: relative; display: block; }
.cover img { display: block; width: 100%; aspect-ratio: 5 / 7; object-fit: cover; object-position: right; border-radius: 6px; background: var(--chip); transition: opacity .2s, transform .2s; }
.cover:hover img { transform: translateY(-2px); }
.cover .cap { display: block; margin-top: 6px; font-size: .85rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.cover .cap .g { display: table; margin-top: 4px; }
.cover-grid.locked .cover { cursor: default; }
.cover-grid.locked .cover:not(.on) img { opacity: .35; }
.cover .loop { position: absolute; left: -8px; top: -8px; width: calc(100% + 16px); height: calc(100% + 16px); overflow: visible; pointer-events: none; }
.cover .loop path { fill: none; stroke: var(--pen); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .32s ease-out forwards; }
.cover .kore { position: absolute; right: 8px; bottom: 8px; font-size: 1.15rem; transform: rotate(-6deg); background: #111215d9; border-radius: 4px; padding: 0 6px; opacity: 0; animation: pop .2s .18s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cover .loop path { animation: none; stroke-dashoffset: 0; }
  .cover .kore { animation: none; opacity: 1; }
}

/* ---- 結果カード（所見） ---- */
.res { position: relative; overflow: hidden; margin: 16px 0; padding: 18px 16px 16px; background-color: var(--card); border-radius: 12px;
  background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: 16px 16px; }
.res > * { position: relative; }
.res h1 { margin: 8px 0 12px; }
.res .bgno { position: absolute; right: -14px; top: -40px; font: 700 180px/1 var(--num); color: var(--ink); opacity: .06; pointer-events: none; }
.res .pre { display: block; font-size: .9rem; font-weight: 700; color: #cfcdd6; }
.type-name { display: inline-block; position: relative; color: var(--lime); font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; }
.type-name svg { position: absolute; left: -4px; bottom: -8px; width: calc(100% + 8px); height: 14px; overflow: visible; }
.finding { font-size: 1rem; line-height: 1.6; margin: 14px 0 12px; transform: rotate(-1deg); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .78rem; border-radius: 999px; padding: 3px 10px; background: #c9f25a22; color: var(--lime); font-weight: 700; }
.res .ogimg { margin-top: 4px; }

.sh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 26px 0 10px; }
.sh span { font-size: .78rem; color: var(--sub); }

/* 横に流れる作家の棚 */
.shelf { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.shelf a { flex: 0 0 30%; min-width: 0; color: var(--ink); text-decoration: none; }
.shelf .t { font-size: .8rem; font-weight: 700; margin-top: 6px; line-height: 1.35; overflow-wrap: anywhere; }
.shelf .why { font-size: .72rem; color: var(--lime); line-height: 1.4; }

/* ---- 設問 ---- */
.bar { height: 4px; background: var(--chip); border-radius: 2px; overflow: hidden; margin: 10px 0 2px; }
.bar i { display: block; height: 100%; background: var(--lime); transition: width .25s; }
.qno { font: 700 1.1rem/1 var(--num); color: var(--lime); letter-spacing: .04em; }
.question { font-size: 1.2rem; font-weight: 900; line-height: 1.5; margin: 10px 0 16px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 14px 16px; font-family: inherit; font-weight: 700; font-size: .95rem; line-height: 1.5; cursor: pointer; }
.choice:hover { border-color: var(--lime); }

footer { color: var(--sub); font-size: .78rem; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); }
footer a { color: var(--sub); }
