/* Comic-Style Rankings Page */
.ranking-section {
  padding: 20px 0;
}

/* Unified Comic Title Styling */
.comic-ranking-header {
  position: relative;
  margin: 0 auto 25px;
  text-align: center;
}

.manga-splash-title {
  background-color: #ff6700;
  border: 4px solid #000;
  border-radius: 8px;
  padding: 12px 20px;
  display: inline-block;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 1;
  transform: rotate(-1deg);
  margin: 0 auto;
  max-width: 90%;
}

.splash-text {
  color: white;
  font-family: "Bangers", cursive, var(--heading-font);
  font-size: 2.2rem;
  margin: 0;
  text-shadow: 2px 2px 0 #000;
  -webkit-text-stroke: 1px black;
  letter-spacing: 1px;
}

.splash-subtitle {
  color: white;
  font-size: 1rem;
  font-weight: bold;
  margin-top: 3px;
  text-shadow: 1px 1px 0 #000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .manga-splash-title {
    padding: 10px 15px;
    border-width: 3px;
  }

  .splash-text {
    font-size: 1.8rem;
  }
}

@media (max-width: 576px) {
  .comic-ranking-header {
    margin: 0 auto 20px;
  }

  .manga-splash-title {
    padding: 8px 12px;
    border-width: 3px;
    transform: rotate(0deg);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
  }

  .splash-text {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
  }

  .splash-subtitle {
    font-size: 0.85rem;
    margin-top: 2px;
  }
}

/* Comic Navigation Tabs */
.ranking-tabs {
  margin-bottom: 20px;
}

.tabs-nav {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: rgba(255, 255, 255, 0.8);
  border: 3px solid var(--manga-border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

.tab-link {
  padding: 15px;
  cursor: pointer;
  font-weight: bold;
  color: var(--dark-color);
  position: relative;
  transition: all 0.3s ease;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-right: 2px dashed rgba(0, 0, 0, 0.2);
}

.tab-link:last-child {
  border-right: none;
}

.tab-link i {
  font-size: 1.5rem;
  margin-bottom: 5px;
  color: var(--ninjaschoolonline-orange);
}

.tab-link.active {
  background-color: var(--ninjaschoolonline-orange);
  color: white;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
  transform: scale(1.02);
}

.tab-link.active i {
  color: white;
}

.tab-link:hover:not(.active) {
  background-color: rgba(255, 103, 0, 0.1);
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

/* Ranking Panel */
.ranking-panel {
  background-color: rgba(255, 255, 255, 0.8);
  border: 3px solid var(--manga-border-color);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.7);
}

/* Ranking Table */
.ranking-table-container {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid var(--manga-border-color);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  /* Force fixed table width */
}

/* Optimize power and exp cell display */
.power-cell,
.exp-cell {
  text-align: right;
  vertical-align: middle;
  font-weight: bold;
  color: var(--ninjaschoolonline-orange);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
  /* Add more padding on the right */
}

/* Player cell improvements */
.player-name {
  font-weight: bold;
  color: var(--ninjaschoolonline-orange);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ranking-table th {
  font-size: 1.1rem;
  padding: 10px 8px;
  background-color: var(--ninjaschoolonline-orange);
  color: white;
  text-align: left;
  border-bottom: 2px solid var(--manga-border-color);
  font-family: "Bangers", cursive, var(--heading-font);
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.ranking-table td {
  padding: 10px 8px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
  vertical-align: middle;
}

.ranking-table tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.03);
}

.ranking-table tr:hover {
  background-color: rgba(255, 103, 0, 0.1);
}

/* Ranking Cell Styles */
.rank-cell {
  text-align: center;
  vertical-align: middle;
}

.rank-number {
  background-color: #f0f0f0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.rank-medal {
  max-width: 30px;
  max-height: 30px;
  margin: 0 auto;
  display: block;
}

/* Player Cell Styles */
.player-cell {
  vertical-align: middle;
}

.player-info,
.account-info {
  display: flex;
  align-items: center;
}

/* Enhanced Avatar Frame */
.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 10px;
  border: 2px solid var(--manga-border-color);
  background-color: white;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 0 2px rgba(255, 103, 0, 0.5), 0 0 10px rgba(0, 0, 0, 0.3);
}

.player-avatar::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px dashed var(--ninjaschoolonline-orange);
  animation: rotate 20s linear infinite;
  pointer-events: none;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Account Icon with Frame */
.account-icon {
  width: 35px;
  height: 35px;
  background-color: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  border: 2px solid var(--manga-border-color);
  position: relative;
  color: #666;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 103, 0, 0.5), 0 0 10px rgba(0, 0, 0, 0.3);
}

.account-icon::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 1px dashed var(--ninjaschoolonline-orange);
  animation: rotate 20s linear infinite;
  pointer-events: none;
}

