/* ==========================================================================
   Ｉｓｅｋａｉｅｄ Ｇｅｎｅｒａｔｏｒ ―― Cyber Fantasy Design System
   ========================================================================== */

:root {
  --bg-dark: #0c051a;
  --bg-surface: #170b33;
  --bg-card: rgba(27, 13, 56, 0.88);
  --bg-hud: rgba(14, 6, 29, 0.92);
  
  --neon-cyan: #00f6ff;
  --neon-pink: #ff2d87;
  --neon-gold: #ffd23f;
  --neon-purple: #9d4edd;
  --neon-green: #38ef7d;
  --neon-red: #ff3366;
  
  --text-main: #fbf8ff;
  --text-muted: #a698c9;
  --text-dim: #6c5c93;
  
  --border-glow: rgba(157, 78, 221, 0.35);
  --border-gold: rgba(255, 210, 63, 0.5);
  
  --font-main: 'Zen Kaku Gothic New', sans-serif;
  --font-mono: 'Chivo Mono', 'Courier New', monospace;
  --font-display: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --shadow-neon: 0 0 20px rgba(157, 78, 221, 0.45);
  --shadow-gold: 0 0 25px rgba(255, 210, 63, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  background-color: var(--bg-dark);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: 
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(157, 78, 221, 0.25), transparent 70%),
    radial-gradient(circle at 10% 40%, rgba(0, 246, 255, 0.08), transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(255, 45, 135, 0.1), transparent 50%),
    linear-gradient(180deg, #090314 0%, #15082a 50%, #0c051a 100%);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow-x: hidden;
  touch-action: manipulation;
}

/* 背景のサイバーグリッドライン */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
}

.background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(119, 71, 255, 0.06), transparent 70%);
  z-index: 0;
}

/* ==========================================================================
   レイアウトコンテナ
   ========================================================================== */

.game-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 16px clamp(10px, 2.5vw, 24px) 24px;
}

/* ==========================================================================
   ブランドヘッダー
   ========================================================================== */

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 4px 0;
}

.kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 246, 255, 0.1);
  border: 1px solid rgba(0, 246, 255, 0.3);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.4vw, 11px);
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 4px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: dotBlink 1.4s ease-in-out infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.8vw, 36px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-shadow: 0 0 20px rgba(157, 78, 221, 0.6);
}

.main-title .fullwidth-text {
  letter-spacing: 0.08em;
}

.accent-title {
  color: var(--neon-gold);
  text-shadow: 0 0 16px rgba(255, 210, 63, 0.6), 2px 2px 0 #7b2cbf;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.icon-text-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 246, 255, 0.3);
  transform: translateY(-1px);
}

.icon-text-btn:active {
  transform: translateY(1px);
}

.icon-text-btn[aria-pressed="true"] {
  border-color: var(--neon-gold);
  background: rgba(255, 210, 63, 0.12);
  color: var(--neon-gold);
}

/* ==========================================================================
   ニュースティッカー
   ========================================================================== */

.ticker-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin-bottom: 12px;
  background: rgba(14, 6, 29, 0.7);
  border: 1px solid rgba(255, 45, 135, 0.3);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.ticker-tag {
  color: var(--neon-pink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
  white-space: nowrap;
  animation: tagPulse 2s ease-in-out infinite;
}

@keyframes tagPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ticker-window {
  flex: 1;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.ticker-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ==========================================================================
   ゲームカード＆HUD
   ========================================================================== */

.game-card {
  background: var(--bg-card);
  border: 2px solid var(--border-glow);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(119, 71, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

.hud {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1fr 1fr 1fr;
  background: var(--bg-hud);
  border-bottom: 2px solid rgba(157, 78, 221, 0.3);
  backdrop-filter: blur(12px);
}

.hud-item {
  padding: 8px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hud-item:last-child {
  border-right: none;
}

.hud-label {
  font-family: var(--font-mono);
  font-size: clamp(8px, 1.3vw, 10px);
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}

.hud-item strong {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2.2vw, 20px);
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
  white-space: nowrap;
}

.glow-value {
  color: var(--neon-gold) !important;
  text-shadow: 0 0 10px rgba(255, 210, 63, 0.5);
}

#highScoreText {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* フィーバーゲージ */
.fever-bar-wrap {
  margin-top: 4px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.fever-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-gold));
  border-radius: 999px;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px var(--neon-pink);
}

/* ライフハート */
.life-hearts {
  display: flex;
  gap: 4px;
  font-size: clamp(14px, 2vw, 18px);
}

.heart {
  color: #4a2d52;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.heart.is-active {
  color: var(--neon-red);
  text-shadow: 0 0 10px rgba(255, 51, 102, 0.7);
  animation: heartThump 2s infinite;
}

@keyframes heartThump {
  0%, 100% { transform: scale(1); }
  5% { transform: scale(1.15); }
  10% { transform: scale(1); }
}

.isekaied-item strong { color: var(--neon-cyan); }
.isekaied-item small { font-size: 11px; margin-left: 2px; color: var(--text-muted); }

.dream-item strong { color: var(--neon-gold); }
.dream-item small { font-size: 10px; margin-left: 2px; color: var(--text-dim); }

/* ==========================================================================
   CANVAS & 演出レイヤー
   ========================================================================== */

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 320px;
  background: #110526;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

/* フィーバーネオンバナー */
.fever-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  border-radius: 999px;
  background: rgba(12, 5, 26, 0.85);
  border: 2px solid var(--neon-gold);
  box-shadow: 0 0 25px rgba(255, 210, 63, 0.6), inset 0 0 15px rgba(255, 45, 135, 0.4);
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--neon-gold);
  font-size: clamp(12px, 2.2vw, 18px);
  letter-spacing: 0.12em;
  pointer-events: none;
  z-index: 8;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fever-banner.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: feverPulse 0.8s ease-in-out infinite alternate;
}

