/*
 * SportsCal — Conversion redesign shared components (2026-06 handoff)
 * Rounded neo-brutalist surfaces used by the SSR team + league pages:
 *   next-game card, stat chips, free-preview meter, inline pay card,
 *   and the sync sheet (shared with the homepage flow).
 * Brand green is #00C853 (repo rule), NOT the handoff's #2EDB5C.
 * Tokens mirror the handoff: 2px borders, radii 7-14px, hard offset shadows.
 */

:root {
  --cr-green: #00C853;
  --cr-green-tint: #e9fbee;
  --cr-cream: #fff9e3;
  --cr-ink: #0b0b0b;
  --cr-paper: #fafaf8;
  --cr-mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --cr-head: 'Space Grotesk', 'Inter', sans-serif;
}

/* ===== Stat chips (demoted stats) ===== */
.cr-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0; }
.cr-chip {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--cr-ink); border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-family: var(--cr-mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--cr-ink);
  background: #fff; white-space: nowrap;
}

/* ===== Next-game card (black, carries the single above-the-fold CTA) ===== */
.cr-nextgame {
  background: var(--cr-ink); color: #fff;
  border: 1.5px solid var(--cr-ink); border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(11,11,11,.25);
  padding: 1.4rem; margin: 0 0 1.25rem;
}
.cr-ng-label {
  font-family: var(--cr-mono); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--cr-green);
}
.cr-ng-matchup { font-family: var(--cr-head); font-size: 1.45rem; font-weight: 700; line-height: 1.2; margin: 0.5rem 0; }
.cr-ng-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: #cfcfcb; margin-bottom: 0.9rem; flex-wrap: wrap; }
.cr-ng-meta .cr-ng-muted { color: #8a8a86; }
.cr-ng-pill { border: 1.5px solid #fff; border-radius: 5px; padding: 0.1rem 0.5rem; font-family: var(--cr-mono); font-size: 0.62rem; letter-spacing: 0.04em; color: #fff; }
.cr-ng-cta {
  display: block; width: 100%; box-sizing: border-box;
  background: var(--cr-green); color: var(--cr-ink);
  border: 1.5px solid var(--cr-green); border-radius: 9px;
  padding: 0.85rem 1rem; text-align: center;
  font-family: var(--cr-head); font-weight: 800; font-size: 1rem;
  cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.cr-ng-cta:hover { transform: translate(-2px,-2px); box-shadow: 3px 3px 0 rgba(255,255,255,.4); }
.cr-ng-subline { font-family: var(--cr-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; color: #9c9c97; margin-top: 0.6rem; }
.cr-ng-alt { font-size: 0.72rem; text-align: center; color: #777; margin-top: 0.5rem; }
.cr-ng-alt button { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0 0.15rem; }

/* ===== Free-preview meter strip ===== */
.cr-meter {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--cr-green-tint); border: 1.5px solid var(--cr-ink); border-radius: 12px;
  padding: 0.9rem 1.1rem; margin: 0 0 1.25rem;
}
.cr-meter--low, .cr-meter--exhausted { background: var(--cr-cream); }
.cr-meter__label { font-family: var(--cr-mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.cr-meter__squares { display: flex; gap: 5px; }
.cr-meter__sq { width: 14px; height: 14px; border: 1.5px solid var(--cr-ink); border-radius: 3px; background: #fff; }
.cr-meter__sq.is-on { background: var(--cr-green); }
.cr-meter__status { font-size: 0.82rem; font-weight: 600; flex: 1; min-width: 180px; }
.cr-meter__status strong { font-weight: 800; }

/* ===== Inline pay card (Phase 3 mounts Stripe Elements into .cr-paycard__element) ===== */
.cr-paycard {
  border: 1.5px solid var(--cr-ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--cr-ink);
  overflow: hidden; margin: 0 0 1.5rem; display: grid; grid-template-columns: 1fr 1fr;
}
.cr-paycard__left { background: var(--cr-ink); color: #fff; padding: 1.6rem; display: flex; flex-direction: column; gap: 0.85rem; }
.cr-paycard__eyebrow { font-family: var(--cr-mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cr-green); }
.cr-paycard__price { display: flex; align-items: baseline; gap: 0.5rem; }
.cr-paycard__price b { font-family: var(--cr-head); font-size: 2.3rem; font-weight: 700; }
.cr-paycard__price span { font-size: 0.85rem; color: #afafaa; }
.cr-paycard__billed { font-size: 0.78rem; color: #a7a7a2; margin-top: 0.15rem; }
.cr-paycard__checks { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem; line-height: 1.4; }
.cr-paycard__checks div { display: flex; gap: 0.5rem; }
.cr-paycard__checks .ck { color: var(--cr-green); font-weight: 700; }
.cr-paycard__keep { font-family: var(--cr-mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: #777; margin-top: auto; }
.cr-paycard__right { background: #fff; padding: 1.6rem; display: flex; flex-direction: column; gap: 0.75rem; }
.cr-paycard__express { min-height: 44px; }
.cr-paycard__divider { display: flex; align-items: center; gap: 0.75rem; color: #999; font-family: var(--cr-mono); font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; }
.cr-paycard__divider span:first-child, .cr-paycard__divider span:last-child { flex: 1; height: 1px; background: #e2e2de; }
.cr-paycard__element { border: 1.5px solid var(--cr-ink); border-radius: 8px; padding: 0.75rem; }
.cr-paycard__paybtn {
  background: var(--cr-green); color: var(--cr-ink); border: 1.5px solid var(--cr-ink); border-radius: 9px;
  box-shadow: 2px 2px 0 var(--cr-ink); padding: 0.85rem 1rem; text-align: center;
  font-family: var(--cr-head); font-weight: 800; font-size: 1rem; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.cr-paycard__paybtn:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--cr-ink); }
.cr-paycard__paybtn:disabled { opacity: 0.6; cursor: progress; }
.cr-paycard__trust { font-family: var(--cr-mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: #888; text-align: center; }
.cr-paycard__err { color: #c0263e; font-size: 0.82rem; font-weight: 600; text-align: center; min-height: 1em; }
.cr-paycard__success { padding: 1.4rem; background: var(--cr-green-tint); border: 1.5px solid var(--cr-ink); border-radius: 14px; font-weight: 700; text-align: center; margin: 0 0 1.5rem; }
.cr-paycard__acct { display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 1.6rem; margin-top: 1rem; font-size: 0.85rem; font-weight: 600; color: #555; line-height: 1.5; }
.cr-paycard__acctbtn { display: inline-block; text-decoration: none; background: var(--cr-ink); color: #fff; border: 1.5px solid var(--cr-ink); border-radius: 9px; box-shadow: 2px 2px 0 var(--cr-green); padding: 0.7rem 1.1rem; font-family: var(--cr-head); font-weight: 800; font-size: 0.95rem; transition: transform .12s, box-shadow .12s; }
.cr-paycard__acctbtn:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--cr-green); }
.cr-paycard__spin { width: 14px; height: 14px; border: 1.5px solid #cfcfcf; border-top-color: var(--cr-green); border-radius: 50%; display: inline-block; animation: crspin .7s linear infinite; }
@keyframes crspin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .cr-paycard { grid-template-columns: 1fr; }
  .cr-nextgame { padding: 1.1rem; border-radius: 12px; }
  .cr-ng-matchup { font-size: 1.2rem; }
}

/* ===== Sync sheet (shared with sync-sheet.js) — modal desktop / bottom-sheet mobile ===== */
.scs { position: fixed; inset: 0; z-index: 9999; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scs[hidden] { display: none; }
.scs__backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); }
.scs__dialog {
  position: relative; max-width: 460px; width: calc(100% - 2rem); margin: 8vh auto;
  background: #fff; border: 1.5px solid var(--cr-ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--cr-ink);
  padding: 1.5rem 1.5rem 1.25rem;
}
.scs__close { position: absolute; top: 8px; right: 10px; background: transparent; border: 0; font-size: 1.1rem; font-weight: 900; cursor: pointer; padding: 0.35rem 0.45rem; border-radius: 7px; }
.scs__title { font-family: var(--cr-head); font-size: 1.25rem; font-weight: 700; line-height: 1.2; margin: 0 0 0.9rem; }
.scs__seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin: 0 0 0.6rem; }
.scs__segbtn { font: inherit; font-weight: 700; font-size: 0.85rem; padding: 0.6rem 0.25rem; background: #fff; color: #666; border: 1.5px solid var(--cr-ink); border-radius: 9px; cursor: pointer; min-height: 44px; }
.scs__segbtn[aria-pressed="true"] { background: var(--cr-green); color: var(--cr-ink); font-weight: 800; }
.scs__label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem; }
.scs__input { width: 100%; box-sizing: border-box; font: inherit; font-size: 1.02rem; padding: 0.8rem 0.9rem; border: 1.5px solid var(--cr-ink); border-radius: 8px; background: #fff; }
.scs__input:focus { outline: none; box-shadow: 0 0 0 3px rgba(0,200,83,.35); }
.scs__btn { display: block; width: 100%; margin-top: 0.8rem; font: inherit; font-weight: 800; font-size: 1.02rem; padding: 0.85rem 1rem; background: var(--cr-green); color: var(--cr-ink); border: 1.5px solid var(--cr-ink); border-radius: 9px; box-shadow: 2px 2px 0 var(--cr-ink); cursor: pointer; min-height: 48px; transition: transform .12s, box-shadow .12s; }
.scs__btn:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: 3px 3px 0 var(--cr-ink); }
.scs__btn:disabled { opacity: 0.7; cursor: progress; }
.scs__err { margin-top: 0.6rem; padding: 0.55rem 0.7rem; background: #fff5f5; border: 1.5px solid #c0263e; border-radius: 8px; font-size: 0.85rem; font-weight: 700; color: #c0263e; }
.scs__hint { font-family: var(--cr-mono); font-size: 0.58rem; letter-spacing: 0.07em; text-transform: uppercase; color: #888; margin: 0.7rem 0 0; text-align: center; line-height: 1.5; }
.scs__anyapp { font-size: 0.78rem; line-height: 1.45; color: #555; margin: 0 0 0.9rem; padding: 0.55rem 0.7rem; background: var(--cr-green-tint); border: 1.5px solid var(--cr-ink); border-radius: 8px; text-align: center; }
.scs__anyapp b { color: var(--cr-ink); }
.scs__copybtn { display: block; width: 100%; margin: 0.5rem 0 0; font: inherit; font-weight: 700; font-size: 0.82rem; padding: 0.6rem 0.8rem; background: #fff; color: var(--cr-ink); border: 2px dashed var(--cr-ink); border-radius: 9px; cursor: pointer; }
.scs__copybtn:hover { background: var(--cr-green-tint); }
/* sent state */
.scs__ok { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; background: var(--cr-green); color: var(--cr-ink); border: 1.5px solid var(--cr-ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--cr-ink); font-size: 1.7rem; font-weight: 900; margin: 0 auto 0.6rem; }
.scs__sent { text-align: center; }
.scs__meter { display: flex; gap: 5px; justify-content: center; margin: 0.4rem 0 0.2rem; flex-wrap: wrap; }
.scs__sq { width: 14px; height: 14px; border: 1.5px solid var(--cr-ink); border-radius: 3px; background: var(--cr-green); }
.scs__sentmeta { font-size: 0.8rem; font-weight: 700; color: #555; margin: 0.1rem 0 0.7rem; }
.scs__sub { font-size: 0.88rem; color: #555; line-height: 1.5; margin: 0 0 0.75rem; }
.scs__addbtns { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0; }
.scs__addbtn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; font: inherit; font-weight: 800; font-size: 0.98rem; padding: 0.8rem 1rem; border: 1.5px solid var(--cr-ink); border-radius: 9px; box-shadow: 2px 2px 0 var(--cr-ink); cursor: pointer; background: #fff; color: var(--cr-ink); text-decoration: none; }
.scs__addbtn:hover { transform: translate(-2px,-2px); box-shadow: 3px 3px 0 var(--cr-ink); }
.scs__addbtn .ic { width: 22px; height: 22px; object-fit: contain; }
.scs__resend { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid #e8e8e4; }
.scs__resendbtn { font: inherit; font-weight: 700; font-size: 0.8rem; padding: 0.5rem 0.8rem; background: #fff; border: 1.5px solid var(--cr-ink); border-radius: 8px; cursor: pointer; }
.scs__resendbtn:disabled { opacity: 0.45; cursor: default; }
.scs__upgrade { font-size: 0.8rem; line-height: 1.5; margin: 0.9rem 0 0; color: #555; text-align: left; }
.scs__upgrade b { color: var(--cr-ink); }
.scs__upgrade a { color: var(--cr-ink); font-weight: 800; text-decoration: underline; }

@media (max-width: 600px) {
  .scs { display: flex; align-items: flex-end; }
  .scs[hidden] { display: none; }
  .scs__dialog {
    margin: 0; width: 100%; max-width: 100%;
    border-width: 2px 0 0; border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,.22);
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    animation: scsUp .22s ease-out;
  }
  .scs__dialog::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #d6d6d2; margin: 0 auto 0.9rem; }
}
@keyframes scsUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .scs__dialog { animation: none !important; } .cr-ng-cta, .scs__btn, .scs__addbtn, .cr-paycard__paybtn, .cr-paycard__acctbtn { transition: none !important; } .cr-paycard__spin { animation: none !important; } }