/* Responsive adjustments for avatar frames */
@media (max-width: 576px) {
  .player-avatar::before,
  .account-icon::before {
    display: none;
    /* Hide the rotating border on small screens */
  }

  .player-avatar,
  .account-icon {
    box-shadow: 0 0 0 2px var(--ninjaschoolonline-orange);
  }
}

/* VIP Styling */
.vip-tag {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff6700;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: bold;
  border: 1px solid var(--manga-border-color);
}

/* Account Styling */
.account-icon {
  width: 35px;
  height: 35px;
  background-color: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  position: relative;
  color: #666;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.account-name {
  font-weight: bold;
  color: var(--ninjaschoolonline-orange);
}

/* Empty Data */
.empty-data {
  text-align: center;
  padding: 30px 0;
  font-style: italic;
  color: #666;
  background: repeating-linear-gradient(
    45deg,
    #f9f9f9,
    #f9f9f9 10px,
    #f5f5f5 10px,
    #f5f5f5 20px
  );
  border-radius: 5px;
}

/* Animation for hover effect */
.rank-row {
  transition: all 0.2s ease;
}

.rank-row:hover {
  transform: translateX(5px);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .splash-text {
    font-size: 2.5rem;
  }

  .splash-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .ranking-section {
    padding: 10px 0;
  }

  .ranking-panel {
    padding: 15px 10px;
  }

  .splash-text {
    font-size: 2rem;
  }

  .splash-subtitle {
    font-size: 1rem;
  }

  .tabs-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tab-link {
    padding: 10px 5px;
    white-space: nowrap;
    min-width: 80px;
  }

  .tab-link i {
    font-size: 1.2rem;
  }

  .tab-link span {
    font-size: 0.9rem;
  }

  /* Optimize table for mobile view */
  .ranking-table th,
  .ranking-table td {
    padding: 8px 5px;
    font-size: 0.9rem;
  }

  /* Make table cells more compact */
  .ranking-table th,
  .ranking-table td {
    padding: 8px 6px;
    font-size: 0.9rem;
  }

  /* Adjust column widths for level tab */
  #level .ranking-table th:nth-child(1) {
    width: 12% !important;
  }

  #level .ranking-table th:nth-child(2) {
    width: 40% !important;
  }

  #level .ranking-table th:nth-child(3) {
    width: 18% !important;
  }

  #level .ranking-table th:nth-child(4) {
    width: 30% !important;
  }

  /* Power tab columns */
  #power .ranking-table th:nth-child(1) {
    width: 15% !important;
  }

  #power .ranking-table th:nth-child(2) {
    width: 50% !important;
  }

  #power .ranking-table th:nth-child(3) {
    width: 35% !important;
  }

  /* More compact text */
  .power-cell,
  .exp-cell {
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  /* Even more compact on small screens */
  .ranking-table th,
  .ranking-table td {
    padding: 6px 4px;
    font-size: 0.85rem;
  }

  /* Adjust power and exp display on small screens */
  .power-cell,
  .exp-cell {
    font-size: 0.8rem;
    padding-right: 5px;
  }

  /* Reduce player cell width to give more space to number columns */
  #power .ranking-table th:nth-child(2) {
    width: 45% !important;
  }

  #power .ranking-table th:nth-child(3) {
    width: 40% !important;
  }

  #level .ranking-table th:nth-child(2) {
    width: 35% !important;
  }

  #level .ranking-table th:nth-child(4) {
    width: 35% !important;
  }

  /* Better avatar sizing */
  .player-avatar,
  .account-icon {
    width: 28px;
    height: 28px;
    margin-right: 5px;
  }

  .player-name {
    font-size: 0.8rem;
  }

  .player-level {
    font-size: 0.7rem;
  }
}

/* Extra small devices */
@media (max-width: 375px) {
  /* Critical adjustments for very small screens */
  .ranking-table th,
  .ranking-table td {
    padding: 5px 2px;
  }

  .power-cell,
  .exp-cell {
    font-size: 0.75rem;
    padding-right: 2px;
  }

  /* Minimal avatar size */
  .player-avatar,
  .account-icon {
    width: 25px;
    height: 25px;
    margin-right: 3px;
  }

  /* Force player name to be smaller */
  .player-name {
    max-width: 60px;
    font-size: 0.75rem;
  }
}

/* Clan specific styles */
.clan-name {
  font-weight: bold;
  display: block;
  padding-left: 10px;
}