@keyframes feverPulse {
  0% { transform: translateX(-50%) translateY(0) scale(1); filter: hue-rotate(0deg); }
  100% { transform: translateX(-50%) translateY(0) scale(1.05); filter: hue-rotate(90deg); }
}

.fever-sparkle {
  color: var(--neon-cyan);
}

/* ==========================================================================
   オーバーレイ・パネル
   ========================================================================== */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(9, 3, 20, 0.78);
  backdrop-filter: blur(6px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.overlay.is-visible {
  visibility: visible;
  opacity: 1;
}

.panel {
  width: min(580px, 94%);
  background: linear-gradient(145deg, rgba(36, 17, 74, 0.95), rgba(18, 8, 38, 0.98));
  border: 2px solid var(--neon-purple);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 36px);
  text-align: center;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(157, 78, 221, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  animation: panelPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes panelPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.portal-emblem {
  position: relative;
  width: 72px;
  height: 72px;
  margin: -60px auto 12px;
  display: grid;
  place-items: center;
}

.portal-emblem .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.portal-emblem .outer-ring {
  border: 2px dashed var(--neon-gold);
  box-shadow: 0 0 20px var(--neon-gold);
  animation: ringSpin 12s linear infinite;
}

.portal-emblem .inner-ring {
  inset: 6px;
  border: 2px solid var(--neon-pink);
  box-shadow: 0 0 15px var(--neon-pink);
  animation: ringSpin 8s linear infinite reverse;
}

.emblem-core {
  font-size: 32px;
  animation: coreFloat 2s ease-in-out infinite alternate;
}

@keyframes ringSpin { 100% { transform: rotate(360deg); } }
@keyframes coreFloat { 0% { transform: translateY(-3px); } 100% { transform: translateY(3px); } }

.panel-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  color: var(--neon-cyan);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 14px;
}

.panel-title .highlight {
  color: var(--neon-gold);
  text-shadow: 0 0 20px rgba(255, 210, 63, 0.6);
}

.panel-desc {
  font-size: clamp(12px, 1.8vw, 15px);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.panel-desc strong {
  color: var(--text-main);
}

.hint-small {
  display: block;
  margin-top: 8px;
  color: var(--neon-gold);
  font-size: 11px;
}

.start-action-wrap {
  margin-bottom: 18px;
}

/* ボタン群 */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-gold), #ff9e00);
  color: #12082b;
  box-shadow: 0 0 20px rgba(255, 210, 63, 0.4), 0 4px 10px rgba(0,0,0,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 210, 63, 0.7), 0 6px 14px rgba(0,0,0,0.5);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary kbd {
  background: rgba(18, 8, 43, 0.85);
  color: var(--neon-gold);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.btn-secondary {
  background: rgba(255, 45, 135, 0.15);
  color: var(--neon-pink);
  border: 1px solid var(--neon-pink);
  box-shadow: 0 0 15px rgba(255, 45, 135, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 45, 135, 0.3);
  box-shadow: 0 0 25px rgba(255, 45, 135, 0.5);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--neon-cyan);
}

.control-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.control-legend kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-muted);
}

