:root {
  --bg-main: #041a13;
  --bg-deep: #02120d;
  --panel: rgba(7, 42, 28, 0.84);
  --panel-soft: rgba(10, 55, 37, 0.66);
  --line: rgba(153, 227, 192, 0.28);
  --text: #ecfff4;
  --text-soft: #b4d8c6;
  --accent-gold: #ddbe67;
  --accent-silver: #c6d0d2;
  --accent-bronze: #aa844d;
  --accent-green: #42d28f;
  --danger: #ff9191;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: radial-gradient(circle at 20% 8%, #0b3b2a 0%, var(--bg-main) 45%, var(--bg-deep) 100%);
  font-family: "Barlow Condensed", sans-serif;
}

body {
  overflow-x: hidden;
  position: relative;
}

.texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.texture-noise {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.55px, transparent 0.55px);
  background-size: 4px 4px;
  opacity: 0.12;
}

.texture-grid {
  background-image: linear-gradient(rgba(97, 180, 145, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 180, 145, 0.08) 1px, transparent 1px);
  background-size: 62px 62px;
  opacity: 0.35;
}

.light-beam {
  position: fixed;
  pointer-events: none;
  filter: blur(18px);
  border-radius: 999px;
  z-index: 0;
}

.beam-a {
  width: 28rem;
  height: 8rem;
  top: -2rem;
  left: -4rem;
  background: linear-gradient(90deg, rgba(234, 255, 227, 0.26), rgba(234, 255, 227, 0));
  transform: rotate(-18deg);
}

.beam-b {
  width: 25rem;
  height: 8rem;
  right: -3rem;
  bottom: 4rem;
  background: linear-gradient(90deg, rgba(237, 199, 107, 0.27), rgba(237, 199, 107, 0));
  transform: rotate(-22deg);
}

.poster-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, 94vw);
  margin: 0.85rem auto 1.6rem;
  display: grid;
  gap: 0.62rem;
}

.card-shell {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(11, 61, 40, 0.84), rgba(4, 26, 18, 0.91));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

.card-flat {
  border: 1px solid rgba(162, 218, 188, 0.22);
  background: linear-gradient(160deg, rgba(12, 63, 42, 0.65), rgba(5, 26, 18, 0.72));
}

.poster-hero {
  overflow: hidden;
  position: relative;
  padding: 1rem 1rem 1.2rem;
}

.poster-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(221, 190, 103, 0.12), transparent 45%);
  pointer-events: none;
}

.hero-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.82rem;
  color: #a8e2c4;
}

h1 {
  margin: 0.35rem 0 0.35rem;
  text-transform: uppercase;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  line-height: 0.95;
  font-size: clamp(2.1rem, 6.6vw, 4.8rem);
}

.hero-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 70ch;
}

.hero-lineup {
  margin: 0.8rem -0.3rem 0.2rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.2rem;
  min-height: 140px;
}

.hero-lineup img {
  width: clamp(85px, 17vw, 220px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.42));
}

.hero-lineup img:nth-child(2) {
  transform: scale(1.1);
}

.summary-cards,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

.metric-card {
  border-radius: 12px;
  border: 1px solid rgba(191, 233, 212, 0.22);
  background: linear-gradient(145deg, rgba(15, 85, 56, 0.62), rgba(8, 40, 27, 0.78));
  padding: 0.62rem 0.7rem;
}

.metric-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.metric-value {
  margin: 0.1rem 0 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.03em;
  font-size: 1.5rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem;
}

