/* =====================================
   AIタイプ診断 LP - PIXEL GAME UI
   Theme: 16-bit JRPG / Emerald × Navy × Gold
   ===================================== */

:root {
  --emerald: #10B981;
  --emerald-dark: #059669;
  --emerald-light: #34D399;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  --navy-darkest: #050816;
  --navy-dark: #0f0c29;
  --navy: #1a1a2e;
  --navy-light: #24243e;
  --gold: #FCD34D;
  --gold-warm: #F59E0B;
  --gold-dark: #B45309;
  --purple-soft: #A78BFA;
  --orange: #F97316;
  --white: #FFFFFF;
  --text-primary: #FFFFFF;
  --text-secondary: #CDE6DC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --black: #000000;
  --pixel-shadow: 4px 4px 0 0 var(--black);
  --pixel-shadow-sm: 3px 3px 0 0 var(--black);
  --pixel-shadow-lg: 6px 6px 0 0 var(--black);

  /* Font stacks */
  --font-pixel-jp: 'DotGothic16', 'Noto Sans JP', monospace;
  --font-pixel-en: 'Press Start 2P', 'DotGothic16', monospace;
  --font-fallback: 'Noto Sans JP', system-ui, sans-serif;
}

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

html {
  scroll-behavior: auto;
}

body {
  font-family: var(--font-pixel-jp);
  background: var(--navy-darkest);
  color: var(--text-primary);
  line-height: 1.9;
  font-size: 17px;
  letter-spacing: 0.02em;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ========== ピクセル風背景：テクスチャ + スキャンライン + グロー ========== */
.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    /* スキャンライン */
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(16, 185, 129, 0.025) 3px,
      transparent 4px
    ),
    /* タイル可能なピクセルテクスチャ */
    url('./images/bg-texture.png') repeat,
    /* グラデーション（最下層） */
    radial-gradient(ellipse at top, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, rgba(252, 211, 77, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, var(--navy-darkest) 0%, var(--navy-dark) 50%, var(--navy-darkest) 100%);
  background-size: 100% 4px, 256px 256px, 100% 100%, 100% 100%, 100% 100%;
  z-index: -2;
  pointer-events: none;
  image-rendering: pixelated;
}

/* タイプ別背景（結果画面の上部に表示） */
#screen-result {
  position: relative;
  isolation: isolate;
}

#screen-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 720px;
  background-image: var(--type-bg, none);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
}

.bg-glow {
  position: fixed;
  border-radius: 0;
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
}

.bg-glow.glow-1 {
  width: 400px;
  height: 400px;
  background: var(--emerald);
  top: -100px;
  left: -100px;
}

.bg-glow.glow-2 {
  width: 350px;
  height: 350px;
  background: var(--gold);
  opacity: 0.25;
  bottom: -100px;
  right: -100px;
}

/* ========== Layout ========== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 60px 20px;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.container-quiz {
  max-width: 760px;
}

/* ========== Pixel Helpers ========== */
.pixel-frame {
  position: relative;
  background: rgba(5, 8, 22, 0.92);
  border: 4px solid var(--white);
  outline: 2px solid var(--emerald);
  outline-offset: 4px;
  padding: 32px;
  box-shadow: var(--pixel-shadow-lg);
}

.pixel-frame::before,
.pixel-frame::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--emerald);
  border: 2px solid var(--white);
  z-index: 2;
}

.pixel-frame::before { top: -8px; left: -8px; }
.pixel-frame::after { top: -8px; right: -8px; }

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 32px 16px;
}

.hero-with-image {
  padding: 16px 8px;
}

.hero-image-wrap {
  width: 100%;
  margin-bottom: 36px;
  border: 4px solid var(--white);
  outline: 2px solid var(--emerald);
  outline-offset: 4px;
  box-shadow: var(--pixel-shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-image-wrap::before,
.hero-image-wrap::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--emerald);
  border: 2px solid var(--white);
  z-index: 3;
}
.hero-image-wrap::before { top: -8px; left: -8px; }
.hero-image-wrap::after { bottom: -8px; right: -8px; }

.hero-image {
  display: block;
  width: 100%;
  height: auto;
}

