/* 研究ファイルのページ(マゼモンとは?・カードバトル・コロシアム) */

:root,
.ap-page {
  --ap-glass: rgba(6, 26, 62, 0.88);
  --ap-line: rgba(157, 252, 255, 0.55);
  --ap-glow: rgba(0, 169, 255, 0.35);
  --ap-pink: var(--color-magenta);
  --ap-yellow: var(--color-yellow);
}

/* 入口 */
.ap-hero { padding-bottom: 48px; }
.ap-page .about-hero-logo { display: block; margin: 18px auto 0; }
.ap-hl.ap-hero-lead { margin: 16px auto 0; max-width: 760px; text-align: center; }
.ap-hero-text {
  margin: 12px auto 0;
  max-width: 640px;
  font-size: 0.95rem;
  line-height: 1.85;
  text-align: center;
  color: var(--color-text-cyan-pale);
  text-wrap: pretty;
}
.ap-hero-text strong { color: var(--color-text-cyan); }

.ap-files {
  list-style: none;
  margin: 30px auto 0;
  padding: 0;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
}
.ap-files li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .ap-files { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ap-files li:last-child:nth-child(odd) { grid-column: auto; }
}
.ap-file-btn {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  padding: 8px 12px;
  text-align: left;
  color: var(--color-white);
  background: var(--ap-glass);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: 0 8px 8px 8px;
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--c) 14%, transparent), 0 0 14px rgba(0, 169, 255, 0.18);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ap-file-btn::before {
  content: "FILE";
  position: absolute;
  left: -1px;
  bottom: 100%;
  padding: 1px 10px 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  line-height: 1.3;
  color: var(--color-header);
  background: var(--c);
  border-radius: 6px 6px 0 0;
}
.ap-file-btn:active { transform: translateY(2px); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 45%, transparent); }
.ap-file-btn:focus-visible { outline: 2px solid var(--color-white); outline-offset: 3px; }
.ap-fbtn-no {
  position: relative;
  font-family: var(--font-title);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--c);
  text-shadow: 0 0 10px color-mix(in srgb, var(--c) 70%, transparent);
}
.ap-fbtn-jp { position: relative; font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; line-height: 1.3; }
@media (max-width: 759px) {
  .ap-file-btn { column-gap: 7px; padding: 8px 9px; }
  .ap-fbtn-jp { font-size: clamp(0.95rem, 4.2vw, 1.1rem); }
}

