/* --- Base Styles & Fonts --- */
:root {
    --primary-red: #e74c3c;
    --dark-red: #c0392b;
    --background-dark: #0d0d0d;
    --surface-dark: #1a1a1a;
    --text-light: #e0e0e0;
    --text-muted: #888;
    --border-color: #333;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    text-align: center;
}
button {
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Kanit', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
}
input, textarea {
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: var(--surface-dark);
    color: var(--text-light);
    width: 90%;
    font-size: 1em;
    font-family: 'Kanit', sans-serif;
}

/* --- Navbar Header --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(10, 10, 10, 0.8);
    padding: 15px 5%;
    border-bottom: 1px solid var(--dark-red);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.logo a {
    text-decoration: none;
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-weight: 900;
    font-size: 1.5em; /* ปรับขนาดให้เหมาะกับมือถือ */
    letter-spacing: 1px;
    text-shadow: 0 0 5px var(--dark-red);
}
.nav-links { display: flex; align-items: center; gap: 15px; } /* ลดช่องว่าง */
.start-date {
    color: var(--text-muted);
    font-size: 0.9em;
    border-right: 1px solid #444;
    padding-right: 15px;
}
.nav-item {
    text-decoration: none;
    color: #aaa;
    font-weight: bold;
    font-size: 1em; /* ปรับขนาด */
    transition: color 0.3s, text-shadow 0.3s;
}
.nav-item:hover, .nav-item.active { color: var(--primary-red); text-shadow: 0 0 8px var(--primary-red); }
#login-logout-button {
    background-color: var(--dark-red);
    color: white;
    border: 1px solid var(--primary-red);
    padding: 8px 15px; /* ปรับขนาดปุ่ม */
}
#login-logout-button:hover { background-color: var(--primary-red); box-shadow: 0 0 10px var(--primary-red); }
#login-logout-button.logout { background-color: #992d22; }

/* ===== TOTAL COUNTER SECTION ===== */
.total-counter-section {
    padding: 40px 20px;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url(https://i.postimg.cc/PqqNWFmX/head-web.png) no-repeat center center;
    background-size: cover;
    border-bottom: 2px solid var(--dark-red);
}
.total-counter-section h2 {
    font-family: 'Charm', sans-serif;
    font-size: 1.5em;
    color: #aaa;
    letter-spacing: 3px;
    margin: 0;
}
.kill-counter {
    font-family: 'Orbitron', sans-serif;
    font-size: 5em; /* ปรับขนาดสำหรับจอเล็ก */
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 15px var(--primary-red), 0 0 25px var(--dark-red);
}

/* --- Main Content --- */
#app-container { padding: 0; }
main { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8em; /* ปรับขนาด */
    color: var(--text-light);
    letter-spacing: 2px;
    margin-top: 40px;
    margin-bottom: 20px;
}

/* ===== CONTROLS (REDESIGNED) ===== */
.controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
#add-player-button {
    background-color: #27ae60;
    color: white;
    flex-shrink: 0; /* ไม่ให้ปุ่มหด */
}
#search-box {
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

