/* 確定KVモックの左右対称ブラケット。既存トップのテーマとは独立して配色する。 */
.tournament-shell {
  container-type: inline-size;
}
.tournament {
  position: relative;
  isolation: isolate;
  padding: 48px 3% 36px;
  background: #060b13;
  color: #fff;
  overflow: hidden;
}
.tournament__game-info .tournament__round {
  display: none;
}
.tournament__arena {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) blur(3px);
  opacity: .16;
  z-index: -3;
}
.tournament:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,#0251ad66,transparent 35%,transparent 65%,#cf132d55),linear-gradient(0deg,#04080e99,#04080e33);
  z-index: -2;
}
.tournament__heading {
  text-align: center;
  margin: 0 auto 25px;
}
.tournament__heading img {
  width: 290px;
  margin: auto;
  filter: drop-shadow(0 6px 20px #0008);
}
.tournament__heading h2 {
  font-size: 17px;
  letter-spacing: .12em;
  margin: 12px 0 0;
}
.tournament__bracket {
  position: relative;
  isolation: isolate;
  height: 550px;
  max-width: 1320px;
  margin: auto;
}
.tournament__side {
  z-index: 1;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36%;
}
.tournament__side.tournament__left {
  left: 0;
}
.tournament__side.tournament__right {
  right: 0;
}
.tournament__team {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: absolute;
  left: 0;
  right: 0;
  height: 68px;
  display: flex;
  align-items: center;
  background: linear-gradient(100deg,#001b37,var(--team-color));
  border: 1px solid #d4e2f0;
  box-shadow: 0 4px 16px #0005;
  overflow: hidden;
}
.tournament__team:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg,#fff0 0px,#fff2 1px,#fff0 2px,#0001 4px);
  opacity: .35;
}
.tournament__team.tournament__first {
  top: 0;
}
.tournament__team.tournament__second {
  top: 170px;
}
.tournament__team.tournament__seed {
  top: 410px;
}
.tournament__mark {
  align-self: stretch;
  background: white;
  width: 68px;
  flex-shrink: 0;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.tournament__mark img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tournament__team-name {
  font-size: clamp(17px,2.1cqw,30px);
  line-height: 1.2;
  font-weight: 900;
  flex: 1;
  text-align: center;
  padding: 8px 5px;
  white-space: nowrap;
}
.tournament__right .tournament__team {
  flex-direction: row-reverse;
}
.tournament__score {
  display: none;
  font: 40px/1 Impact,sans-serif;
  padding: 0 15px;
  z-index: 1;
}
.tournament.has-result .tournament__score:not(:empty) {
  display: block;
}
.tournament.has-result .tournament__team.is-loser {
  opacity: .48;
}
.tournament.has-result .tournament__team.is-winner {
  border: 2px solid #fff;
  box-shadow: 0 0 16px #ffffff35;
}
.tournament__game-info {
  position: absolute;
  top: 82px;
  left: 0;
  right: 0;
  text-align: center;
}
.tournament__date {
  font: 58px/.95 Impact,'Arial Narrow',sans-serif;
  letter-spacing: -.02em;
}
.tournament__date em {
  font: 700 14px/1 system-ui;
  font-style: normal;
  letter-spacing: 0;
  color: #f82b47;
  margin: 0 5px;
}
.tournament__date .tournament__time {
  font-size: 32px;
  letter-spacing: -.02em;
}
.tournament__venue {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 6px;
  font-weight: 700;
}
.tournament__round {
  display: block;
  font-size: 10px;
  color: #d6dce7;
  margin-bottom: 6px;
  letter-spacing: .12em;
}
.tournament__semi {
  position: absolute;
  top: 294px;
  left: 0;
  right: 0;
  text-align: center;
}
.tournament__semi .tournament__date {
  font-size: 64px;
}
.tournament__semi .tournament__date .tournament__time {
  font-size: 35px;
}
.tournament__semi .tournament__venue {
  font-size: 14px;
}
.tournament__advance {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  color: #fff;
  background: #0b1c30c9;
  padding: 4px;
}
.tournament.has-result .tournament__advance:not(:empty) {
  display: block;
}
.tournament__final-date {
  display: contents;
}
.tournament__final {
  position: absolute;
  left: 39%;
  right: 39%;
  top: 90px;
  text-align: center;
  z-index: 2;
}
.tournament__trophy {
  display: block;
  width: clamp(82px, 10cqw, 146px);
  height: 190px;
  object-fit: contain;
  object-position: bottom;
  margin: 0 auto 16px;
  filter: drop-shadow(0 8px 16px #0009);
}
.tournament__final .tournament__round {
  font-size: 11px;
}
.tournament__final .tournament__date {
  font-size: 90px;
  white-space: nowrap;
}
.tournament__final .tournament__year {
  display: block;
  font: 24px/1 Impact,sans-serif;
  margin-bottom: 7px;
}
.tournament__final .tournament__date em {
  font-size: 17px;
}
.tournament__final .tournament__time {
  font: 52px/1 Impact,sans-serif;
  margin-top: 10px;
}
.tournament__final .tournament__venue {
  font-size: 26px;
  white-space: nowrap;
}
.tournament__final-teams {
  display: none;
  font-size: 11px;
  margin-top: 15px;
  color: #e0e7ef;
}
.tournament.has-result .tournament__final-teams:not(:empty) {
  display: block;
}
.tournament__wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.tournament__wire {
  fill: none;
  stroke: #eaf1fa;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}
.tournament__footnote {
  max-width: 1320px;
  margin: 25px auto 0;
  display: flex;
  justify-content: space-between;
  color: #c4ccd8;
  font-size: 11px;
  border-top: 1px solid #ffffff2b;
  padding-top: 14px;
}
.tournament.is-revealed .tournament__team {
  animation: tournament-appear .65s both;
}
.tournament.is-revealed .tournament__second {
  animation-delay: .12s;
}
.tournament.is-revealed .tournament__seed {
  animation-delay: .24s;
}
.tournament.is-revealed .tournament__wire {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: tournament-trace 1.5s .45s ease-out forwards;
}
.tournament.is-revealed .tournament__final {
  animation: tournament-appear .9s 1.1s both;
}
.tournament.is-running .tournament__team:before {
  content: "";
  position: absolute;
  inset: -100% -60%;
  background: linear-gradient(100deg,transparent 40%,#fff4 49%,transparent 58%);
  transform: translateX(-75%);
  animation: tournament-gloss-cycle 6s linear infinite;
  pointer-events: none;
  z-index: 3;
}
@keyframes tournament-gloss-cycle {
  0% {
    transform: translateX(-75%);
  }
  20%,100% {
    transform: translateX(75%);
  }
}
@keyframes tournament-trace {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes tournament-appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.tournament__pulse {
  fill: none;
  stroke: #9fdfff;
  stroke-width: 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 12 100;
  stroke-dashoffset: 12;
  opacity: 0;
  filter: drop-shadow(0 0 5px #62caff) drop-shadow(0 0 11px #90dfff);
}
.tournament.is-running .tournament__pulse {
  animation: tournament-inward-pulse 6s 2.1s linear infinite;
}
@keyframes tournament-inward-pulse {
  0% {
    stroke-dashoffset: 12;
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  10% {
    stroke-dashoffset: -100;
    opacity: 1;
  }
  12%,100% {
    stroke-dashoffset: -100;
    opacity: 0;
  }
}
.tournament__mobile-wires {
  display: none;
}
.tournament__team:hover {
  border-color: white;
  filter: brightness(1.18);
}
.tournament__team:focus-visible {
  outline: 3px solid #9fdfff;
  outline-offset: 4px;
  z-index: 4;
}
/* モーション設定は実行中に切り替えた場合も反映する。JSなしでも内容は静止表示する。 */
@media (prefers-reduced-motion: reduce) {
  .tournament *, .tournament *::before {
    animation: none !important;
  }
  .tournament__wire {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
  .tournament__pulse {
    opacity: 0 !important;
  }
}
/* 小画面の接続線にも初回の描画演出を付ける。 */
.tournament.is-revealed .tournament__mobile-track {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: tournament-trace 1.5s .45s ease-out forwards;
}

/* 得点・勝ち上がりを追記してもチーム名と次のカードが重ならない。 */
.tournament.has-result .tournament__team-name {
  min-width: 0;
  font-size: clamp(15px, 1.8cqw, 26px);
}
.tournament.has-result .tournament__semi {
  top: 275px;
}
.tournament.has-result .tournament__semi .tournament__date {
  font-size: 50px;
}
.tournament.has-result .tournament__semi .tournament__venue {
  font-size: 13px;
}
.tournament.has-result .tournament__advance {
  font-size: 11px;
  margin-top: 4px;
  padding: 2px;
}

/* 塁側は各山から決勝につながる最後の枝に添える。 */
.tournament__bench {
  position: absolute;
  top: 258px;
  left: 122%;
  width: 60px;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
  color: #aeb9c9;
}
.tournament__right .tournament__bench { left: -22%; }
.tournament__bench-note {
  max-width: 1320px;
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 12px;
  color: #aeb9c9;
}
.tournament__bench-note a { flex-shrink: 0; text-underline-offset: 4px; }

/* モバイルも1回戦・シード・決勝までの枝線を保ち、左右の山を同時に見せる。 */
@container (max-width: 800px) {
  .tournament { padding: 24px 18px 22px; }
  .tournament__arena { opacity: .11; filter: grayscale(1) blur(2px); }
  .tournament:before {
    background: linear-gradient(110deg,#10336755,transparent 45%,#60203533),linear-gradient(0deg,#04080edd,#04080e33);
  }
  .tournament__heading { margin-bottom: 24px; }
  .tournament__heading img { width: 112px; }
  .tournament__heading h2 { font-size: 10px; letter-spacing: .17em; margin-top: 10px; }
  .tournament__bracket {
    height: auto;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 0 16px;
  }
  .tournament__side {
    position: relative;
    width: 100%;
    height: 322px;
    top: auto;
    bottom: auto;
  }
  .tournament__left { grid-column: 1; grid-row: 1; }
  .tournament__right { grid-column: 2; grid-row: 1; }
  .tournament__team {
    left: 0;
    right: auto;
    width: 80%;
    height: 34px;
    gap: 5px;
    padding: 5px;
    background: linear-gradient(100deg,#0b1729,color-mix(in srgb,var(--team-color),#07101f 30%));
    border: 1px solid #bdcee455;
    box-shadow: 0 4px 10px #0002;
    overflow: hidden;
  }
  .tournament__right .tournament__team { left: auto; right: 0; }
  .tournament__team.tournament__first { top: 56px; }
  .tournament__team.tournament__second { top: 110px; }
  .tournament__team.tournament__seed { top: 244px; }
  .tournament__mark {
    align-self: center;
    width: 20px;
    height: 23px;
    padding: 2px;
  }
  .tournament__team-name,
  .tournament.has-result .tournament__team-name {
    min-width: 0;
    font-size: clamp(9px,2.3cqw,14px);
    line-height: 1.4;
    font-weight: 700;
    padding: 0;
    text-align: left;
    white-space: normal;
  }
  .tournament__right .tournament__team-name { text-align: right; }
  .tournament__game-info,
  .tournament__semi,
  .tournament.has-result .tournament__semi {
    width: 80%;
    left: 0;
    right: auto;
  }
  .tournament__game-info { top: 0; }
  .tournament__semi, .tournament.has-result .tournament__semi { top: 174px; }
  .tournament__right :is(.tournament__game-info,.tournament__semi) { left: auto; right: 0; }
  .tournament__round,
  .tournament__game-info .tournament__round {
    display: block;
    font-size: 8px;
    color: #98a9be;
    line-height: 1.6;
    margin-bottom: 0;
  }
  .tournament__date,
  .tournament__semi .tournament__date,
  .tournament.has-result .tournament__semi .tournament__date {
    font: 800 clamp(15px,3.85cqw,24px)/1.6 var(--jp);
    white-space: nowrap;
    letter-spacing: .02em;
  }
  .tournament__date em { font: 500 8px/1.6 var(--jp); margin: 0 2px; }
  .tournament__date .tournament__time,
  .tournament__semi .tournament__date .tournament__time { font-size: 8px; font-weight: 500; letter-spacing: 0; }
  .tournament__venue,
  .tournament__semi .tournament__venue,
  .tournament.has-result .tournament__semi .tournament__venue {
    font-size: clamp(7px,1.8cqw,11px);
    line-height: 1.5;
    color: #a1afc2;
    font-weight: 500;
    margin-top: 0;
  }
  .tournament__wires { display: none; }
  .tournament__mobile-wires {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 322px;
    overflow: visible;
    pointer-events: none;
    z-index: -1;
  }
  .tournament__right .tournament__mobile-wires { transform: scaleX(-1); }
  .tournament__mobile-track {
    fill: none;
    stroke: #c7d4e5;
    stroke-width: 1.15;
    vector-effect: non-scaling-stroke;
  }
  .tournament__pulse { stroke-width: 1.5; }
  .tournament__side .tournament__bench {
    top: auto;
    bottom: 9px;
    left: 50%;
    width: 50px;
    font-size: 9px;
    line-height: 16px;
    background: #0c1422;
  }
  .tournament__final {
    position: relative;
    grid-column: 1 / -1;
    left: auto;
    right: auto;
    top: auto;
    width: 78%;
    max-width: 260px;
    margin: auto;
    padding: 11px 8px 10px;
    border-top: 1px solid #ccd7e999;
    border-bottom: 1px solid #ccd7e933;
    background: linear-gradient(120deg,#29416322,#46618a22);
  }
  .tournament__trophy { display: none; }
  .tournament__final .tournament__round { font-size: 8px; letter-spacing: .12em; }
  .tournament__final-date { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
  .tournament__final .tournament__year { font: 500 11px/1.5 var(--jp); margin: 0; letter-spacing: .08em; }
  .tournament__final .tournament__date { font: 800 30px/1.5 var(--jp); letter-spacing: .02em; }
  .tournament__final .tournament__date em { font-size: 10px; }
  .tournament__final .tournament__time { font: 800 15px/1.5 var(--jp); margin: 0 0 0 4px; }
  .tournament__final .tournament__venue { font-size: 10px; font-weight: 500; letter-spacing: .18em; }
  .tournament__bench-note { display: block; font-size: 9px; line-height: 1.8; margin-top: 22px; color: #8595ac; }
  .tournament__bench-note a { display: inline-block; font-size: 10px; margin-top: 10px; }
  .tournament__footnote { display: block; font-size: 9px; line-height: 1.7; margin-top: 20px; }
  .tournament__footnote span { display: block; margin-top: 6px; }
  .tournament.has-result .tournament__score { font-size: 12px; padding: 0 2px; }
  .tournament.has-result .tournament__advance { font-size: 8px; line-height: 1.4; margin-top: 2px; padding: 1px; }
  .tournament__final-teams { font-size: 9px; margin-top: 8px; }
}
@container (max-width: 350px) {
  .tournament { padding-left: 12px; padding-right: 12px; }
  .tournament__bracket { column-gap: 12px; }
  .tournament__team { gap: 3px; padding: 4px 3px; }
  .tournament__mark { width: 18px; height: 21px; }
  .tournament__team-name, .tournament.has-result .tournament__team-name { font-size: 8px; }
  .tournament__date, .tournament__semi .tournament__date,
  .tournament.has-result .tournament__semi .tournament__date { font-size: 14px; }
  .tournament__date em, .tournament__date .tournament__time,
  .tournament__semi .tournament__date .tournament__time { font-size: 7px; }
  .tournament__final { width: 84%; }
}
