/* ============================================================
   美ら海バスターZ Pro MAX - style.css
   ============================================================ */

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

:root {
  --bg:          #0a2540;
  --bg-card:     #0f3358;
  --bg-card2:    #0c2845;
  --accent:      #00d4ff;
  --accent-warm: #e8b84b;
  --accent-blue: #3a9fd8;
  --text:        #ffffff;
  --text-sub:    #90bdd4;
  --text-muted:  #5a8aaa;
  --border:      rgba(0, 212, 255, 0.2);
  --radius:      16px;
  --radius-sm:   10px;
}

html, body { min-height: 100%; }

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 160, 255, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 15%, rgba(0, 120, 220, 0.3) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 90%, rgba(0, 100, 180, 0.25) 0%, transparent 55%),
    linear-gradient(180deg, #0d2d4a 0%, #071a30 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- ヘッダー --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 45, 74, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
}

.header-inner {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.3px;
  white-space: nowrap;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.header-logo:hover {
  opacity: 0.85;
}

.header-logo .logo-z { color: var(--accent-warm); }

.header-logo-sub {
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 400;
  display: block;
  letter-spacing: 0.5px;
}

.header-badge {
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* --- コンテンツラッパー --- */
.hero,
.section-label-wrap,
#main,
footer {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 12px;
  padding-right: 12px;
}

/* --- ヒーロー --- */
.hero {
  padding-top: 24px;
  padding-bottom: 20px;
}

.hero-date {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 3px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* アイコンバッジ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.hero-badge {
  font-size: 12px;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 20px;
  padding: 5px 12px;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -1px;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-desc {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.7;
}

.hero-desc .hero-factors {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.hero-tagline {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-sub);
  margin-top: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-label span {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

#main {
  padding-top: 0;
  padding-bottom: 40px;
}

/* --- ビーチカード --- */
.beach-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.beach-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 212, 255, 0.18);
}

.beach-card:active { transform: scale(0.99); }

.card-wave {
  position: relative;
  height: 80px;
  overflow: hidden;
}

.card-wave {
  background: linear-gradient(135deg, #0e5080 0%, #1475b0 60%, #0a3860 100%);
}

.wave-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 150%;
  height: 60px;
}

.wave-path-1 { animation: waveMove1 8s linear infinite; }
.wave-path-2 { animation: waveMove2 11s linear infinite; }
.wave-path-3 { animation: waveMove3 14s linear infinite; }

@keyframes waveMove1 { from { transform: translateX(0); } to { transform: translateX(-50px); } }
@keyframes waveMove2 { from { transform: translateX(0); } to { transform: translateX(50px); } }
@keyframes waveMove3 { from { transform: translateX(0); } to { transform: translateX(-70px); } }

.card-header-text {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.card-island {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  font-weight: 400;
}

.card-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-body {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.card-score-area {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

/* スコアサークル */
.score-circle {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.score-circle svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.score-circle circle:first-child {
  stroke: rgba(255,255,255,0.08);
  stroke-width: 5;
}

.score-circle circle:last-child {
  transition: stroke-dasharray 0.8s ease;
  stroke-width: 5;
}

/* デフォルトは青（最高点以外） */
.score-circle circle:last-child {
  stroke: var(--accent-blue);
}

/* 最高点カードはオレンジ */
.beach-card-top .score-circle circle:last-child {
  stroke: var(--accent-warm);
}
.beach-card-top .score-num {
  color: var(--accent-warm);
}

.score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-blue);
  line-height: 1;
}

.score-unit {
  font-size: 10px;
  color: var(--text-sub);
  margin-top: 2px;
}

.card-meta { flex: 1; min-width: 0; }

.card-best-time {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.card-comment {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-arrow {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* --- スコアリング根拠 --- */
.scoring-info {
  background: rgba(15, 51, 88, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 10px;
  margin-bottom: 32px;
}

.scoring-info-title {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.scoring-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.scoring-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.scoring-item-label { color: var(--text-sub); }
.scoring-item-value {
  color: var(--accent);
  font-weight: 700;
}

.scoring-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
}

/* --- ローディング --- */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 16px;
  color: var(--text-sub);
  font-size: 13px;
}

.loading-wave {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- 詳細画面 --- */
.detail-view { padding-bottom: 40px; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  padding: 14px 0 8px;
}

.back-btn:hover { opacity: 0.8; }

.detail-hero {
  position: relative;
  height: 100px;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, #104888 0%, #1a68c0 60%, #0c3068 100%);
}

.detail-island {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1px;
}

.detail-name {
  position: absolute;
  bottom: 28px;
  left: 14px;
  right: 14px;
  font-size: clamp(18px, 5vw, 28px);
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-caption {
  position: absolute;
  bottom: 8px;
  left: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.detail-name {
  bottom: 26px;
}

.week-best-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 18px;
}

.week-best-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.week-best-date {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.week-best-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent-warm);
  line-height: 1.1;
  margin-bottom: 8px;
}

.score-unit-sm {
  font-size: 16px;
  color: var(--accent-warm);
  margin-left: 4px;
}

.week-best-comment {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
}

.forecast-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-line {
  padding: 8px 14px;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.now-line-label {
  font-size: 10px;
  color: #e0f0ff;
  letter-spacing: 1px;
  white-space: nowrap;
}

.now-line-score {
  font-size: 13px;
  font-weight: bold;
  color: var(--accent);
  white-space: nowrap;
}

.now-line-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
}

.now-line-detail span {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0, 212, 255, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
}

.day-row {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

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

.day-label { font-size: 13px; font-weight: 700; color: var(--text); }
.day-label.today { color: var(--text); }
.day-best-label { font-size: 11px; color: var(--text-sub); }

.hour-cells {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.hour-cell {
  flex: 1;
  background: rgba(0, 180, 255, 0.07);
  border-radius: 6px;
  padding: 7px 2px;
  text-align: center;
  border: 1px solid rgba(0, 180, 255, 0.12);
}

.hour-cell.hour-best {
  background: rgba(255, 107, 53, 0.15);
  border-color: var(--accent-warm);
}

.hour-label { font-size: 9px; color: var(--text-muted); margin-bottom: 3px; }
.hour-score { font-size: 14px; font-weight: 700; color: var(--accent); }
.hour-cell.hour-best .hour-score { color: var(--accent-warm); }

.day-comment {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 8px;
  line-height: 1.5;
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

.day-breakdown {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-breakdown span {
  font-size: 9px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* --- フッター --- */
footer {
  text-align: center;
  padding-top: 20px;
  padding-bottom: 40px;
  font-size: 11px;
  color: var(--text-muted);
}

footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* --- 週間ベスト日のグロー＆王冠 --- */
.day-week-best {
  border-color: rgba(232, 184, 75, 0.5);
  box-shadow: 0 0 16px rgba(232, 184, 75, 0.15), inset 0 0 24px rgba(232, 184, 75, 0.04);
}

.day-crown {
  display: inline-block;
  font-size: 11px;
  color: var(--accent-warm);
  margin-left: 6px;
  opacity: 0.85;
  vertical-align: middle;
}

/* 今週のベストカードの王冠 */
.week-crown {
  font-size: 13px;
  color: var(--accent-warm);
  margin-right: 5px;
  opacity: 0.85;
}

/* --- ベスト日：日付テキストをゴールドに --- */
.day-week-best {
  border-color: var(--border);
  box-shadow: none;
}

.day-week-best .day-label {
  color: var(--accent-warm);
}

.day-crown,
.week-crown {
  display: none;
}

/* ベスト時間帯の「ちゅら」ラベル */
.hour-unit {
  display: block;
  font-size: 8px;
  font-weight: 400;
  color: var(--accent-warm);
  margin-top: 1px;
  letter-spacing: 0.3px;
}

/* ============================================================
   PC向けメディアクエリ（600px以上）
   スマホ向けに変更した値を元に戻す
   ============================================================ */
@media (min-width: 600px) {
  header {
    padding: 0 24px;
  }

  .hero,
  .section-label-wrap,
  #main,
  footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .card-wave {
    height: 96px;
  }

  .card-comment {
    font-size: 14px;
  }

  .hero-desc {
    line-height: 2.0;
  }

  .card-body {
    border-top: none;
  }

  .beach-card {
    margin-bottom: 16px;
  }

  .detail-hero {
    height: 120px;
  }

  .week-best-comment {
    font-size: 13px;
  }

  .day-comment {
    font-size: 12px;
  }

  .day-breakdown span {
    font-size: 10px;
  }

  /* PC：カード内訳タグにスペースを追加・満点表示はapp.js側で対応 */
  .card-breakdown {
    gap: 8px;
  }

  .card-breakdown span {
    font-size: 11px;
    padding: 3px 10px;
    letter-spacing: 0.3px;
  }

  /* PC：card-bodyを中央揃えに戻し、テキスト間隔を詰める */
  .card-body,
  .card-score-area {
    align-items: center;
  }

  .score-circle {
    margin-top: 0;
  }

  .card-best-time {
    margin-bottom: 2px;
  }

  .card-comment {
    margin-bottom: 4px;
  }
}

/* スマホではカードコメントを非表示・card-bodyを締める */
@media (max-width: 599px) {
  .card-comment {
    display: none;
  }
  .card-body {
    padding: 10px 12px;
  }
  .score-circle {
    width: 70px;
    height: 70px;
  }
  .score-circle svg {
    width: 70px;
    height: 70px;
  }
  .score-num {
    font-size: 24px;
  }
}

/* トップページ カード内訳タグ */
.card-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.card-breakdown span {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* ヒーロー日付 */
.hero-date {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
