.player-card-wrap {
  display: grid;
  justify-items: center;
  padding: 4px 3px 20px;
}
.player-flip-card {
  --pc-accent: #efc184;
  --pc-glow: #80513d;
  --fc-radius: 24px;
  position: relative;
  display: block;
  width: min(100%, 380px);
  height: clamp(400px, 125vw, 506px);
  border-radius: var(--fc-radius);
  perspective: 1100px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
  color: #fff7ea;
  text-align: left;
}
.player-flip-card[data-tone="1"] {
  --pc-accent: #93d9df;
  --pc-glow: #345e6c;
}
.player-flip-card[data-tone="2"] {
  --pc-accent: #ceb3f4;
  --pc-glow: #644276;
}
.player-flip-card[data-tone="3"] {
  --pc-accent: #f8b6a2;
  --pc-glow: #813e4d;
}
.player-flip-card[data-dragging] {
  cursor: grabbing;
}
.player-flip-card .flip-card__shadow {
  position: absolute;
  inset: 13% 9% -4%;
  background: #21170b4a;
  border-radius: inherit;
  filter: blur(22px);
  pointer-events: none;
}
.player-flip-card .flip-card__rotor {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.player-flip-card .flip-card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--fc-radius);
  background: #242128;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid #ffffff21;
}
.player-flip-card .flip-card__face--back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: clamp(18px, 5vw, 26px);
  background:
    radial-gradient(ellipse at 100% 0, var(--pc-glow), transparent 72%), #221e26;
}
.player-flip-card .flip-card__glare {
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--fc-gx, 50%) var(--fc-gy, 50%),
    #ffffff30,
    #ffffff08 38%,
    transparent 72%
  );
  opacity: var(--fc-sheen, 0);
  pointer-events: none;
}
.player-flip-card :is(h2, h3, p) {
  margin: 0;
  color: inherit;
}
.player-flip-card button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.player-flip-card button:focus-visible {
  outline: 2px solid var(--pc-accent);
  outline-offset: -4px;
}
.pc-photo,
.pc-photo-empty,
.pc-photo-wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.pc-photo {
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
}
.pc-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(ellipse at 25% 15%, var(--pc-glow), transparent 70%),
    linear-gradient(145deg, #343039, #1a181f);
}
.pc-photo-empty strong {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 144px;
  font-weight: 500;
  color: var(--pc-accent);
  text-shadow: 0 0 60px #ffffff15;
}
.pc-orbit {
  position: absolute;
  width: 76%;
  aspect-ratio: 1;
  border: 1px solid #ffffff1c;
  border-radius: 50%;
  transform: rotate(-32deg) scaleY(1.25);
}
.pc-orbit::after {
  content: "";
  position: absolute;
  inset: 10px -20px;
  border: 1px solid #ffffff12;
  border-radius: 50%;
}
.pc-photo-wash {
  background: linear-gradient(
    180deg,
    #0e0a1466,
    transparent 32%,
    #120f19ee 100%
  );
  pointer-events: none;
}
.pc-front-brand {
  position: absolute;
  z-index: 2;
  inset: 25px 24px auto;
  pointer-events: none;
}
.pc-front-brand > span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}
.player-flip-card .pc-photo-edit {
  position: absolute;
  top: 20px;
  right: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 10px;
  background: #18141f88;
  border: 1px solid #ffffff40;
  backdrop-filter: blur(12px);
  border-radius: 999px;
  font-size: 11px;
}
.pc-front-caption {
  position: absolute;
  z-index: 2;
  inset: auto 26px 30px;
  pointer-events: none;
}
.player-flip-card .pc-front-caption h2 {
  margin: 8px 0 14px;
  font-size: clamp(32px, 9vw, 42px);
  font-weight: 600;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}
.pc-front-caption > span {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  color: var(--pc-accent);
}
.player-flip-card .pc-flip-cover {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  padding: 0;
}
.player-flip-card .pc-flip-cover:active {
  transform: none;
  background: transparent;
}
.pc-back-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--pc-accent);
  font-size: 10px;
  letter-spacing: 0.16em;
}
.pc-back-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.player-flip-card .pc-back-heading h2 {
  font-size: 32px;
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.pc-type {
  flex: none;
  padding: 5px 9px;
  border: 1px solid #ffffff2c;
  border-radius: 7px;
  color: var(--pc-accent);
  font-size: 12px;
}
.pc-rate {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 0;
  border-block: 1px solid #ffffff20;
}
.pc-rate small {
  display: block;
  color: #ffffff9e;
  font-size: 11px;
}
.pc-rate strong {
  display: block;
  margin-top: 5px;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}
.pc-rate em {
  font-style: normal;
  font-size: 18px;
  margin-right: 4px;
}
.pc-rate strong small {
  display: inline;
  font-weight: 400;
}
.pc-rate > span {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 3px;
  font-size: 10px;
  white-space: nowrap;
  color: var(--pc-accent);
}
.pc-back-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  touch-action: pan-y;
}
.pc-back-body section + section {
  margin-top: 16px;
}
.player-flip-card .pc-back-body h3 {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 500;
  color: #ffffff82;
}
.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pc-tags > span {
  padding: 4px 8px;
  border-radius: 5px;
  background: #ffffff0d;
  border: 1px solid #ffffff15;
  font-size: 11px;
}
.player-flip-card .pc-intro {
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.player-flip-card .pc-unfilled {
  color: #ffffff96;
  font-size: 12px;
  line-height: 1.7;
}
.pc-back-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #ffffff20;
  flex: none;
}
.player-flip-card .pc-back-actions button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-height: 40px;
  padding: 0 5px;
  font-size: 12px;
  border-radius: 7px;
  background: #ffffff09;
  border: 1px solid #ffffff0d;
}
.player-flip-card .pc-back-actions button:nth-child(2) {
  background: var(--pc-accent);
  color: #251f2b;
  font-weight: 600;
}
.player-flip-card[data-fade] .flip-card__face {
  transform: none;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  opacity: 0;
}
.player-flip-card[data-fade="front"] .flip-card__face--front,
.player-flip-card[data-fade="back"] .flip-card__face--back {
  opacity: 1;
}
.pc-editor-photo {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 3/4;
  margin: 0 auto 20px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--panel2);
  border: 1px solid var(--border);
}
.pc-editor-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pc-editor-photo > span {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  position: absolute;
  inset: 0;
  color: var(--muted);
}
.pc-editor-photo small {
  font-size: 11px;
}
.pc-editor-photo.has-photo > span {
  display: none;
}
.pc-editor-tags {
  margin: 20px 0;
}
#dialog .pc-editor-tags .pick {
  font-size: 12px;
}
#dialog form[data-form="playerCard"] input[type="range"] {
  padding: 10px 0;
  accent-color: var(--accent);
}
@media (max-width: 350px) {
  .player-flip-card .flip-card__face--back {
    gap: 12px;
  }
  .pc-front-brand {
    left: 18px;
  }
  .pc-front-brand > span {
    font-size: 11px;
  }
  .pc-front-caption {
    left: 21px;
    right: 21px;
  }
  .pc-back-heading {
    gap: 5px;
  }
  .player-flip-card .pc-back-heading h2 {
    font-size: 28px;
  }
  .pc-type {
    padding-inline: 6px;
  }
}
