
/* M2-06 post-match shell — presentation only. */
.m2-post-match-shell {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 16, .66);
  backdrop-filter: blur(8px);
}
.m2-post-match-shell[hidden] { display: none; }
.m2-post-match-card {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  padding: 26px;
  text-align: center;
  background: rgba(14, 20, 34, .96);
  box-shadow: 0 20px 70px rgba(0,0,0,.45);
}
.m2-post-match-kicker {
  display: block;
  margin-bottom: 7px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--muted);
}
.m2-post-match-card h2 { margin: 0 0 8px; font-size: 2rem; }
.m2-post-match-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.m2-post-match-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.m2-post-match-actions button {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.m2-post-match-actions button:first-child {
  background: rgba(255,255,255,.14);
}
/* B1 — one-tap rematch: the primary action, focused by default. */
.m2-post-match-actions button.m2-post-match-rematch {
  grid-column: 1 / -1;
  min-height: 52px;
  font-size: 1.05rem;
  background: #f5c542;
  border-color: #f5c542;
  color: #1a1405;
}
.m2-post-match-actions button.m2-post-match-rematch:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.m2-post-match-card .m2-post-match-rematch-note {
  margin-top: 8px;
  font-size: .85rem;
}
/* PL-5 — "<name> invited you to a rematch. [Join] Open for N s" (online only, when an offer exists). */
.m2-post-match-card .m2-post-match-offer {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 197, 66, .14);
  color: var(--text);
}
.m2-post-match-offer button {
  min-height: 36px;
  margin: 0 6px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #f5c542;
  background: #f5c542;
  color: #1a1405;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.m2-post-match-offer-time { font-size: .85rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .m2-post-match-shell { backdrop-filter: none; }
}

