/* style.css - レトロ風ポートフォリオサイト レスポンシブ対応版 */
:root {
  --ps2-black: #0a0808;
  --ps2-dark-gray: #1a1715;
  --ps2-gray: #3a3633;
  --ps2-light-gray: #7a7571;
  --ps2-red: #a82c2c;
  --ps2-green: #2a8c2a;
  --ps2-blue: #2c4aa8;
  --ps2-yellow: #a88c2c;
  --ps2-accent: #c0a080;

  --bg-color: var(--ps2-black);
  --nav-bg: var(--ps2-dark-gray);
  --nav-border: var(--ps2-gray);
  --text-color-dim: var(--ps2-light-gray);
  --text-color-normal: #a8a3a0;
  --text-color-bright: #d8d3d0;
  --accent-color: var(--ps2-accent);
  --accent-color-hover: #e0c39e;
  --green-color: var(--ps2-green);
  --green-color-hover: #6b9465;
  --selection-bg: rgba(192, 160, 128, 0.15);

  --font-primary: 'DotGothic16', 'MS Gothic', 'Hiragino Kaku Gothic ProN', monospace;

  --scanline-opacity: 0.15;
  --noise-opacity: 0.05;

  /* デスクトップ初期値 */
  --nav-width: 320px;
  --nav-padding: 55px;
  --header-height: 0px;
  /* デスクトップではヘッダー高さなし */
}

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

html {
  font-size: 16px;
}

body {
  background: var(--bg-color);
  color: var(--text-color-normal);
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: 1.4;
  overflow: hidden;
  /* スクロールは main-content で制御 */
  position: relative;
  height: 100vh;
  width: 100vw;
}

/* --- ユーティリティ --- */
a {
  text-decoration: none;
  color: inherit;
}

/* --- エラー通知 --- */
.error-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--ps2-red);
  color: white;
  padding: 15px 20px;
  border: 2px solid var(--accent-color);
  border-radius: 4px;
  z-index: 10000;
  max-width: 90%;
  width: 300px;
  animation: slideInRight 0.5s ease-out;
}

.error-notification h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--accent-color-hover);
}

.error-notification button {
  margin-top: 10px;
  background: var(--nav-bg);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 5px 10px;
  cursor: pointer;
  font-family: var(--font-primary);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-color-hover);
  box-shadow: 0 0 10px var(--accent-color-hover);
}

::selection {
  background: var(--selection-bg);
  color: var(--accent-color-hover);
}

/* --- ローディング画面 --- */
#loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-color) 0%, #1a1715 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9000;
  /* 最前面 */
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-system-info {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 0.75rem;
  color: var(--text-color-dim);
  line-height: 1.4;
}

.loading-ps2-logo {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--accent-color);
  letter-spacing: 5px;
  margin-bottom: 30px;
  text-shadow: 0 0 20px var(--accent-color);
  text-align: center;
}

.ps2-trademark {
  font-size: 1.2rem;
  vertical-align: super;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--nav-border);
  border-top: 4px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  color: var(--accent-color);
  margin-bottom: 20px;
  letter-spacing: 3px;
  animation: loading-pulse 1.2s infinite ease-in-out;
}

@keyframes loading-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    scale: 0.98;
  }
}

.loading-bar-container {
  width: min(320px, 80%);
  height: 16px;
  border: 2px solid var(--nav-border);
  padding: 3px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-color-hover) 50%, var(--accent-color) 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--accent-color);
  position: relative;
}

.loading-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(255, 255, 255, 0.3) 6px, rgba(255, 255, 255, 0.3) 12px);
  animation: loading-bar-shimmer 0.3s infinite linear;
}

@keyframes loading-bar-shimmer {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(12px);
  }
}

.loading-stage {
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--accent-color);
  letter-spacing: 1px;
  text-align: center;
}

.loading-status {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-color-dim);
  text-align: center;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 背景演出要素 --- */
.catch-copy,
.catch-copy2 {
  font-size: 40rem;
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: -1;
  pointer-events: none;
  transform: translate(22.5%, 20%);
  line-height: 1;
  opacity: 0.3;
  animation: slideUpReveal 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpReveal {
  0% {
    transform: translate(22.5%, 60%);
    opacity: 0;
  }

  100% {
    transform: translate(22.5%, 20%);
    opacity: 0.3;
  }
}

/* --- エフェクトレイヤー (Scanlines, VHS, CRT) --- */
.particle-layer,
.vhs-noise,
.scanlines,
.crt-warp,
.section-transition {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.particle-layer {
  z-index: 999;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
}

.section-transition {
  background: var(--bg-color);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.section-transition.active {
  opacity: 1;
  pointer-events: auto;
}

.vhs-noise {
  z-index: 998;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.7'/%3E%3C/svg%3E");
  animation: vhs-drift 0.15s infinite;
  mix-blend-mode: overlay;
}

@keyframes vhs-drift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(-1px, 0) scale(1.001);
  }

  50% {
    transform: translate(1px, 1px) scale(0.999);
  }

  75% {
    transform: translate(0, -1px) scale(1);
  }
}

.scanlines {
  z-index: 997;
  opacity: var(--scanline-opacity);
  background: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0, 0, 0, 0.4) 1px, rgba(0, 0, 0, 0.4) 2px);
  animation: scanline-flicker 0.12s infinite;
  mix-blend-mode: multiply;
}

@keyframes scanline-flicker {
  0% {
    opacity: var(--scanline-opacity);
  }

  50% {
    opacity: calc(var(--scanline-opacity) * 0.7);
  }

  100% {
    opacity: var(--scanline-opacity);
  }
}