.hero-badge {
  display: inline-block;
  padding: 10px 22px;
  background: var(--emerald);
  color: var(--navy-darkest);
  border: none;
  font-family: var(--font-pixel-jp);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 28px;
  box-shadow:
    inset -3px -3px 0 var(--emerald-dark),
    inset 3px 3px 0 var(--emerald-light),
    var(--pixel-shadow-sm);
}

.hero-title {
  font-family: var(--font-pixel-jp);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
  text-shadow: 4px 4px 0 var(--black);
}

.hero-title-accent {
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--black), 5px 5px 0 var(--emerald-dark);
}

.hero-sub {
  font-family: var(--font-pixel-jp);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--emerald-light);
  margin-bottom: 16px;
  text-shadow: 2px 2px 0 var(--black);
}

.hero-desc {
  font-family: var(--font-pixel-jp);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 2.1;
  text-shadow: 1px 1px 0 var(--black);
}

.hero-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.hero-type {
  padding: 12px 18px;
  background: rgba(5, 8, 22, 0.7);
  border: 3px solid var(--emerald);
  font-family: var(--font-pixel-jp);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  box-shadow: var(--pixel-shadow-sm);
}

.hero-meta {
  margin-top: 40px;
  font-family: var(--font-pixel-en);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ========== CTA Button (8bit立体ボタン) ========== */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 42px;
  background: var(--emerald);
  color: var(--white);
  border: 3px solid var(--black);
  border-radius: 0;
  font-family: var(--font-pixel-jp);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  max-width: 100%;
  box-shadow:
    inset -4px -4px 0 0 var(--emerald-dark),
    inset 4px 4px 0 0 var(--emerald-light),
    4px 4px 0 0 var(--black);
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
  text-shadow: 2px 2px 0 var(--emerald-dark);
}

.cta-button:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    inset -4px -4px 0 0 var(--emerald-dark),
    inset 4px 4px 0 0 var(--emerald-light),
    6px 6px 0 0 var(--black);
}

.cta-button:active {
  transform: translate(2px, 2px);
  box-shadow:
    inset -4px -4px 0 0 var(--emerald-light),
    inset 4px 4px 0 0 var(--emerald-dark),
    0 0 0 0 var(--black);
}

.cta-arrow {
  font-size: 1.2rem;
  animation: arrow-bounce 0.6s steps(2) infinite;
}

.btn-icon {
  width: 28px;
  height: 28px;
  display: inline-block;
  vertical-align: middle;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.6));
}

@keyframes arrow-bounce {
  0%, 50% { transform: translateX(0); }
  51%, 100% { transform: translateX(4px); }
}

.cta-button-line {
  background: #06C755;
  text-shadow: 2px 2px 0 #04a045;
  position: relative;
  overflow: hidden;
  animation: line-glow-pulse 2.6s ease-in-out infinite;
}

/* グロー脈動：呼吸感 */
@keyframes line-glow-pulse {
  0%, 100% {
    box-shadow:
      inset -4px -4px 0 0 #04a045,
      inset 4px 4px 0 0 #34d76e,
      4px 4px 0 0 var(--black),
      0 0 18px rgba(6, 199, 85, 0.4);
  }
  50% {
    box-shadow:
      inset -4px -4px 0 0 #04a045,
      inset 4px 4px 0 0 #34d76e,
      4px 4px 0 0 var(--black),
      0 0 32px rgba(6, 199, 85, 0.85),
      0 0 64px rgba(6, 199, 85, 0.4);
  }
}

/* シャインスイープ：光のスジが流れる */
.cta-button-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.0) 30%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.0) 70%,
    transparent 100%
  );
  animation: line-shine 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes line-shine {
  0%, 70% { left: -120%; }
  100% { left: 220%; }
}

/* LINEアイコンの軽い揺れ */
.cta-button-line .btn-icon {
  animation: line-icon-wiggle 2.6s ease-in-out infinite;
}

@keyframes line-icon-wiggle {
  0%, 90%, 100% { transform: rotate(0deg); }
  92% { transform: rotate(-8deg); }
  94% { transform: rotate(8deg); }
  96% { transform: rotate(-5deg); }
  98% { transform: rotate(5deg); }
}

/* hover/active時はアニメ停止 + 強めの静的グロー */
.cta-button-line:hover {
  animation: none;
  box-shadow:
    inset -4px -4px 0 0 #04a045,
    inset 4px 4px 0 0 #34d76e,
    6px 6px 0 0 var(--black),
    0 0 36px rgba(6, 199, 85, 0.9),
    0 0 72px rgba(6, 199, 85, 0.5);
}

