/* 케어 데이터 랭킹 — 리더보드 (design_system 색감 + 게임형 레이아웃) */
.pdr-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 14px 120px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, "Segoe UI", Roboto,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    min-height: 100vh;
    background: #f8fafc;
}

.pdr-hero {
    background: linear-gradient(135deg, #1e3a6e 0%, #406cb4 60%, #6b9fd4 100%);
    border-radius: 22px;
    padding: 22px 18px 20px;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(30, 58, 110, 0.22);
}

.pdr-hero-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 6px;
}

.pdr-hero h1 {
    font-size: 26px;
    font-weight: 900;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.pdr-hero p {
    font-size: 13px;
    line-height: 1.55;
    opacity: 0.92;
    margin: 0;
}

/* 상단 탭 — 한 화면에서 모드 전환 */
.pdr-main-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.pdr-main-tab {
    flex: 1;
    border: none;
    padding: 12px 10px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 800;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.pdr-main-tab.active {
    background: #eff6ff;
    color: #406cb4;
    border: 1px solid #bfdbfe;
    box-shadow: none;
}

.pdr-panel[hidden] {
    display: none !important;
}

.pdr-panel.is-visible {
    display: block;
}

.pdr-toolbar {
    background: #fff;
    border-radius: 18px;
    padding: 12px 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f7;
}

.pdr-chip-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pdr-chip-row::-webkit-scrollbar {
    display: none;
}

.pdr-chip {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 99px;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.15s, background 0.15s;
}

.pdr-chip.active {
    background: linear-gradient(135deg, #406cb4, #6366f1);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.35);
}

.pdr-period-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pdr-period-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    margin-right: 4px;
}

.pdr-pill {
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 99px;
    cursor: pointer;
}

.pdr-pill.active {
    border-color: #406cb4;
    color: #406cb4;
    background: #eff6ff;
}

.pdr-meta {
    font-size: 11px;
    color: #64748b;
    margin: 0 0 10px 4px;
}

/* 포디움 */
.pdr-podium {
    margin-bottom: 12px;
}

.pdr-podium-inner {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    min-height: 168px;
    padding: 8px 4px 0;
}

.pdr-podium-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pdr-podium-slot.rank-1 {
    order: 2;
    flex: 1.12;
}

.pdr-podium-slot.rank-2 {
    order: 1;
}

.pdr-podium-slot.rank-3 {
    order: 3;
}

.pdr-podium-medal {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 4px;
}

.pdr-podium-av {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    margin-bottom: 6px;
}

.pdr-podium-av-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    font-size: 22px;
}

.pdr-podium-slot.rank-1 .pdr-podium-av {
    width: 56px;
    height: 56px;
    border-color: #fcd34d;
    box-shadow: 0 0 0 2px #fbbf24, 0 8px 20px rgba(251, 191, 36, 0.35);
}

.pdr-podium-name {
    font-size: 11px;
    font-weight: 400;
    color: #1e293b;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pdr-podium--food .pdr-podium-name {
    font-size: 10px;
}

.pdr-podium-score {
    font-size: 12px;
    font-weight: 900;
    color: #406cb4;
    margin-top: 4px;
}

.pdr-podium-slot.rank-1 .pdr-podium-score {
    color: #d97706;
    font-size: 13px;
}

.pdr-podium-stand {
    width: 100%;
    margin-top: 8px;
    border-radius: 10px 10px 6px 6px;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
}

.pdr-podium-slot.rank-1 .pdr-podium-stand {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    min-height: 44px;
}

.pdr-podium-slot.rank-2 .pdr-podium-stand {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    min-height: 32px;
}

.pdr-podium-slot.rank-3 .pdr-podium-stand {
    background: linear-gradient(135deg, #c2956c, #a16207);
    min-height: 24px;
}

/* 리스트 */
.pdr-card-list {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #eef2f7;
    padding: 4px 12px 8px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.pdr-row-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.pdr-row-line:last-child {
    border-bottom: none;
}

.pdr-row-rank {
    width: 26px;
    font-size: 13px;
    font-weight: 900;
    color: #94a3b8;
    text-align: center;
}

.pdr-row-body {
    flex: 1;
    min-width: 0;
}

.pdr-row-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.pdr-row-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.pdr-food-link,
.pdr-food-link:visited,
.pdr-food-link:hover,
.pdr-food-link:active {
    color: inherit;
    text-decoration: none;
}

.pdr-mini-link {
    font-size: 11px;
    font-weight: 800;
    color: #e85b2a;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fff;
}

.pdr-empty {
    text-align: center;
    padding: 28px 12px;
    color: #94a3b8;
    font-size: 13px;
}

/* 내 순위 배너 */
.pdr-my-rank {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #406cb4, #5b67ca);
    color: #fff;
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(64, 108, 180, 0.28);
}

.pdr-my-rank--guest {
    background: linear-gradient(135deg, #64748b, #334155);
    box-shadow: 0 6px 18px rgba(51, 65, 85, 0.25);
}

.pdr-my-rank-rank {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    flex-shrink: 0;
}

.pdr-my-rank-text {
    flex: 1;
    min-width: 0;
}

.pdr-my-rank-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    opacity: 0.85;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.pdr-my-pet-select {
    width: 100%;
    max-width: 220px;
    margin-bottom: 4px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
}

.pdr-my-rank-msg {
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
    opacity: 0.95;
}

.pdr-btn-full {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    color: #406cb4;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    border: 1px solid #bfdbfe;
}

body.pdr-page-theme #siteHeader .header-back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    z-index: 2;
}

body.pdr-page-theme #siteHeader .header-back-btn:hover {
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(calc(-50% - 1px));
}

body.pdr-page-theme #siteHeader .header-back-btn:active {
    transform: translateY(-50%);
}

body.pdr-page-theme #siteHeader .user-profile,
body.pdr-page-theme #siteHeader .header-actions {
    visibility: hidden;
    pointer-events: none;
}