.crt-warp {
  z-index: 996;
  mix-blend-mode: screen;
  opacity: 0.03;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(100, 150, 255, 0.1) 50%, rgba(255, 100, 100, 0.1) 70%, transparent 100%);
  animation: crt-warp 6s infinite ease-in-out;
}

@keyframes crt-warp {

  0%,
  100% {
    transform: scale(1, 1) translate(0, 0);
  }

  25% {
    transform: scale(1.001, 0.999) translate(1px, 0);
  }

  50% {
    transform: scale(0.999, 1.001) translate(0, 1px);
  }

  75% {
    transform: scale(1.0005, 0.9995) translate(-1px, 0);
  }
}

/* --- UI要素 (FPS, Keyboard) --- */
.fps-counter {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--nav-border);
  border-radius: 4px;
  color: var(--accent-color-hover);
  font-size: 0.85rem;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.fps-counter.visible {
  opacity: 1;
}

.keyboard-indicator {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  gap: 10px;
  z-index: 100;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.keyboard-indicator.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.indicator-item {
  background: var(--nav-bg);
  border: 2px solid var(--nav-border);
  color: var(--text-color-dim);
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.indicator-item.pressed {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(0.95);
  box-shadow: 0 0 10px var(--accent-color);
}

/* --- サイトレイアウト --- */
.site-wrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 100;
}

/* サイドナビゲーション (PCデフォルト) */
.side-nav {
  width: var(--nav-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--nav-bg);
  border-right: 2px solid #000;
  box-shadow:
    inset -12px 0 18px -12px rgba(0, 0, 0, 0.8),
    6px 0 18px -6px rgba(0, 0, 0, 0.3),
    inset 0 0 60px rgba(192, 160, 128, 0.03);
  display: flex;
  flex-direction: column;
  padding: var(--nav-padding) 0;
  z-index: 100;
  transition: width 0.4s, height 0.4s, padding 0.4s;
  overflow: hidden;
}

/* サイドバー レトロ演出 */
.side-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 4px);
  pointer-events: none;
  z-index: 1;
}

/* サイドバー CRT曲率エフェクト */
.side-nav::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center,
      transparent 60%,
      rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
  z-index: 2;
}

/* サイドバー ボーダーグロー */
.side-nav {
  border-right: 2px solid rgba(192, 160, 128, 0.3);
  animation: sidebar-border-pulse 4s ease-in-out infinite;
}

@keyframes sidebar-border-pulse {

  0%,
  100% {
    border-right-color: rgba(192, 160, 128, 0.2);
    box-shadow:
      inset -12px 0 18px -12px rgba(0, 0, 0, 0.8),
      6px 0 18px -6px rgba(0, 0, 0, 0.3),
      inset 0 0 60px rgba(192, 160, 128, 0.03),
      2px 0 8px rgba(192, 160, 128, 0.1);
  }

  50% {
    border-right-color: rgba(192, 160, 128, 0.4);
    box-shadow:
      inset -12px 0 18px -12px rgba(0, 0, 0, 0.8),
      6px 0 18px -6px rgba(0, 0, 0, 0.3),
      inset 0 0 60px rgba(192, 160, 128, 0.05),
      2px 0 15px rgba(192, 160, 128, 0.2);
  }
}

/* メインコンテンツエリア */
.main-content {
  flex: 1;
  margin-left: var(--nav-width);
  /* PC用マージン */
  margin-top: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.4s, padding-top 0.4s;
  background: transparent !important;
  position: relative;
}

/* セクション共通 */
.section-header {
  padding: 40px 5% 20px;
  text-align: center;
}

.section-header h2 {
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.section-description {
  color: var(--text-color-dim);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.content-section {
  display: none;
  background: transparent;
  padding: 0;
  min-height: 100vh;
}

.content-section.active {
  display: block;
}

/* 3D Canvas */
#three-canvas-container {
  width: 100%;
  height: 100vh;
  /* ビューポートいっぱいに */
  position: relative;
  overflow: hidden;
  background: transparent;
  touch-action: none;
}

#three-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: pointer;
  image-rendering: pixelated;
}

.scene-info {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  width: 90%;
  text-align: center;
}

.scene-help {
  display: inline-block;
  color: var(--text-color-dim);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border: 1px solid var(--nav-border);
  border-radius: 4px;
}

/* --- ナビゲーション内部パーツ --- */
.nav-mini-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #0f0b0a;
  border-bottom: 1px solid #2a2624;
  z-index: 8;
}

.system-info-bar {
  position: absolute;
  top: 10px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-color-dim);
  z-index: 10;
}

.system-time {
  font-weight: 700;
}

.system-stats {
  display: flex;
  gap: 12px;
}

.system-stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.system-stats .stat-item span:first-child {
  font-size: 0.6rem;
  color: var(--accent-color);
}

.window-controls {
  position: absolute;
  top: 10px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.window-btn {
  width: 16px;
  height: 16px;
  border: 1px solid var(--nav-border);
  background: var(--bg-color);
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--text-color-dim);
  transition: all 0.2s ease;
}

.window-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.window-btn.close:hover {
  background: var(--ps2-red);
  border-color: var(--ps2-red);
  color: white;
}

.drive-info {
  position: absolute;
  bottom: 20px;
  left: 15px;
  right: 15px;
  font-size: 0.7rem;
}

.drive-label {
  color: var(--accent-color);
  margin-bottom: 5px;
}

.drive-bar {
  height: 6px;
  background: var(--bg-color);
  border: 1px solid var(--nav-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}

.drive-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-color-hover) 100%);
  transition: width 0.3s ease;
}

