/* =========================================================
   高校サッカー部ランキング＜東京＞ - 共通スタイル
   FIFAランキングサイトのトーンを踏襲（ネイビー×ゴールド）
   ========================================================= */

:root {
  --navy-900: #0a1633;
  --navy-800: #0f1f45;
  --navy-700: #16295c;
  --navy-600: #1e3a75;
  --gold: #d4af37;
  --gold-bright: #ffd75e;
  --accent: #ff5b3d;
  --accent-bright: #ff8a5c;
  --green: #1fae4f;
  --red: #e5484d;
  --gray-100: #f5f6f8;
  --gray-300: #d7dbe3;
  --gray-500: #8b93a7;
  --gray-700: #4b5468;
  --white: #ffffff;
  --radius: 10px;
  --max-width: 1080px;
  --shadow: 0 4px 18px rgba(10, 22, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic",
    "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--navy-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand__badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 0 2px rgba(255, 91, 61, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-300);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-bright);
}

/* ---------- Page shell ---------- */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.hero {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0;
  color: var(--gray-300);
  font-size: 0.92rem;
}

.hero .updated {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--gold-bright);
}

/* ---------- Ranking table (desktop) ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.table-scroll {
  overflow-x: auto;
}

/* チーム戦績テーブルはモバイルでも表示する */
.table-scroll.matches-scroll {
  display: block;
}

table.ranking {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

table.ranking thead th {
  background: var(--navy-900);
  color: var(--gray-300);
  text-align: left;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 14px;
  position: sticky;
  top: 0;
}

table.ranking tbody tr {
  border-bottom: 1px solid #eef0f4;
  transition: background 0.12s;
}

table.ranking tbody tr:hover {
  background: #f6f8fc;
}

table.ranking td {
  padding: 12px 14px;
  font-size: 0.92rem;
  vertical-align: middle;
}

/* ---------- Rank number + movement (FIFA style) ---------- */
.rank-cell-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 60px;
}

.rank-num {
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}

.rank-num.top1 { color: #b8860b; }
.rank-num.top2 { color: #7d8597; }
.rank-num.top3 { color: #a05a2c; }

.move {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 0.74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.move.up { color: var(--green); }
.move.down { color: var(--red); }
.move.flat { color: var(--gray-500); }

.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-emblem {
  width: 44px;   /* 130%拡大 */
  height: 44px;
  border-radius: 0;
  background: transparent;
  border: none;   /* 枠線（ケイ枠）非表示 */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.team-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.team-emblem--sm {
  width: 36px;   /* 130%拡大 */
  height: 36px;
}

.team-link {
  font-weight: 700;
  color: var(--navy-900);
  border-bottom: 2px solid transparent;
}

.team-link:hover {
  color: var(--navy-600);
  border-bottom-color: var(--gold);
}

.team-name-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.league-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
  background: #eef1f7;
  color: var(--navy-700);
  border: 1px solid #d7dbe3;
}

.league-badge.prince {
  background: rgba(212, 175, 55, 0.16);
  color: #8a6d1a;
  border-color: rgba(212, 175, 55, 0.45);
}

.league-badge.t1 {
  background: rgba(30, 58, 117, 0.1);
  color: var(--navy-700);
  border-color: rgba(30, 58, 117, 0.25);
}

.league-badge.t2 {
  background: #f0f2f5;
  color: var(--gray-700);
  border-color: #d7dbe3;
}

.league-badge.t3 {
  background: #f5f6f8;
  color: var(--gray-500);
  border-color: #e3e6ec;
}

.pt-cell {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--gray-500); }

.muted {
  color: var(--gray-500);
  font-size: 0.85rem;
}

/* ---------- Show all / best-8 toggle ---------- */
.toggle-all-btn {
  display: block;
  width: 100%;
  padding: 13px;
  border: none;
  border-top: 1px solid #eef0f4;
  background: var(--navy-800);
  color: var(--white);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
}

.toggle-all-btn:hover {
  background: var(--navy-700);
}

/* ---------- Mobile ranking cards ---------- */
.ranking-cards {
  display: none;
}

.rank-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f4;
}

.rank-card__rank-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 34px;
  flex-shrink: 0;
}

.rank-card__rank {
  font-weight: 900;
  font-size: 1.4rem;
  text-align: center;
  color: var(--navy-800);
  line-height: 1;
}

.rank-card__body {
  flex: 1;
  min-width: 0;
}

.rank-card__team {
  font-weight: 700;
  font-size: 0.98rem;
  display: block;
}

.rank-card__meta {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.rank-card__pt {
  text-align: right;
  flex-shrink: 0;
}

.rank-card__pt .pt-value {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  color: var(--navy-900);
}

/* ---------- Team page ---------- */
.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.team-header .stat {
  text-align: center;
}

.team-header .stat .value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-bright);
  display: block;
}

