/* Block Runner – Ranking window (design pass 6): glass pills, pot hero with countdown, podium 1-3 with gold / silver / bronze glow,
   a paged list (no scrolling) and my own row pinned at the bottom; sideways phones put podium and list next to each other */
.rbox { width: min(980px, 100%); height: min(760px, 100%); }
.rbox .win-head .rk-live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: rgba(5,7,10,.45); font: 600 12px var(--body); color: var(--silver); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rk-live::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--teal); animation: rkDot 1.6s ease-in-out infinite; }
.rk-live:empty { display: none; }
@keyframes rkDot { 50% { opacity: .35; transform: scale(.7); } }
.rbox .win-body.rk-body { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; padding: 12px 14px 12px; touch-action: manipulation; }

/* tabs: glass pills, the bright pill slides to the chosen one */
.rk-tabs { position: relative; display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(5,7,10,.5); border: 1px solid var(--line); flex: none; }
.rk-tabs button { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; min-height: 38px; padding: 0 6px; border: 0; border-radius: 99px; background: none; color: var(--silver);
  font: 700 12px var(--disp); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .25s; }
.rk-tabs button:hover { color: var(--white); }
.rk-tabs button[aria-selected="true"] { color: var(--void); }
.rk-tabs button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.rk-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 99px; background: linear-gradient(160deg, var(--cyan), var(--teal));
  box-shadow: 0 0 18px rgba(46,230,168,.4), inset 0 1px 0 rgba(255,255,255,.5); transition: transform .38s cubic-bezier(.2,1.25,.4,1), width .38s cubic-bezier(.2,1.25,.4,1); }

