/* ポケモンタイプ相性診断アプリ — 全スタイル（おもちゃ箱デザイン） */

/* ========================================
   フォント
   ======================================== */
@import url("https://fonts.googleapis.com/css2?family=DotGothic16&display=swap");

/* ========================================
   リセット・ベース
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DotGothic16", sans-serif;
  background: linear-gradient(135deg, #fce4ec 0%, #e8f5e9 35%, #e3f2fd 65%, #fff9c4 100%);
  background-attachment: fixed;
  color: #1a1a2e;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.hidden {
  display: none !important;
}

/* ========================================
   背景モンスターボール浮遊アニメーション
   ======================================== */
.pokeball-bg-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.pokeball-bg {
  position: absolute;
  opacity: 0.13;
  animation: float var(--float-duration, 8s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-25px) rotate(180deg);
  }
  100% {
    transform: translateY(0px) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pokeball-bg {
    animation: none;
  }
}

/* ========================================
   ヘッダー
   ======================================== */
.app-header {
  text-align: center;
  padding: 12px 16px 10px;
  background: linear-gradient(180deg, #DC0A2D 0%, #b5081f 100%);
  border-radius: 0 0 32px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 0 #9b0618,
    0 8px 24px rgba(220, 10, 45, 0.3);
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.app-header::before,
.app-header::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.app-header::before {
  left: 18px;
}

.app-header::after {
  right: 18px;
}

.app-header h1 {
  font-size: 1.8rem;
  color: #fff;
  text-shadow:
    2px 2px 0 #FFCB05,
    3px 3px 0 rgba(0, 0, 0, 0.15);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

.app-subtitle {
  color: #FFCB05;
  font-size: 0.95rem;
  margin-top: 6px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

/* ========================================
   ヘッダー — つかいかたボタン
   ======================================== */
.help-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: #DC0A2D;
  color: #fff;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow:
    0 3px 0 #9b0618,
    0 4px 12px rgba(220, 10, 45, 0.3);
}

.help-btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.help-btn-spin {
  animation: pokeballSpin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pokeballSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(720deg); }
}

.help-btn:hover {
  background: #e52535;
}

.help-btn:active {
  box-shadow: 0 1px 0 #9b0618;
  transform: translateY(2px);
}

/* ========================================
   チュートリアルオーバーレイ
   ======================================== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
}

.tutorial-spotlight {
  position: fixed;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
  z-index: 901;
}

.tutorial-tooltip {
  position: fixed;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow:
    0 4px 0 #d0d0d0,
    0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 902;
  animation: tutorialBounceIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 300px;
  width: max-content;
}

@keyframes tutorialBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* ツールチップ矢印 */
.tutorial-tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
}

/* 上下配置（スマホ） */
.tutorial-tooltip-below .tutorial-tooltip-arrow {
  top: -10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #fff;
  transform: translateX(-50%);
}

.tutorial-tooltip-above .tutorial-tooltip-arrow {
  bottom: -10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #fff;
  transform: translateX(-50%);
}

/* 左右配置（PC） */
.tutorial-tooltip-right .tutorial-tooltip-arrow {
  left: -10px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #fff;
  transform: translateY(-50%);
}

.tutorial-tooltip-left .tutorial-tooltip-arrow {
  right: -10px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid #fff;
  transform: translateY(-50%);
}

.tutorial-message {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #1a1a2e;
  margin-bottom: 16px;
}

.tutorial-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.tutorial-btn-next {
  border: none;
  border-radius: 12px;
  padding: 8px 22px;
  background: #FFCB05;
  color: #1a1a2e;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 0 #d4a800;
  position: relative;
  top: 0;
  transition: top 0.1s, box-shadow 0.1s, filter 0.1s;
}

.tutorial-btn-next:hover {
  filter: brightness(1.08);
}

.tutorial-btn-next:active {
  top: 2px;
  box-shadow: 0 1px 0 #d4a800;
}

.tutorial-btn-skip {
  border: none;
  background: none;
  color: #999;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.tutorial-btn-skip:hover {
  color: #666;
}

/* ========================================
   メインレイアウト
   ======================================== */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.panels-row {
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: stretch;
  margin-bottom: 28px;
}

/* ========================================
   ポケモン選択パネル
   ======================================== */
.pokemon-panel {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  width: 280px;
  min-width: 0;
  min-height: 300px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  top: 0;
  box-shadow:
    0 6px 0 #c8c8c8,
    0 8px 16px rgba(0, 0, 0, 0.1);
  transition: top 0.12s ease, box-shadow 0.12s ease;
}

#my-pokemon-panel {
  border-top: 5px solid #DC0A2D;
}

