* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body { 
    background: #eef2f5; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh;
    overflow: hidden;
}

/* 1. Tampilan Hampir Memenuhi Layar */
#game-container { 
    width: 96vw; 
    height: 94vh; 
    max-width: 1400px; 
    background: #ffffff; 
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    overflow: hidden; 
    padding: 20px; 
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hidden { display: none !important; }

/* Menu Pilih Karakter */
#char-selection-screen { 
    text-align: center; 
    padding: 20px; 
    margin: auto 0;
}

#char-selection-screen h2 { margin-bottom: 25px; color: #2c3e50; }
.selection-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.select-box { background: #f8f9fa; border: 2px dashed #bdc3c7; padding: 15px; border-radius: 8px; }
.char-options { display: flex; justify-content: center; gap: 15px; margin-top: 15px; }
.char-item { 
	width: 90px;                  /* Lebar kartu dibuat sama dan konsisten */
    height: 130px;                 /* Tinggi kartu konsisten */
    padding: 8px;
	border: 3px solid transparent; padding: 10px; border-radius: 8px; cursor: pointer; background: #fff; width: 110px; transition: all 0.2s; }
.char-item img { 
	height: 85px;                 /* Kunci tinggi gambar (apapun proporsi aslinya) */
    width: auto;                  /* Lebar menyesuaikan proporsi gambar secara otomatis */
    max-width: 100%;              /* Mencegah gambar melebar keluar dari kartu */
    object-fit: contain;          /* Memastikan seluruh badan karakter tampil tanpa terpotong */
    display: block;
	margin-bottom: 5px; }
.char-item span { font-size: 0.85rem; font-weight: bold; }
.char-item.active { border-color: #3498db; background: #e8f4f8; }

/* Container pembungkus tombol agar berada tepat di tengah */
.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;       /* Lebar area tombol yang ideal */
    margin: 20px auto 0 auto; /* Auto di kiri-kanan memaksa elemen ke tengah */
    position: relative;
    z-index: 10;
}

/* Tombol Mulai Pertandingan */
#btn-start-game { 
    width: 100%;
    padding: 12px 24px; 
    font-size: 1.05rem; 
    background: #2ecc71; 
    color: white; 
    border: none; 
    border-radius: 50px; 
    font-weight: bold; 
    cursor: pointer; 
    box-shadow: 0 4px 0 #27ae60;
    transition: all 0.1s ease;
    text-align: center;
}

#btn-start-game:hover {
    background: #27ae60;
}

#btn-start-game:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #27ae60;
}

/* Tombol Menu Utama */
.btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: bold;
    background: #e67e22;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 50px;
    box-shadow: 0 4px 0 #d35400;
    transition: all 0.1s ease;
}

.btn-secondary:hover { 
    background: #d35400; 
}

.btn-secondary:active { 
    transform: translateY(2px); 
    box-shadow: 0 2px 0 #d35400; 
}

/* Container Match Arena */
#main-match-arena {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

/* 3. Header Hilang, Papan Skor di Tengah & Diperbesar */
#game-header { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding-bottom: 5px; 
}

.score-board { 
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f8fafc;
    padding: 8px 30px;
    border-radius: 50px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.score-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-size: 1.5rem;
    font-weight: 800;
    color: #475569;
}

.score-value {
    font-size: 2.5rem; /* Ukuran Skor Diperbesar */
    font-weight: 900;
    min-width: 45px;
    text-align: center;
    color: #334155; /* Warna Default (Seri) */
    transition: color 0.3s ease, transform 0.2s ease;
}

.score-divider {
    font-size: 2rem;
    font-weight: 900;
    color: #cbd5e1;
}

/* 4. Pewarnaan Skor Tinggi (Hijau) & Rendah (Merah) */
.score-value.score-higher {
    color: #16a34a !important; /* Hijau */
    transform: scale(1.15);
}

.score-value.score-lower {
    color: #dc2626 !important; /* Merah */
    transform: scale(0.95);
}

