/* consistent card sizes: full cards and empty slots share one height; support cards match superstar cards */
.card:not(.tiny) {
  height: 204px;
}
.card.support .art {
  height: 76px;
}
.card.support .art img {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}
.card .stats {
  min-height: 42px;
  align-content: start;
}
.card.tiny {
  height: 128px;
}
.card.tiny .stats {
  min-height: 40px;
}
.card.support.tiny .art {
  height: 48px;
}
.card.support.tiny .art img {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
}
.card .nm {
  min-height: 26px;
}
.slot {
  min-height: 204px;
}
.slots .slot.filled {
  height: 204px;
}
.reveal .card.lg {
  height: auto;
}
.fight .card.tiny {
  height: auto;
}

/* draft board: every cell is the same size regardless of label */
.board button {
  min-height: 0;
  height: auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 2px;
  line-height: 16px;
}
.board button.rev {
  font-size: 16px;
  line-height: 16px;
  white-space: normal;
  word-break: break-word;
}
.board button.rev .k {
  font-size: 16px;
  line-height: 16px;
  opacity: 0.85;
}
.board button.rev .n {
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 16px;
}

/* ===== overlay layer: reveals sit on top of the page, centred in the app column ===== */
@keyframes fadein {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
#overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
#overlay .ovbg {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 15, 0.74);
  animation: fadein 0.2s steps(3) both;
  cursor: pointer;
}
#overlay .reveal {
  width: min(100%, 380px);
  max-height: 100%;
  overflow: auto;
  margin: 0;
  cursor: pointer;
  box-shadow:
    0 0 0 var(--px) var(--gold),
    8px 8px 0 var(--lo);
}
#overlay .reveal .tap {
  position: relative;
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  color: var(--muted);
  animation: blink 1s steps(2) infinite;
  margin-top: 4px;
}
#overlay .reveal .pull {
  font-size: 16px;
}
#overlay .reveal .title {
  position: relative;
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 24px;
  color: var(--fg);
  text-align: center;
  text-transform: uppercase;
}

