:root {
  /* 謎画像は白地なので、ナイトモードでも常に明るい配色で見せる（端末の自動ダーク化も断る） */
  color-scheme: only light;
  /* 目に優しいクリーム系（白を避けてトーンを落とす）。強調色は落ち着いた青 */
  --bg: #EFE8DA;
  --panel: #F8F3E8;
  --inner: #F2ECDF;
  --line: #DDD3C1;
  --text: #2E2B25;
  --sub: #776F61;
  --accent: #2F63C4;
  --accent-soft: #E2E7EE;
  --bad: #B5534A;
  --neutral: #A69E8F;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  line-height: 1.7;
}
a { color: var(--accent); }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }

header.site { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 16px; }
header.site a.home { color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: .02em; }
header.site .nav { font-size: 13px; }
/* 問題一覧に戻る（指で押しやすい大きさ） */
a.back-btn {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); background: var(--panel); text-decoration: none;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
a.back-btn:active { background: var(--accent-soft); }
.bottom-back { text-align: center; margin: 24px 0 8px; }
a.back-btn.wide { min-height: 48px; padding: 10px 28px; font-size: 16px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2, .card h1 { margin: 0 0 4px; font-size: 20px; line-height: 1.4; }
.muted { color: var(--sub); font-size: 13px; }
.tag {
  display: inline-block; font-size: 12px; line-height: 1; padding: 5px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--sub); background: var(--inner); white-space: nowrap;
}
/* 状態の印: 受付中がいちばん目立つ（塗り）。回答済み・結果発表は淡い色の塗り */
.tag.open { color: #fff; border-color: var(--accent); background: var(--accent); font-weight: 700; }
.tag.done { color: #7A5413; border-color: #DCC089; background: #F1E2C2; }
.tag.answered { color: #3D6630; border-color: #B7CFA8; background: #DFEBD6; }
.tags { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.qbody { white-space: pre-wrap; word-break: break-word; margin: 12px 0 0; }
.qimg { display: block; max-width: 100%; max-height: 75vh; width: auto; height: auto; margin: 12px auto 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

.answer-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.answer-box label { display: block; font-weight: 600; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
input[type=text] {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--inner); color: var(--text);
}
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  font: inherit; font-size: 15px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap;
}
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--accent); }
.cf-turnstile { margin-top: 10px; }
.msg { margin-top: 10px; font-size: 14px; }
.msg.err { color: var(--bad); }
.mine-box { background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; }
.mine-box b { font-size: 18px; }

/* 結果 */
.results { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.results h3 { margin: 0 0 4px; font-size: 16px; }
.bar { margin: 12px 0; }
.bar .top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.bar .label { word-break: break-word; }
.bar .num { color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar .num b { color: var(--text); font-size: 16px; }
.bar .track { height: 10px; background: var(--inner); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bar .fill { height: 100%; background: var(--neutral); border-radius: 999px; }
.bar.mine .fill { background: var(--accent); }
.bar.mine .label::after { content: "あなた"; margin-left: 8px; font-size: 11px; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: 2px; }
.bar.other .label { color: var(--sub); }
.comment { margin-top: 16px; background: var(--inner); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; }
.comment .who { font-size: 12px; color: var(--sub); margin-bottom: 4px; }

/* 一覧 */
ul.qlist { list-style: none; margin: 0; padding: 0; }
ul.qlist li { border-top: 1px solid var(--line); }
ul.qlist li:first-child { border-top: none; }
ul.qlist a { display: flex; align-items: center; gap: 10px; padding: 12px 2px; color: var(--text); text-decoration: none; }
ul.qlist .t { flex: 1; min-width: 0; }
ul.qlist .t .muted { display: block; }
/* 見出し: 大きく濃く、左の色帯で区分（受付中=青 / 結果発表=黄土） */
.section-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 0;
  font-size: 19px; color: var(--text); margin: 28px 2px 10px; font-weight: 800;
  padding-left: 12px; border-left: 5px solid var(--neutral); line-height: 1.3;
}
.section-title.open { border-left-color: var(--accent); }
.section-title.done { border-left-color: #C9A04E; }
.rules { font-size: 14px; }
.rules ol { margin: 6px 0 0; padding-left: 1.4em; }
footer.site { margin-top: 32px; text-align: center; font-size: 12px; color: var(--sub); }
footer.site a { color: var(--sub); }

/* トップ */
.hero-title { text-align: center; margin: 36px 0 12px; }

/* ロゴ: 吹き出し「作者の」＋大きく「お気持ち謎」 */
.logo { display: inline-flex; flex-direction: column; align-items: flex-start; margin: 0; line-height: 1.1; }
.logo-main { font-size: clamp(44px, 14vw, 68px); font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.bubble {
  position: relative; display: inline-block; margin: 0 0 14px .5em; padding: 3px 14px;
  font-size: clamp(14px, 4.2vw, 18px); font-weight: 700; letter-spacing: .08em; line-height: 1.5;
  background: var(--panel); color: var(--text); border: 2px solid var(--text); border-radius: 999px;
  transform: rotate(-5deg);
}
/* しっぽ（外側の線と内側の塗りの2枚重ね） */
/* しっぽ: 外側の線の三角形＋内側の塗りの三角形（トップの大きいロゴはこの形で確定）。
   小さいロゴ（.sm）だけ、塗りを吹き出しの線の内側まで食い込ませて付け根の線を消している */
.bubble::before, .bubble::after { content: ""; position: absolute; width: 0; height: 0; border-style: solid; }
.bubble::before { left: 20px; bottom: -11px; border-width: 11px 7px 0 3px; border-color: var(--text) transparent transparent transparent; }
.bubble::after { left: 22px; bottom: -7px; border-width: 8px 5px 0 2px; border-color: var(--panel) transparent transparent transparent; }
/* 各ページ上部の小さいロゴ */
a.logo-mini { display: inline-flex; align-items: center; gap: 10px; }
.bubble.sm { margin: 0; padding: 0 8px; font-size: 11px; border-width: 1.5px; transform: rotate(-4deg); letter-spacing: .04em; }
.bubble.sm::before { left: auto; right: -8px; top: 50%; bottom: auto; margin-top: -4px; border-width: 4px 0 4px 8px; border-color: transparent transparent transparent var(--text); }
.bubble.sm::after { left: auto; right: -4.65px; top: 50%; bottom: auto; margin-top: -3.32px; border-width: 3.32px 0 3.32px 6.65px; border-color: transparent transparent transparent var(--panel); }
.hero { text-align: center; margin-bottom: 32px; }
.hero .catch { font-size: 17px; margin: 0 0 24px; }
.today-no { font-size: 15px; margin-bottom: 4px; }
.today-no b { font-size: 20px; margin-right: 6px; }
.today-title { font-size: 20px; font-weight: 700; margin: 0 0 14px; line-height: 1.4; }
a.big {
  display: inline-block; min-width: 220px; padding: 14px 28px; border-radius: 12px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 17px; text-decoration: none; box-shadow: var(--shadow);
}
a.big.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.hero .sub { margin-top: 8px; font-size: 13px; color: var(--sub); }
#schedule { margin-top: 12px; }
#schedule:empty { display: none; }
ul.qlist .no { color: var(--sub); font-variant-numeric: tabular-nums; min-width: 2.6em; }
button.linkish { background: none; border: none; color: var(--sub); text-decoration: underline; padding: 0; font-size: 12px; }
dialog {
  border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: min(480px, calc(100vw - 32px));
  background: var(--panel); color: var(--text); box-shadow: 0 8px 30px rgba(16, 24, 40, .18);
}
dialog::backdrop { background: rgba(20, 24, 30, .45); }
dialog { max-height: 85vh; overflow-y: auto; }
dialog h3 { margin: 0 0 8px; }
dialog h3:focus { outline: none; }
.howto-btn { display: inline-block; padding: 6px 16px; font-size: 14px; line-height: 1.6; background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; text-decoration: none; cursor: pointer; }
.howto-btn[hidden] { display: none; }
.hero-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.example-cta { background: var(--inner); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 4px 0 12px; }
.example-cta p { margin: 0 0 8px; }
dialog h4 { margin: 16px 0 4px; font-size: 15px; }
dialog ul { padding-left: 1.3em; }
dialog li { margin-bottom: 4px; }
dialog ol { padding-left: 1.3em; }
dialog form { text-align: center; margin-top: 12px; }

.type-hint { display: inline-block; font-size: 13px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
.reveal { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.reveal h3 { margin: 0; font-size: 16px; }
.itag { margin-left: 8px; font-size: 11px; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft); vertical-align: 2px; white-space: nowrap; }
.bar.mine .label::after { margin-left: 6px; }
.intended-answer { font-size: 22px; font-weight: 700; margin: 6px 0 0; letter-spacing: .04em; }

/* 受付中の問題（複数可） */
.section-title .count { margin-left: 10px; font-size: 14px; font-weight: 400; color: var(--sub); }
.qcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 8px; }
a.qcard {
  display: flex; align-items: center; gap: 12px; padding: 10px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
a.qcard:hover { border-color: var(--accent); }
a.qcard .thumb { flex: none; width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
a.qcard .thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--sub); background: var(--inner); }
a.qcard .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
a.qcard .no { font-size: 12px; color: var(--sub); }
a.qcard .title { font-weight: 700; line-height: 1.4; word-break: break-word; }
a.qcard .meta { font-size: 12px; color: var(--sub); }
a.qcard .state { flex: none; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--sub); white-space: nowrap; }
a.qcard .state.answered { color: #3D6630; border-color: #B7CFA8; background: #DFEBD6; }
a.qcard .state.todo { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
a.qcard.done { background: var(--inner); }
#others { margin-top: 8px; }

/* データの扱い（安心感を先に・技術的な話は折りたたみ） */
.privacy h1 { font-size: 20px; }
.privacy .lead { font-size: 16px; background: var(--inner); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.privacy h3 { font-size: 15px; margin: 20px 0 6px; }
.privacy ul.plain { list-style: none; padding: 0; margin: 0; }
.privacy ul.plain li { padding: 8px 0; border-top: 1px solid var(--line); }
.privacy ul.plain li:first-child { border-top: none; }
.privacy details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; color: var(--sub); }
.privacy summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }
.privacy details ul { padding-left: 1.2em; }
.privacy details li { margin-bottom: 6px; }

/* タイトル（任意）は問題番号の横に小さく / 作者名 */
.subtitle { margin-left: 8px; font-size: .78em; font-weight: 600; color: var(--sub); }
a.qcard .subtitle { margin-left: 0; display: block; }
.card h1 .subtitle { display: block; margin: 2px 0 0; font-size: 16px; }
.author { font-size: 14px; color: var(--text); margin: 2px 0 2px; }
ul.qlist .label { font-weight: 700; }

/* 結果発表の一覧: 受付中のカードを小さくした版（情報が少ないぶん低く） */
.qcards .qcard.compact { padding: 8px 10px; gap: 10px; box-shadow: none; }
a.qcard.compact .thumb { width: 64px; height: 48px; border-radius: 5px; }
a.qcard.compact .thumb.empty { font-size: 13px; }
a.qcard.compact .title { font-size: 15px; }
/* 作者名だけ長ければ「…」で省略し、日付は必ず全部見せる */
a.qcard.compact .meta.row { display: flex; white-space: nowrap; }
a.qcard.compact .meta .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
a.qcard.compact .meta .when { flex: none; }
a.qcard .subtitle.inline { display: inline; margin-left: 6px; }
a.qcard.compact .tag { flex: none; }
/* 受付中カードも、長い作者名は1行で「…」 */
a.qcard .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 一致したか */
.verdict { margin: 6px 0 4px; font-weight: 700; }
.verdict.hit { color: var(--accent); font-size: 17px; }
.verdict.miss { color: var(--sub); }
/* シェア */
.share { margin-top: 14px; text-align: center; }
a.share-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 24px;
  border-radius: 999px; background: #1F1F1F; color: #fff; text-decoration: none; font-weight: 700;
}
/* ギブアップ（目立たせすぎない） */
.giveup { margin-top: 14px; text-align: right; }
button.giveup-btn { background: transparent; border: none; color: var(--sub); text-decoration: underline; font-size: 13px; padding: 4px 0; }
dialog.confirm p { margin: 0 0 12px; }
.confirm-btns { display: flex; justify-content: flex-end; gap: 10px; }

/* 想定解の解説（回答直後に見える）。作者コメント（締切後）と同じ見た目 */
.explanation { margin-top: 12px; background: var(--inner); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; }
.explanation .who { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.sample-note { margin-top: 8px; font-size: 13px; font-weight: 700; color: #7A5413; background: #F1E2C2; border: 1px solid #DCC089; border-radius: 6px; padding: 6px 10px; }
