/* Baltic Tierlist fan logo — scoped for site embedding */

.btl-logo {
  --h-side: 280px;
  --h: var(--h-side);
  --peak: 8%;
  --tip: 78%;
  --center-w: 300px;
  --design-w: 900;
  position: relative;
  width: min(96vw, 900px);
  height: 380px;
  margin-inline: auto;
}

.btl-logo .pane {
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: var(--w);
  height: var(--h);
  margin-left: calc(var(--w) / -2);
  transform-origin: 50% 100%;
  z-index: var(--z);
  filter:
    drop-shadow(0 0 0.5px #000)
    drop-shadow(0 0 0.5px #000);
}

.btl-logo .pane--front {
  --w: var(--center-w);
  --h: calc(var(--h-side) / 0.92);
}

.btl-logo .pane--half-left,
.btl-logo .pane--half-right {
  --w: calc(var(--center-w) * 0.55);
  transform: rotate(0deg);
}

.btl-logo .face {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.btl-logo .pane--front .face {
  clip-path: polygon(
    50% 0%,
    100% var(--peak),
    86% var(--tip),
    50% 100%,
    14% var(--tip),
    0% var(--peak)
  );
}

.btl-logo .pane--half-left .face {
  clip-path: polygon(0% 0%, 50% 0%, 50% 100%, 14% var(--tip));
}

.btl-logo .pane--half-right .face {
  clip-path: polygon(50% 0%, 100% 0%, 86% var(--tip), 50% 100%);
}

.btl-logo .face--ee,
.btl-logo .face--lv,
.btl-logo .face--lt {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
}

.btl-logo .face--ee span,
.btl-logo .face--lv span,
.btl-logo .face--lt span {
  min-height: 0;
}

.btl-logo .face--ee span:nth-child(1) { background: #0072ce; }
.btl-logo .face--ee span:nth-child(2) { background: #000; }
.btl-logo .face--ee span:nth-child(3) { background: #fff; }

.btl-logo .face--lv {
  grid-template-rows: 2fr 1fr 2fr;
}
.btl-logo .face--lv span:nth-child(1) { background: #9e3039; }
.btl-logo .face--lv span:nth-child(2) { background: #fff; }
.btl-logo .face--lv span:nth-child(3) { background: #9e3039; }

.btl-logo .face--lt span:nth-child(1) { background: #fdb913; }
.btl-logo .face--lt span:nth-child(2) { background: #006a44; }
.btl-logo .face--lt span:nth-child(3) { background: #c1272d; }

.btl-logo .face--front {
  display: block;
  background-color: transparent;
  background-image: url("/static/logo/mc-shield.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.btl-logo .word,
.btl-logo .mark {
  display: none;
}

/* Country ranking lives in the sticky header */
.country-ranking {
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.country-ranking-title,
.country-ranking-sub {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.country-ranking-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.country-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  background: rgba(14, 24, 34, 0.9);
  border: 1px solid rgba(194, 212, 225, 0.14);
  border-radius: 0.65rem;
}

.country-place {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-gold);
  min-width: 1.1rem;
}

.country-card .region-flag img {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 1px;
}

.country-meta {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.country-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.country-name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-best-name {
  color: var(--foreground);
  font-weight: 600;
}

.country-points {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: right;
  line-height: 1.05;
  flex: 0 0 auto;
}

.country-pts-col,
.country-avg-col {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  white-space: nowrap;
}

.country-points span.country-pts,
.country-points span.country-avg {
  display: inline;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.country-points span.country-pts {
  color: var(--brand-gold);
}

.country-points span.country-avg {
  color: var(--steel);
  font-size: 0.92rem;
}

.country-points small {
  color: var(--muted-foreground);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.country-tier {
  flex: 0 0 auto;
}

.country-lt {
  box-shadow: inset 3px 0 0 #fdb913;
}

.country-lv {
  box-shadow: inset 3px 0 0 #9e3039;
}

.country-ee {
  box-shadow: inset 3px 0 0 #0072ce;
}

.board.is-loading .board-results-body {
  visibility: hidden;
}

.board-results {
  position: relative;
  min-height: 14rem;
}

.board-loader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.board-loader[hidden] {
  display: none;
}

.btl-logo--loader {
  width: min(72vw, 420px);
  height: 180px;
  --h-side: 132px;
  --center-w: 140px;
  margin: 0;
}

.btl-logo--loader .pane {
  bottom: 16px;
}

.btl-logo--loader .face--front {
  padding: 0;
}

@media (max-width: 1100px) {
  .top-header {
    flex-wrap: wrap;
  }

  .top-header .country-ranking {
    order: 3;
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  .country-ranking-list {
    grid-template-columns: 1fr;
  }
}

/* Centered masthead logo above the header bar */
.btl-logo--masthead {
  width: min(90vw, 440px);
  height: 220px;
  --h-side: 145px;
  --center-w: 147px;
  margin: 0;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
}

.btl-logo--masthead .pane {
  bottom: 20px;
}

.btl-logo--masthead .face--front {
  padding: 0;
}

.btl-logo--masthead.is-spinning {
  filter:
    drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 18px rgba(251, 230, 123, 0.18));
}

@media (max-width: 640px) {
  .btl-logo--masthead {
    width: min(92vw, 320px);
    height: 168px;
    --h-side: 108px;
    --center-w: 110px;
  }

  .btl-logo--masthead .pane {
    bottom: 14px;
  }

  .btl-logo--hero {
    width: min(96vw, 420px);
    height: 200px;
    --h-side: 148px;
    --center-w: 156px;
  }

  .btl-logo--hero .pane {
    bottom: 18px;
  }
}
