:root {
    --primary-color: #007bff; --dark-color: #2c3e50; --light-color: #ffffff;
    --bg-color: #eef2f7; --grey-text: #5a6878; --danger-color: #dc3545;
    --player1-color: #ffffff; --player2-color: #c82333;

    /* Warna untuk Judul WOW */
    --wow-color1: #ff6b6b; /* Merah cerah */
    --wow-color2: #ffe66d; /* Kuning keemasan */
    --wow-color3: #4ecdc4; /* Toska */
    --wow-color-shadow: #c0392b; /* Bayangan lebih gelap */
}

body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; padding: 20px; background-color: var(--bg-color); color: var(--dark-color); box-sizing: border-box; }

/* === Gaya Judul WOW BARU === */
#main-title {
    margin-bottom: 25px;
    text-align: center;
    font-size: 3.5em; /* Ukuran lebih besar */
    font-weight: 900; /* Lebih tebal */
    letter-spacing: 2px; /* Jarak antar huruf */
    
    /* Gradient sebagai warna teks */
    background: linear-gradient(45deg, var(--wow-color1), var(--wow-color2), var(--wow-color3));
    -webkit-background-clip: text; /* Menerapkan gradient pada teks */
    -webkit-text-fill-color: transparent; /* Membuat teks transparan agar gradient terlihat */
    
    /* Multiple Text Shadows untuk efek 3D dan Glow */
    text-shadow:
        3px 3px 0 var(--wow-color-shadow),   /* Bayangan dasar */
        -3px -3px 0 rgba(255, 255, 255, 0.4), /* Highlight atas-kiri */
        5px 5px 10px rgba(0,0,0,0.5),         /* Bayangan dalam yang lembut */
        0 0 20px rgba(255, 255, 255, 0.7);     /* Efek glow putih */

    animation: title-shine 3s infinite alternate; /* Animasi berkedip/bersinar */
}

@keyframes title-shine {
    0% { transform: scale(1); text-shadow: 3px 3px 0 var(--wow-color-shadow), -3px -3px 0 rgba(255, 255, 255, 0.4), 5px 5px 10px rgba(0,0,0,0.5), 0 0 10px rgba(255, 255, 255, 0.5); }
    50% { transform: scale(1.02); text-shadow: 3px 3px 0 var(--wow-color-shadow), -3px -3px 0 rgba(255, 255, 255, 0.6), 5px 5px 15px rgba(0,0,0,0.7), 0 0 30px rgba(255, 255, 255, 0.9); }
    100% { transform: scale(1); text-shadow: 3px 3px 0 var(--wow-color-shadow), -3px -3px 0 rgba(255, 255, 255, 0.4), 5px 5px 10px rgba(0,0,0,0.5), 0 0 10px rgba(255, 255, 255, 0.5); }
}


