/* Font default, bisa diubah dinamis */
:root {
    --main-font: 'Poppins', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--main-font);
}

body {
    background-color: #4b1a8f; 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.lobby-container {
    width: 100%;
    max-width: 450px; /* Sedikit diperlebar */
    padding: 20px;
    text-align: center;
}

.app-title {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 2px;
}

.card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.subtitle {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.avatar-grid {
    display: grid;
    /* Grid lebih rapat untuk menampung banyak avatar */
    grid-template-columns: repeat(5, 1fr); 
    gap: 10px;
    margin-bottom: 25px;
    /* Tinggi maksimal ditambah sedikit */
    max-height: 280px; 
    overflow-y: auto;
    padding: 5px;
}

.avatar-item {
    background-color: #f5f5f5;
    border-radius: 12px;
    aspect-ratio: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
}

/* Memastikan gambar API masuk dengan baik */
.avatar-item img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

/* Khusus preview kamera, gunakan cover agar penuh */
#previewContainer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.avatar-item.selected {
    border-color: #2ecc71; 
    background-color: #e8f8f0;
}

.camera-btn {
    background-color: #e0e0e0;
    /* Mengubah label menjadi blok agar bisa diklik sebagai tombol */
    display: block; 
}

.camera-icon {
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.input-group {
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #333;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #4b1a8f;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background-color: #333333;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: #1a1a1a;
}

/* Scrollbar */
.avatar-grid::-webkit-scrollbar {
    width: 8px;
}
.avatar-grid::-webkit-scrollbar-thumb {
    background-color: #bdc3c7;
    border-radius: 10px;
}
.avatar-grid::-webkit-scrollbar-thumb:hover {
    background-color: #95a5a6;
}
