@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #050505;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --glow: #00d2ff;
    --text: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #000000 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animation Blob */
body::before {
    content: ''; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.1) 0%, transparent 60%),
                radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, transparent 50%);
    z-index: -1; animation: spin 20s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Header & Search */
header {
    text-align: center; padding: 4rem 1rem 2rem 1rem;
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}

h1 {
    font-size: 3rem; font-weight: 800; letter-spacing: 2px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text; color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Search Box yang Maju */
.search-wrapper {
    position: relative; width: 100%; max-width: 500px;
}
.search-box {
    width: 100%; padding: 15px 25px; border-radius: 50px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    backdrop-filter: blur(15px); color: white; font-size: 1rem;
    transition: 0.4s ease; outline: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.search-box:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glow);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}
.search-icon {
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.5); pointer-events: none;
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* Grid Modern */
.game-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 2rem;
}

/* Glass Card */
.card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    text-decoration: none;
    color: white;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    position: relative; overflow: hidden;
}

/* Hover Effect yang "Mahal" */
.card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glow);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 
                0 0 20px rgba(0, 210, 255, 0.2);
}

/* Gambar Icon */
.card img {
    width: 80px; height: 80px; border-radius: 18px;
    object-fit: cover; margin-bottom: 1rem;
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
    transition: 0.3s;
}
.card:hover img { transform: scale(1.1); }

/* Nama Game */
.card-title {
    font-weight: 600; font-size: 0.95rem; text-align: center;
    letter-spacing: 0.5px; opacity: 0.9;
}

/* Tombol Admin Hidden tapi Accessible */
.admin-link {
    position: fixed; bottom: 20px; right: 20px;
    background: rgba(255,255,255,0.1); padding: 10px;
    border-radius: 50%; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.3); text-decoration: none;
    transition: 0.3s; border: 1px solid transparent;
}
.admin-link:hover { background: var(--glow); color: black; box-shadow: 0 0 15px var(--glow); }

/* Responsif */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; }
    .card { padding: 1rem; border-radius: 18px; }
    .card img { width: 60px; height: 60px; }
    .card-title { font-size: 0.8rem; }
}
/* --- TAMBAHAN UNTUK ADMIN & LOGIN --- */

/* Glass Panel (Wadah Form) */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    backdrop-filter: blur(15px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-width: 500px;
    width: 100%;
    margin: 2rem auto;
}

/* Input Styles yang Modern */
label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: #aaa; margin-top: 15px; }

input[type="text"], input[type="password"], input[type="url"], input[type="file"] {
    width: 100%;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: 0.3s;
    font-size: 0.95rem;
}

input:focus {
    border-color: var(--glow);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

/* Button Styles */
button.btn-glow {
    width: 100%;
    padding: 14px;
    margin-top: 25px;
    background: linear-gradient(45deg, var(--glow), #3b82f6);
    border: none;
    border-radius: 12px;
    color: #000;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
}
button.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--glow);
}

/* --- PERBAIKAN TAMPILAN ADMIN LIST --- */

.admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pisahkan info dan tombol */
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 12px 15px; /* Padding sedikit dikecilkan agar kompak */
    border-radius: 12px;
    margin-bottom: 10px;
    transition: 0.3s;
    overflow: hidden; /* Mencegah elemen keluar batas */
}

.admin-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--glow);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1; /* Ambil semua ruang kosong yang tersisa */
    min-width: 0; /* PENTING: Agar teks panjang bisa dipotong (ellipsis) */
    margin-right: 10px; /* Jarak aman antara teks dan tombol hapus */
}

.mini-thumb {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0; /* Gambar tidak boleh mengecil */
    border: 1px solid rgba(255,255,255,0.1);
}

/* Container untuk Teks Nama & Link */
.info-text {
    display: flex;
    flex-direction: column;
    min-width: 0; /* PENTING: Agar anak elemen text-overflow bekerja */
}

.info-text strong {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Potong teks nama jika kepanjangan */
    display: block;
}

.info-text small {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Potong link jika kepanjangan */
    display: block;
    max-width: 100%;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.15); 
    color: #ef4444;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: 0.2s;
    white-space: nowrap; /* Teks tombol dilarang turun baris */
    flex-shrink: 0; /* PENTING: Tombol dilarang mengecil/gepeng */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px; /* Tinggi pasti agar rapi */
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
}

/* Responsif untuk Layar Sangat Kecil (HP Sempit) */
@media (max-width: 480px) {
    .admin-item {
        padding: 10px;
    }
    .mini-thumb {
        width: 40px; height: 40px;
    }
    .btn-delete {
        padding: 6px 10px;
        font-size: 0.7rem;
        height: 32px;
    }
}
