/* ねこ魔法 公式サイト
   レイアウト：夜にひらいた魔導書。夜空のページ（詠唱・魔法陣）と、紙のページ（バトル・キャラクター）を交互にめくっていく。
   ゲームと同じ書体（Dela Gothic One ／ M PLUS Rounded 1c）と、ゲームの線の色（こげ茶）で縁どる。 */
:root {
  --night: #1b1240;
  --night-2: #2e1e57;
  --violet: #7c4dff;
  --lilac: #c9b8ff;
  --gold: #ffd54a;
  --gold-soft: #ffe680;
  --paper: #fff7e8;
  --paper-2: #ffe9c4;
  --ink: #4a2e2a;
  --ink-sub: #8a6a5c;
  --rose: #ff8bb0;
  --sky: #7ce0ff;
  --red: #ff6b6b;
  --star: #fff4c8;
  --f-display: "Dela Gothic One", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --f-body: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.88rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-3: clamp(2.2rem, 1.6rem + 3vw, 4rem);
  --step-4: clamp(3rem, 2rem + 6vw, 6.4rem);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: var(--step-0);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* 縁どり文字（ゲームのロゴと同じ：こげ茶の太いふち＋下に影） */
.outline {
  font-family: var(--f-display);
  font-weight: 400;
  -webkit-text-stroke: 0.14em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.07em 0 var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

/* ---------- 夜空 ---------- */
.sky {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(180, 140, 255, 0.28), transparent 60%),
    linear-gradient(175deg, var(--night) 0%, #3b2a7a 60%, #5b3a8e 100%);
}
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(1.6px 1.6px at 12% 18%, var(--star) 60%, transparent 61%),
    radial-gradient(1.2px 1.2px at 28% 62%, var(--star) 60%, transparent 61%),
    radial-gradient(2px 2px at 44% 12%, var(--star) 60%, transparent 61%),
    radial-gradient(1.3px 1.3px at 63% 40%, var(--star) 60%, transparent 61%),
    radial-gradient(1.8px 1.8px at 78% 15%, var(--star) 60%, transparent 61%),
    radial-gradient(1.2px 1.2px at 90% 70%, var(--star) 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 6% 84%, var(--star) 60%, transparent 61%),
    radial-gradient(1.2px 1.2px at 52% 88%, var(--star) 60%, transparent 61%);
  opacity: 0.85;
  pointer-events: none;
}

/* ---------- 紙 ---------- */
.paper {
  background: var(--paper);
  color: var(--ink);
  background-image: radial-gradient(circle at 20% 10%, rgba(255, 233, 196, 0.9), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255, 233, 196, 0.9), transparent 45%);
}

/* ---------- ヘッダー ---------- */
.top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-size: 1.1rem; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.top nav { display: flex; gap: 18px; font-weight: 800; font-size: var(--step--1); }
.top nav a { text-decoration: none; opacity: 0.85; }
.top nav a:hover { opacity: 1; color: var(--gold-soft); }

