/* ============================================================
   ラボの入口（トップ）専用。色は lab.css の変数だけを使う
   ============================================================ */
.page-top { overflow-x: hidden; }
.page-top img { max-width: 100%; height: auto; }
.sp { display: none; }
@media (max-width: 560px) { .sp { display: inline; } }

/* ---------- 1. 入口 ---------- */
.t-hero {
  position: relative;
  padding: clamp(2.4rem, 6vw, 5rem) 0 clamp(2.6rem, 6vw, 4.6rem);
  background:
    radial-gradient(ellipse at 80% 20%, color-mix(in srgb, var(--honey) 22%, transparent), transparent 60%),
    var(--bg);
}
.t-hero__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.6rem, 4vw, 3.4rem); align-items: center; }
.t-hero__plaque { font-size: clamp(1rem, 2.4vw, 1.2rem); }
.t-hero__en { margin: 1.1rem 0 .3rem; letter-spacing: .3em; }
.t-hero__title { font-family: var(--serif); font-weight: 700; font-size: clamp(1.7rem, 4.4vw, 2.7rem); line-height: 1.45; margin: 0 0 1rem; color: var(--fg); }
.t-hero__lead { color: var(--fg-soft); line-height: 2; margin: 0 0 .8rem; }
.t-hero__three { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .12em; margin: 0 0 1.4rem; color: var(--fg); }
.t-hero__three i { font-style: normal; color: var(--accent); margin: 0 .5em; }
.t-hero__btns { flex-wrap: wrap; }
.t-hero__game { position: relative; }
.t-hero__new { position: absolute; top: -14px; right: -12px; font-size: .62rem; transform: rotate(12deg); }

.t-hero__scene { position: relative; padding: 0 0 3.2rem; }
.t-hero__photo { margin: 0; border-radius: 10px; box-shadow: 0 18px 40px rgba(40, 25, 10, .18); background: var(--bg-sunken); }
.t-hero__photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.t-hero__seal { position: absolute; top: -12px; left: -8px; transform: rotate(-10deg); }
.t-hero__memo { position: absolute; right: -6px; bottom: 0; width: min(78%, 330px); transform: rotate(1.6deg); }
.t-hero__date { margin: 0 0 .4rem; font-size: .82rem; line-height: 1.5; }
.t-hero__date b { font-size: 1rem; }
.t-hero__word { margin: 0; display: flex; flex-direction: column; gap: .1rem; }
.t-hero__who { font-family: var(--sans); font-size: .78rem; }
.lamp-glow {
  position: absolute; top: -10%; right: 8%; width: 46%; aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--lamp) 30%, transparent), transparent 65%);
  mix-blend-mode: soft-light; animation: t-glow 6s ease-in-out infinite alternate;
}
@keyframes t-glow { from { opacity: .45; } to { opacity: .9; } }

@media (max-width: 860px) {
  .t-hero__in { grid-template-columns: 1fr; }
  .t-hero__memo { position: relative; right: auto; width: auto; margin: -1.6rem .6rem 0 2rem; }
  .t-hero__scene { padding-bottom: 0; }
}