.team-header .stat .label {
  font-size: 0.7rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.season-summary {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--gray-300);
  line-height: 1.7;
}

.team-stats-row {
  display: flex;
  gap: 22px;
  margin-top: 14px;
  flex-wrap: wrap;
}

table.matches {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

table.matches thead th {
  background: var(--navy-900);
  color: var(--gray-300);
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px 12px;
}

table.matches tbody td {
  padding: 10px 12px;
  font-size: 0.86rem;
  border-bottom: 1px solid #eef0f4;
}

.result-badge {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--white);
}

.result-badge.win { background: var(--green); }
.result-badge.draw { background: var(--gray-500); }
.result-badge.lose { background: var(--red); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 14px;
}

.back-link:hover {
  color: var(--navy-900);
  text-decoration: underline;
}

/* ---------- About page ---------- */
.prose h2 {
  font-size: 1.1rem;
  margin: 26px 0 10px;
  color: var(--navy-800);
  border-left: 4px solid var(--gold);
  padding-left: 10px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p, .prose li {
  font-size: 0.92rem;
  color: #2b3348;
}

.formula-box {
  background: var(--navy-900);
  color: var(--gray-100);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 0.9rem;
  margin: 14px 0;
  overflow-x: auto;
}

.formula-box code {
  color: var(--gold-bright);
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
}

table.coeff {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 18px;
  font-size: 0.86rem;
}

table.coeff th, table.coeff td {
  border: 1px solid #e3e6ec;
  padding: 7px 10px;
  text-align: left;
}

table.coeff th {
  background: #eef1f7;
}

.footer-note {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.78rem;
  margin-top: 30px;
}

.loading, .empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .main-nav a {
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .hero {
    padding: 20px 18px;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .table-scroll {
    display: none;
  }

  .ranking-cards {
    display: block;
  }

  table.matches {
    min-width: 0;
    font-size: 0.8rem;
  }

  table.matches thead th,
  table.matches tbody td {
    padding: 8px 6px;
  }
}

@media (max-width: 480px) {
  .brand span.brand__text {
    font-size: 0.92rem;
  }

  .hero h1 {
    font-size: 1.1rem;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .team-stats-row {
    gap: 12px;
  }

  table.matches {
    font-size: 0.72rem;
  }

  table.matches thead th,
  table.matches tbody td {
    padding: 7px 4px;
  }
}

/* 今週のトピックス */
.topics-card {
  padding: 16px 20px;
  border-left: 5px solid var(--gold, #e0a400);
}
.topics-title {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: var(--navy-800, #16305c);
  font-weight: 800;
}
.topics-text {
  margin: 0;
  white-space: pre-line;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--gray-700, #3a4453);
}

/* チームページ 年度別サマリー */
.team-years { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.year-line { display:grid; grid-template-columns:42px 122px auto; column-gap:6px; align-items:baseline; font-size:0.98rem; color:var(--white); }
.year-line .yl-year { font-weight:700; }
.year-line .yl-single { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; font-weight:700; }
.year-line .yl-cum { white-space:nowrap; font-variant-numeric:tabular-nums; font-weight:700; color:var(--gold-bright); }
.year-line .yl-single .d { color:var(--gold-bright); }
.year-line .r { color:var(--white); font-weight:800; }
@media (max-width:480px){ .year-line { grid-template-columns:34px 108px auto; column-gap:4px; font-size:0.9rem; } }
