@import url("https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap");

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Silkscreen", "Lucida Console", "Courier New", monospace;
  background: #080c14;
  color: #d9eeff;
  overflow-x: hidden;
  image-rendering: pixelated;
}

.page {
  width: min(1040px, calc(100vw - 32px));
  margin: 16px auto;
  padding: 14px;
  box-sizing: border-box;
  background: #121a28;
  border: 4px solid #27354f;
  box-shadow:
    0 0 0 4px #0a1019,
    0 12px 0 #060a11;
}

.masthead {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

.masthead-copy {
  min-height: 182px;
  padding: 16px 18px;
  background: #192338;
  color: #fffef9;
  border: 4px solid #314262;
  box-shadow:
    inset 0 0 0 4px #23324d,
    0 8px 0 #0b111b;
  box-sizing: border-box;
  display: grid;
  align-content: center;
}

.masthead-art {
  display: grid;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ffef8f;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.86rem;
  text-shadow: 2px 2px 0 #17315f;
}

h1,
.copy {
  margin: 0;
}

h1 {
  font-family: "Silkscreen", "Lucida Console", "Courier New", monospace;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #17315f;
}

.masthead-image {
  width: min(290px, 100%);
  height: 182px;
  object-fit: cover;
  border: 4px solid #314262;
  box-shadow:
    inset 0 0 0 4px rgba(15, 22, 34, 0.35),
    0 8px 0 #0b111b;
}

.board-shell {
  position: relative;
  z-index: 1;
  padding: 12px;
  background: #111a2a;
  color: #fffef9;
  border: 4px solid #314262;
  box-shadow:
    inset 0 0 0 4px #1d2940,
    0 8px 0 #0b111b;
}

.status-text {
  margin: 0 0 12px;
  color: #d8f6ff;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.my-rank-section {
  margin: 0 0 52px;
}

.my-rank-section[hidden] {
  display: none;
}

.my-rank-title {
  margin: 0 0 10px;
  color: #ffe57b;
  font-size: 0.84rem;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #3b2a00;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1.3fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  background:
    linear-gradient(180deg, rgba(28, 83, 165, 0.94) 0%, rgba(18, 55, 119, 0.98) 100%);
  border: 3px solid #79dbff;
  box-shadow: 0 5px 0 #0f274f;
}

.leaderboard-item-current {
  border-color: #ff8ea1;
  box-shadow:
    0 0 0 3px rgba(255, 142, 161, 0.22),
    0 5px 0 #5b2230;
}

.leaderboard-item-rank-1 {
  transform: scale(1.02);
  background: linear-gradient(180deg, rgba(116, 83, 18, 0.98) 0%, rgba(70, 49, 11, 1) 100%);
  border-color: #ffe27b;
  box-shadow: 0 6px 0 #5e4103;
}

.leaderboard-item-rank-2 {
  transform: scale(1.015);
  background: linear-gradient(180deg, rgba(94, 120, 148, 0.98) 0%, rgba(46, 66, 91, 1) 100%);
  border-color: #dfeeff;
  box-shadow: 0 6px 0 #274260;
}

.leaderboard-item-rank-3 {
  transform: scale(1.01);
  background: linear-gradient(180deg, rgba(138, 87, 47, 0.98) 0%, rgba(90, 48, 19, 1) 100%);
  border-color: #ffc58e;
  box-shadow: 0 6px 0 #5c2e10;
}

.leaderboard-rank {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: #e9f4ff;
  color: #0f1b2f;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1;
  border: 3px solid #365b8e;
  box-shadow: 0 4px 0 #0f1b2f;
  text-shadow: none;
}

.leaderboard-item-rank-1 .leaderboard-rank,
.leaderboard-item-rank-2 .leaderboard-rank,
.leaderboard-item-rank-3 .leaderboard-rank {
  width: 56px;
  height: 56px;
  font-size: 1.06rem;
}

.leaderboard-item-rank-1 .leaderboard-rank {
  background: #ffd15c;
  color: #5b2f00;
  border-color: #8a4900;
  box-shadow: 0 4px 0 #6d3200;
}

.leaderboard-item-rank-2 .leaderboard-rank {
  background: #cfd8e3;
  color: #27384a;
  border-color: #5d7088;
  box-shadow: 0 4px 0 #364556;
}

.leaderboard-item-rank-3 .leaderboard-rank {
  background: #cf8650;
  color: #40200b;
  border-color: #7a431d;
  box-shadow: 0 4px 0 #5b2e10;
}

.leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.08rem;
  font-weight: 800;
  color: #fffef9;
  text-shadow: 2px 2px 0 rgba(10, 20, 53, 0.95);
}

.leaderboard-score {
  color: #ffe57b;
  font-weight: 800;
  font-size: 0.94rem;
  text-shadow: 2px 2px 0 rgba(91, 55, 0, 0.95);
}

.leaderboard-meta {
  color: #bfeeff;
  font-size: 0.78rem;
}

.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.pagination-button {
  appearance: none;
  border: 3px solid #8a4900;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  color: #6d3200;
  background: linear-gradient(180deg, #fff2a4 0%, #ffbb57 100%);
  cursor: pointer;
  box-shadow: 0 4px 0 #6d3200;
}

.pagination-button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: 0 4px 0 rgba(109, 50, 0, 0.45);
}

.page-indicator {
  color: #d8f3ff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .page {
    width: min(1040px, calc(100vw - 18px));
    margin: 9px auto;
    padding: 12px;
    border-radius: 20px;
  }

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

  .masthead-copy,
  .masthead-image {
    min-height: 0;
    height: auto;
  }

  .masthead-image {
    width: 100%;
    height: 180px;
  }

  .leaderboard-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }
}