.drive-stats {
  display: flex;
  justify-content: space-between;
  color: var(--text-color-dim);
  font-size: 0.6rem;
}

/* ナビタブ */
.nav-noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color-dim);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  z-index: 3;
}

.nav-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0.05) 60%, transparent 100%);
  filter: blur(4px);
  transition: left 0.6s ease-out;
}

.nav-tab:hover::before {
  left: 100%;
}

.nav-tab:hover,
.nav-tab:focus-visible {
  color: var(--accent-color-hover);
  text-shadow: 0 0 8px rgba(192, 160, 128, 0.5);
}

.nav-tab.active-tab {
  color: var(--accent-color);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(192, 160, 128, 0.4);
  animation: nav-text-glow 3s ease-in-out infinite;
}

@keyframes nav-text-glow {

  0%,
  100% {
    text-shadow: 0 0 8px rgba(192, 160, 128, 0.3);
  }

  50% {
    text-shadow: 0 0 15px rgba(192, 160, 128, 0.6), 0 0 25px rgba(192, 160, 128, 0.2);
  }
}

.nav-header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 60px 0 40px;
  position: relative;
  z-index: 1;
}

.nav-header .nav-tab {
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.nav-header .nav-tab::before {
  display: none;
  content: none;
}

.power-button-simple {
  width: 48px;
  height: 48px;
  border: 3px solid var(--nav-border);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 12px;
  background: radial-gradient(circle at center, var(--nav-bg) 0%, #1f1d1c 100%);
  flex-shrink: 0;
}

.power-button-simple::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 16px;
  background: var(--nav-border);
  transition: all 0.3s ease;
}

.nav-text-power {
  font-size: 1.2rem;
  letter-spacing: 1px;
  transition: color 0.3s ease, opacity 0.3s ease;
  white-space: nowrap;
}

.nav-header .nav-tab:hover .power-button-simple {
  border-color: var(--accent-color-hover);
  box-shadow: 0 0 15px var(--accent-color-hover), 0 0 5px var(--accent-color-hover) inset;
}

.nav-header .nav-tab:hover .power-button-simple::before {
  background: var(--accent-color-hover);
}

.nav-header .nav-tab.active-tab .power-button-simple {
  border-color: var(--accent-color);
  box-shadow: 0 0 20px var(--accent-color), 0 0 8px var(--accent-color) inset;
  animation: power-pulse 2s infinite;
}

@keyframes power-pulse {

  0%,
  100% {
    box-shadow: 0 0 20px var(--accent-color), 0 0 8px var(--accent-color) inset;
  }

  50% {
    box-shadow: 0 0 30px var(--accent-color), 0 0 12px var(--accent-color) inset;
  }
}

.nav-header .nav-tab.active-tab .power-button-simple::before {
  background: var(--accent-color);
}

.nav-header .nav-tab.active-tab .nav-text-power {
  color: var(--accent-color);
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  z-index: 1;
}

.nav-item-folder .nav-tab {
  padding: 18px 30px;
  width: 100%;
  border-top: 1px solid #1f1d1c;
  border-bottom: 1px solid #353231;
}

.folder-icon {
  width: 28px;
  height: 22px;
  border: 2px solid var(--text-color-dim);
  border-radius: 3px;
  margin-right: 18px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.folder-icon::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 4px;
  width: 10px;
  height: 4px;
  background: var(--text-color-dim);
  border-radius: 2px 2px 0 0;
  transition: all 0.3s ease;
}

.nav-item-folder .nav-tab:hover .folder-icon,
.nav-item-folder .nav-tab:hover .folder-icon::before {
  border-color: var(--accent-color-hover);
}

.nav-item-folder .nav-tab.active-tab .folder-icon,
.nav-item-folder .nav-tab.active-tab .folder-icon::before {
  border-color: var(--accent-color);
}

.nav-item-folder .nav-tab.active-tab {
  background: linear-gradient(90deg, var(--selection-bg) 0%, transparent 100%);
  color: var(--accent-color);
}

/* --- カード & ボタン --- */
.btn {
  background: var(--nav-bg);
  border: 2px solid var(--nav-border);
  color: var(--text-color-normal);
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  border-radius: 4px;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--accent-color-hover);
  color: var(--accent-color-hover);
  box-shadow: 0 4px 12px rgba(197, 168, 128, 0.2);
  transform: translateY(-2px);
}

/* 分岐ボタン */
.asset-links-container {
  position: relative;
  min-width: 140px;
  height: 48px;
  z-index: 10;
}

.split-btn-trigger {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--nav-bg);
  border: 2px solid var(--nav-border);
  color: var(--text-color-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  z-index: 2;
}

.split-btn-menu {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--nav-bg);
  border: 2px solid var(--accent-color);
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.asset-links-container:hover .split-btn-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  z-index: 3;
  bottom: -10px;
}

.asset-links-container:hover .split-btn-trigger {
  opacity: 0;
  pointer-events: none;
}

.shop-link-item {
  padding: 12px;
  text-align: center;
  color: var(--text-color-bright);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
  border-bottom: 1px solid var(--nav-border);
  display: block;
}

.shop-link-item:last-child {
  border-bottom: none;
}

.shop-link-item:hover {
  background: var(--accent-color);
  color: var(--bg-color);
}

/* カードグリッド (レスポンシブ調整: minmaxを小さく) */
.asset-grid-modern,
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  /* スマホで1カラムになるように調整 */
  gap: 30px;
  padding: 0 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.asset-card-modern,