.cta-button-line:active {
  animation: none;
  box-shadow:
    inset -4px -4px 0 0 #34d76e,
    inset 4px 4px 0 0 #04a045,
    0 0 0 0 var(--black),
    0 0 30px rgba(6, 199, 85, 0.7);
}

/* アニメテキスト/アイコンを最前面に */
.cta-button-line > * {
  position: relative;
  z-index: 2;
}

/* ========== Quiz Header / Progress ========== */
.quiz-header {
  margin-bottom: 48px;
  text-align: center;
}

.progress-text {
  font-family: var(--font-pixel-en);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald-light);
  margin-bottom: 14px;
  letter-spacing: 0.2em;
  text-shadow: 2px 2px 0 var(--black);
}

.progress-text #progress-current {
  font-size: 1.25rem;
  color: var(--gold);
}

/* ピクセル風プログレスバー（ブロック感） */
.progress-bar {
  width: 100%;
  height: 16px;
  background: var(--navy-darkest);
  border: 3px solid var(--white);
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
  padding: 2px;
  position: relative;
  box-shadow: var(--pixel-shadow-sm);
}

.progress-fill {
  height: 100%;
  background:
    linear-gradient(90deg, var(--emerald-dark) 0%, var(--emerald) 50%, var(--emerald-light) 100%),
    repeating-linear-gradient(90deg, transparent 0, transparent 8px, rgba(0,0,0,0.2) 8px, rgba(0,0,0,0.2) 10px);
  width: 0%;
  transition: width 0.4s steps(8);
  box-shadow:
    inset 0 -3px 0 0 rgba(0, 0, 0, 0.3),
    inset 0 3px 0 0 rgba(255, 255, 255, 0.25);
}

/* ========== Quiz Question ========== */
.quiz-question {
  text-align: center;
  margin-bottom: 36px;
}

.quiz-question-number {
  display: inline-block;
  font-family: var(--font-pixel-en);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.3em;
  margin-bottom: 16px;
  padding: 6px 14px;
  background: rgba(252, 211, 77, 0.1);
  border: 2px solid var(--gold);
  text-shadow: 2px 2px 0 var(--black);
}

.quiz-question-title {
  font-family: var(--font-pixel-jp);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.7;
  color: var(--white);
  letter-spacing: 0.05em;
  text-shadow: 3px 3px 0 var(--black);
  padding: 0 16px;
}

/* ========== Quiz Options (RPGメニュー風) ========== */
.quiz-options {
  display: grid;
  gap: 14px;
  margin: 32px 0;
  padding-left: 36px;
  position: relative;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 18px 24px;
  background: rgba(5, 8, 22, 0.85);
  border: 3px solid var(--emerald);
  border-radius: 0;
  color: var(--white);
  font-family: var(--font-pixel-jp);
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-align: left;
  cursor: pointer;
  position: relative;
  box-shadow: var(--pixel-shadow-sm);
  transition: transform 0.08s steps(2), background 0.08s steps(2), border-color 0.08s steps(2);
}

/* ▶ カーソル（ピクセル画像） */
.quiz-option::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background-image: url('./images/cursor.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.08s steps(2);
  filter: drop-shadow(2px 2px 0 var(--black));
}

.quiz-option:hover::before,
.quiz-option.selected::before {
  opacity: 1;
  animation: cursor-blink 0.5s steps(2) infinite;
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}

.quiz-option:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--gold);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 0 var(--black);
}

.quiz-option.selected {
  background: rgba(16, 185, 129, 0.3);
  border-color: var(--gold);
  box-shadow:
    inset 0 0 0 1px var(--white),
    var(--pixel-shadow-sm);
  animation: option-flash 0.3s steps(2) 1;
}

@keyframes option-flash {
  0%, 50% { background: rgba(252, 211, 77, 0.5); }
  100% { background: rgba(16, 185, 129, 0.3); }
}

.quiz-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: var(--emerald);
  border: 2px solid var(--white);
  font-family: var(--font-pixel-en);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
  text-shadow: 2px 2px 0 var(--emerald-dark);
  box-shadow: var(--pixel-shadow-sm);
  transition: background 0.08s steps(2);
}

