/* Porra del Mundial — match detail with embedded pick-card (scoreboard B).
 * Campaign chrome over a real WC fixture. Reuses .card + .entity-tabs.
 * Mobile-first. Score steppers + presets are the variant-B input.
 */

@layer components {
  /* ─── Match-detail hero ─── */
  .porra-mp-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: var(--space-2) var(--space-4) var(--space-5);
    color: #fff;
    background:
      radial-gradient(70% 90% at 10% 30%, rgb(0 200 245 / 30%) 0%, transparent 60%),
      radial-gradient(70% 90% at 90% 30%, rgb(232 25 91 / 30%) 0%, transparent 60%),
      linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  }

  .porra-mp-hero__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-1) 0 var(--space-2);
  }

  .porra-mp-hero__actions {
    display: flex;
    gap: var(--space-1);
  }

  .porra-mp-hero__comp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
  }

  .porra-mp-hero__comp-badge {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--color-porra-magenta);
    color: #fff;
    font-weight: 800;
    font-size: 9px;
  }

  .porra-mp-hero__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-1) 0;
  }

  .porra-mp-hero__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  .porra-mp-hero__crest {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgb(0 0 0 / 40%));
  }

  .porra-mp-hero__tn {
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 14px;
    letter-spacing: 0.3px;
    color: #fff;
    text-align: center;
  }

  .porra-mp-hero__center {
    text-align: center;
  }

  .porra-mp-hero__kickoff {
    display: block;
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 26px;
    letter-spacing: 0.5px;
    color: #fff;
  }

  .porra-mp-hero__date {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--color-text-muted);
  }

  /* ─── Pick card (variant B) ─── */
  .porra-pickcard {
    position: relative;
    overflow: hidden;
    padding: var(--space-3) var(--space-3) var(--space-2);
    /* border-radius: var(--radius-lg); */
    /* border: 1px solid rgb(232 25 91 / 22%); */
    /* background:
      radial-gradient(120% 100% at 0% 0%, rgb(232 25 91 / 10%) 0%, transparent 55%),
      radial-gradient(120% 100% at 100% 100%, rgb(0 200 245 / 8%) 0%, transparent 55%),
      var(--color-surface); */
  }

  .porra-pickcard__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-subtle);
  }

  .porra-pickcard__head-l {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .porra-pickcard__head-grp {
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 12px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #fff;
  }

  .porra-pickcard__head-md {
    font-family: var(--font-title);
    font-weight: var(--weight-semibold);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  /* Match date + time over the close-deadline countdown (right of the head) —
     date/time filled in the user's TZ on connect; deadline ticks client-side. */
  .porra-pickcard__head-r {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
  }

  .porra-pickcard__head-dt {
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    font-size: 12px;
    color: var(--color-text-muted);
  }

  .porra-pickcard__head-deadline {
    font-family: var(--font-mono);
    font-weight: var(--weight-semibold);
    font-size: 10px;
    color: var(--color-porra-gold);
  }

  .porra-pickcard__status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 4px var(--space-2);
    border-radius: var(--radius-full);
    background: rgb(255 255 255 / 4%);
    border: 1px solid rgb(255 255 255 / 8%);
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    font-size: 11px;
    color: var(--color-accent);
  }

  /* `hidden` guard — the controller toggles [hidden] when there's no saved
     pick; inline-flex would otherwise neutralise the attribute. */
  .porra-pickcard__status[hidden] {
    display: none;
  }

  .porra-pickcard__dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
  }

  /* Board: stepper | : | stepper, flanked by team crests */
  .porra-pickcard__board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0 var(--space-4);
  }

  .porra-pickcard__side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
  }

  .porra-pickcard__crest {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgb(0 0 0 / 40%));
  }

  .porra-pickcard__tn {
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
  }

  .porra-pickcard__score {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-1);
  }

  .porra-pickcard__stepcol {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .porra-pickcard__step {
    width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(255 255 255 / 8%);
    background: rgb(255 255 255 / 4%);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition:
      background var(--duration-fast) var(--easing-default),
      color var(--duration-fast) var(--easing-default);
  }

  .porra-pickcard__step:first-child {
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .porra-pickcard__step:last-child {
    border-top: 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  }

  .porra-pickcard__step svg {
    width: 14px;
    height: 14px;
  }

  @media (hover: hover) {
    .porra-pickcard__step:hover {
      background: var(--color-accent);
      border-color: var(--color-accent);
      color: var(--color-on-accent);
    }
  }

  .porra-pickcard__num {
    margin: var(--space-1) 0;
    min-width: 44px;
    text-align: center;
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 48px;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 12px rgb(0 255 135 / 15%);
  }

  .porra-pickcard__sep {
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 30px;
    color: rgb(255 255 255 / 35%);
  }

  /* Presets */
  .porra-pickcard__presets-lbl {
    display: block;
    margin-bottom: var(--space-2);
    font-family: var(--font-title);
    font-weight: var(--weight-semibold);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  .porra-pickcard__presets-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-1);
  }

  .porra-pickcard__preset {
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid rgb(255 255 255 / 8%);
    background: rgb(255 255 255 / 4%);
    color: var(--color-text-secondary);
    font-family: var(--font-title);
    font-weight: var(--weight-semibold);
    font-size: 12px;
    cursor: pointer;
  }

  @media (hover: hover) {
    .porra-pickcard__preset:hover {
      background: rgb(255 255 255 / 8%);
      color: #fff;
    }
  }

  .porra-pickcard__preset.is-active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-on-accent);
  }

  .porra-pickcard__preset.is-popular {
    margin-bottom: var(--space-3);
  }

  .porra-pickcard__preset.is-popular::after {
    content: "★";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 7px;
    color: var(--color-porra-gold);
  }

  .porra-pickcard__preset em {
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    font-family: var(--font-mono);
    font-size: 9px;
    font-style: normal;
    text-align: center;
    color: var(--color-porra-gold);
  }

  .porra-pickcard__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-subtle);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-text-muted);
  }

  /* Delete pinned to the far right; the saved badge sits on the left (the foot
     is space-between, but margin-left:auto keeps delete right even while the
     badge is still hidden — no pick saved yet). */
  .porra-pickcard__delete {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    min-height: 44px;
    border: 0;
    background: none;
    padding: 0 var(--space-2);
    font-family: var(--font-body);
    font-weight: var(--weight-semibold);
    font-size: 11px;
    color: var(--color-text-muted);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    cursor: pointer;
  }

  @media (hover: hover) {
    .porra-pickcard__delete:hover {
      color: var(--color-loss);
    }
  }

  /* ─── Crowd tendency (on .card) ─── */
  .porra-crowd__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
  }

  .porra-crowd__title {
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
  }

  .porra-crowd__n {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 10px;
    color: var(--color-text-muted);
  }

  .porra-crowd__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }

  .porra-crowd__grid[hidden] {
    display: none;
  }

  /* Crowd-trend empty state — GET /fixtures/{id}/crowd is 501, so no real
     split is available yet. Neutral note (no fake percentages). */
  .porra-crowd__empty {
    margin: 0;
    padding: var(--space-3) var(--space-2);
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-text-muted);
  }

  .porra-crowd__cell {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-2) 18px;
    border-radius: var(--radius-md);
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border-subtle);
  }

  .porra-crowd__crest {
    width: 22px;
    height: 22px;
    object-fit: contain;
  }

  .porra-crowd__x {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    background: rgb(255 255 255 / 6%);
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 12px;
    color: var(--color-text-muted);
  }

  .porra-crowd__lbl {
    font-family: var(--font-title);
    font-weight: var(--weight-semibold);
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  .porra-crowd__val {
    font-family: var(--font-title);
    font-weight: var(--weight-bold);
    font-size: 16px;
    color: #fff;
  }

  .porra-crowd__bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: var(--color-porra-cyan);
  }

  .porra-crowd__bar--draw {
    background: rgb(255 255 255 / 40%);
  }

  .porra-crowd__bar--away {
    background: var(--color-porra-magenta);
  }

  .porra-crowd__pop {
    margin: var(--space-3) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-subtle);
    text-align: center;
    font-size: 11px;
    color: var(--color-text-muted);
  }
}
