/* ===== 对战装扮: shop sheet, in-match sticker tray / pop, entrance-effect layer ===== */

/* --- shop sheet --- */
.cos-dialog .cos-sub {
  margin: -6px 0 8px;
  font-size: 0.82rem;
  color: var(--mute, #7a7066);
}
.cos-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 2px 6px;
}
.cos-h {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 12px 0 8px;
  font-family: var(--kaiti, serif);
  font-size: 1.02rem;
  letter-spacing: 0.1em;
}
.cos-h small {
  font: 600 0.7rem/1.3 var(--sans, system-ui);
  letter-spacing: 0;
  color: var(--mute, #7a7066);
}
.cos-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 10px;
  margin-bottom: 10px;
  border: 1.5px dashed var(--line, #3a3530);
  border-radius: 14px;
  background: var(--paper-2, #efe4cc);
}
.cos-card.is-owned,
.cos-card.is-equipped {
  border-style: solid;
}
.cos-card.is-equipped {
  border-color: var(--ink, #2a2a2a);
  background: var(--paper, #fff1c9);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.14);
}
.cos-pack-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.cos-name {
  font-family: var(--kaiti, serif);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.cos-cap {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--mute, #7a7066);
}
.cos-minis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.cos-mini svg {
  display: block;
  width: 100%;
  height: auto;
}
.cos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cos-grid .cos-card {
  margin: 0;
  align-items: center;
  text-align: center;
}
.cos-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 78px;
}
.cos-stage-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper, #fff1c9);
  border: 2px solid var(--ink, #2a2a2a);
}
.cos-btn,
.cos-try {
  position: relative;
  min-width: 96px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ink, #2a2a2a);
  background: var(--ink, #2a2a2a);
  color: var(--paper, #fff1c9);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.cos-btn::after,
.cos-try::after {
  content: "";
  position: absolute;
  inset: -5px -3px;
}
.cos-btn:active:not(:disabled),
.cos-try:active {
  transform: scale(0.96);
}
.cos-try {
  height: 28px;
  min-width: 64px;
  background: transparent;
  color: var(--ink, #2a2a2a);
  font-size: 0.76rem;
}
.cos-btn:disabled {
  background: transparent;
  color: var(--mute, #7a7066);
  border-style: dashed;
  border-color: var(--line, #3a3530);
  cursor: default;
}
.cos-btn--equip,
.cos-btn--unequip {
  background: transparent;
  color: var(--ink, #2a2a2a);
}
.cos-btn--confirm {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}
.cos-card--pack .cos-btn {
  align-self: flex-end;
}
[data-theme="dark"] .cos-btn:not(:disabled):not(.cos-btn--equip):not(.cos-btn--unequip):not(.cos-btn--confirm) {
  background: var(--paper, #efe6d4);
  color: var(--ink, #1c1a16);
}
[data-theme="dark"] .cos-card.is-equipped {
  background: var(--paper, #1c1a16);
}

/* --- in-match sticker tray (inside the message picker) --- */
.pvp-sticker-tray {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1.5px dashed var(--line, #3a3530);
}
.pvp-sticker-tray[hidden] {
  display: none;
}
.pvp-sticker-tray-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--mute, #7a7066);
}
.pvp-sticker-tray-shop {
  border: 0;
  background: transparent;
  color: var(--ink, #2a2a2a);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 2px;
}
.pvp-sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.pvp-sticker-btn {
  padding: 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pvp-sticker-btn svg {
  display: block;
  width: 100%;
  height: auto;
}
.pvp-sticker-btn:active:not(:disabled) {
  transform: scale(0.93);
}
.pvp-sticker-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.pvp-sticker-teaser {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pvp-sticker-teaser .pvp-sticker-grid {
  flex: 1 1 auto;
  grid-template-columns: repeat(4, 34px);
  opacity: 0.85;
}

/* the sticker that pops next to a seat when someone sends one */
.pvp-sticker-pop {
  position: absolute;
  top: calc(100% + 6px);
  width: 68px;
  height: 68px;
  z-index: 210;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.pvp-seat-me .pvp-sticker-pop {
  left: 0;
}
.pvp-seat-opp .pvp-sticker-pop {
  right: 0;
}
.pvp-sticker-pop svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.25));
}

/* --- entrance effect layer: a fixed, click-through stage centred on the anchor --- */
.fx-layer {
  position: fixed;
  z-index: 400;
  width: 0;
  height: 0;
  pointer-events: none;
}
.fx-svg {
  position: absolute;
  left: -140px;
  top: -140px;
  overflow: visible;
  pointer-events: none;
}
.fx-svg * {
  transform-box: view-box;
  transform-origin: 0 0;
}
.fx-svg g,
.fx-svg circle,
.fx-svg path {
  transform-origin: 0 0;
}

/* ===== premium stickers (js/sticker-art-premium.js): every moving part is a <g class="stk-*"> ===== */
.stk--grand,
.stk--fine {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}
.stk--grand {
  filter: drop-shadow(0 0 3px rgba(255, 196, 56, 0.7));
}
.stk .stk-twinkle {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: stk-twinkle 1.9s ease-in-out infinite;
}
.stk .stk-bob {
  animation: stk-bob 2.2s ease-in-out infinite;
}
.stk .stk-tear {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: stk-tear 1.6s ease-in infinite;
}
.stk .stk-tear--b {
  animation-delay: 0.5s;
}
.stk .stk-spin-fast {
  animation: stk-spin 1.4s linear infinite;
}
.stk .stk-spin-slow {
  animation: stk-spin 14s linear infinite;
}
.stk .stk-glint {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: stk-twinkle 2.4s ease-in-out infinite;
}
.stk .stk-glint-sweep {
  animation: stk-sweep 3.4s ease-in-out infinite;
}
.stk .stk-glint-diamond {
  animation: stk-sweep-d 2.6s ease-in-out infinite;
}
.stk .stk-steam {
  animation: stk-steam 1.5s ease-in-out infinite;
}
.stk .stk-pulse {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: stk-pulse 1.6s ease-in-out infinite;
}
.stk .stk-rain {
  animation: stk-rain 0.9s linear infinite;
}
.stk .stk-chop-a {
  animation: stk-chop-a 2.2s ease-in-out infinite;
}
.stk .stk-chop-b {
  animation: stk-chop-b 2.2s ease-in-out infinite;
}
.stk .stk-burst {
  animation: stk-burst 1.8s ease-out infinite;
}
.stk .stk-swing {
  animation: stk-swing 1.8s ease-in-out infinite;
}
.stk .stk-fall {
  animation: stk-fall 2.2s linear infinite;
}
.stk .stk-flip {
  animation: stk-flip 2.4s ease-in-out infinite;
}
.stk .stk-shake {
  animation: stk-shake 0.45s linear infinite;
}
.stk .stk-flame {
  animation: stk-flame 0.28s ease-in-out infinite alternate;
}
@keyframes stk-twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.55); }
}
@keyframes stk-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes stk-tear {
  0% { transform: translateY(-2px) scale(0.9); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(9px) scale(1); opacity: 0; }
}
@keyframes stk-spin {
  to { transform: rotate(360deg); }
}
@keyframes stk-sweep {
  0%, 30% { transform: translateX(-30px); opacity: 0; }
  50% { opacity: 1; }
  80%, 100% { transform: translateX(40px); opacity: 0; }
}
@keyframes stk-sweep-d {
  0%, 25% { transform: translate(0, 0); opacity: 0; }
  45% { opacity: 1; }
  70%, 100% { transform: translate(44px, 30px); opacity: 0; }
}
@keyframes stk-steam {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-4px); opacity: 0.45; }
}
@keyframes stk-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes stk-rain {
  0% { transform: translateY(-5px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(7px); opacity: 0; }
}
@keyframes stk-chop-a {
  0%, 35% { transform: translate(0, 0) rotate(0); }
  55%, 85% { transform: translate(-4px, -5px) rotate(-6deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes stk-chop-b {
  0%, 35% { transform: translate(0, 0) rotate(0); }
  55%, 85% { transform: translate(4px, 6px) rotate(6deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes stk-burst {
  0% { transform: scale(0.35); opacity: 0; }
  25% { opacity: 1; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1.22); opacity: 0; }
}
@keyframes stk-swing {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}
@keyframes stk-fall {
  0% { transform: translateY(-4px) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(54px) rotate(280deg); opacity: 0; }
}
@keyframes stk-flip {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.14); }
}
@keyframes stk-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-0.8px, 0.6px); }
  75% { transform: translate(0.8px, -0.6px); }
}
@keyframes stk-flame {
  from { transform: scaleY(0.82); }
  to { transform: scaleY(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  .stk [class^="stk-"],
  .stk [class*=" stk-"] {
    animation: none !important;
  }
}

/* shop cards by tier */
.cos-card--fine {
  border-style: solid;
  border-color: #c9a227;
}
.cos-card--grand {
  border-style: solid;
  border-width: 2px;
  border-color: #b8860b;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 214, 98, 0.3), transparent 70%), var(--paper, #fff1c9);
  box-shadow: 0 0 0 1px rgba(255, 214, 98, 0.5), 3px 3px 0 rgba(0, 0, 0, 0.14);
}
.cos-tier {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff6d2;
  background: #c8321f;
}
.cos-tier--grand {
  background: #b8860b;
}
.cos-card--grand .cos-minis,
.cos-card--fine .cos-minis {
  gap: 6px;
}

/* in-match tray: one tab per owned pack */
.pvp-sticker-packs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.pvp-sticker-packs::-webkit-scrollbar {
  display: none;
}
.pvp-sticker-pack {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1.5px solid var(--line, #3a3530);
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #2a2a2a);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.pvp-sticker-pack.is-on {
  background: var(--ink, #2a2a2a);
  border-color: var(--ink, #2a2a2a);
  color: var(--paper, #fff1c9);
}
[data-theme="dark"] .pvp-sticker-pack.is-on {
  background: var(--paper, #efe6d4);
  border-color: var(--paper, #efe6d4);
  color: var(--ink, #1c1a16);
}

/* entrance cards: same rhythm as the frame cards — fixed 3-line caption, button pinned to the bottom */
.cos-grid .cos-card--fx .cos-cap {
  flex: 1 1 auto;
  width: 100%;
  min-height: 3.9em;
  max-height: 3.9em;
  overflow: hidden;
}
.cos-grid .cos-card--fx .cos-btn {
  margin-top: auto;
}