.quiz-option:hover .quiz-option-letter,
.quiz-option.selected .quiz-option-letter {
  background: var(--gold);
  color: var(--navy-darkest);
  text-shadow: 2px 2px 0 var(--gold-warm);
}

.quiz-option-text {
  flex: 1;
  line-height: 1.8;
  padding-top: 6px;
  text-shadow: 1px 1px 0 var(--black);
}

.quiz-back {
  display: block;
  margin: 24px auto 0;
  background: transparent;
  border: 2px solid var(--text-muted);
  color: var(--text-muted);
  font-family: var(--font-pixel-jp);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 10px 20px;
  letter-spacing: 0.1em;
  transition: all 0.1s steps(2);
}

.quiz-back:hover {
  color: var(--white);
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

/* ========== Loading Screen ========== */
.loading-container {
  text-align: center;
  padding: 40px 20px;
}

.loading-sprite {
  width: 192px;
  height: 192px;
  margin: 0 auto 36px;
  background-image: url('./images/loading-sprite.png');
  background-repeat: no-repeat;
  background-size: 768px 192px;
  background-position: 0 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 24px var(--emerald-glow))
          drop-shadow(0 0 48px rgba(252, 211, 77, 0.3));
  animation: loading-sprite-anim 0.6s steps(4) infinite;
  position: relative;
}

@keyframes loading-sprite-anim {
  from { background-position: 0 0; }
  to   { background-position: -768px 0; }
}

/* 中央スプライトを囲う回転リング（装飾） */
.loading-container {
  position: relative;
}

.loading-container::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  border: 2px dashed rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  animation: loading-ring-spin 4s steps(8) infinite;
  pointer-events: none;
}

.loading-container::after {
  content: '';
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  border: 1px dotted rgba(252, 211, 77, 0.25);
  border-radius: 50%;
  animation: loading-ring-spin 6s steps(12) infinite reverse;
  pointer-events: none;
}

@keyframes loading-ring-spin {
  from { transform: translateX(-50%) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(360deg); }
}

.loading-text {
  font-family: var(--font-pixel-jp);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--black);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
  animation: loading-text-blink 0.8s steps(2) infinite;
}

@keyframes loading-text-blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.4; }
}

.loading-sub {
  font-family: var(--font-pixel-en);
  font-size: 0.85rem;
  color: var(--emerald-light);
  letter-spacing: 0.4em;
  margin-bottom: 36px;
  text-shadow: 2px 2px 0 var(--black);
}

.loading-bar {
  width: 100%;
  max-width: 360px;
  height: 18px;
  margin: 0 auto;
  background: var(--navy-darkest);
  border: 3px solid var(--white);
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
  padding: 2px;
  box-shadow: var(--pixel-shadow-sm);
  position: relative;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background:
    linear-gradient(90deg, var(--emerald-dark) 0%, var(--emerald) 50%, var(--emerald-light) 100%),
    repeating-linear-gradient(90deg, transparent 0, transparent 8px, rgba(0,0,0,0.2) 8px, rgba(0,0,0,0.2) 10px);
  width: 0%;
  box-shadow:
    inset 0 -3px 0 0 rgba(0, 0, 0, 0.3),
    inset 0 3px 0 0 rgba(255, 255, 255, 0.25);
  animation: loading-bar-fill 1.8s steps(20) forwards;
}

@keyframes loading-bar-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ========== Result Reveal ========== */
.reveal {
  text-align: center;
  padding: 48px 16px 32px;
  margin-bottom: 24px;
  border-bottom: 4px double var(--emerald);
  animation: revealStep 0.5s steps(5) both;
}