/* ---------- 2. お知らせの帯 ---------- */
.t-ribbon { background: var(--wood-d); color: #f8eedd; }
.t-ribbon.is-event { background: var(--shu); }
.t-ribbon__in { display: flex; align-items: center; gap: .8rem; padding-top: .65rem; padding-bottom: .65rem; color: inherit; text-decoration: none; font-size: .9rem; flex-wrap: wrap; }
.t-ribbon__tag { font-family: var(--hand); font-size: .78rem; border: 1px solid currentColor; border-radius: 999px; padding: .05rem .6rem; }
.t-ribbon__text { flex: 1; min-width: 0; }
.t-ribbon__left { white-space: nowrap; }
.t-ribbon .countdown { color: inherit; }
.t-ribbon__go { transition: transform .3s; }
.t-ribbon__in:hover .t-ribbon__go { transform: translateX(4px); }

/* ---------- 3. ゲームラボの紹介 ---------- */
.t-gamelab { position: relative; overflow: hidden; }
.t-gamelab__bg { position: absolute; inset: 0; opacity: .16; pointer-events: none; }
.t-gamelab__bg img { width: 100%; height: 100%; object-fit: cover; }
.t-gamelab__in { position: relative; z-index: 1; }
.t-gamelab__cards { margin-top: 1.6rem; }
.t-gcard__more { margin-top: auto; padding-top: .4rem; font-size: .8rem; color: #8a5a3a; }
.t-nojs-list { grid-column: 1 / -1; line-height: 2.2; }
.t-wip { margin-top: 1.8rem; text-align: center; }
.t-wip__k { font-family: var(--hand); color: var(--room-ink-soft); margin: 0 0 .5rem; }
.t-wip__list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; font-size: .86rem; color: var(--room-ink-soft); }
.t-wip__list li { display: flex; align-items: center; gap: .5rem; }
.t-wip__stamp { font-size: .58rem; }

/* ---------- 4. はじめての方へ ---------- */
.t-master { display: block; position: relative; color: var(--fg); text-decoration: none; max-width: 860px; transition: transform .35s, box-shadow .35s; }
.t-master:hover { transform: translateY(-3px); }
.t-master__stamp { position: absolute; top: -14px; right: 18px; transform: rotate(8deg); }
.t-master__title { font-family: var(--serif); font-size: clamp(1.15rem, 3vw, 1.5rem); line-height: 1.6; margin: .4rem 0; }
.t-master__go { font-weight: 700; color: var(--accent); }
.t-steps { list-style: none; padding: 0; margin: 2rem 0 0; }
.t-steps li { margin: 0; }
.t-steps li:nth-child(2) { transform: rotate(.8deg); }
.t-steps__k { font-size: .78rem; margin: 0; opacity: .8; }
.t-steps__t { font-weight: 600; font-size: 1.08rem; margin: 0 0 .3rem; }

/* ---------- 5. 敷地の案内図 ---------- */
.t-map-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.8rem; align-items: start; }
.t-map { position: relative; }
.t-map__paper { position: relative; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: var(--bg-panel); border: 1px solid var(--line); box-shadow: var(--shadow-paper); }
.t-map__img { display: block; width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1; }
.t-map__wait { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; font-family: var(--hand); color: var(--fg-soft); }
.t-map__paper.is-noimg .t-map__img { visibility: hidden; }
.t-pin {
  position: absolute; z-index: 2; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
  padding: .3rem .7rem .35rem; border-radius: 6px;
  background: var(--bg-panel); color: var(--fg); border: 1px solid var(--line-strong);
  box-shadow: 0 4px 10px rgba(40, 25, 10, .18); text-decoration: none; line-height: 1.3; white-space: nowrap;
  transition: transform .25s;
}
.t-pin::after { content: ""; position: absolute; bottom: -6px; left: 50%; width: 10px; height: 10px; background: inherit; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); transform: translateX(-50%) rotate(45deg); }
.t-pin span { font-weight: 700; font-size: .82rem; }
.t-pin small { font-size: .66rem; color: var(--fg-soft); }
.t-pin:hover, .t-pin:focus-visible { transform: translate(-50%, -112%); }
.t-pin--new { background: var(--cheese); color: #3c2a10; border-color: var(--honey); animation: t-sway 2.8s ease-in-out infinite; box-shadow: 0 0 0 4px color-mix(in srgb, var(--cheese) 35%, transparent), 0 0 18px color-mix(in srgb, var(--lamp) 70%, transparent); }
.t-pin--new small { color: var(--shu); font-weight: 700; }
@keyframes t-sway { 0%, 100% { transform: translate(-50%, -100%) rotate(-3deg); } 50% { transform: translate(-50%, -106%) rotate(3deg); } }
.t-map-list { list-style: none; padding: 0; margin: 0 0 1.4rem; display: none; }
.t-map-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; padding: .7rem .2rem; border-bottom: 1px dashed var(--line-strong); color: var(--fg); text-decoration: none; }
.t-map-list span { font-size: .82rem; color: var(--fg-soft); }
.t-photos { display: grid; gap: 1.6rem; }
.t-photo { margin: 0; background: var(--bg-panel); padding: .6rem .6rem .8rem; box-shadow: var(--shadow-paper); }
.t-photo:nth-child(1) { transform: rotate(-1deg); }
.t-photo:nth-child(2) { transform: rotate(1.2deg); }
.t-photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.t-photo figcaption { font-size: .82rem; line-height: 1.7; color: var(--fg-soft); margin-top: .5rem; }
.t-photo figcaption b { display: block; color: var(--fg); font-family: var(--serif); font-size: .95rem; }
@media (max-width: 860px) {
  .t-map-layout { grid-template-columns: 1fr; }
  .t-map-list { display: block; }
  .t-pin small { display: none; }
  .t-pin { padding: .2rem .45rem; }
  .t-pin span { font-size: .68rem; }
  .t-photos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .t-photos { grid-template-columns: 1fr; } }

