@font-face {
  font-family: "OETZTYP";
  src: url("../images/OETZTYP_.TTF") format("truetype");
  font-weight: normal;
  font-style: normal;
}

.container,
.container * {
  font-family: "OETZTYP", sans-serif !important;
}

.page-head h1 {
  font-family: "Bebas Neue", sans-serif !important;
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.table-wrap {
  overflow-x: auto;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.page-actions .btn {
  min-width: 10.5rem;
}

.page-actions label {
  color: #9db2e1;
  font-size: 0.88rem;
}

.page-actions select.btn {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(12, 18, 35, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #eaf1ff;
}

.page-actions select.btn option {
  background: #0f1730;
  color: #eaf1ff;
}

.week-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.week-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.page-head.week-head {
  align-items: stretch;
  flex-direction: column;
}

.page-head.week-head .week-actions {
  width: 100%;
}

.page-head.week-head .week-row {
  flex-wrap: nowrap;
}

.page-head.week-head.week-head-split {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
}

.page-head.week-head.week-head-split .week-actions {
  width: auto;
  align-items: flex-end;
}

.page-head.week-head.week-head-split .week-row {
  justify-content: flex-end;
}

.week-input {
  width: 8.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(12, 18, 35, 0.9);
  color: #eaf1ff;
  padding: 0.58rem 0.72rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.week-input:focus {
  outline: 2px solid rgba(140, 231, 255, 0.55);
  outline-offset: 1px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.lb-table th,
.lb-table td {
  padding: 0.75rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  font-size: 150%;
}

.lb-table td {
  color: #ffffff;
}

.lb-table th {
  color: #9db2e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lb-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lb-table.lb-colored thead th {
  background: #09418b;
  color: #eaf1ff;
}

.lb-row-alt-a td {
  background: #240655;
}

.lb-row-alt-b td {
  background: #150133;
}

.lb-row-alt-a:hover td,
.lb-row-alt-b:hover td {
  background: inherit;
}

.lb-row-alt-a:hover td {
  background: #240655;
}

.lb-row-alt-b:hover td {
  background: #150133;
}

.lb-row-prestige-odd td {
  background: #875614;
}

.lb-row-prestige-even td {
  background: #291224;
}

.lb-row-prestige-odd:hover td {
  background: #875614;
}

.lb-row-prestige-even:hover td {
  background: #291224;
}

.rank-pill {
  display: inline-flex;
  min-width: 2.1rem;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.rank-1 {
  color: #10111f;
  background: linear-gradient(120deg, #ffd75f, #ffae3d);
  border-color: transparent;
}

.rank-2 {
  color: #10111f;
  background: linear-gradient(120deg, #d6e4ff, #9ab5e8);
  border-color: transparent;
}

.rank-3 {
  color: #10111f;
  background: linear-gradient(120deg, #ffc2a2, #f18d57);
  border-color: transparent;
}

.mini-link {
  display: inline-block;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.country-flag-cell {
  width: 64px;
  text-align: center;
}

.name-flag-image {
  width: 45px;
  height: 45px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}

.mini-link:hover {
  text-decoration: underline;
}

.clan-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.clan-name-text {
  display: inline-flex;
  align-items: center;
}

.clan-badge-slot {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clan-badge-image {
  width: 45px;
  height: 45px;
  object-fit: contain;
  image-rendering: pixelated;
}

.clan-badge-composite {
  width: 45px;
  height: 45px;
  display: inline-block;
  position: relative;
}

.clan-badge-layer {
  width: 45px;
  height: 45px;
  position: absolute;
  inset: 0;
  object-fit: contain;
  image-rendering: pixelated;
}

.clan-badge-layer--shield {
  z-index: 1;
}

.clan-badge-layer--icon {
  z-index: 2;
}

.prestige-score {
  display: inline-block;
  font-weight: 700;
  color: #ffffff;
}

.prize-cell {
  width: 74px;
}

.prize-badge {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.cell-sub {
  display: block;
  font-size: 0.78rem;
  color: #a5b2d1;
  margin-top: 0.1rem;
}

.leaderboard-section {
  margin-top: 1rem;
}

#pastMeta {
  margin: 0.35rem 0;
  line-height: 1.1;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.section-title {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.leaderboard-timer {
  margin: 0;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(140, 231, 255, 0.45);
  background: rgba(9, 65, 139, 0.34);
  color: #f3fbff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: pre-line;
  line-height: 1.45;
}

.week-info-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(140, 231, 255, 0.3);
  background: rgba(9, 65, 139, 0.22);
  color: #f3fbff;
}

.week-info-card[hidden] {
  display: none !important;
}

.week-info-image-wrap {
  width: 4.1rem;
  height: 4.1rem;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-info-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.week-info-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.12;
}

.week-info-date {
  font-size: 1.02rem;
  font-weight: 700;
}

.week-info-mode {
  font-size: 0.92rem;
  color: #d9e9ff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 20, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(640px, 96vw);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0f1730;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  padding: 1rem;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.4rem;
}

.modal-close {
  min-width: 0;
}

.flag-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

.flag-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  padding: 0.5rem;
  min-height: 3.1rem;
  cursor: pointer;
}

.flag-icon {
  width: 2.2rem;
  height: 1.6rem;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.flag-emoji-fallback {
  font-family:
    "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.7rem;
}

.flag-btn:hover {
  border-color: rgba(140, 231, 255, 0.75);
  background: rgba(140, 231, 255, 0.12);
}

@media (max-width: 760px) {
  .page-head.week-head.week-head-split {
    flex-direction: column;
    align-items: stretch;
  }

  .page-head.week-head.week-head-split .week-actions {
    width: 100%;
    align-items: flex-start;
  }

  .page-head.week-head.week-head-split .week-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .flag-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-actions .btn {
    min-width: 0;
  }
}