@keyframes revealStep {
  0% { opacity: 0; transform: translateY(20px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal-label {
  display: inline-block;
  font-family: var(--font-pixel-jp);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 28px;
  padding: 8px 20px;
  background: rgba(252, 211, 77, 0.08);
  border: 2px solid var(--gold);
  text-shadow: 2px 2px 0 var(--black);
}

.reveal-images {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 32px auto 32px;
  max-width: 700px;
  flex-wrap: wrap;
}

.reveal-type-image,
.reveal-stage-image {
  display: block;
  border: 4px solid var(--white);
  outline: 3px solid var(--emerald);
  outline-offset: 4px;
  box-shadow: var(--pixel-shadow-lg);
  animation: imagePop 0.4s steps(4) both;
}

.reveal-type-image {
  width: 280px;
  height: 280px;
  object-fit: cover;
  animation-delay: 0.2s;
}

.reveal-stage-image {
  width: 220px;
  height: 220px;
  object-fit: contain;
  animation-delay: 0.4s;
  outline-color: var(--gold);
}

@keyframes imagePop {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

.reveal-cross {
  font-family: var(--font-pixel-en);
  font-size: 2.5rem;
  color: var(--gold);
  font-weight: 900;
  text-shadow: 4px 4px 0 var(--black);
}

.reveal-name {
  font-family: var(--font-pixel-jp);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: var(--gold);
  text-shadow:
    3px 3px 0 var(--black),
    6px 6px 0 var(--emerald-dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 12px;
  row-gap: 4px;
}

.reveal-name > span {
  white-space: nowrap;
}

.reveal-name-sep {
  color: var(--white);
  text-shadow: 3px 3px 0 var(--black);
}

.reveal-stage-meta {
  display: inline-block;
  font-family: var(--font-pixel-en);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.15em;
  padding: 8px 18px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--emerald);
  box-shadow: var(--pixel-shadow-sm);
  text-shadow: 2px 2px 0 var(--black);
}

@media (max-width: 640px) {
  .reveal-images {
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
  }
  .reveal-type-image { width: 240px; height: 240px; }
  .reveal-stage-image { width: 180px; height: 180px; }
  .reveal-cross {
    font-size: 2rem;
    margin: 0;
    line-height: 1;
  }
}

/* ========== Top CTA (Reveal直後) ========== */
.reveal-cta {
  text-align: center;
  padding: 36px 20px 48px;
  margin-bottom: 24px;
  border-bottom: 4px double var(--emerald);
  animation: revealStep 0.5s steps(5) 0.6s both;
}

.reveal-cta-meta {
  font-family: var(--font-pixel-jp);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 22px;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 var(--black);
}

.reveal-cta-sub {
  margin-top: 24px;
  font-family: var(--font-pixel-jp);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  animation: cursor-blink 1s steps(2) infinite;
}

/* ========== Result Sections ========== */
.result-section {
  padding: 48px 0;
  border-bottom: 4px double rgba(16, 185, 129, 0.4);
  position: relative;
}

.result-section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-pixel-jp);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--white);
  letter-spacing: 0.05em;
  text-shadow: 3px 3px 0 var(--black);
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1.5;
}

.section-title::before {
  content: '■';
  color: var(--emerald);
  font-size: 1rem;
  text-shadow: 2px 2px 0 var(--black);
  flex-shrink: 0;
  line-height: 1;
  display: inline-block;
  transform: translateY(-2px);
}

.section-subtitle {
  font-family: var(--font-pixel-jp);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin: 32px 0 14px;
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 var(--black);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.section-subtitle::before {
  content: '▶';
  color: var(--gold);
  font-size: 0.85rem;
  flex-shrink: 0;
  line-height: 1;
}

.section-lead {
  font-family: var(--font-pixel-jp);
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-shadow: 1px 1px 0 var(--black);
}

/* Combination */
.combination-headline {
  font-family: var(--font-pixel-jp);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 22px;
  line-height: 1.85;
  padding: 16px 20px;
  background: rgba(252, 211, 77, 0.06);
  border-left: 4px solid var(--gold);
  border-right: 1px solid rgba(252, 211, 77, 0.3);
  text-shadow: 2px 2px 0 var(--black);
}

.combination-message,
.combination-scenario {
  font-family: var(--font-pixel-jp);
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 2.1;
  margin-bottom: 16px;
  text-shadow: 1px 1px 0 var(--black);
}

/* Type Image Wrap */
.type-image-wrap,
.stage-image-wrap {
  margin: 0 auto 36px;
  max-width: 460px;
  border: 4px solid var(--white);
  outline: 3px solid var(--emerald);
  outline-offset: 4px;
  box-shadow: var(--pixel-shadow-lg);
  position: relative;
}

.type-image-wrap::before,
.stage-image-wrap::before,
.type-image-wrap::after,
.stage-image-wrap::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--emerald);
  border: 2px solid var(--white);
}

.type-image-wrap::before, .stage-image-wrap::before { top: -8px; left: -8px; }
.type-image-wrap::after, .stage-image-wrap::after { top: -8px; right: -8px; }

