/* Open Play tab (public/open-play.js). Builds on the Clubs page styles in
   clubs.css: hero, cards and empty states come from there. */

.open-play-section-title {
  margin: 18px 16px 0;
  color: var(--clubs-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.open-play-card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.open-play-card-status .club-card-role {
  margin-left: 0;
}

.open-play-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.open-play-status--live {
  background: #fde8e8;
  color: #c81e1e;
}

.open-play-status--live::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.open-play-status--upcoming {
  background: var(--clubs-blue-soft);
  color: var(--clubs-blue);
}

a.clubs-create-button {
  text-decoration: none;
}

.open-play-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 14px 16px 0;
  color: var(--clubs-blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.open-play-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Long Open Play titles ellipsize instead of widening the card. */
.open-play-page .clubs-results {
  grid-template-columns: minmax(0, 1fr);
}

.open-play-card .club-card-body > * {
  min-width: 0;
}

/* The CourtCast Open-Play logo in the hero. */
.open-play-hero-text {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.open-play-logo {
  display: block;
  width: min(170px, 46vw);
  height: auto;
}

.open-play-hero-heading {
  margin: 0;
  line-height: 0;
}

.open-play-hero-heading .open-play-logo {
  width: min(210px, 52vw);
}

/* ---- Scan QR code to check in ------------------------------------------ */
.op-checkin-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 16px;
  padding: 20px 16px 22px;
  border-radius: 20px;
  background: #0b1c2c;
  color: #ffffff;
  text-align: center;
}

.op-checkin-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.op-checkin-brand .open-play-logo { width: min(170px, 48vw); }

.op-checkin-club-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: #1e3a5f;
  font-weight: 800;
}

.op-checkin-club-avatar img { width: 100%; height: 100%; object-fit: cover; }

.op-checkin-cta {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.op-checkin-club {
  margin: 0;
  color: #7dd3fc;
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}

.op-checkin-meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.op-checkin-qr {
  display: block;
  width: min(260px, 70vw);
  margin-top: 10px;
  padding: 6px;
  border-radius: 14px;
  background: #ffffff;
}

.op-checkin-qr svg { display: block; width: 100%; height: auto; }
/* venues.css outlines every svg (stroke: currentColor) for line icons; on a
   QR code that white outline covers the dark modules and blanks the code. */
.qr-code, .qr-code * { stroke: none; }

.op-checkin-link {
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #0b1c2c;
  font-weight: 800;
  text-decoration: none;
}

/* ---- Player view ------------------------------------------------------- */
.op-player-view { display: grid; gap: 12px; margin: 12px 16px 24px; }

.op-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--clubs-blue-soft, #e8f0ff);
}

.op-status-name { margin: 0; font-weight: 800; }
.op-status-line { margin: 2px 0 0; color: var(--clubs-blue, #1d4ed8); font-size: 13px; font-weight: 700; }

.op-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.op-tabs::-webkit-scrollbar { display: none; }

.op-tabs button {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid #dbe2ec;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.op-tabs button[aria-selected="true"] { border-color: #0b1c2c; background: #0b1c2c; color: #ffffff; }

.op-empty { margin: 8px 0; color: var(--clubs-muted, #64748b); font-size: 14px; }

.op-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  object-fit: cover;
}

.op-avatar-stack { display: inline-flex; }
.op-avatar-stack .op-avatar + .op-avatar { margin-left: -8px; }

.op-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.op-court-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  background: #ffffff;
}

.op-card--mine { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18); }

.op-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; font-size: 13px; }

.op-badge {
  padding: 1px 7px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.op-badge--live { border-color: #fca5a5; color: #c81e1e; }

.op-pairing { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px; }
.op-vs { color: #94a3b8; font-size: 10px; font-weight: 800; }

.op-team { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.op-team--b { justify-items: end; text-align: right; }
.op-team-names { display: grid; min-width: 0; font-size: 12px; font-weight: 700; line-height: 1.25; }
.op-team-names > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-team[data-outcome="lost"] .op-team-names { color: #94a3b8; font-weight: 600; }
.op-team[data-outcome="lost"] .op-avatar { opacity: 0.6; }
.op-me { color: #1d4ed8; }

.op-player-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.op-player-group h3,
.op-board-category h3 { margin: 4px 0 6px; color: var(--clubs-muted, #64748b); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.op-player-group ul,
.op-board { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }

.op-player-group li,
.op-board li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #e5e9f0;
  border-radius: 10px;
  background: #ffffff;
  font-size: 12px;
}

.op-me-row { border-color: #2563eb !important; background: #eff6ff !important; }
.op-player-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.op-player-state { flex: 0 0 auto; color: #64748b; font-size: 10px; }

.op-board li { font-size: 13px; padding: 6px 10px; }
.op-rank { width: 20px; flex: 0 0 auto; color: #64748b; font-weight: 800; text-align: center; }
.op-record { font-weight: 700; font-variant-numeric: tabular-nums; }
.op-diff { width: 42px; color: #2563eb; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.op-board-category + .op-board-category { margin-top: 12px; }
.op-note { margin: 6px 0 0; color: #64748b; font-size: 11px; }

.op-results { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.op-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  background: #ffffff;
}

.op-result-center { display: grid; justify-items: center; gap: 2px; }
.op-result-center span { color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.op-result-center strong { color: #2563eb; font-size: 26px; font-weight: 900; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }


/* ==========================================================================
   COURTCAST OPEN PLAY HERO LOGO 2026-09-24

   Replaces only the /open-play listing hero text title with the official
   CourtCast Open-Play lockup. Navigation and back-link labels are unchanged.
   ========================================================================== */

.open-play-hero-brand {
  display: flex;
  align-items: center;

  width: auto;
  max-width: min(220px, 60vw);

  min-height: 38px;

  margin: 0;
  padding: 0;

  line-height: 1;
}

.open-play-hero-logo {
  display: block;

  width: auto;
  height: 42px;
  max-width: 100%;

  object-fit: contain;
  object-position: left center;

  user-select: none;
  -webkit-user-drag: none;
}

/* Phone layout */
@media (max-width: 620px) {
  .open-play-hero-brand {
    max-width: min(190px, 58vw);
    min-height: 34px;
  }

  .open-play-hero-logo {
    height: 36px;
  }
}

/* Narrow phones */
@media (max-width: 390px) {
  .open-play-hero-brand {
    max-width: min(170px, 56vw);
  }

  .open-play-hero-logo {
    height: 33px;
  }
}


/* ==========================================================================
   COURTCAST OPEN PLAY HERO — CSS REFINED LOCKUP 2026-09-24
   ========================================================================== */

/*
 * Open Play listing hero only.
 *
 * The supplied PNG contains transparent vertical space. Instead of altering
 * the source artwork, the image is rendered larger inside a clipped title
 * viewport so its visible lettering matches the former Open Play heading.
 */

.clubs-hero:has(.open-play-hero-brand) {
  padding:
    10px
    max(15px, env(safe-area-inset-right))
    10px
    max(15px, env(safe-area-inset-left));

  border-radius: 0 0 22px 22px;

  background:
    radial-gradient(
      100% 135% at 82% 100%,
      rgba(57, 168, 255, 0.40),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      #063d72 0%,
      #074c8c 24%,
      #0864b6 58%,
      #328fdf 100%
    );

  box-shadow:
    0 8px 20px rgba(3, 41, 84, 0.17),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(255,255,255,0.14);
}


/* --------------------------------------------------------------------------
   HERO TOP ROW
   -------------------------------------------------------------------------- */

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top {
  align-items: center;

  min-height: 42px;

  gap: 10px;
}


/* --------------------------------------------------------------------------
   OPEN PLAY LOCKUP

   The PNG is approximately 3:1 but has transparent space above/below the
   artwork. The outer element acts as a crop window.
   -------------------------------------------------------------------------- */

.clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
  position: relative;

  display: block;

  width: 188px;
  max-width: 51vw;
  height: 38px;
  min-height: 38px;

  margin: 0;
  padding: 0;

  overflow: hidden;

  line-height: 1;
}

.clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
  position: absolute;

  top: 50%;
  left: 0;

  display: block;

  width: 188px;
  max-width: none;
  height: auto;

  transform:
    translateY(-50%)
    scale(1.62);

  transform-origin: left center;

  object-fit: contain;
  object-position: left center;

  filter:
    drop-shadow(0 1px 0 rgba(255,255,255,0.12))
    drop-shadow(0 2px 4px rgba(0,29,72,0.12));

  user-select: none;
  -webkit-user-drag: none;
}


/* --------------------------------------------------------------------------
   SUBTITLE
   -------------------------------------------------------------------------- */

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top p {
  margin: 1px 0 0;

  color: rgba(255,255,255,0.91);

  font-size: 12px;
  font-weight: 550;
  line-height: 1.2;
}


/* --------------------------------------------------------------------------
   CREATE OPEN-PLAY BUTTON

   The earlier Clubs compact-layout CSS intentionally hid button text.
   Open Play needs the label visible, but much smaller than the logo.
   -------------------------------------------------------------------------- */

.clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
  display: inline-flex !important;

  width: auto !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;

  flex: 0 0 auto;

  align-items: center;
  justify-content: center;

  gap: 4px;

  margin: 0;

  padding:
    0
    9px !important;

  border:
    1px solid rgba(255,255,255,0.58);

  border-radius: 999px !important;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.98) 0%,
      rgba(225,244,255,0.95) 100%
    );

  color: #0755a8;

  box-shadow:
    0 4px 11px rgba(0,34,79,0.16),
    inset 0 1px 0 rgba(255,255,255,0.96);
}

.clubs-hero:has(.open-play-hero-brand)
.clubs-create-button .profile-edit-icon {
  display: block !important;

  width: auto !important;
  height: auto !important;

  margin: 0 !important;

  font-size: 18px !important;
  font-weight: 400;
  line-height: 1;
}

.clubs-hero:has(.open-play-hero-brand)
.clubs-create-button > span:last-child {
  display: inline !important;

  font-size: 9px !important;
  font-weight: 750;
  line-height: 1;

  letter-spacing: -0.01em;

  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   MOBILE
   -------------------------------------------------------------------------- */

@media (max-width: 620px) {

  .clubs-hero:has(.open-play-hero-brand) {
    padding:
      9px
      max(14px, env(safe-area-inset-right))
      9px
      max(14px, env(safe-area-inset-left));
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    width: 176px;
    max-width: 48vw;

    height: 36px;
    min-height: 36px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    width: 176px;

    transform:
      translateY(-50%)
      scale(1.62);
  }

  .clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
    height: 32px !important;
    min-height: 32px !important;

    gap: 3px;

    padding-inline: 8px !important;
  }

  .clubs-hero:has(.open-play-hero-brand)
  .clubs-create-button .profile-edit-icon {
    font-size: 17px !important;
  }

  .clubs-hero:has(.open-play-hero-brand)
  .clubs-create-button > span:last-child {
    font-size: 8.5px !important;
  }
}


/* --------------------------------------------------------------------------
   NARROW PHONE
   -------------------------------------------------------------------------- */

@media (max-width: 390px) {

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    width: 164px;
    max-width: 47vw;

    height: 34px;
    min-height: 34px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    width: 164px;
  }

  .clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
    padding-inline: 7px !important;
  }

  .clubs-hero:has(.open-play-hero-brand)
  .clubs-create-button > span:last-child {
    font-size: 8px !important;
  }
}


/* ==========================================================================
   COURTCAST OPEN PLAY — RESPONSIVE RANGE FIX 2026-09-24

   Supported viewport intent:
   - small Android / iPhone portrait
   - phone landscape
   - tablet portrait
   - tablet landscape
   - max CourtCast application content width: 900px
   ========================================================================== */


/* --------------------------------------------------------------------------
   PAGE WIDTH

   Undo the Clubs pages original 720px ceiling for Open Play.
   900px matches the existing CourtCast application shell.
   -------------------------------------------------------------------------- */

#profile-app.clubs-page:has(.open-play-hero-brand) {
  width: 100%;
  max-width: 900px;

  margin-right: auto;
  margin-left: auto;

  box-sizing: border-box;
}


/* --------------------------------------------------------------------------
   LOGO

   IMPORTANT:
   Remove the previous crop-window technique.

   No overflow:hidden.
   No absolute positioning.
   No scale().
   The full official lockup is always visible.
   -------------------------------------------------------------------------- */

.clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
  position: static;

  display: flex;

  flex: 1 1 auto;

  align-items: center;

  width: auto;
  max-width: 255px;

  height: auto;
  min-height: 0;

  margin: 0;
  padding: 0;

  overflow: visible;

  line-height: 1;
}

.clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
  position: static;

  top: auto;
  left: auto;

  display: block;

  width: 100%;
  max-width: 245px;

  height: auto;

  transform: none;

  object-fit: contain;
  object-position: left center;

  filter:
    drop-shadow(0 1px 0 rgba(255,255,255,.14))
    drop-shadow(0 2px 4px rgba(0,27,65,.13));
}


/* --------------------------------------------------------------------------
   HERO

   Same navy family as CourtCast header at the top, fading down into blue.
   -------------------------------------------------------------------------- */

.clubs-hero:has(.open-play-hero-brand) {
  width: 100%;

  box-sizing: border-box;

  padding:
    10px
    max(16px, env(safe-area-inset-right))
    10px
    max(16px, env(safe-area-inset-left));

  background:
    radial-gradient(
      90% 140% at 88% 100%,
      rgba(69,177,255,.35),
      transparent 63%
    ),
    linear-gradient(
      180deg,
      #063d72 0%,
      #07457f 22%,
      #07589f 48%,
      #1474c5 72%,
      #45a0eb 100%
    );

  box-shadow:
    0 8px 22px rgba(3,39,80,.18),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(255,255,255,.14);
}


/* Hero first row: logo left, Create Open-Play right. */

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  min-height: 45px;
}


/* Subtitle stays directly underneath the full logo. */

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top p {
  margin: 2px 0 0;

  color: rgba(255,255,255,.92);

  font-size: 12px;
  font-weight: 550;
  line-height: 1.2;
}


/* --------------------------------------------------------------------------
   CREATE OPEN-PLAY BUTTON

   It remains a real button. Keep label visible but secondary.
   -------------------------------------------------------------------------- */

.clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
  display: inline-flex !important;

  flex: 0 0 auto;

  width: auto !important;
  min-width: 0 !important;

  height: 34px !important;
  min-height: 34px !important;

  align-items: center;
  justify-content: center;

  gap: 4px;

  margin: 0;

  padding: 0 10px !important;

  border:
    1px solid rgba(255,255,255,.62);

  border-radius: 999px !important;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.98),
      rgba(225,244,255,.95)
    );

  color: #0755a8;

  box-shadow:
    0 4px 12px rgba(0,34,79,.16),
    inset 0 1px 0 rgba(255,255,255,.96);
}

.clubs-hero:has(.open-play-hero-brand)
.clubs-create-button .profile-edit-icon {
  display: block !important;

  width: auto !important;
  height: auto !important;

  margin: 0 !important;

  font-size: 18px !important;
  line-height: 1;
}

.clubs-hero:has(.open-play-hero-brand)
.clubs-create-button > span:last-child {
  display: inline !important;

  font-size: 9px !important;
  font-weight: 750;
  line-height: 1;

  white-space: nowrap;
}


/* ==========================================================================
   PHONE PORTRAIT / SMALL ANDROID
   ========================================================================== */

@media (max-width: 430px) {

  #profile-app.clubs-page:has(.open-play-hero-brand) {
    max-width: none;
  }

  .clubs-hero:has(.open-play-hero-brand) {
    padding:
      9px
      max(12px, env(safe-area-inset-right))
      9px
      max(12px, env(safe-area-inset-left));
  }

  .clubs-hero:has(.open-play-hero-brand) .clubs-hero-top {
    gap: 7px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    flex: 1 1 0;

    min-width: 0;
    max-width: 205px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    width: 100%;
    max-width: 205px;
  }

  .clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
    height: 31px !important;
    min-height: 31px !important;

    padding-inline: 7px !important;

    gap: 3px;
  }

  .clubs-hero:has(.open-play-hero-brand)
  .clubs-create-button .profile-edit-icon {
    font-size: 16px !important;
  }

  .clubs-hero:has(.open-play-hero-brand)
  .clubs-create-button > span:last-child {
    font-size: 7.5px !important;
  }

  .clubs-hero:has(.open-play-hero-brand) .clubs-hero-top p {
    font-size: 11.5px;
  }
}


/* ==========================================================================
   EXTRA SMALL PHONES
   ========================================================================== */

@media (max-width: 350px) {

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    max-width: 175px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    max-width: 175px;
  }

  .clubs-hero:has(.open-play-hero-brand)
  .clubs-create-button > span:last-child {
    font-size: 7px !important;
  }
}


