/* The leaderboard page, in Kill Chain's terminal look: near-black, phosphor green, amber for first
   place. Fonts and the base page come from app.css and site.css. The first three rows of the list
   are turned into a podium here, so the page script only ever makes one plain list. */
body.lb { background: radial-gradient(120% 70% at 50% 0%, #0a2a1e 0%, #051209 50%, #020705 100%) fixed; color: #dcffec; }
body.lb::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px); }
body.lb main { position: relative; z-index: 1; }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lb .back { color: #3dff9a; }
.lb-head { padding: 18px 0 6px; }
.lb-head .live { color: #3dff9a; }
.lb-head h1 { font-size: clamp(40px, 11.5vw, 92px); line-height: .9; margin: 6px 0 12px; }
.lb-head h1 em { font-style: normal; color: #ffc533; display: block; }
.lb-head .tag { color: #7fa893; max-width: 46ch; }
.lb a { color: #3dff9a; } .lb a.btn { color: #1a1200; } .lb a.acct { color: #dcffec; } .lb a.acct.in { color: #06231b; }

/* the row of boards */
.lb-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 8px; scrollbar-width: none; }
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tabs button { flex: none; min-height: 44px; padding: 0 14px; border: 1.5px solid #1c4a39; background: rgba(3,10,7,.9); color: #7fa893; font: 700 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
                  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.lb-tabs button.on { background: #3dff9a; color: #021008; border-color: #3dff9a; }
.lb-note { font: 400 13px/1.4 var(--mono); color: #7fa893; min-height: 1.4em; margin: 2px 0 12px; }
.lb-note::before { content: "> "; color: #3dff9a; }

/* the list */
.lb-rows { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; counter-reset: none; }
.lb-rows li { position: relative; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; min-height: 50px; padding: 6px 16px 6px 6px; overflow: hidden;
              border: 1.5px solid #1c4a39; background: rgba(3,10,7,.85); animation: lbin .35s ease both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes lbin { from { opacity: 0; transform: translateY(8px); } }
/* a bar behind each row shows how close that score is to first place */
.lb-rows li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: linear-gradient(90deg, rgba(61,255,154,.16), rgba(61,255,154,.03)); pointer-events: none; }
.lb-rows .rk { position: relative; justify-self: center; width: 36px; height: 36px; display: grid; place-items: center; font: 700 14px var(--mono); color: #7fa893; border: 1.5px solid #1c4a39; font-variant-numeric: tabular-nums; }
.lb-rows .nm { position: relative; font: 600 17px var(--body); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-rows .nm small { font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #7fa893; margin-left: 8px; }
.lb-rows .sc { position: relative; font: 800 26px/1 var(--disp); font-variant-numeric: tabular-nums; color: #dcffec; }
.lb-rows li.you { border-color: #ffc533; box-shadow: 0 0 18px rgba(255,197,51,.18); } .lb-rows li.you .nm small { color: #ffc533; }

/* the podium: the first three rows, larger, each with its own metal */
.lb-rows li:nth-child(-n+3) { grid-template-columns: 58px 1fr auto; min-height: 76px; padding: 10px 18px 10px 10px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); }
.lb-rows li:nth-child(-n+3) .rk { width: 48px; height: 48px; font-size: 20px; border: 0; color: #021008; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.lb-rows li:nth-child(-n+3) .nm { font: 800 26px/1 var(--disp); text-transform: uppercase; letter-spacing: .02em; }
.lb-rows li:nth-child(-n+3) .sc { font-size: 44px; }
.lb-rows li:nth-child(1) { border-color: #ffc533; background: rgba(60,42,2,.55); box-shadow: 0 0 34px rgba(255,197,51,.22); min-height: 92px; }
.lb-rows li:nth-child(1)::before { background: linear-gradient(90deg, rgba(255,197,51,.22), rgba(255,197,51,.02)); }
.lb-rows li:nth-child(1) .rk { background: #ffc533; } .lb-rows li:nth-child(1) .sc { color: #ffc533; font-size: 56px; }
.lb-rows li:nth-child(1) .nm::before { content: "Top operator"; display: block; font: 700 10px var(--mono); letter-spacing: .14em; color: #ffc533; margin-bottom: 4px; }
.lb-rows li:nth-child(2) { border-color: #b9c6d6; } .lb-rows li:nth-child(2) .rk { background: #cfd9e6; }
.lb-rows li:nth-child(3) { border-color: #c98556; } .lb-rows li:nth-child(3) .rk { background: #d08a55; }

/* nobody here yet */
.lb-empty { display: grid; gap: 4px; padding: 26px 18px; margin-bottom: 14px; text-align: center; border: 1.5px dashed #3dff9a; background: rgba(61,255,154,.05); }
.lb-empty[hidden] { display: none; }
.lb-empty b { font: 800 clamp(26px, 7vw, 40px)/1 var(--disp); text-transform: uppercase; color: #dcffec; }
.lb-empty span { font: 400 14px var(--mono); color: #7fa893; }
/* the signed-in player's own place, when it is below the top twenty */
.lb-mine { padding: 12px 14px; margin: 0 0 14px; border: 1.5px solid #ffc533; background: rgba(60,42,2,.45); font: 700 14px var(--mono); color: #ffc533; }
.lb-mine[hidden] { display: none; }
.lb-cta { margin-top: 18px; }
.lb .btn.big { clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); border-radius: 0; }

/* wide screens: the three podium places stand side by side, first place in the middle and tallest */
@media (min-width: 900px) {
  /* a shorter headline on wide screens, so the podium is in view without scrolling */
  .lb-head h1 { font-size: 64px; } .lb-head h1 em { display: inline; }
  .lb-head { padding-top: 8px; }
  .lb-rows { grid-template-columns: repeat(3, 1fr); column-gap: 12px; align-items: end; }
  .lb-rows li { grid-column: 1 / -1; }
  .lb-rows li:nth-child(-n+3) { grid-column: auto; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 8px; padding: 22px 14px 20px; clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%); }
  .lb-rows li:nth-child(1) { order: 2; min-height: 250px; } .lb-rows li:nth-child(2) { order: 1; min-height: 205px; } .lb-rows li:nth-child(3) { order: 3; min-height: 180px; }
  .lb-rows li:nth-child(n+4) { order: 4; }
  .lb-rows li:nth-child(-n+3)::before { inset: auto 0 0 0; width: auto; height: var(--w, 0%); background: linear-gradient(0deg, rgba(61,255,154,.14), transparent); }
  .lb-rows li:nth-child(1)::before { background: linear-gradient(0deg, rgba(255,197,51,.2), transparent); }
  .lb-rows li:nth-child(-n+3) .rk { width: 62px; height: 62px; font-size: 26px; justify-self: center; }
  .lb-rows li:nth-child(-n+3) .nm { white-space: normal; font-size: 30px; }
  .lb-rows li:nth-child(1) .sc { font-size: 84px; } .lb-rows li:nth-child(-n+3) .sc { font-size: 60px; }
  /* with fewer than three players, the ones there still stand in a row */
  .lb-cta { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { .lb-rows li { animation: none; } }
