/* ============================================================
   ゲームラボ（/games/）専用の見た目
   /css/lab.css のあとに読みます。lab.css の変数を使います。
   ============================================================ */
:root {
  --board:      #2f4a3c;
  --board-2:    #263d31;
  --board-ink:  #f3f0e4;
  --board-soft: #c9d6c8;
  --cork:       #c79a63;
  --cork-2:     #b3854f;
  --frame-wood: #7a5534;
}
:root[data-theme="dark"] {
  --board: #22362c; --board-2: #1b2b23; --cork: #8e6c45; --cork-2: #7b5c3a; --frame-wood: #5e4128;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --board: #22362c; --board-2: #1b2b23; --cork: #8e6c45; --cork-2: #7b5c3a; --frame-wood: #5e4128;
  }
}

.page-gamelab main { overflow-x: clip; }

/* ---------- 入室の演出：木の両開き扉 ---------- */
.gl-door-on body { overflow: hidden; }
.gl-door {
  position: fixed; inset: 0; z-index: 1000; cursor: pointer;
  display: grid; place-items: center;
  perspective: 1400px;
  background: radial-gradient(ellipse at 50% 60%, #3a281b, #150e09 75%);
  transition: background-color .6s, opacity .5s ease .5s;
}
.gl-door__light {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 230, 170, .95), rgba(255, 196, 120, .5) 35%, transparent 70%);
  transition: opacity .55s ease;
}
.gl-door__frame {
  position: relative; display: flex;
  width: min(86vw, 520px); height: min(78vh, 720px);
  padding: 14px 14px 0; border-radius: 10px 10px 0 0;
  background: linear-gradient(90deg, #4a3020, #6b4a2f 50%, #4a3020);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 0 0 3px rgba(0, 0, 0, .3);
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.6, 0, .3, 1);
}
.gl-door__leaf {
  position: relative; flex: 1; height: 100%;
  background-color: #8a5f3b;
  background-image:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .0) 0 22px, rgba(0, 0, 0, .18) 22px 24px, rgba(255, 255, 255, .04) 24px 26px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='600'><filter id='w'><feTurbulence type='fractalNoise' baseFrequency='0.25 0.006' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 .25  0 0 0 0 .15  0 0 0 0 .07  0 0 0 .55 0'/></filter><rect width='300' height='600' filter='url(%23w)'/></svg>"),
    linear-gradient(180deg, #a0714a, #7a5232);
  background-size: auto, 300px 600px, auto;
  box-shadow: inset 0 0 0 4px rgba(40, 24, 12, .45), inset 0 0 40px rgba(0, 0, 0, .35);
  transition: transform .9s cubic-bezier(.6, 0, .3, 1);
  backface-visibility: hidden;
}
.gl-door.has-photo .gl-door__leaf { background-image: url("/assets/games/lab-door.jpg"); background-size: 200% 100%; }
.gl-door.has-photo .gl-door__leaf--l { background-position: left center; }
.gl-door.has-photo .gl-door__leaf--r { background-position: right center; }
.gl-door__leaf--l { transform-origin: left center; border-right: 2px solid rgba(30, 18, 10, .7); }
.gl-door__leaf--r { transform-origin: right center; }
/* 金具の帯 */
.gl-door__band {
  position: absolute; left: 0; right: 0; top: 16%; height: 14px;
  background: linear-gradient(180deg, #3b3632, #1f1b18);
  box-shadow: 0 2px 0 rgba(255, 255, 255, .08) inset, 0 3px 6px rgba(0, 0, 0, .4);
}
.gl-door__band::before, .gl-door__band::after {
  content: ""; position: absolute; top: 3px; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c9b48a, #6d5a3a);
}
.gl-door__band::before { left: 14%; } .gl-door__band::after { right: 14%; }
.gl-door__band--b { top: auto; bottom: 14%; }
.gl-door__handle {
  position: absolute; top: 50%; width: 12px; height: 46px; margin-top: -23px; border-radius: 8px;
  background: linear-gradient(90deg, #6b5a3c, #d8c08a, #6b5a3c);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5);
}
.gl-door__leaf--l .gl-door__handle { right: 12px; }
.gl-door__leaf--r .gl-door__handle { left: 12px; }
/* ふみまるの足あと */
.gl-door__paws { position: absolute; left: 30%; bottom: 6%; width: 50%; height: 30%; }
.gl-door__paws i {
  position: absolute; width: 14px; height: 12px; border-radius: 50% 50% 45% 45%;
  background: rgba(40, 22, 10, .55);
}
.gl-door__paws i::before {
  content: ""; position: absolute; top: -7px; left: -1px; width: 16px; height: 6px;
  background: radial-gradient(circle, rgba(40, 22, 10, .55) 2px, transparent 2.5px) 0 0 / 5.3px 6px repeat-x;
}
.gl-door__paws i:nth-child(1) { left: 10%; bottom: 0; transform: rotate(-12deg); }
.gl-door__paws i:nth-child(2) { left: 38%; bottom: 22%; transform: rotate(8deg); }
.gl-door__paws i:nth-child(3) { left: 22%; bottom: 48%; transform: rotate(-10deg); }
.gl-door__paws i:nth-child(4) { left: 52%; bottom: 72%; transform: rotate(10deg); }
/* 札 */
.gl-door__sign {
  position: absolute; left: 50%; top: 28%; transform: translateX(-50%) rotate(-2deg);
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .8rem 1.3rem .7rem; border-radius: 6px;
  background: #f4e7cc; color: #3b2a1c; text-align: center; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  font-family: var(--hand);
  transition: opacity .3s;
}
.gl-door__sign::before {
  content: ""; position: absolute; left: 50%; top: -26px; width: 50px; height: 26px; margin-left: -25px;
  border: 2px solid rgba(30, 20, 10, .7); border-bottom: 0; border-radius: 26px 26px 0 0;
}
.gl-door__sign b { font-family: var(--serif); font-size: clamp(1.3rem, 5vw, 1.8rem); letter-spacing: .12em; }
.gl-door__sign span { font-size: .9rem; color: #8a3b2a; }
.gl-door__btn { position: absolute; bottom: max(6vh, 24px); left: 50%; transform: translateX(-50%); }
/* 開く */
.gl-door.is-open { opacity: 0; pointer-events: none; }
.gl-door.is-open .gl-door__light { opacity: 1; }
.gl-door.is-open .gl-door__leaf--l { transform: rotateY(-105deg); }
.gl-door.is-open .gl-door__leaf--r { transform: rotateY(105deg); }
.gl-door.is-open .gl-door__frame { transform: translateZ(500px) scale(1.15); }
.gl-door.is-open .gl-door__sign, .gl-door.is-open .gl-door__btn { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .gl-door { display: none; } }

/* ---------- 部屋の最上部 ---------- */
.gl-hero { padding: clamp(5.5rem, 12vw, 7.5rem) 0 clamp(3rem, 7vw, 4.5rem); }
.gl-hero .crumbs, .gl-hero .crumbs a { color: var(--room-ink-soft); }
.gl-hero .crumbs { margin-bottom: 1.4rem; font-size: .8rem; }
.gl-lamp { height: 46px; opacity: .25; animation: glLampOn .6s ease forwards, lampFlicker 7s 2s infinite; animation-delay: calc(.35s + var(--i) * .35s), calc(2s + var(--i) * 1s); }
.gl-lamp::after { top: 42px; }
@keyframes glLampOn { 0% { opacity: .25; } 40% { opacity: .9; } 55% { opacity: .4; } 100% { opacity: 1; } }
.gl-hero__grid { display: grid; gap: clamp(1.6rem, 4vw, 3rem); align-items: center; }
@media (min-width: 860px) { .gl-hero__grid { grid-template-columns: 1.05fr 1fr; } }
.gl-hero__sign {
  display: inline-block; margin: 0 0 .9rem; padding: .25rem .9rem; transform: rotate(-2deg);
  background: #f4e7cc; color: #3b2a1c; border-radius: 4px; font-size: .86rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}
.gl-hero__title {
  font-family: var(--serif); font-size: clamp(2.6rem, 10vw, 4.6rem); line-height: 1.15; letter-spacing: .14em;
  color: var(--lamp); margin: .1rem 0 .6rem;
  text-shadow: 0 0 24px rgba(255, 200, 120, .45), 0 2px 0 rgba(0, 0, 0, .35);
}
.gl-hero__lead { font-family: var(--serif); font-size: clamp(1.15rem, 3.4vw, 1.5rem); margin-bottom: .8rem; }
.gl-hero__sub { color: var(--room-ink-soft); font-size: .93rem; margin-bottom: 1.6rem; }
.gl-hero__side { display: grid; gap: 1.2rem; }
.gl-frame {
  margin: 0; padding: 12px; border-radius: 6px; transform: rotate(1deg);
  background: linear-gradient(135deg, var(--frame-wood), #4a301c);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .08);
}
.gl-frame img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; }

/* 黒板（共通） */
.gl-board {
  position: relative; padding: 1.1rem 1.3rem 1.2rem; border-radius: 6px;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .06), transparent 60%), var(--board);
  color: var(--board-ink);
  border: 10px solid var(--frame-wood);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4), inset 0 0 30px rgba(0, 0, 0, .3);
  font-family: var(--hand);
}
.gl-board__head { margin: 0 0 .5rem; font-size: .95rem; letter-spacing: .1em; color: var(--board-soft); border-bottom: 1px dashed rgba(243, 240, 228, .3); padding-bottom: .3rem; }
.gl-status__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.gl-status__list div { text-align: center; }
.gl-status__list dt { font-size: .74rem; color: var(--board-soft); }
.gl-status__list dd { margin: 0; font-size: .82rem; }
.gl-status__list b { font-family: var(--hand); font-weight: 600; font-size: clamp(1.5rem, 6vw, 2.1rem); color: #fff6c9; font-variant-numeric: tabular-nums; }
.gl-board__chalk { position: absolute; right: .9rem; bottom: -.1rem; margin: 0; font-size: .72rem; color: var(--board-soft); opacity: .7; transform: rotate(-3deg); }

.gl-talks { display: grid; gap: .2rem; margin-top: clamp(2rem, 5vw, 3rem); max-width: 760px; }
@media (min-width: 860px) { .gl-talks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: none; } .gl-talks .talk + .talk { margin-top: 0; } .gl-talks .talk--r { grid-template-columns: 56px 1fr; } .gl-talks .talk--r .talk__face { order: 0; } }
.room .talk__bubble { color: var(--fg); }

/* ---------- 開催中の大会：ポスター ---------- */
.gl-event { background: var(--bg-kraft, var(--bg-sunken)); }
.gl-poster {
  position: relative; display: grid; gap: 1.6rem;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--bg-panel); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  transform: rotate(-.4deg);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--shu) 10%, transparent), transparent 40%);
}
@media (min-width: 900px) { .gl-poster { grid-template-columns: 1.4fr 1fr; } }
.gl-poster__pin { position: absolute; top: 10px; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9a8a, var(--shu)); box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.gl-poster__pin--l { left: 14px; } .gl-poster__pin--r { right: 14px; }
.gl-poster__kicker { margin: 0 0 .2rem; font-weight: 700; color: var(--shu); letter-spacing: .06em; }
.gl-poster__title { font-family: var(--sans); font-weight: 900; font-size: clamp(1.9rem, 7vw, 3rem); line-height: 1.2; margin: 0 0 .8rem; }
.gl-poster__state { margin: 0 0 .6rem; }
.gl-poster__left { margin: 0 0 .6rem; font-weight: 700; }
.gl-poster .countdown__n { background: var(--room); color: var(--lamp); }
.gl-poster__period { color: var(--fg-soft); font-size: .9rem; margin-bottom: 1rem; }
.gl-poster__rules { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.gl-poster__rules li { display: flex; gap: .6rem; align-items: baseline; }
.gl-poster__num { flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent-soft); font-weight: 900; font-size: .85rem; }
.gl-poster__prize { padding: .6rem .9rem; background: color-mix(in srgb, var(--sun) 22%, var(--bg-panel)); border-radius: 8px; margin-bottom: 1.2rem; }
.gl-poster__side { min-width: 0; }
.gl-poster__sidehead { font-weight: 700; margin-bottom: .4rem; }
.gl-poster__note { font-size: .78rem; color: var(--fg-soft); margin: .6rem 0 1rem; }
.gl-poster.is-tally { transform: none; opacity: .96; }