/* ==========================================================================
   PHONE LANDSCAPE

   Do not collapse back to the old 720px portrait-like width.
   ========================================================================== */

@media
  (min-width: 431px)
  and (max-width: 759px)
  and (orientation: landscape) {

  #profile-app.clubs-page:has(.open-play-hero-brand) {
    width: 100%;
    max-width: none;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    max-width: 225px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    max-width: 225px;
  }
}


/* ==========================================================================
   TABLET PORTRAIT
   ========================================================================== */

@media
  (min-width: 760px)
  and (orientation: portrait) {

  #profile-app.clubs-page:has(.open-play-hero-brand) {
    width: min(100%, 900px);
    max-width: 900px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    max-width: 235px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    max-width: 235px;
  }
}


/* ==========================================================================
   TABLET LANDSCAPE / DESKTOP PREVIEW

   900px is the CourtCast application maximum rather than allowing the page
   to become a desktop-sized website.
   ========================================================================== */

@media
  (min-width: 760px)
  and (orientation: landscape) {

  #profile-app.clubs-page:has(.open-play-hero-brand) {
    width: min(100%, 900px);
    max-width: 900px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    max-width: 245px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    max-width: 245px;
  }
}


/* ==========================================================================
   COURTCAST OPEN PLAY — HERO PROPORTION TUNE 2026-09-24
   ========================================================================== */