/* ケレン味のある見出し */
.ap-hl {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  line-height: 1.12;
  color: var(--color-white);
  text-shadow: 0 0 14px rgba(0, 169, 255, 0.45), 1px 0 0 rgba(255, 0, 92, 0.34), -1px 0 0 rgba(0, 233, 255, 0.34);
}
.ap-hl > span { display: inline-block; vertical-align: baseline; }
.ap-hl :is(.s, .m, .l) { font-family: var(--font-title-text); }
.ap-hl .s { font-size: clamp(1.15rem, 5vw, 1.6rem); }
.ap-hl .m { font-size: clamp(1.4rem, 6.4vw, 2.2rem); }
.ap-hl .l,
.ap-hl .n {
  font-size: clamp(2rem, 9.4vw, 3.6rem);
  transform: skewX(-8deg);
  background: linear-gradient(180deg, #ffffff 15%, var(--c, var(--color-text-cyan)) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c, #4dfaff) 55%, transparent)) drop-shadow(0 3px 0 rgba(1, 10, 30, 0.9));
}
.ap-hl .n {
  font-size: clamp(3rem, 15vw, 5.2rem);
  line-height: 0.95;
  margin-right: 0.04em;
  background: linear-gradient(180deg, #fff8c2 10%, var(--ap-yellow) 60%, #ff9d2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(255, 210, 63, 0.55)) drop-shadow(0 3px 0 rgba(1, 10, 30, 0.9));
}
.ap-hl .pink {
  background: linear-gradient(180deg, var(--color-magenta-light) 10%, var(--ap-pink) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(255, 95, 168, 0.55)) drop-shadow(0 3px 0 rgba(1, 10, 30, 0.9));
}
.ap-hl .br { display: block; height: 0; }

/* ファイルの見出し */
.ap-file-head {
  position: relative;
  overflow: hidden;
  scroll-margin-top: 116px;
  padding: 26px 16px 34px;
  color: var(--color-white);
  background: radial-gradient(ellipse 80% 70% at 30% 20%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%), var(--color-navy-900);
  border-top: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 -1px 18px color-mix(in srgb, var(--c) 40%, transparent);
}
.ap-file-head::before {
  content: "";
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: -40px;
  height: 180px;
  transform: perspective(260px) rotateX(62deg);
  transform-origin: 50% 100%;
  background:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, transparent) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--c) 45%, transparent) 0 1px, transparent 1px 44px);
  -webkit-mask: linear-gradient(0deg, #000 10%, transparent 90%);
          mask: linear-gradient(0deg, #000 10%, transparent 90%);
  pointer-events: none;
}
.ap-file-inner { position: relative; max-width: 880px; margin: 0 auto; }
.ap-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--c);
}
.ap-file-label b {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1rem;
  padding: 1px 10px;
  color: var(--color-header);
  background: var(--c);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent);
}
.ap-file-title { position: relative; margin: 8px 0 0; }
html.has-reveal body .ap-file-title.reveal-glitch.is-shown,
html.has-reveal body .ap-hl.reveal-glitch.is-shown { animation-fill-mode: backwards; }
.ap-file-word {
  position: absolute;
  right: -0.04em;
  top: 50%;
  transform: translateY(-52%);
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(1.6rem, min(9.4vw, calc((100vw - 28px) * 0.72 / (var(--n, 8) * 0.92))), 4.8rem);
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--c) 17%, transparent);
  text-shadow: none;
  pointer-events: none;
}
.ap-file-jp {
  position: relative;
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(1.7rem, 7.6vw, 2.6rem);
  line-height: 1.2;
  color: var(--color-white);
  text-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent), 0 3px 0 rgba(1, 10, 30, 0.9);
}
.ap-file-head .ap-hl {
  margin-top: 10px;
  text-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent), 1px 0 0 rgba(255, 0, 92, 0.34), -1px 0 0 rgba(0, 233, 255, 0.34);
}
.ap-file-head .ap-hl :is(.n, .pink) {
  background: linear-gradient(180deg, #ffffff 12%, var(--c) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c) 55%, transparent)) drop-shadow(0 3px 0 rgba(1, 10, 30, 0.9));
}

.ap-file-body {
  padding: 22px 16px 40px;
  background:
    linear-gradient(rgba(157, 252, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(157, 252, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--color-navy-800);
  color: var(--color-text-cyan-pale);
}
.ap-file-body .ap-file-inner { max-width: 760px; }
.ap-text {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--color-text-cyan-pale);
  text-wrap: pretty;
}
.ap-text strong { color: var(--color-white); }

/* モニターのコマ */
.ap-comic { display: grid; gap: 18px; }
.ap-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.ap-shot { min-width: 0; }
.ap-panel {
  position: relative;
  margin: 0;
  filter: drop-shadow(0 0 7px var(--ap-glow));
}
.ap-frame {
  position: relative;
  padding: 1.5px;
  background: var(--ap-line);
  clip-path: var(--shape, none);
  border-radius: var(--r, 6px);
}
.ap-media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar, 16 / 9);
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  background: #02061a;
  clip-path: var(--shape, none);
  border-radius: calc(var(--r, 6px) - 1px);
}
.ap-panel.is-photo .ap-frame::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  clip-path: var(--shape, none);
  border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.ap-row2 .ap-panel { --ar: 4 / 5; --r: 0px; }
.ap-row2 > .ap-shot:first-child .ap-panel { --shape: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%); margin-right: -8px; }
.ap-row2 > .ap-shot:last-child .ap-panel { --shape: polygon(22px 0, 100% 0, 100% 100%, 0 100%); margin-left: -8px; }
.ap-row2 > .ap-shot:last-child .ap-num { left: 28px; }
.ap-row2 > .ap-shot:last-child .ap-step-title,
.ap-row2 > .ap-shot:last-child .ap-step-text { padding-left: 14px; }
.ap-row2 > .ap-shot:first-child .ap-step-title,
.ap-row2 > .ap-shot:first-child .ap-step-text { padding-right: 10px; }
@media (min-width: 760px) {
  .ap-row2 .ap-panel { --ar: 4 / 3; }
}

