/* League table, offline cup setup, contracts, reserve and injuries, packs and their opening, month phases, lending, paddock pass */
/* ===== Rules that had landed in the wrong place (now part of the main stylesheet) ===== */
/* ===== Official league table and season close ===== */
.lg { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.lg-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.lg-head .label { width: 100%; }
.lg-head b { font-size: 18px; display: inline-flex; align-items: center; gap: 6px; }
.lg-head small { color: var(--muted); margin-left: auto; font-size: 14px; }
.lg-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 46px; gap: 10px; align-items: center; padding: 7px 8px; border-top: 1px solid var(--line); border-left: 3px solid transparent; font-size: 15px; font-variant-numeric: tabular-nums; }
.lg-row.th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; border-top: 0; padding-top: 0; }
.lg-row .pos { color: var(--muted); }
.lg-row .nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lg-row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-row .pr { color: var(--muted); font-size: 13px; text-align: right; }
.lg-row .pts { text-align: right; font-size: 16px; }
.lg-row.up { border-left-color: #21c283; }
.lg-row.down { border-left-color: #e5484d; }
.lg-row.mine { background: rgba(255, 255, 255, 0.09); font-weight: 600; }
.lg-row.mine .pos { color: inherit; }
.lg-note { margin: 8px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lg-key.up { background: #21c283; } .lg-key.down { background: #e5484d; margin-left: 8px; }
.sc-modal { position: fixed; inset: 0; z-index: 80; background: rgba(3, 6, 14, 0.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sc-modal[hidden] { display: none; }
.sc-box { width: min(580px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.sc-box h2 { margin: 4px 0 0; font-size: 26px; }
.sc-box .review { grid-template-columns: 1fr; }
.sc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.sc-row b { font-size: 18px; display: flex; align-items: center; gap: 6px; }
.sc-row small { display: block; color: var(--muted); font-size: 13px; margin: 2px 0 4px; }
.sc-out { font-size: 15px; font-weight: 600; }
.sc-out.up { color: #21c283; } .sc-out.down { color: #e5484d; }
.sc-prize { font-size: 20px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.sc-prize small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.sc-total { margin: 0; font-size: 18px; font-weight: 600; }

/* ===== Offline cup setup ===== */
.cup-setup { max-width: none; gap: 16px; }
.cup-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cup-cats button { padding: 8px 12px; font-size: 15px; }
.cup-cats button[aria-pressed="true"], .cup-drivers button[aria-pressed="true"] { border-color: var(--hi, #fff); background: rgba(255, 255, 255, 0.1); }
.cup-drivers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.cup-drivers button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; text-transform: none; letter-spacing: 0; font-weight: 500; }
.cup-ovr { font-size: 22px; min-width: 32px; font-variant-numeric: tabular-nums; }
.cup-nm { display: flex; flex-direction: column; font-size: 15px; min-width: 0; }
.cup-line { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.cup-setup { width: 100%; }
.cup-nm small { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ===== Contracts ===== */
.e-mode { margin-bottom: 8px; }
.picks small.rent, .staffs small.rent, small.rent { color: #f2c94c !important; }
.rent-badge { border-color: #f2c94c; color: #f2c94c; }
.sc-split { margin-top: 2px; white-space: nowrap; }

.offer { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; font-size: 13px; color: #f2c94c; margin-top: 4px; }
.enroll input.offer-in, input.offer-in { width: 72px !important; min-width: 0 !important; flex: none !important; display: inline-block !important; margin: 0 !important; height: auto !important; padding: 4px 6px; font-size: 15px; font-weight: 600; text-align: right; background: rgba(0, 0, 0, 0.3); color: inherit; border: 1px solid #f2c94c; border-radius: 6px; }
.offer-row { margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }

/* ===== Reserve driver and injuries ===== */
.staff.reserve { margin-top: 12px; border-style: dashed; }
.racer-pick { display: flex; gap: 8px; flex-wrap: nowrap; margin-top: 6px; }
.racer-pick button { flex: 1 1 0; min-width: 0; }
.racer-pick button { display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-transform: none; letter-spacing: 0; font-weight: 500; text-align: left; }
.racer-pick button b { font-size: 20px; }
.racer-pick button small { display: block; color: var(--muted); font-size: 12px; }
.racer-pick button[aria-pressed="true"] { border-color: var(--hi, #fff); background: rgba(255, 255, 255, 0.1); }
.badge.inj { border-color: #e5484d; color: #e5484d; }
#racerBox:empty { display: none; }
#racerBox { margin-bottom: 10px; }

/* ===== Packs and reveal ===== */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pack { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.pack-art { --pk: #9aa3ad; flex: none; width: 92px; aspect-ratio: 5 / 7; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--pk) 55%, #111) 0%, #0b0d12 70%); border: 1px solid color-mix(in srgb, var(--pk) 70%, transparent); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.pack-art b { font-family: var(--display, inherit); font-style: italic; font-size: 26px; letter-spacing: .02em; }
.pack-art span { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, 0.75); text-align: center; padding: 0 4px; }
.pack-driver .pack-art { --pk: #5b8def; } .pack-staff .pack-art { --pk: #3fc79a; } .pack-starter .pack-art { --pk: #b8bcc4; }
.pack-drop .pack-art { --pk: #e6cf8b; } .pack-elite .pack-art { --pk: #e24bf0; }
.pack-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pack-info h3 { margin: 0; font-size: 18px; }
.pack-info p { margin: 0; color: var(--muted); font-size: 14px; }
.pack-info small { color: #f2c94c; font-size: 13px; }
.pack-info button { margin-top: auto; align-self: flex-start; }
.pk-odds { margin: 12px 0; } .pk-odds summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.pk-odds table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.pk-odds td, .pk-odds th { padding: 4px 12px; border-bottom: 1px solid var(--line); text-align: right; font-size: 14px; }
.pk-odds td:first-child { text-align: left; font-weight: 600; }
.pk-log { display: flex; flex-direction: column; }
.pk-row { display: grid; grid-template-columns: 96px 150px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pk-row > span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.pk-cards { display: flex; gap: 6px; flex-wrap: wrap; }
.pk-cards i { font-style: normal; font-size: 12px; border: 1px solid; border-radius: 6px; padding: 1px 6px; }
@media (max-width: 600px) { .pk-row { grid-template-columns: 1fr; gap: 4px; } }
.rv-box { width: min(1120px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.rv-cards { display: flex; gap: 16px; row-gap: 44px; flex-wrap: wrap; justify-content: center; }
.rv-cards.many { gap: 12px; row-gap: 44px; }
.rv-cards.many { max-width: 820px; }
.rv-modal { align-items: flex-start; overflow: auto; }
.rv-modal .rv-box { max-height: none; overflow: visible; margin: auto; }
.rv-card { --rar: #b8bcc4; width: 250px; max-width: 100%; aspect-ratio: 5 / 8.1; perspective: 1200px; cursor: pointer; position: relative; display: flex; flex-direction: column; }
.rv-inner { position: relative; flex: 1; transition: transform .7s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.rv-card.open .rv-inner { transform: rotateY(180deg); }
.rv-back, .rv-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; }
.rv-back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: radial-gradient(circle at 50% 35%, #1d2433, #07090d 70%); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.rv-back b { font-family: var(--display, inherit); font-style: italic; font-size: 44px; color: rgba(255, 255, 255, 0.85); }
.rv-back span { font-size: 28px; color: rgba(255, 255, 255, 0.4); }
.rv-card:not(.open):hover .rv-back { border-color: rgba(255, 255, 255, 0.4); }
.rv-front { transform: rotateY(180deg); }
.rv-front { border-radius: 8px; }
.rv-card.open .rv-front { box-shadow: 0 0 0 2px var(--rar), 0 0 40px color-mix(in srgb, var(--rar) 60%, transparent); }
.rv-front .dcard { width: 100%; height: 100%; }
.rv-rar { position: absolute; left: 0; right: 0; bottom: -28px; text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--rar); opacity: 0; transition: opacity .3s .5s; }
.rv-card.open .rv-rar { opacity: 1; }
.rv-actions { display: flex; gap: 10px; margin-top: 18px; }

.sell.quick { border-color: rgba(229, 72, 77, 0.5); color: #e5484d; }
.sell.quick.confirm { background: #e5484d; color: #fff; border-color: #e5484d; }
.sell.quick:disabled { opacity: 0.5; }

/* ===== Month phases ===== */
.phase-chip { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-left: 3px solid #f2c94c; background: rgba(242, 201, 76, 0.07); border-radius: 6px; margin: 6px 0 10px; }
.phase-chip b { font-size: 15px; } .phase-chip span { font-size: 13px; color: var(--muted); }
.pre-tag { color: #3fc79a; font-weight: 600; }
#enrollCancel, #preClear { margin-left: 8px; }

/* ===== Lending ===== */
.sell.lend { border-color: rgba(242, 201, 76, 0.5); color: #f2c94c; }
.lend-form { width: 250px; max-width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid rgba(242, 201, 76, 0.5); border-radius: 8px; font-size: 14px; }
.lend-form small { color: var(--muted); font-size: 12px; }
.lend-actions { display: flex; gap: 8px; }
.sc-lend { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.sc-lend small { display: block; color: var(--muted); font-size: 13px; }
.sc-lend b.down { color: #e5484d; }

/* ===== Pack opening screen ===== */
.pk-stage { position: relative; min-height: 640px; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 24px 0 40px; overflow: hidden; }
.pk-stage > .label { position: relative; z-index: 2; }
.pk-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--glow) 70%, #fff) 0%, color-mix(in srgb, var(--glow) 35%, transparent) 30%, transparent 70%); }
.pk-stage.flash .pk-flash { animation: pkFlash 1s ease-out; }
@keyframes pkFlash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.pk-big { all: unset; cursor: pointer; margin-top: 30px; position: relative; z-index: 1; animation: pkFloat 2.4s ease-in-out infinite; }
.pk-big .pack-art { width: 230px; gap: 12px; position: relative; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px color-mix(in srgb, var(--pk) 35%, transparent); }
.pk-big .pack-art b { font-size: 64px; }
.pk-big .pack-art span { font-size: 15px; }
.pk-big .pack-art em { font-style: normal; font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.pk-big .pack-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.25) 45%, transparent 60%); transform: translateX(-100%); animation: pkShine 3s ease-in-out infinite; }
.pk-top { position: absolute; left: 0; right: 0; top: 0; height: 14%; border-bottom: 2px dashed rgba(255, 255, 255, 0.35); }
.pk-big:hover .pack-art { filter: brightness(1.15); }
.pk-big.shake { animation: pkShake .65s ease-in-out; }
.pk-big.burst .pack-art { animation: pkBurst .5s ease-in forwards; }
.pk-big.burst .pk-top { animation: pkTear .45s ease-in forwards; }
@keyframes pkFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pkShine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pkShake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-7deg) scale(1.03); } 30% { transform: rotate(7deg) scale(1.05); } 45% { transform: rotate(-6deg) scale(1.07); } 60% { transform: rotate(6deg) scale(1.08); } 80% { transform: rotate(-3deg) scale(1.1); } }
@keyframes pkBurst { 0% { transform: scale(1.1); filter: brightness(1); } 60% { filter: brightness(3); } 100% { transform: scale(1.5); opacity: 0; filter: brightness(4); } }
@keyframes pkTear { to { transform: translate(40px, -120px) rotate(25deg); opacity: 0; } }
.pk-hint { margin: 0; color: var(--muted); font-size: 15px; animation: pkFloat 2.4s ease-in-out infinite; }
.rv-cards.deal .rv-card { animation: pkDeal .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 140ms); }
@keyframes pkDeal { from { opacity: 0; transform: translateY(220px) scale(.4) rotate(-10deg); } to { opacity: 1; transform: none; } }
.rv-card.big-pull.open .rv-front { animation: pkPull 1.2s ease-out; }
@keyframes pkPull { 0% { box-shadow: 0 0 0 2px var(--rar), 0 0 0 transparent; } 40% { box-shadow: 0 0 0 3px var(--rar), 0 0 90px var(--rar); } 100% { box-shadow: 0 0 0 2px var(--rar), 0 0 40px color-mix(in srgb, var(--rar) 60%, transparent); } }
@media (prefers-reduced-motion: reduce) { .pk-big, .pk-hint, .pk-big .pack-art::after, .rv-cards.deal .rv-card { animation: none !important; } }

/* ===== Paddock pass: every card arrives as a sealed credential on a lanyard; flipping it shows the card ===== */
.rv-cards.passes { padding-top: 46px; row-gap: 78px; }
.rv-card { container-type: inline-size; }
.pass-strap { position: absolute; left: 50%; top: -46px; width: 34px; height: 44px; margin-left: -17px; pointer-events: none; }
.pass-strap::before, .pass-strap::after { content: ""; position: absolute; top: 0; width: 12px; height: 44px; background: repeating-linear-gradient(180deg, var(--c) 0 10px, color-mix(in srgb, var(--c) 65%, #000) 10px 12px); }
.pass-strap::before { left: 2px; transform: skewX(14deg); } .pass-strap::after { right: 2px; transform: skewX(-14deg); }
.pass-clip { position: absolute; left: 50%; top: -8px; width: 24px; height: 16px; margin-left: -12px; border-radius: 4px 4px 8px 8px; background: linear-gradient(#cfd5dd, #7c8590); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); z-index: 3; pointer-events: none; }
.pass-face { overflow: hidden; container-type: inline-size; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.5cqw; text-align: center; color: #fff; border: 0;
  background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 45%, #050810)); box-shadow: 0 16px 36px rgba(0, 0, 0, .55); }
.pass-face::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 7cqw, rgba(255, 255, 255, .05) 7cqw 7.8cqw); }
.pass-face .pass-sleeve { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .04) 35%, transparent 55%, rgba(255, 255, 255, .12) 80%); border: 1px solid rgba(255, 255, 255, .35); pointer-events: none; }
.pass-face .pass-hole { position: absolute; top: 5cqw; left: 50%; width: 17cqw; height: 3.4cqw; margin-left: -8.5cqw; border-radius: 2cqw; background: var(--bg, #0a0d14); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8); }
.pass-face .pass-access { position: relative; font-family: var(--display, inherit); font-weight: 800; letter-spacing: .3em; font-size: 5.6cqw; padding: .6cqw 3cqw .6cqw 4.5cqw; background: #eef1f6; color: #0a0d14; border-radius: 1cqw; }
.pass-logo { position: relative; font-family: var(--display, inherit); font-style: italic; font-weight: 800; font-size: 30cqw; line-height: .85; text-shadow: 0 1cqw 0 rgba(0, 0, 0, .35); }
.pass-logo i { font-style: inherit; color: #e5243b; }
.pass-kind { position: relative; font-family: var(--display, inherit); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 6.3cqw; padding: 0 4cqw; }
.pass-sub { position: relative; font-size: 3.8cqw; letter-spacing: .08em; color: rgba(255, 255, 255, .75); }
.pass-seal { position: relative; width: 24cqw; height: 24cqw; border-radius: 50%; margin-top: 2cqw; display: grid; place-items: center; font-family: var(--display, inherit); font-weight: 800; font-size: 5.6cqw; color: #0a0d14;
  background: conic-gradient(#ff9ad5, #9ad8ff, #b3ffb0, #fff59a, #ffb38a, #ff9ad5); box-shadow: 0 0 0 1cqw rgba(255, 255, 255, .6), 0 1.5cqw 4cqw rgba(0, 0, 0, .4); animation: passHolo 4s linear infinite; }
.pass-face .pass-seal span { font-size: 5.6cqw; color: #0a0d14; background: rgba(255, 255, 255, .75); border-radius: 50%; width: 72%; height: 72%; display: grid; place-items: center; }
@keyframes passHolo { to { filter: hue-rotate(360deg); } }
.rv-card.tearing .pass-seal { animation: passTear .4s ease-in forwards; }
@keyframes passTear { to { transform: translate(24cqw, -16cqw) rotate(70deg) scale(.6); opacity: 0; } }
.rv-card:not(.open):hover .pass-face { filter: brightness(1.12); }
.pass-mini { position: relative; width: 84px; aspect-ratio: 5 / 7.6; max-width: 100%; margin: 26px auto 0; }
.pass-mini .pass-face { position: absolute; inset: 0; border-radius: 8px; }
.pass-mini .pass-strap { top: -26px; height: 24px; width: 24px; margin-left: -12px; }
.pass-mini .pass-strap::before, .pass-mini .pass-strap::after { height: 24px; width: 8px; }
.pass-mini .pass-clip { top: -6px; width: 16px; height: 11px; margin-left: -8px; }
.pass-mini .pass-sub { display: none; }
@media (prefers-reduced-motion: reduce) { .pass-seal { animation: none !important; } }

