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

:root {
  --bg: #050510;
  --bg-section: #0a0a1a;
  --bg-card: #0d1025;
  --bg-card-hover: #111535;
  --cyan: #00ccff;
  --cyan-dim: rgba(0, 204, 255, 0.12);
  --cyan-glow: rgba(0, 204, 255, 0.5);
  --cyan-bright: #40e0ff;
  --fire: #ff6600;
  --ice: #00ffff;
  --thunder: #ffe033;
  --poison: #c44dff;
  --green: #00ff88;
  --red: #ff4444;
  --text: #eef2f7;
  --text-secondary: #c0cad8;
  --text-muted: #7a8a9e;
  --border: #1a2040;
  --border-glow: rgba(0, 204, 255, 0.25);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', 'Segoe UI', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ========== グローバルオーバーレイ ========== */

/* スキャンライン */
.scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 200, 255, 0.015) 2px,
    rgba(0, 200, 255, 0.015) 4px
  );
}

/* グリッドパターン背景 */
.grid-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0, 204, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 204, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ========== ナビゲーション ========== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  background: rgba(5, 5, 16, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glow);
}

.nav-home {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.25s;
  font-family: 'Share Tech Mono', 'Consolas', monospace;
}

.nav-home:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: 0 0 12px rgba(0, 204, 255, 0.2);
}

.nav-logo {
  font-family: 'Share Tech Mono', 'Consolas', monospace;
  color: var(--cyan);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 0 12px var(--cyan-glow);
}

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  padding: 7px 14px;
  border-radius: 3px;
  transition: all 0.25s;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'Share Tech Mono', 'Consolas', monospace;
}

.nav-links a:hover {
  color: var(--cyan-bright);
  background: var(--cyan-dim);
}

/* ========== ヒーロー ========== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding-top: 52px;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 100, 180, 0.08) 0%, transparent 60%);
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(0, 204, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

#game-container {
  position: relative;
  border: 2px solid rgba(0, 204, 255, 0.5);
  border-radius: 6px;
  box-shadow:
    0 0 20px rgba(0, 204, 255, 0.3),
    0 0 60px rgba(0, 204, 255, 0.1),
    inset 0 0 20px rgba(0, 204, 255, 0.05);
}

canvas { display: block; }

.scroll-hint {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: float 2.5s ease-in-out infinite;
}

.scroll-hint-text {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.scroll-hint-arrow {
  width: 16px;
  height: 16px;
  border-right: 1.5px solid var(--cyan);
  border-bottom: 1.5px solid var(--cyan);
  transform: rotate(45deg);
  opacity: 0.6;
}

@keyframes float {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(10px); opacity: 1; }
}

/* ========== セクション共通 ========== */
.lp-section {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 90px 28px;
}

.section-alt {
  background: var(--bg-section);
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  height: 1px;
  width: 50px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.section-label {
  font-family: 'Share Tech Mono', monospace;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
}

.section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 52px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== About ========== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 24px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.about-card:hover {
  border-color: rgba(0, 204, 255, 0.3);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 24px rgba(0, 204, 255, 0.08);
}

.about-card:hover::before { opacity: 1; }

.about-card-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.about-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.about-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 技術スタック */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-secondary);
  transition: all 0.25s;
}

.tech-tag:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 204, 255, 0.15);
}

.tech-tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* ========== キャラクター ========== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s;
  overflow: hidden;
}

.char-card:hover {
  border-color: rgba(0, 204, 255, 0.4);
  box-shadow: 0 0 24px rgba(0, 204, 255, 0.12);
  transform: translateY(-4px);
}

.char-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 204, 255, 0.03);
}

.char-card .char-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.char-card .char-type {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.char-card .char-stats {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== 敵グリッド ========== */
.enemy-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.enemy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 14px;
  text-align: center;
  transition: all 0.3s;
}

.enemy-card:hover {
  border-color: rgba(255, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.1);
  transform: translateY(-4px);
}

.enemy-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 4px rgba(255, 68, 68, 0.3));
}

.enemy-card .enemy-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.enemy-card .enemy-ability {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.enemy-group-label {
  grid-column: 1 / -1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--border);
}