.tab-btn {
  border: 1px solid rgba(164, 225, 196, 0.28);
  background: linear-gradient(145deg, rgba(14, 78, 52, 0.7), rgba(8, 41, 27, 0.85));
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.88rem;
  cursor: pointer;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tab-btn:hover {
  border-color: rgba(212, 227, 171, 0.46);
}

.tab-btn.active {
  color: #0c2118;
  background: linear-gradient(145deg, rgba(223, 192, 112, 0.95), rgba(171, 226, 188, 0.95));
  border-color: rgba(238, 241, 200, 0.75);
}

.panel {
  display: none;
  padding: 0.62rem 0.68rem;
  animation: panelIn 260ms ease;
}

.panel.active {
  display: block;
}

.panel.panel-plain {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0.08rem 0.9rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

h2 {
  margin: 0 0 0.36rem;
  text-transform: uppercase;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.08em;
  font-size: clamp(1.12rem, 2.8vw, 1.7rem);
}

h3 {
  margin: 0 0 0.52rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.poster-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 0.46rem;
  justify-items: center;
}

.poster-grid.single {
  margin-top: 0.2rem;
}

.top20-grid {
  justify-items: stretch;
  grid-template-columns: 1fr !important;
}

.top20-grid .rank-board {
  max-width: none;
}

.rank-board {
  border: 1px solid rgba(176, 231, 200, 0.24);
  border-radius: 16px;
  padding: 0.42rem;
  background: linear-gradient(160deg, rgba(10, 59, 39, 0.72), rgba(4, 23, 16, 0.86));
  width: 100%;
  max-width: 560px;
}

.rank-board h3 {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.08em;
  font-size: 1.22rem;
}

.rank-board-sub {
  margin: -0.16rem 0 0.3rem;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.rank-list {
  display: grid;
  gap: 0.32rem;
}

.rank-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.32rem;
  align-items: start;
}

.rank-list.rank-list-half {
  gap: 0.28rem;
}

.leaderboard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  align-items: end;
  margin: 0 0 0.48rem;
}

.filter-field {
  display: grid;
  gap: 0.14rem;
  min-width: 128px;
}

.world-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
}

.world-map-wrap {
  display: grid;
  gap: 0.42rem;
  align-content: start;
}

.geo-summary {
  grid-template-columns: repeat(4, minmax(96px, 1fr));
}

.geo-summary .metric-card {
  padding: 0.4rem 0.45rem;
}

.geo-summary .metric-label {
  font-size: 0.62rem;
}

.geo-summary .metric-value {
  font-size: 1.05rem;
}

.world-map {
  width: 100%;
  min-height: 360px;
  border-radius: 14px;
  border: 1px solid rgba(168, 226, 197, 0.24);
  background: linear-gradient(160deg, rgba(8, 44, 30, 0.84), rgba(4, 22, 15, 0.9));
  overflow: hidden;
}

.world-side {
  margin-top: 0;
}

.leaflet-container {
  background: linear-gradient(160deg, rgba(8, 44, 30, 0.84), rgba(4, 22, 15, 0.9));
  font-family: "Barlow Condensed", sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(7, 38, 25, 0.95);
  color: #d9f2e4;
}

.leaflet-control-zoom a {
  background-color: rgba(9, 41, 28, 0.92);
  color: #dff6ea;
  border-color: rgba(159, 215, 185, 0.35);
}

.rank-row {
  display: grid;
  grid-template-columns: 82px 76px 1fr 52px;
  align-items: center;
  gap: 0.3rem;
  min-height: 72px;
  border-radius: 10px;
  border: 1px solid rgba(180, 230, 205, 0.2);
  background: linear-gradient(135deg, rgba(22, 103, 70, 0.78), rgba(7, 53, 35, 0.86));
  padding: 0.16rem 0.3rem 0.16rem 0.24rem;
}

.rank-row.rank-1 {
  border-color: rgba(248, 216, 122, 0.58);
  background: linear-gradient(135deg, rgba(77, 140, 87, 0.86), rgba(17, 69, 43, 0.9));
}

.rank-row.rank-2 {
  border-color: rgba(198, 214, 219, 0.55);
}

.rank-row.rank-3 {
  border-color: rgba(177, 137, 89, 0.58);
}

.rank-value {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(16, 70, 49, 0.76), rgba(7, 37, 25, 0.91));
  border: 1px solid rgba(212, 237, 223, 0.18);
  padding: 0.2rem 0.24rem 0.14rem;
  display: grid;
  align-content: center;
}