/* ---------- 6. 研究員証 ---------- */
.t-ids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.t-id {
  --id: var(--accent);
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-paper); overflow: hidden;
}
.t-id--fumi { --id: var(--honey); }
.t-id--miso { --id: var(--navy); }
.t-id::before { content: ""; position: absolute; top: 8px; left: 50%; width: 46px; height: 8px; border-radius: 4px; background: var(--bg-sunken); border: 1px solid var(--line); transform: translateX(-50%); z-index: 2; }
.t-id__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 1.4rem 1rem .5rem; background: color-mix(in srgb, var(--id) 16%, var(--bg-panel)); border-bottom: 2px solid var(--id); font-size: .7rem; letter-spacing: .1em; color: var(--fg-soft); }
.t-id__head b { font-family: var(--serif); color: var(--fg); }
.t-id__main { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: .9rem; align-items: center; padding: 1rem 1rem .4rem; position: relative; }
.t-id__photo { margin: 0; }
.t-id__photo .portrait__frame { width: 88px; height: 88px; border-radius: 10px; }
.t-id__role { margin: 0; font-size: .74rem; color: var(--fg-soft); }
.t-id__name { margin: .1rem 0 .2rem; font-family: var(--serif); font-size: 1.25rem; }
.t-id__emo { margin: 0; font-size: .72rem; color: var(--fg-soft); line-height: 1.6; }
.t-id__seal { position: absolute; right: 12px; bottom: -6px; transform: rotate(-12deg); opacity: .85; font-size: .66rem; }
.t-id__text { padding: 0 1rem; font-size: .88rem; line-height: 1.9; margin: .6rem 0; }
.t-id__quote { padding: 0 1rem; margin: 0 0 .6rem; color: var(--accent); }
.t-id__dl { margin: auto 0 0; padding: .8rem 1rem 1rem; border-top: 1px dashed var(--line-strong); font-size: .82rem; }
@media (max-width: 960px) { .t-ids { grid-template-columns: minmax(0, 1fr); max-width: 620px; margin: 0 auto; } }

.t-sub { font-family: var(--serif); font-size: 1.2rem; margin: 3rem 0 1.2rem; }
.t-nb { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem 1rem; }
.t-nb__img img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.t-nb__k { margin: .7rem 0 0; font-size: .72rem; color: var(--fg-soft); }
.t-nb h4 { margin: .1rem 0 .3rem; font-family: var(--serif); font-size: 1.05rem; }
.t-nb p:last-child { margin: 0; font-size: .86rem; line-height: 1.8; }

/* ---------- 7. ラボについて ---------- */
.t-frame {
  margin: 0 auto 2rem; max-width: 820px; text-align: center;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2.4rem);
  background: var(--bg-panel);
  border: 10px solid var(--wood);
  outline: 1px solid var(--wood-d); outline-offset: -4px;
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px rgba(40, 25, 10, .15);
}
.t-frame figcaption { font-size: .78rem; letter-spacing: .2em; color: var(--fg-soft); margin-bottom: .8rem; }
.t-frame blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.15rem, 3.2vw, 1.7rem); line-height: 1.9; color: var(--fg); }
.t-about2 { margin-bottom: 1.4rem; }
.t-about2__k { margin: 0; font-size: .78rem; color: var(--fg-soft); }
.t-about2__t { font-family: var(--serif); font-size: 1.15rem; margin: .2rem 0; }
.t-four { margin: 0; padding-left: 1.2em; }
.t-pillar { text-align: center; padding: 1.4rem 1rem; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 12px; }
.t-pillar h3 { font-family: var(--serif); font-size: 1.25rem; margin: .7rem 0 .3rem; }
.t-pillar p { margin: 0; font-size: .88rem; line-height: 1.85; color: var(--fg-soft); }