/*
 * Final proportion pass:
 * - full logo remains visible
 * - logo approaches previous Open Play heading visual size
 * - hero returns to compact height
 * - Create Open-Play remains visible but secondary
 */

.clubs-hero:has(.open-play-hero-brand) {
  gap: 2px;

  padding:
    7px
    max(15px, env(safe-area-inset-right))
    8px
    max(15px, env(safe-area-inset-left));

  background:
    radial-gradient(
      90% 150% at 92% 100%,
      rgba(63, 176, 255, .30),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      #063d72 0%,
      #07477f 25%,
      #0861aa 58%,
      #3b98e5 100%
    );
}


/* Logo/button row */

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top {
  min-height: 34px;

  gap: 10px;

  align-items: center;
}


/* Keep complete official artwork, just reduce its visual footprint. */

.clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
  flex: 0 1 auto;

  width: 185px;
  max-width: 43vw;

  height: auto;
  min-height: 0;

  overflow: visible;
}

.clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
  position: static;

  width: 100%;
  max-width: 185px;
  height: auto;

  transform: none;
}


/* Subtitle */

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top p {
  margin: 0;

  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.15;
}


/* Create Open-Play remains an action, not a second headline. */

.clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
  height: 29px !important;
  min-height: 29px !important;

  gap: 3px;

  padding: 0 8px !important;

  border-radius: 999px !important;
}