.portfolio-card {
  background: var(--nav-bg);
  border: 2px solid var(--nav-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.asset-card-modern:hover,
.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(197, 168, 128, 0.25);
  border-color: var(--accent-color);
}

.asset-image-container,
.portfolio-image {
  width: 100%;
  height: 200px;
  background: #2a2725;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color-dim);
  position: relative;
  overflow: hidden;
}

.asset-image-container img,
.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--accent-color);
  color: var(--bg-color);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 3px;
  z-index: 1;
}

.asset-badge.popular {
  background: var(--ps2-yellow);
}

.asset-content,
.portfolio-info {
  padding: 20px;
}

.asset-content h3,
.portfolio-header h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: var(--text-color-bright);
}

.asset-description,
.portfolio-description {
  color: var(--text-color-normal);
  margin-bottom: 20px;
  min-height: 60px;
  font-size: 0.9rem;
}

.asset-meta,
.portfolio-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: var(--text-color-dim);
  flex-wrap: wrap;
  gap: 10px;
}

.asset-footer {
  padding: 0 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.asset-price {
  font-size: 1.1rem;
  color: var(--accent-color);
  font-weight: 700;
}

.portfolio-date {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--accent-color);
  border-radius: 3px;
}

.blender-version {
  font-size: 0.8rem;
  color: var(--text-color-dim);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 3px;
}

.portfolio-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--nav-border);
  color: var(--text-color-dim);
  padding: 4px 8px;
  font-size: 0.7rem;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.tag:hover {
  background: var(--accent-color);
  color: var(--bg-color);
}

/* --- 説明ウィンドウ (モーダル) --- */
.game-description-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  /* 右側に配置 */
  align-items: center;
  z-index: 1003;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
  padding-right: 40px;
  /* 右側に余白 */
}

.game-description-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.game-description-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  /* 透明度を下げて3Dビューを見やすく */
  backdrop-filter: blur(1px);
}

.description-window {
  position: relative;
  width: 45%;
  /* 画面の半分程度 */
  max-width: 600px;
  height: 75vh;
  max-height: 700px;
  background: var(--nav-bg);
  border: 3px solid var(--nav-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(197, 168, 128, 0.3);
  z-index: 1;
  animation: window-slide-in 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

@keyframes window-slide-in {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }

  70% {
    transform: translateX(-10px);
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.window-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.frame-line {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 0;
  height: 3px;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

.window-frame.animated .frame-line {
  animation: frame-line-draw 0.8s ease-out forwards;
}

@keyframes frame-line-draw {
  0% {
    width: 0;
  }

  100% {
    width: calc(100% + 6px);
  }
}

.window-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row-reverse;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%), repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.05) 2px, rgba(0, 0, 0, 0.05) 4px);
  overflow: hidden;
}

.ps2-texture-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0, 0, 0, 0.05) 1px, rgba(0, 0, 0, 0.05) 2px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.1'/%3E%3C/svg%3E");
  z-index: 10;
  mix-blend-mode: overlay;
}

.ps2-text {
  letter-spacing: 0.5px;
  text-shadow: 0 0 1px currentColor, 0.5px 0 0 rgba(255, 255, 255, 0.1), -0.5px 0 0 rgba(0, 0, 0, 0.3);
  image-rendering: pixelated;
  line-height: 1.4 !important;
}

.info-panel {
  width: 100%;
  height: 100%;
  padding: 40px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.info-panel h3 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--accent-color);
  margin-bottom: 20px;
  letter-spacing: 2px;
  border-bottom: 2px solid var(--nav-border);
  padding-bottom: 12px;
}

.description-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-color-normal);
  margin-bottom: 30px;
  white-space: pre-wrap;
}

.game-stats {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid var(--nav-border);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.stat-label {
  color: var(--text-color-dim);
  font-weight: 400;
}

.stat-value {
  color: var(--accent-color);
  font-weight: 700;
  text-align: right;
  max-width: 60%;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--accent-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: var(--accent-color);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  background: var(--accent-color);
  color: var(--bg-color);
  transform: scale(1.1);
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--nav-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* --- 背景演出と3Dアイコン (z-index強制) --- */
#layer-atmosphere {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(white, rgba(255, 255, 255, 0.1) 2px, transparent 3px), radial-gradient(white, rgba(255, 255, 255, 0.05) 1px, transparent 2px);
  background-size: 500px 500px, 300px 300px;
  background-position: 0 0, 100px 150px;
  opacity: 0.2;
  animation: mist-move 60s linear infinite;
}

@keyframes mist-move {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-500px);
  }
}

#layer-asset-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#layer-asset-bg.active {
  opacity: 1;
}

#layer-asset-bg .bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  opacity: 0;
  transition: opacity 0.8s ease, transform 5s ease;
}

#layer-asset-bg .bg-overlay-color {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2;
}

#layer-asset-bg[data-mode="normal"] .bg-image.normal {
  opacity: 0.8;
  filter: blur(10px);
  transform: scale(1.05);
  z-index: 1;
}

#layer-asset-bg[data-mode="wireframe"] .bg-image.wireframe {
  opacity: 0.4;
  filter: none;
  transform: scale(1.05);
  z-index: 3;
}

#layer-asset-bg[data-mode="wireframe"] .bg-image.normal {
  opacity: 0;
}

#layer-save-icon {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.7;
  animation: icon-breathe 3s infinite ease-in-out;
  pointer-events: none;
}

.ps2-cube {
  width: 24px;
  height: 36px;
  position: relative;
  transform-style: preserve-3d;
  animation: cube-spin 4s infinite linear;
}

