/* ==========================================
   バクチモン探偵ミニゲーム - スタイルシート
   ========================================== */

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

:root {
  /* カラーパレット - 顕微鏡・科学的テーマ */
  --bg-dark: #0a1628;
  --bg-gradient: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #0d2840 100%);
  --primary-cyan: #00d4ff;
  --primary-blue: #00a3e0;
  --deep-blue: #0077be;
  --accent-green: #00ff88;
  --accent-yellow: #ffd700;
  --accent-pink: #ff6b9d;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-white: #ffffff;
  --text-light: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  /* フォント */
  --font-main: "Noto Sans JP", sans-serif;
  --font-decorative: "Zen Antique", serif;
  
  /* トランジション */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-main);
  background: #585858;
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   ゲームコンテナ
   ========================================== */
.game-container {
  width: 100%;
  max-width: 800px;
  height: 100vh;
  max-height: 900px;
  position: relative;
  overflow: hidden;
  background: var(--bg-gradient);
  box-shadow: 0 0 60px rgba(0, 100, 150, 0.3);
}

/* ==========================================
   画面切り替え
   ========================================== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* ==========================================
   タイトル画面
   ========================================== */
.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 30px;
}

.game-title {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-cyan), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
  animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from {
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
  }
  to {
    filter: drop-shadow(0 0 40px rgba(0, 255, 136, 0.5));
  }
}

.game-subtitle {
  font-size: 1.3rem;
  color: var(--text-light);
  font-weight: 500;
}

.title-instructions {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 25px 35px;
  backdrop-filter: blur(10px);
}

.title-instructions p {
  padding: 10px 0;
  font-size: 1.1rem;
  color: var(--text-light);
}

/* ボタンスタイル */
.btn-primary {
  padding: 18px 60px;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  border: none;
  border-radius: 50px;
  color: white;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--glass-bg);
  border: 2px solid var(--primary-cyan);
  border-radius: 50px;
  color: var(--primary-cyan);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--primary-cyan);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

.btn-link {
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  background: transparent;
  border: 2px solid var(--text-muted);
  border-radius: 50px;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.btn-link:hover {
  border-color: var(--text-light);
  color: var(--text-white);
}

.back-link {
  margin-top: 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.back-link:hover {
  color: var(--primary-cyan);
}

/* バージョン表記 */
.version-info {
  position: absolute;
  bottom: 15px;
  right: 15px;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
  font-family: monospace;
}

/* ==========================================
   ゲーム画面
   ========================================== */
#gameScreen {
  gap: 10px;
}

/* ヘッダー情報 */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.timer-display, .hint-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.timer-icon, .hint-icon {
  font-size: 1.2rem;
}

#timerText {
  color: var(--accent-yellow);
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
}

#hintCount {
  color: var(--accent-green);
}

/* ヒントエリア */
.hint-area {
  flex-shrink: 0;
}

.hint-area-inner {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.hint-box {
  flex: 7;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 15px;
  backdrop-filter: blur(10px);
}

.hint-box h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--primary-cyan);
}

/* シルエットボックス */
.silhouette-box {
  flex: 3;
  min-width: 100px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px;
  backdrop-filter: blur(10px);
  text-align: center;
  transition: all 0.5s ease;
  display: flex;
  flex-direction: column;
}

.silhouette-box h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.silhouette-box.active h4 {
  color: var(--accent-yellow);
}

.silhouette-container {
  flex: 1;
  width: 100%;
  min-height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.silhouette-locked {
  position: absolute;
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.4;
  z-index: 2;
}

.silhouette-image {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.silhouette-box.active .silhouette-locked {
  display: none;
}

.silhouette-box.active .silhouette-image {
  opacity: 0.8;
  animation: silhouetteReveal 0.6s ease-out;
}

.hint5-note {
  margin-top: 6px;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: opacity 0.3s ease;
}

.silhouette-box.active .hint5-note {
  color: var(--accent-green);
}

@keyframes silhouetteReveal {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 0.8;
    transform: scale(1) rotate(0deg);
  }
}

#hintsContainer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hint-slot {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hint-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hint-text {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--text-muted);
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  min-height: 16px;
  transition: all 0.5s ease;
}