.stage-image-wrap {
  max-width: 320px;
  outline-color: var(--gold);
}

.type-detail-image,
.stage-detail-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Catchphrase */
.catchphrase {
  font-family: var(--font-pixel-jp);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--emerald-light);
  margin-bottom: 28px;
  padding: 18px 22px;
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--emerald);
  border-right: 1px solid rgba(16, 185, 129, 0.3);
  text-shadow: 2px 2px 0 var(--black);
}

.type-description,
.stage-situation {
  font-family: var(--font-pixel-jp);
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 2.1;
  white-space: pre-line;
  text-shadow: 1px 1px 0 var(--black);
}

/* Strengths / Weaknesses */
.strengths-weaknesses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 36px 0;
}

@media (max-width: 640px) {
  .strengths-weaknesses {
    grid-template-columns: 1fr;
  }
}

.sw-block {
  padding: 24px;
  background: rgba(5, 8, 22, 0.85);
  border: 3px solid var(--emerald);
  border-radius: 0;
  position: relative;
  box-shadow: var(--pixel-shadow-sm);
}

.sw-strong { border-color: var(--emerald); }
.sw-weak { border-color: var(--gold); }

.sw-block::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  width: 10px;
  height: 10px;
  background: var(--emerald);
  border: 2px solid var(--white);
}

.sw-weak::before { background: var(--gold); }

.sw-block h4 {
  font-family: var(--font-pixel-jp);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  text-shadow: 2px 2px 0 var(--black);
}

.sw-strong h4 { color: var(--emerald-light); }
.sw-weak h4 { color: var(--gold); }

.sw-block ul {
  list-style: none;
}

.sw-block li {
  padding: 8px 0 8px 26px;
  position: relative;
  font-family: var(--font-pixel-jp);
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.85;
  text-shadow: 1px 1px 0 var(--black);
}

.sw-strong li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--emerald-light);
}

.sw-weak li::before {
  content: '◇';
  position: absolute;
  left: 0;
  color: var(--gold);
}

/* Agent Card (9-slice window frame) */
.agent-card {
  margin-top: 36px;
  padding: 12px;
  background: rgba(5, 8, 22, 0.95);
  position: relative;
  border: 32px solid transparent;
  border-image: url('./images/window-frame.png') 32 fill round;
  border-image-outset: 0;
  box-shadow: var(--pixel-shadow-lg);
  image-rendering: pixelated;
}

.agent-card > * {
  position: relative;
  z-index: 1;
}

.agent-label {
  font-family: var(--font-pixel-en);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 14px;
  text-shadow: 2px 2px 0 var(--black);
}

.agent-name {
  font-family: var(--font-pixel-jp);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-shadow: 3px 3px 0 var(--black);
}

.agent-summary {
  font-family: var(--font-pixel-jp);
  font-size: 0.98rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
  line-height: 1.9;
  text-shadow: 1px 1px 0 var(--black);
}

.agent-examples {
  list-style: none;
  margin-bottom: 22px;
}

.agent-examples li {
  padding: 8px 0 8px 32px;
  position: relative;
  font-family: var(--font-pixel-jp);
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.85;
  text-shadow: 1px 1px 0 var(--black);
}

.agent-examples li::before {
  content: '▸';
  position: absolute;
  left: 8px;
  color: var(--emerald-light);
  text-shadow: 1px 1px 0 var(--black);
}

.agent-outcome {
  padding: 18px 22px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--emerald);
  font-family: var(--font-pixel-jp);
  font-weight: 700;
  color: var(--emerald-light);
  line-height: 1.9;
  text-shadow: 2px 2px 0 var(--black);
}

/* Stage gains list */
.stage-gains {
  list-style: none;
  margin: 16px 0 32px;
}

.stage-gains li {
  padding: 10px 0 10px 36px;
  position: relative;
  font-family: var(--font-pixel-jp);
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.85;
  text-shadow: 1px 1px 0 var(--black);
}

.stage-gains li::before {
  content: '★';
  position: absolute;
  left: 4px;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--black);
}

/* Evolution Card (9-slice window frame) */
.evolution-card {
  margin-top: 28px;
  padding: 12px;
  background: rgba(5, 8, 22, 0.95);
  border: 32px solid transparent;
  border-image: url('./images/window-frame.png') 32 fill round;
  border-image-outset: 0;
  position: relative;
  box-shadow: var(--pixel-shadow-lg);
  image-rendering: pixelated;
}

