@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=IM+Fell+English+SC&display=swap");

:root {
  --row-top-drop: 0px;
  --row-mid-drop: 58px;
  --row-low-drop: 120px;
  --inset-mid: 22%;
  --panel-w: 1100px;

  /* UPDATED: bigger crest size for badges */
  --badge-icon-h: 100px;
}

/* Background */
body {
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: "Georgia", serif;
  background: url("../brinth_icons/bg10.jpg") no-repeat center center fixed;
  background-size: cover;
  overflow-x: hidden;
}
.wrap {
  min-height: 100vh;
  padding: 70px 0 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Title */
.hdr {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}
.hdr h1 {

  margin: 0;
  font-size: 2.6em;
  letter-spacing: 2px;
  color: #e8d8be;
  text-shadow: 0 0 8px #d8b88a, 0 0 22px #a88a60;
  font-family: "Cinzel Decorative", serif;
  margin-bottom: 10px;
}
.hdr .bar {
  width: 210px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #a88a60, transparent);
  box-shadow: 0 0 4px #a88a60;
}

/* Panel */
.panel {
  position: relative;
  width: min(var(--panel-w), 92vw);
  border: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  padding: 24px 20px 28px;
  overflow: visible;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(
        90deg,
        transparent,
        #c5a98a 15%,
        #c5a98a 85%,
        transparent
      )
      0 4px/100% 2px no-repeat,
    linear-gradient(
        135deg,
        transparent 45%,
        #c5a98a 46%,
        #c5a98a 54%,
        transparent 55%
      )
      left 0 top 2px/64px 6px no-repeat,
    linear-gradient(
        225deg,
        transparent 45%,
        #c5a98a 46%,
        #c5a98a 54%,
        transparent 55%
      )
      right 0 top 2px/64px 6px no-repeat;
  box-shadow: 0 0 6px #c5a98a;
  pointer-events: none;
}

/* Top 5 */
.top5 {
  position: relative;
  height: 270px;
  padding-top: 30px;
  padding-bottom: 30px;
}

/* Each badge + its drop lives in a local positioning context */
.badge-group {
  position: relative;
}

/* ===== BADGE ===== */
.badge {
  position: absolute;
  isolation: isolate;
  width: 190px; /* UPDATED: bigger badge */
  padding: 12px 12px 20px;
  text-align: center;
  color: #f5e4d0;
  font-family: "Cinzel Decorative", serif;
  letter-spacing: 0.2px;
  text-shadow: 0 0 5px rgba(255, 223, 184, 0.45);
  background: radial-gradient(
      120% 100% at 50% -10%,
      rgba(197, 169, 138, 0.12) 0%,
      transparent 60%
    ),
    linear-gradient(
      180deg,
      rgba(15, 11, 8, 0.97) 0%,
      rgba(28, 21, 15, 0.94) 55%,
      rgba(15, 11, 8, 0.99) 100%
    );
  border: 2px solid rgba(227, 194, 150, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(80, 60, 40, 0.55),
    inset 0 0 18px rgba(168, 138, 96, 0.22), 0 0 14px rgba(200, 170, 120, 0.25);
  clip-path: polygon(10% 0, 90% 0, 90% 70%, 50% 100%, 10% 70%);
  border-radius: 2px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  cursor: pointer;
}
.badge::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 9px;
  background: linear-gradient(
        90deg,
        transparent,
        #e3c296 14%,
        #e3c296 86%,
        transparent
      )
      0 3px/100% 1px no-repeat,
    linear-gradient(
        135deg,
        transparent 45%,
        #e3c296 46%,
        #e3c296 54%,
        transparent 55%
      )
      left 1px top 2px/52px 5px no-repeat,
    linear-gradient(
        225deg,
        transparent 45%,
        #e3c296 46%,
        #e3c296 54%,
        transparent 55%
      )
      right 1px top 2px/52px 5px no-repeat;
  filter: drop-shadow(0 0 4px #c5a98a);
  pointer-events: none;
}
.badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 40%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}
.badge.me {
  background: radial-gradient(
      120% 100% at 50% -10%,
      rgba(197, 169, 138, 0.18) 0%,
      transparent 60%
    ),
    linear-gradient(180deg, rgba(66, 48, 28, 0.98), rgba(33, 24, 16, 0.96));
  border-color: #f0d7a8;
  box-shadow: 0 0 22px #a88a60, inset 0 0 18px rgba(168, 138, 96, 0.24);
}

/* Only Name + Icon on the badge */
.b-name {
  font-size: 0.95em;
  color: #f1e2c9;
  margin-bottom: 3px; /* UPDATED spacing */
}
.b-icon {
  position: relative;
  height: var(--badge-icon-h);
  display: grid;
  place-items: center;
  padding: 0 5px; /* UPDATED: 5px inset from edges */
}
.b-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    closest-side,
    rgba(24, 159, 191, 0.18),
    transparent 70%
  );
  filter: blur(6px);
}
.b-icon img {
  height: var(--badge-icon-h);
  width: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(168, 138, 96, 0.65));
}

/* Hover lift */
@media (hover: hover) {
  .badge:hover {
    transform: translateY(-4px);
    filter: brightness(1.06);
  }
  .slot-1:hover {
    transform: translateX(-50%) !important;
    filter: none !important;
  }
}