.ap-num {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  margin: 0;
  padding: 1px 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--c, var(--color-text-cyan));
  background: rgba(3, 10, 30, 0.82);
  border: 1px solid currentColor;
  border-radius: 3px;
}
.ap-num::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  vertical-align: 1px;
  border-radius: 50%;
  background: var(--color-secondary);
  box-shadow: 0 0 6px var(--color-secondary);
}
.ap-cap {
  position: absolute;
  z-index: 2;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  margin: 0;
  padding: 4px 10px 4px 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text-cyan-pale);
  background: rgba(3, 10, 30, 0.82);
  border-left: 3px solid var(--c, var(--color-text-cyan));
  text-wrap: balance;
}
.ap-row2 > .ap-shot:first-child .ap-cap { max-width: calc(100% - 34px); }

.ap-sfx {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 12px;
  margin: 0;
  font-family: var(--font-title-text);
  font-size: clamp(1.5rem, 7.4vw, 2.6rem);
  line-height: 1;
  white-space: nowrap;
  color: var(--color-white);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.6);
  text-shadow:
    1.5px 0 0 rgba(255, 0, 92, 0.55),
    -1.5px 0 0 rgba(0, 233, 255, 0.55),
    2px 0 0 var(--color-navy-900),
    -2px 0 0 var(--color-navy-900),
    0 2px 0 var(--color-navy-900),
    0 -2px 0 var(--color-navy-900),
    1.5px 1.5px 0 var(--color-navy-900),
    -1.5px 1.5px 0 var(--color-navy-900),
    1.5px -1.5px 0 var(--color-navy-900),
    -1.5px -1.5px 0 var(--color-navy-900),
    0 0 6px var(--sfx, var(--color-text-cyan)),
    0 0 16px var(--sfx, var(--color-text-cyan)),
    0 0 30px var(--sfx, var(--color-text-cyan)),
    0 3px 0 rgba(1, 10, 30, 0.9);
  transform: rotate(-7deg) skewX(-8deg);
  pointer-events: none;
}
.ap-sfx.is-pink { --sfx: var(--ap-pink); }
.ap-sfx.is-yellow { --sfx: var(--color-yellow); }
.ap-sfx.at-bl { top: auto; right: auto; bottom: 14px; left: 12px; }
.ap-sfx.at-ml { top: 40%; right: auto; left: 12px; }
.ap-sfx.is-long { top: 12px; right: auto; left: 10px; font-size: clamp(1.15rem, 5.4vw, 1.9rem); }
.ap-panel:has(.ap-sfx.is-long) .ap-sheet { padding-top: 56px; }
.ap-row2 > .ap-shot:first-child .ap-sfx:not(.at-bl):not(.at-ml) { right: 18px; }
.ap-panel.reveal .ap-sfx { opacity: 0; }
.ap-panel.reveal.is-shown .ap-sfx { animation: ap-sfx-glitch 620ms steps(1, end) 0.3s both; }
@keyframes ap-sfx-glitch {
  0%   { opacity: 0; }
  6%   { opacity: 1; clip-path: inset(42% 0 40% 0); transform: rotate(-7deg) skewX(-8deg) translateX(-7px); filter: hue-rotate(70deg) saturate(2.4); }
  18%  { opacity: 1; clip-path: inset(8% 0 74% 0);  transform: rotate(-7deg) skewX(-8deg) translateX(6px);  filter: none; }
  30%  { opacity: 1; clip-path: inset(66% 0 12% 0); transform: rotate(-7deg) skewX(-8deg) translateX(-4px); filter: hue-rotate(-50deg) saturate(2); }
  42%  { opacity: 1; clip-path: inset(24% 0 52% 0); transform: rotate(-7deg) skewX(-8deg) translateX(3px);  filter: none; }
  54%  { opacity: 1; clip-path: inset(0 0 0 0);     transform: rotate(-7deg) skewX(-8deg) translateX(-2px); }
  66%  { opacity: 1; transform: rotate(-7deg) skewX(-8deg) translateX(2px); }
  100% { opacity: 1; clip-path: inset(0 0 0 0);     transform: rotate(-7deg) skewX(-8deg); filter: none; }
}

.ap-step-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--color-white);
}
.ap-step-title b {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--c, var(--color-text-cyan));
  text-shadow: 0 0 10px color-mix(in srgb, var(--c, #4dfaff) 60%, transparent);
}
.ap-step-text {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--color-text-cyan-pale);
  text-wrap: pretty;
}