/* ---------- 実験棚 ---------- */
.gl-shelf__list { display: grid; gap: clamp(2.4rem, 6vw, 4rem); position: relative; }
.gl-item { position: relative; display: grid; gap: 1.2rem; align-items: start; padding-bottom: clamp(1.6rem, 4vw, 2.4rem); }
/* 棚板 */
.gl-item::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: 0; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, #9b7049, #6b4a2f 60%, #4a3020);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .45);
}
@media (min-width: 900px) {
  .gl-item { grid-template-columns: 1fr 1.1fr; gap: 2rem; }
  .gl-item--alt .gl-item__media { order: 2; }
  .gl-item__memo { position: absolute; bottom: 2.6rem; left: 1rem; max-width: 260px; }
  .gl-item--alt .gl-item__memo { left: auto; right: 1rem; }
}
.gl-item__media {
  position: relative; padding: 8px; background: #fffaf0; border-radius: 4px; transform: rotate(-1.2deg);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4); transition: transform .4s cubic-bezier(.2, .9, .3, 1.3);
}
.gl-item--alt .gl-item__media { transform: rotate(1.2deg); }
.gl-item:hover .gl-item__media { transform: rotate(0) translateY(-4px); }
.gl-item__media img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.gl-item__fallback { display: none; }
.gl-item__media.is-noimg { aspect-ratio: 1200 / 630; display: grid; place-items: center; background: #efe2c8; }
.gl-item__media.is-noimg .gl-item__fallback { display: block; font-size: 3rem; }
.gl-item__card { overflow: visible; }
.gl-item__card:hover { transform: translateY(-6px); }
.gl-item__stamps { display: flex; flex-wrap: wrap; gap: .4rem; padding: .9rem 1.1rem 0; }
.gl-item__stamps .stamp { font-size: .72rem; }
.gl-item__title { font-size: clamp(1.4rem, 4.6vw, 1.85rem); }
.gl-item__catch { margin: 0; font-weight: 700; color: #8a3b2a; }
.gl-item__lead { margin: .2rem 0 .3rem; font-size: .9rem; color: #5a4c40; line-height: 1.85; }
.gl-item__collab { margin: 0; font-size: .86rem; color: #3c3128; }
.gl-item__collab a { color: #8a3b2a; font-weight: 700; }
.gl-item__chips .chip { background: #f3e8d4; border-color: #e0cfb1; color: #5a4c40; font-size: .74rem; }
.gl-item__spec { margin: .4rem 0 0; display: grid; gap: .25rem; font-size: .84rem; color: #5a4c40; }
.gl-item__spec div { display: grid; grid-template-columns: 5.5em 1fr; gap: .4rem; }
.gl-item__spec dt { color: #8a7562; }
.gl-item__spec dd { margin: 0; }
.gl-cheese span { opacity: .22; filter: grayscale(1); }
.gl-cheese span.on { opacity: 1; filter: none; }
.gl-item__rec { margin-top: .6rem; }
.gl-item__who:not(:empty)::before { content: "（"; }
.gl-item__who:not(:empty)::after { content: "）"; }
.gl-item__who span:empty { display: none; }
.gl-item__total { margin-left: auto; }
.gl-item__btns { margin-top: .8rem; }
.gl-item__btns .btn--ghost { color: #3c3128; border-color: #cdb998; }
.gl-item__tease { margin: .5rem 0 0; font-size: .8rem; color: #8a7562; text-align: right; }
.gl-item__memo { transform: rotate(2deg); box-shadow: 0 8px 18px rgba(0, 0, 0, .3); color: #3c3128; }
.gl-item__memo p { font-size: .86rem; }
.gl-noscript { list-style: none; padding: 0; display: grid; gap: .8rem; }
.gl-noscript li { padding: 1rem 1.2rem; background: rgba(255, 255, 255, .08); border-radius: 10px; }

/* ---------- ふみまるのおすすめ ---------- */
.gl-pick__box { padding: clamp(1.2rem, 4vw, 2rem); border-radius: 10px; }
.gl-pick__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: .6rem; margin-bottom: 1.2rem; }
.gl-tile {
  display: block; padding: .8rem .7rem; text-align: center; border-radius: 10px;
  background: var(--bg-sunken); border: 2px dashed var(--line-strong);
  font-weight: 900; font-size: .9rem; line-height: 1.4;
  transition: background .12s, transform .12s, box-shadow .12s;
}
.gl-tile__no { display: block; font-family: var(--serif); font-weight: 600; font-size: .68rem; letter-spacing: .14em; color: var(--fg-soft); }
.gl-tile.is-lit { background: color-mix(in srgb, var(--sun) 45%, var(--bg-panel)); border-style: solid; border-color: var(--sun); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 30%, transparent); transform: translateY(-2px); }
.gl-tile.is-chosen { animation: glPop .6s ease; }
@keyframes glPop { 30% { transform: scale(1.08) rotate(-2deg); } 60% { transform: scale(.98) rotate(1deg); } }
.gl-pick__result { margin-top: 1.2rem; min-height: 1rem; }
.gl-pick__talk { margin-bottom: 1rem; }
.gl-pick__think { text-align: center; color: var(--fg-soft); }

/* ---------- 記録掲示板（黒板） ---------- */
.gl-chalk {
  position: relative; max-width: 820px; margin: 0 auto;
  padding: clamp(1rem, 4vw, 2rem) clamp(.9rem, 4vw, 2.2rem) 2.4rem;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, .07), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(255, 255, 255, .05), transparent 50%),
    var(--board);
  color: var(--board-ink); font-family: var(--hand);
  border: clamp(10px, 2.4vw, 16px) solid var(--frame-wood); border-radius: 6px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .5), inset 0 0 50px rgba(0, 0, 0, .35);
}
.gl-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.gl-tabs [role="tab"] {
  font: inherit; font-size: .95rem; cursor: pointer;
  padding: .45rem 1rem; border-radius: 999px;
  background: transparent; color: var(--board-soft); border: 1.5px dashed rgba(243, 240, 228, .45);
}
.gl-tabs [role="tab"][aria-selected="true"] { background: rgba(255, 246, 201, .14); color: #fff6c9; border-style: solid; border-color: #fff6c9; }
.gl-tabs [role="tab"]:focus-visible, .gl-chalk__panel:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }
.gl-chalk__label { margin: 0 0 .5rem; font-size: .85rem; color: var(--board-soft); }
.gl-reclist { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.gl-reclist .rec-row {
  display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; gap: .6rem; align-items: baseline;
  padding: .45rem .2rem; border-bottom: 1px dashed rgba(243, 240, 228, .2);
  font-size: clamp(.95rem, 3.4vw, 1.1rem);
}
.gl-reclist .rec-row__no { text-align: center; color: var(--board-soft); }
.gl-reclist .rec-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-reclist .rec-row__val { font-weight: 600; color: #fff6c9; font-variant-numeric: tabular-nums; }
.gl-reclist .rec-row--1 .rec-row__no, .gl-reclist .rec-row--2 .rec-row__no, .gl-reclist .rec-row--3 .rec-row__no { font-size: 0; }
.gl-reclist .rec-row--1 .rec-row__no::before { content: "🥇"; font-size: 1.2rem; }
.gl-reclist .rec-row--2 .rec-row__no::before { content: "🥈"; font-size: 1.2rem; }
.gl-reclist .rec-row--3 .rec-row__no::before { content: "🥉"; font-size: 1.2rem; }
.gl-reclist .rec-row--1 { font-size: clamp(1.05rem, 3.8vw, 1.25rem); }
.gl-reclist__empty { padding: 1rem .2rem; color: var(--board-soft); }
.gl-chalk__note { margin: 1rem 0 0; font-size: .78rem; color: var(--board-soft); }
.gl-chalk__eraser {
  position: absolute; right: 8%; bottom: -6px; width: 70px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, #e9e1d0 0 45%, #6b5a4a 45%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .4);
}
.gl-chalk__eraser::before { content: ""; position: absolute; left: -46px; top: 6px; width: 34px; height: 7px; border-radius: 4px; background: #fbf6ea; }
/* 紙の上（ポスターの中）の一覧 */
.gl-reclist--paper .rec-row { border-bottom-color: var(--line); }
.gl-reclist--paper .rec-row__no { color: var(--fg-soft); }
.gl-reclist--paper .rec-row__val { color: var(--fg); font-weight: 900; }
.gl-reclist--paper .gl-reclist__empty { color: var(--fg-soft); }

/* ---------- ラボの殿堂 ---------- */
.gl-hall__cabinet {
  position: relative; overflow: hidden; max-width: 900px; margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1rem, 4vw, 2rem) 0;
  background: linear-gradient(180deg, var(--room), var(--room-2, var(--room)));
  border: 12px solid var(--frame-wood); border-bottom-width: 0; border-radius: 8px 8px 0 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .3);
  color: var(--room-ink);
}
.gl-hall__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .25; pointer-events: none; }
.gl-hall__shelf {
  position: relative; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  padding-bottom: 26px;
}
.gl-hall__shelf::after {
  content: ""; position: absolute; left: -2rem; right: -2rem; bottom: 0; height: 22px;
  background: linear-gradient(180deg, #a07449, #6b4a2f);
}
.gl-trophy { text-align: center; padding: .4rem .4rem 1rem; }
.gl-trophy__cup { position: relative; display: inline-grid; place-items: center; width: 6rem; height: 6rem; margin-bottom: .4rem; font-size: 3.6rem; filter: drop-shadow(0 0 18px rgba(255, 210, 120, .5)); }
.gl-trophy__title { margin: 0; font-family: var(--serif); font-weight: 700; color: var(--lamp); letter-spacing: .1em; }
.gl-trophy__name { margin: .1rem 0 0; font-weight: 900; font-size: 1.3rem; }
.gl-trophy__rec { margin: 0; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--room-ink); }
.gl-trophy__ev { margin: .2rem 0 .7rem; font-size: .78rem; color: var(--room-ink-soft); }
.gl-trophy .btn--ghost { color: var(--room-ink); border-color: var(--room-line, rgba(255, 255, 255, .3)); }
/* 布をかぶったトロフィー */
.gl-trophy.is-veiled .gl-trophy__cup { filter: none; }
.gl-trophy.is-veiled .gl-trophy__cup span { opacity: .15; }
.gl-trophy__cloth {
  position: absolute; inset: -4px 2px 0; border-radius: 48% 48% 10% 10% / 70% 70% 10% 10%;
  background:
    repeating-linear-gradient(100deg, rgba(0, 0, 0, .0) 0 10px, rgba(0, 0, 0, .12) 10px 13px),
    linear-gradient(180deg, #c9b8d8, #8e7aa6);
  box-shadow: 0 8px 14px rgba(0, 0, 0, .35);
}
.gl-trophy__cloth::after { content: "？"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.8rem; color: rgba(255, 255, 255, .85); font-style: normal; }
.gl-trophy.is-veiled .gl-trophy__name { letter-spacing: .3em; }

/* ---------- 研究中の案件 ---------- */
.gl-wipcard { display: grid; background: var(--bg-panel); border: 1px dashed var(--line-strong); border-radius: 12px; overflow: hidden; }
.gl-wipcard__media { position: relative; background: var(--bg-sunken); aspect-ratio: 1200 / 630; overflow: hidden; }
.gl-wipcard__media img { width: 100%; height: 100%; object-fit: cover; filter: blur(5px) saturate(.7); transform: scale(1.08); opacity: .8; }
.gl-wipcard__stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); font-size: 1.1rem; background: var(--bg-panel); }
.gl-wipcard__body { padding: 1rem 1.2rem 1.2rem; }
.gl-wipcard__title { font-weight: 900; font-size: 1.15rem; margin: .1rem 0 .3rem; }
.gl-wipcard__title small { display: block; font-size: .8rem; font-weight: 500; color: var(--fg-soft); }
.gl-wipcard__catch { font-weight: 700; margin: 0 0 .3rem; }
.gl-wipcard__lead { font-size: .88rem; color: var(--fg-soft); margin: 0 0 .5rem; }
.gl-wipcard__memo { margin: 0; font-size: .86rem; }

/* ---------- 決まりごと（コルクボード） ---------- */
.gl-cork {
  list-style: none; margin: 0 auto; max-width: 980px;
  padding: clamp(1.2rem, 4vw, 2rem);
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  background-color: var(--cork);
  background-image: radial-gradient(rgba(0, 0, 0, .12) 1px, transparent 1.4px), radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1.4px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 4px;
  border: 12px solid var(--frame-wood); border-radius: 6px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .25), 0 12px 30px rgba(0, 0, 0, .2);
}
.gl-cork .memo { margin: 0; color: #3c3128; position: relative; }
.gl-cork .memo:nth-child(odd) { transform: rotate(-1.5deg); }
.gl-cork .memo:nth-child(even) { transform: rotate(1.2deg); }
.gl-cork .memo::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9a8a, #c0392b); box-shadow: 0 2px 3px rgba(0, 0, 0, .35); }
.gl-cork .memo p { font-size: .9rem; }

/* ---------- ゲームの作り方 ---------- */
.gl-howto__text { text-align: center; font-size: .88rem; color: var(--fg-soft); margin: 0; }
.gl-howto__text .hand { font-size: 1rem; color: var(--fg); }

/* ---------- 動きを止める ---------- */
@media (prefers-reduced-motion: reduce) {
  .gl-lamp { animation: none; opacity: 1; }
  .gl-item__media, .gl-item__card, .gl-tile { transition: none; }
  .gl-item:hover .gl-item__media { transform: rotate(-1.2deg); }
  .gl-tile.is-chosen { animation: none; }
}

/* ---------- 見直し（10/11）：ヒーローの小物棚 ---------- */
.gl-deco { position: relative; padding: .6rem .4rem 0; }
.gl-deco__glow {
  position: absolute; left: 10%; right: 10%; top: -10%; height: 90%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 214, 150, .32), transparent 70%);
}
.gl-deco__row { position: relative; display: flex; justify-content: space-around; align-items: flex-end; min-height: 3.4rem; padding: 0 .6rem; }
.gl-deco__row--2 { justify-content: space-evenly; min-height: 3rem; margin-top: .9rem; }
.gl-deco__plank {
  display: block; height: 12px; border-radius: 3px;
  background: linear-gradient(180deg, #a87c52, #6b4a2f 65%, #4a3020);
  box-shadow: 0 8px 14px rgba(0, 0, 0, .4);
}
.gl-deco__it { display: inline-flex; align-items: flex-end; gap: .1rem; cursor: default; transform-origin: 50% 100%; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .35)); }
.gl-deco__it i { font-style: normal; font-size: 2.1rem; line-height: 1; }
.gl-deco__it i.sm { font-size: 1.2rem; }
.gl-deco__row--2 .gl-deco__it i { font-size: 1.7rem; }
.gl-deco__it:hover, .gl-deco__it:active { animation: glHop .5s ease; }
@keyframes glHop { 35% { transform: translateY(-8px) rotate(-4deg); } 65% { transform: translateY(0) rotate(2deg); } }
/* lab-room.jpg が置かれたら、絵が主役。棚は1段だけ控えめに */
.gl-hero__side:has(.gl-frame) .gl-deco { opacity: .85; }
.gl-hero__side:has(.gl-frame) .gl-deco__row--2,
.gl-hero__side:has(.gl-frame) .gl-deco__row--2 + .gl-deco__plank { display: none; }
@media (max-width: 859px) { .gl-deco { max-width: 420px; margin: 0 auto; width: 100%; } .gl-deco__it i { font-size: 1.8rem; } }
@media (prefers-reduced-motion: reduce) { .gl-deco__it:hover, .gl-deco__it:active { animation: none; } }

/* 札の中の文字・リンク・はんこは、夜でも紙の色で読めるように */
.gl-item__card a:not(.btn) { color: #8a3b2a; text-decoration: underline; text-underline-offset: 2px; }
.gl-item__card { --bg-panel: #fffaf0; }
.gl-item__stamps .stamp { --stamp: #c0392b; }
.gl-item__stamps .stamp--green { --stamp: #3f7a52; }
.gl-item__stamps .stamp--navy { --stamp: #2e4a7a; }

/* 入室の扉：ボタンは扉の下に置く */
.gl-door { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 3vh, 28px); }
.gl-door__frame { height: min(72vh, 680px); }
.gl-door__btn { position: static; transform: none; flex: 0 0 auto; }

/* スマホの詰まり */
@media (max-width: 520px) {
  .gl-status__list dt { font-size: .68rem; line-height: 1.4; }
  .gl-board__chalk { position: static; text-align: right; margin-top: .4rem; }
  .gl-poster { transform: none; }
  .gl-item__spec div { grid-template-columns: 4.6em 1fr; }
  .gl-item__memo { max-width: none; }
  .gl-cork { grid-template-columns: 1fr; padding: 1rem; border-width: 8px; }
  .gl-reclist .rec-row { grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: .4rem; }
  .gl-trophy__ev { overflow-wrap: anywhere; }
}

/* ---------- 2026-10-13：note の共同マガジンへ ---------- */
/* ヒーローの切符（暗い部屋の上に貼った紙なので、朝も夜も紙の色のまま） */
.gl-mag {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: stretch;
  width: 100%; max-width: 440px; margin-top: 1.4rem;
  background: #fffaf0; color: #3c3128; text-decoration: none;
  border: 1px solid #d9c9ad; border-radius: 12px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .12), 0 12px 28px rgba(0, 0, 0, .3);
  transform: rotate(-.6deg);
  transition: transform .25s, box-shadow .25s;
}
.gl-mag:hover, .gl-mag:focus-visible { transform: translateY(-2px) rotate(0deg); box-shadow: 0 2px 0 rgba(0, 0, 0, .12), 0 18px 36px rgba(0, 0, 0, .36); }
.gl-mag__main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .75rem 1rem .8rem 1.1rem; border-left: 4px solid #5f7d57; border-radius: 12px 0 0 12px; }
.gl-mag__k { font-size: .68rem; letter-spacing: .16em; color: #8a7562; line-height: 1.5; }
.gl-mag__t { font-family: var(--sans); font-weight: 900; font-size: 1.05rem; line-height: 1.5; color: #2c1f17; }
.gl-mag__s { font-size: .74rem; color: #6f6155; line-height: 1.6; }
.gl-mag__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; color: #3c3128;
  background: #e3ecd9; border-left: 2px dashed #cdbb9c; border-radius: 0 11px 11px 0;
}
.gl-mag__stub::before, .gl-mag__stub::after {
  content: ""; position: absolute; left: -8px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--room); border: 1px solid #cdbb9c;
}
.gl-mag__stub::before { top: -8px; clip-path: inset(50% 0 0 0); }
.gl-mag__stub::after  { bottom: -8px; clip-path: inset(0 0 50% 0); }
@media (max-width: 480px) {
  .gl-mag { max-width: none; }
  .gl-mag__main { padding: .65rem .8rem .7rem .9rem; }
  .gl-mag__t { font-size: .95rem; }
  .gl-mag__stub { min-width: 4.6rem; padding: .5rem .6rem; font-size: .74rem; }
}

/* いちばん下の「ゲームの記録は、note にも」 */
.gl-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.2rem; max-width: 920px; margin: 0 auto; }
.gl-notes__card {
  position: relative; display: flex; flex-direction: column; gap: .45rem;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.2rem; box-shadow: var(--shadow-paper);
  transition: transform .25s, box-shadow .25s;
}
.gl-notes__card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.gl-notes__card--mag { border-left: 4px solid var(--green); }
.gl-notes__stamp { position: absolute; top: -12px; right: 16px; font-size: .68rem; background: var(--bg-panel); }
.gl-notes__title { font-family: var(--sans); font-weight: 900; font-size: 1.06rem; line-height: 1.55; color: var(--fg); text-decoration: none; }
/* カード全体を押せるように（リンクの当たり判定をカードいっぱいに広げる） */
.gl-notes__title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.gl-notes__title:focus-visible { outline: none; }
.gl-notes__title:focus-visible::after { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.gl-notes__card p { margin: 0; font-size: .88rem; color: var(--fg-soft); line-height: 1.85; }
.gl-notes__go { margin-top: auto; padding-top: .4rem; font-size: .82rem; font-weight: 700; color: var(--accent); }
:root[data-theme="dark"] .gl-notes__stamp.stamp--green { --stamp: var(--green); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gl-notes__stamp.stamp--green { --stamp: var(--green); } }

/* ---------- 2026-10-13 生成画像の組み込み ---------- */
.gl-frame img.gl-frame__night { display: none; }
:root[data-theme="dark"] .gl-frame img.gl-frame__day { display: none; }
:root[data-theme="dark"] .gl-frame img.gl-frame__night { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gl-frame img.gl-frame__day { display: none; }
  :root:not([data-theme="light"]) .gl-frame img.gl-frame__night { display: block; }
}
.gl-recphoto { max-width: 560px; margin: 0 auto 2rem; background: #fffaf0; padding: 8px; border-radius: 6px; transform: rotate(-1.2deg); box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.gl-recphoto img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; }
.gl-hall__bg { opacity: .32; }