/* Optional aura by slot */
.slot-1 .b-icon::before {
  background: radial-gradient(
    closest-side,
    rgba(65, 136, 255, 0.22),
    transparent 70%
  );
}
.slot-2 .b-icon::before {
  background: radial-gradient(
    closest-side,
    rgba(80, 180, 220, 0.2),
    transparent 70%
  );
}
.slot-3 .b-icon::before {
  background: radial-gradient(
    closest-side,
    rgba(255, 160, 60, 0.18),
    transparent 70%
  );
}
.slot-4 .b-icon::before,
.slot-5 .b-icon::before {
  background: radial-gradient(
    closest-side,
    rgba(220, 70, 70, 0.18),
    transparent 70%
  );
}

/* Absolute slots — 4th left, 5th right */
.slot-4 { left: 0; top: var(--row-top-drop); }
.slot-5 { right: 0; top: var(--row-top-drop); }
.slot-2 { left: var(--inset-mid); top: var(--row-mid-drop); }
.slot-3 { right: var(--inset-mid); top: var(--row-mid-drop); }
.slot-1 { left: 50%; transform: translateX(-50%); top: var(--row-low-drop); }

/* ===== DROP WINDOW (expands under badge) ===== */
.badge-drop {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  background: #111;
  border: 1px solid #222;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 255, 255, 0.1);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 6;
}
.badge-drop.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.bd-inner {
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #0f0f0f 0%, #151515 100%);
  color: #fff;
  text-align: center; /* CENTER ALL TEXT */
  font-family: "Georgia", serif;
}

/* Place (e.g., "1st Place") */
.bd-place {
  font-family: "Cinzel Decorative", serif;
  color: #c5a98a;
  letter-spacing: 0.5px;
  font-size: 1.05em;
  text-transform: uppercase;
  text-shadow: 0 0 6px #795845;
  margin-top: 2px;
}

.bd-name {
  margin-top: 6px;
  font-size: 1.12em;
  color: #fff;
  font-family: "Cinzel Decorative", serif;
}
.bd-role {
  margin-top: 2px;
  color: #d8c19a;
  font-family: "IM Fell English SC", serif;
  font-size: 0.95em;
  letter-spacing: 0.3px;
}

.bd-divider {
  height: 1px;
  border: none;
  margin: 10px 0;
  background: linear-gradient(90deg, transparent, #a88a60, transparent);
  box-shadow: 0 0 6px #a88a60;
}

.bd-stats-title {
  font-family: "Cinzel Decorative", serif;
  color: #9e8170;
  margin-bottom: 8px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.bd-stats {
  display: grid;
  gap: 6px;
}
.bd-stat {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: #c5a98a;
}
.bd-stat span {
  opacity: 0.95;
}
.bd-stat strong {
  color: #fff;
}

/* ===== 6–10 List ===== */
.list {
  margin-top: 18px;
  padding: 18px 10px 6px;
  position: relative;
}
.list::before,
.list::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    #c5a98a 15%,
    #c5a98a 85%,
    transparent
  );
  box-shadow: 0 0 6px #c5a98a;
}
.list::before {
  top: 0;
}
.list::after {
  bottom: 0;
}

.row {
  font-family: "Cinzel Decorative", serif;
  display: grid;
  grid-template-columns: 100px 1fr 1fr 60px 130px;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin: 0;
  background: none;
  box-shadow: none;
  border-bottom: 1px solid transparent;
  background-image: linear-gradient(
    90deg,
    transparent,
    rgba(197, 169, 138, 0.2) 1%,
    rgba(197, 169, 138, 0.2) 85%,
    transparent
  );
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 1px;
}
.row:last-child {
  background-image: none;
}
.row.me {
  background: linear-gradient(
    180deg,
    rgba(66, 48, 28, 0.86),
    rgba(33, 24, 16, 0.9)
  );
  box-shadow: 0 0 16px #a88a60, inset 0 0 16px rgba(168, 138, 96, 0.18);
}
.col {
  white-space: nowrap;
}
.rk {
  color: #e8d8be;
}
.nm {
  color: #fff;
}
.rl {
  color: #cdb188;
}
.ic img {
  width: 30px;
  height: auto;
  filter: drop-shadow(0 0 3px #795845);
}
.xp {
  color: #a88a60;
  font-weight: 700;
  text-align: right;
}

/* Rank message + back */
.rank-msg {
  margin-top: 26px;
  text-align: center;
  font-size: 1.05em;
  color: #c5a98a;
  text-shadow: 0 0 6px #795845;
  font-family: "Cinzel Decorative", serif;
}
.back {
  margin-top: 40px;
}


/* Responsive */
@media (max-width: 1050px) {
  :root {
    --panel-w: 980px;
    --inset-mid: 18%;
  }
  .badge {
    width: 180px;
  }
}
@media (max-width: 820px) {
  :root {
    --panel-w: 760px;
    --inset-mid: 16%;
    --row-low-drop: 112px;
  }
  .row {
    grid-template-columns: 82px 1fr 1fr 50px 110px;
  }
}
@media (max-width: 560px) {
  :root {
    --panel-w: 94vw;
    --inset-mid: 12%;
    --row-mid-drop: 52px;
    --row-low-drop: 106px;
  }
  .badge {
    width: 160px;
  }
  .row {
    grid-template-columns: 70px 1fr 1fr 40px 90px;
  }
}

@media (max-width: 768px) {
  .badge {
    width: 140px;
    padding: 6px 6px 12px;
    font-size: 0.75em;
  }
  .b-icon {
    height: 70px;
  }
  .b-icon img {
    height: 70px;
  }
  .row .rl {
    display: none;
  }
  .row {
    grid-template-columns: 60px 1fr 40px 80px;
    gap: 8px;
    padding: 10px;
  }

  /* Added spacing around panel on mobile */
  .panel {
    margin-left: 120px;
    margin-right: 120px;
  }
}
