/* =========================================================
   魔神少女シリーズ ポータル — styles
   ライトテーマ（白背景）+ マゼンタ/ゴールドのアクセント
   ========================================================= */
:root {
  --bg: #ffffff;
  --bg-2: #f6f3fb;
  --bg-3: #ece7f5;
  --panel: #ffffff;
  --line: rgba(28, 20, 48, 0.12);
  --text: #1c1430;
  --muted: #5c5470;
  --dim: #8a8299;
  --accent: #ff3d9a;
  --accent-2: #b24cff;
  --gold: #c9930a;
  --sky: #0b7fb5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px rgba(60, 30, 110, 0.16);
  --font-latin: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-sc: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-tc: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-latin), var(--font-jp);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body[data-lang="ja"] { font-family: var(--font-jp), var(--font-latin); }
body[data-lang="zh"] { font-family: var(--font-sc), var(--font-latin); }
body[data-lang="tw"] { font-family: var(--font-tc), var(--font-latin); }
body[data-lang="en"] { font-family: var(--font-latin), var(--font-jp); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(14px, 3vw, 32px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav__name { display: flex; flex-direction: column; line-height: 1.15; }
.nav__name-main { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.nav__name-sub { font-size: 11px; color: var(--muted); font-family: var(--font-latin); letter-spacing: 0.06em; }

.nav__links { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
.nav__links a {
  padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  white-space: nowrap;
}
.nav__links a:hover { color: var(--text); background: rgba(28, 20, 48, 0.06); }

.lang { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(28, 20, 48, 0.05); border: 1px solid var(--line); }
.lang__btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.lang__btn:hover { color: var(--text); }
.lang__short { display: none; }
.lang__btn.is-active { background: var(--accent); color: #fff; box-shadow: 0 2px 10px rgba(255, 61, 154, 0.35); }

.nav__toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; align-items: center;
}
.nav__toggle span { display: block; width: 20px; height: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- HERO（動画の上なので暗いオーバーレイのまま。下端は白へフェード） ---------- */
.hero {
  position: relative; min-height: min(80vh, 680px);
  display: grid; place-items: center; overflow: hidden;
  padding: clamp(40px, 8vw, 90px) clamp(16px, 4vw, 40px) clamp(56px, 9vw, 110px);
  text-align: center; color: #fff;
}
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  filter: saturate(1.05);
}
.hero__shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(20, 10, 40, 0.1) 0%, rgba(20, 10, 40, 0.65) 60%, rgba(20, 10, 40, 0.85) 100%),
    linear-gradient(180deg, rgba(20, 10, 40, 0.5) 0%, rgba(20, 10, 40, 0.15) 45%, rgba(255, 255, 255, 0) 75%, #ffffff 100%);
}
.hero__inner { position: relative; z-index: 2; max-width: 860px; }
.hero__kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: #ffd766; border: 1px solid rgba(255, 215, 102, 0.5); border-radius: 999px; padding: 6px 14px;
  background: rgba(20, 10, 40, 0.55);
}
.hero__title {
  margin-top: 18px;
  font-size: clamp(40px, 8vw, 84px); font-weight: 900; line-height: 1.05; letter-spacing: 0.02em;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #fff 30%, #ffd1e8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__title-sub { display: block; font-size: 0.42em; font-weight: 700; letter-spacing: 0.3em; margin-top: 6px; color: #fff; -webkit-text-fill-color: #fff; }
.hero__lead { margin-top: 20px; font-size: clamp(15px, 1.6vw, 18px); color: #f3eefb; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75); }
.hero__cta { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__platforms {
  list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.hero__platforms li {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: #f3eefb;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(20, 10, 40, 0.55); border-radius: 999px; padding: 5px 12px;
}
.hero__scroll {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 2;
  color: var(--muted); font-size: 22px; animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 800; font-size: 15px;
  border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 24px rgba(255, 61, 154, 0.35); }
.btn--ghost { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.45); backdrop-filter: blur(6px); }
.btn--x { background: #000; color: #fff; border-color: #333; }
.btn--x::before { content: "𝕏"; font-weight: 400; }

/* ---------- SECTIONS ---------- */
.section { padding: clamp(26px, 3.5vw, 44px) clamp(16px, 4vw, 40px); max-width: 1240px; margin: 0 auto; }
.section--featured { padding-top: 8px; }
.section-head { margin-bottom: 18px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.section-head h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 900; line-height: 1.25; }
.section-note { margin-top: 6px; color: var(--muted); font-size: 14.5px; }

/* ---------- GRIDS ---------- */
.grid { display: grid; gap: 16px; }
.grid--featured { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--games { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid--tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid--contact { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 720px; }
.grid--anime { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ---------- CARD ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 2px 8px rgba(60, 30, 110, 0.06);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255, 61, 154, 0.55); box-shadow: var(--shadow); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card__thumb { aspect-ratio: 1 / 1; background: var(--bg-3); overflow: hidden; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card__thumb img { transform: scale(1.04); }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { font-size: 15px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.card__orig { font-size: 12px; color: var(--dim); line-height: 1.4; font-family: var(--font-jp); overflow-wrap: anywhere; }
.card__desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.card__meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.card__year { font-size: 12px; color: var(--dim); font-family: var(--font-latin); font-weight: 700; margin-left: auto; }
.card__rank {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: var(--font-latin); font-weight: 800; font-size: 12px; letter-spacing: 0.08em; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 999px; padding: 3px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.card--featured .card__title { font-size: 17px; }

.badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; line-height: 1;
  padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); background: #fff;
  font-family: var(--font-latin);
}
.badge--switch { color: #e60012; border-color: rgba(230, 0, 18, 0.35); }
.badge--steam  { color: #1b2838; border-color: rgba(27, 40, 56, 0.35); }
.badge--ps5    { color: #0070d1; border-color: rgba(0, 112, 209, 0.35); }
.badge--3ds    { color: #d9541e; border-color: rgba(217, 84, 30, 0.35); }
.badge--mobile { color: #1f8a4c; border-color: rgba(31, 138, 76, 0.35); }
.badge--proto  { color: var(--gold); border-color: rgba(201, 147, 10, 0.4); }
.badge--jp { color: var(--gold); border-color: rgba(201, 147, 10, 0.45); }
.badge--multi { color: var(--sky); border-color: rgba(11, 127, 181, 0.45); }
.card__lang { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18); }

.legend { margin-top: 14px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.legend__sep { color: var(--dim); }

/* ---------- YOUTUBE facade ---------- */
.yt {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: #000 center / cover no-repeat; border: 1px solid var(--line); cursor: pointer;
  box-shadow: 0 2px 8px rgba(60, 30, 110, 0.08);
}
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; transition: opacity .2s, transform .35s; }
.yt:hover img { opacity: 1; transform: scale(1.03); }
.yt__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 48px; border: 0; border-radius: 14px; cursor: pointer;
  background: rgba(255, 0, 0, 0.9); display: grid; place-items: center; transition: transform .15s, background .15s;
}
.yt__play::after { content: ""; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff; margin-left: 4px; }
.yt:hover .yt__play { transform: translate(-50%, -50%) scale(1.08); background: #f00; }
.yt__title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px;
  font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
}
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- TWITTER / X ---------- */
.section--twitter { text-align: center; }
.twitter-wrap { max-width: 600px; margin: 0 auto; }
.twitter-wrap[hidden] { display: none; }
.twitter-wrap .twitter-timeline:not(.twitter-timeline-rendered) { font-size: 0; color: transparent; } /* 読み込み中の素のリンクを見せない */

/* タイムラインが描画されない環境向けの代替カード */
.x-card {
  max-width: 600px; margin: 0 auto; padding: 28px 24px 30px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(60, 30, 110, 0.06);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.x-card[hidden] { display: none; }
.x-card__logo {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: #000; color: #fff; font-size: 28px; line-height: 1; font-family: var(--font-latin);
}
.x-card__handle { font-family: var(--font-latin); font-weight: 700; color: var(--muted); font-size: 14px; }
.x-card__title { font-size: 18px; font-weight: 800; margin-top: 4px; }
.x-card__body { color: var(--muted); font-size: 14px; max-width: 460px; }
.x-card .btn { margin-top: 10px; }

/* 自前表示の最新投稿（tweets.php） */
.xfeed { text-align: left; }
.xfeed[hidden] { display: none; }
.xfeed__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.xfeed__more { text-align: center; margin-top: 18px; }
.btn--outline { background: #fff; color: var(--text); border-color: var(--line); }
.btn--outline:hover { border-color: var(--text); }
.post {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 2px 8px rgba(60, 30, 110, 0.06);
}
.post__head { display: flex; align-items: center; gap: 10px; }
.post__avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.post__who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.post__name { font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.post__handle { font-size: 12px; color: var(--dim); font-family: var(--font-latin); }
.post__date { margin-left: auto; font-size: 12px; color: var(--dim); white-space: nowrap; font-family: var(--font-latin); }
.post__date:hover { text-decoration: underline; }
.post__repost { font-size: 12px; color: var(--dim); }
.post__text { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.post__text a { color: var(--sky); text-decoration: underline; text-underline-offset: 2px; }
.post__media { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-3); }
.post__media img { width: 100%; height: 100%; object-fit: cover; }
.post__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%; background: rgba(0, 0, 0, 0.65);
}
.post__play::after {
  content: ""; position: absolute; left: 55%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff;
}
.post__foot {
  margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--dim);
}
.post__foot a { color: var(--text); font-weight: 700; }
.post__foot a:hover { text-decoration: underline; }

/* ---------- FOOTER ---------- */
.footer {
  margin-top: 20px; padding: 30px clamp(16px, 4vw, 40px) 40px; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 13.5px; background: var(--bg-2);
}
.footer__share { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.footer__share a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.footer__note { margin-top: 14px; }
.footer__rights { margin-top: 10px; color: var(--dim); font-family: var(--font-latin); }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .nav__links a { font-size: 12.5px; padding: 8px 7px; }
  .nav__name-sub { display: none; }
}
@media (max-width: 900px) {
  .nav { gap: 10px; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 10px 12px;
    background: rgba(255, 255, 255, 0.98); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px 10px; font-size: 15px; }
  .lang { margin-left: auto; }
  .lang__btn { padding: 5px 8px; font-size: 12px; }
}
@media (max-width: 520px) {
  .nav { gap: 8px; padding: 0 10px; }
  .nav__name-main { font-size: 13px; }
  .lang { margin-left: auto; }
  .lang__btn { padding: 5px 8px; font-size: 11.5px; }
  .lang__full { display: none; }           /* 狭い画面は短い表記に切替 */
  .lang__short { display: inline; }
  .grid--games, .grid--tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card__body { padding: 10px 10px 12px; }
  .card__title { font-size: 13.5px; }
  .hero { min-height: 64vh; }
}
