/* The rounds, dealt as trading cards (roundcard.js).

   A sheet of its own, on every page, because three walls deal the same card:
   the front page's and the workshop's, under the club's sheet, and the strip
   of other rounds under a race, under the race's — and those two are never
   enabled together.

   Rounded, against the charter's square corners, on purpose: a trading card
   is an object with its own shape, the way the channel's television is. */

.round-cards {
  display: grid;
  /* Four across in the 1240px the wall allows, folding to two and then one. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 262px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem);
  perspective: 1200px;
}

.round-card {
  /* --c, the card's accent, is set on the card by roundcard.js. */
  --rest: -1deg;
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  --r: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r);
  box-shadow: 7px 7px 0 var(--ink);
  color: var(--ink);
  transform: rotate(var(--rest));
}
.round-card:nth-child(2n) { --rest: 1deg; }
.round-card:hover { --rest: 0deg; box-shadow: 11px 11px 0 var(--ink); }
.round-card:has(.round-card__link:focus-visible) { outline: 3px solid var(--cyan); outline-offset: 5px; }

/* Not positioned, so the link's cover below reaches the card's own edge
   rather than stopping at this frame's. */
.round-card__frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  background: var(--warm-paper);
  border: 2px solid var(--ink);
  border-radius: calc(var(--r) - 6px);
  overflow: hidden;
}

/* The cartouche: the card's number, its kind, and the kind's symbol. */
.round-card__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 3px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.round-card__num, .round-card__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 38px;
  padding: 0 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--ink);
}
.round-card__num { font: 400 1.35rem/1 var(--display); }
.round-card__cat {
  text-align: center;
  font: 400 1rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The title is the card's link, and its cover is the whole card: every part
   of it leads to the event. The voted event's button stands above the cover. */
.round-card__link { color: inherit; text-decoration: none; }
.round-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: var(--r);
}
.round-card__link:focus-visible { outline: none; }

/* Over the illustration, which slides up under it, at the lean the comic's
   own panels have. One line: the long names are shortened in roundcard.js
   rather than wrapped here. */
.round-card__title {
  position: relative;
  z-index: 2;
  margin: 2px 4px 0;
  font: 400 clamp(1.6rem, 2.3vw, 1.95rem)/0.95 var(--display);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--c);
  rotate: -3deg;
  transform-origin: left center;
  white-space: nowrap;
}

.round-card__art {
  position: relative;
  margin: -22px -4px -6px;
  aspect-ratio: 1847 / 1710;
}
.round-card__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.round-card__stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
}
.round-card__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  border-left: 2px solid var(--ink);
  text-align: center;
  font: 400 0.9rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.round-card__stat:first-child { border-left: 0; }
.round-card__stat--wide { flex-direction: row; gap: 10px; padding: 10px 12px; }
.round-card__stat--wide b { margin-left: auto; font: 400 1.5rem/1 var(--display); }

.round-card__score {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0 4px;
  white-space: nowrap;
}
.round-card__score .symbol {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--yellow);
  filter: drop-shadow(1.5px 1.5px 0 var(--ink));
}
.round-card__score b { font: 400 1.15rem/1 var(--display); }
.round-card__holder {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font: normal 0.75rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink-70);
}

/* Pushed to the foot, so the buttons of a row line up whatever is above them. */
.round-card__cta {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 9px 16px;
  background: var(--c);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font: 400 1.6rem/1 var(--display);
  text-transform: uppercase;
  text-decoration: none;
}
/* A plain button is the card's: the cover above it takes the click. */
span.round-card__cta { z-index: auto; }
.round-card__cta > span { transform: skewX(-10deg); }
.round-card__cta .symbol { width: 26px; height: 26px; }
.round-card:hover .round-card__cta { translate: -2px -2px; box-shadow: 7px 7px 0 var(--ink); }
.round-card:active .round-card__cta { translate: 4px 4px; box-shadow: 0 0 0 var(--ink); }
a.round-card__cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.round-card__holo {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: var(--r);
  pointer-events: none;
  opacity: 0;
}

/* The tilt toward the pointer and the holographic sheen it drags along. */
@media (prefers-reduced-motion: no-preference) {
  .round-card {
    transform: rotate(var(--rest)) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 220ms;
  }
  .round-card:hover { transition: transform 80ms linear, box-shadow 220ms; }
  .round-card__art img {
    transform: translate(calc((var(--mx) - 50%) * -0.03), calc((var(--my) - 50%) * -0.03));
  }
  .round-card__cta { transition: translate 120ms ease, box-shadow 120ms ease; }
  .round-card__holo {
    mix-blend-mode: color-dodge;
    background:
      radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.55), transparent 38%),
      linear-gradient(115deg, transparent 20%, rgba(47, 240, 230, 0.35) 36%,
        rgba(255, 47, 168, 0.3) 46%, rgba(255, 210, 63, 0.35) 56%, transparent 72%);
    background-size: 100% 100%, 250% 250%;
    background-position: center, var(--mx) var(--my);
    transition: opacity 200ms;
  }
  .round-card:hover .round-card__holo { opacity: 0.6; }
}
