/* =========================================================
   ファントムバスターズ 除霊ガチャ モック - style.css
   ダーク×蛍光カラーのグリッチデザイン / スマホファースト
   ========================================================= */

:root{
  --c-bg: #060608;
  --c-bg-2: #0d0d12;
  --c-yellow: #eeff00;
  --c-purple: #b026ff;
  --c-cyan: #00f6ff;
  --c-pink: #ff2fa0;
  --c-red: #ff3355;
  --c-text: #f4f4f6;
  --c-text-dim: #9a9aa5;
  --font-jp: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing: border-box; }
html,body{
  margin:0; padding:0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-jp);
  overflow-x:hidden;
  -webkit-tap-highlight-color: transparent;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family: inherit; border:none; cursor:pointer; }

/* ---------- 背景演出：ノイズ & スキャンライン ---------- */
.noise-overlay{
  position:fixed; inset:0; pointer-events:none; z-index: 9998;
  opacity:.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseShift 1s steps(2) infinite;
}
@keyframes noiseShift{ 0%{transform:translate(0,0);} 50%{transform:translate(-2%,1%);} 100%{transform:translate(1%,-2%);} }

.scanline-overlay{
  position:fixed; inset:0; pointer-events:none; z-index: 9997;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.035) 0px,
    rgba(255,255,255,0.035) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity:.5;
}

/* ---------- 画面共通 ---------- */
.screen{
  display:none;
  min-height:100vh;
  width:100%;
  padding: calc(28px + var(--safe-top)) 20px calc(40px + var(--safe-bottom));
  position:relative;
  flex-direction:column;
  align-items:center;
  text-align:center;
}
.screen.screen-active{ display:flex; }

/* ---------- SCREEN1: ファーストビュー ---------- */
#screen-first-view{
  background:
    radial-gradient(circle at 50% 0%, rgba(176,38,255,.35), transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(0,246,255,.18), transparent 55%),
    var(--c-bg);
  justify-content:flex-start;
}

.glitch-badge{
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--c-cyan);
  border: 1px solid rgba(0,246,255,.5);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
  text-transform: uppercase;
  animation: badgeFlicker 2.4s infinite;
  background: rgba(0,246,255,.06);
}
@keyframes badgeFlicker{
  0%,100%{ opacity:1; }
  46%{ opacity:1; }
  48%{ opacity:.3; }
  50%{ opacity:1; }
  92%{ opacity:1; }
  94%{ opacity:.4; }
}

.main-copy{
  font-size: 12.5vw;
  line-height: 1.15;
  font-weight: 900;
  margin: 4px 0 18px;
  letter-spacing: .01em;
}
.main-copy .line{ display:block; }
.main-copy .line-glow{
  color: var(--c-yellow);
  text-shadow: 0 0 12px rgba(238,255,0,.55), 0 0 30px rgba(238,255,0,.25);
}
@media (min-width: 480px){ .main-copy{ font-size: 52px; } }
@media (min-width: 900px){ .main-copy{ font-size: 64px; } }

/* グリッチテキスト */
.glitch-text{ position:relative; }
.glitch-text::before,
.glitch-text::after{
  content: attr(data-text);
  position:absolute; left:0; top:0; width:100%;
  opacity:0; white-space:pre-wrap;
}
.glitch-text::before{ color: var(--c-cyan); }
.glitch-text::after{ color: var(--c-pink); }
.glitch-text.glitch-active::before{
  animation: glitchTop .35s steps(2,end) 2;
  opacity:.8;
}
.glitch-text.glitch-active::after{
  animation: glitchBottom .35s steps(2,end) 2;
  opacity:.8;
}
@keyframes glitchTop{
  0%{ clip-path: inset(0 0 85% 0); transform: translate(-3px,-2px); }
  50%{ clip-path: inset(30% 0 40% 0); transform: translate(3px,1px); }
  100%{ clip-path: inset(80% 0 0 0); transform: translate(-2px,2px); }
}
@keyframes glitchBottom{
  0%{ clip-path: inset(80% 0 0 0); transform: translate(3px,2px); }
  50%{ clip-path: inset(10% 0 60% 0); transform: translate(-3px,-1px); }
  100%{ clip-path: inset(0 0 85% 0); transform: translate(2px,-2px); }
}