/* Arena & Lapangan Game */
#arena {
    width: 100%;
    /* Tinggi arena diperbesar agar background lebih luas dan lega */
    height: 350px; 
    min-height: 350px;
    background: url('assets/bg-lapangan.png') no-repeat center center;
    background-size: cover;
    background-color: #dff0ea;
    margin: 10px 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden; 
}

/* Garis Tengah Putus-Putus */
#garis-tengah { 
    position: absolute; 
    left: 50%; 
    top: 0; 
    width: 4px; 
    height: 100%; 
    border-left: 4px dashed #555; 
    transform: translateX(-50%); 
    z-index: 2; 
}

/* Container Lintasan Utama */
#tali-lintasan { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    top: 0;
    left: 0; 
    z-index: 3; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); 
}

/* Tali Tambang 12px */
#tali-tambang { 
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58%;
    height: 12px; /* Ketebalan pas 12px */
    z-index: 3; /* Berada tepat di belakang kepalan tangan */
}

#tali-tambang img { 
    width: 100%; 
    height: 100%; 
    object-fit: fill; 
    display: block;
}

#bendera-tengah { 
    position: absolute; 
    left: 50%; 
    top: 50%; 
    width: 12px; 
    height: 26px; 
    background: #e74c3c; 
    transform: translate(-50%, -50%); 
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    z-index: 4;
}

/* Container Karakter */
.karakter-tim { 
    position: absolute; 
    top: 58%; /* Disamakan dengan Ketinggian Tali */
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5; /* Karakter & Tangan berada DI ATAS tali */
    flex-shrink: 0;
}

.karakter-tim img { 
    height: 180px; 
    width: auto;
    object-fit: contain;
    display: block;
    /* Memberikan efek bayangan halus agar karakter menyatu dengan tanah */
    filter: drop-shadow(0px 8px 4px rgba(0, 0, 0, 0.15)); 
}

/* Fine-Tuning Posisi Masing-Masing Karakter */
#tim-pemain1 { 
    left: 22%; 
    transform: translate(-50%, -50%);
}

#tim-pemain2 { 
    left: 78%; 
    transform: translate(-50%, -50%);
}

/* Kalibrasi Offset Ketinggian Tangan per Karakter */
#tim-pemain1 img {
    /* Offset Simba jika perlu dinaikkan/diturunkan beberapa pixel */
    transform: translateY(0px); 
}

#tim-pemain2 img {
    /* Jerapah dibalik horizontal + disesuaikan 4px ke atas agar tangannya pas sejajar dengan Simba */
    transform: scaleX(-1) translateY(-4px); 
}

/* Kuis & Pertanyaan */
#main-question-box { 
    background: #34495e; 
    color: #fff; 
    font-size: 1.25rem; 
    font-weight: bold; 
    text-align: center; 
    padding: 15px 20px; 
    border-radius: 8px; 
    margin-bottom: 12px; 
}

#pvp-quiz-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.player-panel { 
    background: #f8f9fa; 
    padding: 15px; 
    border-radius: 8px; 
    border: 2px solid #ddd; 
}

#panel-p1 { border-left: 6px solid #3498db; }
#panel-p2 { border-right: 6px solid #e74c3c; }

.player-panel h3 { 
    font-size: 1rem; 
    margin-bottom: 10px; 
    color: #555; 
    text-align: center; 
}

.options-list { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.btn-option { 
    background: #ffffff; 
    border: 1px solid #ccc; 
    padding: 10px 14px; 
    font-size: 0.95rem; 
    border-radius: 6px; 
    text-align: left; 
    cursor: pointer;
    transition: background 0.2s;
}

.btn-option:hover {
    background: #f1f5f9;
}

.shortcut-badge { 
    background: #e0e0e0; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-weight: bold; 
    margin-right: 8px; 
}

/* Overlay Screen */
#overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.85); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 10; 
}

.modal-content { 
    background: #fff; 
    padding: 30px; 
    border-radius: 10px; 
    text-align: center; 
    max-width: 400px; 
}

.modal-content button { 
    margin-top: 20px; 
    padding: 10px 20px; 
    background: #2ecc71; 
    color: white; 
    border: none; 
    border-radius: 5px; 
    font-weight: bold; 
    cursor: pointer; 
}
