@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@500;700;800;900&display=swap");

:root {
  --paper: #fffdf8;
  --paper-deep: #f4ecdf;
  --ink: #363636;
  --muted: #44403d;
  --rule: #d6cbbb;
  --soft: #efe6d8;
  --violet: #a85ce6;
  --violet-soft: #f3e7ff;
  --blue: #2f80ed;
  --green: #187b62;
  --red: #c7473f;
  --yellow: #fff8bb;
  --pink: #f5e7ff;
  --shadow: 0 18px 44px rgba(35, 31, 25, 0.22);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(168, 92, 230, 0.18), transparent 26%),
    linear-gradient(135deg, #252426, #37302d 58%, #1c2024);
  color: var(--ink);
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  line-height: 1.45;
}

body {
  margin: 0;
  padding: 24px 0;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ol {
  margin: 0;
}

.pamphlet {
  width: 1280px;
  max-width: calc(100vw - 48px);
  margin: 0 auto;
  background:
    linear-gradient(90deg, rgba(214, 203, 187, 0.22) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(rgba(214, 203, 187, 0.18) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  height: 320px;
  overflow: hidden;
  background: #cad9df;
  border-bottom: 8px solid var(--violet);
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.18) 48%, transparent 74%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.28), transparent 35%);
}

.hero__note {
  position: absolute;
  top: 11px;
  right: 31px;
  z-index: 3;
  padding: 6px 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.82);
  border-left: 4px solid var(--violet);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

h1 {
  position: absolute;
  left: 27px;
  bottom: 18px;
  z-index: 3;
  color: #fff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Times New Roman", serif;
  font-size: 54px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34), 0 10px 22px rgba(0, 0, 0, 0.44);
}

h1 span {
  font-size: 60%;
}

.section {
  position: relative;
  padding: 42px 66px 58px;
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.2)),
    transparent;
}

.section:nth-of-type(even) {
  background:
    linear-gradient(90deg, rgba(243, 231, 255, 0.48), transparent 44%),
    rgba(255, 253, 248, 0.65);
}

.section::before {
  content: "";
  position: absolute;
  left: 66px;
  right: 66px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(27, 27, 29, 0.28), transparent);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(168, 92, 230, 0.45), rgba(214, 203, 187, 0.46), transparent) 1;
}

.star {
  color: var(--violet);
  display: inline-block;
  width: auto;
  height: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 37px;
  filter: drop-shadow(0 2px 0 rgba(168, 92, 230, 0.18));
  line-height: 1;
}

h2 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

h3,
h4 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

h4 {
  margin-top: 24px;
}

p,
dd,
li,
a,
strong,
span {
  font-size: 15px;
  font-weight: 700;
}

p,
dd {
  color: var(--muted);
}

.links {
  padding-top: 28px;
  padding-bottom: 36px;
}

.links .section-title {
  margin-bottom: 30px;
}

.episode-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 0 162px;
}

.episode-links a {
  display: block;
  color: var(--ink);
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(27, 27, 29, 0.08);
}

.main-character-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 0 38px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 22px 28px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(67, 48, 31, 0.08);
}

.profile-card__portrait {
  width: 177px;
  height: 174px;
  object-fit: fill;
  margin-bottom: 18px;
}

.profile-card p {
  width: 100%;
  min-height: 112px;
  margin-top: 19px;
  font-size: 14px;
  font-weight: 700;
}

.profile-card__horse {
  width: 223px;
  height: 137px;
  object-fit: fill;
  margin-top: 18px;
  border: 1px solid var(--rule);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.sub-character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 70px;
}

.sub-character-grid article {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px 24px;
  background: rgba(255, 255, 255, 0.66);
  border-top: 4px solid var(--soft);
  border-radius: 12px;
}

.sub-character-grid img {
  width: 132px;
  height: 132px;
  object-fit: fill;
  margin-bottom: 18px;
}

.sub-character-grid p {
  width: 100%;
  margin-top: 17px;
  font-size: 14px;
}

