.rank-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  z-index: 3;
  display: none;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-in-out;
}

.rank-container {
  position: relative;
  border-radius: 15px;
  padding: 20px;
  width: 80%;
  max-width: 1400px;
  max-height: 85vh;
  animation: slideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.rank-title {
  position: relative;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  margin: -10px auto 20px;
  padding: 12px 30px;
  background: #fff;
  color: #333;
  border-radius: 999px;
  display: inline-block;
  z-index: 1;
}

.rank-table-wrapper {
  display: flex;
}

.rank-table-container {
  flex: 1;
  background: #fff;
  overflow-y: auto;
  max-height: calc(4 * 90px + 80px);
  height: calc(4 * 90px + 80px);
  border: 3px solid #000;
  border-radius: 8px;
  min-height: 440px;
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 22px;
}

.rank-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #b1dff4;
  color: #000;
  font-size: 24px;
}

.rank-table th {
  padding: 20px 15px;
  text-align: center;
  font-weight: bold;
  height: 80px;
  box-sizing: border-box;
}

.rank-table td {
  padding: 18px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
  height: 90px;
  box-sizing: border-box;
}

.rank-table tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

.rank-number {
  font-weight: bold;
  color: #007bff;
}

.rank-name {
  font-weight: 500;
}

.rank-score {
  font-weight: bold;
  color: #28a745;
}

.rank-date {
  font-size: 20px;
  color: #666;
}

.rank-footer {
  display: none;
  align-items: end;
  margin-left: 30px;
  bottom: 290px;
  right: 120px;
  position: absolute;
  z-index: 4;
  animation: fadeIn 0.5s ease-in-out;
}

.rank-end-btn {
  position: relative;
  background: red;
  color: #fff;
  border: none;
  padding: 0px 25px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 999px;
  z-index: 1;
  min-height: 50px;
}

.rank-end-btn rt {
  margin-top: 8px;
}

.rank-end-btn:hover {
  background: #d91a1a;
  transform: scale(1.08) rotate(-2deg);
}

.rank-table-container::-webkit-scrollbar {
  display: none;
}

.rank-table-container::-webkit-scrollbar-track {
  background: #e6f7fc;
  border-radius: 6px;
}

.rank-table-container::-webkit-scrollbar-thumb {
  background: #b1dff4;
  border-radius: 6px;
  border: 2px solid #e6f7fc;
}

.rank-table-container::-webkit-scrollbar-thumb:hover {
  background: #7fcdee;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Popup Overlay Styles */
.rank-popup-overlay {
  position: absolute;
  top: 48px;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  border-radius: 15px;
}

.rank-popup-content {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: popupSlideIn 0.3s ease-out;
  position: relative;
  border: 3px solid #000;
}

.rank-popup-header {
  margin-bottom: 20px;
}

.rank-popup-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin: 0;
}

.rank-popup-body {
  margin-bottom: 25px;
}

.rank-popup-message {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 28px;
  font-weight: bold;
}

.rank-popup-rank {
  color: #ff6b6b;
  font-size: 36px;
  margin-right: 8px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.rank-popup-text {
  color: #333;
}

.rank-popup-subtext {
  font-size: 18px;
  color: #666;
  font-style: italic;
}

.rank-popup-footer {
  display: flex;
  justify-content: center;
}

.rank-popup-close-btn {
  background: #ff6b6b;
  color: #fff;
  border: none;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.rank-popup-close-btn::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid #ff5252;
  border-radius: 30px;
  z-index: -1;
  opacity: 0.8;
}

.rank-popup-close-btn:hover {
  background: #ff5252;
  transform: scale(1.05);
}

@keyframes popupSlideIn {
  from {
    transform: scale(0.8) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.rank-table td.rank-name,
.rank-table td.rank-score,
.rank-table td.rank-date {
  font-family: "Arial", sans-serif !important;
  font-weight: normal;
}