.card.back {
  height: auto;
  min-height: 272px;
  width: 216px;
  max-width: 100%;
  cursor: default;
  background: repeating-linear-gradient(45deg, var(--panel2) 0 4px, var(--lo) 4px 8px);
}
.card.back .ribbon {
  order: 0;
}
.card.back .nm {
  order: 1;
  background: var(--lo);
}
.card.back .bk {
  order: 2;
  padding: 6px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  align-items: start;
}
.card.back .bk .eyebrow {
  color: var(--gold);
}
.card.back .bars {
  order: 3;
  margin-top: auto;
  padding: 4px 6px 6px;
  display: grid;
  gap: 2px;
}
.card.back .bars i {
  display: block;
  height: 4px;
}
.card.back .bars .s0 {
  background: var(--pow);
}
.card.back .bars .s1 {
  background: var(--tgh);
}
.card.back .bars .s2 {
  background: var(--spd);
}
.card.back .bars .s3 {
  background: var(--cha);
}
.opp img {
  image-rendering: pixelated;
}
.stip {
  animation: slide-l 0.25s steps(4) both;
}
.arena .score {
  margin-top: 0;
}
/* ===== matchup stage: corner preview, intro, boosts, choreography, verdict ===== */
.corner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
  margin: 8px 0 4px;
  padding: 8px;
  background: var(--lo);
  border: var(--px) solid var(--line);
}
.corner .side {
  display: flex;
  gap: 6px;
  justify-content: center;
  min-height: 84px;
  align-items: flex-end;
}
.corner .side.op {
  flex-direction: row-reverse;
}
.corner .vs {
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--gold);
  padding-bottom: 28px;
}
.corner .who {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 72px;
}
.corner .who img {
  animation: bob 0.5s steps(2) infinite;
}
.corner .who .plate {
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  text-transform: uppercase;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--tc);
  color: #fff;
  padding: 0 4px;
}
.corner .who.empty {
  width: 72px;
  height: 84px;
  border: var(--px) dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--f-display);
}
.stage {
  position: relative;
  height: 356px;
  margin: 8px 0;
  overflow: hidden;
  background: var(--lo);
  border: var(--px) solid var(--line);
  cursor: pointer;
  user-select: none;
}
.stage .mat {
  position: absolute;
  inset: 0;
  background-image: var(--ring);
  background-repeat: repeat-x;
  background-position: top center;
  background-size: 192px 80px;
}
.stage .floor {
  position: absolute;
  left: 0;
  right: 0;
  top: 80px;
  bottom: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 8px), #2a3147;
}
.stage .actor {
  position: absolute;
  bottom: 36px;
  width: 64px;
  display: grid;
  justify-items: center;
  gap: 2px;
  transition: none;
}
.stage .actor img {
  display: block;
}
.stage .actor .plate {
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  text-transform: uppercase;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--tc);
  color: #fff;
  padding: 0 4px;
  margin-top: -2px;
}
.stage .actor.me.p0 {
  left: 16%;
}
.stage .actor.me.p1 {
  left: 0;
  bottom: 62px;
  opacity: 0.75;
  z-index: 0;
}
.stage .actor.me.p0,
.stage .actor.op.p0 {
  z-index: 1;
}
.stage .actor.op.p0 {
  right: 16%;
}
.stage .actor.op.p1 {
  right: 0;
  bottom: 62px;
  opacity: 0.75;
  z-index: 0;
}
.stage .actor.hid {
  visibility: hidden;
}
.stage .tot {
  position: absolute;
  bottom: 4px;
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 24px;
  padding: 0 8px;
  background: var(--panel);
  border: var(--px) solid var(--line);
  min-width: 72px;
  text-align: center;
}
.stage .tot.me {
  left: 8px;
}
.stage .tot.op {
  right: 8px;
}
.stage .tot.win {
  color: var(--ok);
  border-color: var(--ok);
}
.stage .tot.lose {
  color: #ff8a9a;
  border-color: var(--bad);
}
.stage .boosts {
  position: absolute;
  top: 112px;
  display: grid;
  gap: 4px;
  max-width: 48%;
  z-index: 2;
}
.stage .boosts.me {
  left: 6px;
}
.stage .boosts.op {
  right: 6px;
  justify-items: end;
}
.stage .bchip {
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  padding: 2px 6px;
  background: var(--panel2);
  border: var(--px) solid var(--line);
  animation: pop-in 0.3s steps(4) both;
  white-space: normal;
  max-width: 100%;
}
.stage .bchip.sig {
  border-color: var(--gold);
  color: var(--gold);
  animation:
    pop-in 0.3s steps(4) both,
    glow-text 0.8s steps(2) 0.3s infinite;
}
.stage .bchip.align {
  border-color: var(--rope-blue);
}
.stage .bchip.support {
  border-color: var(--ok);
}
.stage .bchip.debuff {
  border-color: var(--bad);
  color: #ff8a9a;
}
.stage .mid {
  position: absolute;
  left: 0;
  right: 0;
  top: 86px;
  display: grid;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 3;
}
.stage .mid .stip {
  background: var(--lo);
  padding: 2px 4px;
}
.stage .shadow {
  top: auto;
  bottom: 36px;
}
.stage .mid .stip {
  animation: none;
}
.stage .verdict {
  position: absolute;
  top: -62px;
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 24px;
  padding: 4px 10px;
  background: var(--lo);
  border: var(--px) solid var(--gold);
  color: var(--gold);
  animation:
    pop-in 0.35s steps(4) both,
    glow-text 1s steps(2) 0.4s infinite;
}
.stage .verdict.lose {
  color: #ff8a9a;
  border-color: var(--bad);
  animation: pop-in 0.35s steps(4) both;
}
.stage .hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  color: var(--muted);
  animation: blink 1s steps(2) infinite;
  background: var(--lo);
  padding: 0 4px;
}
.stage .burst {
  position: absolute;
  animation: burst 0.45s steps(5) both;
  pointer-events: none;
}
.stage .shadow {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  bottom: 48px;
  background: rgba(0, 0, 0, 0.35);
}
/* actor moves (stepped, 2px grid) */
@keyframes a-in-l {
  0% {
    transform: translateX(-120px);
  }
  100% {
    transform: none;
  }
}
@keyframes a-in-r {
  0% {
    transform: translateX(120px);
  }
  100% {
    transform: none;
  }
}
@keyframes a-lunge-r {
  0% {
    transform: none;
  }
  100% {
    transform: translateX(52px);
  }
}
@keyframes a-lunge-l {
  0% {
    transform: none;
  }
  100% {
    transform: translateX(-52px);
  }
}
@keyframes a-back-r {
  0% {
    transform: translateX(52px);
  }
  100% {
    transform: none;
  }
}
@keyframes a-back-l {
  0% {
    transform: translateX(-52px);
  }
  100% {
    transform: none;
  }
}
@keyframes a-hit {
  0%,
  100% {
    transform: var(--base, none);
  }
  30% {
    transform: var(--base, none) translate(-6px, -2px);
  }
  60% {
    transform: var(--base, none) translate(4px, 0);
  }
}
@keyframes a-fall-l {
  0% {
    transform: var(--base, none);
  }
  100% {
    transform: var(--base, none) translate(-8px, 14px) rotate(-90deg);
    opacity: 0.65;
  }
}
@keyframes a-fall-r {
  0% {
    transform: var(--base, none);
  }
  100% {
    transform: var(--base, none) translate(8px, 14px) rotate(90deg);
    opacity: 0.65;
  }
}
@keyframes a-lift {
  0% {
    transform: var(--base, none);
  }
  100% {
    transform: var(--base, none) translateY(-44px);
  }
}
@keyframes a-slam-l {
  0% {
    transform: var(--base, none) translateY(-44px);
  }
  100% {
    transform: var(--base, none) translate(-8px, 14px) rotate(-90deg);
    opacity: 0.65;
  }
}
@keyframes a-slam-r {
  0% {
    transform: var(--base, none) translateY(-44px);
  }
  100% {
    transform: var(--base, none) translate(8px, 14px) rotate(90deg);
    opacity: 0.65;
  }
}
@keyframes a-jump-r {
  0% {
    transform: none;
  }
  50% {
    transform: translate(30px, -70px);
  }
  100% {
    transform: translate(60px, -4px);
  }
}
@keyframes a-jump-l {
  0% {
    transform: none;
  }
  50% {
    transform: translate(-30px, -70px);
  }
  100% {
    transform: translate(-60px, -4px);
  }
}
@keyframes a-whiff-r {
  0% {
    transform: none;
  }
  60% {
    transform: translateX(150px);
  }
  100% {
    transform: translateX(90px);
  }
}
@keyframes a-whiff-l {
  0% {
    transform: none;
  }
  60% {
    transform: translateX(-150px);
  }
  100% {
    transform: translateX(-90px);
  }
}
@keyframes a-taunt {
  0%,
  100% {
    transform: none;
  }
  25% {
    transform: translateY(-6px);
  }
  50% {
    transform: none;
  }
  75% {
    transform: translateY(-6px);
  }
}
@keyframes a-tagin-r {
  0% {
    transform: none;
    opacity: 0.75;
  }
  100% {
    transform: translate(46px, 8px);
    opacity: 1;
  }
}
@keyframes a-tagin-l {
  0% {
    transform: none;
    opacity: 0.75;
  }
  100% {
    transform: translate(-46px, 8px);
    opacity: 1;
  }
}
@keyframes a-tagout-l {
  0% {
    transform: none;
  }
  100% {
    transform: translate(-40px, -6px);
    opacity: 0.5;
  }
}
@keyframes a-tagout-r {
  0% {
    transform: none;
  }
  100% {
    transform: translate(40px, -6px);
    opacity: 0.5;
  }
}
@keyframes a-flash {
  0% {
    filter: brightness(3);
  }
  100% {
    filter: none;
  }
}
.stage.shake {
  animation: shake 0.3s steps(4) 1;
}
.stage .actor.flash img {
  animation: a-flash 0.35s steps(3) 1;
}