.profile-card p a,
.sub-character-grid p a {
  color: var(--violet);
  font-size: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.relation-map {
  position: relative;
  height: 880px;
  margin: 0 auto;
}

.relation-map::before,
.relation-map::after {
  content: "";
  position: absolute;
  background: #111;
  transform-origin: left center;
}

.person {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.person img {
  object-fit: fill;
}

.person strong {
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
}

.person--unknown {
  left: 76px;
  top: 28px;
}

.person--unknown img,
.person--jungle img,
.person--miracle img,
.person--soccer img,
.person--biwa img {
  width: 95px;
  height: 95px;
}

.person--karen {
  left: 49px;
  top: 214px;
}

.person--karen img,
.person--okita img,
.person--dotou img {
  width: 132px;
  height: 132px;
}

.person--vega {
  left: 254px;
  top: 83px;
}

.person--toproad {
  left: 663px;
  top: 83px;
}

.person--vega img,
.person--toproad img,
.person--opera img {
  width: 174px;
  height: 174px;
  object-fit: fill;
}

.person--okita {
  right: 66px;
  top: 0;
}

.person--jungle {
  right: 67px;
  top: 221px;
}

.person--opera {
  left: 469px;
  top: 426px;
}

.person--miracle {
  right: 256px;
  top: 497px;
}

.person--soccer {
  right: 58px;
  top: 492px;
}

.person--biwa {
  left: 341px;
  bottom: 8px;
}

.person--dotou {
  left: 641px;
  bottom: 0;
}

.label {
  position: absolute;
  color: #111;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.label--room-a { left: 177px; top: 246px; }
.label--room-b { left: 888px; top: 162px; }
.label--room-c { left: 376px; top: 656px; }
.label--leave { left: 493px; top: 81px; }
.label--admire { left: 510px; top: 213px; }
.label--annoy { left: 449px; top: 343px; }
.label--laugh-a { left: 277px; top: 391px; }
.label--laugh-b { left: 542px; top: 354px; }
.label--great { left: 725px; top: 391px; white-space: normal; }
.label--coach { right: 179px; top: 29px; }
.label--father-a { right: 92px; top: 332px; }
.label--father-b { right: 47px; top: 226px; }
.label--same-father { right: 173px; top: 250px; }
.label--follower { left: 648px; top: 641px; }

.relation-map svg,
.relation-map .line {
  pointer-events: none;
}

.relation-map::before {
  left: 171px;
  top: 103px;
  width: 84px;
  height: 3px;
  transform: rotate(24deg);
}

.relation-map::after {
  left: 484px;
  top: 178px;
  width: 183px;
  height: 3px;
  background: var(--blue);
}

.relation-map {
  background:
    linear-gradient(28deg, transparent 43%, #111 43.1%, #111 43.4%, transparent 43.5%) 122px 0 / 350px 260px no-repeat,
    linear-gradient(118deg, transparent 45%, #111 45.1%, #111 45.4%, transparent 45.5%) 327px 570px / 360px 260px no-repeat,
    linear-gradient(90deg, transparent 0, transparent 100%);
}

.section-lead {
  margin-bottom: 30px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.22;
}

.figma-figure {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(67, 48, 31, 0.08);
}

.figma-figure--relation {
  padding: 40px;
  margin-top: -10px;
}

.figma-figure--relation img {
  width: 100%;
  height: auto;
}

.race-schedule {
  display: grid;
  grid-template-columns: repeat(12, minmax(88px, 1fr));
  gap: 4px;
  overflow-x: auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(67, 48, 31, 0.08);
}

.race-month {
  display: grid;
  grid-template-rows: auto repeat(3, 1fr);
  min-width: 88px;
  height: 360px;
  overflow: hidden;
  border: 1px solid rgba(54, 54, 54, 0.12);
  background: #fff;
}

.race-month h3 {
  display: grid;
  place-items: center;
  color: #fff;
  padding: 8px 4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.race-period {
  padding: 6px;
  border-top: 1px solid rgba(54, 54, 54, 0.14);
}

.race-period ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.race-period--dense ul {
  gap: 2px;
}

.race-period--dense li {
  margin-bottom: 2px;
}

.race-period--dense .race-name {
  font-size: 10px;
  line-height: 1.05;
}

.race-period--dense .race-venue {
  line-height: 1;
}

.race-period li {
  display: grid;
  gap: 1px;
  margin-bottom: 4px;
  padding: 3px 4px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  word-break: keep-all;
}

.race-name {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.03em;
  word-break: keep-all;
}

.race-venue {
  color: #777;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.1;
  opacity: 0.75;
}

.featured-race {
  background: #f6efcf;
  font-weight: 700;
}

.featured-race span {
  font-weight: 700;
}

.season-spring h3 {
  background: #e56b8a;
}

.season-spring .race-period {
  background: rgba(229, 107, 138, 0.12);
}

.season-summer h3 {
  background: #7cb342;
}

.season-summer .race-period {
  background: rgba(124, 179, 66, 0.12);
}

.season-autumn h3 {
  background: #f39c12;
}

.season-autumn .race-period {
  background: rgba(243, 156, 18, 0.12);
}

.season-winter h3 {
  background: #4a90e2;
}

.season-winter .race-period {
  background: rgba(74, 144, 226, 0.12);
}

.era-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 720px;
  margin-top: 28px;
  overflow: hidden;
}

.era-map::before,
.era-map::after {
  content: "";
  position: absolute;
  top: 53px;
  bottom: 0;
  width: 118px;
}

.era-map::before {
  left: calc(66.666% - 59px);
  background: var(--pink);
}

.era-map::after {
  left: calc(75% - 59px);
  background: var(--yellow);
}

.era-label {
  position: relative;
  z-index: 1;
  height: 30px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.era-dot {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: end center;
  width: 112px;
  height: 112px;
  padding-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.era-dot::before {
  content: "";
  position: absolute;
  top: 0;
  width: 75px;
  height: 75px;
  border-radius: 999px;
  background: #d9d9d9;
}

.dot-1 { left: 0; top: 110px; }
.dot-2 { left: 205px; top: 250px; }
.dot-3 { left: 201px; top: 480px; }
.dot-4 { left: 600px; top: 80px; }
.dot-5 { left: 600px; top: 250px; }
.dot-6 { left: 600px; top: 480px; }
.dot-7 { left: 991px; top: 250px; }
.dot-8 { left: 1112px; top: 250px; }
.dot-9 { left: 980px; top: 388px; }
.dot-10 { left: 1114px; top: 388px; }
.dot-11 { left: 600px; top: 615px; }
.dot-topro { left: 751px; top: 80px; }
.dot-vega { left: 751px; top: 250px; }
.dot-opera { left: 751px; top: 424px; }
.dot-dotou { left: 751px; top: 615px; }

.dot-topro::after,
.dot-vega::after,
.dot-opera::after {
  content: "";
  position: absolute;
  top: 35px;
  left: 80px;
  width: 112px;
  height: 10px;
  border-radius: 999px;
}

.dot-topro::after {
  background: #be39ff;
}

.dot-vega::after {
  background: #3336ff;
  width: 55px;
}

.dot-opera::after {
  background: #c100d6;
}

.dot-dotou::after {
  content: "";
  position: absolute;
  top: 35px;
  left: 80px;
  width: 55px;
  height: 10px;
  border-radius: 999px;
  background: #3336ff;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.track-grid article {
  padding: 18px 18px 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(67, 48, 31, 0.08);
}

.track-grid img {
  width: 100%;
  height: auto;
  object-fit: fill;
  margin-bottom: 20px;
  border: 1px solid var(--rule);
}

.track-grid h3,
.track-grid p {
  width: 100%;
  text-align: left;
}

.track-grid h3 {
  margin-bottom: 15px;
}

.track-grid p {
  font-size: 14px;
  line-height: 1.36;
}

.track-grid p + p {
  margin-top: 17px;
}

.tips-list {
  display: grid;
  gap: 18px;
}

.tips-list div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 30px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.78);
  border-left: 7px solid var(--violet);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(67, 48, 31, 0.07);
}

.tips-list dt {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.tips-list dd {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.48;
  font-weight: 700;
}

.footer {
  padding: 46px 66px 42px;
  color: #b3b3b3;
  text-align: center;
}

.footer p {
  color: #b3b3b3;
  font-size: 13px;
}

.footer__credits {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 22px;
}

.footer__credits p,
.footer__credits li {
  color: #9f9f9f;
  font-size: 12px;
  font-weight: 700;
}

.footer__credits ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 900px) {
  body {
    padding: 0;
  }

  .pamphlet {
    max-width: 100%;
  }

  .section {
    padding: 28px 22px 42px;
  }

  h1 {
    font-size: 32px;
  }

  .episode-links,
  .main-character-grid,
  .sub-character-grid,
  .track-grid,
  .tips-list div {
    grid-template-columns: 1fr;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .profile-card p,
  .sub-character-grid p,
  .track-grid h3,
  .track-grid p,
  .track-grid img {
    width: 100%;
  }

  .relation-map,
  .era-map {
    transform: scale(0.72);
    transform-origin: top left;
    width: 1280px;
    margin-bottom: -240px;
  }

  .race-schedule {
    grid-template-columns: repeat(12, 92px);
  }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }

  html,
  body {
    background: #fff;
  }

  body {
    padding: 0;
  }

  .pamphlet {
    width: auto;
    max-width: none;
    box-shadow: none;
  }

  .section,
  .hero {
    break-inside: avoid;
  }
}