.evolution-card > * {
  position: relative;
  z-index: 1;
}

.evolution-label {
  font-family: var(--font-pixel-en);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--emerald-light);
  margin-bottom: 14px;
  text-shadow: 2px 2px 0 var(--black);
}

.evolution-point {
  font-family: var(--font-pixel-jp);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 18px;
  text-shadow: 3px 3px 0 var(--black);
}

.evolution-body {
  font-family: var(--font-pixel-jp);
  color: var(--text-secondary);
  line-height: 2;
  white-space: pre-line;
  text-shadow: 1px 1px 0 var(--black);
}

/* ========== Share Image ========== */
.share-canvas-wrap {
  margin: 24px 0;
  border: 4px solid var(--white);
  outline: 3px solid var(--emerald);
  outline-offset: 4px;
  background: var(--navy-dark);
  box-shadow: var(--pixel-shadow-lg);
  position: relative;
}

.share-canvas-wrap::before,
.share-canvas-wrap::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--emerald);
  border: 2px solid var(--white);
}
.share-canvas-wrap::before { top: -8px; left: -8px; }
.share-canvas-wrap::after { bottom: -8px; right: -8px; }

#share-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-button {
  padding: 14px 24px;
  background: rgba(5, 8, 22, 0.85);
  border: 3px solid var(--emerald);
  border-radius: 0;
  color: var(--emerald-light);
  font-family: var(--font-pixel-jp);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: var(--pixel-shadow-sm);
  transition: transform 0.08s steps(2), background 0.08s steps(2);
  text-shadow: 1px 1px 0 var(--black);
}

.share-button:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--black);
}

.share-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 0 var(--black);
}

.share-button.download {
  background: var(--gold);
  border-color: var(--black);
  color: var(--navy-darkest);
  box-shadow:
    inset -3px -3px 0 0 var(--gold-warm),
    inset 3px 3px 0 0 #FEF3C7,
    var(--pixel-shadow-sm);
  text-shadow: 1px 1px 0 var(--gold-warm);
}

.share-button.download:hover {
  background: var(--gold);
  box-shadow:
    inset -3px -3px 0 0 var(--gold-warm),
    inset 3px 3px 0 0 #FEF3C7,
    4px 4px 0 0 var(--black);
}

.share-button.download:active {
  box-shadow:
    inset -3px -3px 0 0 #FEF3C7,
    inset 3px 3px 0 0 var(--gold-warm),
    0 0 0 0 var(--black);
}

/* ========== Lead Magnets ========== */
.role-tagline {
  padding: 18px 22px;
  background: rgba(16, 185, 129, 0.06);
  border: 3px solid var(--emerald);
  font-family: var(--font-pixel-jp);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 28px;
  box-shadow: var(--pixel-shadow-sm);
  text-shadow: 1px 1px 0 var(--black);
}

.magnets-main {
  display: grid;
  gap: 14px;
  margin-bottom: 32px;
}

.magnet-main {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: rgba(5, 8, 22, 0.85);
  border: 3px solid var(--emerald);
  position: relative;
  box-shadow: var(--pixel-shadow-sm);
  transition: transform 0.08s steps(2), border-color 0.08s steps(2);
}

.magnet-main::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border: 1px solid var(--white);
}

.magnet-main:hover {
  transform: translate(-2px, -2px);
  border-color: var(--gold);
  box-shadow: 5px 5px 0 0 var(--black);
}

.magnet-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.magnet-info { flex: 1; }

.magnet-rank {
  font-family: var(--font-pixel-en);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 6px;
  text-shadow: 2px 2px 0 var(--black);
}

.magnet-title {
  font-family: var(--font-pixel-jp);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
  text-shadow: 1px 1px 0 var(--black);
}

.magnet-format {
  font-family: var(--font-pixel-en);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.magnets-sub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.magnet-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(5, 8, 22, 0.7);
  border: 2px solid var(--emerald);
  font-family: var(--font-pixel-jp);
  font-size: 0.85rem;
  color: var(--text-secondary);
  box-shadow: var(--pixel-shadow-sm);
  text-shadow: 1px 1px 0 var(--black);
}

.magnet-sub .magnet-icon { font-size: 1.2rem; }