.krow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.kslot {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 4px 2px;
  background: var(--bg2);
  border: var(--px) solid var(--line);
}
.kslot.sel {
  border-color: var(--gold);
  animation: glow-gold 1s steps(2) infinite;
}
.kslot.rest {
  opacity: 0.85;
}
.kslot .kcard {
  background: var(--tc);
  border: var(--px) solid var(--lo);
  padding: 2px 0 0;
  width: 100%;
  display: grid;
  justify-items: center;
  cursor: pointer;
}
.kslot .kcard img {
  display: block;
}
.kslot .kname,
.kslot .ktier {
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}
.kslot .ktier {
  background: var(--lo);
  color: var(--muted);
}
.kslot .bar {
  width: 100%;
}
.kslot .kst {
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  color: var(--muted);
}
.kslot .btn.small {
  padding: 2px 6px;
  width: 100%;
}
@media (max-width: 460px) {
  .krow {
    grid-template-columns: repeat(3, 1fr);
  }
}

.standings {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}
.srow {
  display: grid;
  grid-template-columns: 28px 1fr 56px 64px 44px;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  background: var(--bg2);
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
}
.srow.q {
  background: var(--panel2);
}
.srow.me {
  background: var(--lo);
  box-shadow: inset 0 0 0 var(--px) var(--gold);
  color: var(--gold);
}
.srow .pos {
  color: var(--muted);
  text-align: right;
}
.srow.me .pos {
  color: var(--gold);
}
.srow .nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}
.srow .nm .badge {
  font-size: 16px;
  padding: 0 4px;
  margin-left: 4px;
}
.srow .rec {
  text-align: right;
}
.srow .wbar {
  height: 8px;
  background: var(--lo);
  border: var(--px) solid var(--line);
  padding: var(--px);
}
.srow .wbar i {
  display: block;
  height: 100%;
  background: var(--ok);
}
.srow.me .wbar i {
  background: var(--gold);
}
.srow .pct {
  text-align: right;
  color: var(--muted);
}
.cut {
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  padding: 4px 0;
  border-top: var(--px) dashed var(--gold);
  border-bottom: var(--px) dashed var(--gold);
  margin: 2px 0;
}
@media (max-width: 380px) {
  .srow {
    grid-template-columns: 24px 1fr 52px 44px;
  }
  .srow .wbar {
    display: none;
  }
}