.hint-locked {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}

.hint-text.active {
  background: rgba(0, 212, 255, 0.1);
  border-left-color: var(--primary-cyan);
}

.hint-text.active .hint-locked {
  display: none;
}

.hint-text.new {
  animation: hintAppear 0.5s ease-out;
  border-left-color: var(--accent-yellow);
  background: rgba(255, 215, 0, 0.15);
}

@keyframes hintAppear {
  0% {
    opacity: 0.5;
    transform: translateX(-10px) scale(0.98);
  }
  50% {
    transform: translateX(3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ==========================================
   顕微鏡ビュー
   ========================================== */
.microscope-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.microscope-frame {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 
    0 0 0 8px rgba(0, 212, 255, 0.3),
    0 0 0 12px rgba(0, 212, 255, 0.2),
    0 0 40px rgba(0, 212, 255, 0.4),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

.microscope-frame:active {
  cursor: grabbing;
}

/* ターゲットが視野内に入った時の光るエフェクト */
.microscope-frame.target-in-view {
  box-shadow: 
    0 0 0 8px rgba(255, 215, 0, 0.6),
    0 0 0 12px rgba(255, 215, 0, 0.4),
    0 0 40px rgba(255, 215, 0, 0.6),
    0 0 80px rgba(255, 215, 0, 0.4),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  animation: frameGlow 1s ease-in-out infinite;
}

@keyframes frameGlow {
  0%, 100% {
    box-shadow: 
      0 0 0 8px rgba(255, 215, 0, 0.6),
      0 0 0 12px rgba(255, 215, 0, 0.4),
      0 0 40px rgba(255, 215, 0, 0.6),
      0 0 80px rgba(255, 215, 0, 0.4),
      inset 0 0 60px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow: 
      0 0 0 10px rgba(255, 215, 0, 0.8),
      0 0 0 16px rgba(255, 215, 0, 0.5),
      0 0 60px rgba(255, 215, 0, 0.8),
      0 0 100px rgba(255, 215, 0, 0.5),
      inset 0 0 60px rgba(0, 0, 0, 0.5);
  }
}

.microscope-view {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  /* フィールド外の背景: 暗い紫がかった黒 */
  background: #0a0812;
}

/* フィールドコンテナ（ドラッグで移動） */
.field-container {
  position: absolute;
  width: 1200px;
  height: 1200px;
  /* フィールド内の背景: 水中をイメージした青緑 */
  background: 
    linear-gradient(135deg, #0d3b4c 0%, #0a2e3d 50%, #082530 100%),
    radial-gradient(circle at 20% 30%, rgba(0, 255, 136, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(0, 212, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(100, 200, 255, 0.08) 0%, transparent 40%);
  background-color: #0a2e3d;
  /* フィールド境界を示す枠線 */
  border: 3px solid rgba(0, 180, 220, 0.4);
  box-shadow: 
    inset 0 0 100px rgba(0, 150, 200, 0.15),
    0 0 30px rgba(0, 100, 150, 0.3);
  transform: translate(-440px, -440px);
  transition: none;
}

/* 微生物画像 */
.microbe {
  position: absolute;
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
  pointer-events: none;
  animation: microbeFloat 3s ease-in-out infinite;
}

.microbe:nth-child(odd) {
  animation-delay: -1.5s;
}

@keyframes microbeFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(3deg);
  }
}

/* 顕微鏡オーバーレイ（レンズ効果） */
.microscope-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 30% 30%, 
    rgba(255, 255, 255, 0.1) 0%, 
    transparent 40%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.4);
}

/* 中心のクロスヘア */
.microscope-frame::before,
.microscope-frame::after {
  content: '';
  position: absolute;
  background: rgba(0, 212, 255, 0.4);
  z-index: 10;
  pointer-events: none;
}

.microscope-frame::before {
  width: 2px;
  height: 40px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.microscope-frame::after {
  width: 40px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 方向矢印（ヒント5） */
.direction-arrow {
  position: absolute;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.5s ease, left 0.1s ease, top 0.1s ease;
  /* 初期位置は中心（JSで動的に変更） */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.direction-arrow.active {
  opacity: 1;
}

.direction-arrow.hidden {
  opacity: 0;
}

.arrow-icon {
  font-size: 1.8rem;
  color: var(--accent-yellow);
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.9))
          drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
  /* 矢印の回転はJSで設定 */
  display: inline-block;
}

.direction-arrow.active .arrow-icon {
  animation: arrowGlow 1s ease-in-out infinite;
}

@keyframes arrowGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.9))
            drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 1))
            drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
  }
}

