/* ==========================================================================
   サモンピース 公式サイト
   - 色は原則すべて Assets/PaletteStore.asset (uPalette) の実値を使う
     （AIが好むベージュ/クリーム系は使わない。迷ったらパレットに無い色は足さない）
   - 基調色はゲームと同じ CardBlueBlack #1E3042
   - 書体はゲームと同じ Noto（NotoSansCJKJP / Black）= Web版は Noto Sans JP
   - フラットデザイン（ドロップシャドウ・立体表現は使わない）
   - 1CSSを index.php / rules.php / news.php で共用する
   ========================================================================== */

:root {
  /* 面と文字（uPalette: CardLightGray / GrayLight / White / TextBlack / GrayMedium） */
  --paper: #efefef;
  --paper-deep: #e7e7e7;
  --card: #ffffff;
  --ink: #333333;
  --ink-2: #777777;
  --line: rgba(51, 51, 51, 0.14);

  /* アクセント（uPalette: Yellow / YellowDark=PrimaryButton） */
  --gold: #ffd54f;
  --gold-deep: #ffc107;
  /* 明るい面の上に置くアクセント文字色。黄色は白地でコントラストが出ないため
     基調色 CardBlueBlack を使う（見出しラベル・数値・強調） */
  --accent-ink: #1e3042;
  /* 本文中のリンク（uPalette: SecondaryButton=ElementBlueDarker） */
  --link: #0288d1;

  /* 基調色（uPalette: CardBlueBlack / ElementBlueFrame / ElementWhitePrimary / StatsBlue） */
  --night: #1e3042;
  --night-deep: #001f35;
  --night-line: rgba(250, 250, 250, 0.14);
  --night-text: #fafafa;
  --night-soft: #98b6db;

  /* 属性カラー（ゲーム内 ElementPrimary 実値） */
  --el-white: #fafafa;
  --el-blue: #42a5f5;
  --el-green: #4caf50;
  --el-red: #ef5350;
  --el-black: #212121;
  --el-gray: #999999;

  /* ピース図鑑・個別ページの画像地色。--paper-deep に各属性色を16%だけ混ぜた薄い面
     （黒属性を暗い面にすると画像の縁が沈むため、どの属性でも明度は paper-deep 相当を保つ） */
  --el-white-wash: #eaeaea;
  --el-blue-wash: #cddce9;
  --el-green-wash: #cedecf;
  --el-red-wash: #e8cfcf;
  --el-black-wash: #c7c7c7;
  --el-gray-wash: #dbdbdb;

  --radius: 26px;

  /* ヘッダー高さ（アンカースクロールの余白と sticky の基準に使う） */
  --header-h: 64px;

  /* ゲーム内と同じ Noto。見出しは Black(900)、本文は Regular/Medium/Bold */
  /* YakuHanJPs（句読点の字間調整用）は表示速度対策のため2026-08-18に撤去。詳細はREADME「表示速度」 */
  --font-head: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
}

/* トップページはヘッダーが2段（ページナビ＋セクションナビ） */
html.has-subnav { --header-h: 106px; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); overflow-x: clip; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: inline-block; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--ink); }

.container { width: min(1080px, 92vw); margin: 0 auto; }
.narrow { width: min(760px, 92vw); margin: 0 auto; }

/* --------------------------------------------------------------------------
   ヘッダー
   -------------------------------------------------------------------------- */
/* 1段目＝ページ（トップ/あそびかた/開発情報）、2段目＝トップページ内のセクション。
   階層が違うものを同列に並べないための2段構成。現在地は下線で示す（塗りつぶしは使わない） */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(239, 239, 239, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 900; font-size: 18px;
  text-decoration: none; letter-spacing: 0.04em;
}
.brand img { width: 22px; height: 22px; }

.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  position: relative;
  font-size: 14px; font-weight: 700; text-decoration: none;
  padding: 8px 14px; border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav a:hover { background: rgba(51, 51, 51, 0.07); }