/* アイテム: サプリ → カード(ポンと出る) */
.ap-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 4vw, 26px);
  padding: 26px 14px;
  overflow: hidden;
}
.ap-item-icon { width: min(30%, 130px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 3px 5px rgba(4, 59, 131, 0.3)); }
.ap-item-arrow {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--color-text-gallery-title);
}
.ap-item-pop { position: relative; width: min(38%, 170px); }
.ap-item-card { position: relative; display: block; width: 100%; height: auto; aspect-ratio: 668 / 1051; border-radius: 6px; box-shadow: 0 6px 16px rgba(4, 59, 131, 0.3); }
.ap-item-pop::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(77, 250, 255, 0.55) 35%, transparent 68%);
  opacity: 0;
  pointer-events: none;
}
.ap-panel.reveal .ap-item-card { opacity: 0; }
.ap-panel.reveal.is-shown .ap-item-card { animation: ap-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) 0.5s both; }
.ap-panel.reveal.is-shown .ap-item-pop::before { animation: ap-burst 0.65s ease-out 0.5s both; }
@keyframes ap-pop {
  0%   { opacity: 0; transform: scale(0.1) rotate(-14deg); }
  55%  { opacity: 1; transform: scale(1.14) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes ap-burst {
  0%   { opacity: 0; transform: scale(0.2); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.35); }
}

/* 明るい画面のコマ(図・アイテム) */
.ap-sheet {
  position: relative;
  padding: 42px 12px 30px;
  background: var(--color-paper);
  clip-path: var(--shape, none);
  border-radius: calc(var(--r, 6px) - 1px);
}
.ap-sheet .cb-elem { margin: 0 auto; }

/* 三すくみの図: 画面いっぱいに大きく */
.ap-page .ap-frame .cb-elem {
  container-type: inline-size;
  width: 100%;
  padding: 0 0 26px;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.ap-page .ap-frame .cb-elem .attr-triangle { --tri-size: min(520px, 100cqi); }
.ap-page .cb-elem .attr-triangle .attr { --attr-d: clamp(34px, calc(var(--tri-size) * 0.12), 60px); }
.ap-page .cb-elem-name { font-size: clamp(0.85rem, calc(var(--tri-size) * 0.036), 1.15rem); }
.ap-page .cb-elem .attr-triangle .attr-arrow::after { border-width: 7px 0 7px 12px; }
.ap-sheet:has(> .cb-elem) { padding: 30px 6px 12px; }
.ap-sheet-cb:has(> .cb-elem) { padding: 26px 6px 12px; }

/* 研究所の通信 */
.ap-comm {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 18px 0 0;
  padding: 10px 12px;
  background: var(--ap-glass);
  border: 1px solid var(--ap-line);
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(77, 250, 255, 0.1), 0 0 18px rgba(0, 169, 255, 0.2);
}
.ap-comm-face {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--color-text-cyan);
  box-shadow: 0 0 10px rgba(77, 250, 255, 0.5);
  background: #eef6ff;
}
.ap-comm-text { margin: 0; font-weight: 800; font-size: 0.95rem; line-height: 1.6; color: var(--color-white); }
.ap-comm-text strong { color: var(--color-text-cyan); }

/* 研究所のコマ(物語) */
.ap-lab {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  background:
    radial-gradient(circle at 72% 40%, rgba(77, 250, 255, 0.3), transparent 55%),
    repeating-linear-gradient(0deg, rgba(157, 252, 255, 0.08) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(157, 252, 255, 0.08) 0 1px, transparent 1px 22px),
    linear-gradient(160deg, var(--color-navy-blue), var(--color-navy-900));
}
.ap-lab-chara { position: absolute; left: 3%; bottom: -6%; width: 40%; height: auto; filter: drop-shadow(0 0 14px rgba(77, 250, 255, 0.35)); }
.ap-lab .ap-say { right: 5%; top: 18%; }
.ap-say {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 8px 12px;
  max-width: 58%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-white);
  background: rgba(3, 10, 30, 0.85);
  border: 1px solid var(--color-text-cyan);
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(77, 250, 255, 0.35);
  text-wrap: balance;
}
.ap-say::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: rgba(3, 10, 30, 0.95);
  border-left: 1px solid var(--color-text-cyan);
  border-bottom: 1px solid var(--color-text-cyan);
  transform: translateY(-50%) rotate(45deg);
}