.ps2-cube .face {
  position: absolute;
  border: 1px solid var(--accent-color);
  background: rgba(10, 8, 8, 0.85);
  box-shadow: 0 0 5px rgba(192, 160, 128, 0.2);
}

.ps2-cube .front,
.ps2-cube .back {
  width: 24px;
  height: 36px;
}

.ps2-cube .front {
  transform: translateZ(12px);
}

.ps2-cube .back {
  transform: rotateY(180deg) translateZ(12px);
}

.ps2-cube .right,
.ps2-cube .left {
  width: 24px;
  height: 36px;
}

.ps2-cube .right {
  transform: rotateY(90deg) translateZ(12px);
}

.ps2-cube .left {
  transform: rotateY(-90deg) translateZ(12px);
}

.ps2-cube .top,
.ps2-cube .bottom {
  width: 24px;
  height: 24px;
}

.ps2-cube .top {
  transform: rotateX(90deg) translateZ(12px);
}

.ps2-cube .bottom {
  transform: rotateX(-90deg) translateZ(24px);
}

.ps2-cube .core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--ps2-blue);
  box-shadow: 0 0 15px var(--ps2-blue);
  border-radius: 50%;
}

.save-text {
  font-size: 10px;
  color: var(--text-color-dim);
  letter-spacing: 1px;
}

@keyframes cube-spin {
  0% {
    transform: rotateX(-15deg) rotateY(0deg);
  }

  100% {
    transform: rotateX(-15deg) rotateY(360deg);
  }
}

@keyframes icon-breathe {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* ============================================================================
   ★ レスポンシブ対応 (Mobile & Tablet)
   ============================================================================ */

@media (max-width: 1024px) {
  :root {
    --nav-width: 0px;
    --header-height: 100px;
    /* スマホ用ヘッダー高さ */
  }

  /* レイアウト変更: サイドバーを上部ヘッダーへ */
  .side-nav {
    width: 100%;
    height: var(--header-height);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-right: none;
    border-bottom: 2px solid #000;
    background: var(--nav-bg);
  }

  .main-content {
    margin-left: 0;
    margin-top: var(--header-height);
    /* ヘッダー分の余白 */
    height: calc(100vh - var(--header-height));
  }

  /* 非表示要素 */
  .system-info-bar,
  .drive-info,
  .window-controls,
  .keyboard-indicator,
  .catch-copy,
  .catch-copy2,
  .nav-mini-header {
    display: none;
  }

  /* ナビゲーション調整 */
  .nav-header {
    width: auto;
    padding: 0;
    border: none;
    margin-right: 10px;
  }

  .nav-header .nav-tab {
    padding: 5px;
    flex-direction: row;
    align-items: center;
  }

  .power-button-simple {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
    margin-right: 8px;
    border-width: 2px;
  }

  .nav-text-power {
    font-size: 0.9rem;
  }

  .nav-list {
    display: flex;
    flex-direction: row;
    flex: 1;
    justify-content: flex-end;
    gap: 5px;
  }

  .nav-item-folder .nav-tab {
    padding: 8px 10px;
    border: 1px solid var(--nav-border);
    border-radius: 4px;
    flex-direction: row;
    align-items: center;
    width: auto;
    justify-content: center;
  }

  .nav-text {
    font-size: 0.8rem;
  }

  .folder-icon {
    width: 20px;
    height: 16px;
    margin-right: 6px;
  }

  .folder-icon::before {
    width: 8px;
    height: 3px;
    top: -4px;
  }

  /* アクティブタブのエフェクト調整 (モバイルでは控えめに) */
  .nav-header .nav-tab.active-tab .power-button-simple {
    box-shadow: 0 0 10px var(--accent-color), 0 0 4px var(--accent-color) inset;
    animation: none;
    /* パフォーマンスのためアニメーション停止 */
  }

  /* グリッドとコンテンツ */
  .asset-grid-modern,
  .portfolio-grid {
    padding: 20px;
    gap: 20px;
    grid-template-columns: 1fr;
    /* 完全1カラム */
  }

  .section-header {
    padding: 20px 15px;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  /* 3Dシーン調整 */
  #three-canvas-container {
    height: calc(100vh - var(--header-height));
  }

  .scene-info {
    bottom: 20px;
    width: 95%;
    padding: 0 10px;
  }

  .scene-help {
    font-size: 0.75rem;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
  }

  /* モーダル (縦並び) - モバイルでは中央配置 */
  .game-description-overlay {
    justify-content: center;
    padding-right: 20px;
  }

  .description-window {
    height: auto;
    max-height: 85vh;
    width: 95%;
    overflow-y: auto;
  }

  .window-content {
    flex-direction: column !important;
    /* 画像上、テキスト下 */
    height: auto;
    overflow: visible;
  }

  .info-panel {
    width: 100%;
    padding: 20px;
    height: auto;
  }

  /* ローディング画面調整 */
  .loading-ps2-logo {
    letter-spacing: 2px;
    margin-bottom: 20px;
  }

  .loading-text {
    margin-bottom: 15px;
  }

  #layer-save-icon {
    bottom: 20px;
    right: 20px;
    transform: scale(0.8);
  }
}