.glitch-text-sm{ position:relative; display:inline-block; }

.sub-copy{
  font-size: 15px;
  color: var(--c-text-dim);
  margin: 0 0 26px;
  line-height:1.7;
}

/* ---------- 画像プレースホルダー / ビジュアル枠 ---------- */
.phantom-visual-area{ width:100%; max-width: 340px; margin: 0 auto 30px; }
.visual-frame{
  position:relative;
  border: 2px solid rgba(238,255,0,.5);
  border-radius: 14px;
  overflow:hidden;
  background: linear-gradient(145deg, #131318, #08080b);
  box-shadow: 0 0 25px rgba(176,38,255,.25), inset 0 0 30px rgba(0,0,0,.6);
}
.official-placeholder{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:8px;
  padding: 46px 16px;
  color: var(--c-text-dim);
  min-height: 260px;
}
.official-placeholder i{ font-size: 30px; color: var(--c-purple); }
.official-placeholder p{ margin:0; font-weight:700; font-size:13px; color:#cfcfd8; }
.official-placeholder span{ font-size:11px; color:#71717c; }
.official-placeholder.small{ min-height: 170px; padding: 30px 12px; }
.official-placeholder.wide{ min-height: 150px; }

.visual-glitch-pulse{
  position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,246,255,.12) 50%, transparent 100%);
  animation: sweepDown 3.2s linear infinite;
  pointer-events:none;
}
@keyframes sweepDown{
  0%{ transform: translateY(-100%); }
  100%{ transform: translateY(100%); }
}

/* ---------- CTA / ボタン共通 ---------- */
.cta-stack{ width:100%; max-width: 360px; margin-top:auto; }
.btn-primary{
  width:100%;
  background: var(--c-yellow);
  color:#0a0a0a;
  font-weight:900;
  font-size: 18px;
  padding: 18px 20px;
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(238,255,0,.55), 0 6px 0 rgba(0,0,0,.4);
  letter-spacing: .02em;
}
.btn-pulse{ animation: pulseGlow 1.8s ease-in-out infinite; }
@keyframes pulseGlow{
  0%,100%{ box-shadow: 0 0 18px rgba(238,255,0,.45), 0 6px 0 rgba(0,0,0,.4); transform: scale(1); }
  50%{ box-shadow: 0 0 34px rgba(238,255,0,.85), 0 6px 0 rgba(0,0,0,.4); transform: scale(1.02); }
}
.btn-primary:active{ transform: scale(.97); }
.nfc-hint{ margin: 14px 0 0; font-size: 12px; color: var(--c-text-dim); }

/* ---------- SCREEN2: 検出演出 ---------- */
#screen-scanning{
  justify-content:center;
  background: radial-gradient(circle at 50% 40%, rgba(255,47,160,.22), transparent 60%), var(--c-bg);
}
.scan-wrap{
  position:relative;
  width: 220px; height:220px;
  display:flex; align-items:center; justify-content:center;
  margin-bottom: 34px;
}
.scan-ring-outer, .scan-ring-inner{
  position:absolute; border-radius:50%;
  border: 2px solid var(--c-cyan);
}
.scan-ring-outer{
  width:100%; height:100%;
  animation: ringSpin 1.6s linear infinite, ringPulse 1.6s ease-in-out infinite;
  border-style: dashed;
}
.scan-ring-inner{
  width: 70%; height:70%;
  border-color: var(--c-purple);
  animation: ringSpinRev 1.2s linear infinite;
}
@keyframes ringSpin{ to{ transform: rotate(360deg); } }
@keyframes ringSpinRev{ to{ transform: rotate(-360deg); } }
@keyframes ringPulse{ 0%,100%{ opacity:.5; } 50%{ opacity:1; } }
.scan-core{
  font-size: 46px;
  color: var(--c-yellow);
  animation: coreFlicker .5s steps(3) infinite;
  filter: drop-shadow(0 0 12px rgba(238,255,0,.7));
}
@keyframes coreFlicker{
  0%,100%{ opacity:1; transform: translate(0,0); }
  33%{ opacity:.6; transform: translate(-2px,1px); }
  66%{ opacity:.9; transform: translate(2px,-1px); }
}
.scan-text{
  font-size: 22px; font-weight:900; margin: 0 0 8px;
  letter-spacing:.03em;
}
.scan-sub{ font-size: 14px; color: var(--c-text-dim); margin:0 0 26px; }
.scan-progress{
  width: 240px; height: 6px; border-radius: 4px;
  background: rgba(255,255,255,.08); overflow:hidden;
}
.scan-progress-bar{
  height:100%; width:0%;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-purple), var(--c-yellow));
}

