:root{
  --bg: #f3efe6;            /* 生成り */
  --paper:#f3efe6;
  --ink:#2f2c2b;            /* 墨 */
  --line: rgba(47,44,43,.18);
  --soft: rgba(255,255,255,.0);

  --card:#f7f3ea;
  --white:#ffffff;

  --r-sheet: 60px;
  --r-card: 18px;
  --r-inner: 18px;
  --r-pill: 18px;

  --shadow: 0 10px 30px rgba(0,0,0,.06);
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;color:var(--ink);font-family: ui-rounded,"Hiragino Maru Gothic ProN","Hiragino Sans","Noto Sans JP",system-ui,-apple-system,sans-serif}

.pink{background:var(--bg)}

/* ===== Paper theme (Top page like your PDF) ===== */
body.paper{
  --bg: #f3efe6;            /* 生成り */
  --paper:#f3efe6;
  --ink:#1f1f1f;            /* 墨 */
  --line: rgba(31,31,31,.18);
  --soft: rgba(255,255,255,.0);
  background: var(--bg);
}

.stage{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:34px 18px;
}

.sheet{
  width:min(1200px, 100%);
  background:rgba(255,255,255,.10);
  border-radius: var(--r-sheet);
  padding:34px 34px 22px;
}

/* ===== Home ===== */
.sheet--home{padding:60px 34px}
.homeHead{display:grid;gap:12px;justify-items:center;margin-top:10px}
.homeTitle{margin:0;font-size:58px;letter-spacing:.06em}
.homeSub{margin:0;font-size:18px;opacity:.8}
.homeActions{display:flex;gap:16px;justify-content:center;margin-top:34px;flex-wrap:wrap}
.homeNote{margin-top:18px;text-align:center;opacity:.75}
.homeReset{display:flex;justify-content:center;margin-top:26px}

/* Top (paper) layout tuned to match your PDF style */
body.paper .stage{
  padding: 54px 18px;
}
body.paper .sheet--home{
  position: relative;
  overflow: hidden;
  padding: 86px 44px 62px;
  background: rgba(255,255,255,.28);
  border: 1px solid rgba(31,31,31,.10);
  border-radius: 46px;
  box-shadow: 0 18px 45px rgba(0,0,0,.08);
}
body.paper .homeHead{gap: 14px; margin-top: 0}
body.paper .homeTitle{
  font-size: clamp(52px, 7vw, 82px);
  letter-spacing: .12em;
  font-weight: 900;
}
body.paper .homeSub{
  font-size: 16px;
  letter-spacing: .06em;
  opacity: .78;
}

/* Crane motif (very subtle, clipped off-screen) */
.homeCrane{
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: .09;
  filter: grayscale(1) contrast(1.05);
}
.homeCrane--main{
  width: min(780px, 80vw);
  right: -180px;
  bottom: -140px;
  transform: rotate(-6deg);
  opacity: .08;
}
.homeCrane--sub{
  width: min(420px, 52vw);
  left: -160px;
  top: -120px;
  transform: rotate(9deg);
  opacity: .04;
}

/* Paper button tone */
body.paper .pill{
  background: transparent;
  border-color: rgba(31,31,31,.22);
  padding: 14px 24px;
}
body.paper .pill--main{
  background: #1f1f1f;
  border-color: #1f1f1f;
  color: #f3efe6;
}
body.paper .pill--ghost{
  border-style: dashed;
  opacity: .86;
}

/* ===== Pills ===== */
.pill{
  border:2px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  border-radius: var(--r-pill);
  padding: 14px 22px;
  font-weight:700;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  cursor:pointer;
  transition: transform .08s ease;
}
.pill:hover{transform:translateY(-1px)}
.pill--main{
  background:#eeb9c2;
}
.pill--ghost{
  background:transparent;
}

/* ===== Zukan header ===== */
.zHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding: 0 6px 18px;
}
.zTitle{
  font-size:54px;
  font-weight:900;
  letter-spacing:.08em;
  text-align:center;
  flex: 1;
}
.zRight{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:220px;
  justify-content:flex-end;
}
.crane{
  width:44px;height:44px;
  color: #e17f8c;
}
.crane svg{width:100%;height:100%}
.zCount{
  font-size:26px;
  font-weight:900;
}
.zCollected{
  font-size:26px;
  font-weight:900;
}

/* ===== Zukan grid ===== */
.zGrid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px 26px;
  padding: 10px 6px 16px;
}
@media (max-width: 1100px){ .zGrid{grid-template-columns:repeat(4,1fr)} .zTitle{font-size:44px} }
@media (max-width: 700px){ .zGrid{grid-template-columns:repeat(2,1fr)} .zTitle{font-size:34px} }

.card{
  background: rgba(255,255,255,.14);
  border-radius: var(--r-card);
  padding: 14px;
  position:relative;
  cursor:pointer;
}
.card--active{
  outline: 2px solid var(--line);
  outline-offset: 2px;
}
.cardNo{
  font-weight:900;
  font-size:18px;
  opacity:.85;
  margin-bottom:10px;
}
.cardInner{
  background: rgba(255,255,255,.12);
  border-radius: var(--r-inner);
  height: 140px;
  display:grid;
  place-items:center;
  overflow:hidden;
}
.cardQ{
  font-size:64px;
  font-weight:900;
  opacity:.75;
}
.cardInner img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.cardName{
  margin-top:10px;
  font-size:22px;
  letter-spacing:.08em;
}