.profile {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.pf-id {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.pf-ring {
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 24px;
  text-transform: uppercase;
  color: var(--gold);
}

.pf-av {
  width: 72px;
  height: 72px;
  background: var(--tc);
  border: var(--px) solid var(--lo);
  box-shadow: 0 0 0 var(--px) var(--gold);
  display: grid;
  place-items: center;
  flex: none;
}

.face {
  display: inline-block;
  width: 32px;
  height: 32px;
  overflow: hidden;
  vertical-align: middle;
  background: var(--lo);
  box-shadow: 0 0 0 var(--px) var(--line);
}
.face img {
  margin: -6px 0 0 -16px;
  max-width: none;
}
.opp {
  grid-template-columns: 64px 1fr;
  align-items: center;
}
.opp .oav {
  width: 64px;
  height: 64px;
  background: var(--tc);
  border: var(--px) solid var(--lo);
  display: grid;
  place-items: center;
  grid-row: 1/3;
}
.opp .oav img {
  display: block;
}
.srow {
  grid-template-columns: 28px 32px 1fr 56px 64px 44px;
}
@media (max-width: 380px) {
  .srow {
    grid-template-columns: 24px 32px 1fr 52px 44px;
  }
}
table .face {
  margin-right: 4px;
}

.rtg-cur {
  display: grid;
  grid-template-columns: 216px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 8px;
}
.rtg-curcard .card {
  animation: glow-gold 1s steps(2) infinite;
}
.rtg-name {
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 24px;
  text-transform: uppercase;
  color: var(--gold);
}
.rtg-path {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.rtg-step {
  flex: 0 0 128px;
  display: grid;
  gap: 4px;
}
.rtg-step .card {
  cursor: default;
}
.rtg-step .card:hover {
  transform: none;
}
.rtg-step.done .card {
  filter: none;
  opacity: 0.9;
}
.rtg-step.done .card::after {
  content: '✔';
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  background: var(--ok);
  color: #1a1c2c;
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  padding: 0 4px;
}
.rtg-step.next .card {
  opacity: 0.55;
  filter: grayscale(0.5);
}
.rtg-step .card.dim {
  cursor: default;
}
.rtg-pts {
  font-family: var(--f-cond);
  font-size: 16px;
  line-height: 16px;
  text-align: center;
  color: var(--muted);
}
.rtg-step.cur .rtg-pts {
  color: var(--gold);
}
@media (max-width: 480px) {
  .rtg-cur {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.pcc-intro {
  margin-top: 8px;
  padding: 12px 8px;
  background: var(--lo);
  border: var(--px) solid var(--line);
  background-image: var(--ring);
  background-repeat: repeat-x;
  background-position: top center;
  background-size: 192px 80px;
  padding-top: 88px;
  position: relative;
  overflow: hidden;
}
.pcc-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.pcc-side {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}
.pcc-side .pcc-card {
  width: 150px;
  max-width: 100%;
}
.pcc-side .pcc-card .card {
  animation: glow-gold 1s steps(2) 1.2s infinite;
}
.pcc-side.l {
  animation: slide-l 0.5s steps(5) both;
}
.pcc-side.r {
  animation: slide-r 0.5s steps(5) 0.15s both;
}
.pcc-side .btn {
  animation: pop-in 0.3s steps(4) 1s both;
  max-width: 100%;
  white-space: normal;
}
.pcc-mid {
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--gold);
  animation:
    pop-in 0.4s steps(4) 0.6s both,
    glow-text 1s steps(2) 1s infinite;
}
.pcc-note {
  animation: px-in 0.3s steps(4) 1.2s both;
  margin-top: 10px;
}
@media (max-width: 420px) {
  .pcc-side .pcc-card {
    width: 124px;
  }
}
