.lightbox-trigger { cursor: zoom-in; }

.photo-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(0, 0, 0, .9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.photo-lightbox.is-open { opacity: 1; visibility: visible; }
.photo-lightbox.is-team-card { background: rgba(5, 11, 22, .9); }
.photo-lightbox > img { display: block; max-width: 100%; max-height: calc(100vh - 48px); border-radius: 12px; object-fit: contain; box-shadow: 0 18px 70px rgba(0,0,0,.45); }
.photo-lightbox button { position: fixed; z-index: 2; top: 14px; right: 16px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #e4e7eb; color: #080a08; font-size: 2rem; line-height: 1; cursor: pointer; }
.photo-lightbox .team-card-viewer-content { display: none; width: 100%; }
.photo-lightbox .team-card-viewer-content { position: relative; }
.photo-lightbox.is-team-card > img { display: none; }
.photo-lightbox.is-team-card .team-card-viewer-content { display: grid; place-items: center; }
.team-card-viewer-nav { display: none; }
body.lightbox-open { overflow: hidden; }
@media(max-width:640px) {
  .photo-lightbox { align-items: center; padding: 64px 14px 18px; }
  .photo-lightbox.is-team-card .team-card-viewer-content {
    position: fixed;
    inset: 56px 14px 8px;
    grid-template-rows: minmax(0, 1fr) 44px;
    align-content: stretch;
    justify-items: center;
    touch-action: pan-y;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card {
    width: auto;
    height: min(74vh, calc(100dvh - 150px));
    max-width: calc(100vw - 36px);
    max-height: calc(100dvh - 150px);
    aspect-ratio: .68;
    touch-action: pan-y;
  }
  .photo-lightbox.is-team-card .team-card-viewer-nav {
    display: grid;
    width: min(260px, 80vw);
    height: 42px;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    justify-items: center;
  }
  .photo-lightbox.is-team-card .team-card-viewer-arrow {
    position: static;
    top: auto;
    right: auto;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.82);
    font-size: 1.7rem;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,.16);
    backdrop-filter: blur(6px);
  }
  .team-card-viewer-arrow:disabled { opacity: .34; cursor: default; }
  .team-card-viewer-arrow:not(:disabled):active { transform: scale(.94); }
  .team-card-viewer-position {
    color: rgba(255,255,255,.72);
    font-size: .64rem;
    font-weight: 650;
    letter-spacing: .025em;
    text-align: center;
    white-space: nowrap;
  }
}
@media(prefers-reduced-motion:reduce) {
  .photo-lightbox { transition: none; }
}

/* Expanded coach cards: editorial collectible look, with name and biography
   remaining live DOM text so the normal content editor can still change them. */
@media(max-width:640px) {
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card {
    width: min(88vw, 390px);
    height: auto;
    max-height: calc(100dvh - 150px);
    aspect-ratio: .68;
    position: relative;
    overflow: hidden;
    border: 1px solid #d5b765;
    border-radius: 16px;
    background: #08162b;
    box-shadow: 0 24px 64px #0009, inset 0 0 0 1px #fff1;
    color: #fff;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card::before {
    z-index: 5;
    inset: 7px;
    border: 1px solid #f0d58a99;
    border-radius: 11px;
    pointer-events: none;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card::after {
    z-index: 1;
    background:
      linear-gradient(180deg, #07132672 0%, #07132608 30%, #07132620 48%, #071326bd 69%, #071326fa 100%),
      linear-gradient(90deg, #07132615 0%, #07132600 48%, #0713268c 100%);
    pointer-events: none;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card .team-portrait {
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #152640;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card .team-portrait img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    object-position: center 25%;
    filter: saturate(.72) contrast(1.08);
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card .team-portrait::after {
    z-index: 1;
    background:
      linear-gradient(180deg, #08152b45 0%, transparent 27%, #08152b08 47%, #08152bba 72%, #08152bf5 100%),
      radial-gradient(ellipse at 50% 44%, transparent 24%, #08152b65 100%);
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-card-masthead {
    z-index: 3;
    top: 22px;
    right: 22px;
    left: 22px;
    display: flex;
    min-height: 76px;
    align-items: flex-start;
    gap: 8px;
    padding: 0 68px 0 0;
    color: #f1d18a;
    font-size: .48rem;
    letter-spacing: .17em;
    text-shadow: 0 2px 8px #07152c;
    white-space: normal;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-card-masthead img {
    width: 72px;
    height: 62px;
    object-position: left top;
    filter: brightness(0) invert(1) drop-shadow(0 2px 7px #07152ccc);
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-card-masthead span {
    align-self: flex-end;
    margin: 0 0 7px -4px;
    font-size: .43rem;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-card-number {
    top: 2px;
    right: 0;
    padding: 5px 7px;
    border-color: #d5b765b8;
    border-radius: 3px;
    background: #071326b8;
    color: #f1d18a;
    font-size: .58rem;
    letter-spacing: .1em;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-card-tactics {
    z-index: 3;
    top: 34%;
    right: auto;
    left: 22px;
    width: 66px;
    height: 88px;
    padding: 6px;
    border-color: #f1d18a99;
    border-radius: 3px;
    background: #0a1830a8;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card .ace-card-tactics::before {
    border-color: #f1d18acc;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-card-stats {
    z-index: 3;
    top: 30%;
    right: 20px;
    bottom: 37%;
    width: 72px;
    gap: 7px;
    padding: 5px 0 5px 8px;
    border-left-color: #f1d18acc;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-stat {
    gap: 2px;
    padding: 4px 5px;
    border: 1px solid #f1d18a38;
    border-radius: 3px;
    background: #071326b8;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-stat b {
    color: #f1d18a;
    font-size: 1.08rem;
    line-height: 1;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .mobile-card-expanded .ace-stat small {
    color: #fff;
    font-size: .4rem;
    letter-spacing: .04em;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card h3 {
    z-index: 3;
    right: 37%;
    bottom: 16.5%;
    left: 8%;
    height: 2em;
    max-height: 2em;
    padding: 0;
    border: 0;
    background: none;
    color: #f1d18a;
    font-size: clamp(1.25rem, 5.6vw, 1.8rem);
    font-weight: 950;
    letter-spacing: -.045em;
    line-height: .98;
    text-shadow: 0 3px 14px #071326;
    -webkit-line-clamp: 2;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card p {
    z-index: 3;
    right: 8%;
    bottom: 5%;
    left: 8%;
    max-height: 3.4em;
    padding: 5px 8px;
    border: 1px solid #d5b76599;
    border-left: 2px solid #d5b765;
    border-radius: 4px;
    background: #071326e8;
    color: #f3f4f6;
    font-size: clamp(.62rem, 2.6vw, .72rem);
    line-height: 1.18;
    text-shadow: 0 1px 5px #071326;
    -webkit-line-clamp: 3;
  }
  /* The supplied transparent frame is a reversible overlay. The live portrait,
     coach name and explanation remain in the DOM underneath / above it. */
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame {
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame::before {
    content: none;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame::after {
    background:
      linear-gradient(180deg, #0713263b 0%, #07132600 34%, #07132615 61%, #0713269c 100%);
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame .ace-card-masthead,
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame .ace-card-number,
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame .ace-card-tactics,
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame .ace-card-stats {
    display: none;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame .coach-card-frame-art {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame h3,
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card.use-premium-frame p {
    z-index: 6;
  }
  .photo-lightbox.is-team-card .team-card-viewer-content .team-card.mobile-card-expanded.ace-card [data-content-kind="text"] {
    cursor: text;
    touch-action: pan-y;
  }
}

.legal-content{max-width:780px;margin:0 auto}.legal-content h1{font-size:clamp(3rem,6vw,5.5rem);margin:12px 0 52px}.legal-content h2{margin:32px 0 8px;font-size:1.15rem;line-height:1.15;letter-spacing:-.025em}.legal-content p{max-width:680px;margin:0;color:var(--gray);font-size:1rem}.legal-content p:last-child{margin-top:38px}

/* Keep the collectible frame visible on the roster cards before opening them. */
.team-roster article.ace-card.use-premium-frame {
  height: auto;
  aspect-ratio: 2 / 3;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.team-roster article.ace-card.use-premium-frame::before { content: none; }
.team-roster article.ace-card.use-premium-frame .team-portrait {
  inset: 0;
  height: 100%;
  border-radius: 0;
}
.team-roster article.ace-card.use-premium-frame .ace-card-masthead,
.team-roster article.ace-card.use-premium-frame .ace-card-number,
.team-roster article.ace-card.use-premium-frame .ace-card-tactics,
.team-roster article.ace-card.use-premium-frame .ace-card-stats { display: none; }
.team-roster article.ace-card.use-premium-frame .coach-card-frame-art {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.team-roster article.ace-card.use-premium-frame h3 {
  z-index: 6;
  right: 37%;
  bottom: 15.5%;
  left: 8%;
  height: 2.1em;
  max-height: 2.1em;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f1d18a;
  font-size: clamp(.68rem, 1.4vw, .9rem);
  line-height: 1;
  text-shadow: 0 2px 8px #071326;
  -webkit-line-clamp: 2;
}
.team-roster article.ace-card.use-premium-frame p {
  z-index: 6;
  right: 8%;
  bottom: 4%;
  left: 8%;
  max-height: 3.8em;
  padding: 3px 5px;
  border-radius: 2px;
  background: #071326b8;
  color: #f3f4f6;
  font-size: clamp(.44rem, .8vw, .64rem);
  line-height: 1.22;
  -webkit-line-clamp: 3;
}
@media(max-width:640px) {
  .team-roster { height: 260px; }
  .team-roster article.ace-card.use-premium-frame {
    top: 17px;
    width: clamp(126px, 36vw, 146px);
    height: auto;
    aspect-ratio: 2 / 3;
  }
  .team-roster article.ace-card.use-premium-frame p { display: none; }
  .team-roster article.ace-card.use-premium-frame h3 {
    bottom: 15.5%;
    font-size: clamp(.68rem, 2.3vw, .82rem);
  }
}
@media(max-width:380px) {
  .team-roster { height: 245px; }
  .team-roster article.ace-card.use-premium-frame { width: 126px; }
}

/* Desktop expanded state: keep editable coach copy inside the frame's
   nameplate and lower information panel. The mobile composition above stays
   untouched. */
@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
  .team-roster article.ace-card.use-premium-frame:hover h3,
  .team-roster article.ace-card.use-premium-frame:focus-visible h3 {
    z-index: 6;
    right: 37%;
    bottom: 15.5%;
    left: 8%;
    display: -webkit-box;
    height: 2.1em;
    max-height: 2.1em;
    overflow: hidden;
    color: #f1d18a;
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    line-height: .98;
    text-shadow: 0 3px 14px #071326;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .team-roster article.ace-card.use-premium-frame:hover p,
  .team-roster article.ace-card.use-premium-frame:focus-visible p {
    z-index: 6;
    right: 8%;
    bottom: 4.5%;
    left: 8%;
    display: -webkit-box;
    max-height: 4.5em;
    overflow: hidden;
    padding: 7px 10px;
    border: 1px solid #d5b76599;
    border-left: 3px solid #d5b765;
    border-radius: 5px;
    background: #071326e8;
    color: #f3f4f6;
    font-size: clamp(.76rem, 1.05vw, .9rem);
    line-height: 1.25;
    text-shadow: 0 1px 5px #071326;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }
}