/* --- Player Grid --- */
.player-grid {
    display: grid;
    grid-template-columns: 1fr; /* เริ่มต้นที่ 1 คอลัมน์สำหรับมือถือ */
    gap: 20px;
    min-height: 500px;
}
.player-card {
    background-color: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
    border-color: var(--primary-red);
}
.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px; /* เพิ่มช่องว่างระหว่างชื่อกับแท็ก */
}
.player-card h3 {
    font-family: 'Kanit', sans-serif;
    font-size: 1.4em;
    color: var(--primary-red);
    margin: 0;
    text-align: left;
    word-break: break-word; /* ตัดคำเมื่อยาวเกิน */
    flex-grow: 1; /* ให้ชื่อยืดขยายได้เต็มที่ */
}
.player-card .status {
    background-color: var(--dark-red);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap; /* ป้องกันไม่ให้แท็กขึ้นบรรทัดใหม่ */
}
.last-updated {
    font-size: 0.8em;
    color: var(--text-muted);
    text-align: left;
    margin-top: 5px;
    margin-bottom: 15px;
}
.kill-count-info {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111;
    padding: 5px 10px;
    border-radius: 5px;
}
.kill-count-text { 
    font-size: 1.2em; 
    font-family: 'Kanit', sans-serif;
}
.kill-count-text span {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5em;
    color: var(--primary-red);
    margin-left: 10px;
}
.admin-controls { display: flex; gap: 10px; }
.admin-btn {
    background-color: #333;
    color: #aaa;
    border-radius: 5px;
    width: 35px;
    height: 35px;
    font-size: 1.2em;
    line-height: 35px;
    padding: 0;
    border: 1px solid #444;
}
.admin-btn.increment-btn:hover { background-color: #27ae60; color: white; }
.admin-btn.decrement-btn:hover { background-color: #f39c12; color: white; }
.admin-btn.delete-btn:hover { background-color: var(--dark-red); color: white; }

/* ===== PAGINATION ===== */
.pagination-controls {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap; /* ทำให้ปุ่มขึ้นบรรทัดใหม่ได้ */
}
.page-btn {
    background-color: #333;
    color: #aaa;
    border: 1px solid #555;
    padding: 8px 15px;
}
.page-btn:hover { background-color: #555; }
.page-btn.active {
    background-color: var(--dark-red);
    color: white;
    border-color: var(--primary-red);
}

/* ===== RANKING PAGE ===== */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.rank-item {
    display: flex;
    align-items: center;
    background-color: var(--surface-dark);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none; /* ป้องกันการขีดเส้นใต้ลิงก์ */
    color: inherit; /* ทำให้สีตัวอักษรเป็นไปตามธีม */
    cursor: pointer; /* ทำให้เมาส์เป็นรูปมือเมื่อชี้ */
}
/* --- การเปลี่ยนแปลงข้อ 3: แก้ไขการซ้อนทับของตัวเลข --- */
.rank-position {
    font-family: 'Orbitron', sans-serif;
    font-size: 2em;
    color: var(--text-muted);
    width: 80px; /* เพิ่มความกว้างจาก 60px เป็น 80px */
    flex-shrink: 0; /* ป้องกันการหดตัวของกล่อง */
}
.rank-name {
    flex-grow: 1;
    text-align: left;
    font-size: 1.5em;
    padding-left: 10px; /* เพิ่มบรรทัดนี้เพื่อดันชื่อไปทางขวา */
    box-sizing: border-box; /* ป้องกันไม่ให้ padding ขยายกล่อง */    
}
.rank-kills {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2em;
    color: var(--primary-red);
}
.rank-item.rank-1, .rank-item.rank-2, .rank-item.rank-3 { border-width: 2px; }
.rank-item.rank-1 { border-color: #ffd700; box-shadow: 0 0 15px #ffd700; }
.rank-item.rank-1 .rank-position { color: #ffd700; }
.rank-item.rank-2 { border-color: #c0c0c0; box-shadow: 0 0 15px #c0c0c0; }
.rank-item.rank-2 .rank-position { color: #c0c0c0; }
.rank-item.rank-3 { border-color: #cd7f32; box-shadow: 0 0 15px #cd7f32; }
.rank-item.rank-3 .rank-position { color: #cd7f32; }

/* ===== DETAILS PAGE (IMAGES & COMMENTS) ===== */
.details-section { max-width: 960px; margin: 20px auto; }
.details-header {
    background: #111;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.details-header h2 { font-family: 'Kanit', sans-serif; color: var(--primary-red); }
.video-section-controls { margin-top: 30px; text-align: center; }
.back-button {
    background-color: #333;
    color: #aaa;
    border: 1px solid #555;
}
.back-button:hover {
    background-color: var(--primary-red);
    color: white;
    border-color: var(--dark-red);
}


/* Image Gallery */
.image-gallery-container {
    background-color: var(--surface-dark);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.image-gallery-container h3 { text-align: left; }
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.image-item {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    aspect-ratio: 16 / 9;
    cursor: pointer;
}
.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.image-timestamp {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ccc;
    font-size: 0.8em;
    padding: 5px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.image-item:hover .image-timestamp {
    opacity: 1;
}
.image-item .delete-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(231, 76, 60, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 1.5em;
    padding: 0;
}
.image-item:hover .delete-button {
    opacity: 1;
}

/* Paste Area */
.paste-area {
    border: 2px dashed #444;
    border-radius: 8px;
    padding: 40px;
    margin-top: 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.paste-area:hover { border-color: var(--primary-red); }
.paste-area p { margin: 0; color: var(--text-muted); }
.paste-area.uploading {
    border-color: #27ae60;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

/* ===== COMMENTS SECTION (REDESIGNED) ===== */
.comments-section { margin-top: 30px; text-align: left; }
.comments-section h3 { font-family: 'Kanit', sans-serif; border-bottom: 2px solid var(--primary-red); padding-bottom: 10px; }
#comment-form {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#comment-form textarea {
    width: 100%;
    height: 80px;
    box-sizing: border-box;
    margin-bottom: 10px;
    resize: none;
}
#comment-form button {
    background-color: var(--primary-red);
    color: white;
    align-self: center; /* จัดให้อยู่กลาง */
}
.char-counter {
    font-size: 0.8em;
    color: var(--text-muted);
    align-self: flex-start;
    margin-bottom: 10px;
}
#comments-list { list-style: none; padding: 0; margin-top: 20px; }
.comment-item {
    background-color: var(--surface-dark);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary-red);
    position: relative;
}

.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.comment-author { font-weight: bold; color: var(--primary-red); }
.comment-date { font-size: 0.8em; color: var(--text-muted); }
.comment-body { color: #ccc; white-space: pre-wrap; word-break: break-word; }

/* ===== MONTAGE PAGE ===== */
.montages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}
.montage-card {
    background-color: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.montage-card iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    border: none;
}
.montage-info {
    padding: 15px;
    text-align: left;
}
.montage-info h3 { margin: 0 0 5px 0; color: var(--primary-red); }
.montage-info p { margin: 0; color: var(--text-muted); font-size: 0.9em; }

/* ===== ADMIN PANEL ===== */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-dark);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.user-email {
    font-size: 1.1em;
    color: #ccc;
}
.admin-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.admin-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.admin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #27ae60;
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* --- Modals --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-content {
    background-color: var(--surface-dark);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--dark-red);
}
.modal-content h3 { margin-top: 0; font-family: 'Kanit', sans-serif; }
.modal-content button { margin-right: 10px; }
.close-modal-button { background-color: #95a5a6; }
#confirm-ok-button.confirm-danger { background-color: var(--primary-red); color: white; }

/* ===== LIGHTBOX (NEW) ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
    box-sizing: border-box;
}
.lightbox-content {
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}
.lightbox-close:hover {
    color: var(--primary-red);
}

/* --- Utility --- */
.hidden { display: none !important; }
.admin-only { }
.delete-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--primary-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    line-height: 25px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
}
.delete-button:hover { opacity: 1; }

/* ===== RESPONSIVE DESIGN ===== */
@media (min-width: 600px) {
    .player-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .controls {
        flex-direction: row;
    }
}

@media (min-width: 992px) {
    .player-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .montages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .logo a {
        font-size: 1.8em;
    }
    .nav-links {
        gap: 25px;
    }
    .nav-item {
        font-size: 1.1em;
    }
    .kill-counter {
        font-size: 6em;
    }
     .section-title {
        font-size: 2em;
    }
}

/* =================================================================== */
/* โค้ดสำหรับปรับปรุงการแสดงผลบนมือถือ (Responsive Design)         */
/* =================================================================== */

/* ตั้งค่าสำหรับหน้าจอที่เล็กกว่า 992px */
@media (max-width: 991px) {
    .navbar {
        display: flex; /* เปิดใช้งาน Flexbox */
        justify-content: space-between; /* จัดให้ไอเท็มห่างกันสุดขอบ */
        align-items: center; /* จัดให้อยู่กลางแนวตั้ง */
        padding: 10px 15px;
        position: absolute;
        
        /* --- เพิ่ม 2 บรรทัดนี้ --- */
        width: 100%; /* กางให้เต็มความกว้างเสมอ */
        box-sizing: border-box; /* ป้องกัน padding ทำให้ขนาดเกิน */
    }

    .logo {
        flex-grow: 1;
    }
    
    /* ลดขนาดชื่อเว็บสำหรับมือถือ */
    .logo .logo-text {
        font-size: 1.3em;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 1.8em;
        cursor: pointer;
    }

    /* --- เมนู (แก้ไขใหม่ทั้งหมด) --- */
    .nav-menu {
        display: none; /* ซ่อนเมนูไว้ก่อน */
        flex-direction: column;
        width: 100%;
        
        /* ทำให้เมนูสไลด์ลงมาจากด้านบน */
        position: absolute;
        top: 60px; /* ระยะห่างจากขอบบน (ปรับได้ตามความสูงของ Navbar) */
        left: 0;
        
        background-color: rgba(26, 26, 26, 0.95); /* สีพื้นหลัง */
        backdrop-filter: blur(5px); /* เพิ่มความเบลอ */
        padding: 20px 0;
        gap: 20px;
        border-bottom: 1px solid var(--dark-red);
    }

    .nav-menu.active {
        display: flex; /* แสดงเมนูเมื่อถูกกด */
    }

    .start-date {
        display: none; /* ซ่อนวันที่บนมือถือเพื่อให้เมนูดูสะอาดขึ้น */
    }
    .nav-links { /* เราไม่ได้ใช้ class นี้แล้วใน HTML ใหม่ แต่ใส่ไว้เผื่อ */
        flex-direction: column;
    }


    /* --- 2. ปรับปรุงหัวข้อหลัก --- */
    .total-counter-section h2 {
        font-size: 1.2em; /* ลดขนาดตัวอักษรหัวข้อ */
        letter-spacing: 1px;
    }
    .kill-counter {
        font-size: 4em; /* ลดขนาดตัวเลข Counter */
    }


    /* --- 3. ปรับปรุงหน้า Ranking --- */
    .rank-item {
        padding: 10px;
        flex-wrap: wrap; /* ทำให้ชื่อขึ้นบรรทัดใหม่ได้ถ้าไม่พอ */
    }
    .rank-position {
        font-size: 1.5em; /* ลดขนาดตัวเลขอันดับ */
        width: 50px; /* ลดความกว้าง */
    }
    .rank-name {
        font-size: 1.2em; /* ลดขนาดชื่อ */
    }
    .rank-kills {
        font-size: 1.8em; /* ลดขนาดจำนวน Kill */
    }
}

/* ซ่อนปุ่มแฮมเบอร์เกอร์บนจอใหญ่ */
@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }
    .nav-menu {
        display: flex !important; /* บังคับให้แสดงเมนูแนวนอนเสมอ */
        flex-direction: row;
        width: auto;
        background-color: transparent;
        padding: 0;
        margin-top: 0;
        gap: 25px;
        align-items: center;
    }
}

.card-stats {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    gap: 15px;
}

.comment-count {
    font-size: 0.9em;
    color: var(--text-muted);
}

.comment-count i {
    margin-right: 5px;
}

/* --- สไตล์ปุ่มลบคอมเมนต์ (แบบใหม่) --- */
.comment-item {
    border-left: 3px solid var(--primary-red);
    margin-bottom: 15px;
    padding: 15px;
    background-color: var(--surface-dark);
    border-radius: 5px;
}

.comment-footer {
    margin-top: 15px;
    text-align: right;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.comment-delete-btn {
    background: none;
    border: 1px solid #444;
    color: var(--text-muted);
    font-size: 0.8em;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    text-transform: none;
}

.comment-delete-btn i {
    margin-right: 5px;
}

.comment-delete-btn:hover {
    background-color: var(--dark-red);
    color: white;
    border-color: var(--primary-red);
}

/* --- Loading Indicator Styles --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 13, 13, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.spinner {
    border: 5px solid #f3f3f3; /* Light grey */
    border-top: 5px solid var(--primary-red); /* Red */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- ปรับปรุง Navbar เพิ่มเติม --- */
.logo .logo-text {
    text-decoration: none;
    font-family: 'Charm', sans-serif;
    font-weight: 700; /* ปรับลดลงเล็กน้อยเพื่อให้เข้ากับฟอนต์ Charm */
    font-size: 1.5em; /* เพิ่มขนาดให้เด่นขึ้น */
    letter-spacing: 1px;
    cursor: default;

    /* --- ส่วนที่แก้ไข --- */
    color: #ffffff; /* สีแดงสด (เหมือนสีหลักของเว็บ) */
    
    /* ออร่าสีขาวฟุ้งๆ ด้วย text-shadow หลายชั้น */
    text-shadow: 0 0 5px #c03333, 
                 0 0 10px #1b1b1b, 
                 0 0 15px #616161,
                 0 0 20px #000000; /* เพิ่มเงาสีแดงจางๆ ด้านนอกสุด */
}

/* ทำให้เมนูและปุ่ม Login เป็นตัวพิมพ์ใหญ่ทั้งหมด */
.nav-item, #login-logout-button {
    text-transform: uppercase;
}

@media (min-width: 992px) {
    .logo .logo-text {
        font-size: 1.8em;
    }
}

/* --- Footer Styles --- */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    margin-top: 60px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-red);
}

.footer-links span {
    margin: 0 10px;
}

/* --- สไตล์สำหรับสถิติการสังหารในหน้ารายละเอียด --- */
.details-kill-count {
    color: var(--text-muted);
    font-size: 1.2em;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.details-kill-count i {
    margin-right: 10px;
    color: var(--primary-red);
}

.rank-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
    border-color: var(--primary-red);
}

/* =================================================================== */
/* ปรับปรุงหน้า Ranking บนมือถือเพิ่มเติม                             */
/* =================================================================== */

@media (max-width: 767px) {
    .rank-item {
        padding: 8px 10px; /* ลด padding เล็กน้อย */
    }

    .rank-position {
        font-size: 1.2em; /* ลดขนาดตัวเลขอันดับ */
        width: 40px; /* ลดความกว้าง */
    }

    .rank-name {
        font-size: 0.9em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-left: 10px; /* เพิ่มบรรทัดนี้เพื่อดันชื่อไปทางขวา */
        box-sizing: border-box; /* ป้องกันไม่ให้ padding ขยายกล่อง */
    }

    .rank-kills {
        font-size: 1.5em; /* ลดขนาด Skull เล็กน้อย */
    }
}

/* --- แก้ไข Navbar ทับเนื้อหาบนมือถือ --- */
@media (max-width: 991px) {
    #app-container {
        padding-top: 70px; /* เพิ่มระยะห่างด้านบน (ปรับค่าได้ตามความสูงของ Navbar) */
    }
}

/* --- สไตล์สำหรับ Smart Add Modal --- */
.autocomplete-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

#smart-add-player-name {
    width: 100%;
    box-sizing: border-box;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2c3e50;
    border: 1px solid #444;
    border-top: none;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1001;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--text-light);
}

.suggestion-item:hover {
    background-color: #34495e;
}

#smart-add-paste-area {
    position: relative;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#smart-add-preview-image {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

button.confirm-save {
    background-color: #27ae60;
    color: white;
}
button.confirm-save:hover {
    background-color: #2ecc71;
}

