/* =========================================================
   あーずかいの診断ノート（トップページ）
   各診断（dotei/ など）と同じ「方眼ノートの落書き帳」の見た目。
   診断ごとの style.css には頼らず、このファイルだけで完結させる
   ========================================================= */
:root {
  --paper: #fffdf5;
  --grid: rgba(96, 140, 210, 0.14);
  --margin-line: rgba(232, 88, 104, 0.4);
  --ink: #1d1d22;
  --sub: #6b6a75;
  --lav: #e4e6ff;
  --cheek: #ff8fb1;
  --cheek-soft: #ffd3e1;
  --hl: #fff066;
  --pen-red: #e2434b;
  --pen-blue: #2d5fd6;
  --tape: rgba(255, 233, 140, 0.78);
  --tape-pink: rgba(255, 196, 214, 0.8);
  --wobble: 255px 14px 225px 16px / 16px 225px 14px 255px;
  --wobble-2: 14px 225px 16px 255px / 225px 16px 255px 14px;
  --hand: "Yusei Magic", "Zen Maru Gothic", sans-serif;
  --pencil: "Klee One", "Zen Maru Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Zen Maru Gothic", system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--pen-blue); font-weight: 700; text-underline-offset: 3px; }
img { max-width: 100%; }

@media (min-width: 900px) {
  body::before {
    content: ""; position: fixed; top: 0; bottom: 0; left: calc(50% - 430px);
    border-left: 2px solid var(--margin-line); pointer-events: none;
  }
}

/* ===== 共通の部品 ===== */
.hl { background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%); padding: 0 .15em; }
.hl-pink { background: linear-gradient(transparent 58%, var(--cheek-soft) 58%, var(--cheek-soft) 92%, transparent 92%); }
.pencil { font-family: var(--pencil); font-weight: 600; }
.small { font-size: 12px; color: var(--sub); }

.chara {
  display: block; height: auto; user-select: none; -webkit-user-drag: none;
  filter:
    drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff)
    drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff)
    drop-shadow(2px 5px 5px rgba(40, 40, 80, .18));
}
.bubble {
  position: relative; display: inline-block; font-family: var(--pencil); font-weight: 600;
  font-size: 14px; line-height: 1.5; background: #fff; border: 2.5px solid var(--ink);
  border-radius: var(--wobble); padding: 6px 12px; white-space: nowrap;
}
.bubble::after {
  content: ""; position: absolute; left: 18px; bottom: -9px; width: 14px; height: 14px;
  background: #fff; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
  transform: rotate(40deg) skew(10deg);
}

.doodle { display: inline-block; width: 40px; pointer-events: none; }
.doodle svg { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.doodle.cheek { color: var(--cheek); }
.doodle.star, .doodle.sparkle { color: #f5b301; }

.btn {
  display: inline-block; cursor: pointer; text-decoration: none; font-family: var(--hand); font-weight: 400;
  font-size: 20px; line-height: 1.3; padding: 12px 32px; color: var(--ink); background: var(--cheek);
  border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: 4px 5px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-1px, -2px) rotate(-1deg); box-shadow: 5px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.lav { background: var(--lav); }

/* ===== ヘッダー ===== */
.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 860px; margin: 0 auto; padding: 14px 16px 6px;
}
.logo { font-family: var(--hand); font-size: 19px; text-decoration: none; color: var(--ink); }
.logo span { color: var(--pen-red); }
.site-header nav a {
  font-family: var(--hand); font-weight: 400; text-decoration: none; font-size: 14px; color: var(--ink);
  background: var(--lav); border: 2.5px solid var(--ink); border-radius: 10px 10px 4px 4px;
  padding: 3px 12px; display: inline-block; transform: rotate(2deg); white-space: nowrap;
}

main { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }

/* ===== 表紙 ===== */
.cover { text-align: center; padding: 26px 0 0; }
.cover .label {
  display: table; margin: 0 auto; font-family: var(--pencil); font-weight: 600; font-size: 14px;
  padding: 3px 18px; background: var(--tape); transform: rotate(-2deg);
}
.cover h1 {
  margin: 6px 0 0; font-family: var(--hand); font-weight: 400;
  font-size: clamp(52px, 15vw, 96px); line-height: 1.15; letter-spacing: .04em;
}
/* ノートの表紙のタイトルらしく、太い下線を手描きで */
.cover h1 .title-main { text-decoration: underline; text-decoration-color: var(--cheek); text-decoration-thickness: .12em; text-underline-offset: .12em; }
/* タイトル横の赤い「秘」のハンコ（ないしょのノートの印） */
.cover h1 { position: relative; display: inline-block; }
.stamp {
  position: absolute; top: .1em; right: -1.2em; width: 1.9em; height: 1.9em; border-radius: 50%; white-space: nowrap;
  display: grid; place-items: center; font-family: var(--hand); font-size: clamp(22px, 5.6vw, 34px); line-height: 1;
  color: var(--pen-red); border: 3px double var(--pen-red); background: rgba(255, 253, 245, .7);
  transform: rotate(16deg); text-decoration: none; letter-spacing: 0; opacity: .9;
}
.cover h1 small {
  display: block; font-family: var(--pencil); font-weight: 600; font-size: .36em; line-height: 1.2;
  letter-spacing: .3em; color: var(--pen-red); margin-bottom: .1em;
}
.bubble .blush { color: var(--cheek); margin-left: 2px; }
@media (max-width: 520px) { .stamp { right: -.6em; top: -.2em; } }

.cover .kicker { font-family: var(--pencil); font-weight: 600; font-size: clamp(14px, 4.1vw, 22px); margin: 14px 0 0; white-space: nowrap; }
.cover .kicker .doodle { width: 1.3em; margin: 0 .3em; vertical-align: -.15em; }
.cover .lead-text { margin: 4px 0 0; font-weight: 700; }

.cover-stage { position: relative; max-width: 520px; height: 250px; margin: 6px auto 0; }
.cover-stage .main-a { position: absolute; left: 50%; bottom: 6px; width: 330px; transform: translateX(-50%); animation: bob 2.8s ease-in-out infinite; }
.cover-stage .bubble { position: absolute; left: calc(50% + 40px); top: 18px; transform: rotate(3deg); }
.cover-stage .sparkle { position: absolute; left: 6%; top: 40px; width: 34px; }
.cover-stage .star { position: absolute; right: 5%; bottom: 40px; width: 30px; transform: rotate(14deg); }
/* ノートの表紙の名前欄（右下に小さく） */
.owner {
  width: fit-content; margin: 2px 4px 0 auto; padding: 0 6px 0 2px; border-bottom: 1.5px solid #a9a8b5;
  font-family: var(--pencil); font-weight: 600; font-size: 14px; color: var(--sub); transform: rotate(-1.5deg);
}
.owner span { font-family: "Zen Maru Gothic", sans-serif; font-size: 10px; color: #a9a8b5; margin-right: 14px; }

@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }
@media (max-width: 520px) {
  .cover-stage { height: 210px; }
  .cover-stage .main-a { width: 270px; }
  .cover-stage .bubble { left: auto; right: 0; top: 4px; }
}

/* ===== もくじ ===== */
.section-title {
  font-family: var(--hand); font-weight: 400; font-size: clamp(24px, 6vw, 30px); line-height: 1.3;
  margin: 40px 0 26px; text-align: center;
}
.section-title .doodle { width: 26px; vertical-align: -3px; margin: 0 8px; }

.toc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 34px 22px; }

