/* --- Rankings Section Styles --- */
.ranking-layout-wrapper {
  width: 96% !important;
  max-width: 1100px !important;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Title Section */
.ranking-title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 35px;
}

.ranking-main-title {
  font-family: "Cinzel", serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text-light);
  text-shadow: 0 0 15px rgba(243, 241, 228, 0.2);
  margin: 0;
  text-transform: uppercase;
}

.ranking-subtitle {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  margin: 8px 0 12px;
  text-transform: uppercase;
}

/* Podium Styles */
.ranking-podium-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 25px;
  margin-bottom: 15px; /* Shrunk gap to table */
  width: 100%;
}

.podium-card {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 45px 15px 15px;
  text-align: center;
  position: relative;
  box-shadow: none;
  transition: all 0.4s ease;
  width: 230px; /* Enlarged frame cards */
}


/* Card image border overlay */
.podium-card-frame-overlay {
  position: absolute;
  inset: -1px; /* extends slightly outward to wrap the card nicely */
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 10;
  background-image: url('assets/community/rank.png');
}

.podium-card.rank-1 .podium-card-frame-overlay {
  filter: none;
}

.podium-card.rank-2 .podium-card-frame-overlay {
  filter: grayscale(100%) brightness(1.25) contrast(1.1);
}

.podium-card.rank-3 .podium-card-frame-overlay {
  filter: sepia(80%) hue-rotate(-20deg) saturate(1.8) brightness(0.85) contrast(1.15);
}

.podium-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(127, 255, 212, 0.1);
}

.podium-card.rank-1 {
  height: 340px; /* Enlarged */
  z-index: 5;
  padding-top: 55px; /* Pushes content below gem area */
}

.podium-card.rank-2 {
  height: 300px; /* Enlarged */
  z-index: 3;
}

.podium-card.rank-3 {
  height: 285px; /* Enlarged */
  z-index: 2;
}

/* Rank Ring Badges - Hidden as requested by the user */
.podium-rank-num {
  display: none !important;
}

.crown-icon {
  display: none !important;
}

/* Avatar Frame */
.podium-avatar-wrap {
  border-radius: 50%;
  border: 2px solid rgba(221, 217, 176, 0.15);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.podium-card.rank-1 .podium-avatar-wrap {
  width: 80px;
  height: 80px;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.podium-card.rank-2 .podium-avatar-wrap {
  width: 72px;
  height: 72px;
  border-color: #b0bec5;
}

.podium-card.rank-3 .podium-avatar-wrap {
  width: 68px;
  height: 68px;
  border-color: #a27255;
}

.podium-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(221, 217, 176, 0.1);
}

.podium-name {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: #fff;
  margin: 0 0 3px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.15);
}

.podium-card.rank-1 .podium-name {
  font-size: 17px;
}

.podium-card.rank-2 .podium-name,
.podium-card.rank-3 .podium-name {
  font-size: 15px;
}