/* そざい: 流れる帯 */
.material-showcase {
  margin: 14px 0 0;
  padding: 12px 0;
  background: var(--ap-glass);
  border: 1px solid var(--ap-line);
  border-radius: 8px;
  box-shadow: inset 0 0 18px rgba(77, 250, 255, 0.1);
}
.material-marquee {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-row { overflow: hidden; }
.marquee-track {
  display: flex;
  width: max-content;
  animation-name: marquee-shift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.marquee-left .marquee-track { animation-direction: normal; }
.marquee-right .marquee-track { animation-direction: reverse; }
@keyframes marquee-shift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-set {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  padding: 0 4px;
  list-style: none;
}
.marquee-item {
  flex: 0 0 auto;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 3px 6px;
  background: rgba(13, 86, 181, 0.3);
  border: 1px solid rgba(157, 252, 255, 0.25);
  border-radius: 6px;
}
.marquee-item img { width: 56px; height: 56px; object-fit: contain; }
.marquee-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-white);
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
  word-break: normal;
}

/* グッズの手順 */
.ap-goods-steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 10px;
}
@media (min-width: 760px) { .ap-goods-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ap-goods-steps .ap-panel { --ar: 600 / 560; }
.ap-goods-steps .ap-media { object-position: 50% 0; }
.ap-goods-hero .ap-media { background: #fff; object-fit: contain; }

.ap-page .link-banner { margin-top: 18px; }
.ap-page .about-info-table { margin: 0; }
.ap-page .goods-download { margin-top: 18px; }
.ap-mypage { margin: 14px 0 0; font-size: 0.88rem; line-height: 1.7; }
.ap-mypage a { color: var(--color-text-cyan); font-weight: 800; }
.ap-mypage small { display: block; font-size: 0.75rem; opacity: 0.85; }

/* 研究所のコマ(PC): そざい → なぞのモンスター */
.ap-lab-mats,
.ap-lab-holo { display: none; }
@media (min-width: 760px) {
  .ap-lab { aspect-ratio: 21 / 9; container-type: inline-size; }
  .ap-lab-chara { width: 22%; left: 5%; }
  .ap-lab .ap-say { left: 28.5%; right: auto; top: 16%; max-width: 38%; font-size: clamp(0.95rem, 1.7cqi, 1.15rem); }

  .ap-lab-mats {
    position: absolute;
    left: 29%;
    bottom: 14%;
    display: flex;
    align-items: center;
    gap: 1.2cqi;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .ap-lab-mats:empty { display: none; }
  .ap-lab-mats li { display: flex; align-items: center; gap: 1.2cqi; }
  .ap-lab-mats li + li::before {
    content: "+";
    font-family: var(--font-title);
    font-size: 2.6cqi;
    line-height: 1;
    color: var(--color-text-cyan);
    text-shadow: 0 0 10px rgba(77, 250, 255, 0.8);
  }
  .ap-lab-mats img {
    width: 6.6cqi;
    height: 6.6cqi;
    padding: 0.7cqi;
    object-fit: contain;
    background: rgba(238, 246, 255, 0.94);
    border: 2px solid var(--color-text-cyan);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(77, 250, 255, 0.55);
    animation: ap-bob 2.8s ease-in-out infinite;
  }
  .ap-lab-mats li:nth-child(2) img { animation-delay: -0.9s; }
  .ap-lab-mats li:nth-child(3) img { animation-delay: -1.8s; }
  .ap-lab-mats::after {
    content: "▶▶▶";
    margin-left: 1.4cqi;
    font-size: 1.5cqi;
    letter-spacing: 0.3em;
    color: var(--color-text-cyan);
    text-shadow: 0 0 8px rgba(77, 250, 255, 0.8);
    animation: ap-flow 1.4s ease-in-out infinite;
  }

  .ap-lab-holo {
    position: absolute;
    right: 9%;
    top: 50%;
    display: grid;
    justify-items: center;
    gap: 0.9cqi;
    width: 13cqi;
    transform: translateY(-50%);
  }
  .ap-lab-holo::after {
    content: "";
    width: 150%;
    height: 2.4cqi;
    margin-top: -0.4cqi;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(157, 252, 255, 0.85), rgba(0, 169, 255, 0.35) 55%, transparent);
  }
  .ap-lab-holo-tag {
    padding: 1px 8px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(0.7rem, 1.1cqi, 0.85rem);
    letter-spacing: 0.16em;
    color: var(--color-text-cyan);
    background: rgba(3, 10, 30, 0.85);
    border: 1px solid currentColor;
    border-radius: 3px;
  }
  .ap-lab-holo-card {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 668 / 1051;
    overflow: hidden;
    background:
      repeating-linear-gradient(0deg, rgba(157, 252, 255, 0.12) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, rgba(77, 250, 255, 0.24), rgba(77, 250, 255, 0.05));
    border: 2px solid rgba(157, 252, 255, 0.9);
    border-radius: 0.8cqi;
    box-shadow: 0 0 20px rgba(77, 250, 255, 0.55), inset 0 0 24px rgba(77, 250, 255, 0.35);
    animation: ap-bob 3.2s ease-in-out infinite;
  }
  .ap-lab-holo-card b {
    font-family: var(--font-title);
    font-weight: 400;
    font-size: 9cqi;
    line-height: 1;
    color: #eaffff;
    text-shadow: 0 0 12px var(--color-text-cyan), 0 0 28px rgba(0, 169, 255, 0.9);
  }
  .ap-lab-holo-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 22%;
    background: linear-gradient(180deg, transparent, rgba(157, 252, 255, 0.5), transparent);
    animation: ap-scan 2.6s linear infinite;
  }
}
@keyframes ap-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes ap-flow {
  0%, 100% { opacity: 0.35; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(6px); }
}
@keyframes ap-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(460%); }
}