/* ノートのページ1枚＝診断1つ */
.note {
  position: relative; background: #fff; border: 3px solid var(--ink); border-radius: var(--wobble-2);
  box-shadow: 5px 6px 0 var(--lav); padding: 26px 20px 20px;
}
.note .no {
  position: absolute; top: -15px; left: 18px; font-family: var(--hand); font-size: 15px;
  padding: 1px 14px; background: var(--tape); transform: rotate(-4deg);
}
.note h3 { font-family: var(--hand); font-weight: 400; font-size: 24px; line-height: 1.35; margin: 0 0 8px; }
.note h3 a { color: var(--ink); text-decoration: none; }
.note p { margin: 8px 0 0; }

/* 公開中の診断は横いっぱいに大きく */
.note.open { grid-column: 1 / -1; display: grid; grid-template-columns: 44% 1fr; gap: 22px; align-items: center; transform: rotate(-.6deg); }
.note.open .no { background: var(--tape-pink); }
.note-thumb { display: block; }
.note-thumb .chara { width: 100%; transform: rotate(-3deg); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tags li { font-family: var(--pencil); font-weight: 600; font-size: 13px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 16px !important; }
.sub-link { font-size: 15px; }

/* 準備中のページは、破線で書きかけっぽく */
.note.soon { background: rgba(255, 255, 255, .55); border-style: dashed; border-color: #a9a8b5; box-shadow: none; color: var(--sub); text-align: center; padding: 34px 16px 26px; }
.note.soon:nth-child(2) { transform: rotate(1deg); }
.note.soon:nth-child(3) { transform: rotate(-1.2deg); }
.note.soon .no { background: #ececf2; color: var(--ink); }
.note.soon h3 { color: #a9a8b5; }

@media (max-width: 600px) {
  .toc { grid-template-columns: 1fr; gap: 30px; }
  .note.open { grid-template-columns: 1fr; gap: 6px; }
  .note-thumb { max-width: 340px; margin: 0 auto; }
  .note.open .btn { width: 100%; text-align: center; }
  .actions { justify-content: center; }
}

/* ===== リクエスト募集 ===== */
.request {
  display: grid; grid-template-columns: 130px 1fr; gap: 20px; align-items: center;
  margin-top: 56px; padding: 22px; border-top: 2.5px dashed #c9cbe8; border-bottom: 2.5px dashed #c9cbe8;
}
.request h2 { font-family: var(--hand); font-weight: 400; font-size: 24px; line-height: 1.35; margin: 0; }
.request p { margin: 6px 0 14px; }
@media (max-width: 600px) {
  .request { grid-template-columns: 1fr; text-align: center; padding: 22px 4px; }
  .request .chara { width: 110px; margin: 0 auto; }
}

/* ===== フッター ===== */
.site-footer { text-align: center; padding: 22px 16px 34px; font-size: 14px; max-width: 760px; margin: 0 auto; }
.site-footer p { margin: 4px 0; }

/* 文の途中で変な位置で折り返さないように */
.nb { display: inline-block; }

/* ===== 広告枠（AdSense の審査後に中身を広告コードに差し替える） ===== */
.ad-slot {
  margin: 44px 0; min-height: 100px; border: 2px dashed #c9c9d2; border-radius: 6px;
  display: grid; place-items: center; color: #b2b2bb; font-size: 12px; background: rgba(255, 255, 255, .6);
}
.request + .ad-slot { margin-bottom: 0; }
