.ss-end-overlay[hidden] { display: none !important; }

.ss-end-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(25, 25, 25, .68);
  backdrop-filter: blur(6px);
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
}

.ss-end-dialog {
  position: relative;
  width: min(100%, 760px);
  max-height: 94vh;
  overflow-y: auto;
  border: 1px solid rgba(193, 110, 148, .18);
  border-radius: 22px;
  background: #fff;
  color: #191919;
  box-shadow: 0 28px 80px rgba(25, 25, 25, .3);
}

.ss-end-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 28px 20px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #b95f89 0%, #e8b8c8 100%);
}

.ss-end-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 0%, rgba(255, 255, 255, .24), transparent 54%);
  pointer-events: none;
}

.ss-end-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 180px;
  height: auto;
  margin: 0 auto 11px;
}

.ss-end-eyebrow {
  position: relative;
  z-index: 1;
  display: inline-block;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  padding: 6px 15px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ss-end-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font: inherit;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.ss-end-close:hover,
.ss-end-close:focus-visible { background: rgba(255, 255, 255, .38); }
.ss-end-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .9);
  outline-offset: 2px;
}

.ss-end-content { padding: 25px 32px 29px; }

.ss-end-status {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #f8eaf0;
  color: #9f4d73;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.ss-end-content h2 {
  margin: 0 0 7px;
  color: #191919;
  font-size: clamp(27px, 5vw, 34px);
  font-weight: 750;
  line-height: 1.16;
  letter-spacing: -.02em;
}

.ss-end-content p {
  margin: 0 0 12px;
  color: #494949;
  font-size: 15px;
  line-height: 1.58;
}

.ss-end-content .ss-end-no-winner {
  margin-bottom: 8px;
  color: #b0527e;
  font-size: 18px;
  font-weight: 750;
}

.ss-end-leaders { margin: 22px 0 20px; }

.ss-end-leaders h3,
.ss-end-mug h3,
.ss-end-winners h3 {
  margin: 0 0 12px;
  color: #191919;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
}

.ss-end-leaders-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ss-end-leader {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #eed4df;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fdf6f9 100%);
  padding: 8px 8px 12px;
  text-align: center;
}

.ss-end-leader img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 10px;
  border-radius: 11px;
  object-fit: cover;
  object-position: center 25%;
}

.ss-end-rank {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  background: #c16e94;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(65, 25, 43, .2);
}

.ss-end-leader strong {
  display: block;
  overflow: hidden;
  color: #242424;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-end-leader > span:last-child {
  display: block;
  margin-top: 3px;
  color: #a24f76;
  font-size: 13px;
  font-weight: 700;
}

.ss-end-mug {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 19px;
  margin: 0 0 16px;
  border-radius: 17px;
  background: #f8eaf0;
  padding: 13px;
}

.ss-end-mug img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
}

.ss-end-mug h3 { margin-bottom: 5px; }
.ss-end-mug p { margin: 0; color: #704055; font-size: 14px; }

.ss-end-winners {
  margin: 0 0 18px;
  border: 1px solid #eed4df;
  border-radius: 16px;
  background: #fffafb;
  padding: 15px 17px 17px;
}

.ss-end-winners h3 { margin-bottom: 10px; text-align: center; }

.ss-end-winners ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mug-winner;
}

.ss-end-winners li {
  counter-increment: mug-winner;
  min-width: 0;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: #f8eaf0;
  padding: 8px 10px;
  color: #6f3a53;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.ss-end-winners li::before {
  content: counter(mug-winner) ". ";
  color: #a24f76;
  font-weight: 800;
}

.ss-end-content .ss-end-thanks {
  margin: 2px 0 19px;
  color: #333;
  font-weight: 650;
  text-align: center;
}

.ss-end-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ss-end-primary,
.ss-end-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 10px 22px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ss-end-primary {
  border: 0;
  background: #bd638c;
  color: #fff;
}

.ss-end-primary:hover { background: #a94f78; }

.ss-end-secondary {
  border: 1px solid #db9bb7;
  background: #fff;
  color: #98476d;
}

.ss-end-secondary:hover { background: #f8eaf0; }

body.ss-end-open { overflow: hidden; }

@media (max-width: 620px) {
  .ss-end-overlay { padding: 10px; }
  .ss-end-dialog { max-height: 96vh; border-radius: 18px; }
  .ss-end-hero { padding: 20px 18px 18px; }
  .ss-end-logo { width: 155px; }
  .ss-end-content { padding: 21px 18px 23px; }
  .ss-end-content p { font-size: 14px; }
  .ss-end-content .ss-end-no-winner { font-size: 17px; }
  .ss-end-leaders-grid { gap: 7px; }
  .ss-end-leader { border-radius: 13px; padding: 5px 5px 9px; }
  .ss-end-leader img { margin-bottom: 7px; border-radius: 9px; }
  .ss-end-rank { top: 9px; left: 9px; width: 26px; height: 26px; font-size: 12px; }
  .ss-end-leader strong { font-size: 11px; }
  .ss-end-leader > span:last-child { font-size: 11px; }
  .ss-end-mug { grid-template-columns: 105px 1fr; gap: 13px; }
  .ss-end-mug h3 { font-size: 15px; }
  .ss-end-mug p { font-size: 12px; line-height: 1.45; }
  .ss-end-winners { padding: 13px; }
  .ss-end-winners ol { grid-template-columns: 1fr; gap: 6px; }
  .ss-end-winners li { font-size: 12px; }
  .ss-end-actions > * { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .ss-end-leaders-grid { grid-template-columns: 1fr; gap: 8px; }
  .ss-end-leader {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    padding: 7px;
    text-align: left;
  }
  .ss-end-leader img {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 90px;
    height: 72px;
    margin: 0;
    aspect-ratio: auto;
  }
  .ss-end-rank { top: 11px; left: 11px; }
  .ss-end-leader strong {
    grid-column: 2;
    grid-row: 1;
    overflow: visible;
    font-size: 13px;
    line-height: 1.3;
    text-overflow: clip;
    white-space: normal;
  }
  .ss-end-leader > span:last-child {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    font-size: 13px;
  }
}