/* スマートフォン縦向き特化 (さらに小さい画面) */
@media (max-width: 480px) {
  :root {
    --header-height: 0px;
    /* 上部ヘッダーなし */
    --footer-height: 70px;
    /* 下部ナビの高さ */
  }

  /* テキスト復活 */
  .nav-text-power,
  .nav-text {
    display: block;
    font-size: 0.65rem;
    margin-top: 4px;
    line-height: 1;
  }

  /* ナビゲーションを下部へ */
  .side-nav {
    top: auto;
    bottom: 0;
    height: var(--footer-height);
    border-bottom: none;
    border-top: 2px solid #000;
    justify-content: space-evenly;
    padding: 0;
    z-index: 500;
    /* モーダルより下、キャンバスより上 */
    display: flex;
  }

  .main-content {
    margin-top: 0;
    height: calc(100vh - var(--footer-height));
    margin-bottom: var(--footer-height);
  }

  /* アイコンのみレイアウト解除、縦並びに */
  .nav-header {
    margin-right: 0;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 1px solid #2a2624;
  }

  .nav-header .nav-tab {
    flex-direction: column;
    padding: 5px 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
  }

  .power-button-simple {
    width: 24px;
    height: 24px;
    margin-right: 0;
    margin-bottom: 2px;
    border-width: 2px;
  }

  .nav-list {
    flex: 3;
    gap: 0;
    justify-content: space-evenly;
    display: flex;
  }

  .nav-item-folder {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-left: none;
  }

  .nav-item-folder .nav-tab {
    padding: 5px 0;
    border: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
  }

  .folder-icon {
    width: 22px;
    height: 16px;
    margin-right: 0;
    margin-bottom: 2px;
  }

  .folder-icon::before {
    top: -5px;
    left: 2px;
  }

  /* 3Dキャンバスなどの高さ調整 */
  #three-canvas-container {
    height: calc(100vh - var(--footer-height));
  }

  /* その他調整 */
  .asset-grid-modern,
  .portfolio-grid {
    padding: 15px 15px 30px;
    /* 下部に余白 */
  }

  .asset-image-container,
  .portfolio-image {
    height: 160px;
  }

  .asset-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .asset-links-container,
  .btn {
    width: 100%;
    text-align: center;
  }

  /* モーダル位置調整 */
  .description-window {
    max-height: calc(85vh - var(--footer-height));
  }

  #layer-save-icon {
    bottom: calc(20px + var(--footer-height));
    /* アイコンが隠れないように */
    right: 10px;
    transform: scale(0.7);
  }

  .scene-info {
    bottom: calc(10px + var(--footer-height));
  }
}

/* Introduction Grid */
.introduction-grid {
  padding: 0 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

@media (max-width: 768px) {
  .introduction-grid {
    padding: 0 20px 20px;
  }
}

/* =============================================================================
   追加演出効果 - Enhanced Visual Effects
   ============================================================================= */

/* 1. 背景パーティクル（浮遊ダスト） */
.ambient-particle {
  position: fixed;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  animation: ambient-float 15s infinite linear;
}

@keyframes ambient-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) translateX(0) scale(0.5);
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    opacity: 0;
    transform: translateY(-100px) translateX(50px) scale(1);
  }
}

/* 2. グリッチエフェクト */
.glitch-target {
  position: relative;
}

.glitch-target.glitching {
  animation: text-glitch 0.3s ease-in-out;
}

@keyframes text-glitch {

  0%,
  100% {
    transform: translate(0);
    filter: none;
  }

  10% {
    transform: translate(-2px, 1px);
    filter: hue-rotate(90deg);
  }

  20% {
    transform: translate(2px, -1px);
    text-shadow: -2px 0 #ff0000, 2px 0 #00ffff;
  }

  30% {
    transform: translate(-1px, 2px);
    filter: hue-rotate(-90deg);
  }

  40% {
    transform: translate(1px, -2px);
    text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
  }

  50% {
    transform: translate(-2px, -1px);
    clip-path: inset(30% 0 40% 0);
  }

  60% {
    transform: translate(2px, 1px);
    clip-path: inset(50% 0 20% 0);
  }

  70% {
    transform: translate(0);
    clip-path: none;
  }
}

/* 画像グリッチ */
.glitch-image.glitching {
  animation: image-glitch 0.4s ease-in-out;
}

@keyframes image-glitch {

  0%,
  100% {
    transform: translate(0);
    filter: none;
  }

  20% {
    transform: translate(-3px, 2px);
    filter: saturate(2) hue-rotate(10deg);
  }

  40% {
    transform: translate(3px, -2px);
    filter: saturate(0.5) contrast(1.5);
  }

  60% {
    transform: translate(-2px, -1px);
    filter: brightness(1.3);
  }

  80% {
    transform: translate(2px, 1px);
    filter: saturate(1.5);
  }
}

/* 3. タイピングアニメーション */
.typing-text {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent-color);
  animation: typing-cursor 0.7s step-end infinite;
}

@keyframes typing-cursor {

  0%,
  50% {
    border-color: var(--accent-color);
  }

  51%,
  100% {
    border-color: transparent;
  }
}

/* 4. ネオンパルス効果 */
.neon-pulse {
  animation: neon-glow 3s ease-in-out infinite;
}

@keyframes neon-glow {

  0%,
  100% {
    box-shadow: 0 0 5px var(--accent-color),
      0 0 10px var(--accent-color),
      inset 0 0 5px rgba(192, 160, 128, 0.1);
    border-color: var(--nav-border);
  }

  50% {
    box-shadow: 0 0 10px var(--accent-color),
      0 0 20px var(--accent-color),
      0 0 30px var(--accent-color),
      inset 0 0 10px rgba(192, 160, 128, 0.2);
    border-color: var(--accent-color);
  }
}

/* テキストネオンパルス */
.neon-text-pulse {
  animation: neon-text-glow 4s ease-in-out infinite;
}

@keyframes neon-text-glow {

  0%,
  100% {
    text-shadow: 0 0 5px var(--accent-color);
  }

  50% {
    text-shadow: 0 0 10px var(--accent-color),
      0 0 20px var(--accent-color),
      0 0 30px var(--accent-color);
  }
}

