/*
 * 釣果図鑑ページ - ゲーム感覚のコレクション表示
 *
 * カラーパレット（Tutter共通）:
 * - プライマリ: #1877f2
 * - テキスト: #1c1e21, #606770
 * - 背景: #ffffff, #f0f2f5
 * - ボーダー: #dddfe2
 */

/* ===========================================
   コンテナ
   =========================================== */
.fish-book-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===========================================
   ヘッダー
   =========================================== */
.fish-book-header {
  background: linear-gradient(135deg, #1877f2 0%, #166fe5 100%);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  color: #fff;
}

.fish-book-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.fish-book-title {
  font-size: 1.8em;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.fish-book-subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95em;
}

.fish-book-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.2s ease;
}

.fish-book-back-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===========================================
   統計エリア
   =========================================== */
.fish-book-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

/* コンプリート率サークル */
.fish-book-completion {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.completion-circle {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.circular-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: #e4e6e9;
  stroke-width: 3;
}

.circle {
  fill: none;
  stroke: #1877f2;
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dasharray 0.6s ease;
}

.completion-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.completion-rate {
  font-size: 1.8em;
  font-weight: 700;
  color: #1c1e21;
  line-height: 1;
}

.completion-percent {
  font-size: 0.9em;
  color: #606770;
}

.completion-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.completion-label {
  font-size: 1.1em;
  font-weight: 600;
  color: #1c1e21;
}

.completion-count {
  font-size: 0.95em;
  color: #606770;
}

/* レア度別統計 */
.rarity-stats {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rarity-stats-title {
  font-size: 1em;
  font-weight: 600;
  color: #1c1e21;
  margin: 0 0 16px 0;
}

.rarity-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rarity-bar-item {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: 12px;
}

.rarity-label {
  font-size: 0.85em;
}

.rarity-label .star {
  color: #dddfe2;
}

.rarity-label .star.filled {
  color: #fbbf24;
}

.rarity-bar {
  height: 8px;
  background: #e4e6e9;
  border-radius: 4px;
  overflow: hidden;
}

.rarity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1877f2, #42a5f5);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.rarity-count {
  font-size: 0.8em;
  color: #606770;
  text-align: right;
}

/* ===========================================
   カテゴリ
   =========================================== */
.fish-book-categories {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fish-book-category {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fish-book-category.locked {
  opacity: 0.7;
}

.category-header {
  margin-bottom: 16px;
}

.category-title-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.category-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #1c1e21;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.unlocked-icon {
  background: #e7f3ff;
  color: #1877f2;
}

.locked-icon {
  background: #f0f2f5;
  color: #606770;
}

.category-count {
  font-size: 0.9em;
  color: #606770;
  font-weight: 500;
}

.category-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-progress-bar {
  flex: 1;
  height: 6px;
  background: #e4e6e9;
  border-radius: 3px;
  overflow: hidden;
}

.category-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1877f2, #42a5f5);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.category-rate {
  font-size: 0.85em;
  font-weight: 600;
  color: #1877f2;
  min-width: 35px;
  text-align: right;
}

/* ===========================================
   魚カード
   =========================================== */
.category-fishes {
  display: grid;
  grid-template-columns: repeat(auto-fill, 100px);
  gap: 12px;
  justify-content: start;
}

.fish-card {
  min-height: 100px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fish-card:hover {
  transform: translateY(-2px);
}

.fish-card-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  text-align: center;
  box-sizing: border-box;
}

/* 釣った魚 */
.fish-card.caught {
  background: linear-gradient(135deg, #e7f3ff 0%, #d4e9ff 100%);
  border: 2px solid #1877f2;
}

.fish-card.caught:hover {
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.fish-card.caught .fish-card-icon {
  color: #1877f2;
  margin-bottom: 6px;
}

.fish-card.caught .fish-card-name {
  font-size: 0.75em;
  font-weight: 600;
  color: #1c1e21;
  line-height: 1.2;
  word-break: break-all;
}

/* 未釣魚（シルエット） */
.fish-card.not-caught {
  background: #f5f6f7;
  border: 2px dashed #dddfe2;
}

.fish-card.not-caught:hover {
  border-color: #bbbfc4;
}

.fish-card-silhouette {
  width: 48px;
  height: 48px;
  background: #dddfe2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.silhouette-mark {
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
}

.fish-card-name.unknown {
  font-size: 0.75em;
  color: #bbbfc4;
  font-weight: 500;
}

/* レア度表示 */
.fish-card-rarity {
  margin-top: 4px;
  font-size: 0.65em;
  line-height: 1;
}

.fish-card-rarity .star {
  color: #dddfe2;
}

.fish-card-rarity .star.filled {
  color: #fbbf24;
}

.fish-card.not-caught .fish-card-rarity .star {
  color: #e4e6e9;
}

/* ===========================================
   詳細モーダル
   =========================================== */
.fish-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-index-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fish-detail-modal.hidden {
  display: none;
}

.fish-detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.fish-detail-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modal-slide-in 0.25s ease-out;
}

@keyframes modal-slide-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fish-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #606770;
  transition: all 0.2s ease;
  z-index: 1;
}

.fish-detail-close:hover {
  background: #fff;
  color: #1c1e21;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fish-detail-body {
  padding: 0;
}

/* モーダル内の魚写真 */
.fish-detail-image {
  width: 100%;
  max-height: 250px;
  overflow: hidden;
  background: #f0f2f5;
}

.fish-detail-image img {
  width: 100%;
  height: 100%;
  max-height: 250px;
  object-fit: cover;
  display: block;
}

/* モーダル内の魚詳細スタイル */
.fish-detail-header {
  background: linear-gradient(135deg, #1877f2 0%, #166fe5 100%);
  padding: 24px 20px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.fish-detail-header-main {
  flex: 1;
}

.fish-detail-name {
  font-size: 1.6em;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.fish-detail-category {
  font-size: 0.85em;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
}

.fish-detail-info {
  padding: 20px;
}

.fish-detail-description {
  color: #606770;
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0 0 16px 0;
  padding: 12px 14px;
  background: #f0f2f5;
  border-radius: 8px;
  border-left: 3px solid #1877f2;
}

.fish-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.fish-detail-stat {
  background: #f7f8fa;
  border: 1px solid #e4e6e9;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.fish-detail-stat-label {
  font-size: 0.7em;
  color: #606770;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.fish-detail-stat-value {
  font-size: 0.9em;
  font-weight: 600;
  color: #1c1e21;
}

.fish-detail-stat-stars {
  font-size: 1em;
}

.fish-detail-stat-stars .star {
  color: #dddfe2;
}

.fish-detail-stat-stars .star.filled {
  color: #fbbf24;
}

/* 釣った回数（ヘッダー内） */
.fish-detail-catch-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 70px;
}

.fish-detail-catch-count-main {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.fish-detail-catch-count-value {
  font-size: 1.8em;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.fish-detail-catch-count-unit {
  font-size: 1em;
  font-weight: 600;
  color: #fff;
}

.fish-detail-catch-count-label {
  font-size: 0.75em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
}

.fish-detail-sizes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fish-detail-size {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7f8fa;
  border: 1px solid #e4e6e9;
  border-radius: 8px;
  padding: 10px 12px;
}

.fish-detail-size-icon {
  width: 32px;
  height: 32px;
  background: #e7f3ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1877f2;
}

.fish-detail-size-content {
  display: flex;
  flex-direction: column;
}

.fish-detail-size-label {
  font-size: 0.65em;
  color: #606770;
  text-transform: uppercase;
}

.fish-detail-size-value {
  font-size: 0.85em;
  font-weight: 600;
  color: #1c1e21;
}

/* 毒魚警告 */
.fish-detail-warning {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.fish-detail-warning-icon {
  width: 36px;
  height: 36px;
  background: #f59e0b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.fish-detail-warning-text {
  flex: 1;
}

.fish-detail-warning-title {
  font-size: 0.75em;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fish-detail-warning-message {
  font-size: 0.85em;
  color: #78350f;
  line-height: 1.4;
  margin: 2px 0 0 0;
}

/* ===========================================
   レスポンシブ
   =========================================== */
@media (max-width: 768px) {
  .fish-book-container {
    padding: 12px;
  }

  .fish-book-header {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .fish-book-title {
    font-size: 1.4em;
  }

  .fish-book-stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .fish-book-completion {
    padding: 16px;
    border-radius: 12px;
  }

  .completion-circle {
    width: 80px;
    height: 80px;
  }

  .completion-rate {
    font-size: 1.5em;
  }

  .rarity-stats {
    padding: 16px;
    border-radius: 12px;
  }

  .fish-book-category {
    padding: 16px;
    border-radius: 12px;
  }

  .category-fishes {
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 8px;
  }

  .fish-card {
    min-height: 85px;
  }

  .fish-card-inner {
    padding: 8px 6px;
  }

  .fish-card.caught .fish-card-icon svg {
    width: 24px;
    height: 24px;
  }

  .fish-card-silhouette {
    width: 36px;
    height: 36px;
  }

  .silhouette-mark {
    font-size: 1.2em;
  }

  .fish-detail-modal {
    padding: 12px;
  }

  .fish-detail-content {
    border-radius: 12px;
  }

  .fish-detail-header {
    padding: 20px 16px;
  }

  .fish-detail-name {
    font-size: 1.4em;
  }

  .fish-detail-info {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .fish-book-header-content {
    flex-direction: column;
  }

  .fish-book-back-link {
    align-self: flex-start;
  }

  .category-fishes {
    grid-template-columns: repeat(auto-fill, 70px);
  }

  .fish-card {
    min-height: 75px;
  }

  .fish-card-name {
    font-size: 0.65em !important;
  }

  .fish-card-rarity {
    font-size: 0.55em;
  }
}