/* 判定結果メッセージ */
.result-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 15px;
  font-size: 1.3rem;
  font-weight: 700;
  z-index: 100;
  animation: messagePopup 0.3s ease-out;
}

.result-message.hidden {
  display: none;
}

.result-message.wrong {
  border: 2px solid var(--accent-pink);
  color: var(--accent-pink);
}

.result-message.correct {
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
}

@keyframes messagePopup {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ゲームコントロール */
.game-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 15px;
  flex-shrink: 0;
}

.btn-found {
  padding: 18px 50px;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-green), #00cc6a);
  border: none;
  border-radius: 50px;
  color: white;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

.btn-found:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 255, 136, 0.6);
}

.btn-found:active {
  transform: translateY(-1px) scale(1.02);
}

.btn-back {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition-smooth);
  backdrop-filter: blur(5px);
}

.btn-back:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.btn-back:active {
  transform: scale(0.98);
}

/* ==========================================
   クリア画面
   ========================================== */
.clear-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 25px;
}

.clear-animation {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sparkle {
  font-size: 2.5rem;
  animation: sparkle 1s ease-in-out infinite alternate;
}

.sparkle:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes sparkle {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.2) rotate(20deg);
    opacity: 1;
  }
}

.clear-title {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-yellow), #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: clearPulse 1s ease-in-out infinite alternate;
}

@keyframes clearPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.found-microbe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.found-microbe img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0, 212, 255, 0.5));
  animation: microbeReveal 0.8s ease-out;
}

@keyframes microbeReveal {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.microbe-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-cyan);
}

.microbe-original {
  font-size: 0.9rem;
  color: var(--accent-yellow);
  font-style: italic;
  margin-top: 5px;
  padding: 6px 14px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 20px;
  display: inline-block;
}

.microbe-original:empty {
  display: none;
}

.microbe-description {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 400px;
  text-align: center;
  margin-top: 10px;
  padding: 15px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  animation: descFadeIn 0.8s ease-out 0.3s both;
}

@keyframes descFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.score-board {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 25px 40px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 280px;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}

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

.score-item.total {
  padding-top: 15px;
  margin-top: 5px;
}

.score-label {
  font-size: 1rem;
  color: var(--text-light);
}

.score-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-yellow);
  font-family: 'Courier New', monospace;
}

.score-item.total .score-value {
  font-size: 1.8rem;
  color: var(--accent-green);
}

.score-rank {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.3rem;
}

.rank-text {
  color: var(--text-light);
}

.rank-value {
  font-size: 2.5rem;
  font-weight: 900;
  animation: rankPop 0.5s ease-out;
}

