@import url("./common-overrides.css");
@import url("./cn-vs-worlds-table-fix.css");

/* CN vs JP 1:3 homepage banner */
body #past-tournaments .cn-jp-card.gradient-banner-card::before {
  background-image:
    linear-gradient(90deg, rgba(7,14,28,.68), rgba(7,14,28,.34) 52%, rgba(7,14,28,.10)),
    url('/tournaments/cn-vs-jp/blab13.webp?v=20260613-cnvsjp-blab13') !important;
  background-size: cover, cover !important;
  background-position: center, center center !important;
  background-repeat: no-repeat !important;
}

/* CN vs JP 1:4 page header */
body:has(a[href="https://www.iyingdi.com/tz/post/5609636"]) .tournament-hero {
  background: #071421 !important;
}

body:has(a[href="https://www.iyingdi.com/tz/post/5609636"]) .tournament-hero-image {
  display: block !important;
  content: url('/tournaments/cn-vs-jp/blab14.webp?v=20260613-cnvsjp-blab14-direct') !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Keep every page's return link label consistent. */
.back-link {
  font-size: 0 !important;
}

.back-link::after {
  content: "メインページに戻る";
  font-size: 12px;
  line-height: 1.4;
}

/* Remove redundant tournament category labels from these archive headers. */
body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .archive-hero .eyebrow-wrap,
body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero > .eyebrow {
  display: none !important;
}

/* About cards should use solid black rather than muted gray. */
#about .profile-card h2,
#about .profile-card p,
#about .contact-card h2,
#about .contact-card p {
  color: #111 !important;
}

#about .contact-card .contact-ja-title {
  margin: 6px 0 14px;
  font-weight: 900;
}

/* Choujousen overview and rules copy should use solid black. */
body:has(.choujousen-hero) .overview-text p,
body:has(.choujousen-hero) .overview-text strong {
  color: #111 !important;
}

/* Timewalk Dream Match overview heading cleanup. */
body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .score-card:has(.archive-rule-list) > .section-title {
  font-size: 0 !important;
}

body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .score-card:has(.archive-rule-list) > .section-title::after {
  content: "大会概要とルール";
  font-size: 16px;
}

body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .overview-subsection > .mini-section-title {
  display: none !important;
}

