:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #e8e8ed;
  --text: #1d1d1f;
  --text-muted: #86868b;
  --line: #d2d2d7;
  --accent: #d70035;
  --accent-strong: #b3002d;
  --accent-glow: rgba(215, 0, 53, 0.08);
  --gold: #bf913c;
  --silver: #86868b;
  --blue: #0066cc;
  --green: #248a3d;
  --radius: 20px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  --max: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

/* ── Header ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
}

.brand:hover { opacity: 0.8; }

.brand__logo {
  height: 36px;
  width: auto;
}

.brand__text {
  color: var(--text);
}

.brand__text span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 8px;
  font-size: 13px;
  align-items: center;
}

.nav a {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.2s;
  font-weight: 500;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav a.active {
  color: var(--accent);
  background: rgba(201, 53, 62, 0.12);
}

/* Hamburger */
.menu-trigger {
  display: none;
  width: 28px;
  height: 22px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 100;
}

.menu-trigger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text);
  position: absolute;
  left: 0;
  transition: 0.3s ease;
}

.menu-trigger span:nth-child(1) { top: 0; }
.menu-trigger span:nth-child(2) { top: 10px; }
.menu-trigger span:nth-child(3) { bottom: 0; }

body.is-menu-open .menu-trigger span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
body.is-menu-open .menu-trigger span:nth-child(2) { opacity: 0; }
body.is-menu-open .menu-trigger span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* ── Hero ── */
.hero {
  padding: 56px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%);
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}

/* ── Hero Main (Stadium Background) ── */
.hero-main {
  background: none; /* Reset if previously set */
  position: relative;
  color: #ffffff;
  padding: 120px 0 100px;
  overflow: hidden;
}

/* Background image layer */
.hero-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('stadium_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.65; /* Increased from 0.5 for more visibility */
  filter: blur(2px) brightness(0.75); /* Reduced blur and increased brightness */
  z-index: -1;
}

/* Dark overlay layer */
.hero-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 0;
  pointer-events: none;
}

.hero-main .hero__inner {
  z-index: 2;
  position: relative;
}

.hero-main h1, 
.hero-main h1 .accent,
.hero-main .subtitle {
  color: #ffffff !important;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-main .label {
  color: #ff4d7a;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-weight: 700;
}

.hero-main .hero__profile {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero-main .profile-item .val {
  color: #ffffff;
}

.hero-main .profile-item .lbl {
  color: rgba(255, 255, 255, 0.9);
}

.hero-main .profile-divider {
  background: rgba(255, 255, 255, 0.15);
}

.hero-main .year-nav a {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.hero-main .year-nav a:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.hero__inner {
  position: relative;
  z-index: 10;
}

.hero .label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  font-weight: 800;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .subtitle {
  color: var(--text-muted);
  font-size: clamp(15px, 1.6vw, 19px);
  max-width: 680px;
  margin: 0 auto 28px;
}

.hero__profile {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 28px;
  margin-bottom: 32px;
}

.profile-item {
  text-align: center;
}

.profile-item .val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.profile-item .lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-divider {
  width: 1px;
  height: 36px;
  background: var(--line);
}

/* ── Section ── */
.section {
  padding: 64px 0;
}

.section-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 8px;
}

.section h2 {
  font-size: clamp(22px, 3vw, 34px);
  text-align: center;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  font-weight: 700;
}

.section .lead {
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto 36px;
}

/* ── Year Cards ── */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.year-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.year-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-2px);
}

.year-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.year-card__year {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.year-card__team {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
}

.year-card__team.angels { color: #ba0021; background: rgba(186, 0, 33, 0.08); }
.year-card__team.dodgers { color: #005a9c; background: rgba(0, 90, 156, 0.08); }

.year-card__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.year-card__stat {
  text-align: center;
}

.year-card__stat .val {
  font-size: 20px;
  font-weight: 700;
}

.year-card__stat .lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.year-card__awards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.award-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(184, 134, 11, 0.08);
  color: var(--gold);
  border: 1px solid rgba(184, 134, 11, 0.2);
}

.award-badge.mvp {
  background: rgba(184, 134, 11, 0.12);
  border-color: rgba(184, 134, 11, 0.3);
}

.award-badge.ws {
  background: rgba(45, 122, 62, 0.08);
  color: var(--green);
  border-color: rgba(45, 122, 62, 0.2);
}

/* ── Stats Tables ── */
.stats-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.stats-card__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-card__title .icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
}

.stats-card__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.stats-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 500px;
}

