/* 都道府県覚えゲーム スタイルシート */

:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --success-color: #10b981;
  --error-color: #ef4444;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* 地域別マップ配色 */
  --region-hokkaido: #bae6fd;
  --region-tohoku: #c7d2fe;
  --region-kanto: #fbcfe8;
  --region-chubu: #fef08a;
  --region-kinki: #bbf7d0;
  --region-chugoku: #fed7aa;
  --region-shikoku: #fef08a;
  --region-kyushu: #ddd6fe;
  --region-okinawa: #a7f3d0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  width: 100%;
}

/* ヘッダー */
.header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

/* ダッシュボード (お題 & ステータス) */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

.target-card {
  background: var(--card-bg);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  text-align: center;
  border: 2px solid var(--primary-color);
}

.target-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.target-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: #1e3a8a;
  margin-top: 0.2rem;
}

.target-name.pulse {
  animation: pulseScale 0.4s ease-in-out;
}

@keyframes pulseScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.stats-card {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-around;
  border: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.1rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn.secondary {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.btn.secondary:hover {
  background-color: #cbd5e1;
}

/* フィードバックバナー (地図上の前面浮遊表示) */
.feedback-banner {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 0.7rem 1.6rem;
  border-radius: 30px;
  text-align: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.feedback-banner.hidden {
  opacity: 0;
  transform: translate(-50%, -15px);
  pointer-events: none;
}

.feedback-banner.correct {
  background-color: #d1fae5;
  color: #065f46;
  border: 2px solid #34d399;
}

.feedback-banner.wrong {
  background-color: #fee2e2;
  color: #991b1b;
  border: 2px solid #f87171;
  animation: shakeOverlay 0.4s ease-in-out;
}

@keyframes shakeOverlay {
  0%, 100% { transform: translate(-50%, 0); }
  20%, 60% { transform: translate(calc(-50% - 8px), 0); }
  40%, 80% { transform: translate(calc(-50% + 8px), 0); }
}

/* マップエリア */
.map-container {
  position: relative;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.map-wrapper {
  width: 100%;
  max-width: 1050px;
  aspect-ratio: 960 / 780;
}

#japan-map {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.05));
}

/* 天気予報風・沖縄枠線スタイル */
.inset-border {
  stroke: #94a3b8;
  stroke-width: 2px;
  stroke-dasharray: 6 4;
  fill: #f1f5f9;
  opacity: 0.85;
}

.inset-label {
  font-size: 11px;
  font-weight: 700;
  fill: #64748b;
  user-select: none;
}

/* 都道府県SVGパス */
.prefecture-path {
  stroke: #ffffff;
  stroke-width: 2px;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

.prefecture-path.region-hokkaido { fill: var(--region-hokkaido); }
.prefecture-path.region-tohoku { fill: var(--region-tohoku); }
.prefecture-path.region-kanto { fill: var(--region-kanto); }
.prefecture-path.region-chubu { fill: var(--region-chubu); }
.prefecture-path.region-kinki { fill: var(--region-kinki); }
.prefecture-path.region-chugoku { fill: var(--region-chugoku); }
.prefecture-path.region-shikoku { fill: var(--region-shikoku); }
.prefecture-path.region-kyushu { fill: var(--region-kyushu); }
.prefecture-path.region-okinawa { fill: var(--region-okinawa); }

.prefecture-path:hover,
.prefecture-path.hover {
  fill: #60a5fa !important;
  stroke: #1e40af;
  stroke-width: 3px;
  filter: brightness(1.05);
}

.prefecture-path.solved {
  fill: #34d399 !important;
  stroke: #059669;
}

.prefecture-path.correct-flash {
  animation: flashGreen 0.6s ease-in-out;
}

.prefecture-path.wrong-flash {
  animation: flashRed 0.6s ease-in-out;
}

@keyframes flashGreen {
  0%, 100% { fill: #34d399; }
  50% { fill: #10b981; }
}

@keyframes flashRed {
  0%, 100% { fill: #f87171; }
  50% { fill: #ef4444; }
}

/* ラベル表現 */
.label-group {
  cursor: pointer;
}

.label-badge {
  fill: #ffffff;
  stroke: #94a3b8;
  stroke-width: 2px;
  filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.15));
  transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.label-group:hover .label-badge,
.label-group.hover .label-badge {
  transform: scale(1.18);
  stroke: #2563eb;
  stroke-width: 2.5px;
  fill: #eff6ff;
  filter: drop-shadow(0px 4px 8px rgba(37, 99, 235, 0.35));
}

.label-group:hover .label-badge.solved,
.label-group.hover .label-badge.solved {
  fill: #059669;
  stroke: #047857;
}

.label-text {
  font-size: 13px;
  font-weight: 800;
  fill: #334155;
  user-select: none;
  pointer-events: none;
  transition: transform 0.2s ease, fill 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.label-group:hover .label-text,
.label-group.hover .label-text {
  transform: scale(1.18);
  fill: #1d4ed8;
}

.label-group:hover .label-text.solved,
.label-group.hover .label-text.solved {
  fill: #ffffff;
}

.label-badge.solved {
  fill: #10b981;
  stroke: #047857;
}

.label-text.solved {
  fill: #ffffff;
  font-size: 11px;
}

/* モーダル */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.trophy-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.modal-content h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.modal-stats {
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 12px;
  margin: 1.2rem 0;
  font-size: 1.1rem;
}

.modal-stats p {
  margin: 0.3rem 0;
}
