/* Halaman papan peringkat (dipakai bersama css/style.css) */
.rank { max-width: 1180px; margin: 0 auto; padding: 4px 28px 64px; display: flex; flex-direction: column; gap: 18px; }
.rank > * { min-width: 0; }

/* ---------- hero + podium ---------- */
.rank-hero {
  background: radial-gradient(120% 140% at 85% 0%, #2a3d63 0%, var(--ink) 55%);
  color: #fff; border-radius: 22px; padding: 36px 40px 0;
  display: grid; grid-template-columns: 1fr minmax(0, 540px); gap: 32px; align-items: end; overflow: hidden;
}
.rh-text { padding-bottom: 36px; align-self: center; min-width: 0; }
.rank-hero .eyebrow { color: #9fb6ff; }
.rank-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: 28px; }
.rh-stats { display: flex; gap: 32px; margin: 0; flex-wrap: wrap; }
.rh-stats dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.55); font-weight: 600; }
.rh-stats dd { margin: 4px 0 0; font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.pod { text-align: center; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.pod .ava { width: 56px; height: 56px; font-size: 1.1rem; margin-bottom: 10px; box-shadow: 0 0 0 3px var(--medal), 0 0 0 8px rgba(255,255,255,.06); }
.pod-1 .ava { width: 72px; height: 72px; font-size: 1.35rem; }
.pod-nama { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-sek { font-size: .76rem; color: rgba(255,255,255,.55); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-skor { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0 12px; }
.pod-1 .pod-skor { font-size: 1.7rem; color: #ffd66b; }
.pod-base {
  width: 100%; border-radius: 14px 14px 0 0; display: grid; place-items: start center; padding-top: 10px;
  font-size: 2rem; font-weight: 800; color: rgba(255,255,255,.92);
  background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 60%, transparent), color-mix(in srgb, var(--medal) 10%, transparent));
}
.pod-1 { --medal: #e9b52a; } .pod-1 .pod-base { height: 128px; }
.pod-2 { --medal: #aab4c0; } .pod-2 .pod-base { height: 92px; }
.pod-3 { --medal: #c98a53; } .pod-3 .pod-base { height: 68px; }
.pod.kosong .ava, .pod.kosong .pod-nama { opacity: .5; }
.pod.kosong .ava { background: transparent; border: 2px dashed rgba(255,255,255,.6); box-shadow: none; color: #fff; }
.pod.kosong .pod-base { opacity: .45; }

.ava { flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #fff; color: var(--ink); letter-spacing: .02em; }
.ava.sm { width: 36px; height: 36px; font-size: .8rem; background: #eceae5; }

/* ---------- posisi saya ---------- */
.saya { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: var(--radius); padding: 14px 20px; box-shadow: var(--shadow); }
.saya-rk { font-size: 1.9rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.saya small { display: block; color: var(--ink-3); }

/* ---------- toolbar ---------- */
.rank-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cari { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--ink-3); min-width: 0; }
.cari:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cari input { border: 0; outline: 0; padding: 11px 0; width: 100%; min-width: 0; background: transparent; }
.seg { display: inline-flex; background: #e9e6df; border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.upd { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink-3); font-size: .84rem; cursor: pointer; padding: 8px 4px; }
.upd:hover { color: var(--ink); }
.upd.spin svg { animation: putar .8s linear infinite; }
@keyframes putar { to { transform: rotate(360deg); } }

/* ---------- daftar peringkat ---------- */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.r-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 200px 110px 210px; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.board.penuh .r-row { grid-template-columns: 52px minmax(0, 1fr) repeat(7, 52px) 110px 210px; }
.r-row:last-child { border-bottom: 0; }
.r-head { background: #faf8f4; padding-top: 10px; padding-bottom: 10px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.r-head .c-sub { text-align: center; }
.c-rk { text-align: center; font-variant-numeric: tabular-nums; }
.c-rk b { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 9px; font-size: .92rem; color: var(--ink-2); }
.top1 .c-rk b { background: #fbefc8; color: #8a6400; }
.top2 .c-rk b { background: #eceff3; color: #4d5866; }
.top3 .c-rk b { background: #f6e4d4; color: #8a4f1d; }
.c-nama { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nm { min-width: 0; }
.nm b, .nm small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm small { color: var(--ink-3); font-size: .78rem; }
.cell { text-align: center; font-size: .86rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 6px 0; border-radius: 8px; background: rgba(31, 79, 209, calc(var(--h, 0) * .26)); }
.cell em { display: none; font-style: normal; }
.c-sub1 { font-size: .88rem; color: var(--ink-2); }
.c-skor { text-align: right; }
.c-skor b { font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mbar { display: block; height: 4px; background: #efece6; border-radius: 99px; margin-top: 5px; overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.c-pil { min-width: 0; }
.pil-nm { display: block; font-size: .8rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { display: inline-block; margin-top: 3px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.st.ok { background: var(--done-soft); color: var(--done); }
.st.mid { background: var(--ragu-soft); color: #8a5800; }
.st.no { background: var(--danger-soft); color: var(--danger); }
.r-row.milik { background: var(--primary-soft); }
.kamu { font-style: normal; font-size: .66rem; font-weight: 800; background: var(--primary); color: #fff; padding: 2px 7px; border-radius: 99px; vertical-align: 2px; }

.empty { text-align: center; padding: 48px 24px; }
.empty-ic { font-size: 2.4rem; }
.empty h3 { margin: 10px 0 6px; }
.empty p { color: var(--ink-3); margin: 0 auto 18px; max-width: 40ch; }

/* ---------- responsif ---------- */
@media (max-width: 1080px) {
  .rank-hero { grid-template-columns: 1fr; padding: 28px 24px 0; gap: 8px; }
  .rh-text { padding-bottom: 16px; }
  .c-pil { display: none; }
  .r-row { grid-template-columns: 52px minmax(0, 1fr) 200px 110px; }
  .board.penuh .r-row { grid-template-columns: 44px minmax(0, 1fr) repeat(7, 48px) 100px; }
}
/* HP: baris jadi kartu ringkas; skor subtes pindah ke baris kedua berupa chip */
@media (max-width: 760px) {
  .rank { padding: 4px 16px 48px; gap: 14px; }
  .rank-hero { border-radius: 18px; padding: 22px 16px 0; }
  .rank-hero h1 { margin-bottom: 16px; }
  .rh-stats { gap: 22px; }
  .rh-stats dd { font-size: 1.3rem; }
  .podium { gap: 8px; }
  .pod .ava { width: 44px; height: 44px; font-size: .9rem; }
  .pod-1 .ava { width: 56px; height: 56px; font-size: 1.05rem; }
  .pod-nama { font-size: .86rem; }
  .pod-skor { font-size: 1.05rem; margin-bottom: 10px; }
  .pod-1 .pod-skor { font-size: 1.3rem; }
  .pod-base { font-size: 1.5rem; }
  .pod-1 .pod-base { height: 92px; } .pod-2 .pod-base { height: 66px; } .pod-3 .pod-base { height: 48px; }
  .seg { flex: 1; } .seg button { flex: 1; }
  .upd { width: 100%; justify-content: flex-end; padding: 0 2px; margin-top: -4px; }
  .r-head { display: none; }
  .r-row, .board.penuh .r-row { grid-template-columns: 32px repeat(7, minmax(0, 1fr)) 64px; gap: 8px 5px; padding: 12px 14px; }
  .c-rk { grid-column: 1; grid-row: 1; }
  .c-nama { grid-column: 2 / 9; grid-row: 1; }
  .c-skor { grid-column: 9; grid-row: 1; }
  .c-sub1 { grid-column: 2 / -1; grid-row: 2; font-size: .8rem; }
  .board.penuh .c-sub { grid-row: 2; padding: 4px 0; font-size: .74rem; }
  .board.penuh .r-row .c-sub:nth-child(3) { grid-column: 2; }
  .board.penuh .r-row .c-sub:nth-child(4) { grid-column: 3; }
  .board.penuh .r-row .c-sub:nth-child(5) { grid-column: 4; }
  .board.penuh .r-row .c-sub:nth-child(6) { grid-column: 5; }
  .board.penuh .r-row .c-sub:nth-child(7) { grid-column: 6; }
  .board.penuh .r-row .c-sub:nth-child(8) { grid-column: 7; }
  .board.penuh .r-row .c-sub:nth-child(9) { grid-column: 8; }
  .cell em { display: block; font-size: .58rem; font-weight: 700; color: var(--ink-3); letter-spacing: .03em; }
  .saya { padding: 12px 14px; gap: 12px; }
  .saya-rk { font-size: 1.5rem; }
}
