.tournament-summary-modal:has(> .tournament-summary-panel--champion) { z-index: 1600; }

.tournament-summary-panel--champion {
  --champion-safe-x: max(10px, var(--safe-inline, 0px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --champion-height: calc(100dvh - max(9px, env(safe-area-inset-top, 0px)) - max(9px, var(--safe-bottom, 0px), env(safe-area-inset-bottom, 0px)));
  box-sizing: border-box;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
  align-content: center;
  gap: clamp(6px, 1.6vmin, 12px);
  width: min(1040px, calc(100dvw - 2 * var(--champion-safe-x)));
  min-height: min(480px, var(--champion-height));
  max-height: var(--champion-height);
  padding: clamp(10px, 2.7vmin, 24px);
  overflow-x: hidden;
  overscroll-behavior: contain;
  text-align: left;
  color: #fff4dc;
  border: 1px solid #efc987;
  border-radius: clamp(11px, 3vmin, 24px);
  background:
    linear-gradient(90deg, transparent 25%, #13091937 41%, #190b23dc 58%, #160a21fb),
    url('./assets/ui/holdem-champion-v07000.webp') left center / cover no-repeat #160a21;
  box-shadow: 0 0 36px #b67dce59, 0 24px 70px #000b, inset 0 0 0 3px #9c61344a;
}

.tournament-summary-panel--champion > [data-tournament-normal] { display: none !important; }
.tournament-summary-panel--champion > :not(.tournament-champion-confetti) {
  position: relative;
  grid-column: 2;
  z-index: 1;
  min-width: 0;
}
.tournament-champion-copy { animation: tournament-champion-arrive .46s ease-out both; }
.tournament-champion-event {
  margin: 0;
  color: #f9d996;
  font: 700 clamp(10px, 2.7vmin, 15px)/1.25 system-ui, sans-serif;
  letter-spacing: .07em;
}
.tournament-champion-copy h2 {
  width: max-content;
  margin: 0 0 .05em;
  color: #ffdda0;
  font: 850 clamp(36px, 14vmin, 86px)/1.08 Georgia, 'Yu Mincho', 'Hiragino Mincho ProN', 'Noto Serif CJK JP', serif;
  letter-spacing: .12em;
  text-shadow: 0 0 20px #df9d5c54;
}
.tournament-champion-copy h2:focus { outline: none; }
@supports (background-clip: text) {
  .tournament-champion-copy h2 {
    background: linear-gradient(178deg, #fff8da 11%, #ffe2a1 42%, #c68840 75%, #f6bf70 94%);
    background-clip: text;
    color: transparent;
  }
}
.tournament-champion-prize {
  display: flex;
  align-items: baseline;
  gap: clamp(5px, 1.7vmin, 12px);
  margin: 0 0 clamp(5px, 1.6vmin, 12px);
  border-block-end: 1px solid #dfb06877;
  padding-block-end: clamp(4px, 1.3vmin, 10px);
  color: #f6d5a0;
  font-size: clamp(11px, 2.9vmin, 15px);
}
.tournament-champion-prize strong {
  color: #fff3cf;
  font: 800 clamp(21px, 6.7vmin, 38px)/1.1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.tournament-champion-prize small { font-size: .85em; letter-spacing: .08em; }
.tournament-placement-awards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(4px, 1.15vmin, 8px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tournament-summary-panel > .tournament-placement-awards { margin-block: 8px; text-align: left; }
.tournament-placement-awards li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 1.6vmin, 12px);
  border: 1px solid #d8ad6570;
  border-radius: 8px;
  padding: 3px 8px;
  background: linear-gradient(110deg, #624071b0, #281733db 68%);
}
.tournament-placement-awards img {
  width: clamp(24px, 7.7vmin, 44px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.tournament-placement-awards small, .tournament-placement-awards b { display: block; }
.tournament-placement-awards small {
  color: #f1c78c;
  font: 700 clamp(9px, 2.6vmin, 12px)/1.12 system-ui, sans-serif;
  letter-spacing: .08em;
}
.tournament-placement-awards b { font: 750 clamp(11px, 3.1vmin, 16px)/1.28 system-ui, sans-serif; }
.tournament-champion-record { margin: 5px 0 0; color: #ffd6a9; font-size: 12px; }

.tournament-summary-panel--champion :is(.tournament-result-actions button, .flow-primary, #tournamentSummaryHand summary) {
  min-width: 0;
  min-height: clamp(32px, 9.6vmin, 44px);
  margin: 0;
  border: 1px solid #daa95f;
  border-radius: 8px;
  background: #261630;
  color: #fff0cd;
  padding: 5px 8px;
  font: 750 clamp(11px, 3.05vmin, 14px)/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.tournament-summary-panel--champion #tournamentSummaryHand { margin: 0; }
.tournament-summary-panel--champion #tournamentSummaryHand summary { box-sizing: border-box; align-content: center; }
.tournament-summary-panel--champion .tournament-result-actions { display: grid !important; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.tournament-summary-panel--champion .tournament-result-actions:has(button:first-child[hidden]) { grid-template-columns: minmax(0, 1fr); }
.tournament-summary-panel--champion :is(#tournamentSummaryReturn, .tournament-result-actions .flow-primary) {
  background: linear-gradient(135deg, #fce3ac, #e1aa5d 70%, #d19547) !important;
  border-image: none !important;
  color: #291426 !important;
  text-shadow: none;
  box-shadow: 0 3px 14px #d78e4752;
}
.tournament-summary-panel--champion :is(button, summary):focus-visible { outline: 2px solid #fff0c4; outline-offset: 2px; }

.tournament-champion-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: paint;
}
.tournament-champion-confetti::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(111deg, transparent 20%, #ffd2875c 49%, transparent 64%);
  animation: tournament-champion-light 1.65s ease-out both;
}
.tournament-champion-confetti i {
  position: absolute;
  inset-inline-start: var(--origin);
  inset-block-start: -13px;
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(125deg, #fff7d9, #edbb6c 57%, #986123);
  animation: tournament-champion-fall var(--duration) var(--delay) cubic-bezier(.29,.31,.72,.89) both;
}
.tournament-champion-confetti i:nth-child(3n) { background: #c293f4; width: 6px; height: 7px; }
.tournament-champion-confetti i:nth-child(5n) { background: #96f2da; width: 4px; height: 8px; }

@keyframes tournament-champion-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tournament-champion-light {
  0% { opacity: 0; transform: translateX(-75%); }
  35% { opacity: .72; }
  100% { opacity: 0; transform: translateX(44%); }
}
@keyframes tournament-champion-fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
  9%, 68% { opacity: .92; }
  100% { opacity: 0; transform: translate3d(var(--drift), min(110dvh, 515px), 0) rotate(340deg); }
}

@media (min-width: 940px) {
  .tournament-placement-awards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) and (orientation: landscape) {
  .tournament-summary-panel--champion .tournament-result-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (orientation: portrait) {
  .tournament-summary-panel--champion {
    grid-template-columns: minmax(0, 1fr);
    align-content: end;
    width: min(460px, calc(100dvw - 2 * var(--champion-safe-x)));
    padding-top: min(40dvh, 290px);
    background:
      linear-gradient(180deg, transparent 24%, #160a2159 37%, #160a21 54%),
      url('./assets/ui/holdem-champion-v07000.webp') 14% top / auto min(49dvh, 370px) no-repeat #160a21;
  }
  .tournament-summary-panel--champion > :not(.tournament-champion-confetti) { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tournament-champion-copy { animation: none; }
  .tournament-champion-confetti { display: none; }
}