/* Ura Choujousen overview cleanup. */
body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .score-card:has(.archive-rule-list) > .section-title {
  font-size: 0 !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .score-card:has(.archive-rule-list) > .section-title::after {
  content: "大会概要とルール";
  font-size: 16px;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .overview-subsection > .mini-section-title {
  display: none !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .overview-subsection {
  margin-top: 18px;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .overview-subsection:first-child {
  margin-top: 0;
}

/* Restore the Players heading and the original closed accordion. */
body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .overview-subsection:last-child > .mini-section-title {
  display: block !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details {
  width: calc(100% - 28px) !important;
  margin: 0 auto !important;
  overflow: hidden !important;
  background: #fffaf2 !important;
  border: 1px solid rgba(24,33,40,.12) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-soft) !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details::before {
  content: none !important;
  display: none !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details > summary {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 18px;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details:not([open]) > .players-details-body {
  display: none !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details[open] > .players-details-body {
  display: block !important;
  padding: 0 0 16px !important;
  border-top: 1px solid rgba(24,33,40,.1) !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details .table-wrap {
  width: calc(100% - 28px) !important;
  margin: 0 auto !important;
  overflow-x: auto !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details table {
  display: table !important;
  width: 100% !important;
  min-width: 760px !important;
  margin: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
  background: transparent !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details thead {
  display: table-header-group !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) #players-body {
  display: table-row-group !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) #players-body tr {
  display: table-row !important;
  box-shadow: var(--shadow-soft) !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) #players-body td {
  display: table-cell !important;
  padding: 12px !important;
  color: var(--text-primary) !important;
  background: #fffaf2 !important;
  border-top: 1px solid rgba(24,33,40,.08) !important;
  border-bottom: 1px solid rgba(24,33,40,.16) !important;
  text-align: center !important;
  white-space: nowrap !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) #players-body td:first-child {
  text-align: left !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) #players-body td.info-cell {
  white-space: normal !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .players-details .archive-note {
  margin: 10px 14px 0 !important;
  color: var(--text-muted) !important;
}

/* Timewalk Dream Match: emphasize the rewind match game4 column. */
body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .archive-table th:nth-child(7) {
  color: #2b1c00 !important;
  background: linear-gradient(180deg, #f1d77e, #d8ad3c) !important;
  border-left: 2px solid #b47a0e !important;
  border-right: 2px solid #b47a0e !important;
  font-weight: 950 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .archive-table th:nth-child(7)::after {
  content: "運命巻き戻しマッチ";
  display: block;
  margin-top: 2px;
  color: #6f4700;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
  line-height: 1.1;
}

body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .archive-table td:nth-child(7) {
  color: #7f2634 !important;
  background: #fff1bd !important;
  border-left: 2px solid #c18b20 !important;
  border-right: 2px solid #c18b20 !important;
  font-weight: 950 !important;
}

body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .archive-table tbody tr.winner-row td:nth-child(7) {
  background: #ffd96a !important;
  color: #5f1b27 !important;
}

body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .archive-table tbody tr:hover td:nth-child(7) {
  background: #ffe7a0 !important;
}

body:has(a[href="https://tonamel.com/competition/cC1Zi"]) .archive-table tbody tr.winner-row:hover td:nth-child(7) {
  background: #ffd96a !important;
}

/* Ura Choujousen: red-black glowing tournament header. */
body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .hero.archive-hero {
  position: relative !important;
  overflow: hidden !important;
  padding: 48px 24px 44px !important;
  text-align: center !important;
  background: linear-gradient(135deg,#1a0a0e 0%,#0a0e1a 50%,#1a0a0e 100%) !important;
  border: 1px solid rgba(255,59,48,.34) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 48px rgba(5,12,20,.34), inset 0 1px 0 rgba(255,255,255,.04) !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .hero.archive-hero::before {
  content: "" !important;
  position: absolute !important;
  inset: -45% 12% auto !important;
  height: 240px !important;
  background: radial-gradient(ellipse,rgba(255,59,48,.20) 0%,rgba(255,59,48,.07) 38%,transparent 72%) !important;
  pointer-events: none !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero .back-link {
  position: absolute !important;
  top: 16px !important;
  left: 50% !important;
  z-index: 2 !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 4px 16px !important;
  color: #aaa !important;
  background: rgba(255,255,255,.025) !important;
  border: .5px solid #555 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero .back-link::after {
  color: #aaa !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero .back-link:hover {
  color: #ddd !important;
  background: rgba(255,255,255,.06) !important;
  border-color: #777 !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero h1 {
  position: relative !important;
  z-index: 1 !important;
  margin: 24px 0 0 !important;
  color: #fff !important;
  font-size: clamp(38px,5.5vw,52px) !important;
  font-weight: 500 !important;
  letter-spacing: .05em !important;
  line-height: 1.3 !important;
  text-shadow: 0 0 12px rgba(255,80,80,.60),0 0 30px rgba(255,80,80,.30) !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero h1 .accent-red {
  display: inline-block !important;
  padding: 0 14px !important;
  margin: 0 8px !important;
  color: #fff !important;
  background: #ff3b30 !important;
  transform: skewX(-8deg) !important;
  box-shadow: 0 0 25px rgba(255,59,48,.90),0 0 60px rgba(255,59,48,.50) !important;
  text-shadow: none !important;
}

body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero .title-line {
  display: none !important;
}

@media (max-width: 640px) {
  body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .hero.archive-hero {
    padding: 46px 14px 36px !important;
  }

  body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero h1 {
    margin-top: 20px !important;
    font-size: clamp(28px,9vw,40px) !important;
    letter-spacing: .025em !important;
    white-space: nowrap !important;
  }

  body:has(a[href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQaazuDWzeaqukUZLdh5o-bB-k52toXUy_P6KDx7XxNPl_RX4o0xUSeZdhiyOObu_z1ij9cjvpdumBf/pubhtml"]) .archive-hero h1 .accent-red {
    padding: 0 8px !important;
    margin: 0 4px !important;
  }
}