/* 5. ホバー時Waveアニメーション */
.hover-wave {
  transition: transform 0.3s ease;
}

.hover-wave:hover {
  animation: card-wave 0.6s ease-in-out;
}

@keyframes card-wave {

  0%,
  100% {
    transform: perspective(1000px) rotateX(0) rotateY(0);
  }

  25% {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
  }

  50% {
    transform: perspective(1000px) rotateX(-1deg) rotateY(2deg);
  }

  75% {
    transform: perspective(1000px) rotateX(1deg) rotateY(-1deg);
  }
}

/* 6. セクション切替グリッチ */
.section-glitch-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3000;
  opacity: 0;
  background: linear-gradient(0deg,
      transparent 0%,
      rgba(192, 160, 128, 0.1) 50%,
      transparent 100%);
}

.section-glitch-overlay.active {
  animation: section-glitch 0.4s ease-out forwards;
}

@keyframes section-glitch {
  0% {
    opacity: 0;
    transform: translateX(0);
  }

  10% {
    opacity: 1;
    transform: translateX(-5px);
  }

  20% {
    transform: translateX(5px);
    background: linear-gradient(0deg,
        transparent 0%,
        rgba(255, 0, 0, 0.1) 25%,
        rgba(0, 255, 255, 0.1) 75%,
        transparent 100%);
  }

  30% {
    transform: translateX(-3px);
  }

  40% {
    transform: translateX(3px);
  }

  60% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

/* 7. マウストレイル */
.mouse-trail-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  opacity: 0.8;
  mix-blend-mode: screen;
  transition: opacity 0.3s ease-out, transform 0.1s ease-out;
}

/* 8. ランダムVHS歪み強化 */
.vhs-glitch-intense {
  animation: vhs-intense 0.15s linear;
}

@keyframes vhs-intense {
  0% {
    transform: translate(0);
    filter: none;
  }

  10% {
    transform: translate(-2px, 0) skewX(1deg);
    filter: saturate(2);
  }

  20% {
    transform: translate(2px, 1px) skewX(-1deg);
    filter: hue-rotate(5deg);
  }

  30% {
    transform: translate(-1px, -1px);
    filter: brightness(1.2);
  }

  40% {
    transform: translate(1px, 0) skewX(0.5deg);
    filter: contrast(1.2);
  }

  50% {
    transform: translate(0, 1px);
    filter: saturate(1.5);
  }

  60% {
    transform: translate(-1px, 0);
  }

  70% {
    transform: translate(1px, -1px);
  }

  80% {
    transform: translate(0);
  }

  100% {
    transform: translate(0);
    filter: none;
  }
}

/* VHSノイズラインエフェクト */
.vhs-line-glitch::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 9998;
  pointer-events: none;
  animation: vhs-line-scan 3s linear infinite;
}

@keyframes vhs-line-scan {
  0% {
    top: -10px;
    opacity: 0;
  }

  5% {
    opacity: 0.8;
  }

  95% {
    opacity: 0.8;
  }

  100% {
    top: 100vh;
    opacity: 0;
  }
}

/* ボーダーパルスエフェクト（ナビゲーション用） */
.nav-tab.active-tab .power-button-simple {
  animation: power-pulse 2s ease-in-out infinite, neon-glow 3s ease-in-out infinite;
}

/* アセットカードホバー強化 */
.asset-card-modern {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.asset-card-modern:hover {
  animation: card-wave 0.6s ease-in-out;
  box-shadow: 0 10px 40px rgba(192, 160, 128, 0.2),
    0 0 20px rgba(192, 160, 128, 0.1);
}

/* ポートフォリオカードホバー強化 */
.portfolio-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
  animation: card-wave 0.6s ease-in-out;
  box-shadow: 0 10px 40px rgba(192, 160, 128, 0.2);
}

/* ローディングテキストにタイピングカーソル */
.loading-text {
  border-right: 3px solid var(--accent-color);
  animation: loading-pulse 1.2s infinite ease-in-out, typing-cursor 0.7s step-end infinite;
}

/* スキャンライン強化 - 時々強いライン */
.scanlines.intense-scan::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  animation: intense-scanline 4s linear infinite;
}

@keyframes intense-scanline {
  0% {
    top: -10px;
  }

  100% {
    top: 100vh;
  }
}

/* =============================================================================
   ブログセクション スタイル
   ============================================================================= */

/* ブログフィルター */
.blog-filter-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px 5%;
  flex-wrap: wrap;
}

.blog-filter-btn {
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  color: var(--text-color-dim);
  padding: 8px 20px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.blog-filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.blog-filter-btn.active {
  background: var(--accent-color);
  color: var(--bg-color);
  border-color: var(--accent-color);
}

/* ブログカードグリッド */
#portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 25px;
  padding: 20px 5% 60px;
}

/* ブログカード */
.blog-card {
  background: linear-gradient(145deg, var(--nav-bg), rgba(26, 23, 21, 0.9));
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(192, 160, 128, 0.15),
    0 0 20px rgba(192, 160, 128, 0.08);
  border-color: var(--accent-color);
}

.blog-card-thumbnail {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.blog-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-thumbnail img {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.blog-card-date {
  font-size: 0.75rem;
  color: var(--text-color-dim);
}

.blog-card-category {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--nav-border);
  color: var(--text-color-normal);
}

.blog-card-category[data-category="Works"] {
  background: rgba(42, 140, 42, 0.3);
  color: var(--ps2-green);
}

.blog-card-category[data-category="Tips"] {
  background: rgba(168, 140, 44, 0.3);
  color: var(--ps2-yellow);
}

.blog-card-title {
  font-size: 1.05rem;
  color: var(--text-color-bright);
  margin-bottom: 10px;
  line-height: 1.4;
}

.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-color-dim);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-readmore {
  font-size: 0.8rem;
  color: var(--accent-color);
  margin-top: 15px;
  display: block;
  transition: color 0.2s ease;
}

