/* --- End Screen Overlay --- */
.end-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.end-overlay.hidden {
  display: none;
}

.end-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  padding: 5px;
}

/* Header */
.end-header {
  background: var(--color-primary-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 20px 20px 0 0;
}

.end-date {
  font-size: 23px;
  font-weight: 800;
}

.end-close {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}

.end-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Summary */
.end-summary {
  display: flex;
  align-items: center;
  padding: 10px;
  gap: 16px;
}

.end-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 7px;
  border-radius: 16px;
  background-color: var(--color-card-info-bg);
}

.end-stat-row {
  display: flex;
  align-items: center;
}

.end-stat-label {
  font-size: 18px;
  font-weight: 600;
  color: #8fa1b0;
  white-space: nowrap;
}

.end-stat-dots {
  flex: 1;
  margin: 0 8px;
  border-bottom: 3px dotted #9faebd;
  transform: translateY(2px);
}

.end-stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--color-primary-green-dark);
  white-space: nowrap;
}

.end-trophy-wrap {
  flex-shrink: 0;
}

.end-trophy-img {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));
}

/* Rounds section */
.end-rounds {
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.end-round-buttons {
  display: flex;
  justify-content: space-between;
  margin: 0px 2px;
}

.end-round-wrap {
  position: relative;
  border-radius: 20px;
}

.end-round-wrap::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -50px;
  border-radius: 20px 20px 10px 10px;
  background: var(--continent-shadow);
  opacity: 0;
  transition: opacity 0.15s;
}

.end-round-wrap.active::before {
  opacity: 1;
}

.end-round-btn {
  position: relative;
  width: 45px;
  height: 45px;
  padding: 0;
  border-radius: 40%;
  background-color: var(--continent-color);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0px -3px #0000001f;
  transition:
    background 0.1s,
    border-color 0.1s,
    box-shadow 0.1s;
}

.end-round-btn img,
.end-round-btn .icon-cross {
  width: 30px;
  height: 30px;
  display: block;
  filter: drop-shadow(0 3px 0px #00000040);
}

/* Round detail card */
.end-round-detail {
  background: var(--continent-color);
  border: 2px solid var(--continent-shadow);
  border-radius: 25px;
  overflow: hidden;
  z-index: 1;
  padding: 5px;
}

.end-round-detail-header {
  padding: 10px 16px;
  text-align: center;
  background-color: var(--continent-shadow);
  border-radius: 20px 20px 0 0;
}

.end-round-country {
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.end-round-continent {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

.end-round-stats {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.end-stat-row--light .end-stat-label {
  color: white;
  font-size: 16px;
}

.end-stat-row--light .end-stat-dots {
  border-color: white;
}

.end-stat-row--light .end-stat-value {
  color: white;
  font-size: 30px;
}

.end-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 60%;
  margin: 8px auto 0;
  padding: 10px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(to bottom, #ffb347, #ff8c00);
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}

.end-share-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* Footer */
.end-footer {
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.end-onday-note {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #ff6b73;
}

.end-onday-note.hidden {
  display: none;
}

.end-replay-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(to bottom, #2ed0e8, #3ab0f1);
  color: var(--color-navy);
  font-size: 18px;
  font-weight: 700;
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.end-replay-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
