/* 群英榜（排行榜）面板樣式
   架構：完全鏡像 achievement.css，前綴改為 .lb-
   尺寸單位：500x850 邏輯舞台
*/

/* 遮罩 */
.lb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: hsla(0, 0%, 0%, 0.85);
    z-index: 2100;
    /* 高於遊戲 overlay (2000) 與 GameMessage (2050)；4 個覆蓋層統一 2100 */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    font-family: 'Noto Sans TC';
}

.lb-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 卡片 */
.lb-container {
    background-color: hsl(0, 60%, 24%);
    border-radius: 20px;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: hsl(34, 64%, 98%);
    font-family: 'Noto Sans TC';
    position: absolute;
}

/* 標題 */
.lb-header {
    background: hsl(0, 60%, 36%);
    color: hsl(34, 64%, 98%);
    padding: 5px 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    font-family: 'Noto Serif TC', serif;
}

/* 標題右側 X 關閉按鈕（4 dialog 唯一關閉方式） */
.lb-close-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    color: hsl(34, 64%, 98%);
    cursor: pointer;
}
.lb-close-btn:hover { opacity: 0.85; }

.lb-title {
    font-size: 30px;
    font-weight: bold;
    letter-spacing: 5px;
    text-align: center;
}

/* 主分頁列 */
.lb-tabs {
    display: flex;
    background: hsl(0, 60%, 28%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lb-tab {
    flex: 1;
    text-align: center;
    padding: 5px 0;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    color: hsl(0, 0%, 80%);
    transition: background 0.2s, color 0.2s;
    border-right: 1px solid hsla(0, 0%, 100%, 0.2);
    border-bottom: 2px solid hsla(0, 0%, 100%, 0.2);
}

.lb-tab:last-child {
    border-right: none;
}

.lb-tab.active {
    background: hsl(0, 60%, 48%);
    color: hsl(34, 64%, 98%);
    border-bottom: 2px solid hsl(48, 89%, 50%);
}

/* 主內容容器：本身不捲動，只負責放分頁 */
.lb-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 每個分頁：flex 直排，工具列固定，內容區自捲 */
.lb-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 10px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-in-out;
}

.lb-panel.active {
    display: flex;
}

/* 工具列固定在分頁頂端，不參與捲動 */
.lb-toolbar {
    flex: 0 0 auto;
}

/* 分頁內容區：唯一允許上下手指拖曳捲動的容器，不顯示捲動條 */
.lb-content {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
}
.lb-content::-webkit-scrollbar { display: none; }
.lb-content.grabbing { cursor: grabbing; }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 子排行類型 + 時間切片 工具列 */
.lb-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

/*內容區的下拉選單*/
.lb-select {
    background: hsla(0, 50%, 30%, 1);
    color: hsl(34, 64%, 98%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 18px;
}

/* 時間切片 按鈕 pill */
.lb-time-switch {
    display: flex;
    gap: 4px;
}

.lb-pill {
    background: hsla(0, 50%, 30%, 1);
    color: hsl(0, 0%, 80%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
}

.lb-pill.active {
    background: hsl(0, 60%, 48%);
    color: #fdfaf6;
    border-color: hsl(48, 89%, 50%);
    border-bottom: 3px solid hsl(48, 89%, 50%);
}

/*隱身按鈕*/
.lb-stealth {
    margin-left: auto;
    font-size: 18px;
    font-weight: normal;
    color: hsl(0, 0%, 80%);
    user-select: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 我的位置 sticky 卡 */
.lb-mybox {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, hsla(48, 89%, 50%, 0.3), hsla(48, 89%, 40%, 0.00));
    border: 1px solid hsl(48, 89%, 50%);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 10px;
    color: hsl(34, 64%, 98%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border-bottom: 3px solid hsl(48, 89%, 50%);
}

.lb-mybox-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
}

.lb-mybox-rank {
    color: hsl(48, 100%, 70%);
    font-size: 24px;
}

.lb-mybox-hint {
    font-size: 16px;
    color: hsl(0, 0%, 85%);
    margin-top: 4px;
}

/* 排行列表 */
.lb-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lb-item {
    background: hsla(0, 50%, 30%, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: hsl(34, 64%, 98%);
    font-size: 22px;
}

.lb-item.top1,
.lb-item.top2,
.lb-item.top3 {
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {

    0%,
    100% {
        box-shadow: 0 0 0 0 hsla(48, 89%, 50%, 0.6);
    }

    50% {
        box-shadow: 0 0 14px 2px hsla(48, 89%, 50%, 0.7);
    }
}

.lb-item.me {
    background: hsla(48, 89%, 50%, 0.18);
    border-color: hsl(48, 89%, 50%);
}

.lb-rank {
    min-width: 38px;
    font-weight: bold;
    font-size: 20px;
    color: hsl(48, 100%, 65%);
    text-align: center;
}

.lb-medal {
    font-size: 24px;
}

.lb-nick {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-rank-tag {
    font-size: 16px;
    color: hsl(0, 0%, 80%);
    margin-left: 4px;
}

.lb-score {
    font-weight: bold;
    color: hsl(36, 100%, 92%);
    min-width: 70px;
    text-align: right;
}

.lb-sub {
    font-size: 18px;
    color: hsl(0, 0%, 75%);
    margin-top: 2px;
}

/* 遊戲挑選格 (單遊戲分頁) */
.lb-game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.lb-game-cell {
    background: hsla(0, 50%, 30%, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    font-size: 18px;
    color: hsl(34, 64%, 98%);
}

.lb-game-cell.active {
    background: hsl(0, 60%, 48%);
    border-color: hsl(48, 89%, 50%);
}

/* 空狀態 / 載入中 */
.lb-empty,
.lb-loading {
    text-align: center;
    color: hsl(0, 0%, 75%);
    padding: 30px 10px;
    font-size: 18px;
}

/* 歷代月冠軍堂 */
.lb-hof {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.3);
}

.lb-hof-title {
    font-size: 18px;
    color: hsl(48, 100%, 70%);
    text-align: center;
    margin-bottom: 6px;
}

.lb-hof-row {
    display: flex;
    justify-content: space-between;
    background: hsla(0, 50%, 30%, 0.8);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 18px;
}