body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: #4a1f0a; /* Warna latar belakang kayu yang lebih gelap */
    overflow: hidden; /* Penting untuk menghindari scroll saat animasi */
}

.game-wrapper {
    width: 375px; /* Lebar standar ponsel */
    background: url('assets/game_bg.jpg') no-repeat center center / cover; /* Background keseluruhan game */
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    padding: 10px;
    position: relative;
    border: 5px solid #8b4513; /* Border kayu */
    overflow: hidden; /* Untuk konten di dalamnya */
}

/* --- HEADER --- */
.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: url('assets/header_bg.png') no-repeat center center / cover; /* Latar belakang header */
    padding: 15px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    position: relative;
    z-index: 2; /* Agar di atas grid saat animasi */
}

.title {
    color: #ffcc00;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    margin-bottom: 10px;
}

.multiplier-bar {
    display: flex;
    justify-content: space-around;
    width: 90%;
    background: url('assets/multiplier_bar_bg.png') no-repeat center center / contain; /* Latar belakang bar multiplier */
    padding: 5px 0;
    border-radius: 15px;
    position: relative;
    top: -5px; /* Sedikit naik agar terlihat menyatu */
}

.multiplier {
    padding: 5px 15px;
    color: #d8c09a; /* Warna teks tidak aktif */
    font-size: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: all 0.2s ease-in-out;
}

.multiplier.active {
    color: #ffcc00; /* Warna aktif */
    text-shadow: 0 0 10px #ffea00, 0 0 5px #ffcc00; /* Efek glow */
    transform: scale(1.1);
}

/* --- GRID AREA --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 60px); /* 5 kolom */
    grid-template-rows: repeat(4, 60px);    /* 4 baris */
    gap: 4px;
    background-color: #2e8b57; /* Warna hijau dasar grid */
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 3px solid #8b4513;
    position: relative;
    overflow: hidden; /* Penting untuk animasi tumble */
}

.tile-wrapper {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px; /* Untuk efek 3D flip */
}

.tile {
    width: 100%;
    height: 100%;
    background-color: white; /* Default tile color */
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    position: absolute; /* Agar bisa dianimasikan secara individual */
    backface-visibility: hidden; /* Mencegah sisi belakang terlihat saat flip */
}

.tile img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.tile.golden {
    background-color: #ffd700; /* Warna kuning emas */
    box-shadow: 0 0 8px 3px rgba(255,215,0,0.7);
}

/* Animasi Putar/Tumble */
.tile.tumble-out {
    transform: translateY(-100%) rotateX(90deg); /* Bergerak ke atas dan berputar */
    opacity: 0;
    transition: transform 0.4s ease-in, opacity 0.4s ease-in;
}
.tile.tumble-in {
    transform: translateY(100%) rotateX(-90deg); /* Masuk dari bawah dan berputar */
    opacity: 0;
}
.tile.tumble-in.active {
    transform: translateY(0) rotateX(0deg); /* Kembali ke posisi */
    opacity: 1;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

/* Animasi Kemenangan */
.tile.winning {
    animation: win-glow 0.8s infinite alternate ease-in-out;
    border: 2px solid #ffcc00;
}

@keyframes win-glow {
    from { box-shadow: 0 0 5px #ffcc00, 0 0 10px #ffcc00; }
    to { box-shadow: 0 0 15px #ffcc00, 0 0 25px #ffcc00; }
}


/* --- FOOTER --- */
.game-footer {
    position: relative;
    z-index: 2;
}

.message-bar {
    background: url('assets/message_bar_bg.png') no-repeat center center / cover; /* Latar belakang message bar */
    color: #ffcc00;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.scatter-symbol {
    color: #ff0000; /* Warna khusus untuk simbol scatter di teks */
}

.bottom-panel {
    display: flex;
    justify-content: space-around;
    background: url('assets/bottom_panel_bg.png') no-repeat center center / cover; /* Latar belakang panel bawah */
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #d8c09a;
    font-size: 12px;
}

.info-item .value {
    color: #ffcc00;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.control-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: url('assets/control_panel_bg.png') no-repeat center center / cover; /* Latar belakang control panel */
    padding: 10px 0;
    border-radius: 8px;
}

.control-btn {
    background: #8b4513; /* Warna tombol default */
    border: 2px solid #5a2c13;
    color: #d8c09a;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.control-btn:hover {
    background: #a0522d;
}

.spin-btn {
    background: radial-gradient(circle, gold, #ffcc00);
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    cursor: pointer;
    box-shadow: 0 5px 0 #d4af37;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.1s;
}

.spin-btn:active {
    box-shadow: 0 2px 0 #d4af37;
    transform: translateY(3px);
}

.spin-icon {
    width: 60%;
    height: 60%;
    object-fit: contain;
}