/* 画面振動・暗転演出用クラス（JSで付与） */
.shake{ animation: shakeScreen .4s linear; }
@keyframes shakeScreen{
  0%,100%{ transform: translate(0,0); }
  20%{ transform: translate(-4px,3px); }
  40%{ transform: translate(4px,-3px); }
  60%{ transform: translate(-3px,-2px); }
  80%{ transform: translate(3px,2px); }
}
.blackout::after{
  content:''; position:fixed; inset:0; background:#000;
  z-index: 9999; animation: blackoutFlash .18s ease-out;
  pointer-events:none;
}
@keyframes blackoutFlash{ 0%{ opacity:1; } 100%{ opacity:0; } }

/* ---------- SCREEN3: 結果表示 ---------- */
#screen-result{
  background:
    radial-gradient(circle at 50% 0%, rgba(0,246,255,.18), transparent 55%),
    var(--c-bg);
}
.result-topline{
  font-family: 'Courier New', monospace;
  font-size: 13px; letter-spacing:.15em; font-weight:700;
  color: var(--c-yellow);
  margin-bottom: 14px;
  text-shadow: 0 0 10px rgba(238,255,0,.6);
}

.result-card{
  width:100%; max-width: 380px;
  background: linear-gradient(160deg, #14141b, #090910);
  border: 2px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 22px 18px 26px;
  position: relative;
  box-shadow: 0 0 40px rgba(176,38,255,.25);
}
.rarity-badge{
  position:absolute; top: -14px; left:50%; transform: translateX(-50%);
  font-family: 'Courier New', monospace;
  font-weight:900; font-size: 15px; letter-spacing:.1em;
  padding: 6px 22px; border-radius: 999px;
  background: var(--c-purple); color:#fff;
  box-shadow: 0 0 20px rgba(176,38,255,.7);
}
.rarity-badge[data-rarity="N"]{ background:#6b7280; box-shadow:0 0 14px rgba(107,114,128,.6); }
.rarity-badge[data-rarity="R"]{ background:#2196f3; box-shadow:0 0 16px rgba(33,150,243,.6); }
.rarity-badge[data-rarity="SR"]{ background: var(--c-purple); }
.rarity-badge[data-rarity="SSR"]{
  background: linear-gradient(90deg, var(--c-yellow), var(--c-pink));
  color:#0a0a0a;
  box-shadow: 0 0 26px rgba(255,47,160,.75), 0 0 26px rgba(238,255,0,.5);
}

.result-visual-frame{
  position:relative; width: 100%; aspect-ratio: 1/1; max-width: 280px; margin: 18px auto 16px;
  border-radius: 16px; overflow:hidden;
  background: radial-gradient(circle at 50% 30%, rgba(0,246,255,.15), #050507 70%);
  border: 1px solid rgba(255,255,255,.1);
}
.ghost-image{ width:100%; height:100%; object-fit: contain; padding: 6px; }
.result-visual-scan{
  position:absolute; inset:0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.05) 0 2px, transparent 2px 5px);
  mix-blend-mode: overlay;
}

.ghost-name{
  font-size: 26px; font-weight:900; margin: 0 0 4px;
  letter-spacing:.01em;
}
.ghost-category{
  display:inline-block;
  font-size: 12px; color: var(--c-cyan);
  border: 1px solid rgba(0,246,255,.5);
  padding: 3px 12px; border-radius: 999px;
  margin-bottom: 12px;
}
.ghost-catchcopy{
  font-size: 15px; font-weight:700; color: var(--c-yellow);
  margin: 0 0 18px; line-height:1.6;
}

.ghost-stats{ margin: 0 0 16px; text-align:left; }
.stat-row{
  display:flex; justify-content:space-between; align-items:baseline;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.stat-row dt{ color: var(--c-text-dim); display:flex; align-items:center; gap:6px; }
.stat-row dd{ margin:0; font-weight:700; color:#fff; }

.ghost-desc{
  font-size: 13.5px; line-height:1.8; color:#d6d6dd;
  text-align:left; margin: 0 0 18px;
}

.brand-mark{
  border-top: 1px dashed rgba(255,255,255,.2);
  padding-top: 12px; text-align:center;
}
.brand-mark-logo{
  display:block; font-weight:900; font-size:15px; letter-spacing:.08em;
  color:#fff;
}
.brand-mark-sub{ display:block; font-size:10px; color: var(--c-text-dim); letter-spacing:.15em; margin-top:2px; }

/* 共有ボタン(控えめ) */
.btn-share{
  margin: 16px 0 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  color: #cfcfd8;
  font-size: 13px; font-weight:600;
  padding: 10px 18px; border-radius: 999px;
  display:flex; align-items:center; gap:8px;
}
.btn-share:active{ transform: scale(.97); }

/* ---------- 作品への接続ブロック ---------- */
.connect-block{
  width:100%; max-width: 380px; margin-top: 36px;
}
.connect-question{
  font-size: 15px; color: var(--c-text-dim); margin: 0 0 6px;
}
.connect-answer{
  font-size: 22px; font-weight:900; color: var(--c-yellow);
  margin: 0 0 22px; line-height:1.4;
  text-shadow: 0 0 14px rgba(238,255,0,.4);
}

.work-intro-card{
  display:flex; gap:14px; text-align:left;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 14px;
  margin-bottom: 14px;
}
.work-cover{ width: 96px; flex-shrink:0; }
.work-info h3{ margin: 2px 0 4px; font-size:16px; font-weight:900; }
.work-meta{ margin:0 0 8px; font-size:11px; color: var(--c-text-dim); }
.work-desc{ margin:0; font-size:12.5px; line-height:1.7; color:#d6d6dd; }

.work-chara-area{ margin-bottom: 22px; }

.btn-cta-mainlink{
  display:flex; align-items:center; justify-content:center; gap:10px;
  width:100%;
  background: var(--c-yellow); color:#0a0a0a;
  font-weight:900; font-size: 17px;
  padding: 18px 16px; border-radius: 14px;
  box-shadow: 0 0 26px rgba(238,255,0,.6);
  margin-bottom: 12px;
}
.btn-cta-mainlink .link-icon{ font-size: 13px; }
.btn-cta-mainlink:active{ transform: scale(.97); }

.link-secondary{
  display:block; text-align:center; font-size: 12.5px;
  color: var(--c-text-dim); text-decoration: underline;
  margin-bottom: 8px;
}

.btn-retry{
  width:100%; max-width: 380px;
  background: transparent;
  border: 2px solid var(--c-cyan);
  color: var(--c-cyan);
  font-weight:800; font-size: 15px;
  padding: 15px 18px; border-radius: 14px;
  margin-top: 18px;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.btn-retry:active{ transform: scale(.97); background: rgba(0,246,255,.08); }

/* ---------- フッター ---------- */
.site-footer{
  background: #050506;
  padding: 28px 20px calc(28px + var(--safe-bottom));
  text-align:center;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-copyright{ font-size:12px; color:#8a8a94; margin:0 0 8px; }
.footer-note{ font-size:10.5px; color:#5b5b64; line-height:1.7; margin:0 0 6px; max-width:420px; margin-inline:auto; }
.footer-link{ display:inline-block; margin-top:10px; font-size:11px; color:#7a7aff; text-decoration:underline; }

/* ---------- トースト ---------- */
.toast{
  position:fixed; bottom: calc(24px + var(--safe-bottom)); left:50%;
  transform: translate(-50%, 20px);
  background: #1a1a22; border:1px solid rgba(255,255,255,.15);
  color:#fff; font-size:13px; padding:12px 20px; border-radius:999px;
  opacity:0; pointer-events:none; z-index: 10000;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  max-width: 88vw; text-align:center;
}
.toast.show{ opacity:1; transform: translate(-50%,0); }

/* ---------- PC表示調整 ---------- */
@media (min-width: 640px){
  .screen{ padding: 60px 24px 80px; }
  .result-card, .connect-block, .btn-retry, .cta-stack{ max-width: 420px; }
  body{
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0,0,0,.8);
  }
  .site-footer{ max-width: 480px; margin:0 auto; }
}
@media (min-width: 900px){
  html{ background:#000; }
  body{ background: var(--c-bg); }
}
