.home-link {
  border: 3px double #ff00ff;
  padding: 8px 12px;
  background-color: #ffeeff;
  display: inline-block;
  color: #0000cc !important;
  font-weight: bold;
  border-radius: 6px;
  box-shadow: 3px 3px 0 #cc00cc;
  text-decoration: none;
}

.home-link:hover {
  background-color: #ffccff;
  color: #ff00ff !important;
}

/* TV video and canvas scaling fix */
.tv-frame video,
.screen-inner video,
.screen-inner canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  border-radius: 10px;
}

/* Banner container scaling */
.banner-container {
  position: relative;
  margin-top: 30px;
  z-index: 2;
  transform: scale(0.7);
  transform-origin: top center;
}

/* Starfield */
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: .8;
}

/* Leaderboard */
#leaderboard {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  z-index: 31;
  text-align: center;
  padding: 16px;
  overflow-y: auto; /* Fix for hidden entries */
}

#leaderboard h3 {
  text-decoration: underline;
  margin: 6px 0 14px 0;
  font-size: 24px;
}

#leaderboard .blink-msg {
  margin-bottom: 16px;
  animation: blink 0.9s step-start infinite;
}

.score-row {
  display: flex;
  justify-content: space-between;
  width: 300px;
  max-width: 90%;
  margin: 4px 0;
}

.score-row span {
  display: inline-block;
  min-width: 80px;
}

.score-row .score {
  text-align: right;
}

.score-row.highlight {
  color: #0f0;
  animation: blink 0.9s step-start infinite;
}

/* TV panel controls */
.tv-panel {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 12px;
}

.panel-left, .panel-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tv-knob {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #eee,#777 40%,#444 100%);
  border: 3px solid #2a2a2a;
  box-shadow: 0 4px 8px rgba(0,0,0,.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s linear;
}

.tv-knob:active {
  transform: rotate(14deg) scale(.98);
}

.tv-label {
  font-size: 10px;
  color: #ddd;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000;
  user-select: none;
}

/* LED */
.tv-led {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6a0000;
  box-shadow: 0 0 6px rgba(255,0,0,.6);
  border: 2px solid rgba(0,0,0,.4);
}

.tv-led.on {
  background: limegreen;
  box-shadow: 0 0 12px rgba(0,255,0,.9);
}

/* Mobile remote buttons */
.mobile-remote {
  display: flex;
  justify-content: space-between;
  width: 60%;
  max-width: 400px;
  margin-top: 20px;
  z-index: 5;
}

.remote-button {
  flex: 1;
  margin: 0 30px;
  height: 100px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 30%, #eee,#666);
  border: 3px solid #2a2a2a;
  color: #fff;
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,.6);
  user-select: none;
}

.remote-button:active {
  transform: scale(0.95);
}

/* Start text blinking */
#startText {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  text-align: center;
  color: #fff;
  z-index: 30;
  pointer-events: none;
  animation: blink 1s steps(2,start) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .tv-frame {
    width: 95% !important;
    max-width: 420px !important;
    padding: 10px;
    border-radius: 18px;
    box-shadow: 0 0 20px rgba(0,255,255,0.1), 0 5px 15px rgba(0,0,0,0.7);
  }
  .tv-knob {
    width: 40px;
    height: 40px;
  }
  .tv-label {
    font-size: 10px;
  }
  .tv-panel {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  .score-row {
    width: 90%;
  }
}