/* ---------- 8. 読みもの（時間の流れ） ---------- */
.t-flow { list-style: none; margin: 0; padding: 0; position: relative; }
.t-flow::before { content: ""; position: absolute; top: .4rem; bottom: .4rem; left: 7.4rem; width: 2px; background: linear-gradient(var(--sun), var(--sky), var(--navy), var(--wood), var(--green)); opacity: .55; }
.t-flow__item { position: relative; display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: 1.8rem; margin: 0 0 1.4rem; }
.t-flow__item::before { content: ""; position: absolute; left: 7.4rem; top: .55rem; width: 14px; height: 14px; border-radius: 50%; transform: translateX(-6px); background: var(--dot, var(--accent)); border: 3px solid var(--bg); }
.t-flow--morning { --dot: var(--sun); }
.t-flow--noon { --dot: var(--sky); }
.t-flow--night { --dot: var(--navy); }
.t-flow--any { --dot: var(--wood); }
.t-flow--sun { --dot: var(--pink); }
.t-flow--member { --dot: var(--green); }
.t-flow__time { margin: .2rem 0 0; text-align: right; font-family: var(--serif); font-weight: 600; font-size: .95rem; line-height: 1.4; }
.t-flow__time small { display: block; font-family: var(--sans); font-weight: 400; font-size: .7rem; color: var(--fg-soft); }
.t-flow__multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.t-flow__card { display: block; background: var(--bg-panel); border: 1px solid var(--line); border-left: 4px solid var(--dot, var(--accent)); border-radius: 10px; padding: 1rem 1.1rem; color: var(--fg); text-decoration: none; transition: transform .3s, box-shadow .3s; }
.t-flow__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-paper); }
.t-flow__card h3 { margin: 0 0 .3rem; font-size: 1.02rem; }
.t-flow__card p { margin: 0 0 .5rem; font-size: .86rem; line-height: 1.85; color: var(--fg-soft); }
.t-flow__card .cluster { margin: 0; }
@media (max-width: 640px) {
  .t-flow::before { left: 6px; }
  .t-flow__item { grid-template-columns: minmax(0, 1fr); gap: .4rem; padding-left: 1.6rem; }
  .t-flow__item::before { left: 6px; top: .3rem; }
  .t-flow__time { text-align: left; }
  .t-flow__time small { display: inline; margin-left: .5em; }
}

/* ---------- 9. アプリ置き場 ---------- */
.t-shop .rail-head { align-items: flex-end; }
.t-shop .sec-head { margin-bottom: 0; }

/* ---------- 動きを止める ---------- */
@media (prefers-reduced-motion: reduce) {
  .lamp-glow, .t-pin--new { animation: none; }
  .t-master, .t-flow__card, .t-pin, .t-ribbon__go { transition: none; }
}

/* ---------- 見直し（10/11）：重なり・はみ出しの修正 ---------- */
/* 見出しは「ようこそ、」「心野まるっとラボへ。」の2行に固定 */
.t-hero__title { font-size: clamp(1.45rem, 3.1vw, 2.45rem); }
.t-hero__title2 { white-space: nowrap; }
@media (max-width: 860px) { .t-hero__title { font-size: clamp(1.3rem, 6.4vw, 2.3rem); } }
/* NEW の判子はボタンの右上の外側へ */
.t-hero__btns { padding-top: .7rem; padding-right: 1.2rem; }
.t-hero__new { top: -1.45rem; right: -1.35rem; z-index: 2; font-size: .5rem; pointer-events: none; }
/* 観測中の判子は写真の内側に収める */
.t-hero__seal { top: 8px; left: 8px; z-index: 3; }

/* お知らせの帯：スマホでは残り時間を次の行へ */
.t-ribbon .countdown { max-width: 100%; }
@media (max-width: 560px) {
  .t-ribbon__in { gap: .4rem .6rem; font-size: .84rem; }
  .t-ribbon__text { flex-basis: calc(100% - 6rem); }
  .t-ribbon__left { display: block; margin-top: .3rem; white-space: normal; }
  .t-ribbon .countdown { display: inline-flex; flex-wrap: wrap; font-size: .88em; }
}

/* 研究中の案件：看板絵が少し見える札＋判子 */
.t-wip__list { gap: 1rem; }
.t-wip__list li.t-wip__card { position: relative; display: flex; align-items: center; gap: .6rem; padding: .4rem 1.2rem .4rem .4rem; background: color-mix(in srgb, var(--bg-panel) 72%, transparent); border: 1px dashed var(--line-strong); border-radius: 10px; }
.t-wip__pic { flex: none; width: 64px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--bg-sunken); }
.t-wip__pic img { display: block; width: 100%; height: 100%; object-fit: cover; filter: blur(1px); opacity: .8; }
.t-wip__card b { font-weight: 600; }
.t-wip__card .t-wip__stamp { position: absolute; top: -.75rem; right: -.6rem; font-size: .56rem; transform: rotate(8deg); }