/* カードバトル: ルールの図をモニターに映す */
.cbp-page { overflow-wrap: anywhere; }
.cbp-page svg {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cbp-page .cb-zone-name { word-break: normal; text-wrap: balance; }
.cbp-page .section-title-logo { filter: drop-shadow(0 0 8px rgba(0, 169, 255, 0.55)); }
.cbp-hero .cb-meta { margin-top: 14px; }
.cbp-hero .ap-comm { max-width: 560px; margin: 18px auto 0; }
.cbp-hero .ap-files { margin-top: 26px; }
.cbp-hero .sim-invite { margin-top: 22px; }

.ap-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--color-white);
}
.ap-sub::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 1.2em;
  background: var(--c, var(--color-text-cyan));
  box-shadow: 0 0 10px var(--c, var(--color-text-cyan));
  transform: skewX(-14deg);
}
.cbp-body > .ap-sub:first-child { margin-top: 0; }
.ap-note {
  position: relative;
  margin: 12px 0 0;
  padding-left: 1.1em;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--color-text-cyan-pale);
  text-wrap: pretty;
}
.ap-note::before { content: "▶"; position: absolute; left: 0; top: 0.2em; font-size: 0.7em; color: var(--c, var(--color-text-cyan)); }
.ap-note strong { color: var(--color-white); }
.ap-center { text-align: center; }

.ap-screen { margin: 0 0 4px; filter: drop-shadow(0 0 7px var(--ap-glow)); }
.ap-screen + .ap-screen { margin-top: 16px; }
.ap-sheet-cb {
  padding: 16px 10px;
  background: var(--color-paper);
  color: var(--color-primary);
  border-radius: 5px;
}
.ap-sheet-cb > * { margin-top: 0; margin-bottom: 0; }
.ap-screen.is-table .ap-sheet-cb { padding: 10px; }
.ap-screen.is-check .ap-sheet-cb { padding: 16px 16px 10px; }
.ap-solo { margin: 20px 0 6px; }
.ap-solo .ap-step-text { text-align: center; font-family: var(--font-display); font-weight: 900; font-size: 1.05rem; color: var(--color-white); }
.ap-vs { margin: 6px 0 0; }
.cbp-body > .ap-comm { margin-top: 22px; }

/* コロシアム */
.clp-hero .colosseum-frame { margin-top: 18px; }
.clp-hero .ap-files { margin-top: 26px; }
.ap-sheet-card { display: grid; place-items: center; gap: 10px; min-height: 180px; }
.ap-sheet-card > * { width: 100%; max-width: 100%; }
.ap-panel.is-movie .ap-frame { aspect-ratio: 16 / 9; }
.ap-panel.is-movie .yt-facade { inset: 1.5px; border-radius: 5px; overflow: hidden; }
.ap-panel.is-movie .yt-facade-frame {
  position: absolute;
  inset: 1.5px;
  width: calc(100% - 3px);
  height: calc(100% - 3px);
  border: 0;
  border-radius: 5px;
}
.gather-side > .ap-solo + .ap-text { margin-top: 22px; }
.clp-body > .ap-text + .ap-comic,
.clp-body > .ap-text + .ap-solo,
.clp-body > .ap-solo + .ap-comic { margin-top: 22px; }
.clp-body > .ap-comic + .ap-solo,
.clp-body > .ap-solo + .ap-text { margin-top: 22px; }