/* ゲームオーバー画面 */
.gameover-text {
  color: var(--neon-red);
  text-shadow: 0 0 20px rgba(255, 51, 102, 0.7);
}

.result-stats-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: rgba(14, 6, 29, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
}

.stat-name {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: clamp(13px, 2vw, 17px);
  color: var(--text-main);
}

.stat-val.highlight {
  color: var(--neon-gold);
}

.reincarnation-summary-card {
  background: rgba(0, 246, 255, 0.08);
  border: 1px dashed rgba(0, 246, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 12px;
}

.badge-mini {
  display: inline-block;
  font-size: 9px;
  color: var(--neon-cyan);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.mvp-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.review-text {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 20px;
}

.button-cluster {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   リアルタイム転生ポップアップカード
   ========================================================================== */

.reincarnate-card {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px) scale(0.9);
  opacity: 0;
  pointer-events: none;
  z-index: 9;
  width: min(420px, 90%);
  background: rgba(22, 10, 48, 0.95);
  border: 2px solid var(--neon-gold);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(255, 210, 63, 0.4);
  backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reincarnate-card.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.rc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.rc-tag {
  color: var(--neon-gold);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.6);
}

.rc-points {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
}

.rc-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rc-avatar {
  font-size: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.rc-info {
  flex: 1;
  text-align: left;
}

.rc-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 2px;
}

.rc-skill-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.rc-skill-label {
  color: var(--text-dim);
}

.rc-skill {
  color: var(--neon-green);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* アナウンストースト */
.announcement-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 9;
  padding: 8px 18px;
  background: rgba(255, 45, 135, 0.9);
  color: #fff;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(255, 45, 135, 0.6);
  transition: all 0.2s ease;
}

.announcement-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   モバイル・タッチ操作
   ========================================================================== */

.mobile-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-hud);
  border-top: 2px solid rgba(157, 78, 221, 0.3);
}

.touch-btn {
  min-height: 52px;
  background: linear-gradient(180deg, #371873, #220e4b);
  border: 1px solid rgba(157, 78, 221, 0.4);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 4px 0 #0d051c;
  transition: transform 0.05s, box-shadow 0.05s;
}

.touch-btn .arrow {
  font-size: 16px;
  color: var(--neon-cyan);
}

.touch-btn .btn-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.touch-btn.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0d051c;
  background: linear-gradient(180deg, #4f23a6, #371873);
  border-color: var(--neon-gold);
}

.touch-center-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hint-pulse {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 6px var(--neon-pink);
  animation: dotBlink 1s infinite;
}

/* ==========================================================================
   転生図鑑モーダル
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(9, 3, 20, 0.85);
  backdrop-filter: blur(8px);
  visibility: hidden;
  opacity: 0;
  transition: all 0.25s ease;
}

.modal-overlay.is-visible {
  visibility: visible;
  opacity: 1;
}

.modal-card {
  width: min(720px, 95%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 2px solid var(--neon-purple);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 30px rgba(157,78,221,0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 10px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--neon-gold);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close-btn:hover {
  color: var(--neon-pink);
}

.dex-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dex-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding-right: 4px;
}

.dex-item-card {
  background: rgba(14, 6, 29, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dex-item-card.is-empty {
  opacity: 0.4;
  border-style: dashed;
}

.dex-avatar {
  font-size: 24px;
}

.dex-info strong {
  display: block;
  font-size: 12px;
  color: var(--text-main);
}

.dex-info small {
  font-size: 10px;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  margin-top: 12px;
  text-align: center;
}

.signature-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.signature-text strong {
  color: var(--neon-gold);
}

/* ==========================================================================
   フッター
   ========================================================================== */

.app-footer {
  margin-top: 14px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.app-footer .tagline {
  color: var(--neon-cyan);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 4px;
}

.app-footer .credits strong {
  color: var(--neon-gold);
}

/* ==========================================================================
   メディアクエリ (レスポンシブ最適化)
   ========================================================================== */

@media (max-width: 680px) {
  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-controls {
    align-self: flex-end;
  }

  .hud {
    grid-template-columns: 1.3fr 1.1fr 1fr;
  }

  .hud-item.isekaied-item,
  .hud-item.dream-item {
    display: none;
  }

  .result-stats-box {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .button-cluster {
    flex-direction: column;
  }

  .btn-primary, .btn-secondary, .btn-ghost {
    width: 100%;
  }

  .control-legend {
    display: none;
  }
}

@media (min-width: 768px) {
  .touch-btn {
    min-height: 44px;
  }
}