.clubs-hero:has(.open-play-hero-brand)
.clubs-create-button .profile-edit-icon {
  font-size: 15px !important;
}

.clubs-hero:has(.open-play-hero-brand)
.clubs-create-button > span:last-child {
  font-size: 7.5px !important;
  font-weight: 750;
}


/* --------------------------------------------------------------------------
   PHONE PORTRAIT
   -------------------------------------------------------------------------- */

@media (max-width: 430px) {

  .clubs-hero:has(.open-play-hero-brand) {
    padding:
      7px
      max(12px, env(safe-area-inset-right))
      7px
      max(12px, env(safe-area-inset-left));
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    width: 165px;
    max-width: 44vw;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    max-width: 165px;
  }

  .clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
    height: 28px !important;
    min-height: 28px !important;

    padding-inline: 7px !important;
  }

  .clubs-hero:has(.open-play-hero-brand)
  .clubs-create-button > span:last-child {
    font-size: 7px !important;
  }
}


/* --------------------------------------------------------------------------
   PHONE LANDSCAPE
   -------------------------------------------------------------------------- */

@media
  (min-width: 431px)
  and (max-width: 759px)
  and (orientation: landscape) {

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    width: 180px;
    max-width: 34vw;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    max-width: 180px;
  }
}


/* --------------------------------------------------------------------------
   TABLET
   -------------------------------------------------------------------------- */