.rk-main { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.rk-main.anim > * { animation: rkIn .36s cubic-bezier(.2,1.2,.4,1) backwards; }
.rk-main.anim > :nth-child(2) { animation-delay: .06s; }
@keyframes rkIn { from { opacity: 0; transform: translateY(10px); } }

/* hero: pot amount big, countdown next to it */
.rk-hero { position: relative; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255,201,74,.3); background: radial-gradient(120% 140% at 0% 0%, rgba(255,201,74,.2), transparent 60%), linear-gradient(180deg, rgba(26,35,48,.85), rgba(9,13,19,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.35); }
.rk-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255,236,190,.1) 50%, transparent 60%) 0 0 / 260% 100% no-repeat; animation: gcSheen 6s linear infinite; }
.rk-pot { display: grid; min-width: 0; }
.rk-pl { font: 700 11px var(--disp); letter-spacing: .14em; text-transform: uppercase; color: #ffd98a; }
.rk-pv { display: flex; align-items: baseline; gap: 8px; min-width: 0; font: 800 clamp(24px, 4.4vw, 36px)/1.1 var(--disp); color: #ffe08a; text-shadow: 0 0 22px rgba(255,201,74,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-pv small { font: 700 13px var(--disp); color: #ffcf6a; letter-spacing: .04em; text-shadow: none; }
.rk-psub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-clock { justify-self: end; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: rgba(5,7,10,.5); border: 1px solid var(--line); }
.rk-clock > svg { width: 28px; height: 28px; flex: none; color: var(--cyan); filter: drop-shadow(0 0 6px rgba(111,231,255,.5)); }
.rk-clock span { display: grid; line-height: 1.15; }
.rk-clock small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rk-clock b { font: 800 19px var(--disp); color: var(--white); letter-spacing: .03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-info { position: absolute; top: 6px; right: 6px; z-index: 1; width: 26px; height: 26px; padding: 3px; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.rk-info:hover, .rk-info[aria-expanded="true"] { color: var(--cyan); }
.rk-info svg { width: 100%; height: 100%; display: block; }
.rk-hero:has(.rk-info) .rk-clock { margin-right: 22px; }
.rk-rule { position: absolute; z-index: 5; top: 118px; left: 14px; right: 14px; margin: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2);
  background: rgba(10,14,20,.96); box-shadow: 0 18px 40px rgba(0,0,0,.6); font-size: 13px; line-height: 1.45; color: var(--silver); animation: rkIn .22s ease-out; }

/* stage: podium on top, list below (side by side on sideways phones) */
.rk-stage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.rk-podium { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 20px 4px 0; }
.rk-pod { --m: #ffc94a; --mg: rgba(255,201,74,.55); position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; text-align: center;
  animation: rkRise .55s cubic-bezier(.2,1.3,.4,1) backwards; animation-delay: calc(var(--i) * 90ms + .05s); }
.rk-pod.p2 { --m: #dfe7f3; --mg: rgba(214,226,243,.45); }
.rk-pod.p3 { --m: #e39a5f; --mg: rgba(227,154,95,.45); }
@keyframes rkRise { from { opacity: 0; transform: translateY(26px) scale(.9); } }
.rk-ava { position: relative; width: 64px; height: 64px; margin-bottom: 4px; }
.rk-pod.p1 .rk-ava { width: 82px; height: 82px; }
.rk-ava::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, var(--mg), transparent 68%); animation: rkGlow 2.4s ease-in-out infinite alternate; }
.rk-ava img, .rk-ghost { position: relative; width: 100%; height: 100%; display: block; border-radius: 50%; border: 3px solid var(--m);
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), rgba(5,7,10,.85) 75%); box-shadow: 0 0 0 3px rgba(5,7,10,.6), 0 0 18px var(--mg); object-fit: contain; }
.rk-ghost { display: grid; place-items: center; font: 800 26px var(--disp); color: var(--muted); border-style: dashed; box-shadow: none; }
@keyframes rkGlow { from { opacity: .45; transform: scale(.92); } to { opacity: 1; transform: scale(1.06); } }
.rk-medal { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font: 800 13px var(--disp); color: #1a1206;
  background: radial-gradient(circle at 35% 30%, #fff, var(--m) 60%); border: 2px solid rgba(5,7,10,.7); }
.rk-crown { position: absolute; z-index: 1; top: -22px; left: 50%; width: 32px; height: 26px; transform: translateX(-50%) rotate(-8deg); color: #ffc94a; filter: drop-shadow(0 0 8px rgba(255,201,74,.8)); animation: rkCrown 3s ease-in-out infinite; }
.rk-crown svg { width: 100%; height: 100%; display: block; }
@keyframes rkCrown { 50% { transform: translateX(-50%) translateY(-3px) rotate(6deg); } }
.rk-pn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px var(--disp); color: var(--white); }
.rk-pod.me .rk-pn { color: var(--teal); }
.rk-pt { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.rk-pt .rk-lg { width: 16px; height: 16px; }
.rk-ps { font: 700 13px var(--disp); color: var(--silver); }
.rk-pp { padding: 1px 9px; border-radius: 99px; background: rgba(255,201,74,.14); border: 1px solid rgba(255,201,74,.4); color: #ffd36a; font: 800 12px var(--disp); white-space: nowrap; }
.rk-pp small { font: 600 10px var(--body); color: #e8c36a; }
.rk-step { width: 100%; height: 26px; margin-top: 6px; border-radius: 12px 12px 4px 4px; border: 1px solid color-mix(in srgb, var(--m) 50%, transparent); border-bottom: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--m) 34%, transparent), rgba(5,7,10,.1)); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.rk-pod.p1 .rk-step { height: 44px; } .rk-pod.p2 .rk-step { height: 32px; }
.rk-pod.free { opacity: .55; }

/* list */
.rk-listbox { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.rk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; min-height: 0; overflow: hidden; }
.rk-listbox > .rk-list { flex: 1 1 0; }
.rk-row { display: grid; grid-template-columns: 30px 38px minmax(0, 1fr) auto minmax(64px, auto) minmax(84px, auto); align-items: center; gap: 10px; height: 50px; padding: 0 12px 0 8px; border-radius: 14px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(26,35,48,.7), rgba(9,13,19,.75)); animation: rkRow .32s cubic-bezier(.2,1.2,.4,1) backwards; animation-delay: calc(var(--i) * 35ms); }
.rk-list.flip .rk-row { animation-name: rkFlip; }
@keyframes rkRow { from { opacity: 0; transform: translateY(8px); } }
@keyframes rkFlip { from { opacity: 0; transform: translateX(14px); } }
.rk-n { font: 800 15px var(--disp); color: var(--white); text-align: center; }
.rk-row img { width: 38px; height: 38px; border-radius: 50%; background: rgba(5,7,10,.5); }
.rk-who { display: grid; min-width: 0; line-height: 1.2; }
.rk-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--white); font: 600 14px var(--body); }
.rk-who b em { font: 800 9px var(--disp); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--void); background: var(--teal); border-radius: 99px; padding: 1px 6px; vertical-align: 2px; }
.rk-who small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-lg { display: block; width: 24px; height: 24px; flex: none; }
.rk-lg svg { width: 100%; height: 100%; display: block; }
.rk-sc { display: grid; justify-items: end; line-height: 1.15; }
.rk-sc b { font: 700 14px var(--disp); color: var(--white); white-space: nowrap; }
.rk-sc small, .rk-pz small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rk-pz { display: grid; justify-items: end; line-height: 1.15; }
.rk-pz b { font: 800 14px var(--disp); color: #ffd36a; text-shadow: 0 0 10px rgba(255,201,74,.35); white-space: nowrap; }
.rk-row.me { border-color: rgba(46,230,168,.65); background: radial-gradient(120% 140% at 0% 50%, rgba(46,230,168,.2), transparent 60%), linear-gradient(180deg, rgba(26,40,44,.9), rgba(9,16,18,.9));
  box-shadow: 0 0 0 1px rgba(46,230,168,.25), 0 0 20px rgba(46,230,168,.2); }
.rk-row.me .rk-n { color: var(--teal); }
.rk-empty { display: grid; place-items: center; min-height: 50px; padding: 10px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; text-align: center; }
.rk-pgr { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; font: 700 13px var(--disp); color: var(--white); }
.rk-pgr:empty { display: none; }
.rk-pgr small { font: 500 12px var(--body); color: var(--muted); }
.rk-pb { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(5,7,10,.5); color: var(--white); transition: transform .15s, border-color .15s; }
.rk-pb svg { width: 18px; height: 18px; } .rk-pb:hover:not(:disabled) { border-color: var(--cyan); } .rk-pb:active:not(:disabled) { transform: scale(.9); } .rk-pb:disabled { opacity: .3; cursor: default; }

/* my row, pinned */
.rk-me { flex: none; padding-top: 10px; border-top: 1px solid var(--line); }
.rk-me p { margin: 5px 2px 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-me b.gold, .rk-me .gold { color: #ffd36a; }
.rk-row.pin { animation: none; }
.rk-row.ghost { grid-template-columns: 30px 38px minmax(0, 1fr); }
.rk-row.ghost small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rk-load { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rk-load i { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); animation: rkDot 1s ease-in-out infinite; }
.rk-load i:nth-child(2) { animation-delay: .15s; } .rk-load i:nth-child(3) { animation-delay: .3s; }

/* wide screens: podium left, list right */
@media (min-width: 900px) and (min-height: 561px) {
  .rk-stage { flex-direction: row; gap: 18px; }
  .rk-podium { width: 46%; align-self: center; }
}
/* phones upright */
@media (max-width: 560px) {
  .rbox .win-head .rk-live { display: none; }
  .rbox .win-body.rk-body { padding: 10px 10px 10px; gap: 8px; }
  .rk-tabs button { font: 700 12px var(--body); text-transform: none; letter-spacing: 0; padding: 0 2px; min-height: 34px; }
  .rk-psub { font-size: 11px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .rk-hero { padding: 10px 12px; gap: 8px; }
  .rk-clock { padding: 6px 8px; } .rk-clock > svg { width: 22px; height: 22px; } .rk-clock b { font-size: 15px; }
  .rk-pv small { font-size: 11px; }
  .rk-podium { gap: 6px; padding: 0; }
  .rk-ava { width: 52px; height: 52px; } .rk-pod.p1 .rk-ava { width: 66px; height: 66px; }
  .rk-pn { font-size: 12px; } .rk-pt { font-size: 11px; } .rk-ps { font-size: 12px; } .rk-pp { font-size: 11px; padding: 0 6px; }
  .rk-step { height: 18px; } .rk-pod.p1 .rk-step { height: 32px; } .rk-pod.p2 .rk-step { height: 24px; }
  .rk-row { grid-template-columns: 22px 32px minmax(0, 1fr) auto auto; gap: 7px; height: 46px; padding: 0 8px 0 4px; }
  .rk-row img { width: 32px; height: 32px; }
  .rk-row .rk-lg { display: none; }
  .rk-row .rk-sc small { display: none; }
  .rk-row .rk-pz.none { display: none; }
  .rk-row.ghost { grid-template-columns: 22px 32px minmax(0, 1fr); }
  .rk-who b { font-size: 13px; } .rk-sc b, .rk-pz b { font-size: 13px; }
  .rk-rule { top: 104px; left: 10px; right: 10px; }
}
/* short phones upright: smaller podium so the list keeps a few rows */
@media (max-width: 560px) and (max-height: 760px) {
  .rk-psub, .rk-clock small:last-child { display: none; }
  .rk-hero { padding: 8px 12px; } .rk-pv { font-size: 26px; }
  .rk-podium { padding-top: 16px; }
  .rk-ava { width: 42px; height: 42px; margin-bottom: 2px; } .rk-pod.p1 .rk-ava { width: 54px; height: 54px; } .rk-ava::before { inset: -10px; }
  .rk-crown { top: -17px; width: 24px; height: 20px; } .rk-medal { width: 20px; height: 20px; font-size: 11px; }
  .rk-step { height: 8px; margin-top: 3px; } .rk-pod.p1 .rk-step { height: 20px; } .rk-pod.p2 .rk-step { height: 14px; }
  .rk-pod { gap: 0; } .rk-pn { font-size: 11px; } .rk-pt, .rk-ps { font-size: 10px; } .rk-pt .rk-lg { width: 13px; height: 13px; }
  .rk-row { height: 42px; } .rk-me { padding-top: 6px; } .rk-me p { margin-top: 3px; font-size: 11px; }
}
@media (max-width: 380px) { .rk-pz small { display: none; } .rk-tabs button { font-size: 11px; } }
/* sideways phones and short windows: podium left, list right */
@media (max-height: 560px) and (min-width: 600px) {
  .rbox .win-head { padding: 6px 8px 6px 12px; } .rbox .win-head i[data-ic] { width: 30px; height: 30px; } .rbox .win-x { width: 38px; height: 38px; }
  .rbox .win-body.rk-body { padding: 8px 12px; gap: 7px; }
  .rk-tabs { padding: 3px; } .rk-tabs button { min-height: 30px; font-size: 11px; } .rk-ind { top: 3px; bottom: 3px; }
  .rk-main { gap: 7px; }
  .rk-hero { padding: 6px 12px; } .rk-pv { font-size: 24px; } .rk-psub { display: none; }
  .rk-clock { padding: 4px 10px; } .rk-clock > svg { width: 22px; height: 22px; } .rk-clock b { font-size: 15px; }
  .rk-stage { flex-direction: row; gap: 12px; }
  .rk-podium { width: 44%; align-self: end; padding-top: 16px; }
  .rk-ava { width: 46px; height: 46px; } .rk-pod.p1 .rk-ava { width: 58px; height: 58px; } .rk-crown { top: -18px; width: 26px; height: 21px; }
  .rk-pn { font-size: 12px; } .rk-pt, .rk-ps { font-size: 11px; } .rk-pp { font-size: 11px; }
  .rk-step { height: 14px; } .rk-pod.p1 .rk-step { height: 30px; } .rk-pod.p2 .rk-step { height: 22px; }
  .rk-row { height: 40px; gap: 8px; } .rk-row img { width: 30px; height: 30px; } .rk-list { gap: 4px; }
  .rk-pb { width: 30px; height: 30px; } .rk-listbox { gap: 4px; }
  .rk-hero { grid-template-columns: auto minmax(0, 1fr) auto; } .rk-pot { grid-template-columns: auto auto; align-items: baseline; column-gap: 12px; } .rk-pl { grid-row: 1; }
  .rk-row .rk-sc small { display: none; }
  .rk-me { padding-top: 6px; } .rk-me p, .rk-clock small:last-child { display: none; }
  .rk-rule { top: 84px; }
}
@media (max-height: 420px) and (min-width: 600px) { .rk-row { height: 36px; } .rk-ava { width: 38px; height: 38px; margin-bottom: 1px; } .rk-pod.p1 .rk-ava { width: 48px; height: 48px; } .rk-pod { gap: 0; } .rk-pt { font-size: 10px; } .rk-medal { width: 18px; height: 18px; font-size: 10px; } .rk-step { height: 8px; margin-top: 2px; } .rk-pod.p1 .rk-step { height: 22px; } .rk-pod.p2 .rk-step { height: 15px; } }
@media (prefers-reduced-motion: reduce) { .rk-main.anim > *, .rk-pod, .rk-row, .rk-ava::before, .rk-crown, .rk-hero::after, .rk-live::before { animation: none; } .rk-ind { transition: none; } }
/* older ranking rules in chain.css must not leak in */
#win-board #rkTabs { margin: 0; border-radius: 99px; }
#win-board #rkTabs button[aria-selected="true"] { background: none; box-shadow: none; }