.blog-card:hover .blog-card-readmore {
  color: var(--accent-color-hover);
}

/* ブログ詳細オーバーレイ - フルスクリーン2カラム */
.blog-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 8, 0.98);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
}

.blog-detail-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.blog-detail-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* 左サイドバー：ツイート埋め込みエリア */
.blog-detail-sidebar {
  width: 350px;
  min-width: 350px;
  background: linear-gradient(180deg, var(--nav-bg), rgba(15, 13, 12, 0.98));
  border-right: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.blog-sidebar-header {
  padding: 20px 20px 12px;
  font-size: 0.9rem;
  color: var(--accent-color);
  border-bottom: 1px solid var(--nav-border);
  background: rgba(0, 0, 0, 0.3);
}

/* 目次セクション */
.blog-toc-section {
  border-bottom: 1px solid var(--nav-border);
}

.blog-toc {
  padding: 15px 20px;
  max-height: 40vh;
  overflow-y: auto;
}

.blog-toc-placeholder {
  color: var(--text-color-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 15px 0;
}

.blog-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-toc-item {
  margin-bottom: 8px;
}

.blog-toc-link {
  display: block;
  color: var(--text-color-dim);
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.blog-toc-link:hover {
  color: var(--accent-color);
  background: rgba(192, 160, 128, 0.1);
}

.blog-toc-link.active {
  color: var(--accent-color);
  background: rgba(192, 160, 128, 0.15);
  border-left: 2px solid var(--accent-color);
}

.blog-toc-link[data-level="2"] {
  padding-left: 20px;
  font-size: 0.8rem;
}

.blog-toc-link[data-level="3"] {
  padding-left: 30px;
  font-size: 0.75rem;
}

/* 関連ツイートセクション */
.blog-tweet-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.blog-tweet-container {
  flex: 1;
  padding: 15px 20px;
  overflow-y: auto;
}

.blog-tweet-placeholder {
  color: var(--text-color-dim);
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: center;
  padding: 20px 10px;
}

/* ツイート埋め込み */
.blog-tweet-container .twitter-tweet {
  margin: 0 auto 20px !important;
}

/* メインコンテンツエリア */
.blog-detail-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
  background: linear-gradient(145deg, var(--nav-bg), rgba(20, 18, 16, 0.98));
}

.blog-detail-close {
  position: fixed;
  top: 20px;
  right: 25px;
  width: 44px;
  height: 44px;
  background: var(--bg-color);
  border: 2px solid var(--nav-border);
  border-radius: 50%;
  color: var(--text-color-dim);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 100;
}

.blog-detail-close:hover {
  background: var(--ps2-red);
  border-color: var(--ps2-red);
  color: white;
  transform: scale(1.1);
}

.blog-detail-header {
  padding: 50px 60px 30px;
  border-bottom: 1px solid var(--nav-border);
}

.blog-detail-title {
  font-size: 2.2rem;
  color: var(--text-color-bright);
  margin-bottom: 20px;
  line-height: 1.3;
}

.blog-detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.blog-detail-date {
  font-size: 1rem;
  color: var(--text-color-dim);
}

.blog-detail-category {
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 4px;
  background: var(--nav-border);
  color: var(--text-color-normal);
}

.blog-detail-category[data-category="Works"] {
  background: rgba(42, 140, 42, 0.3);
  color: var(--ps2-green);
}

.blog-detail-category[data-category="Tips"] {
  background: rgba(168, 140, 44, 0.3);
  color: var(--ps2-yellow);
}

.blog-detail-content {
  padding: 40px 60px 60px;
  flex: 1;
}

.blog-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-color-dim);
}

.blog-error {
  text-align: center;
  padding: 40px;
  color: var(--ps2-red);
}

.blog-detail-body {
  color: var(--text-color-normal);
  line-height: 1.9;
  font-size: 1.1rem;
}

.blog-detail-body p {
  margin-bottom: 1.5em;
}

.blog-detail-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.blog-detail-body img:hover {
  transform: scale(1.02);
}

.blog-detail-body h1,
.blog-detail-body h2,
.blog-detail-body h3 {
  color: var(--text-color-bright);
  margin: 1.5em 0 0.5em;
}

.blog-detail-body code {
  background: var(--bg-color);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.blog-detail-body pre {
  background: var(--bg-color);
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
}

.blog-detail-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--nav-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-tag {
  background: var(--nav-border);
  color: var(--text-color-dim);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 0.75rem;
}

.blog-tools {
  font-size: 0.8rem;
  color: var(--text-color-dim);
}

/* 画像ライトボックス */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 40px;
  height: 40px;
  background: var(--ps2-red);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  #portfolio-grid {
    grid-template-columns: 1fr;
    padding: 15px 4%;
  }

  /* ブログ詳細のサイドバーを非表示 */
  .blog-detail-sidebar {
    display: none;
  }

  .blog-detail-header {
    padding: 30px 20px 20px;
  }

  .blog-detail-content {
    padding: 20px;
  }

  .blog-detail-title {
    font-size: 1.5rem;
  }

  .blog-detail-body {
    font-size: 1rem;
  }

  .blog-detail-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .blog-filter-container {
    padding: 15px 4%;
  }
}