/* ============================================================
   scoreboard.css — 네온 랭킹 보드판 (항상 표시)
   · WIDE : 스테이지 우측 열에 고정
   · TALL : 게임 아래쪽에 배치 (세로로 긴 화면)
   · 서버 주간 랭킹 TOP 10 (오차 오름차순)
   ============================================================ */

#scoreboard {
  position: absolute;
  left: 1100px;
  top: 250px;
  width: 560px;
  z-index: 30;
  opacity: 1;
  animation: boardIn .6s ease-out;
}
@keyframes boardIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 세로로 긴 화면 : 게임 아래로 내려간다 (가로가 넉넉하므로 한 줄로 압축) */
#stage.tall #scoreboard {
  left: 40px;
  top: 1940px;
  width: 1000px;
}
#stage.tall .brow            { height: 64px; grid-template-columns: 56px 1fr 170px; }
#stage.tall .brow.r1         { height: 78px; }
#stage.tall .brow .nm        { flex-wrap: nowrap; }
#stage.tall .brow .when      { flex: 0 0 auto; margin-left: auto; padding-left: 12px; }
#stage.tall .brow.empty .when { display: none; }

.board-frame {
  position: relative;
  border-radius: 22px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(6,1,18,.96), rgba(12,2,32,.98));
  border: 6px solid var(--neon-cyan);
  box-shadow:
     0 0 20px var(--neon-cyan),
     0 0 52px rgba(0,229,255,.55),
     inset 0 0 30px rgba(255,91,208,.28),
     0 20px 50px rgba(0,0,0,.7);
  animation: boardBreath 2.6s ease-in-out infinite;
}
@keyframes boardBreath {
  0%,100% { filter: brightness(1); }
  50%     { filter: brightness(1.16); }
}
.board-frame::before,
.board-frame::after {
  content: '★';
  position: absolute;
  font-size: 30px;
  color: var(--neon-yellow);
  text-shadow: 0 0 12px var(--neon-yellow);
  animation: starSpin 5s linear infinite;
}
.board-frame::before { left: 2px;  top: -20px; }
.board-frame::after  { right: 2px; top: -20px; }

/* ---------- 헤더 ---------- */
.board-header {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 12px;
}
.board-header h2 {
  font-size: 42px;
  letter-spacing: 4px;
  white-space: nowrap;
  background: linear-gradient(90deg, #ff2d55, #ffd60a, #39ff14, #00e5ff, #b14aed, #ff2d55);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowFlow 4s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255,255,255,.45));
}
@keyframes rainbowFlow { to { background-position: 300% 0; } }

.board-header .bulbs {
  flex: 1;
  height: 9px;
  background-image: radial-gradient(circle, #fff 38%, rgba(255,255,255,0) 40%);
  background-size: 24px 9px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 5px #ffe9a8);
  animation: bulbRun 1s linear infinite;
}

/* ---------- 순위 행 (10줄) ---------- */
.board-rows { display: flex; flex-direction: column; gap: 10px; }

.brow {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr 150px;
  align-items: center;
  gap: 8px;
  height: 84px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 3px solid var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0,229,255,.4), inset 0 0 12px rgba(0,229,255,.1);
  opacity: 0;
  transform: translateX(-24px);
  animation: rowIn .4s ease-out forwards;
  overflow: hidden;
}
@keyframes rowIn { to { opacity: 1; transform: translateX(0); } }

.brow .rk  { font-size: 28px; text-align: center; color: #fff; text-shadow: 0 0 10px currentColor; }

/* 닉네임 + 등급태그 + 기록시각 */
.brow .nm  { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.brow .who {
  font-size: 34px; color: #fff;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brow .when {
  flex: 1 1 100%;
  font-family: 'Courier New', monospace;
  font-size: 19px;
  color: rgba(255,255,255,.48);
  letter-spacing: .3px;
  line-height: 1.1;
  white-space: nowrap;
}
.brow.r1 .when { color: rgba(255,248,220,.72); }

/* 기록 / 오차 — 한 칸에 위아래로 */
.brow .score {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  line-height: 1.05;
}
.brow .rec { font-family: 'Courier New', monospace; font-size: 34px; color: #fff; }
.brow .dif { font-family: 'Courier New', monospace; font-size: 21px; text-shadow: 0 0 8px currentColor; }

/* 등급 태그 */
.gtag {
  flex: 0 0 auto;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 19px;
  border: 2px solid currentColor;
  text-shadow: 0 0 8px currentColor;
}

/* 방금 플레이한 기록 표시 */
.brow.me { background: rgba(255,255,255,.13); }
.brow.me .who::after {
  content: 'NEW';
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 16px;
  vertical-align: middle;
  color: #06280a;
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
  animation: newBlink 1.2s ease-in-out infinite;
}
@keyframes newBlink { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* 1위 : 골드 + 왕관 + 스윕 하이라이트 */
.brow.r1 {
  height: 100px;
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(255,215,0,.24), rgba(255,215,0,.06));
  box-shadow: 0 0 22px var(--gold), 0 0 46px rgba(255,215,0,.5), inset 0 0 20px rgba(255,215,0,.22);
}
.brow.r1 .rk  { font-size: 32px; }
.brow.r1 .who,
.brow.r1 .rec { font-size: 38px; color: #fff8dc; text-shadow: 0 0 14px var(--gold), 0 0 32px var(--gold); }
.brow.r1::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -40%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  animation: sweep 2.6s ease-in-out infinite;
}
@keyframes sweep { 0% { left: -45%; } 60%,100% { left: 115%; } }

.brow.r2 { border-color: var(--silver); box-shadow: 0 0 14px var(--silver), inset 0 0 12px rgba(192,192,192,.16); }
.brow.r2 .rk, .brow.r2 .who, .brow.r2 .rec { color: #f2f2f2; text-shadow: 0 0 10px var(--silver); }
.brow.r3 { border-color: var(--bronze); box-shadow: 0 0 14px var(--bronze), inset 0 0 12px rgba(205,127,50,.18); }
.brow.r3 .rk, .brow.r3 .who, .brow.r3 .rec { color: #ffd9b3; text-shadow: 0 0 10px var(--bronze); }

/* 빈 자리(아직 기록 없는 순위) */
.brow.empty {
  border-color: rgba(255,255,255,.14);
  box-shadow: none;
  background: rgba(255,255,255,.025);
}
.brow.empty .rk  { color: rgba(255,255,255,.3); text-shadow: none; }
.brow.empty .who { color: rgba(255,255,255,.22); font-size: 30px; }

/* 기록 없음 / 로딩 */
.board-empty {
  padding: 40px 10px;
  text-align: center;
  font-size: 26px;
  color: rgba(255,255,255,.55);
}

/* ---------- 하단 버튼 / 요약 / 초기화 ---------- */
.board-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 16px;
}
.board-actions .nbtn { font-size: 24px; padding: 11px 20px; white-space: nowrap; }

.board-best {
  margin-top: 10px;
  font-size: 20px;
  color: rgba(255,255,255,.6);
  text-align: center;
}
.board-best b { color: var(--neon-yellow); text-shadow: 0 0 8px var(--neon-yellow); }

/* 주간 초기화 안내 */
.board-reset {
  margin-top: 8px;
  text-align: center;
  font-size: 18px;
  color: rgba(255,255,255,.62);
  letter-spacing: .4px;
  line-height: 1.4;
}
.board-reset b { color: var(--neon-cyan, #00e5ff); }
.board-reset .rst { color: rgba(255,255,255,.4); font-size: 16px; }