/* ========== 壁グリッド ========== */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.wall-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 14px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.wall-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.wall-card[data-type="basic"]::before { background: var(--cyan); }
.wall-card[data-type="fire"]::before { background: var(--fire); }
.wall-card[data-type="ice"]::before { background: var(--ice); }
.wall-card[data-type="thunder"]::before { background: var(--thunder); }
.wall-card[data-type="poison"]::before { background: var(--poison); }

.wall-card:hover { transform: translateY(-4px); }

.wall-card[data-type="basic"]:hover { border-color: var(--cyan); box-shadow: 0 0 24px rgba(0, 204, 255, 0.15); }
.wall-card[data-type="fire"]:hover { border-color: var(--fire); box-shadow: 0 0 24px rgba(255, 102, 0, 0.15); }
.wall-card[data-type="ice"]:hover { border-color: var(--ice); box-shadow: 0 0 24px rgba(0, 255, 255, 0.15); }
.wall-card[data-type="thunder"]:hover { border-color: var(--thunder); box-shadow: 0 0 24px rgba(255, 224, 51, 0.15); }
.wall-card[data-type="poison"]:hover { border-color: var(--poison); box-shadow: 0 0 24px rgba(196, 77, 255, 0.15); }

.wall-card img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 12px;
}

.wall-card .wall-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.wall-card .wall-stats {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== アーキテクチャ ========== */
.arch-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.arch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  transition: all 0.3s;
}

.arch-card:hover {
  border-color: rgba(0, 204, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 204, 255, 0.06);
}

.arch-card h4 {
  font-size: 0.9rem;
  color: var(--cyan-bright);
  margin-bottom: 10px;
  font-weight: 600;
}

.arch-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.flow-title {
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.scene-flow {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  overflow-x: auto;
  white-space: nowrap;
}

.scene-flow .scene-node {
  display: inline-block;
  padding: 6px 14px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0, 204, 255, 0.3);
  border-radius: 4px;
  color: var(--cyan-bright);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.scene-flow .arrow {
  color: var(--text-muted);
  margin: 0 6px;
  font-family: monospace;
}

.docs-cta {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.docs-cta a {
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  color: var(--cyan);
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 1px;
  transition: all 0.3s;
}

.docs-cta a:hover {
  background: var(--cyan);
  color: var(--bg);
  box-shadow: 0 0 24px var(--cyan-glow);
}

/* ========== セパレータ ========== */
.section-sep {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  max-width: 500px;
  margin: 0 auto;
}

/* ========== フッター ========== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 52px 28px;
  text-align: center;
  background: var(--bg);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.5px;
  transition: color 0.25s;
}

.footer-links a:hover { color: var(--cyan); }

.footer-copy {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 1px;
}

/* ========== ナビ動的状態 ========== */
.nav-links a.active {
  color: var(--cyan-bright);
  background: var(--cyan-dim);
}

.site-nav.scrolled {
  background: rgba(5, 5, 16, 0.95);
  border-bottom-color: rgba(0, 204, 255, 0.35);
}

/* ========== スクロールトップ ========== */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 204, 255, 0.2);
}

/* ========== レスポンシブ ========== */
@media (max-width: 900px) {
  .char-grid { grid-template-columns: repeat(3, 1fr); }
  .enemy-grid { grid-template-columns: repeat(3, 1fr); }
  .wall-grid { grid-template-columns: repeat(3, 1fr); }
  .arch-features { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-nav { padding: 0 14px; height: 48px; }
  .nav-logo { font-size: 12px; letter-spacing: 1.5px; }
  .nav-links { display: none; }
  .hero { padding-top: 48px; }

  .about-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: repeat(2, 1fr); }
  .enemy-grid { grid-template-columns: repeat(2, 1fr); }
  .wall-grid { grid-template-columns: repeat(2, 1fr); }

  .lp-section { padding: 56px 16px; }
  .section-title { font-size: 1.25rem; }

  #game-container {
    max-width: calc(100vw - 20px);
    overflow: hidden;
  }
  #game-container canvas {
    max-width: 100%;
    height: auto !important;
  }
}