.rank-value.rank-s {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rank-value.rank-a {
  color: var(--accent-green);
}

.rank-value.rank-b {
  color: var(--primary-cyan);
}

.rank-value.rank-c {
  color: var(--text-light);
}

@keyframes rankPop {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  60% {
    transform: scale(1.3);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.clear-buttons {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

/* ==========================================
   レスポンシブデザイン
   ========================================== */
@media (max-width: 768px) {
  .game-container {
    max-height: 100vh;
  }
  
  .screen {
    padding: 15px;
  }
  
  .game-title {
    font-size: 2.2rem;
  }
  
  .game-subtitle {
    font-size: 1.1rem;
  }
  
  .title-instructions {
    padding: 20px 25px;
  }
  
  .title-instructions p {
    font-size: 0.95rem;
    padding: 8px 0;
  }
  
  .btn-primary {
    padding: 15px 45px;
    font-size: 1.1rem;
  }
  
  .microscope-frame {
    width: 280px;
    height: 280px;
  }
  
  .microscope-overlay {
    width: 280px;
    height: 280px;
  }
  
  .hint-area-inner {
    flex-direction: column;
  }
  
  .silhouette-box {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
  }
  
  .silhouette-box h4 {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  .silhouette-container {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }
  
  .silhouette-locked {
    font-size: 0.65rem;
  }
  
  .hint-box {
    padding: 15px;
  }
  
  .hint-text {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  
  .game-header {
    padding: 12px 15px;
  }
  
  .timer-display, .hint-counter {
    font-size: 1rem;
  }
  
  #timerText {
    font-size: 1.2rem;
  }
  
  .btn-found {
    padding: 15px 40px;
    font-size: 1.1rem;
  }
  
  .clear-title {
    font-size: 2.2rem;
  }
  
  .score-board {
    padding: 20px 30px;
    min-width: 250px;
  }
  
  .clear-buttons {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 1.8rem;
  }
  
  .title-instructions p {
    font-size: 0.85rem;
  }
  
  .microscope-frame {
    width: 240px;
    height: 240px;
  }
  
  .microscope-overlay {
    width: 240px;
    height: 240px;
  }
  
  .microbe {
    width: 60px;
    height: 60px;
  }
  
  .clear-title {
    font-size: 1.8rem;
  }
  
  .found-microbe img {
    width: 100px;
    height: 100px;
  }
  
  .score-board {
    padding: 15px 20px;
    min-width: 220px;
  }
  
  .score-value {
    font-size: 1.1rem;
  }
  
  .score-item.total .score-value {
    font-size: 1.5rem;
  }
  
  .rank-value {
    font-size: 2rem;
  }
}

/* ==========================================
   アニメーションユーティリティ
   ========================================== */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

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

.slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   デバッグモード
   ========================================== */
.debug-panel {
  position: fixed;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 10px 15px;
  z-index: 9999;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-light);
  user-select: none;
}

.debug-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.debug-btn {
  margin-top: 5px;
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(0, 200, 100, 0.3);
  border: 1px solid rgba(0, 200, 100, 0.5);
  border-radius: 4px;
  color: #00ff88;
  cursor: pointer;
  transition: all 0.2s ease;
}

.debug-btn:hover {
  background: rgba(0, 200, 100, 0.5);
}

/* デバッグモード有効時: 顕微鏡の外も見える */
.microscope-container.debug-mode .microscope-frame {
  overflow: visible;
  border-radius: 0;
}

.microscope-container.debug-mode .microscope-view {
  border-radius: 0;
  background: rgba(0, 50, 100, 0.5);
}

.microscope-container.debug-mode .microscope-frame::before {
  display: none;
}

.microscope-container.debug-mode .microscope-overlay {
  display: none;
}

/* 視野範囲の枠を表示 */
.microscope-container.debug-mode .microscope-view::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 3px dashed var(--accent-yellow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
}

/* デバッグモード時のフィールドコンテナ拡張表示 */
.microscope-container.debug-mode .field-container {
  /* デバッグモードでも同じフィールド背景を維持 */
  background: 
    linear-gradient(135deg, #0d3b4c 0%, #0a2e3d 50%, #082530 100%);
  background-color: #0a2e3d;
  border: 3px solid rgba(0, 255, 200, 0.6);
  box-shadow: 
    inset 0 0 100px rgba(0, 150, 200, 0.15),
    0 0 30px rgba(0, 255, 200, 0.4);
}

/* 正解ハイライト */
.microbe.target-highlight {
  box-shadow: 0 0 20px 10px rgba(255, 0, 0, 0.8), 0 0 40px 20px rgba(255, 0, 0, 0.4);
  border-radius: 50%;
  animation: targetPulse 1s ease-in-out infinite;
}

@keyframes targetPulse {
  0%, 100% {
    box-shadow: 0 0 20px 10px rgba(255, 0, 0, 0.8), 0 0 40px 20px rgba(255, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 30px 15px rgba(255, 0, 0, 1), 0 0 60px 30px rgba(255, 0, 0, 0.6);
  }
}