.podium-class {
  font-size: 10px;
  color: rgba(243, 241, 228, 0.45);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.podium-power-wrap {
  border-top: 1px dashed rgba(221, 217, 176, 0.1);
  width: 85%;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.podium-power-lbl {
  font-family: "Cinzel", serif;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: rgba(243, 241, 228, 0.35);
}

.podium-power-val {
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.podium-card.rank-1 .podium-power-val {
  font-size: 14.5px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(221, 217, 176, 0.25);
}

.podium-card.rank-2 .podium-power-val {
  font-size: 13.5px;
  color: #e0e0e0;
  text-shadow: 0 0 6px rgba(240, 240, 240, 0.2);
}

.podium-card.rank-3 .podium-power-val {
  font-size: 13px;
  color: #e2b495;
  text-shadow: 0 0 6px rgba(226, 180, 149, 0.2);
}

/* Bottom Table Layout card container */
.ranking-table-panel {
  background: rgba(10, 22, 14, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(221, 217, 176, 0.2);
  border-radius: 6px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.75), inset 0 0 25px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  margin-bottom: 30px;
  width: 100%;
}

.ranking-table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(221, 217, 176, 0.15);
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.controls-title {
  font-family: "Cinzel", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--gold);
  text-shadow: 0 0 6px var(--gold-glow);
  text-transform: uppercase;
}

.controls-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.rank-dropdown-select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(221, 217, 176, 0.2);
  border-radius: 4px;
  padding: 5px 25px 5px 12px;
  font-family: "Cinzel", serif;
  font-size: 9.5px;
  color: var(--gold);
  cursor: pointer;
  outline: none;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ddd9b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
  letter-spacing: 1px;
}

.rank-dropdown-select option {
  background-color: #14171a;
  color: #ddd9b0;
}

.ranking-table-container {
  padding: 10px 15px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th {
  font-family: "Cinzel", serif;
  font-size: 10.5px;
  color: var(--gold);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(221, 217, 176, 0.15);
  font-weight: 600;
  letter-spacing: 1.5px;
}

.ranking-table td {
  padding: 10px 12px;
  font-family: "Cinzel", serif;
  font-size: 11px;
  color: rgba(243, 241, 228, 0.7);
  border-bottom: 1px solid rgba(221, 217, 176, 0.05);
  vertical-align: middle;
  font-weight: 500;
}

.ranking-table tr:hover td {
  background: rgba(221, 217, 176, 0.02);
  color: #fff;
}

.ranking-table tr:last-child td {
  border-bottom: none;
}

/* Character cell with avatar */
.char-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(221, 217, 176, 0.2);
  background-size: cover;
  background-position: center;
}

.char-name {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.char-name:hover {
  color: #fff;
  text-shadow: 0 0 6px var(--gold-glow);
}

/* Level, Power and Delta text */
.power-col {
  font-family: monospace;
  font-weight: 700;
  color: rgba(243, 241, 228, 0.85);
}

.change-col {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.change-col.up {
  color: #00ff66;
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.35);
}

.change-col.down {
  color: #ff3b30;
  text-shadow: 0 0 6px rgba(255, 59, 48, 0.35);
}

.change-col.none {
  color: rgba(243, 241, 228, 0.3);
}

/* Flags */
.country-flag-icon {
  display: flex;
  align-items: center;
}

/* Pagination */
.ranking-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(221, 217, 176, 0.1);
}

.ranking-pag-arrow, .ranking-pag-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 11px;
  color: rgba(243, 241, 228, 0.55);
  border: 1px solid rgba(221, 217, 176, 0.12);
  border-radius: 2px;
  background: transparent;
  transition: all 0.3s ease;
  font-weight: 600;
}

.ranking-pag-arrow:hover, .ranking-pag-num:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(221, 217, 176, 0.03);
}

.ranking-pag-num.active {
  color: #fff;
  background: var(--gold-glow);
  border-color: var(--gold);
  text-shadow: 0 0 6px var(--gold);
  box-shadow: inset 0 0 8px rgba(221, 217, 176, 0.2);
}

/* --- Karus theme overrides --- */
body.karus-theme .podium-card {
  background: none;
  border: none;
  box-shadow: none;
}

body.karus-theme .podium-card:hover {
  box-shadow: 0 20px 50px rgba(176, 190, 197, 0.15);
}

body.karus-theme .podium-avatar-wrap {
  border-color: rgba(176, 190, 197, 0.2);
}

body.karus-theme .podium-card.rank-1 .podium-avatar-wrap {
  border-color: #b0bec5 !important;
  box-shadow: 0 0 15px rgba(176, 190, 197, 0.3) !important;
}

body.karus-theme .podium-card.rank-1 .podium-power-val {
  color: #b0bec5 !important;
  text-shadow: 0 0 10px rgba(176, 190, 197, 0.35) !important;
}

body.karus-theme .ranking-table-panel {
  background: rgba(12, 13, 15, 0.95);
  border-color: rgba(176, 190, 197, 0.2);
}

body.karus-theme .controls-title {
  color: #b0bec5 !important;
  text-shadow: 0 0 6px rgba(176, 190, 197, 0.45) !important;
}