@media (min-width: 760px) {

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-brand {
    width: 195px;
    max-width: 195px;
  }

  .clubs-hero:has(.open-play-hero-brand) .open-play-hero-logo {
    max-width: 195px;
  }

  .clubs-hero:has(.open-play-hero-brand) .clubs-create-button {
    height: 30px !important;
    min-height: 30px !important;
  }
}


/* ==========================================================================
   COURTCAST OPEN PLAY — DARK HERO GRADIENT FINAL 2026-09-24
   ========================================================================== */

/*
 * Match the CourtCast header navy at the top and transition gradually
 * downward without turning into the previous bright sky-blue.
 */

.clubs-hero:has(.open-play-hero-brand) {
  background:
    radial-gradient(
      100% 150% at 92% 105%,
      rgba(45, 139, 219, 0.24),
      transparent 62%
    ),
    radial-gradient(
      75% 120% at 8% 100%,
      rgba(21, 106, 185, 0.18),
      transparent 65%
    ),
    linear-gradient(
      180deg,
      #063d72 0%,
      #073f76 18%,
      #084a82 42%,
      #0b5a96 68%,
      #166eae 100%
    );

  box-shadow:
    0 8px 22px rgba(3, 35, 74, 0.20),
    inset 0 1px 0 rgba(255,255,255,0.07),
    inset 0 -1px 0 rgba(123,205,255,0.13);
}