/* PC の組み */
@media (min-width: 960px) {
  .ap-file-inner,
  .ap-file-body .ap-file-inner { max-width: 1040px; }
  .ap-file-head { padding: 44px 32px 52px; }
  .ap-file-body { padding: 40px 32px 72px; }
  .ap-hl .s { font-size: 1.7rem; }
  .ap-hl .m { font-size: 2.5rem; }
  .ap-hl .l { font-size: 4.2rem; }
  .ap-hl .n { font-size: 6.2rem; }
  .ap-file-jp { font-size: 2.8rem; }
  .ap-file-word { font-size: min(5.4rem, calc(1040px * 0.72 / (var(--n, 8) * 0.92))); }
  .ap-text { max-width: 720px; font-size: 1rem; }

  .ap-files { max-width: 900px; }

  .ap-comic { gap: 48px; }
  .ap-comic > .ap-shot {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas:
      "media ."
      "media title"
      "media text"
      "media .";
    column-gap: 40px;
  }
  .ap-comic > .ap-shot:nth-child(even of .ap-shot) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
    grid-template-areas:
      ". media"
      "title media"
      "text media"
      ". media";
  }
  .ap-comic > .ap-shot > .ap-panel { grid-area: media; }
  .ap-comic > .ap-shot > .ap-step-title { grid-area: title; margin: 0; font-size: 1.6rem; flex-wrap: wrap; }
  .ap-comic > .ap-shot > .ap-step-title b { font-size: 3rem; }
  .ap-comic > .ap-shot > .ap-step-text { grid-area: text; margin: 12px 0 0; font-size: 1rem; line-height: 1.9; }

  .ap-row2 { gap: 0 4px; }
  .ap-row2 .ap-panel { --ar: 16 / 10; }
  .ap-row2 .ap-step-title { font-size: 1.2rem; }
  .ap-row2 .ap-step-title b { font-size: 1.9rem; }
  .ap-row2 .ap-step-text { font-size: 0.95rem; }

  .ap-lab { aspect-ratio: 3 / 1; }
  .ap-lab-chara { width: 20%; left: 6%; }
  .ap-lab .ap-say { top: 18%; }

  .ap-comm,
  .ap-page .link-banner,
  .ap-page .goods-download,
  .ap-page .about-info-table,
  .ap-mypage { max-width: 760px; margin-left: auto; margin-right: auto; }
  .ap-comm { margin-top: 32px; }
  .ap-mypage { text-align: center; }
  .ap-page .movie-frame { max-width: 720px; }
  .ap-bar-btn,
  .ap-bar-menu { max-width: 1040px; }

  .cbp-page .ap-file-inner,
  .cbp-page .ap-file-body .ap-file-inner { max-width: 860px; }
  .ap-sheet-cb { padding: 24px 28px; }
  .ap-page .ap-frame .cb-elem .attr-triangle { --tri-size: min(500px, 100cqi); }
  .ap-sheet:has(> .cb-elem),
  .ap-sheet-cb:has(> .cb-elem) { padding: 34px 20px 14px; }
  .ap-screen:has(.cb-elem) { max-width: 620px; margin-left: auto; margin-right: auto; }
  .ap-sub { font-size: 1.4rem; margin-top: 40px; }
  .ap-note { font-size: 1rem; }
  .ap-solo { max-width: 760px; margin-left: auto; margin-right: auto; }
  .cbp-hero .ap-files { max-width: 900px; }
}