/* QA-10 — the victory moment: winner portrait, equipped Victory effect + set, stats, share. */
.m2-post-match-card {
  position: relative;
  overflow: hidden;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.m2-post-match-card[data-result="victory"] {
  border-color: rgba(255, 214, 102, .55);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 214, 102, .22), transparent 58%),
    rgba(14, 20, 34, .97);
  box-shadow: 0 0 0 1px rgba(255, 214, 102, .18), 0 24px 80px rgba(0,0,0,.55), 0 0 60px rgba(255, 196, 64, .18);
}
.m2-post-match-card[data-result="victory"] h2 {
  font-size: 2.4rem;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #fff6d0, #ffc940);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.m2-post-match-card > *:not(.m2-victory-burst) { position: relative; z-index: 1; }

.m2-victory-portrait {
  width: 84px;
  height: 84px;
  margin: 4px auto 10px;
  border-radius: 50%;
  border: 3px solid var(--team-ink, #fff);
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.22), rgba(10,14,28,.9) 70%);
  box-shadow: 0 0 0 4px rgba(0,0,0,.35), 0 0 26px var(--team-ink, #fff);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.m2-victory-portrait img { width: 150%; height: 150%; object-fit: cover; object-position: center 36%; }
.m2-victory-portrait span { font-size: 2rem; font-weight: 800; color: var(--team-ink, #fff); }
.m2-post-match-card[data-result="victory"] .m2-victory-portrait { animation: m2-victory-rise .7s cubic-bezier(.2,1.4,.4,1) both; }

.m2-victory-loadout {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  text-align: left;
}
.m2-victory-loadout img { width: 64px; height: 64px; border-radius: 10px; display: block; }
.m2-victory-loadout span {
  display: block;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--muted);
}
.m2-victory-loadout strong { display: inline-block; margin: 1px 6px 4px 0; font-size: .98rem; }
.m2-victory-loadout em {
  display: inline-block;
  font-style: normal;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 1px 6px;
  border-radius: 6px;
  vertical-align: 2px;
  background: rgba(255,255,255,.12);
}
.m2-victory-loadout em[data-rarity="rare"] { background: rgba(97, 160, 255, .3); }
.m2-victory-loadout em[data-rarity="epic"] { background: rgba(185, 110, 255, .35); }
.m2-victory-loadout em[data-rarity="legendary"] { background: rgba(255, 196, 64, .35); }

.m2-post-match-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.m2-post-match-stats div {
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
}
.m2-post-match-stats span { display: block; font-size: .6rem; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.m2-post-match-stats strong { font-size: 1.25rem; }

.m2-post-match-actions .m2-post-match-share {
  background: linear-gradient(180deg, rgba(255, 214, 102, .28), rgba(255, 196, 64, .14));
  border-color: rgba(255, 214, 102, .5);
}
.m2-post-match-share-status {
  margin-top: 10px !important;
  font-size: .82rem;
  word-break: break-word;
  user-select: text;
}
.m2-post-match-share-status[hidden] { display: none; }

/* The equipped Victory effect, played on the card. */
.m2-victory-burst {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.m2-victory-burst i {
  position: absolute;
  top: -12px;
  left: calc((var(--i) * 5.6%) + 2%);
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  background: hsl(calc(var(--i) * 47deg), 85%, 62%);
  animation: m2-confetti-fall 2.6s cubic-bezier(.3,.6,.5,1) calc(var(--i) * 70ms) 2 both;
}
.m2-victory-burst[data-effect="crown-storm"] i {
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: none;
  animation-name: m2-crown-fall;
}
.m2-victory-burst[data-effect="crown-storm"] i::before {
  content: '\265B';
  font-style: normal;
  font-size: 15px;
  line-height: 1;
  color: #ffd45a;
  text-shadow: 0 0 8px rgba(255, 212, 90, .9);
}
.m2-victory-burst[data-effect="crown-storm"] i:nth-child(3n)::before { content: '\2726'; color: #fff3b0; font-size: 12px; }

@keyframes m2-confetti-fall {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translateY(520px) rotate(calc(160deg + var(--i) * 40deg)); }
}
@keyframes m2-crown-fall {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  12% { opacity: 1; transform: translateY(40px) scale(1.15); }
  100% { opacity: 0; transform: translateY(520px) scale(.9) rotate(calc(var(--i) * 12deg)); }
}
@keyframes m2-victory-rise {
  0% { opacity: 0; transform: translateY(14px) scale(.7); }
  100% { opacity: 1; transform: none; }
}

body.calm .m2-victory-burst i,
body.performance-mode .m2-victory-burst i,
body.calm .m2-victory-portrait,
body.performance-mode .m2-victory-portrait { animation: none !important; }
body.calm .m2-victory-burst i,
body.performance-mode .m2-victory-burst i { opacity: .55; transform: translateY(calc(20px + var(--i) * 9px)); }

@media (prefers-reduced-motion: reduce) {
  .m2-victory-burst i,
  .m2-victory-portrait { animation: none !important; }
  .m2-victory-burst i { opacity: .55; transform: translateY(calc(20px + var(--i) * 9px)); }
}

@media (max-width: 420px) {
  .m2-post-match-card { padding: 20px 16px; }
  .m2-post-match-card[data-result="victory"] h2 { font-size: 2rem; }
  .m2-victory-portrait { width: 70px; height: 70px; }
}

/* Placements (2026-11-30): final 1st–4th standings on the post-match card. */
.m2-post-match-standings {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: grid; gap: 4px;
}
.m2-post-match-standings li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(255,255,255,.05);
}
.m2-post-match-standings li[data-you="true"] { background: rgba(255,255,255,.14); }
.m2-post-match-standings span { font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: var(--muted); }

/* PL-1 (2026-11-30): on a phone the game topbar grows into the free row above the board (game-layout.css,
   max-width 760px) and sits at z-index 120 (experience.css), over this shell's 60, so it hid the card's
   title and "took 1st" line. On a phone the finished-match shell goes above the topbar. Desktop is unchanged. */
@media (max-width: 760px) {
  .m2-post-match-shell { z-index: 121; }
}

/* PL-4 (2026-11-30): after B1 the desktop card grew (47-853 at 1366x900), so its top slid under the
   game topbar (z-index 120, above this shell's 60). On desktop the shell starts below the topbar and the
   card's max height leaves room for it, so a tall card scrolls inside itself instead. Phone rules above
   (PL-1, max-width 760px) are unchanged. */
@media (min-width: 761px) {
  .m2-post-match-shell { padding-top: calc(var(--game-topbar-height, 58px) + 12px); }
  .m2-post-match-card {
    max-height: calc(100vh - var(--game-topbar-height, 58px) - 32px);
    max-height: calc(100dvh - var(--game-topbar-height, 58px) - 32px);
  }
}