/* ==========================================================================
   COURTCAST OPEN PLAY — CLEAN BLUE HERO FINAL 2026-09-24
   ========================================================================== */

.clubs-hero:has(.open-play-hero-brand) {
  background:
    radial-gradient(
      85% 120% at 95% 100%,
      rgba(21, 154, 244, 0.24),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      #073d72 0%,
      #07528f 38%,
      #0b6ab3 70%,
      #1884d2 100%
    );

  box-shadow:
    0 8px 22px rgba(2, 40, 83, 0.19),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(105,205,255,0.14);
}

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top p {
  color: rgba(255,255,255,0.96);
}


/* ==========================================================================
   COURTCAST OPEN PLAY — HEADER MATCH HERO 2026-09-24
   ========================================================================== */

/*
 * Use the same navy family as the CourtCast application header.
 * The hero only becomes slightly brighter toward the bottom.
 */

.clubs-hero:has(.open-play-hero-brand) {
  background:
    radial-gradient(
      95% 145% at 92% 110%,
      rgba(17, 111, 187, 0.28),
      transparent 64%
    ),
    linear-gradient(
      180deg,
      #072c5a 0%,
      #072e5d 24%,
      #083663 52%,
      #0a4676 78%,
      #0d5b91 100%
    );

  box-shadow:
    0 8px 22px rgba(2, 31, 67, 0.22),
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(91,185,255,0.12);
}

.clubs-hero:has(.open-play-hero-brand) .clubs-hero-top p {
  color: rgba(255,255,255,0.94);
}

/* Player view on iPad / tablet: bigger cards, results and Top 10 in columns. */
@media (min-width: 700px) {
  .op-cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
  .op-court-card { padding: 14px; }
  .op-card-top { font-size: 15px; }
  .op-team-names { font-size: 14px; }
  .op-court-card .op-avatar { width: 32px !important; height: 32px !important; font-size: 13px !important; }
  .op-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .op-player-group li { padding: 7px 10px; font-size: 14px; }
  .op-checkin-qr { width: 300px; }
}