/* 画面の上のファイルの帯 */
.ap-bar {
  --c: var(--color-text-cyan);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 49;
  background: rgba(5, 10, 31, 0.95);
  border-bottom: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 35%, transparent);
  transform: translateY(calc(var(--ap-hdr, 61px) - 110%));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s, border-color 0.3s;
}
.ap-bar.is-on { transform: translateY(var(--ap-hdr, 61px)); opacity: 1; pointer-events: auto; }
.ap-bar-btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "no title open"
    "meter meter meter";
  align-items: center;
  gap: 5px 10px;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 7px 16px 8px;
  color: var(--color-white);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ap-bar-no {
  grid-area: no;
  padding: 1px 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-header);
  background: var(--c);
  border-radius: 3px;
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent);
  white-space: nowrap;
}
.ap-bar-title { grid-area: title; font-family: var(--font-display); font-weight: 900; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-bar-open {
  grid-area: open;
  padding: 3px 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--c);
  border: 1px solid currentColor;
  border-radius: 999px;
}
.ap-bar-meter { grid-area: meter; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.ap-bar-meter i { position: relative; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(157, 252, 255, 0.14); }
.ap-bar-meter i::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: var(--seg, var(--color-text-cyan));
  box-shadow: 0 0 8px var(--seg, var(--color-text-cyan));
}
.ap-bar-menu { max-width: 880px; margin: 0 auto; padding: 4px 10px 12px; }
.ap-bar-menu[hidden] { display: none; }
.ap-bar-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ap-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  text-align: left;
  color: var(--color-text-cyan-pale);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.ap-bar-item b { font-family: var(--font-display); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.06em; color: var(--c); min-width: 4.6em; }
.ap-bar-item[aria-current="true"] { color: var(--color-white); background: rgba(2, 161, 243, 0.2); box-shadow: inset 2px 0 0 var(--c); }

@media (prefers-reduced-motion: reduce) {
  .ap-bar { transition: none; }
  .ap-panel.reveal .ap-sfx { opacity: 1; }
  .ap-panel.reveal.is-shown .ap-sfx { animation: none; }
  .ap-panel.reveal .ap-item-card { opacity: 1; }
  .ap-panel.reveal.is-shown .ap-item-card,
  .ap-panel.reveal.is-shown .ap-item-pop::before { animation: none; }
  .ap-lab-mats img,
  .ap-lab-mats::after,
  .ap-lab-holo-card,
  .ap-lab-holo-card::after { animation: none; }
  .marquee-track { animation: none; }
  .marquee-row { overflow-x: auto; }
  .marquee-set:last-child { display: none; }
}

/* サイト全体: TOP・図鑑・店舗・シミュレーターのあしらい */

/* 節の見出し(TOP) */
.top-head { padding-top: 34px; padding-bottom: 38px; }
.top-title { position: relative; }
.top-title .ap-file-word { top: 46%; }

/* 図鑑・店舗の言い切り */
:root .page:not(.ap-page) .ap-hero-lead { margin: 12px auto 18px; }

/* 店舗: 明るい地 → 研究所の地 */
:root .page[data-page="stores"] .section-zukan.page-light {
  background:
    linear-gradient(rgba(157, 252, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(157, 252, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--color-navy-800);
  color: var(--color-text-cyan-pale);
}
:root .page[data-page="stores"] .section-title.dark { color: var(--color-white); }
:root .page[data-page="stores"] .title-deco.dark { filter: brightness(2.2); }
:root .store-search,
:root .store-card {
  border-color: rgba(157, 252, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 169, 255, 0.3);
}
:root .region-title { box-shadow: 0 0 14px rgba(0, 169, 255, 0.35); }

/* シミュレーター: 下の説明を研究所の地に、パネルの題字をサイバーに */
:root .sim-about {
  padding-top: 30px;
  background:
    linear-gradient(rgba(157, 252, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(157, 252, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--color-navy-800);
  border-top: 1px solid rgba(77, 250, 255, 0.7);
  box-shadow: 0 -1px 18px rgba(77, 250, 255, 0.35);
}
:root .sim-about-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-white);
}
:root .sim-about-title::before {
  content: "";
  width: 6px;
  height: 1.2em;
  background: var(--color-text-cyan);
  box-shadow: 0 0 10px var(--color-text-cyan);
  transform: skewX(-14deg);
}
:root .sim-about-list { list-style: none; padding-left: 0; }
:root .sim-about-list li { position: relative; padding-left: 1.1em; }
:root .sim-about-list li + li { margin-top: 6px; }
:root .sim-about-list li::before { content: "▶"; position: absolute; left: 0; top: 0.35em; font-size: 0.7em; color: var(--color-text-cyan); }
:root .sim-panel-title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--color-white);
  text-shadow: 0 0 14px rgba(0, 169, 255, 0.6), 1px 0 0 rgba(255, 0, 92, 0.34), -1px 0 0 rgba(0, 233, 255, 0.34);
  animation: glitch-in 620ms steps(1, end) 1 both;
}

@media (prefers-reduced-motion: reduce) {
  :root .sim-panel-title { animation: none; }
}

@media (min-width: 1000px) {
  :root .section-dex .ap-hero-lead { grid-column: 1 / -1; }
}
