/* ========================================
   Gaya Khusus Game Tebak Warna Resistor
======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

html, body {
    height: 100%;
    overflow-y: auto;
}

body {
    background: #f0f8ff;
    padding: 15px;
    max-width: 700px;
    margin: 0 auto;
}

.bagianatas {
    text-align: center;
    margin-bottom: 15px;
}

.kembali {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 10px;
}

.kembali:active {
    background: #2980b9;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 17px;
    margin-bottom: 5px;
}

.kotak {
    background: white;
    padding: 17px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.baris-mode-atur {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.grup-mode {
    display: flex;
    gap: 7px;
}

.tombol-mode {
    padding: 8px 11px;
    font-size: 17px;
    border: none;
    border-radius: 8px;
    background: #e0e9f2;
    color: #2c3e50;
    cursor: pointer;
}

.tombol-mode.aktif {
    background: #3498db;
    color: white;
}

.tombol-atur button {
    padding: 8px 16px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: #e0e9f2;
    color: #2c3e50;
    cursor: pointer;
}

.kotak-pengaturan {
    background: #fef9e7;
    padding: 17px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: none;
}

.kotak-pengaturan.tampil {
    display: block;
}

.kotak-pengaturan label {
    display: block;
    margin: 10px 0 5px;
    font-size: 15px;
    color: #555;
}

.kotak-pengaturan input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.baris-tombol {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-simpan {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #27ae60;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.btn-batal {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #95a5a6;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.info-atas {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1px;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.wadah-resistor {
    position: relative;
    height: 100px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kabel-kiri, .kabel-kanan {
    position: absolute;
    width: 60px;
    height: 4px;
    background: #333;
    z-index: 1;
}

.kabel-kiri {
    left: calc(50% - 165px);
}

.kabel-kanan {
    right: calc(50% - 165px);
}

.ujung-kiri, .ujung-kanan {
    position: absolute;
    width: 60px;
    height: 120px;
    background: #ffddbb;
    border-radius: 30px;
    z-index: 3;
}

.ujung-kiri {
    left: calc(50% - 150px);
}

.ujung-kanan {
    right: calc(50% - 150px);
}

.badan-tengah {
    position: relative;
    width: 200px;
    height: 80px;
    background: #ffddbb;
    z-index: 2;
    border-radius: 4px;
}

.gelang {
    position: absolute;
    width: 18px;
    height: 80px;
    top: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.gelang.g1, .gelang.g2, .gelang.g3, .gelang.g4 {
    opacity: 0;
}

.gelang.aktif {
    opacity: 1;
}

.g1 {
    left: 10px;
}

.g2 {
    left: 45px;
}

.g3 {
    left: 80px;
}

.g4 {
    left: 115px;
}

.g5 {
    left: 170px;
    background: #C0C0C0;
    opacity: 1;
}

.teks-soal {
    text-align: center;
    font-size: 14px;
    color: #2c3e50;
    margin: 3px 0;
    font-weight: bold;
}

.input-jawab {
    margin-bottom: 11px;
}

.input-jawab input {
    width: 100%;
    padding: 11px;
    font-size: 22px;
    border: 3px solid #f5a623;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 11px;
}

.btn-kirim {
    width: 100%;
    padding: 15px;
    font-size: 22px;
    border: none;
    border-radius: 12px;
    background: #28a745;
    color: white;
    cursor: pointer;
    margin-bottom: 15px;
}

.tombol-mulai {
    width: 100%;
    padding: 15px;
    font-size: 22px;
    border: none;
    border-radius: 12px;
    background: #f59e0b;
    color: white;
    cursor: pointer;
    margin-bottom: 20px;
}

.pesan {
    text-align: center;
    font-size: 20px;
    margin: 15px 0;
    font-weight: bold;
    min-height: 30px;
}

.benar {
    color: #28a745;
}

.salah {
    color: #dc3545;
}

.nilai-akhir {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border-radius: 12px;
    margin-top: 20px;
    margin-bottom: 20px;
    display: none;
}

.nilai-akhir.tampil {
    display: block;
}

.tabel-warna {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 10px;
}

.tabel-warna h3 {
    text-align: center;
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 16px;
}

.tabel-warna table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabel-warna th, .tabel-warna td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.tabel-warna th {
    background: #f0f8ff;
}

.kotak-warna {
    width: 30px;
    height: 20px;
    margin: 0 auto;
    border: 1px solid #999;
    border-radius: 3px;
}