@media (min-width: 1100px) {
  .op-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Match Results like the reference (same as the organizer's). */
.op-results { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.op-result-card { gap: 6px; padding: 12px 14px; border: 1.5px solid #6d7cf5; border-radius: 16px; background: #f3f6ff; }
.op-result-card .op-avatar-stack .op-avatar + .op-avatar { margin-left: -12px; }
.op-result-card .op-team { gap: 6px; }
.op-result-card .op-team-names { gap: 2px; font-size: 16px; font-weight: 800; line-height: 1.3; color: #111827; }
.op-result-card .op-team[data-outcome="lost"] .op-team-names { color: #9ca3af; font-weight: 500; }
.op-result-card .op-team[data-outcome="lost"] .op-avatar { opacity: 1; }
.op-result-center { gap: 4px; }
.op-result-center span { font-size: 14px; color: #6b7280; text-transform: none; }
.op-result-center strong { font-size: 30px; font-weight: 800; color: #2446f0; }
@media (min-width: 560px) { .op-results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .op-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }

.op-status-card > div { flex: 1 1 auto; min-width: 0; }
.op-status-action {
  flex: 0 0 auto; padding: 8px 12px; border: 0; border-radius: 999px;
  background: #0b1c2c; color: #ffffff; font: inherit; font-size: 13px; font-weight: 800;
}
.op-status-action[data-op-action="ready"] { background: #16a34a; }
.op-status-action:disabled { opacity: 0.6; }

/* Interested / Join on upcoming Open Plays. */
.op-responses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.op-response {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1.5px solid #cfdcf0;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.op-response em {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e8f0ff;
  font-style: normal;
  font-size: 11px;
}

.op-response--joined { border-color: #1d4ed8; background: #1d4ed8; color: #ffffff; }
.op-response--joined em { background: rgba(255, 255, 255, 0.22); }
.op-response--interested[aria-pressed="true"] { border-color: #f59e0b; background: #fff7e6; color: #b45309; }
.op-response--joined[aria-pressed="true"] { border-color: #15803d; background: #16a34a; }
.op-response:disabled { opacity: 0.6; }

/* Who joined / is interested, below the event card. */
.op-attendees { margin: 4px 16px 24px; padding: 14px; border-radius: 18px; background: #ffffff; border: 1px solid #e5e9f0; }
.op-attendees-title { margin: 4px 0 10px; color: var(--clubs-muted, #64748b); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.op-attendees-title + .op-empty { margin-top: 0; }
.op-attendee-grid + .op-attendees-title { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eef2f7; }
.op-attendee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 12px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.op-attendee-grid li { display: grid; justify-items: center; gap: 5px; min-width: 0; }
.op-attendee-grid .op-avatar { border: 2px solid #e8f0ff; font-size: 18px !important; }
.op-attendee-grid .op-attendee-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; color: #0f172a; }
@media (min-width: 700px) {
  .op-attendee-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .op-attendee-grid .op-avatar { width: 64px !important; height: 64px !important; }
}

/* Join as <category>, and joined players grouped by category. */
.op-join-picker { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); align-items: center; }
.op-join-picker p { grid-column: 1 / -1; margin: 0; color: #64748b; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.op-response--category { border-color: #1d4ed8; }
.op-response--cancel { border-color: #e2e8f0; color: #64748b; }
.op-attendees-group { margin: 12px 0 8px; color: #1d4ed8; font-size: 13px; font-weight: 800; }
.op-attendees-title + .op-attendees-group { margin-top: 0; }
.op-attendee-category {
  max-width: 100%; min-height: 26px; padding: 2px 4px; border: 1px solid #cfdcf0; border-radius: 999px;
  background: #f8fbff; color: #1d4ed8; font: inherit; font-size: 11px; font-weight: 700;
}

/* Interested / Join as tag-sized pills (the same size as the UPCOMING and
   Organizer tags), in a compact row at the bottom-right of the card. */
.open-play-card .op-responses {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 12px 10px;
}
.open-play-card .op-response {
  min-height: 0;
  gap: 5px;
  padding: 2px 9px;
  border-width: 1px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 13px;
  text-transform: uppercase;
}
.open-play-card .op-response em { min-width: 0; padding: 0 5px; font-size: 10px; line-height: 13px; }
.open-play-card .op-join-picker p { flex: 0 0 auto; margin-right: 2px; font-size: 10px; }
.open-play-card .op-response { white-space: nowrap; }

/* The Open Play list's header uses the same blue as every other Open Play
   page's header (e.g. an event's). */
.open-play-page .clubs-hero,
.open-play-page .clubs-hero:has(.open-play-hero-brand) {
  background:
    radial-gradient(95% 125% at 89% -8%, rgba(36, 164, 255, 0.6), transparent 60%),
    radial-gradient(70% 100% at 4% 100%, rgba(24, 118, 240, 0.42), transparent 70%),
    linear-gradient(145deg, #073a83 0%, #075bbd 52%, #2188ee 100%);
  box-shadow: 0 10px 26px rgba(4, 50, 112, 0.17), inset 0 -1px 0 rgba(255, 255, 255, 0.13);
}
@media (min-width: 1200px) {
  .op-results { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .op-result-center strong { font-size: 26px; }
}

/* Open Plays in the Home feed use the Open Play card (clubs.css + above). */
.home-feed-open-play[hidden] { display: none; }
.home-feed-open-play .open-play-card { margin: 0; }
/* The wrapper only borrows the Open Play page's card styles, not its page
   padding or background. */
.home-feed .home-feed-open-play.clubs-page {
  width: auto;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* Leaderboard chips in the player view, like the Venues sport chips. */
.op-board-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.op-board-filter {
  min-height: 34px; padding: 2px 14px; border: 1px solid #dfe7f3; border-radius: 13px;
  background: #ffffff; color: #13244a; font: inherit; font-size: 12px; font-weight: 650;
  box-shadow: 0 2px 5px rgba(18, 66, 125, 0.043);
}
.op-board-filter[aria-pressed="true"] {
  border-color: transparent;
  background: radial-gradient(circle at 80% 110%, rgba(0, 235, 255, 0.56), transparent 50%), linear-gradient(145deg, #1087ff 0%, #0672ed 100%);
  color: #ffffff;
  box-shadow: 0 5px 13px rgba(5, 116, 238, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---- Public share page (open-play-share.html) ---------------------------- */
.open-play-share-body { min-height: 100dvh; margin: 0; background: #eef6ff; }
.op-share-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, #061a3c, #0a3470);
}
.op-share-home { display: inline-flex; align-items: center; }
.op-share-home img { display: block; height: 30px; width: auto; }
.op-share-signin {
  padding: 8px 16px; border-radius: 999px; background: linear-gradient(145deg, #1087ff, #0672ed);
  color: #ffffff; font-size: 14px; font-weight: 800; text-decoration: none;
}
.op-share-page { max-width: 760px; margin: 0 auto; padding-bottom: 40px; }
.op-share-inapp { margin: 12px 16px 0; padding: 10px 12px; border-radius: 12px; background: #fff7e6; color: #92400e; font-size: 13px; line-height: 1.4; }
.op-share-checkin {
  display: block; margin: 12px 16px 0; padding: 14px; border-radius: 14px; text-align: center;
  background: linear-gradient(145deg, #16a34a, #15803d); color: #ffffff; font-size: 17px; font-weight: 900; text-decoration: none;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.25);
}
.op-share-walkin-list { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.op-share-walkin-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #f8fafc; border: 1px solid #eef2f7; font-weight: 700; }
.op-share-walkin-list em { color: #b45309; font-size: 12px; font-style: normal; font-weight: 700; }
.op-share-walkin-list .op-response { min-height: 30px; padding: 2px 12px; font-size: 12px; }

/* Organizers: share the page from the event. */
.op-share-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 12px 16px 0; padding: 14px; border-radius: 16px; background: #ffffff; border: 1px solid #e5e9f0;
}
.op-share-box > div { display: grid; gap: 2px; min-width: 0; flex: 1 1 200px; }
.op-share-box span { color: #64748b; font-size: 12px; }
.op-share-button {
  min-height: 40px; padding: 8px 18px; border: 0; border-radius: 999px;
  background: linear-gradient(145deg, #1087ff, #0672ed); color: #ffffff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.op-share-url { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1d4ed8; font-size: 12px; }


/* ===================================================================
   COURTCAST OPEN PLAY SHARED TABLET WIDTH REPAIR 2026-09-25
   ========================================================================== */

@media (min-width: 600px) and (min-height: 600px) {

  body #profile-app.clubs-page:has(.open-play-hero-brand) {
    width: min(calc(100% - 32px), 820px) !important;
    max-width: 820px !important;

    margin-right: auto !important;
    margin-left: auto !important;
  }
}
=======
/* Organizers: open an upcoming Open Play's session to set it up. */
.op-setup-box { border-color: #bbf7d0; background: #f0fdf4; }
.op-setup-button { background: #16a34a; }

/* An Open Play that is over (last in the Home feed). */
.open-play-status--done { background: #f1f5f9; color: #64748b; }
.home-feed-open-play:has(.open-play-status--done) .open-play-card { opacity: 0.85; }
.open-play-status--today { background: #fff4e5; color: #b45309; }