/* ===== Footer ===== */
.zFoot{
  display:flex;
  gap:14px;
  justify-content:flex-end;
  padding: 10px 6px 0;
  flex-wrap:wrap;
}

/* ===== Animal header ===== */
.aHead{
  display:flex;
  align-items:flex-end;
  gap:18px;
  padding: 0 6px 18px;
}
.aNo{
  font-size:36px;
  font-weight:900;
  opacity:.9;
}
.aName{
  font-size:58px;
  font-weight:900;
  letter-spacing:.08em;
  flex:1;
}
@media (max-width: 900px){ .aName{font-size:40px} }
.aNav{display:flex;gap:12px;flex-wrap:wrap}

/* ===== Animal body ===== */
.aBody{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 28px;
  padding: 10px 6px 6px;
}
@media (max-width: 980px){ .aBody{grid-template-columns:1fr} }

.photoFrame{
  background: var(--white);
  border-radius: 14px;
  height: 430px;
  border: 3px dashed var(--line);
  display:grid;
  place-items:center;
  position:relative;
  overflow:hidden;
}
.photoQ{
  font-size:88px;
  font-weight:900;
  color:#b7b7b7;
}
.photoFrame img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:none;
}
.aBtns{
  display:flex;
  gap:16px;
  margin-top:18px;
  flex-wrap:wrap;
}
.aBtns--mini{margin-top:14px}

/* ===== Right info boxes (tag + box) ===== */
.aInfo{display:grid;gap:22px}
.tagBox{position:relative}
.tag{
  position:absolute;
  top:-16px; left:18px;
  padding: 10px 18px;
  border-radius: 14px;
  background:#eeb9c2;
  font-weight:900;
  border:2px solid var(--line);
}
.box{
  min-height: 126px;
  border:2px solid var(--line);
  border-radius: 14px;
  background: rgba(238,185,194,.25);
  padding: 22px 18px 16px;
  font-size:22px;
  font-weight:800;
  letter-spacing:.06em;
}
.tagBox--gallery .box{
  min-height:auto;
  padding: 18px 14px 14px;
}

/* ===== Gallery ===== */
.gallery{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 520px){ .gallery{grid-template-columns:repeat(2,1fr)} }
.gItem{
  width:100%;
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow:hidden;
  border:2px solid rgba(230,167,177,.6);
  background:#fff;
}
.gItem img{width:100%;height:100%;object-fit:cover}
.gEmpty{
  opacity:.75;
  font-weight:700;
  padding: 6px 2px;
}

/* ===== Titles ===== */
.titleLead{
  padding: 6px 8px 16px;
  font-weight:700;
  opacity:.8;
}
.titleGrid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
  padding: 10px 6px 16px;
}
@media (max-width: 800px){ .titleGrid{grid-template-columns:1fr} }
.tCard{
  border:2px solid var(--line);
  border-radius: 16px;
  background: rgba(238,185,194,.18);
  padding: 14px 16px;
  display:flex;
  align-items:center;
  gap:14px;
}
.tMark{
  width:44px;height:44px;
  border-radius: 14px;
  border:2px solid var(--line);
  background:#fff;
  display:grid;place-items:center;
  font-weight:900;
}
.tText{display:grid;gap:4px}
.tName{font-weight:900;font-size:18px}
.tReq{opacity:.75;font-weight:700}
.tCard--on{background: rgba(238,185,194,.32)}


/* --- PDFっぽい共通トーン（表紙と同じ生成り） --- */
body.paper{ background: var(--bg); }

/* 図鑑ヘッダー：タイトル中央＋右上にカウント */
.zHead{
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  gap:16px;
  padding: 0 6px 18px;
}
.zTitle{
  font-size: clamp(34px, 5vw, 54px);
  font-weight:900;
  letter-spacing:.08em;
  text-align:center;
  flex: 1;
}
.zRight{
  position:absolute;
  right:6px;
  top:0;
  display:flex;
  align-items:center;
  gap:14px;
  justify-content:flex-end;
}
.zCountWrap{display:flex; align-items:center; gap:10px;}
.zLogo{width:34px;height:34px; display:block; opacity:.9;}

/* 表紙ロゴ */
.siteLogo{width:56px;height:56px; display:block; margin:0 auto 10px; opacity:.9;}

/* 動物詳細：? の中央寄せ（空のときだけ） */
.box{
  /* 上のラベル（特徴など）と本文が重ならないように、上パディングを多めに確保 */
  padding: 34px 16px 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  min-height: 86px;
  line-height: 1.7;
}
.box[data-empty="true"]{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size: 22px;
  letter-spacing:.06em;
  color: rgba(47,44,43,.55);
}

/* 称号：メダル */
.tMark .medal{ width:42px; height:42px; display:block; }
.tCard--off .medal{ filter: grayscale(1) contrast(1.05); opacity:.72; }
.tCard--on .medal{ filter:none; opacity:1; }


/* Zukan cards are links: keep ink color (no blue/purple) */
.cardLink{ text-decoration:none; color:inherit; display:block; }
.cardLink:visited{ color:inherit; }

/* Small per-animal badge inside the thumbnail (keeps ? as main placeholder) */
.cardInner{ position:relative; }
.cardBadge{display:none;}

.zTitleLink{ text-decoration:none; color:inherit; }
.zTitleLink:visited{ color:inherit; }