.stats-table thead th {
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.stats-table tbody td {
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid rgba(221, 213, 200, 0.7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-table tbody tr:hover {
  background: rgba(181, 49, 42, 0.04);
}

.stats-table .highlight {
  color: var(--accent-strong);
  font-weight: 700;
}

.stats-table .month-label {
  text-align: center;
  font-weight: 600;
  color: var(--text);
}

/* ── Career Summary Grid ── */
.career-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.career-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s;
}

.career-stat:hover {
  border-color: var(--accent);
}

.career-stat .val {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.career-stat .val.gold { color: var(--gold); }
.career-stat .val.red { color: var(--accent-strong); }
.career-stat .val.blue { color: var(--blue); }
.career-stat .val.green { color: var(--green); }

.career-stat .lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ── Awards List ── */
.awards-section {
  margin-top: 24px;
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.award-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  transition: border-color 0.2s;
}

.award-item:hover {
  border-color: var(--gold);
}

.award-icon {
  font-size: 24px;
  min-width: 32px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.svg-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
}
.svg-trophy, .svg-medal, .svg-rocket, .svg-star, .svg-scroll {
  color: var(--gold);
}
.svg-baseball, .svg-calendar, .svg-briefcase, .svg-chart {
  color: var(--text-muted);
}
.svg-flag {
  color: #ba0021; /* Japan Red */
}

.award-info .name {
  font-weight: 600;
  font-size: 14px;
}

.award-info .detail {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Record List & Highlights ── */
.record-section {
  margin-bottom: 40px;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.record-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: all 0.3s ease;
}

.record-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.record-card__content {
  flex: 1;
}

.record-card__title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--text);
}

.record-card__detail {
  font-size: 13px;
  color: var(--text-muted);
}

.record-card__year {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

/* Legendary Style */
.record-card.legendary {
  background: linear-gradient(135deg, #fff 0%, #fff9f0 100%);
  border: 1px solid #ffd700;
  box-shadow: 0 10px 40px rgba(218, 165, 32, 0.1);
  position: relative;
}

.record-card.legendary::after {
  content: "LEGEND";
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.1em;
}

.record-card.legendary .record-card__title {
  color: #a67c00;
}

.record-card.legendary .record-card__year {
  background: var(--gold);
  color: #fff;
}

/* Grid for records */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.year-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.year-nav a {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-muted);
  transition: all 0.2s;
}

.year-nav a:hover {
  color: var(--text);
  border-color: var(--accent);
}

.year-nav a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Page Header for yearly pages ── */
.page-header {
  padding: 40px 0 24px;
  text-align: center;
}

.page-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  transition: color 0.2s;
}

.page-header .back-link:hover {
  color: var(--accent);
}

.page-header h1 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header .team-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.page-header .team-badge.angels {
  background: rgba(186, 0, 33, 0.08);
  color: #ba0021;
}

.page-header .team-badge.dodgers {
  background: rgba(0, 90, 156, 0.08);
  color: #005a9c;
}

/* ── Two Column Layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Footer ── */
footer {
  padding: 32px 0 48px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  border-top: 1px solid var(--line);
}

footer a {
  color: var(--text-muted);
  transition: color 0.2s;
}

footer a:hover {
  color: var(--text);
}

/* ── Fade Animation ── */
.fade {
  opacity: 0;
  transform: translateY(14px);
  transition: 0.55s ease;
}

.fade.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Note Box ── */
.note-box {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 16px 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .year-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .menu-trigger {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100dvh;
    background: var(--surface);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 24px 60px; /* Top padding increased, added bottom padding */
    gap: 8px;
    z-index: 150;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
  }

  body.is-menu-open .nav {
    transform: translateX(0);
  }

  .nav a {
    width: 100%;
    font-size: 15px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg);
    text-align: center; /* Center text to avoid cutting off at the edges */
  }

  .nav a.active {
    background: var(--accent-glow);
  }
}

@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .year-grid {
    grid-template-columns: 1fr;
  }

  .year-card__stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .career-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .hero__profile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
    width: 100%;
    max-width: 380px;
    margin: 0 auto 32px;
  }

  .profile-item:first-child {
    grid-column: span 2;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .profile-item {
    text-align: center;
  }

  .profile-divider {
    display: none;
  }

  /* 記録カードのモバイル対応 */
  .record-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
  }

  .record-card__year {
    order: 2; /* テキストの下に配置 */
    align-self: flex-start;
  }

  .record-card.legendary::after {
    top: 10px;
    right: 15px;
  }

  /* インデックスページのマイルストーンテーブルをカード化 */
  .stats-table-milestone {
    min-width: 0 !important;
    width: 100% !important;
  }

  .stats-table-milestone thead {
    display: none;
  }

  .stats-table-milestone tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .stats-table-milestone tr {
    display: block;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .stats-table-milestone tr:hover {
    background: var(--surface) !important;
    border-color: var(--accent);
  }

  .stats-table-milestone td {
    display: block;
    text-align: left !important;
    padding: 4px 0 !important;
    border: none !important;
    white-space: normal !important;
  }

  .stats-table-milestone td:nth-child(1) {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
  }

  .stats-table-milestone td:nth-child(2) {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    display: inline-block;
    background: var(--accent-glow);
    padding: 3px 10px !important;
    border-radius: 6px;
    margin-bottom: 8px;
    margin-top: 4px;
  }

  .stats-table-milestone td:nth-child(3) {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
  }

  .awards-grid {
    grid-template-columns: 1fr;
  }


  .section {
    padding: 48px 0;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .hero-main {
    padding: 80px 0 60px;
  }

  .page-header {
    padding: 32px 0 20px;
  }
}

@media (max-width: 480px) {
  .career-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .year-card__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-card {
    padding: 16px;
  }

  .section h2 {
    font-size: 24px;
  }

  .year-nav {
    gap: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 4px 16px;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    margin: 16px -16px;
    width: calc(100% + 32px);
    display: flex;
    flex-wrap: nowrap;
  }
  .year-nav::-webkit-scrollbar {
    display: none;
  }
  .year-nav a {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ── Footer ── */
footer {
  padding: 60px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  list-style: none;
  padding: 0;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-nav a:hover, .footer-nav a.active {
  color: var(--accent);
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-muted);
}
