:root {
  color-scheme: light;
  --night: #101525;
  --night-text: #f6f7ff;
  --paper: #ffffff;
  --background: #f2f4f8;
  --ink: #1d2535;
  --muted: #57647a;
  --line: #dce2ec;
  --accent: #5045a5;
  --accent-soft: #edeafd;
  --container: 78rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--background);
}

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

html { scroll-padding-top: 5rem; }
body { margin: 0; }
a { color: var(--accent); }
a:focus-visible, summary:focus-visible, .table-wrap:focus-visible {
  outline: 2px solid #7765e7;
  outline-offset: 4px;
}

.wrap {
  width: min(var(--container), calc(100% - 4rem));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 5;
  top: 0.6rem;
  left: 0.6rem;
  transform: translateY(-200%);
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: var(--paper);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #101525;
  border-bottom: 1px solid #2b324a;
}
.topbar-inner {
  min-height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-name {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #f0eeff;
  font-weight: 680;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}
.site-name::before {
  content: "";
  width: 0.78rem;
  aspect-ratio: 1;
  border: 2px solid #bcb1ff;
  border-radius: 0.16rem;
  transform: rotate(45deg);
  flex: none;
}
.top-links { display: flex; gap: 0.3rem; }
.top-links a {
  padding: 0.58rem 0.76rem;
  border-radius: 0.45rem;
  color: #d4d7e8;
  font-weight: 580;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.top-links a:hover {
  background: #252c44;
  color: #ffffff;
}

.hero {
  color: var(--night-text);
  background:
    radial-gradient(ellipse at 78% 0%, #252247 0%, transparent 61%),
    linear-gradient(152deg, #151b2d, #101525 70%);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6.1rem);
  padding-block: clamp(3.6rem, 7vw, 6.2rem);
}
.hero-meta {
  margin: 0 0 1.4rem;
  color: #c2bfdd;
  font-size: 0.94rem;
  font-weight: 580;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.9rem, 5.7vw, 5.15rem);
  line-height: 1.02;
  font-weight: 770;
  letter-spacing: -0.055em;
}
.hero h1 span {
  display: block;
  margin-top: 0.42em;
  color: #ddd5ff;
  font-size: 0.53em;
  letter-spacing: 0.045em;
  line-height: 1.18;
}
.hero-deck {
  margin: 1.1rem 0 0;
  color: #ececfa;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.5;
  font-weight: 610;
}
.hero-desc {
  margin: 0.6rem 0 0;
  color: #bfc5db;
  line-height: 1.65;
  font-size: 1rem;
}
.date-range { white-space: nowrap; }
.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.65rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.62rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  font-size: 0.94rem;
  line-height: 1.5;
  font-weight: 650;
  text-decoration: none;
}
.button-primary { color: #211844; background: #d6cdff; }
.button-primary:hover { background: #eee9ff; }
.button-outline { color: #edf0ff; border-color: #5a6184; }
.button-outline:hover { border-color: #afa6ec; background: #262845; }

.match {
  min-width: 0;
  margin: 0;
  border: 1px solid #414765;
  border-radius: 1.1rem;
  background: #151b31;
  overflow: hidden;
}
.match-board {
  position: relative;
  isolation: isolate;
  min-height: 10.5rem;
  aspect-ratio: 1.95;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background:
    radial-gradient(circle at 27% 54%, #4e429255, transparent 43%),
    radial-gradient(circle at 77% 48%, #79473c45, transparent 43%);
}
.match-board::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(to right, #93a4d719 1px, transparent 1px),
    linear-gradient(to bottom, #93a4d719 1px, transparent 1px);
  background-size: 1.35rem 1.35rem;
  background-position: center;
}
.match-board::after {
  position: absolute;
  z-index: -1;
  inset: 16% 8%;
  content: "";
  border: 1px solid #909cc453;
  border-radius: 0.75rem;
}
.side {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.4rem, 1.8vw, 1rem);
}
.side-a { --side-color: #a294ff; }
.side-b { --side-color: #efa879; }
.player {
  display: grid;
  place-items: center;
  width: clamp(1.7rem, 4vw, 3.05rem);
  aspect-ratio: 1;
  border: 1px solid var(--side-color);
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--side-color) 24%, #181b32);
  box-shadow: 0 0 1.1rem color-mix(in srgb, var(--side-color) 25%, transparent);
  transform: rotate(45deg);
}
.player::before {
  content: "";
  width: 28%;
  aspect-ratio: 1;
  border-radius: 0.12rem;
  background: var(--side-color);
}
.side-a .player:first-child, .side-b .player:last-child { margin-top: 1.35rem; }
.versus {
  padding: 0.25rem 0.42rem;
  color: #e5e0fe;
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.1em;
}
.match figcaption {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid #414765;
  background: #12182a;
}
.fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.95rem 0.3rem 1rem;
  text-align: center;
}
.fact + .fact { border-left: 1px solid #353c57; }
.fact strong { color: #f4f0ff; line-height: 1.1; font-size: clamp(1.25rem, 2.9vw, 1.7rem); letter-spacing: -0.03em; }
.fact span { color: #c5cce2; font-size: 0.875rem; line-height: 1.4; }

.reading {
  display: grid;
  grid-template-columns: minmax(12rem, 14.4rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2.65rem);
  padding-block: 2.5rem 4rem;
}
.contents {
  position: sticky;
  top: 5.25rem;
  max-height: calc(100vh - 6.25rem);
  overflow: auto;
  padding: 0.24rem 0.5rem 1rem 0;
}
.contents-toggle { display: none; }
.section-menu {
  display: grid;
  gap: 0.16rem;
}
.contents-title {
  margin: 0 0 0.55rem 0.65rem;
  color: #303851;
  font-weight: 740;
  font-size: 1rem;
}
.section-menu a,
.contents-section summary {
  display: block;
  padding: 0.48rem 0.65rem;
  border-radius: 0.45rem;
  color: #46536a;
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
}
.section-menu .contents-entry,
.contents-section summary {
  color: #303851;
  font-size: 0.95rem;
  font-weight: 650;
}
.contents-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  cursor: pointer;
  list-style: none;
}
.contents-section summary::-webkit-details-marker { display: none; }
.contents-section summary::after,
.contents-toggle::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  flex: none;
  margin-right: 0.16rem;
  margin-top: -0.2rem;
  border: solid #68718a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.contents-section[open] summary::after,
.contents-toggle[aria-expanded="true"]::after {
  margin-top: 0.18rem;
  transform: rotate(225deg);
}
.contents-section[open] summary { color: var(--accent); }
.section-menu :is(a, summary):hover { background: #e9ecf3; }
.section-menu a[aria-current="location"] {
  color: #473c98;
  background: #e5e1f8;
  font-weight: 660;
}
.contents-children {
  margin: 0.12rem 0 0.35rem 0.72rem;
  padding-left: 0.43rem;
  border-left: 1px solid #d4daea;
}
.contents-children a { padding: 0.4rem 0.52rem; }
.contents-overview { font-weight: 640; }
.contents-roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.contents-category {
  grid-column: 1 / -1;
  margin: 0.55rem 0 0 0.52rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 640;
}
.contents-log {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.documents { min-width: 0; }
.document {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0 0.25rem 1rem #13284c08;
  padding: clamp(1.3rem, 4.3vw, 3.25rem);
}
.document + .document { margin-top: 2.25rem; }
.document-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 1.25rem;
}
.document-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3.3vw, 2.25rem);
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.download {
  min-height: 2.5rem;
  border-color: #d8d3ee;
  color: #4c4298;
  background: #fbfaff;
}
.download:hover { background: var(--accent-soft); }

.doc-body {
  color: #263145;
  font-size: 1rem;
  line-height: 1.78;
  overflow-wrap: anywhere;
}
.doc-body p { margin: 0 0 0.95rem; }
.doc-body > :first-child { margin-top: 0; }
.doc-body p a {
  font-weight: 590;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.doc-body p a:hover { color: #342c78; text-decoration-thickness: 2px; }
.overview-intro {
  margin-bottom: 1.65rem !important;
  padding: 0.95rem 1.1rem;
  border-left: 3px solid #8d7ed6;
  border-radius: 0 0.45rem 0.45rem 0;
  background: #f5f3ff;
  font-size: 1.045rem;
}
.doc-body section { min-width: 0; }
.doc-body section + section {
  margin-top: 2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}
.doc-body h3 {
  margin: 0 0 0.65rem;
  color: #20283b;
  font-size: clamp(1.28rem, 2.6vw, 1.6rem);
  letter-spacing: -0.018em;
  line-height: 1.35;
}
.doc-body section:target h3 { color: var(--accent); }
.doc-body h4 {
  margin: 1.55rem 0 0.54rem;
  color: #2a344a;
  font-size: 1.07rem;
  line-height: 1.45;
}
.doc-body [data-custom-style="Deck"] {
  color: #58667d;
  font-weight: 560;
}
.doc-body [data-custom-style="Small"] {
  color: #56647b;
  font-size: 0.92rem;
}
.doc-body [data-custom-style="Meta"] {
  color: var(--muted);
  font-size: 0.94rem;
}
.table-wrap {
  margin: 0.78rem 0 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.62rem;
  max-width: 100%;
  overflow-x: auto;
}
.table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  text-align: left;
  line-height: 1.6;
}
.table-wrap.wide table { min-width: 35rem; }
.table-wrap.extra-wide table { min-width: 41rem; }
.table-wrap :is(th, td) {
  padding: 0.72rem 0.8rem;
  vertical-align: top;
  border-bottom: 1px solid #e3e7ef;
}
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap thead th {
  background: #edf0f8;
  color: #293650;
  font-weight: 680;
}
.table-wrap tbody tr:nth-child(even) { background: #f8f9fc; }
.table-wrap :is(th, td) p { margin: 0; }
.table-wrap :is(th, td) p + p { margin-top: 0.42rem; }
.log .table-wrap tbody td:nth-child(2) { white-space: nowrap; }
.log .table-wrap tbody td:first-child {
  color: #283657;
  font-weight: 655;
  font-variant-numeric: tabular-nums;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding-block: 1.3rem;
}
.footer a { text-underline-offset: 0.22em; }

@media (max-width: 54rem) {
  .wrap { width: min(var(--container), calc(100% - 2.5rem)); }
  .reading { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1.45rem; }
  .contents {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: var(--paper);
  }
  .contents-toggle:not([hidden]) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: #374263;
    font: inherit;
    font-weight: 660;
    cursor: pointer;
  }
  .contents-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  .contents-toggle:not([hidden])[aria-expanded="false"] + .section-menu { display: none; }
  .contents-toggle:not([hidden]) + .section-menu .contents-title { display: none; }
  .section-menu { padding: 0.35rem 0.55rem 0.65rem; }

}

@media (max-width: 42rem) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; padding-block: 2.7rem 2.25rem; }
  .hero-meta { margin-bottom: 0.9rem; }
  .match { max-width: 30rem; }
  .match-board { min-height: 7.25rem; aspect-ratio: 2.5; }
  .player { width: 1.95rem; }
  .side { gap: 0.52rem; }
  .document + .document { margin-top: 1.4rem; }
  .doc-body h4 { margin-top: 1.2rem; }
  .table-wrap :is(th, td) { padding: 0.58rem 0.62rem; }
  .stack-mobile table, .stack-mobile tbody { display: block; min-width: 0 !important; }
  .stack-mobile colgroup { display: none; }
  .stack-mobile thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .stack-mobile tbody tr {
    display: grid;
    row-gap: 0.4rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e3e7ef;
  }
  .stack-mobile tbody tr:last-child { border-bottom: 0; }
  .stack-mobile tbody td { border: 0; padding: 0; }
  .portfolio .stack-mobile tbody tr { row-gap: 0.65rem; }
  .portfolio .stack-mobile tbody td::before {
    content: attr(data-label);
    display: block;
    color: #525e78;
    font-size: 0.86rem;
    font-weight: 670;
  }
  .log .stack-mobile tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
  }
  .log .table-wrap tbody td:nth-child(2) { color: #5a5979; font-size: 0.87rem; }
  .log .table-wrap tbody td:last-child { grid-column: 1 / -1; }
}

@media (max-width: 28rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .site-name { gap: 0.47rem; font-size: 0.86rem; }
  .site-name::before { width: 0.61rem; }
  .top-links { gap: 0.08rem; }
  .top-links a { padding-inline: 0.46rem; }
  .topbar-inner { gap: 0.35rem; }
  .hero-inner { padding-inline: 0.28rem; }
  .hero h1 { font-size: clamp(2.57rem, 10.6vw, 3rem); }
  .document { padding: 1.15rem 0.9rem; }
}

.class-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.6rem;
}
.class-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--accent);
  font-weight: 620;
  text-decoration: none;
}
.class-jump a:hover { background: var(--accent-soft); }
.doc-body .class-card {
  margin-top: 1.25rem;
  padding: clamp(0.9rem, 3vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.class-card:target {
  border-color: #8d7ed6;
  box-shadow: 0 0 0 2px #edeafd;
}
.class-role {
  display: inline-block;
  margin-left: 0.65rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 575;
  letter-spacing: normal;
}
.class-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0 1.15rem;
}
.class-stats div {
  padding: 0.5rem 0.65rem;
  background: #f5f3ff;
  border-radius: 0.45rem;
}
.class-stats dt { color: var(--muted); font-size: 0.875rem; }
.class-stats dd { margin: 0; font-weight: 620; }
.class-card p:last-child { margin-bottom: 0; }

@media (max-width: 42rem) {
  .class-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 28rem) {
  .top-links a { padding-inline: 0.32rem; font-size: 0.875rem; }
}
@media (max-width: 22rem) {
  .site-name::before { display: none; }
  .topbar-inner { gap: 0.15rem; }
  .top-links { gap: 0; }
  .top-links a { padding-inline: 0.24rem; }
}