/* 現在のページ */
.site-nav a[aria-current="page"] { color: var(--accent-ink); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2.5px; border-radius: 2px;
  background: var(--accent-ink);
}

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; border-radius: 12px;
  color: var(--ink);
}
.nav-toggle:hover { background: rgba(51, 51, 51, 0.07); }

/* 2段目：トップページのセクションナビ（現在位置をスクロールに追従して表示） */
.section-nav {
  border-top: 1px solid var(--line);
}
.section-nav .container {
  display: flex; align-items: center; gap: 4px;
  height: 42px;
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav .container::-webkit-scrollbar { display: none; }
.section-nav a {
  position: relative; flex: none;
  font-size: 13px; font-weight: 500; text-decoration: none;
  color: var(--ink-2);
  padding: 6px 12px; border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.section-nav a:hover { background: rgba(51, 51, 51, 0.07); color: var(--ink); }
.section-nav a.is-active { color: var(--accent-ink); font-weight: 700; }
.section-nav a.is-active::after {
  content: "";
  position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2.5px; border-radius: 2px 2px 0 0;
  background: var(--gold-deep);
}

@media (max-width: 840px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 10px 4vw 16px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 16px; font-size: 15px; border-radius: 12px; }
  .site-nav a[aria-current="page"]::after { left: 16px; right: auto; width: 22px; bottom: 6px; }
  .section-nav .container { width: 100%; padding: 0 4vw; }
  /* メニューを開いている間は2段目を隠す。
     開いたパネルは top:64px に重なるので、出したままだと文字同士が交差して読めない */
  .site-header.nav-open .section-nav { display: none; }
}

/* --------------------------------------------------------------------------
   ヒーロー
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 32%, rgba(255, 213, 79, 0.16), rgba(30, 48, 66, 0) 62%),
    linear-gradient(rgba(0, 31, 53, 0.86), rgba(30, 48, 66, 0.94)),
    url(../img/bg-puzzle.webp) center / cover no-repeat;
  background-color: var(--night);
  color: var(--night-text);
  text-align: center;
  padding: 96px 0 110px;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; }

.hero-logo {
  position: relative;
  width: min(640px, 88vw);
  aspect-ratio: 1400 / 875;
  margin: 0 auto;
}
.hero-logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero-logo picture { display: contents; } /* <picture>(webp)で包んでも3層の重ね合わせを崩さない */

.hero .tagline {
  font-family: var(--font-head);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.22em;
  font-size: clamp(13px, 2.4vw, 16px);
  margin-top: -10px;
}
.hero .lead {
  margin: 22px auto 0;
  max-width: 560px;
  font-size: clamp(15px, 2.6vw, 17px);
  color: var(--night-text);
  padding: 0 16px;
}

/* 縦型トレーラー動画の枠（動画ができたらここに入れる） */
.hero-trailer {
  width: min(280px, 72vw);
  aspect-ratio: 9 / 16;
  margin: 30px auto 4px;
  border: 2px solid var(--night-line);
  border-radius: 22px;
  overflow: hidden;
  background: var(--night-deep);
}
.hero-trailer iframe,
.hero-trailer video {
  display: block; width: 100%; height: 100%; border: 0; object-fit: cover;
}

.hero-badges {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 26px; padding: 0 14px;
}
.hero-badges span {
  font-size: 13px; font-weight: 700;
  border: 1.5px solid rgba(255, 213, 79, 0.65);
  color: var(--gold);
  padding: 5px 14px; border-radius: 999px;
}

.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 30px; }