.game-layout { display: flex; gap: 30px; align-items: flex-start; }
#left-panel { width: 300px; flex-shrink: 0; }
#selection-title { margin-top: 0; text-align: center; color: var(--primary-color); }
#opponent-selection-list { display: flex; flex-direction: column; gap: 15px; }
.opponent-card { background-color: var(--light-color); padding: 15px; border-radius: 12px; border: 1px solid #dbe2e8; box-shadow: 0 4px 15px rgba(0,0,0,0.05); cursor: pointer; text-align: center; transition: all 0.3s ease; opacity: 1; }
.opponent-card:hover { transform: scale(1.05); box-shadow: 0 8px 25px rgba(0,0,0,0.1); border-color: var(--primary-color); }
.opponent-card.is-hidden { opacity: 0; transform: scale(0.9); height: 0; padding: 0; margin: 0; border: none; overflow: hidden; }
.card-icon { font-size: 2.5em; margin-bottom: 10px; line-height: 1; }
.card-title { margin: 0 0 5px 0; font-size: 1.4em; color: var(--dark-color); }
.card-difficulty { margin: 0 0 10px 0; font-size: 0.9em; color: #8492a6; }
.card-description { font-size: 0.85em; color: var(--grey-text); line-height: 1.4; }
#game-info-panel { margin-top: 15px; display: flex; flex-direction: column; gap: 15px; text-align: center; }
#status { font-size: 1.2em; font-weight: bold; min-height: 50px; padding: 10px; background-color: var(--light-color); border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
#restart-button { padding: 12px 20px; font-size: 1.1em; cursor: pointer; border: none; background-color: var(--danger-color); color: white; border-radius: 8px; transition: background-color 0.3s ease; }
#restart-button:hover { background-color: #c82333; }
#right-panel { flex-grow: 1; }
#board-wrapper { position: relative; width: 486px; height: 486px; margin: 0 auto; }
#board-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.8); display: flex; justify-content: center; align-items: center; text-align: center; font-size: 1.5em; font-weight: bold; color: var(--grey-text); z-index: 10; border-radius: 2px; transition: opacity 0.3s ease; }
#board-overlay.hidden { opacity: 0; pointer-events: none; }
#dam-warning { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 100px; font-weight: 900; color: var(--danger-color); text-shadow: 3px 3px 0 #fff, -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff; z-index: 20; pointer-events: none; opacity: 0; transition: opacity 0.5s ease-out; }
#dam-warning.show { animation: dam-effect 1.2s ease-in-out forwards; }
@keyframes dam-effect { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } 80% { transform: translate(-50%, -50%) scale(1.0); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; } }
#game-board { display: grid; grid-template-columns: repeat(8, 60px); grid-template-rows: repeat(8, 60px); border: 3px solid #333; width: 480px; height: 480px; }
.square { width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; position: relative; }

/* === Warna Papan BARU === */
.dark { background-color: #008744; } /* Hijau */
.light { background-color: #fdd835; } /* Kuning */


.piece { width: 50px; height: 50px; border-radius: 50%; cursor: pointer; box-shadow: inset 0 -4px 6px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.3); transition: transform 0.2s ease-in-out; position: absolute; z-index: 5; }
.player1 { background-color: var(--player1-color); border: 2px solid #555; }
.player2 { background-color: var(--player2-color); border: 2px solid #003a7a; }
.piece.jumping { animation: jump-and-move 0.6s ease-in-out forwards; }
.piece.captured { animation: captured-fade 0.5s ease-in forwards; }
@keyframes jump-and-move { 0% { transform: translate(0, 0) scale(1.1); z-index: 6; } 50% { transform: translate(var(--jump-x-half), var(--jump-y-half)) scale(1.3); } 100% { transform: translate(var(--jump-x), var(--jump-y)) scale(1.0); z-index: 6; } }
@keyframes captured-fade { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.3); opacity: 0; } }
.selected { box-shadow: 0 0 0 4px gold; transform: scale(1.1); }
.possible-move { background-color: rgba(255, 255, 255, 0.5); border-radius: 10%; width: 55px; height: 55px; } /* Warna highlight diubah agar kontras */
.rules-container { width: 486px; margin: 20px auto 0 auto; padding: 15px 25px; background-color: var(--light-color); border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); box-sizing: border-box; }
.rules-container h2 { text-align: center; margin-top: 0; color: var(--primary-color); font-size: 1.2em; }
.rules-container ul { padding-left: 20px; margin: 0; font-size: 0.9em; }
.rules-container li { margin-bottom: 5px; }
#win-screen-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(44, 62, 80, 0.85); display: flex; justify-content: center; align-items: center; z-index: 100; opacity: 0; transition: opacity 0.5s ease; }
#win-screen-overlay.show { opacity: 1; }
#confetti-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.win-screen-content { background-color: var(--light-color); padding: 40px 60px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); text-align: center; transform: scale(0.7); transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#win-screen-overlay.show .win-screen-content { transform: scale(1); }
#win-screen-title { font-size: 3em; margin: 0 0 10px 0; color: var(--primary-color); }
#win-screen-title.loser { color: var(--grey-text); }
#win-screen-message { font-size: 1.2em; margin: 0 0 30px 0; color: var(--grey-text); }
#play-again-button { padding: 12px 30px; font-size: 1.2em; font-weight: bold; cursor: pointer; border: none; background-color: var(--primary-color); color: white; border-radius: 8px; transition: background-color 0.3s ease; }
#play-again-button:hover { background-color: #0056b3; }

.hidden { display: none !important; }

#confetti-canvas {
    /* Baris ini memberitahu browser untuk 'menembus' canvas saat ada klik,
       sehingga elemen di belakangnya (papan permainan) yang akan menerima klik. */
    pointer-events: none;
}