/* ===== กล่องหลัก น้ำทะเล + เอฟเฟคเคลื่อนไหว ===== */
.ranking-box {
    width: 80%;
    margin: 0 auto;
    margin-top: 40px;
    padding: 30px;
    border-radius: 20px;

    /* ไล่เฉดฟ้าน้ำทะเล */
    background: linear-gradient(135deg, rgba(0,80,140,0.65), rgba(0,120,180,0.55));

    /* เอฟเฟคเงาน้ำ */
    box-shadow: 0 0 25px rgba(0,140,255,0.4);

    /* เอฟเฟคคลื่นเคลื่อนไหว */
    position: relative;
    overflow: hidden;
}

.ranking-box::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: oceanWave 6s infinite linear;
}

@keyframes oceanWave {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== หัวข้อหลัก ===== */
.ranking-title {
    text-align: center;
    font-size: 46px;
    font-weight: 900;
    color: #e8f6ff;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-shadow: 0 0 12px #8dd6ff, 0 0 22px #4ecbff;
}

/* ===== ปุ่มสลับโหมด ===== */
.rank-switch {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.rank-btn {
    font-size: 26px;
    font-weight: 800;
    color: #d9eeff;
    padding-bottom: 6px;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: 0.25s;
}

.rank-btn:hover {
    color: #ffffff;
    border-bottom: 3px solid #82d1ff;
    text-shadow: 0 0 12px #82d1ff;
}

.rank-btn.active {
    color: #ffffff;
    border-bottom: 3px solid #ffe082;
    text-shadow: 0 0 14px #ffe082;
}

/* ===== ช่องค้นหา ===== */
.rank-search-box {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.rank-search-box input,
.rank-search-box select {
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 8px;
    background: rgba(255,255,255,0.85);
    border: none;
    outline: none;
}

/* ===== ตาราง ===== */
.rank-table-wrapper {
    background: rgba(0,0,0,0.25);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
}

.rank-table {
    width: 100%;
    border-collapse: collapse;
}

/* ===== หัวตาราง ===== */
.rank-table thead tr {
    background: linear-gradient(90deg, #084ca1, #0b69d1);
}

.rank-table thead th {
    padding: 14px;
    font-size: 18px;
    color: #e6f1ff;
    font-weight: 800;
    text-align: center;
}

/* ===== ขนาดคอลัมน์ ===== */
.rank-table th:nth-child(1), .rank-table td:nth-child(1) { width: 10%; text-align:center; }
.rank-table th:nth-child(2), .rank-table td:nth-child(2) { width: 30%; text-align:left; padding-left:20px; }
.rank-table th:nth-child(3), .rank-table td:nth-child(3) { width: 15%; text-align:center; }
.rank-table th:nth-child(4), .rank-table td:nth-child(4) { width: 15%; text-align:center; }
.rank-table th:nth-child(5), .rank-table td:nth-child(5) { width: 30%; text-align:center; }

/* ===== แถวข้อมูล ===== */
.rank-table tbody tr {
    background: rgba(0,0,0,0.35);
    color: #ffffff;
    font-weight: 600;
    font-size: 17px;
    height: 52px;
    transition: 0.25s;
}

.rank-table tbody tr:hover {
    background: rgba(0,120,200,0.35);
}

/* ===== อันดับพิเศษ 1,2,3 พร้อมกรอบแสง ===== */
.rank-1 {
    background: rgba(255,215,0,0.35) !important;
    border-left: 4px solid #ffd700;
    box-shadow: inset 0 0 20px #ffd700aa;
}

.rank-2 {
    background: rgba(180,180,255,0.32) !important;
    border-left: 4px solid #dcdcdc;
    box-shadow: inset 0 0 20px #dcdcdcaa;
}

.rank-3 {
    background: rgba(210,140,100,0.32) !important;
    border-left: 4px solid #cd7f32;
    box-shadow: inset 0 0 20px #cd7f32aa;
}

/* ไอคอนมงกุฎ */
.crown {
    font-size: 20px;
    margin-right: 6px;
}
.crown-gold   { color:#ffd700; text-shadow:0 0 8px #ffd700; }
.crown-silver { color:#e0e0e0; text-shadow:0 0 8px #e0e0e0; }
.crown-bronze { color:#cd7f32; text-shadow:0 0 8px #cd7f32; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.page-number {
    padding: 8px 14px;
    color: #ffffff;
    font-weight: 900;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25);
    text-decoration: none;
    transition: 0.2s;
}

.page-number:hover {
    background: rgba(255,255,255,0.25);
}

.page-number.active {
    background: #00c8ff;
    color: #003a4d;
    box-shadow: 0 0 12px #00e1ffaa;
}