/* ---------- ヒーロー ---------- */
.hero { padding-block: calc(96px + env(safe-area-inset-top, 0px)) 72px; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; }
.hero-copy { position: relative; z-index: 2; min-width: 0; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border: 2px solid rgba(255, 230, 128, 0.6);
  border-radius: 999px;
  color: var(--gold-soft);
  font-weight: 800;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.06);
}
.logo { font-size: var(--step-4); margin: 18px 0 8px; color: #fff; }
.lead { font-size: var(--step-1); font-weight: 800; margin: 0 0 6px; }
.lead-sub { color: var(--lilac); margin: 0 0 26px; max-width: 32em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px 10px 16px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 2px solid #a6a6a6;
  line-height: 1.15;
}
.store-btn svg { width: 30px; height: 30px; flex: none; }
.store-btn small { display: block; font-size: 0.72rem; font-weight: 500; }
.store-btn b { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.01em; }
.store-btn:hover { border-color: var(--gold); }
.cta-note { font-size: var(--step--1); color: var(--lilac); }

.hero-art { position: relative; aspect-ratio: 1; max-width: 100%; }
.hero-art .circle { position: absolute; inset: 0; width: 100%; animation: spin 60s linear infinite; filter: drop-shadow(0 0 40px rgba(255, 190, 90, 0.45)); }
.hero-art .cat { position: absolute; width: 62%; left: 22%; bottom: -4%; animation: float 3.2s ease-in-out infinite; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.35)); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- 特長（ページ） ---------- */
.page { padding-block: 88px; }
.page .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 56px; align-items: center; }
.page.flip .wrap { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); }
.page.flip .phone { order: -1; }
.page-label {
  font-family: var(--f-display);
  font-size: var(--step--1);
  letter-spacing: 0.3em;
  color: var(--gold);
}
.paper .page-label { color: #c9962e; }
.page h2 { font-size: var(--step-3); margin: 8px 0 18px; color: #fff; }
.page h2 em { font-style: normal; color: var(--accent, var(--gold)); }
.page p { margin: 0 0 14px; max-width: 34em; }
.paper .page p { color: var(--ink); }

.phone {
  justify-self: center;
  width: min(300px, 80vw);
  border-radius: 40px;
  padding: 9px;
  background: #1a1330;
  box-shadow: 0 0 0 3px #3b2a7a, 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 90px var(--glow, rgba(124, 224, 255, 0.3));
}
.phone img { border-radius: 32px; width: 100%; }
.paper .phone { box-shadow: 0 0 0 3px var(--ink), 0 24px 50px rgba(74, 46, 42, 0.28); }

/* 詠唱文：ゲームと同じく漢字にふりがな */
.chant {
  margin: 22px 0 6px;
  padding: 18px 22px;
  border-radius: 20px;
  border: 2px solid rgba(124, 224, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  font-size: var(--step-1);
  line-height: 2.2;
  max-width: 24em;
}
.chant ruby rt { font-size: 0.5em; color: var(--lilac); font-weight: 800; }
.chant .shout { display: block; font-family: var(--f-display); color: var(--gold); font-size: 1.25em; line-height: 1.6; }
.meter { display: flex; gap: 6px; flex-wrap: wrap; font-size: var(--step--1); color: var(--lilac); margin-top: 10px; }
.meter span { border: 1.5px solid rgba(201, 184, 255, 0.5); border-radius: 999px; padding: 0 10px; }

/* 属性 */
.elems { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
.elems li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 4px 6px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: #fff;
  font-weight: 800;
  color: var(--ink);
}
.elems i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); background: var(--c); }
.ratio { display: flex; gap: 12px; flex-wrap: wrap; font-weight: 800; }
.ratio span { background: var(--paper-2); border-radius: 12px; padding: 4px 12px; font-variant-numeric: tabular-nums; }
.ratio .w { color: #e8434f; }
.ratio .r { color: #6a7086; }

/* 最終決戦 */
.final { background: radial-gradient(ellipse at 70% 40%, rgba(255, 80, 80, 0.25), transparent 55%), linear-gradient(175deg, #0e0a1a, #3a1030 70%, #7a1f3a); }
.final .noir { width: min(240px, 60vw); justify-self: center; filter: drop-shadow(0 0 30px rgba(255, 60, 60, 0.45)); }
.forms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.forms li { border: 1.5px solid rgba(255, 107, 107, 0.5); border-radius: 14px; padding: 10px 12px; background: rgba(0, 0, 0, 0.25); font-size: var(--step--1); line-height: 1.6; }
.forms b { display: block; color: var(--red); font-family: var(--f-display); font-weight: 400; font-size: 1rem; }

/* シェア */
.tags { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.tags span { font-family: var(--f-display); color: var(--rose); font-size: var(--step-1); }

/* キャラクター */
.cast { padding-block: 88px; }
.cast h2, .foes h2 { font-size: var(--step-3); text-align: center; margin: 6px 0 40px; color: #fff; }
.cast .head, .foes .head { text-align: center; }
.chars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.char {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 28px;
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.char img { height: 210px; width: auto; object-fit: contain; margin-bottom: 8px; }
.char h3 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: var(--step-1); color: var(--ink); }
.char .role { font-size: var(--step--1); color: var(--ink-sub); font-weight: 800; }
.char p { margin: 10px 0 0; font-size: var(--step--1); line-height: 1.75; color: var(--ink); }
.char.dark { background: var(--night-2); border-color: #120e1a; }
.char.dark h3 { color: #fff; }
.char.dark .role { color: var(--red); }
.char.dark p { color: var(--lilac); }

.foes { padding-block: 0 88px; }
.foe-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.foe-row figure { margin: 0; width: 112px; text-align: center; font-size: 0.78rem; font-weight: 800; color: var(--ink-sub); }
.foe-row img { width: 96px; height: 96px; object-fit: contain; margin: 0 auto 2px; }

/* 小ネタ */
.extras { padding-block: 80px; }
.extras .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.extra { border: 2px solid rgba(201, 184, 255, 0.35); border-radius: 26px; padding: 26px; background: rgba(255, 255, 255, 0.05); min-width: 0; }
.extra h3 { font-family: var(--f-display); font-weight: 400; font-size: var(--step-1); margin: 0 0 8px; color: var(--gold-soft); }
.extra p { margin: 0; color: var(--lilac); }
.extra q { display: block; margin-top: 12px; color: #fff; font-weight: 800; quotes: "「" "」"; }

/* 最後のCTA */
.closing { padding-block: 90px 100px; text-align: center; }
.closing h2 { font-size: var(--step-3); margin: 0 0 10px; color: #fff; }
.closing p { color: var(--lilac); margin: 0 0 28px; }
.closing .cta { justify-content: center; }
.closing .circle-mini { width: 120px; margin: 0 auto 14px; animation: spin 40s linear infinite; }

/* フッター */
.foot { background: #120c2c; color: var(--lilac); font-size: var(--step--1); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }

/* ---------- 規約ページ ---------- */
.doc-head { padding-block: calc(90px + env(safe-area-inset-top, 0px)) 40px; }
.doc-head h1 { font-size: var(--step-3); margin: 0; color: #fff; }
.doc-head p { margin: 8px 0 0; color: var(--lilac); }
.doc { padding-block: 48px 80px; }
.doc .wrap { max-width: 760px; }
.doc h2 { font-family: var(--f-display); font-weight: 400; font-size: var(--step-1); color: var(--ink); margin: 2.2em 0 0.4em; padding-bottom: 6px; border-bottom: 2px dashed #d9c7b0; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 1.3em; }
.doc li { margin-bottom: 0.4em; }
.doc a { color: #7a56d1; }
.doc .date { margin-top: 3em; color: var(--ink-sub); font-size: var(--step--1); }
.doc .fill { background: #fff1b8; padding: 0 4px; border-radius: 4px; }

/* ---------- せまい画面 ---------- */
@media (max-width: 820px) {
  .hero .wrap, .page .wrap, .page.flip .wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .page.flip .phone { order: 0; }
  .hero-art { width: min(420px, 100%); justify-self: center; }
  .chars { grid-template-columns: minmax(0, 1fr); }
  .extras .wrap { grid-template-columns: minmax(0, 1fr); }
  .top nav { display: none; }
}
@media (max-width: 480px) {
  .forms { grid-template-columns: minmax(0, 1fr); }
  .page, .cast { padding-block: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art .circle, .hero-art .cat, .closing .circle-mini { animation: none; }
  html { scroll-behavior: auto; }
}
.nb { display: inline-block; }