.pdr-w-val {
    font-weight: 900;
    color: #406cb4;
    font-size: 14px;
}

.pdr-av {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.pdr-av-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    font-size: 16px;
}

.pdr-footnote {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.6;
    margin-top: 20px;
    padding: 12px;
}

/* 모달 */
.pdr-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pdr-modal[hidden] {
    display: none !important;
}

.pdr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.pdr-modal-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 78vh;
    background: #fff;
    border-radius: 22px 22px 0 0;
    display: flex;
    flex-direction: column;
    animation: pdrSheetUp 0.25s ease-out;
}

@keyframes pdrSheetUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.pdr-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 8px;
    border-bottom: 1px solid #f1f5f9;
}

.pdr-modal-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    color: #1e293b;
}

.pdr-modal-x {
    border: none;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.pdr-modal-body {
    overflow-y: auto;
    padding: 8px 12px 28px;
    -webkit-overflow-scrolling: touch;
}

/* ── PC · design_system.php(ds-wrap / ds-page-hero) 정렬 ── */
@media (min-width: 900px) {
    .pdr-page {
        max-width: 1080px;
        margin: 0 auto;
        padding: 40px 24px 120px;
        background: #f8fafc;
        min-height: auto;
    }

    .pdr-hero {
        position: relative;
        overflow: hidden;
        background: linear-gradient(135deg, #1e3a6e 0%, #406cb4 60%, #6b9fd4 100%);
        border-radius: 24px;
        padding: 48px 40px;
        margin-bottom: 32px;
        box-shadow: 0 8px 32px rgba(30, 58, 110, 0.18);
    }

    .pdr-hero::before {
        content: '';
        position: absolute;
        top: -40px;
        right: -40px;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.06);
        pointer-events: none;
    }

    .pdr-hero-badge {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: none;
        padding: 4px 10px;
        border-radius: 99px;
        background: rgba(255, 255, 255, 0.15);
        opacity: 1;
    }

    .pdr-hero h1 {
        font-size: 36px;
        font-weight: 900;
        margin: 0 0 8px;
        color: #fff;
    }

    .pdr-hero p {
        font-size: 16px;
        line-height: 1.6;
        opacity: 0.8;
        color: #e0eaff;
        max-width: 640px;
    }

    /* 탭: 라이트 카드 안에서 선택 (DS 톤) */
    .pdr-main-tabs {
        gap: 6px;
        padding: 6px;
        margin-bottom: 28px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
        backdrop-filter: none;
    }

    .pdr-main-tab {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 12px;
        color: #64748b;
        background: transparent;
    }

    .pdr-main-tab.active {
        background: #eff6ff;
        color: #406cb4;
        border: 1px solid #bfdbfe;
        box-shadow: none;
    }

    .pdr-toolbar {
        padding: 18px 22px 20px;
        border-radius: 16px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    }

    .pdr-chip-row {
        flex-wrap: wrap;
        overflow-x: visible;
        margin-bottom: 12px;
        gap: 8px;
    }

    .pdr-chip {
        font-size: 13px;
        padding: 10px 16px;
    }

    .pdr-pill {
        font-size: 13px;
        padding: 8px 16px;
    }

    .pdr-meta {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .pdr-podium-inner {
        min-height: 200px;
        gap: 16px;
        padding: 12px 8px 0;
    }

    .pdr-podium-medal {
        font-size: 24px;
    }

    .pdr-podium-av {
        width: 56px;
        height: 56px;
    }

    .pdr-podium-slot.rank-1 .pdr-podium-av {
        width: 72px;
        height: 72px;
    }

    .pdr-podium-name {
        font-size: 12px;
        max-height: none;
        -webkit-line-clamp: unset;
    }

    .pdr-podium--food .pdr-podium-name {
        font-size: 11px;
    }

    .pdr-podium-score {
        font-size: 14px;
    }

    .pdr-podium-slot.rank-1 .pdr-podium-score {
        font-size: 16px;
    }

    .pdr-card-list {
        border-radius: 16px;
        border: 1px solid #e2e8f0;
        padding: 8px 20px 12px;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    }

    .pdr-row-line {
        padding: 14px 0;
    }

    .pdr-row-title {
        font-size: 15px;
    }

    .pdr-row-sub {
        font-size: 12px;
    }

    .pdr-my-rank {
        padding: 20px 28px;
        border-radius: 20px;
    }

    .pdr-my-rank-rank {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }

    .pdr-my-rank-msg {
        font-size: 14px;
    }

    .pdr-btn-full {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
        color: #406cb4;
        border-color: #bfdbfe;
        background: #fff;
        box-shadow: 0 2px 12px rgba(64, 108, 180, 0.08);
    }

    .pdr-btn-full:hover {
        background: #eff6ff;
    }

    .pdr-footnote {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        margin-top: 40px;
        padding: 16px 20px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        font-size: 12px;
    }

    /* 모달: PC에서는 중앙 카드 */
    .pdr-modal {
        align-items: center;
        padding: 24px;
    }

    .pdr-modal-sheet {
        max-width: 560px;
        width: 100%;
        max-height: 85vh;
        border-radius: 20px;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
        animation: pdrModalIn 0.2s ease-out;
    }

    @keyframes pdrModalIn {
        from {
            opacity: 0;
            transform: scale(0.98) translateY(8px);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }

    .pdr-modal-head {
        padding: 20px 24px 12px;
    }

    .pdr-modal-head h2 {
        font-size: 20px;
    }

    .pdr-modal-body {
        padding: 8px 20px 32px;
    }
}