#opp-pokemon-panel {
  border-top: 5px solid #3B4CCA;
}

.pokemon-panel:hover {
  top: -3px;
  box-shadow:
    0 9px 0 #c8c8c8,
    0 12px 24px rgba(0, 0, 0, 0.13);
}

.pokemon-panel:active {
  top: 4px;
  box-shadow:
    0 2px 0 #c8c8c8,
    0 3px 8px rgba(0, 0, 0, 0.08);
}

/* 検索中はパネルの上下移動を無効化（ドロップダウンのクリックずれ防止） */
.pokemon-panel.panel-searching,
.pokemon-panel.panel-searching:hover,
.pokemon-panel.panel-searching:active {
  top: 0;
  box-shadow:
    0 6px 0 #c8c8c8,
    0 8px 16px rgba(0, 0, 0, 0.1);
}

.panel-label {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 14px;
  font-weight: bold;
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  background: #DC0A2D;
}

#opp-pokemon-panel .panel-label {
  background: #3B4CCA;
}

.panel-placeholder {
  color: #999;
  font-size: 0.9rem;
  margin-top: 50px;
  padding: 10px 18px;
  border: 2px dashed #ccc;
  border-radius: 12px;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

/* 検索ボックス */
.search-box {
  margin-top: 12px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #DC0A2D;
  border-radius: 12px;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: #FFCB05;
  box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.25);
}

/* ドロップダウン */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0 0 12px 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: background 0.1s;
}

.dropdown-item:hover,
.dropdown-item.highlighted {
  background: #FFF3CD;
}

.dropdown-en {
  font-size: 0.75rem;
  color: #999;
  margin-left: 6px;
}

/* ポケモン弱点表示 */
.pokemon-weak {
  margin-top: 12px;
  background: #fff5f5;
  border: 1.5px solid #f0d0d0;
  border-radius: 12px;
  padding: 8px 10px;
}

.weak-label {
  font-size: 0.8rem;
  font-weight: bold;
  color: #c44;
  margin-bottom: 6px;
}