.btn {
  font-family: var(--font-head); font-weight: 900; font-size: 15px;
  text-decoration: none; letter-spacing: 0.05em;
  padding: 14px 30px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
/* ゲーム内 PrimaryButton (#FFC107) 準拠。文字は TextBlack */
.btn-primary {
  background: var(--gold-deep);
  color: var(--ink);
}
.btn-primary:hover { background: var(--gold); }
.btn-ghost {
  border: 2px solid rgba(250, 250, 250, 0.75); color: var(--night-text);
}
.btn-ghost:hover { background: rgba(250, 250, 250, 0.12); }
.btn-ink {
  background: var(--ink); color: var(--night-text);
}
.btn-ink:hover { background: #555555; }

/* 浮遊するピースイラスト（リロード毎にJSでランダム差し替え） */
.hero-float {
  position: absolute; z-index: 1;
  width: clamp(96px, 15vw, 200px);
  animation: bob 7s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero-float.f1 { left: 3%;  top: 12%;  rotate: -10deg; }
.hero-float.f2 { right: 3%; top: 14%;  rotate: 9deg;  animation-delay: -2.2s; }
.hero-float.f3 { left: 6%;  bottom: 7%; rotate: 7deg;  animation-delay: -4.1s; }
.hero-float.f4 { right: 6%; bottom: 5%; rotate: -7deg; animation-delay: -5.6s; }
@keyframes bob {
  from { transform: translateY(-9px); }
  to   { transform: translateY(11px); }
}
@media (max-width: 620px) {
  .hero-float { width: clamp(72px, 19vw, 110px); opacity: 0.9; }
  .hero-float.f1 { top: 5%; }
  .hero-float.f2 { top: 6%; }
}

/* --------------------------------------------------------------------------
   セクション共通
   -------------------------------------------------------------------------- */
.section { padding: 96px 0; }
.section-tight { padding: 72px 0; }

.kicker {
  font-family: var(--font-head); font-weight: 900;
  font-size: 13px; letter-spacing: 0.3em;
  color: var(--accent-ink);
  text-transform: uppercase;
  display: block; text-align: center;
}
h2.heading {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.4;
  text-align: center;
  margin: 10px 0 18px;
}
.section-lead {
  text-align: center; color: var(--ink-2);
  max-width: 620px; margin: 0 auto 48px;
  padding: 0 16px;
}
.on-dark .kicker { color: var(--gold); }
.on-dark h2.heading { color: var(--night-text); }
.on-dark .section-lead { color: var(--night-soft); }

/* --------------------------------------------------------------------------
   ABOUT
   -------------------------------------------------------------------------- */
.about-copy { text-align: center; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.about-copy p + p { margin-top: 1.2em; }
.about-copy strong { color: var(--accent-ink); }

.stat-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin-top: 40px;
}
.stat-chips .chip {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 16px 26px;
  text-align: center;
  min-width: 150px;
}
.stat-chips .num {
  font-family: var(--font-head); font-weight: 900; font-size: 26px;
  color: var(--accent-ink); line-height: 1.3; display: block;
}
.stat-chips .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* --------------------------------------------------------------------------
   特徴カード
   -------------------------------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
  margin-top: 8px;
}
.feature {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px 28px;
  transition: transform 0.25s ease;
}
.feature:hover { transform: translateY(-4px); }
.feature .fico {
  height: 76px; display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.feature .fico img { height: 60px; width: auto; }
.feature .fico .mini-cards img {
  height: 56px; width: 56px; object-fit: contain;
}
.feature .fico .mini-cards { display: flex; gap: 4px; }
.feature .fico .mini-els { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.feature .fico .mini-els img { height: 30px; width: 30px; }
.feature .fico .packs img { height: 72px; }
.feature .fico .packs img:nth-child(1) { rotate: -8deg; }
.feature .fico .packs img:nth-child(3) { rotate: 8deg; }
.feature h3 {
  font-family: var(--font-head); font-weight: 900; font-size: 19px;
  margin-bottom: 8px; line-height: 1.5;
}
.feature p { font-size: 14.5px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   ピースギャラリー（基調色の帯 + 召喚陣 + マーキー）
   -------------------------------------------------------------------------- */
.gallery {
  position: relative;
  background: linear-gradient(180deg, var(--night-deep), var(--night) 50%, var(--night-deep));
  overflow: hidden;
}
/* 召喚陣：ゲーム内ロビー実装準拠（glow α0.06 + Rough線画 α0.12・通常合成） */
.gallery::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 1100px; height: 1100px;
  transform: translate(-50%, -50%);
  background: url(../img/pentacle-glow.webp) center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
.gallery::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 1100px; height: 1100px;
  transform: translate(-50%, -50%);
  background: url(../img/pentacle-rough.webp) center / contain no-repeat;
  opacity: 0.12;
  animation: spin 160s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.gallery .container, .gallery .marquee, .gallery .caption { position: relative; z-index: 1; }

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  margin-top: 14px;
}
.marquee + .marquee { margin-top: 26px; }
.mq-track {
  display: flex; gap: 24px; width: max-content;
  animation: mq 48s linear infinite;
}
.marquee.rev .mq-track { animation-name: mq-rev; animation-duration: 56s; }
@keyframes mq     { to { transform: translateX(-50%); } }
@keyframes mq-rev { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.marquee:hover .mq-track { animation-play-state: paused; }

/* タイル＝ゲーム内の実ピースレンダリング(透過PNG・凹凸/名前/ライフ込み) */
.tile {
  width: 200px; height: 200px; flex: none;
}
.mq-track .tile:nth-child(odd)  { rotate: -3deg; }
.mq-track .tile:nth-child(even) { rotate: 2.5deg; }
.tile img { width: 100%; height: 100%; object-fit: contain; }

.gallery .caption {
  text-align: center; color: var(--night-soft);
  font-size: 13.5px; margin-top: 40px; padding: 0 16px;
}

/* --------------------------------------------------------------------------
   スクリーンショット
   -------------------------------------------------------------------------- */
.screens-row {
  display: flex; gap: 26px; justify-content: flex-start;
  overflow-x: auto; padding: 12px 4vw 26px;
  scroll-snap-type: x mandatory;
}
.screens-row::-webkit-scrollbar { height: 8px; }
.screens-row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.phone {
  flex: none; width: min(240px, 62vw);
  border: 3px solid var(--ink);
  border-radius: 30px;
  overflow: hidden;
  background: var(--night-deep);
  scroll-snap-align: center;
}
.phone img { display: block; width: 100%; }
@media (min-width: 1120px) {
  .screens-row { justify-content: center; overflow-x: visible; }
}

/* --------------------------------------------------------------------------
   あそびかた 3ステップ
   -------------------------------------------------------------------------- */
.steps-band { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin-top: 8px;
}
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}
.step .no {
  font-family: var(--font-head); font-weight: 900; font-size: 15px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold);
  color: var(--ink); margin: 0 auto 14px;
}
.step h3 { font-family: var(--font-head); font-weight: 900; font-size: 18px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--ink-2); }
.steps-cta { text-align: center; margin-top: 40px; }

/* --------------------------------------------------------------------------
   ニュース
   -------------------------------------------------------------------------- */
.news-list {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 760px; margin: 0 auto;
}
.news-item {
  display: flex; gap: 18px; align-items: baseline;
  padding: 20px 26px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--paper); }
.news-item time {
  flex: none; font-size: 13px; font-weight: 700; color: var(--accent-ink);
  font-family: var(--font-head); letter-spacing: 0.02em;
}
.news-item .t { font-size: 15px; font-weight: 500; }
.news-more { text-align: center; margin-top: 30px; }
@media (max-width: 560px) {
  .news-item { flex-direction: column; gap: 2px; }
}

/* --------------------------------------------------------------------------
   フォロー導線
   -------------------------------------------------------------------------- */
.follow { background: var(--paper-deep); text-align: center; }
.follow .x-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  font-family: var(--font-head); font-weight: 900; font-size: 15px;
  text-decoration: none;
  padding: 14px 30px; border-radius: 999px;
  transition: transform 0.15s ease, background 0.2s ease;
}
.follow .x-btn:hover { transform: translateY(-2px); background: #555555; }
.follow .x-btn svg { width: 17px; height: 17px; fill: currentColor; }
.follow p { color: var(--ink-2); margin-bottom: 22px; }

/* --------------------------------------------------------------------------
   下層ページ（あそびかた / 開発情報）
   -------------------------------------------------------------------------- */
.page-hero {
  text-align: center;
  padding: 76px 0 56px;
}
.page-hero h1 {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(30px, 6vw, 44px);
  margin-top: 10px;
}
.page-hero .lead { color: var(--ink-2); margin-top: 12px; padding: 0 16px; }

/* ルール記事 */
.rule-block {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 22px;
}
.rule-block h3 {
  font-family: var(--font-head); font-weight: 900; font-size: 19px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.rule-block h3::before {
  content: "";
  width: 12px; height: 12px; border-radius: 4px;
  background: var(--gold);
  flex: none;
}
.rule-block ul { list-style: none; }
.rule-block li {
  position: relative; padding-left: 20px;
  font-size: 15px; margin-bottom: 6px;
}
.rule-block li::before {
  content: "";
  position: absolute; left: 2px; top: 0.75em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-deep); opacity: 1;
}
.rule-block p { font-size: 15px; margin-bottom: 8px; }
.rule-block strong { color: var(--accent-ink); }

.connector-legend {
  display: flex; justify-content: center; gap: 34px;
  margin: 26px 0 8px;
}
.connector-legend figure { text-align: center; }
.connector-legend img { height: 64px; }
.connector-legend figcaption { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }

.element-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 14px;
}
@media (max-width: 640px) { .element-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .element-grid { grid-template-columns: 1fr; } }
.element-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
}
.element-card img { width: 34px; height: 34px; flex: none; }
.element-card .name { font-weight: 700; font-size: 14.5px; display: block; line-height: 1.5; }
.element-card .motif { font-size: 12.5px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   本文中のアイコン（Assets/Resources/STMQuads の画像＝ゲーム内テキストと同じ絵）

   ゲーム内は SuperTextMesh のクアッドで文章にアイコンを差し込んでいる。
   Webでは同じPNGを img/quads/ に置き、<img class="q"> で同じように混ぜる。
   例: ライフが3つ分減少します<img class="q" src="./img/quads/Heart4.png" alt="">
   -------------------------------------------------------------------------- */
.q {
  display: inline-block;
  width: 1.15em; height: 1.15em;
  vertical-align: -0.22em;
  margin: 0 0.06em;
}
/* アイコンを続けて並べるとき（ハート3つ分など）。文中に挟むので前後に少し余白を取る */
.q-run { margin: 0 0.2em; white-space: nowrap; }

/* ハートの目盛（満タン→空）。ハート1つは4分割される */
.heart-scale {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 22px;
  margin: 20px 0 8px;
}
.heart-scale figure { text-align: center; }
.heart-scale img { width: 46px; height: 46px; }
.heart-scale figcaption {
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  margin-top: 2px;
}

.page-cta { text-align: center; padding: 20px 0 40px; }
.page-cta .btn { margin: 0 8px 12px; }

/* 開発情報ログ */
.log-entry {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 26px;
}
.log-entry header {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px; margin-bottom: 16px;
}
.log-entry h2 {
  font-family: var(--font-head); font-weight: 900; font-size: 21px;
}
.log-entry h2 .vtag {
  display: inline-block;
  background: var(--gold-deep);
  color: var(--ink);
  border-radius: 10px;
  padding: 1px 10px;
}
.log-entry time { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.log-entry pre {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 2.0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
.log-entry pre a { color: var(--link); font-weight: 700; }
.log-entry h3 {
  font-family: var(--font-head); font-weight: 900; font-size: 16px;
  margin: 18px 0 10px;
}
.log-shots { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; margin: 6px 0 10px; }
.log-shots img {
  width: min(230px, 44vw);
  border-radius: 16px;
  border: 1.5px solid var(--line);
}
.log-shots img.small { width: min(120px, 30vw); }
.log-note { font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; }

/* 開発情報のページャー（10件ずつ） */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px;
  margin: 40px 0 8px;
}
.pager a, .pager span {
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  line-height: 1;
  min-width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  background: var(--card);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.pager a:hover { background: var(--paper-deep); border-color: var(--ink-2); }
.pager .is-current {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--night-text);
}
.pager .is-disabled {
  color: var(--ink-2); opacity: 0.45; background: transparent;
}
.pager .pg-edge { font-weight: 900; }
.pager-status {
  text-align: center; font-size: 13px; color: var(--ink-2);
  margin-top: 14px;
}

/* --------------------------------------------------------------------------
   フッター
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--night);
  color: var(--night-soft);
  border-top: 1px solid var(--night-line);
  text-align: center;
  padding: 72px 0 48px;
}
.site-footer .f-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px;
  margin-bottom: 40px;
}
.site-footer .f-nav a {
  color: var(--night-text); text-decoration: none;
  font-size: 13.5px; font-weight: 700;
}
.site-footer .f-nav a:hover { color: var(--gold); }
.door { margin: 56px 0 64px; }
.door img { width: 35px; opacity: 0.92; transition: transform 0.3s ease, opacity 0.3s ease; }
.door a:hover img { transform: scale(1.15); opacity: 1; }
.f-home a {
  color: var(--night-soft); text-decoration: none; font-size: 22px;
}
.f-home a:hover { color: var(--gold); }
.copyright { font-size: 12px; margin-top: 18px; letter-spacing: 0.06em; }

/* --------------------------------------------------------------------------
   その他
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* --------------------------------------------------------------------------
   ピース図鑑（pieces.php / piece.php）

   属性タイルの地色は uPalette 実値の属性色をそのまま使う。
   white は --card とほぼ同化するため薄い枠線を足す。black のタイルは
   文字を --night-text（明るい面用の文字色）に切り替える。
   -------------------------------------------------------------------------- */
h2.heading-sm {
  font-family: var(--font-head); font-weight: 900;
  font-size: 20px;
  margin: 0 0 16px;
}

/* 絞り込みバー */
.pdex-wrap { padding-bottom: 70px; }
.pf-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.pf-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pf-btn:hover { border-color: var(--ink-2); color: var(--ink); }
/* 押されている状態＝枠線＋塗り。黄色は使うが文字は明るい面用のaccent-ink */
.pf-btn.is-active {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: var(--accent-ink);
}
.pf-search {
  margin-left: auto;
}
.pf-search input {
  font-family: var(--font-body); font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  width: 200px;
  max-width: 40vw;
  background: var(--paper);
  color: var(--ink);
}
.pf-search input:focus { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.pf-clear {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 700;
  background: none; border: none; color: var(--link);
  cursor: pointer; padding: 6px 4px;
}
.pf-clear:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .pf-bar { padding: 16px; }
  .pf-search { margin-left: 0; width: 100%; }
  .pf-search input { width: 100%; max-width: none; }
}

.pf-count {
  text-align: center; font-size: 13px; color: var(--ink-2);
  margin-bottom: 18px;
}
.pf-count #pf-count-n { font-weight: 900; color: var(--accent-ink); }
.pf-empty {
  text-align: center; color: var(--ink-2);
  padding: 40px 0;
}

/* グリッド＋タイル（一覧・関連ピースで共用） */
.pdex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.pdex-grid-sm { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 8px; }
.pdex-tile {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--accent-ink);
  border-radius: 18px;
  padding: 14px 10px 12px;
  transition: transform 0.15s ease;
}
.pdex-tile:hover { transform: translateY(-3px); }
.pdex-tile.is-hidden { display: none; }
.pdex-tile.el-white  { background: var(--el-white);  border: 1.5px solid var(--line); }
.pdex-tile.el-blue   { background: var(--el-blue); }
.pdex-tile.el-green  { background: var(--el-green); }
.pdex-tile.el-red    { background: var(--el-red); }
.pdex-tile.el-gray   { background: var(--el-gray); }
.pdex-tile.el-black  { background: var(--el-black); color: var(--night-text); }
.pdex-thumb {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  margin-bottom: 8px;
}
.pdex-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pdex-name { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.pdex-rarity { font-size: 11.5px; margin-top: 2px; opacity: 0.85; }

/* 個別ページ */
.piece-page {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 40px;
  padding: 48px 0 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .piece-page { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
}
.piece-media {
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  padding: 28px;
  display: flex; align-items: center; justify-content: center;
  position: sticky; top: calc(var(--header-h) + 20px);
}
@media (max-width: 820px) { .piece-media { position: static; } }
/* 属性色を paper-deep に薄く溶かした地色（黒属性でも暗く沈まないように明度は保つ） */
.piece-media.el-white { background: var(--el-white-wash); }
.piece-media.el-blue  { background: var(--el-blue-wash); }
.piece-media.el-green { background: var(--el-green-wash); }
.piece-media.el-red   { background: var(--el-red-wash); }
.piece-media.el-black { background: var(--el-black-wash); }
.piece-media.el-gray  { background: var(--el-gray-wash); }
.piece-media img { width: 100%; max-width: 420px; height: auto; }

.piece-back { margin-bottom: 10px; }
.piece-back a { font-size: 13.5px; font-weight: 700; color: var(--link); text-decoration: none; }
.piece-back a:hover { text-decoration: underline; }

.piece-name-ja {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(26px, 4.5vw, 34px);
  line-height: 1.3;
}
.piece-name-en {
  font-size: 14px; color: var(--ink-2); margin-top: 2px;
  letter-spacing: 0.02em;
}

.piece-meta { margin-top: 26px; }
.pm-row {
  display: flex; gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.pm-row dt {
  flex: none; width: 74px;
  font-weight: 700; color: var(--ink-2);
}
.pm-row dd { flex: 1; }
.pm-el-icon { width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; }
.pm-stars { color: var(--accent-ink); letter-spacing: 0.06em; }
.pm-hearts { display: flex; flex-wrap: wrap; gap: 4px; }
.pm-hearts img { width: 22px; height: 22px; }
.pm-connector-list { list-style: none; display: grid; grid-template-columns: repeat(2, auto); gap: 4px 22px; }
.pm-side { display: inline-block; width: 1.6em; font-weight: 700; color: var(--ink); }

.piece-download { margin-top: 28px; }
.piece-download .btn { padding: 12px 26px; font-size: 14px; }
.dl-note { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.dl-note a { color: var(--link); }

/* 能力一覧 */
.piece-abilities { max-width: 780px; margin: 0 auto; padding: 30px 0 0; }
.piece-abilities:first-of-type { padding-top: 42px; }
.ability-row {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 16px 22px;
  margin-bottom: 12px;
}
.ability-kind {
  display: inline-block;
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}
.ability-trigger {
  font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.ability-trigger .q { width: 1.3em; height: 1.3em; }
.ability-body { font-size: 15px; line-height: 1.75; }
.ability-basic { background: var(--paper); border-style: dashed; }

/* 前後ナビ */
.piece-prevnext {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  max-width: 780px; margin: 36px auto 0;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.pp-link { font-size: 13.5px; font-weight: 700; text-decoration: none; color: var(--link); }
.pp-link:hover { text-decoration: underline; }
.pp-index { color: var(--ink-2); }
@media (max-width: 560px) {
  .piece-prevnext { justify-content: center; text-align: center; }
  .pp-index { order: -1; flex: 0 0 100%; }
}

/* 関連ピース */
.piece-related { max-width: 900px; margin: 46px auto 0; padding-bottom: 60px; }

@media (prefers-reduced-motion: reduce) {
  .hero-float, .gallery::after { animation: none !important; }
  .mq-track { animation-duration: 400s !important; }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   ファンキット / プレスキット（fankit.php / press.php）
   -------------------------------------------------------------------------- */
.rule-block h4 {
  font-family: var(--font-head); font-weight: 900; font-size: 15.5px;
  color: var(--accent-ink);
  margin: 22px 0 8px;
}
.rule-block h4:first-of-type { margin-top: 14px; }
.rule-block h4.gl-ok::before, .rule-block h4.gl-ng::before {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 8px; content: "";
}
.rule-block h4.gl-ok::before { background: var(--el-green); }
.rule-block h4.gl-ng::before { background: var(--el-red); }

/* ダウンロード一覧 */
.dl-list { list-style: none; }
.dl-list li {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.dl-list li:first-child { border-top: none; padding-top: 4px; }
.dl-list li::before { display: none; }
.dl-btn { flex: none; padding: 12px 20px; font-size: 14px; }
.dl-size {
  font-family: var(--font-body); font-weight: 500; font-size: 12px;
  opacity: 0.8; margin-left: 4px;
}
.dl-text strong { display: block; font-size: 15px; }
.dl-text p { font-size: 14px; color: var(--ink-2); margin: 2px 0 0; }
.dl-note { font-size: 14px; color: var(--ink-2); margin-top: 12px; }
.dl-note a, .rule-block a:not(.btn) { color: var(--link); } /* .btn(ダウンロード等)はボタン色を優先。以前は本文リンク色が勝って暗い地に青文字になっていた */
@media (max-width: 560px) {
  .dl-list li { flex-direction: column; gap: 8px; }
}

/* 中身プレビュー */
.kit-preview {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-top: 12px;
}
.kit-preview figure {
  background: var(--paper); border-radius: 18px;
  padding: 14px 10px 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
}
.kit-preview img { max-height: 120px; width: auto; }
.kit-preview .kit-logo img { max-height: 90px; }
.kit-preview .kit-icons span { display: flex; gap: 8px; align-items: center; }
.kit-preview .kit-icons img { width: 32px; height: 32px; }
.kit-preview .kit-icons img.q { width: 26px; height: 26px; }
.kit-preview figcaption { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
@media (max-width: 640px) { .kit-preview { grid-template-columns: repeat(2, 1fr); } }

.credit-line code, .rule-block code {
  font-family: var(--font-body); font-size: 14px;
  background: var(--paper-deep); border-radius: 8px; padding: 6px 12px;
  display: inline-block;
}
.gl-updated { font-size: 12.5px; color: var(--ink-2); margin-top: 18px; }

/* ファクトシート */
.fact-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 8px; }
.fact-table th, .fact-table td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; text-align: left; }
.fact-table tr:first-child th, .fact-table tr:first-child td { border-top: none; }
.fact-table th { width: 30%; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
@media (max-width: 560px) {
  .fact-table th, .fact-table td { display: block; width: auto; }
  .fact-table th { border-top: 1px solid var(--line); padding-bottom: 0; }
  .fact-table td { border-top: none; padding-top: 2px; }
}

/* 紹介文（コピー用の面） */
.copyable {
  background: var(--paper); border-radius: 14px;
  padding: 14px 16px; font-size: 15px;
}

/* スクリーンショット */
.shot-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px;
}
.shot-grid a { display: block; background: var(--paper); border-radius: 14px; padding: 8px; }
.shot-grid img { width: 100%; height: auto; border-radius: 8px; display: block; }
@media (max-width: 640px) { .shot-grid { grid-template-columns: repeat(2, 1fr); } }

/* 未確定の穴（インタビュー回答待ち）。埋まったら span ごと外す。公開前に残数ゼロを確認 */
.todo {
  display: inline-block; font-size: 12px; font-weight: 700;
  color: var(--el-red); border: 1.5px dashed var(--el-red); border-radius: 6px;
  padding: 0 6px; margin: 0 2px; line-height: 1.7; vertical-align: middle;
}
.todo::before { content: "TODO: "; }

/* プレスキット: 動画・GIF（Battle Capture の成果物。9:16縦型） */
.press-movies {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-top: 12px;
}
.press-movie {
  background: var(--paper); border-radius: 18px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.press-movie video { width: 100%; max-width: 240px; aspect-ratio: 9 / 16; border-radius: 12px; background: var(--paper-deep); }
.press-movie figcaption { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.press-movie figcaption a { color: var(--link); }
@media (max-width: 640px) { .press-movies { grid-template-columns: repeat(2, 1fr); } }
