.ranked-profile-card .trophy-section {
  margin-top: 12px;
  min-width: 0;
}
.trophy-case {
  padding: 9px 0 11px;
  border-bottom: 1px solid var(--website-line-199-213-171-0_14901960784313725, #c7d5ab26);
}
.ranked-profile-card .trophy-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 24px;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  color: var(--profile-accent, var(--website-ink-208-237-170-1, #d0edaa));
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.trophy-section > header small {
  margin-left: 5px;
  opacity: 0.76;
}
.trophy-grid-actions {
  display: flex;
  gap: 5px;
}
.trophy-grid-actions button {
  min-height: 25px;
  border: 1px solid var(--website-line-185-198-167-0_26666666666666666, #b9c6a744);
  border-radius: 5px;
  padding: 2px 6px;
  color: inherit;
  background: var(--website-surface-18-21-16-0_3215686274509804, #12151052);
  font-family: inherit;
  font-weight: 650;
  font-size: 10px;
  line-height: 1.1;
  cursor: pointer;
}
.trophy-grid-actions button:hover,
.trophy-grid-actions button:focus-visible {
  border-color: currentColor;
}
.trophy-grid-actions button[hidden] {
  display: none;
}
.trophy-awards,
.trophy-badge-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  --trophy-tile-height: 43.47px;
}
.trophy-award {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  box-sizing: border-box;
  width: 94.5%;
  justify-self: center;
  height: var(--trophy-tile-height);
  padding: 0;
  border: 1px solid var(--website-line-194-205-165-0_16862745098039217, #c2cda52b);
  border-radius: 6px;
  color: inherit;
  background: linear-gradient(155deg, var(--website-surface-203-216-165-0_06274509803921569, #cbd8a510), var(--website-surface-18-23-16-0_25098039215686274, #12171040));
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.trophy-award:hover,
.trophy-award:focus-visible {
  border-color: #f1d780a0;
  background: #ad914224;
}
.trophy-award[data-equipped='true'] {
  border-color: #e7c77b75;
  background: #c8a75524;
}
.trophy-equip-note {
  margin: 0 0 6px;
  color: #eee3c6;
  font-size: 11px;
}
.trophy-icon {
  --metal-light: #ffebad;
  --metal-mid: #e9bd59;
  --metal-dark: #996b29;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  color: var(--metal-light);
  filter: drop-shadow(0 2px 2px #0008);
}
.trophy-icon.trophy-silver {
  --metal-light: var(--website-surface-238-246-255-1, #eef6ff);
  --metal-mid: #b2c6dd;
  --metal-dark: #647e9b;
}
.trophy-icon.trophy-bronze {
  --metal-light: #ffcba6;
  --metal-mid: #dc925f;
  --metal-dark: #8d4e31;
}
.trophy-trophy::before {
  content: '';
  position: absolute;
  inset: 19% 8% 42%;
  border: 2px solid var(--metal-mid);
  border-radius: 2px 2px 45% 45%;
}
.trophy-trophy i {
  position: absolute;
  inset: 10% 23% 9%;
  background: linear-gradient(135deg, var(--metal-light), var(--metal-mid) 53%, var(--metal-dark));
  clip-path: polygon(
    0 0,
    100% 0,
    95% 35%,
    85% 51%,
    69% 63%,
    57% 68%,
    57% 84%,
    77% 84%,
    88% 100%,
    12% 100%,
    23% 84%,
    43% 84%,
    43% 68%,
    31% 63%,
    15% 51%,
    5% 35%
  );
}
.trophy-medal::before {
  content: '';
  position: absolute;
  inset: 2% 20% 34%;
  background: linear-gradient(90deg, var(--metal-dark), var(--metal-mid), var(--metal-dark));
  clip-path: polygon(0 0, 32% 0, 50% 29%, 68% 0, 100% 0, 73% 86%, 50% 100%, 27% 86%);
}
.trophy-medal i {
  position: absolute;
  inset: 39% 22% 6%;
  border: 1px solid var(--metal-light);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--metal-dark),
    var(--metal-mid) 64%,
    var(--metal-light) 70%,
    var(--metal-dark)
  );
}
.trophy-crown i {
  width: 94.5%;
  height: 74%;
  background: linear-gradient(
    150deg,
    var(--metal-light),
    var(--metal-mid) 51%,
    var(--metal-dark) 84%
  );
  clip-path: polygon(0 23%, 25% 48%, 50% 0, 75% 48%, 100% 23%, 86% 85%, 14% 85%);
}
.trophy-crown::after {
  content: '';
  position: absolute;
  bottom: 13%;
  width: 62%;
  height: 7%;
  border-radius: 2px;
  background: var(--metal-light);
}
.trophy-case[data-expanded='false'] .trophy-award:nth-child(n + 9),
.trophy-profile-badges[data-expanded='false'] .trophy-badge-slot:nth-child(n + 25) {
  display: none;
}
.trophy-standing-name {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-align: left;
}
.trophy-standing-title {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
}
.trophy-standing-title .styled-name {
  min-width: 0;
  max-width: 100%;
}
.trophy-standing-title .nickname {
  overflow: hidden;
  text-overflow: ellipsis;
}
.trophy-standing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.trophy-standing-badges .name-badge {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trophy-tooltip {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 8px 10px;
  max-width: calc(100vw - 16px);
  border: 1px solid #d1b8748c;
  border-radius: 7px;
  background: var(--website-surface-32-34-24-1, #202218);
  color: #fff0c7;
  box-shadow: 0 6px 22px var(--website-shade-0-0-0-0_6666666666666666, #000a);
  font:
    12px/1.4 system-ui,
    sans-serif;
  pointer-events: none;
}
.trophy-tooltip span {
  display: block;
  color: #d0c7a5;
  font-size: 11px;
}
@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  .trophy-standing-badges .name-badge:nth-child(n + 3) {
    display: none;
  }
}

.trophy-badge-slot .name-badge.achievement-badge,
.name-badge.achievement-badge {
  color: var(--badge-ink);
  background: var(--badge-fill);
  border: 1px solid var(--badge-edge);
}
.achievement-badge.rarity-common {
  --badge-ink: #efbd9c;
  --badge-fill: #39291f;
  --badge-edge: #926448;
}
.achievement-badge.rarity-rare {
  --badge-ink: #d6e6ef;
  --badge-fill: #26343e;
  --badge-edge: #718c9b;
}
.achievement-badge.rarity-epic {
  --badge-ink: #ffe3a1;
  --badge-fill: #3d321b;
  --badge-edge: #a2803e;
}
.achievement-badge.rarity-legendary {
  --badge-ink: #f4ddff;
  --badge-fill: linear-gradient(120deg, #382951, #233e49);
  --badge-edge: #9b81c2;
}

/* Badge windows stay square as the profile column narrows. */
.trophy-badge-slot {
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  width: min(100%, var(--trophy-tile-height));
  height: auto;
  aspect-ratio: 1;
  line-height: 1;
}
.trophy-badge-slot .profile-achievement-medal {
  width: min(82%, 35px);
  max-width: none;
}
.trophy-badge-slot.badge-window-bronze {
  background: #39291f;
  border: 1px solid #ba8968;
}
.trophy-badge-slot.badge-window-silver {
  background: #26343e;
  border: 1px solid #9bb5c6;
}
.trophy-badge-slot.badge-window-gold,
.trophy-badge-slot.badge-window-vip {
  background: #3d321b;
  border: 1px solid #c5a25b;
  color: #ffe3a1;
}
.trophy-badge-slot.badge-window-prism {
  background: linear-gradient(135deg, #54405e, #305564 42%, #695844 72%, #4c3e64);
  border: 1px solid #cdb9da;
}
.trophy-badge-slot[data-equipped='true'] {
  box-shadow: inset 0 0 0 1px #f5e9bc55;
}
.trophy-badge-slot:hover,
.trophy-badge-slot:focus-visible {
  outline: 1px solid var(--website-line-227-236-204-1, #e3eccc);
  outline-offset: 1px;
}

/* Keep the wave behind the coin and inside the rarity border. */
:is(
  .trophy-badge-slot.badge-window-gold,
  .trophy-badge-slot.badge-window-prism,
  .trophy-window-gold
) {
  isolation: isolate;
  overflow: hidden;
}
:is(
    .trophy-badge-slot.badge-window-gold,
    .trophy-badge-slot.badge-window-prism,
    .trophy-window-gold
  )
  img {
  position: relative;
  z-index: 1;
}
:is(
  .trophy-badge-slot.badge-window-gold,
  .trophy-badge-slot.badge-window-prism,
  .trophy-window-gold
)::before {
  content: '';
  position: absolute;
  inset: -35% -20%;
  pointer-events: none;
  background: var(--badge-wave);
  transform: translateX(-100%) skewX(-18deg);
  animation: badge-window-wave 2.22s ease-in-out infinite;
}
.trophy-badge-slot.badge-window-gold {
  --badge-wave: radial-gradient(ellipse at center, #ffe5a065 0%, #d0a04930 36%, transparent 69%);
}
.trophy-badge-slot.badge-window-prism {
  --badge-wave: linear-gradient(
    112deg,
    transparent 21%,
    #de98de40 36%,
    #9de7e565 49%,
    #ffe6a850 59%,
    #baa9f339 67%,
    transparent 82%
  );
}
@keyframes badge-window-wave {
  0%,
  8% {
    transform: translateX(-100%) skewX(-18deg);
  }
  72.865%,
  100% {
    transform: translateX(100%) skewX(-18deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(
    .trophy-badge-slot.badge-window-gold,
    .trophy-badge-slot.badge-window-prism,
    .trophy-window-gold
  )::before {
    animation: none;
    transform: none;
    opacity: 0.45;
  }
}

/* Use darker trophy finishes with a brighter edge so awards read separately. */
.trophy-award.trophy-window-bronze {
  background: linear-gradient(155deg, #512e24, var(--website-surface-39-27-26-1, #271b1a));
  border-color: #ad6d54;
}
.trophy-award.trophy-window-silver {
  background: linear-gradient(155deg, #354354, #1b232e);
  border-color: #879eb5;
}
.trophy-award.trophy-window-gold {
  background: linear-gradient(155deg, #503c22, #292117);
  border-color: #b89558;
  --badge-wave: radial-gradient(ellipse at center, #ffc96c66 0%, #e2a75430 39%, transparent 71%);
}
.trophy-award:is([data-award], [data-profile-badge]) > .trophy-icon {
  z-index: 1;
}
#player-profile-dialog > [data-profile-dismiss] {
  position: absolute;
  inset: 12px 12px auto auto;
}

.trophy-award[data-award][data-equipped='true'] {
  box-shadow: inset 0 0 0 1px #ffe3a289;
}

.trophy-gallery {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  margin: auto;
  height: fit-content;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--website-line-99-113-103-1, #637167);
  border-radius: 11px;
  color: var(--website-ink-237-240-228-1, #edf0e4);
  background: var(--website-surface-32-41-34-1, #202922);
  box-shadow: 0 10px 26px var(--website-shade-0-0-0-0_5333333333333333, #0008);
}
.trophy-gallery:popover-open {
  display: flex;
  flex-direction: column;
}
.trophy-gallery .trophy-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
}
.trophy-gallery .trophy-awards,
.trophy-gallery .trophy-badge-grid {
  max-height: calc(5 * var(--trophy-tile-height) + 16px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-inline: 1px;
}

.trophy-gallery :is(.trophy-awards, .trophy-badge-grid)::-webkit-scrollbar {
  display: none;
}
.trophy-gallery .trophy-equip-note:empty {
  display: none;
}

#player-profile-dialog .ranked-profile-details > h2 {
  translate: 0 -5%;
}
#player-profile-dialog .profile-pvp-record strong {
  display: flex;
  align-items: center;
  gap: 0.17em;
}
#player-profile-dialog .profile-pvp-record strong > i {
  line-height: 1;
}
#player-profile-dialog .review-coin-stage[data-framed='true'] > .profile-showcase-coin {
  scale: 1.1;
}

#player-profile-dialog .profile-avatar-row > .avatar-frame {
  scale: 1.1;
}

/* A quiet rim light distinguishes pinned tiles in both profile collections. */
.trophy-award:is(.trophy-window-bronze, .badge-window-bronze) {
  --pin-light: #ffc39a;
}
.trophy-award:is(.trophy-window-silver, .badge-window-silver) {
  --pin-light: #d6edff;
}
.trophy-award:is(.trophy-window-gold, .badge-window-gold, .badge-window-vip) {
  --pin-light: #ffe3a2;
}
.trophy-award.badge-window-prism {
  --pin-light: #e7dcff;
}
.trophy-award:is([data-award], [data-profile-badge])[data-equipped='true'] {
  border-color: var(--pin-light, #ffe3a2);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--pin-light, #ffe3a2) 42%, transparent),
    0 0 4px 1px color-mix(in srgb, var(--pin-light, #ffe3a2) 48%, transparent);
}

/* The profile frame has a continuous tinted backing under its entire inner rim. */
#player-profile-dialog .profile-showcase-coin.coin-frame-equipped::before {
  --dome-tint: rgb(var(--coin-glass-tint, 180, 180, 170));
  background:
    radial-gradient(ellipse at 34% 20%, var(--website-surface-255-255-255-0_3137254901960784, #ffffff50), transparent 54%),
    radial-gradient(
      circle at 38% 28%,
      color-mix(in srgb, var(--dome-tint) 84%, var(--website-surface-255-255-255-1, #fff)) 0%,
      color-mix(in srgb, var(--dome-tint) 80%, var(--website-surface-66-63-69-1, #423f45)) 43%,
      color-mix(in srgb, var(--dome-tint) 54%, var(--website-surface-48-42-52-1, #302a34)) 79%,
      color-mix(in srgb, var(--dome-tint) 48%, var(--website-surface-52-42-50-1, #342a32)) 100%
    );
  box-shadow:
    inset 0 0 0 1px var(--website-shade-255-255-255-0_18823529411764706, #ffffff30),
    inset 0 2px 7px var(--website-shade-255-255-255-0_25882352941176473, #ffffff42),
    inset 0 -6px 11px var(--website-shade-40-33-40-0_2196078431372549, #28212838);
}

/* Keep the coin image and its emblem on the same center at every breakpoint. */
.trophy-badge-slot .profile-achievement-medal > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