body.karus-theme .rank-dropdown-select {
  color: #b0bec5 !important;
  border-color: rgba(176, 190, 197, 0.2) !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b0bec5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

body.karus-theme .ranking-table th {
  color: #b0bec5 !important;
}

body.karus-theme .char-name {
  color: #b0bec5 !important;
}

body.karus-theme .char-name:hover {
  text-shadow: 0 0 6px rgba(176, 190, 197, 0.45) !important;
}

body.karus-theme .ranking-pag-num.active {
  background: rgba(176, 190, 197, 0.15);
  border-color: #b0bec5;
  text-shadow: 0 0 6px #b0bec5;
  box-shadow: inset 0 0 8px rgba(176, 190, 197, 0.2);
}

body.karus-theme .ranking-pag-arrow:hover,
body.karus-theme .ranking-pag-num:hover {
  color: #b0bec5;
  border-color: #b0bec5;
}

/* Tablet / Mobile Layout updates */
@media (max-width: 850px) {
  .ranking-podium-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 35px;
  }
  .podium-card {
    width: 280px !important;
  }
  .podium-card.rank-1, .podium-card.rank-2, .podium-card.rank-3 {
    height: auto !important;
  }
  .ranking-table-controls {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}

/* Tab Selector at the top of ranking page */
.ranking-tab-selector {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 35px;
  z-index: 10;
}

.rank-tab-btn {
  background: rgba(10, 22, 14, 0.6);
  border: 1px solid rgba(221, 217, 176, 0.25);
  color: rgba(243, 241, 228, 0.6);
  padding: 10px 24px;
  font-family: "Cinzel", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.rank-tab-btn:hover {
  border-color: var(--gold);
  color: #fff;
  background: rgba(221, 217, 176, 0.03);
}

.rank-tab-btn.active {
  background: rgba(22, 45, 27, 0.8);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 15px rgba(104, 157, 113, 0.25);
  text-shadow: 0 0 8px rgba(221, 217, 176, 0.3);
}

/* Karus theme button toggles */
body.karus-theme .rank-tab-btn.active {
  background: rgba(30, 33, 37, 0.8) !important;
  border-color: #b0bec5 !important;
  color: #b0bec5 !important;
  box-shadow: 0 0 15px rgba(176, 190, 197, 0.25) !important;
  text-shadow: 0 0 8px rgba(176, 190, 197, 0.3) !important;
}

body.karus-theme .rank-tab-btn:hover {
  border-color: #b0bec5 !important;
}

/* --- Inventory Slot & Character Gear Popup Styles --- */
.inv-wrapper {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}
.inv-slot {
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid rgba(221, 217, 176, 0.2);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-slot.has-item {
  background: rgba(12, 19, 15, 0.65);
  border: 1.5px solid rgba(221, 217, 176, 0.35);
}
.inv-slot:hover {
  border-color: var(--gold) !important;
  background: rgba(221, 217, 176, 0.08);
  box-shadow: 0 0 8px rgba(221, 217, 176, 0.4);
}
.inv-slot-icon {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.inv-slot-count {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-family: 'Inter', sans-serif;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  padding: 0 3px;
  border-radius: 2px;
  font-weight: bold;
  pointer-events: none;
}
/* Tooltip styles */
.inv-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(10, 15, 12, 0.98);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 12px;
  color: #e3dec9;
  font-size: 11.5px;
  width: 250px;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.85);
  font-family: 'Inter', sans-serif;
  display: none;
  line-height: 1.45;
  text-align: left;
}
.inv-tooltip-title {
  font-family: 'Cinzel', serif;
  font-size: 13.5px;
  font-weight: bold;
  border-bottom: 1px solid rgba(221,217,176,0.25);
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.inv-tooltip-type {
  font-size: 10.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.inv-tooltip-prop {
  color: #cbd5e1;
  margin-bottom: 2px;
}
.inv-tooltip-bonus {
  color: #34d399; /* Green for bonuses */
}
.inv-tooltip-req {
  color: #f87171; /* Red for requirements */
}

/* Karus specific theme rules for inventory */
body.karus-theme .inv-slot {
  border-color: rgba(176, 190, 197, 0.2) !important;
}
body.karus-theme .inv-slot.has-item {
  border-color: rgba(176, 190, 197, 0.35) !important;
}
body.karus-theme .inv-slot:hover {
  border-color: #b0bec5 !important;
  background: rgba(176, 190, 197, 0.08) !important;
  box-shadow: 0 0 8px rgba(176, 190, 197, 0.4) !important;
}
body.karus-theme .inv-tooltip {
  border-color: #b0bec5 !important;
}