/* ========== CTA Section (最終) ========== */
.result-section-cta {
  padding: 60px 0;
}

.cta-card {
  padding: 32px 16px 32px;
  background: rgba(5, 8, 22, 0.95);
  text-align: center;
  position: relative;
  border: 40px solid transparent;
  border-image: url('./images/window-frame.png') 32 fill round;
  border-image-outset: 0;
  box-shadow: 8px 8px 0 0 var(--black);
  image-rendering: pixelated;
}

.cta-card > * {
  position: relative;
  z-index: 1;
}

.cta-card-label {
  font-family: var(--font-pixel-en);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 18px;
  text-shadow: 2px 2px 0 var(--black);
}

.cta-card-title {
  font-family: var(--font-pixel-jp);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 24px;
  text-shadow: 4px 4px 0 var(--black);
  line-height: 1.5;
}

.cta-card-title .emerald { color: var(--emerald-light); }

.cta-card-desc {
  font-family: var(--font-pixel-jp);
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 2;
  text-shadow: 1px 1px 0 var(--black);
}

.cta-card-meta {
  margin-top: 18px;
  font-family: var(--font-pixel-jp);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-shadow: 1px 1px 0 var(--black);
}

/* ========== Footer ========== */
.result-footer {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 4px double rgba(16, 185, 129, 0.3);
  text-align: center;
  font-family: var(--font-pixel-en);
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  body { font-size: 15px; }

  .screen { padding: 32px 14px; }
  .hero { padding: 24px 8px; }

  .quiz-options { padding-left: 28px; }
  .quiz-option { padding: 16px 18px; font-size: 0.92rem; }
  .quiz-option::before { left: -26px; font-size: 18px; }

  /* CTAボタン：スマホで1行に収まるよう調整 */
  .cta-button {
    padding: 16px 22px;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    gap: 8px;
    width: 100%;
  }

  .btn-icon {
    width: 22px;
    height: 22px;
  }

  /* ウィンドウ枠：スマホでは縦パディングをコンパクトに */
  .agent-card {
    padding: 8px;
    border-width: 28px;
  }

  .cta-card {
    padding: 12px 4px;
    border-width: 24px;
  }

  .evolution-card {
    padding: 8px;
    border-width: 24px;
  }

  .reveal { padding: 32px 12px 24px; }

  .pixel-frame {
    padding: 24px 18px;
  }
}

/* 小さめスマホ向け（380px 以下） */
@media (max-width: 380px) {
  .cta-button {
    padding: 14px 16px;
    font-size: 0.85rem;
    gap: 6px;
    letter-spacing: 0.02em;
  }

  .cta-card {
    border-width: 20px;
    padding: 8px 4px;
  }

  .btn-icon {
    width: 20px;
    height: 20px;
  }
}

/* ========== LINE Success Overlay ========== */
.line-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 22, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
  animation: overlayFadeIn 0.4s steps(4) both;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.line-success-card {
  max-width: 440px;
  width: 100%;
  padding: 40px 28px;
  background: rgba(5, 8, 22, 0.98);
  border: 4px solid var(--emerald);
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  text-align: center;
  box-shadow: 8px 8px 0 0 var(--black);
  animation: overlayPop 0.4s steps(4) both;
}

@keyframes overlayPop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.line-success-icon {
  font-family: var(--font-pixel-en);
  font-size: 4rem;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 20px;
  text-shadow: 4px 4px 0 var(--black);
  animation: cursor-blink 1s steps(2) infinite;
}

.line-success-card h2 {
  font-family: var(--font-pixel-jp);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
  text-shadow: 3px 3px 0 var(--black);
}

.line-success-card p {
  font-family: var(--font-pixel-jp);
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.9;
  text-shadow: 1px 1px 0 var(--black);
}

/* ========== Selection ========== */
::selection {
  background: var(--gold);
  color: var(--navy-darkest);
}

/* ========== Scrollbar (ピクセル風) ========== */
::-webkit-scrollbar {
  width: 14px;
}

::-webkit-scrollbar-track {
  background: var(--navy-darkest);
  border-left: 2px solid var(--emerald);
}

::-webkit-scrollbar-thumb {
  background: var(--emerald);
  border: 2px solid var(--navy-darkest);
  box-shadow: inset -2px -2px 0 0 var(--emerald-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--emerald-light);
}
