* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Ubah agar bisa di-scroll kalau layar kecil */
    min-height: 100vh;
    padding: 20px;
}

/* --- LAYOUT UTAMA --- */
.game-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
}

/* --- PAPAN MONOPOLI --- */
.board-wrapper {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.board {
    display: grid;
    /* Ukuran desktop: 11x11 dengan kotak 55px */
    grid-template-columns: repeat(11, 55px);
    grid-template-rows: repeat(11, 55px);
    gap: 2px;
    background-color: #333;
    border: 2px solid #333;
    position: relative;
}

.center-board {
    grid-column: 2 / 11;
    grid-row: 2 / 11;
    background-color: #cde6d0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 1;
}

.center-board h1 {
    font-size: 24px;
    color: #2c3e50;
    text-align: center;
}

.space {
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    text-align: center;
    padding: 2px;
    overflow: hidden; /* Mencegah teks meluber */
}

/* --- KONTROL (DADU) & PEMAIN --- */
.controls-panel, .player-panel {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#roll-dice-btn {
    padding: 12px 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    width: 100%;
    transition: 0.2s;
}

#roll-dice-btn:active { transform: scale(0.95); }
#roll-dice-btn:disabled { background-color: #ccc; cursor: not-allowed; }

#dice-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.die {
    width: 50px;
    height: 50px;
    background-color: white;
    border: 3px solid #333;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

@keyframes dropDown {
    0% { transform: translateY(-30px); opacity: 0; }
    50% { transform: translateY(10px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

.falling { animation: dropDown 0.4s ease-out; }

/* --- MODAL KARTU --- */
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.cards-wrapper {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 20px;
}

.card-option {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    width: 100px;
    height: 150px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    cursor: pointer;
    border: 3px solid #ff758c;
    transition: transform 0.2s;
}
.card-option:hover { transform: scale(1.1); }

/* ==========================================
   RESPONSIVE UNTUK HP (MOBILE VIEW)
   ========================================== */
@media (max-width: 768px) {
    body { padding: 10px; }

    .game-container {
        flex-direction: column; /* Ubah jadi atas-bawah */
        align-items: center;
    }

    .sidebar { width: 100%; }

    .board-wrapper {
        width: 100%;
        padding: 5px;
    }

    .board {
        /* Papan mengecil otomatis sesuai lebar layar HP */
        grid-template-columns: repeat(11, 8.5vw);
        grid-template-rows: repeat(11, 8.5vw);
        gap: 1px;
    }

    .center-board h1 { font-size: 14px; }
    
    .space { padding: 1px; }
    
    /* Teks disembunyikan / dikecilkan ekstrem agar muat di kotak kecil HP */
    .space span {
        font-size: 5px; 
        line-height: 1;
        letter-spacing: -0.5px;
    }

    /* Ukuran ikon disesuaikan */
    .space div { font-size: 10px !important; }

    .players-wrapper {
        display: flex;
        flex-direction: row;
        width: 100%;
        gap: 10px;
        overflow-x: auto; /* Bisa digeser ke samping kalau pemainnya banyak */
    }

    .players-wrapper > div {
        flex: 1;
        min-width: 120px;
        padding: 10px !important;
    }

    #roll-dice-btn { padding: 15px; font-size: 20px; } /* Tombol dadu dibesarkan biar enak dipencet jempol */
}

/* ==========================================
   ANIMASI BIDAK PEMAIN (BIAR MENCOLOK)
   ========================================== */
.player-token {
    position: absolute;
    font-size: 26px; /* Ukuran emoji dibesarkan */
    z-index: 10;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.6));
    transition: left 0.3s, bottom 0.3s;
}

/* Animasi lompat-lompat untuk pemain yang sedang giliran */
@keyframes bounceToken {
    0%, 100% { transform: translateY(0) scale(1.1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

.active-turn {
    animation: bounceToken 0.6s infinite;
    z-index: 15; /* Pastikan posisinya paling atas jika numpuk */
}