/* Championship celebration. Transform and opacity only.
   Near-black, graphite, white, PTL red. No particles. */

.ptl-celeb {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding:
    max(10px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  overflow: hidden;
  color: #f4f1ea;
  animation: ptl-celeb-in 280ms ease both;
}

.ptl-celeb--l1,
.ptl-celeb--l2 {
  background: radial-gradient(120% 80% at 50% 18%, #1c222b 0%, #07090c 62%);
}

.ptl-celeb__panel {
  box-sizing: border-box;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: auto;
}

.ptl-celeb__stage {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.ptl-celeb__tail {
  flex: 0 0 auto;
  width: min(720px, 100%);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ptl-celeb__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  flex: 0 0 auto;
  width: 100%;
}

.ptl-celeb__logo {
  height: 22px;
  width: auto;
  flex: 0 0 auto;
  display: block;
}

.ptl-celeb__close {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 44px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #c6ccd4;
  cursor: pointer;
  font: 700 12px/1 'Saira', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ptl-celeb__title {
  margin: 0;
  width: min(920px, 100%);
  flex: 0 0 auto;
  min-width: 0;
  text-align: center;
  font: 700 clamp(22px, 3.4vw, 48px)/1.05 'Saira', 'Inter', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  animation: ptl-celeb-title 480ms ease both;
}

.ptl-celeb__sub {
  margin: 4px 0 0;
  width: min(720px, 100%);
  text-align: center;
  color: #c6ccd4;
  font: 700 clamp(12px, 1.5vw, 16px)/1.3 'Saira', 'Inter', sans-serif;
  letter-spacing: 0.14em;
}

.ptl-celeb__art {
  flex: 0 0 auto;
  width: 100%;
  height: min(50vh, 480px);
  display: grid;
  place-items: center;
  margin: 6px 0 4px;
  overflow: hidden;
}

.ptl-celeb__art .ptl-award-svg {
  width: auto;
  height: 100%;
  max-width: min(92vw, 440px);
}

.ptl-celeb__art .ptl-award-svg--cup { height: 84%; }
.ptl-celeb__art:has(.ptl-award-svg--medal) { height: auto; margin: 0; }
.ptl-celeb__art .ptl-award-svg--medal { height: min(40vh, 360px); max-width: min(70vw, 280px); }
.ptl-celeb[data-stage="4"] .ptl-award-svg--medal { height: 100%; max-height: 100%; }

.ptl-celeb__art:has(.ptl-celeb__preview) {
  height: auto;
  max-height: min(34vh, 300px);
  margin: 0;
}

.ptl-celeb__preview {
  display: block;
  width: 100%;
  height: 100%;
  max-width: min(100%, 560px);
  max-height: min(34vh, 300px);
  object-fit: contain;
}

.ptl-award-sweep {
  transform: translateX(-80px);
  opacity: 0;
  animation: ptl-award-sweep 1.05s ease 0.28s 1 both;
}

.ptl-celeb__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 22px;
  margin: 0;
  width: 100%;
}

.ptl-celeb__stats div { text-align: center; min-width: 64px; }

.ptl-celeb__stats dt {
  margin: 0;
  color: #8b95a3;
  font: 700 11px/1 'Saira', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ptl-celeb__stats dd {
  margin: 5px 0 0;
  color: #f4f1ea;
  font: 700 clamp(15px, 1.6vw, 18px)/1.15 'Saira', 'Inter', sans-serif;
  letter-spacing: 0.02em;
}

.ptl-celeb__guest {
  margin: 0;
  max-width: 36em;
  text-align: center;
  color: #9aa3ad;
  font: 500 13px/1.4 'Inter', sans-serif;
}

.ptl-celeb__claim {
  flex: 0 0 auto;
  width: min(420px, 100%);
  min-height: 52px;
  border: 0;
  background: #e3263b;
  color: #fff;
  cursor: pointer;
  font: 700 15px/1 'Saira', sans-serif;
  letter-spacing: 0.12em;
}

.ptl-celeb__actions {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ptl-celeb__row {
  width: 100%;
  display: flex;
  gap: 8px;
}

.ptl-celeb__claim:focus-visible,
.ptl-celeb__text:focus-visible,
.ptl-celeb__link:focus-visible,
.ptl-celeb__close:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}

.ptl-celeb__confirm {
  margin: 0;
  width: min(420px, 100%);
  text-align: center;
  color: #c6ccd4;
  font: 500 13px/1.35 'Inter', sans-serif;
}

.ptl-celeb__confirm b,
.ptl-celeb__confirm span { display: block; }

.ptl-celeb__confirm b {
  color: #f4f1ea;
  font: 700 15px/1.25 'Saira', sans-serif;
  letter-spacing: 0.04em;
}

.ptl-celeb__text {
  flex: 1 1 0;
  min-height: 44px;
  border: 1px solid #3a424c;
  background: transparent;
  color: #f3f4f5;
  cursor: pointer;
  font: 700 12px/1.2 'Saira', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ptl-celeb__link {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #c6ccd4;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: 500 14px/1 'Inter', sans-serif;
}

.ptl-celeb--l3 {
  inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  width: min(440px, calc(100vw - 24px));
  height: auto;
  padding: 0;
  background: transparent;
  pointer-events: none;
  animation: ptl-celeb-toast 280ms ease both;
}

.ptl-celeb--l3 .ptl-celeb__panel {
  pointer-events: auto;
  height: auto;
  overflow: visible;
  padding: 12px 14px;
  background: #12161c;
  border: 1px solid #2a313b;
}

.ptl-celeb--l3 .ptl-celeb__bar { min-height: 28px; }
.ptl-celeb--l3 .ptl-celeb__stage {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  align-items: center;
  justify-content: stretch;
}
.ptl-celeb--l3 .ptl-celeb__title {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  text-align: left;
  font-size: 16px;
  animation: none;
}
.ptl-celeb--l3 .ptl-celeb__sub {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  margin: 2px 0 0;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.ptl-celeb--l3 .ptl-celeb__art {
  grid-column: 1;
  grid-row: 1 / span 3;
  height: auto;
  margin: 0;
}
.ptl-celeb--l3 .ptl-award-svg,
.ptl-celeb--l3 .ptl-award-svg--medal { height: 84px; max-width: 72px; }
.ptl-celeb--l3 .ptl-celeb__tail {
  grid-column: 2;
  grid-row: 3;
  width: auto;
  align-items: stretch;
}
.ptl-celeb--l3 .ptl-celeb__stats { justify-content: flex-start; gap: 8px 12px; }
.ptl-celeb--l3 .ptl-celeb__stats div { text-align: left; }
.ptl-celeb--l3 .ptl-celeb__stats dd { font-size: 13px; }
.ptl-celeb--l3 .ptl-celeb__guest { text-align: left; font-size: 12px; }
.ptl-celeb--l3 .ptl-celeb__claim { width: 100%; min-height: 42px; }

body:has(#ptl-celeb) #ptl-award-toast { display: none !important; }

@media (max-width: 700px) {
  .ptl-celeb__claim,
  .ptl-celeb__actions,
  .ptl-celeb__confirm { width: 100%; }
  .ptl-trophy-head { flex-direction: column; align-items: flex-start; }
  .ptl-trophy .ptl-trophy-lead { text-align: left; max-width: none; }
}

@media (max-height: 700px) and (min-width: 700px) {
  .ptl-celeb__stage { justify-content: flex-start; }
  .ptl-celeb__art { height: min(42vh, 320px); }
}

@media (max-height: 640px) and (max-width: 699px) {
  .ptl-celeb__stage { justify-content: flex-start; }
  .ptl-celeb__art { height: min(38vh, 210px); }
  .ptl-celeb__title { font-size: clamp(18px, 5.4vw, 28px); }
  .ptl-celeb__claim { min-height: 46px; }
}

.ptl-celeb[data-stage="4"] .ptl-celeb__art { height: min(28vh, 260px); }
.ptl-celeb[data-stage="4"] .ptl-celeb__confirm { margin: 0; }
@media (max-height: 820px) {
  .ptl-celeb[data-stage="4"] .ptl-celeb__art { height: min(24vh, 200px); }
  .ptl-celeb[data-stage="4"] .ptl-celeb__title { font-size: clamp(18px, 5vw, 28px); }
  .ptl-celeb[data-stage="4"] .ptl-celeb__stats { gap: 6px 14px; }
  .ptl-celeb[data-stage="4"] .ptl-celeb__stats dd { margin-top: 2px; }
}
@media (max-height: 640px) {
  .ptl-celeb[data-stage="4"] .ptl-celeb__art { height: min(18vh, 120px); }
  .ptl-celeb[data-stage="4"] .ptl-celeb__guest { font-size: 12px; }
}

@media (max-height: 520px) {
  .ptl-celeb--l1 .ptl-celeb__stage,
  .ptl-celeb--l2 .ptl-celeb__stage {
    display: grid;
    grid-template-columns: minmax(120px, 32vw) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
    justify-content: stretch;
    width: 100%;
  }
  .ptl-celeb--l1 .ptl-celeb__title,
  .ptl-celeb--l2 .ptl-celeb__title {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    font-size: clamp(18px, 4.4vh, 28px);
  }
  .ptl-celeb--l1 .ptl-celeb__sub,
  .ptl-celeb--l2 .ptl-celeb__sub {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }
  .ptl-celeb--l1 .ptl-celeb__art,
  .ptl-celeb--l2 .ptl-celeb__art {
    grid-column: 1;
    grid-row: 1 / span 3;
    height: min(48vh, 100%);
    margin: 0;
  }
  .ptl-celeb--l1 .ptl-celeb__tail,
  .ptl-celeb--l2 .ptl-celeb__tail {
    grid-column: 2;
    grid-row: 3;
    align-items: flex-start;
    width: 100%;
  }
  .ptl-celeb--l1 .ptl-celeb__stats,
  .ptl-celeb--l2 .ptl-celeb__stats { justify-content: flex-start; }
  .ptl-celeb--l1 .ptl-celeb__stats div,
  .ptl-celeb--l2 .ptl-celeb__stats div { text-align: left; }
  .ptl-celeb--l1 .ptl-award-svg,
  .ptl-celeb--l2 .ptl-award-svg { max-width: 32vw; max-height: 100%; }
  .ptl-celeb--l1 .ptl-celeb__actions,
  .ptl-celeb--l2 .ptl-celeb__actions { width: min(420px, 100%); }
}

@keyframes ptl-celeb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ptl-celeb-title {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes ptl-celeb-toast {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes ptl-award-sweep {
  0% { transform: translateX(-80px); opacity: 0; }
  25% { opacity: 0.9; }
  100% { transform: translateX(210px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ptl-celeb,
  .ptl-celeb *,
  .ptl-award-sweep {
    animation: none !important;
    transition: none !important;
  }
}

/* Trophy case collectible cards. */
.ptl-trophy { max-width: none; width: 100%; }
.ptl-trophy h1 {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(22px, 3vw, 28px);
}
.ptl-trophy .ptl-trophy-lead {
  max-width: 28em;
  text-align: right;
  color: #9aa3ad;
  font: 500 13px/1.4 'Inter', sans-serif;
}
.ptl-record-band b.is-empty {
  color: #8b95a3;
  font: 600 15px/1.2 'Inter', sans-serif;
  letter-spacing: 0;
}
.ptl-case-section { margin: 22px 0 10px; }
.ptl-case-section h2,
.ptl-trophy h2 {
  margin: 0 0 10px;
  font: 700 13px/1 'Saira', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c6ccd4;
}
.ptl-case-empty {
  margin: 0 0 12px;
  color: #8b95a3;
  font: 500 14px/1.4 'Inter', sans-serif;
}
.ptl-case-grid,
.ptl-medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.ptl-case-card,
.ptl-medal-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 300px;
  padding: 18px 14px 16px;
  border: 1px solid #2a313b;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0) 42%), #14181e;
  color: #f3f4f5;
  text-align: center;
  cursor: pointer;
}
.ptl-medal-tile { cursor: default; min-height: 280px; }
.ptl-case-card[data-metal="gold"],
.ptl-medal-tile[data-metal="gold"] { border-color: #c6a15a; box-shadow: inset 0 0 0 1px rgba(198, 161, 90, 0.35); }
.ptl-case-card[data-metal="silver"],
.ptl-medal-tile[data-metal="silver"] { border-color: #b7c2cb; box-shadow: inset 0 0 0 1px rgba(183, 194, 203, 0.35); }
.ptl-case-card[data-metal="bronze"],
.ptl-medal-tile[data-metal="bronze"] { border-color: #a86a3c; box-shadow: inset 0 0 0 1px rgba(168, 106, 60, 0.4); }
.ptl-case-card .ptl-award-svg,
.ptl-medal-tile .ptl-award-svg { height: 168px; width: auto; max-width: 100%; }
.ptl-case-card b,
.ptl-medal-tile b { font: 700 15px/1.2 'Saira', sans-serif; letter-spacing: 0.03em; }
.ptl-case-card span,
.ptl-medal-tile span { color: #9aa3ad; font: 500 12px/1.35 'Inter', sans-serif; }
.ptl-case-count {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
  padding: 4px 8px;
  background: #0c1016;
  border: 1px solid #3a424c;
  color: #f4f1ea;
  font: 700 13px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0;
}
.ptl-medal-tile.is-locked { opacity: 0.72; }
.ptl-medal-tile.is-locked .ptl-award-svg { opacity: 0.55; }
.ptl-case-detail { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ptl-case-detail .ptl-award-svg { height: min(42vh, 280px); width: auto; }
.ptl-case-history, .ptl-case-bracket {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  width: min(640px, 100%);
  list-style: none;
  text-align: left;
}
.ptl-case-history li, .ptl-case-bracket li {
  padding: 10px 12px;
  border: 1px solid #2a313b;
  background: #12161c;
  color: #d7dbe0;
  font: 500 14px/1.35 'Inter', sans-serif;
}
.ptl-case-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ptl-case-actions button, .ptl-case-actions a {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a424c;
  background: transparent;
  color: #f3f4f5;
  text-decoration: none;
  cursor: pointer;
  font: 700 12px/1 'Saira', sans-serif;
  letter-spacing: 0.06em;
}
.ptl-case-actions .is-primary { background: #e3263b; border-color: #e3263b; }

@media (max-width: 700px) {
  .ptl-case-grid,
  .ptl-medal-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ptl-case-card,
  .ptl-medal-tile { min-height: 240px; padding: 12px 8px; }
  .ptl-case-card .ptl-award-svg,
  .ptl-medal-tile .ptl-award-svg { height: 120px; }
  .ptl-case-card b,
  .ptl-medal-tile b { font-size: 13px; }
}

/* Official award art: the <picture> wrapper stays out of layout so existing
   .ptl-award-svg sizing applies to the <img>. Fallback SVG lives in a <template>. */
.ptl-award-pic { display: contents; }
img.ptl-award-img { display: block; width: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.ptl-award-fallback { display: none; }
.ptl-celeb__art img.ptl-award-img:not(.ptl-award-img--medal) { max-height: min(calc(50vh - 8px), 480px); }