.weak-types {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.weak-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.weak-multiplier {
  font-size: 0.68rem;
  opacity: 0.9;
}

/* ポケモン情報 */
.pokemon-info {
  animation: fadeIn 0.3s ease;
}

.pokemon-image {
  width: 180px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pokemon-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 8px;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.pokemon-types {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.type-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 14px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

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

/* ========================================
   タイプ相性マッチアップ（パネル間）
   ======================================== */
.type-matchup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 200px;
  flex-shrink: 0;
  gap: 4px;
  padding: 16px 12px;
  position: relative;
}

.type-matchup::before {
  content: "VS";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFCB05;
  color: #1a1a2e;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 3px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 0 #d4a800;
  letter-spacing: 0.1em;
}

.type-matchup-placeholder {
  color: #ccc;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
}

/* 矢印ブロック共通 */
.matchup-arrows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.matchup-arrow-block {
  position: relative;
  padding: 12px 16px;
  color: #fff;
  animation: fadeInSlide 0.3s ease-out forwards;
  overflow: hidden;
}

/* ハイライト光沢 */
.matchup-arrow-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
  pointer-events: none;
}

/* 攻撃: 右向き矢印（黄緑系） */
.matchup-arrow-attack {
  background: linear-gradient(135deg, #5CB85C 0%, #78C850 50%, #A7DB8D 100%);
  clip-path: polygon(
    0 15%, 75% 15%, 75% 0%, 100% 50%, 75% 100%, 75% 85%, 0 85%
  );
  padding: 20px 40px 20px 16px;
  filter: drop-shadow(0 3px 2px rgba(60, 120, 60, 0.35));
}

/* 防御: 左向き矢印（グレー系） */
.matchup-arrow-defense {
  background: linear-gradient(135deg, #8a8fa8 0%, #9ea3b5 50%, #b5b9c9 100%);
  clip-path: polygon(
    0 50%, 20% 0%, 20% 15%, 100% 15%, 100% 85%, 20% 85%, 20% 100%
  );
  padding: 20px 16px 20px 24%;
  filter: drop-shadow(0 3px 2px rgba(100, 105, 130, 0.35));
}

.matchup-arrow-label {
  font-size: 0.65rem;
  font-weight: bold;
  opacity: 0.85;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.matchup-arrow-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.matchup-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.matchup-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  min-width: 52px;
  text-align: center;
}

.matchup-result {
  font-weight: bold;
  font-size: 0.72rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* 攻撃ばつぐん（プラス強調） */
.matchup-highlight-positive {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 2px 6px;
}

.matchup-highlight-positive .matchup-result {
  font-size: 0.82rem;
  text-shadow: 0 0 8px rgba(255, 255, 150, 0.7), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 防御ばつぐん（マイナス強調） */
.matchup-highlight-negative {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 2px 6px;
}

.matchup-highlight-negative .matchup-result {
  font-size: 0.82rem;
  color: #ffaaaa;
  text-shadow: 0 0 8px rgba(255, 80, 80, 0.6), 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .matchup-arrow-block {
    animation: none;
  }
}

/* ========================================
   技タイプスロット & 相性結果テーブル
   ======================================== */
.results-section {
  background: rgba(255, 255, 255, 0.45);
  border: 2px solid rgba(224, 224, 224, 0.5);
  border-radius: 20px;
  overflow: hidden;
  max-width: 580px;
  margin: 0 auto;
  backdrop-filter: blur(4px);
}

.results-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: linear-gradient(180deg, #DC0A2D 0%, #b5081f 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
}

.results-header span {
  padding: 12px 16px;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 2px 0;
}

.result-row:last-child {
  padding-bottom: 4px;
}

/* 技タイプスロット */
.type-slot {
  padding: 12px 16px;
  margin: 4px 8px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  position: relative;
  top: 0;
  transition: top 0.1s ease, box-shadow 0.1s ease, background 0.15s, filter 0.15s;
}

.type-slot.slot-empty {
  color: #999;
  border: 2px dashed #ccc;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
}

.type-slot.slot-empty:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: #FFCB05;
  color: #666;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}

.type-slot.slot-empty:active {
  top: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.type-slot.slot-filled {
  background: var(--slot-color);
  color: #fff;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

.type-slot.slot-filled:hover {
  filter: brightness(1.1);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.type-slot.slot-filled:active {
  top: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.slot-icon {
  font-style: normal;
}

/* 結果セル */
.result-cell {
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--result-color, #aaa);
}

.result-none {
  color: #ccc;
  font-weight: normal;
}

.result-animate {
  animation: fadeInSlide 0.3s ease-out forwards;
}

.result-row:nth-child(2) .result-animate { animation-delay: 0s; }
.result-row:nth-child(3) .result-animate { animation-delay: 0.05s; }
.result-row:nth-child(4) .result-animate { animation-delay: 0.1s; }
.result-row:nth-child(5) .result-animate { animation-delay: 0.15s; }

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ×4 ちょうばつぐん 強調 */
.super-effective {
  animation: fadeInSlide 0.3s ease-out forwards, superEffective 1.5s ease-in-out infinite 0.3s;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
}

@keyframes superEffective {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ========================================
   フッター
   ======================================== */
.app-footer {
  text-align: center;
  padding: 20px 16px 24px;
  font-size: 0.7rem;
  color: #999;
}

.app-footer a {
  color: #888;
  text-decoration: underline;
}

.app-footer a:hover {
  color: #555;
}

/* ========================================
   タイプ選択モーダル
   ======================================== */
.type-selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.type-selector-modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow:
    0 6px 0 #d0d0d0,
    0 12px 40px rgba(0, 0, 0, 0.2);
  animation: bounceIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.type-selector-title {
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 16px;
  color: #333;
  font-weight: bold;
}

.type-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.type-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 4px;
  color: #fff;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  position: relative;
  top: 0;
}

.type-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.1);
}

.type-btn:active {
  transform: scale(1);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  top: 2px;
}

/* ========================================
   トースト
   ======================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #DC0A2D, #9b0618);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.85rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(220, 10, 45, 0.3);
}

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

/* ========================================
   キーフレーム（新規）
   ======================================== */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(-30px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateY(0);
  }
  80% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

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

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   prefers-reduced-motion — 全アニメーション無効化
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .pokeball-bg,
  .app-header,
  .type-selector-modal,
  .pokemon-image,
  .panel-placeholder,
  .matchup-row,
  .result-animate,
  .pokemon-info,
  .super-effective,
  .tutorial-tooltip,
  .help-btn-spin {
    animation: none;
  }

  .tutorial-spotlight {
    transition: none;
  }

  .toast {
    transition: opacity 0.3s;
    transform: translateX(-50%);
  }

  .toast-show {
    transform: translateX(-50%);
  }
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 640px) {
  .app-header {
    padding: 10px 12px 8px;
    border-radius: 0 0 22px 22px;
  }

  .app-header::before,
  .app-header::after {
    display: none;
  }

  .app-header h1 {
    font-size: 1.3rem;
  }

  .app-subtitle {
    font-size: 0.8rem;
  }

  .main-container {
    padding: 0 8px 40px;
  }

  .panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
    row-gap: 20px;
    margin-bottom: 16px;
  }

  #my-pokemon-panel {
    grid-column: 1;
    grid-row: 1;
  }

  #opp-pokemon-panel {
    grid-column: 2;
    grid-row: 1;
  }

  .pokemon-panel {
    width: auto;
    min-height: auto;
    min-width: 0;
    padding: 12px 8px;
    border-radius: 14px;
    box-shadow:
      0 4px 0 #c8c8c8,
      0 6px 12px rgba(0, 0, 0, 0.08);
  }

  .pokemon-panel .pokemon-image {
    width: 80px;
    max-width: 100%;
    height: auto;
  }

  .pokemon-panel .pokemon-name {
    font-size: 0.8rem;
  }

  .pokemon-panel .panel-label {
    font-size: 0.7rem;
    padding: 3px 10px;
    margin-bottom: 6px;
  }

  .pokemon-panel .panel-placeholder {
    font-size: 0.7rem;
    margin-top: 20px;
    padding: 6px 8px;
  }

  .pokemon-panel .search-input {
    font-size: 0.75rem;
    padding: 6px 8px;
  }

  .pokemon-panel .type-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .weak-badge {
    font-size: 0.6rem;
    padding: 2px 7px;
  }

  .weak-label {
    font-size: 0.65rem;
  }

  .type-matchup {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 70%;
    max-width: 260px;
    margin: 4px auto 0;
    padding: 16px 0;
    gap: 4px;
    justify-self: center;
  }

  .type-matchup::before {
    font-size: 0.65rem;
    padding: 2px 10px;
    top: -12px;
  }

  .matchup-arrow-attack {
    padding: 18px 34px 18px 12px;
  }

  .matchup-arrow-defense {
    padding: 18px 12px 18px 24%;
  }

  .matchup-type-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    min-width: 40px;
  }

  .matchup-result {
    font-size: 0.65rem;
  }

  .results-section {
    width: 100%;
  }

  .type-selector-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .type-btn {
    font-size: 0.78rem;
    padding: 8px 2px;
  }

  .tutorial-tooltip {
    max-width: calc(100vw - 24px) !important;
  }

  .tutorial-message {
    font-size: 0.85rem;
  }
}
