/* The Juice Crew: the wall, the home strip, the sheet, the chip.
   Loaded only for people who can see the Crew. Builds on app.css tokens;
   only transform and opacity animate. */

/* ================================================================ buttons */
.cw__empty[hidden], .crew-chip[hidden], .crew-toast[hidden] { display: none; }
.btn--crew { background: var(--pink); color: #fff; border: 0; cursor: pointer; }
.btn--crew:hover { background: var(--hot); color: #000; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); border: 0; cursor: pointer; }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ================================================================ the wall page */
.cw { position: relative; overflow: hidden; padding: 18px 0 56px; container-type: inline-size; }
.cw__ghost { height: 150%; right: -12%; top: -30%; }
.cw__in { position: relative; z-index: 1; }

.cw__head { display: grid; gap: 14px; align-items: end; }
.cw__h { margin: 0; display: grid; justify-items: start; line-height: .84; font-size: min(26cqi, 190px); }
.cw__h1 { font-size: .34em; --stroke-c: var(--ink); -webkit-text-stroke-width: max(1.5px, .02em); }
.cw__h2 { color: var(--sky-display); letter-spacing: -.01em; }

.cw__count { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: end; }
.cw__lamp { grid-column: 1 / -1; justify-self: start; margin-bottom: 4px; animation: cw-lamp 2.2s ease-in-out infinite; }
@keyframes cw-lamp { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.cw__n { color: var(--hot); font-size: min(30cqi, 210px); line-height: .8; font-variant-numeric: tabular-nums; }
.cw__nl { display: grid; line-height: .88; padding-bottom: .1em; font-size: min(8cqi, 52px); }
.cw__nl .o { font-size: .8em; }

.cw__areas { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ca { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 12px; padding: 14px 16px 16px; background: var(--ghost); border-radius: 14px; }
.ca__l { font-size: 30px; line-height: .9; }
.ca__n { font-size: 44px; line-height: .8; color: var(--pink-ink); font-variant-numeric: tabular-nums; }
.ca__bar { grid-column: 1 / -1; height: 8px; background: var(--rule); border-radius: 8px; overflow: hidden; }
.ca__bar i { display: block; height: 100%; width: 100%; background: var(--pink); transform-origin: left; transform: scaleX(var(--w, 0)); transition: transform .8s var(--ease); }
.ca--liverpool .ca__bar i { background: var(--sky); }
.ca--lancashire .ca__bar i { background: var(--currant); }
.ca--elsewhere .ca__bar i { background: var(--muted); }
:root[data-theme="dark"] .ca--lancashire .ca__bar i { background: #B06CD6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ca--lancashire .ca__bar i { background: #B06CD6; } }

.cw__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 26px 0 30px; }
.cw__hint { margin: 0; color: var(--muted); font-size: 15px; flex-basis: 100%; }

.cw__all { margin: 34px 0 16px; font-size: 40px; }
.cw__all .o { font-size: .8em; }
.cw__wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 22px 14px; }
.cw__empty { display: flex; align-items: center; gap: 20px; padding: 10px 0; }
.cw__empty .tile { width: 120px; border-radius: 12px; transform: rotate(-3deg); opacity: .9; }
.cw__empty p { margin: 0; max-width: 34ch; color: var(--muted); }
.cw__small { margin: 40px 0 0; font-size: 14px; color: var(--muted); max-width: 70ch; }
.cw__small a { color: var(--pink-ink); font-weight: 700; }

@container (min-width: 720px) {
  .cw { padding-top: 40px; }
  .cw__head { grid-template-columns: minmax(0, 1fr) auto; }
  .cw__count { justify-self: end; }
  .cw__wall { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 26px 18px; }
  .cw__hint { flex-basis: auto; }
}

/* ================================================================ a Crew tile */
.ct { position: relative; min-width: 0; text-align: center; }
.ct__card { position: relative; display: block; padding: 5px; background: var(--sticker); border-radius: 14px; transform: rotate(var(--r, 0deg)); transition: transform .25s var(--ease); }
.ct__card .tile { border-radius: 9px; }
.ct:hover .ct__card { transform: rotate(0deg) scale(1.04); }
.ct__n { display: block; margin-top: 8px; font-weight: 800; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct__t { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct__you { position: absolute; left: -6px; top: -8px; background: var(--sky); color: #000; font: 900 11px/1 var(--f-ui); font-stretch: 125%; text-transform: uppercase; padding: 5px 6px 4px; border-radius: 3px; transform: rotate(-8deg); }
.ct__onair { position: absolute; right: -6px; top: -8px; transform: rotate(6deg); }
.ct__flag { position: absolute; right: 2px; bottom: 34px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--muted); font-size: 15px; opacity: 0; transition: opacity .15s ease; box-shadow: 0 2px 8px rgba(13, 10, 15, .18); }
.ct:hover .ct__flag, .ct__flag:focus-visible { opacity: 1; }
@media (pointer: coarse) { .ct__flag { opacity: .85; width: 30px; height: 30px; } }

.ct.is-glow .ct__card { background: var(--hot); animation: ct-glow 1.4s ease-in-out infinite alternate; }
@keyframes ct-glow { from { box-shadow: 0 0 0 0 rgba(255, 0, 154, .0), 0 0 14px 2px rgba(255, 0, 154, .45); } to { box-shadow: 0 0 0 4px rgba(255, 0, 154, .35), 0 0 34px 8px rgba(255, 0, 154, .55); } }
.ct.is-me .ct__card { background: var(--sky); }

.ct.is-new { animation: ct-pop .64s cubic-bezier(.34, 1.56, .64, 1) var(--d, 0ms) both; }
@keyframes ct-pop { from { opacity: 0; transform: translateY(18px) scale(.35) rotate(-14deg); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
.ct.is-out { animation: ct-out .3s ease forwards; pointer-events: none; }
@keyframes ct-out { to { opacity: 0; transform: scale(.6) translateY(8px); } }

/* ================================================================ home strip */
.cx { padding: 48px 0 8px; overflow: hidden; }
.cx .sec-h h2 .hot { color: var(--hot); }
.cx__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; }
.cx__count { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); }
.cx__count b { font-size: 46px; line-height: .8; color: var(--hot); font-variant-numeric: tabular-nums; }
.cx__in .tk { grid-column: 1 / -1; grid-row: 2; }
.cx__join { justify-self: end; }
@container main (min-width: 720px) { .cx__count b { font-size: 64px; } }

/* ================================================================ the ticker: an endless stream of tiles */
.tk { --tk-w: 96px; --tk-gap: 16px; position: relative; overflow: hidden; margin: 0 calc(var(--g) * -1); padding: 14px 0 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.tk--big { --tk-w: 116px; --tk-gap: 18px; margin: 26px 0 0; padding: 16px 0 10px; }
@media (min-width: 768px) { .tk { --tk-w: 112px; } .tk--big { --tk-w: 136px; --tk-gap: 22px; } }
.tk__row + .tk__row { margin-top: 16px; }
.tk__track { display: flex; width: max-content; will-change: transform; }
.tk__half { display: flex; gap: var(--tk-gap); margin: 0; padding: 0 var(--tk-gap) 0 0; list-style: none; }
.tk__i { position: relative; width: var(--tk-w); flex: none; text-align: center; transition: opacity .6s ease; }
.tk__card { position: relative; display: block; padding: 5px; background: var(--sticker); border-radius: 14px; transform: rotate(var(--r, 0deg)); }
.tk__card .tile { border-radius: 9px; }
.tk__n { display: block; margin-top: 8px; font-weight: 800; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk__t { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk__you { position: absolute; left: -6px; top: -8px; background: var(--sky); color: #000; font: 900 11px/1 var(--f-ui); font-stretch: 125%; text-transform: uppercase; padding: 5px 6px 4px; border-radius: 3px; transform: rotate(-8deg); }
.tk__onair { position: absolute; right: -6px; top: -8px; transform: rotate(6deg); }
.tk__i.is-glow .tk__card { background: var(--hot); animation: ct-glow 1.4s ease-in-out infinite alternate; }
.tk__i.is-me .tk__card { background: var(--sky); }
.tk__i.is-ghost { opacity: .55; }
.tk__i.is-ghost .tk__n { color: var(--muted); }
.tk__i.is-leaving { opacity: .2; }
.tk__i.is-new .tk__card { animation: ct-pop .64s cubic-bezier(.34, 1.56, .64, 1) both; }
/* Reduced motion: a still row you can scroll. */
.tk--static { -webkit-mask-image: none; mask-image: none; }
.tk--static .tk__row { overflow-x: auto; scrollbar-width: none; padding: 0 var(--g); }
.tk--static .tk__row::-webkit-scrollbar { display: none; }
.tk--static .tk__track { width: auto; }

/* ================================================================ player bar chip */
.crew-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; font-size: 13px; white-space: nowrap; }
.crew-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 0 rgba(255, 0, 154, .6); animation: chip-ping 1.8s ease-out infinite; }
@keyframes chip-ping { to { box-shadow: 0 0 0 8px rgba(255, 0, 154, 0); } }
.crew-chip b { font-variant-numeric: tabular-nums; }
.crew-chip span { color: var(--lilac); }
.crew-chip:hover { background: rgba(255, 255, 255, .18); }

/* ================================================================ the sheet */
.cs__h .hot { color: var(--hot); }
.cs__lede { margin: 2px 0 16px; color: var(--muted); }
.cs__form { display: grid; gap: 14px; }
.cs__form .field { position: relative; }
.cs__form textarea { min-height: 96px; }
.cs__count { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cs__count.is-low { color: var(--pink-ink); font-weight: 700; }
.cs__row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cs__skip, .cs__link { min-height: 44px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.cs__link { color: var(--pink-ink); min-height: 32px; }
.cs__err { margin: 0; padding: 10px 12px; background: #FFE8F4; color: #7A003F; border-left: 5px solid #C4007A; font-weight: 600; font-size: 15px; }
.cs__fine { margin: 0; font-size: 13px; color: var(--muted); }
.cs__fine a { color: var(--pink-ink); }
.cs__ts:empty { display: none; }
.cs__me { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.cs__me .tile { width: 92px; border-radius: 10px; flex: none; box-shadow: 0 0 0 5px var(--sticker); }
.cs__nick { margin: 0; font-size: 36px; line-height: .9; }
.cs__town { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cs__kinds { display: flex; gap: 8px; }
.cs__kinds label { position: relative; }
.cs__kinds input { position: absolute; opacity: 0; inset: 0; }
.cs__kinds span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 99px; box-shadow: inset 0 0 0 2px var(--field-line); font-weight: 700; font-size: 15px; cursor: pointer; }
.cs__kinds input:checked + span { background: var(--ink); color: var(--paper); box-shadow: none; }
.cs__kinds input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.cs__sub { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cs__shouts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cs__shouts li { padding: 10px 12px; background: var(--ghost); border-radius: 10px; display: grid; gap: 4px; font-size: 15px; }
.cs__shouts small { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.cs__shouts .is-onair { box-shadow: inset 4px 0 0 var(--hot); }
.cs__leave { margin: 22px 0 0; font-size: 13px; color: var(--muted); }
@media (min-width: 768px) { .crew-sheet .sheet__panel { width: 420px; max-height: calc(100vh - var(--player-h) - 40px); } }

/* ================================================================ toast + confetti */
.crew-toast { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--dock-h) + 16px); transform: translate(-50%, 20px); opacity: 0; transition: transform .35s var(--ease), opacity .25s ease;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 99px; background: var(--ink); color: var(--paper); font-weight: 700; box-shadow: 0 12px 30px rgba(13, 10, 15, .3); }
.crew-toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.crew-toast.is-party { background: var(--currant); color: #fff; font-size: 18px; }
@media (min-width: 768px) { .crew-toast { left: calc(50% + var(--side-w) / 2); } }
.crew-confetti { position: fixed; z-index: 81; left: 50%; bottom: calc(var(--dock-h) + 40px); pointer-events: none; }
.crew-confetti i { position: absolute; width: 10px; height: 14px; border-radius: 2px; opacity: 0; animation: crew-burst 1.4s cubic-bezier(.2, .7, .3, 1) var(--d) forwards; }
@keyframes crew-burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }

@media (prefers-reduced-motion: reduce) {
  .ct.is-new, .ct.is-out, .ct.is-glow .ct__card, .cw__lamp, .crew-chip i, .tk__i.is-glow .tk__card, .tk__i.is-new .tk__card { animation: none; }
  .ca__bar i { transition: none; }
}

/* the Crew this week, under the live wall */
.cw__wall--week .ct { opacity: .82; }
