/* Ranking window (top 10, own rank) and the ranked extras of the lobby and the results screen. */
body.rk-open { overflow: hidden; }
.rk-backdrop { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 18px; background: rgba(6, 12, 26, .78); backdrop-filter: blur(4px); overflow-y: auto; }
.rk-dialog { position: relative; width: min(520px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: 28px 26px 24px; background: #fff9ed; color: #142b43; border: 1px solid #cfbc96; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.rk-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: #6a6258; }
.rk-eyebrow { color: #927037; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.rk-dialog h2 { margin: 4px 0 14px; font: 800 28px 'Fraunces', Georgia, serif; }
.rk-note { font-size: 13px; color: #6a6258; }
.rk-me { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid #e1d3b3; margin-bottom: 14px; }
.rk-me img { flex: none; }
.rk-me > div { flex: 1; min-width: 0; }
.rk-me small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #927037; }
.rk-me strong { display: block; font: 800 22px 'Fraunces', Georgia, serif; }
.rk-me span { font-size: 12px; color: #6a6258; }
.rk-bar { height: 8px; background: #eadfc6; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.rk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e0a92e, #f3c94f); }
.rk-ban { margin: -6px 0 12px; font-size: 12px; font-weight: 700; color: #a02b2b; }
.rk-list { list-style: none; margin: 0 0 14px; padding: 0; }
.rk-list li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid #eadfc6; }
.rk-list li b { width: 22px; text-align: center; font-size: 13px; color: #927037; }
.rk-list li:nth-child(-n+3) b { color: #c8861a; font-size: 15px; }
.rk-list li span { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-list li small { display: block; font-size: 11px; font-weight: 600; color: #6a6258; }
.rk-list li em { font-style: normal; font-weight: 800; font-size: 14px; }
.rk-list .rk-empty { justify-content: center; color: #6a6258; font-size: 13px; }
.rk-tiers { margin-bottom: 14px; font-size: 12px; }
.rk-tiers summary { cursor: pointer; font-weight: 800; color: #275f9b; }
.rk-tiers div { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.rk-tiers span { display: grid; justify-items: center; text-align: center; gap: 2px; font-weight: 700; }
.rk-tiers small { color: #6a6258; font-weight: 600; }
.rk-play { width: 100%; padding: 14px; border: 0; cursor: pointer; font: 800 14px sans-serif; background: linear-gradient(#f3c94f, #e0a92e); color: #142b43; }
.rk-play:hover { filter: brightness(1.06); }
/* lobby preparation banner */
.rl-prep { display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin-bottom: 18px; background: #fff3d1; border: 1px solid #e0a92e; }
.rl-prep.ranked { background: #e9f1fb; border-color: #4a7db5; }
.rl-prep-clock { flex: none; text-align: center; min-width: 56px; }
.rl-prep-clock b { display: block; font: 800 34px 'Fraunces', Georgia, serif; line-height: 1; }
.rl-prep-clock small { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.rl-prep strong { font-size: 14px; }
.rl-prep p { margin: 3px 0 0; font-size: 12px; color: #6a6258; }
.rl-prep-ready { margin-left: auto; display: grid; gap: 4px; font-size: 12px; font-weight: 700; }
.rl-prep-ready span { padding: 3px 10px; background: #fff; border: 1px solid #e1d3b3; }
.rl-prep-ready span.on { background: #dff3e6; border-color: #3fa56b; color: #1f6b44; }
@media (max-width: 640px) { .rl-prep { flex-wrap: wrap; } .rl-prep-ready { margin-left: 0; width: 100%; } }
/* ranked result block */
.rl-rank-result { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 22px auto 0; max-width: 460px; padding: 14px 18px; background: #fff9ed; border: 1px solid #cfbc95; text-align: left; animation: rk-rise .5s ease-out; }
@keyframes rk-rise { from { opacity: 0; transform: translateY(10px); } }
.rl-rank-result small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8b774f; }
.rl-rank-result strong { display: block; font: 800 24px 'Fraunces', Georgia, serif; }
.rl-rank-result span { font-size: 13px; }
.rl-rank-result b.up { color: #1f8a4c; } .rl-rank-result b.down { color: #b53030; }

/* Player card (friends window) and privacy switches (profile window). */
.pc { display: grid; gap: 8px; margin: 12px 0; }
.pc-rank { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid #e1d3b3; }
.pc-rank small, .pc-line small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #927037; }
.pc-rank strong { display: block; font: 800 20px 'Fraunces', Georgia, serif; }
.pc-rank span { font-size: 12px; color: #6a6258; }
.pc-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 0; padding: 8px 12px; background: #fff; border: 1px solid #e1d3b3; font-size: 13px; }
.pc-line > span { text-align: right; font-weight: 700; }
.pc-line b { font-size: 16px; }
.pc-hidden { font-weight: 600; font-size: 12px; color: #8b8070; font-style: italic; }
.pc-friends { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-height: 84px; overflow-y: auto; }
.pc-friends li { display: flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; background: #f5ecd6; border-radius: 12px; font-size: 11px; font-weight: 700; }
.pc-friends img { border-radius: 50%; object-fit: cover; }
.rp-privacy { margin: 14px 0 0; padding: 10px 12px; background: #fff; border: 1px solid #e1d3b3; text-align: left; }
.rp-privacy h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #927037; }
.rp-privacy label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }

.rf-avatar[data-rf-avatar] { cursor: pointer; }
.rf-avatar[data-rf-avatar]:hover img { filter: brightness(1.12); }

.rk-live { display: flex; align-items: center; gap: 8px; margin: -8px 0 12px; font-size: 12px; font-weight: 700; color: #1f6b44; }
.rk-live i { width: 8px; height: 8px; border-radius: 50%; background: #3fa56b; animation: rk-blink 1.6s ease-in-out infinite; }
@keyframes rk-blink { 50% { opacity: .35; } }
.rk-me > div.rk-place { flex: none; text-align: center; padding-left: 14px; border-left: 1px solid #e1d3b3; }
.rk-place b { display: block; font: 800 30px/1 'Fraunces', Georgia, serif; color: #163958; }
.rk-place span { display: block; margin-top: 3px; font-size: 11px; }
@media (max-width: 420px) { .rk-me { flex-wrap: wrap; } .rk-me > div.rk-place { flex: 1 0 100%; border-left: 0; border-top: 1px solid #e1d3b3; padding: 10px 0 0; } }
.dl-rank { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11px; font-weight: 800; color: #927037; }
.dl-rank img { flex: none; }