/* 研究員証：判子は写真の右下の角へ（文字にかけない） */
.t-id__main { align-items: start; }
.t-id__seal { right: auto; bottom: auto; left: calc(1rem + 60px); top: calc(1rem + 62px); z-index: 2; }

/* 敷地の案内図：地図を大きく、写真2枚は下に横並び */
.t-map-layout { grid-template-columns: minmax(0, 1fr); max-width: 1040px; margin: 0 auto; gap: 2rem; }
.t-photos { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .t-photos { grid-template-columns: 1fr; } }

/* アプリ置き場：小さいカードも中央にそろえる */
.t-shop .rail--few { justify-content: center; max-width: 980px; margin-left: auto; margin-right: auto; }

/* ---- 2026-10-11 主任の仕上げ ---- */
.t-hero__game { position: relative; }
.t-hero__new { position: absolute; top: -9px; right: -8px; left: auto; z-index: 2; width: auto; height: auto; font-size: .62rem; padding: .3rem .5rem .28rem; transform: rotate(8deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); pointer-events: none; }
.t-wip__list li.t-wip__card { background: rgba(255, 255, 255, .06); border-color: var(--room-line); color: var(--room-ink); }
.t-wip__card b { color: var(--room-ink); }
.t-wip__card .t-wip__stamp { --stamp: #f0a48e; }

/* ---- 2026-10-13 最初の画面から note へ（切符のような札） ---- */
.t-note {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: stretch;
  width: 100%; max-width: 440px; margin-top: 1.4rem;
  background: var(--bg-panel); color: var(--fg); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow-paper);
  transition: transform .25s, box-shadow .25s;
}
.t-note:hover, .t-note:focus-visible { transform: translateY(-2px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.t-note__main {
  display: flex; flex-direction: column; gap: .1rem; min-width: 0;
  padding: .75rem 1rem .8rem 1.1rem;
  border-left: 4px solid var(--green); border-radius: 12px 0 0 12px;
}
.t-note__k { font-size: .68rem; letter-spacing: .16em; color: var(--fg-soft); line-height: 1.5; }
.t-note__t { font-family: var(--serif); font-weight: 600; font-size: 1rem; line-height: 1.6; }
.t-note__t b { font-family: var(--sans); font-weight: 900; font-size: 1.12em; letter-spacing: .02em; color: var(--green-d); }
.t-note__s { font-size: .74rem; color: var(--fg-soft); line-height: 1.6; }
.t-note__stub {
  position: relative; display: grid; place-items: center; text-align: center;
  padding: .6rem 1rem; min-width: 5.6rem;
  font-weight: 700; font-size: .8rem; line-height: 1.45; letter-spacing: .06em;
  background: color-mix(in srgb, var(--green) 24%, var(--bg-panel));
  border-left: 2px dashed var(--line-strong); border-radius: 0 11px 11px 0;
}
/* 切り取り線の、上下の小さな切り欠き */
.t-note__stub::before, .t-note__stub::after {
  content: ""; position: absolute; left: -8px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-strong);
}
.t-note__stub::before { top: -8px; clip-path: inset(50% 0 0 0); }
.t-note__stub::after  { bottom: -8px; clip-path: inset(0 0 50% 0); }
:root[data-theme="dark"] .t-note__t b { color: var(--green); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-note__t b { color: var(--green); } }
@media (max-width: 860px) { .t-note { max-width: none; } }
@media (max-width: 380px) { .t-note__stub { min-width: 4.6rem; padding: .5rem .6rem; font-size: .74rem; } .t-note__t { font-size: .94rem; } }

/* 付箋の中の「今朝の朝ふみを読む」 */
.t-hero__memo-link {
  display: inline-block; margin-top: .45rem;
  font-family: var(--hand); font-weight: 600; font-size: .86rem;
  color: #6b4f3a; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.t-hero__memo-link:hover { color: #3c3128; text-decoration-thickness: 2px; }
@media (max-width: 480px) {
  .t-note__t { font-size: .88rem; letter-spacing: 0; }
  .t-note__main { padding: .65rem .8rem .7rem .9rem; }
  .t-ribbon__go { display: none; }
}

/* ---- 2026-10-13 明るい面と暗い面（無地で、壁紙を透かさない） ---- */
.page-top {
  --face-paper: #fffdf8; --face-light: #fbf6ec; --face-kraft: #f3e7d0;
  --face-ink: #26304a; --face-wood: #3f2e22;
  --face-on-dark: #f8eedd; --face-on-dark-soft: #e6d9c4; --face-on-dark-line: rgba(248, 238, 221, .22);
  --face-text-soft: #5a4d42;   /* 明るい面の本文（--fg-soft より濃いめ） */
  --face-edge: var(--wood-d);
}
:root[data-theme="dark"] .page-top {
  --face-paper: #232b3c; --face-light: #1f2636; --face-kraft: #2a3043;
  --face-ink: #141a28; --face-wood: #1a1410;
  --face-on-dark-soft: #dccfbc; --face-text-soft: #c4b8a6; --face-edge: #0c0f17;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-top {
    --face-paper: #232b3c; --face-light: #1f2636; --face-kraft: #2a3043;
    --face-ink: #141a28; --face-wood: #1a1410;
    --face-on-dark-soft: #dccfbc; --face-text-soft: #c4b8a6; --face-edge: #0c0f17;
  }
}
.t-face { position: relative; isolation: isolate; --fg-soft: var(--face-text-soft); }
/* 面の境目：上に細い木の帯と、やわらかい影 */
.t-face::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; pointer-events: none;
  background: linear-gradient(var(--wood-l), var(--face-edge));
  box-shadow: 0 3px 10px rgba(40, 25, 10, .16);
}
.t-face--paper { background: var(--face-paper); }
.t-face--light { background: var(--face-light); }
.t-face--kraft { background: var(--face-kraft); }
.t-face--dark  { background: var(--face-ink); color: var(--face-on-dark); }
.t-face--wood  { background: var(--face-wood); }
/* 暗い面の上の文字（カード＝明るい紙の中はそのまま） */
.t-face--dark > .wrap > .sec-head .sec-head__title { color: var(--face-on-dark); }
.t-face--dark > .wrap > .sec-head .sec-head__en { color: var(--lamp); }
.t-face--dark > .wrap > .sec-head .sec-head__lead { color: var(--face-on-dark-soft); }
.t-face--dark a:not([class]) { color: var(--lamp); }
.t-face--dark .t-master, .t-face--dark .notebook, .t-face--dark .memo, .t-face--dark .t-pillar, .t-face--dark .t-frame {
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 16px 34px rgba(0, 0, 0, .35);
}
.t-face--dark .t-pillar { border-color: transparent; }
/* ツール棚：白い紙に棚板の線 */
.t-shop .rail { padding-bottom: 1rem; border-bottom: 6px solid var(--wood-l); box-shadow: 0 10px 12px -8px rgba(40, 25, 10, .25); }
.t-face--paper .t-id, .t-face--paper .t-nb, .t-face--light .t-flow__card { border-color: var(--line-strong); }
.t-flow__item::before { border-color: var(--face-light); }
/* 暗い面に置いた明るい紙の中は、紙の文字色に戻す（主任の追記 10/13） */
.t-face--dark .notebook, .t-face--dark .t-master, .t-face--dark .t-pillar, .t-face--dark .t-frame, .t-face--dark .card { color: var(--fg); }
.t-face--dark .notebook a:not([class]), .t-face--dark .t-master a:not([class]), .t-face--dark .t-pillar a:not([class]) { color: var(--accent); }
/* ツール棚の小さいカードは、大きい1枚と同じ中心にそろえる */
.t-shop .rail--few { justify-content: center; max-width: 980px; margin-inline: auto; }
.t-shop #pickup-rail { max-width: 980px; margin-inline: auto; justify-content: safe center; }
/* 生成画像の組み込み（10/13） */
.t-gamelab__photo { max-width: 860px; margin: 0 auto 2.2rem; background: #fffaf0; padding: 10px; border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.4); transform: rotate(.6deg); }
.t-gamelab__photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; }
.t-mapillust { margin: 1.6rem 0 0; background: #fffdf8; padding: 10px 10px 14px; border-radius: 6px; box-shadow: var(--shadow-paper); color: #3c3128; }
.t-mapillust img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; }
.t-mapillust figcaption { font-size: .86rem; line-height: 1.7; margin-top: .55rem; color: #5a4d42; }
.t-mapillust figcaption b { display: block; font-family: var(--serif); color: #3c3128; }
