:root {
  /* ---- leaderboard spacing knobs ---- */
  --lb-row-gap:        10px;  /* space between score rows           */
  --lb-col-gap:        8px;   /* space between columns              */
  --lb-title-margin:  12px;   /* space between title and header row */
  --lb-header-margin:  5px;   /* space between header row and divider */  
  --lb-sep-margin-top:    0x;  /* gap between header row and separator */
  --lb-sep-margin-bottom: 5px;  /* gap between separator and first row  */
  /* ---- title animation colors ---- */
  --lb-base:      rgb(128, 128, 0);      /* native font pixel color */
  --lb-highlight: rgba(180,255,180,0.9); /* pulse target color      */
}

.leaderboard-overlay {
  width: 90%;
  height: 90%;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  justify-content: flex-start;
  align-items: center;
  padding: 12px 20px;
  box-sizing: border-box;
  z-index: 1001;
  cursor: default;

  /* ---- leaderboard background ---- */
  background: rgba(0, 10, 0, 0.75);
}

.leaderboard-overlay::-webkit-scrollbar { display: none; } /* Chrome/Safari */

@keyframes lb-pulse {
  0%, 100% { fill: var(--lb-base); }
  50%      { fill: var(--lb-highlight); }
}

#lb_title_all  rect { animation: lb-pulse 1s ease-in-out infinite; }
#lb_title_time rect { animation: lb-pulse 1s ease-in-out infinite; animation-delay: 0.5s; }

.lb-row--new rect { animation: lb-pulse 1s ease-in-out infinite; }

/* ---- Leaderboard table layout ---- */
.lb-title-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: var(--lb-title-margin);
}

.lb-table {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--lb-row-gap);
}

.lb-header-row {
  display: flex;
  align-items: center;
  gap: var(--lb-col-gap);
  margin-bottom: calc(var(--lb-header-margin) - var(--lb-row-gap));
}

.lb-row {
  display: flex;
  align-items: center;
  gap: var(--lb-col-gap);
}

.lb-col {
  flex-shrink: 0;
}

[id$="_date"] {
  display: flex;
  justify-content: flex-end;
}

.lb-separator {
  display: flex;
  overflow: hidden;
  margin-top:    calc(var(--lb-sep-margin-top)    - var(--lb-row-gap));
  margin-bottom: calc(var(--lb-sep-margin-bottom) - var(--lb-row-gap));
}

/* ---- Back to game button ---- */
.back-to-game-btn {
  position: fixed;
  width: 185px;
  height: 50px;
  transform: translateX(-50%);
}

/* ---- Enter initials overlay ---- */
#initials-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  overflow-y: auto;
}

#initials-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(0, 10, 0, 0.9);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 12px 4px rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 14px 16px;
}

#initials-display {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}

@keyframes initials-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.initials-cursor-slot rect {
  animation: initials-cursor-blink 0.7s step-start infinite;
}

#initials-label {
  /* rendered as retro font */
}

#initials-char-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.initials-char-row {
  display: flex;
  flex-direction: row;
}

#initials-action-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}


.initials-char-btn,
#initials-backspace,
#initials-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  padding: 5px;
  min-width: 22px;
  min-height: 22px;
  cursor: pointer;
}

.initials-char-btn:hover,
.initials-char-btn:active {
  background: rgba(128,255,128,0.15);
  border-color: rgba(128,255,128,0.4);
}

#initials-backspace {
  padding: 10px 10px;
}

#initials-backspace:hover {
  background: rgba(255,100,100,0.2);
  border-color: rgba(255,100,100,0.4);
}

#initials-submit {
  padding: 10px 16px;
}

#initials-submit:hover {
  background: rgba(255,255,255,0.2);
}