.rank-position {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.rank-number {
  font-family: "Bebas Neue", sans-serif;
  line-height: 1;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.rank-meta-small {
  font-size: 0.6rem;
  color: #caebd9;
  line-height: 1;
}

.rank-row.rank-1 .rank-number {
  color: var(--accent-gold);
}

.rank-row.rank-2 .rank-number {
  color: var(--accent-silver);
}

.rank-row.rank-3 .rank-number {
  color: var(--accent-bronze);
}

.rank-photo {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 65%);
}

.rank-photo img {
  max-width: 100%;
  max-height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 9px 13px rgba(0, 0, 0, 0.36));
}

.rank-main {
  overflow: hidden;
}

.rank-name {
  margin: 0;
  text-transform: uppercase;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  font-size: clamp(0.92rem, 1.8vw, 1.18rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.rank-desc {
  margin: 0.08rem 0 0;
  color: #cde8da;
  font-size: 0.68rem;
}

.rank-chip {
  justify-self: end;
  align-self: center;
  border-radius: 999px;
  border: 1px solid rgba(202, 238, 217, 0.26);
  background: rgba(7, 40, 28, 0.78);
  color: #e4f7ed;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.34rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.table-wrap {
  margin-top: 0.48rem;
  border-radius: 14px;
  padding: 0.5rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 0.86rem;
}

th,
td {
  padding: 0.44rem 0.38rem;
  border-bottom: 1px solid rgba(180, 230, 205, 0.17);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #b7dbc8;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

tbody tr:hover {
  background: rgba(178, 222, 201, 0.09);
}

.finder {
  max-width: 380px;
  display: grid;
  gap: 0.3rem;
}

label {
  color: var(--text-soft);
  font-size: 0.82rem;
}

input,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(170, 225, 196, 0.26);
  background: linear-gradient(140deg, rgba(8, 45, 29, 0.84), rgba(4, 24, 15, 0.92));
  color: var(--text);
  padding: 0.5rem 0.58rem;
  font-size: 0.95rem;
  font-family: "Barlow Condensed", sans-serif;
}

select {
  background: #000;
  color: #ecfff4;
  color-scheme: dark;
}

select option,
select optgroup {
  background-color: #000;
  color: #ecfff4;
}

.map-note {
  margin: 0.05rem 0 0.08rem;
  font-size: 0.82rem;
}

input::placeholder {
  color: #9fc7b5;
}

.profile-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.pill {
  display: inline-block;
  margin-right: 0.36rem;
  margin-bottom: 0.36rem;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(177, 228, 202, 0.23);
  background: rgba(9, 46, 31, 0.86);
  color: #daf2e5;
  font-size: 0.8rem;
}

.entity-cover {
  border-radius: 13px;
  border: 1px solid rgba(175, 227, 201, 0.24);
  background: linear-gradient(130deg, rgba(16, 82, 55, 0.86), rgba(7, 35, 24, 0.9));
  padding: 0.45rem;
  display: grid;
  grid-template-columns: 102px 1fr;
  gap: 0.55rem;
  align-items: center;
}

.entity-cover img {
  width: 100%;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
}

.entity-cover h3 {
  margin: 0;
  font-size: 1.35rem;
  text-transform: uppercase;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.08em;
}

.entity-cover p {
  margin: 0.22rem 0 0;
  color: #cde8da;
  font-size: 0.9rem;
}

.muted {
  color: var(--text-soft);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 880px) {
  .poster-grid {
    grid-template-columns: 1fr 1fr;
  }

  .poster-grid.single {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .world-layout {
    grid-template-columns: 1fr;
  }

  .geo-summary {
    grid-template-columns: repeat(2, minmax(92px, 1fr));
  }

  .world-map {
    min-height: 300px;
  }

  .rank-columns {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 74px 70px 1fr;
    grid-template-areas:
      "value photo main"
      "value photo chip";
    min-height: 68px;
    gap: 0.24rem;
  }

  .rank-value {
    grid-area: value;
  }

  .rank-photo {
    grid-area: photo;
  }

  .rank-main {
    grid-area: main;
  }

  .rank-chip {
    grid-area: chip;
    justify-self: start;
  }

  .rank-photo img {
    max-height: 56px;
  }
}
