body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #222;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
    overflow: hidden;
}

/* Custom Scrollbar for Webkit browsers (Chrome, Safari, Edge, Opera) */
/* Track */
::-webkit-scrollbar {
    width: 10px;
    height: 10px; /* For horizontal scrollbars if any */
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: #b0b4b0;
    border-radius: 5px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #ffffff;
}

/* Track background */
::-webkit-scrollbar-track {
    background: #333;
    border-radius: 5px;
}


.game-container {
    background-color: #333;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    width: 650px;
    height: 750px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    color: #4CAF50;
    margin-bottom: 20px; /* Kembali ke margin default untuk h1 di luar start-screen */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

/* Gaya baru untuk informasi versi */
.version-info {
    font-size: 0.9em;
    color: #bbb;
    margin-top: 0;
    margin-bottom: 20px; /* Memberi jarak ke elemen di bawahnya */
}

/* Ukuran font level-info-top dikecilkan lebih lanjut */
.level-info-top {
    font-size: 1.0em;
    font-weight: bold;
    color: #FFD700;
    margin-top: -10px;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    text-align: center;
    width: 100%;
}


canvas {
    background-color: #1a1a1a;
    border: 3px solid #4CAF50;
    border-radius: 10px;
    display: block;
    margin: 15px auto;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 600px;
    margin-top: 5px;
    padding: 0 10px;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

/* Mengelompokkan elemen skor dan target skor */
.score-and-target {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
    flex-shrink: 1;
    max-width: 30%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

/* Gaya untuk target-score-info */
.target-score-info {
    font-size: 1.2em;
    font-weight: bold;
    color: #ADD8E6;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gaya untuk kecepatan */
.speed-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    flex-grow: 1;
    flex-shrink: 1;
    text-align: center;
    max-width: 25%;
}

/* Gaya untuk kelompok tombol */
.button-group {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
    flex-grow: 1;
    flex-shrink: 0;
    max-width: 35%;
}

.game-info .game-button {
    margin-left: 10px;
    flex-shrink: 0;
}


/* Notifikasi Skor Bonus */
.score-notification {
    position: absolute;
    font-size: 3em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    z-index: 30;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    pointer-events: none;
}

.score-notification.show {
    opacity: 1;
    transform: translateY(-20px);
}

/* Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/images/snake_pattern_background.png'); /* Cek jalur gambar Anda */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.849);
    background-blend-mode: multiply;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 20;
    color: #eee;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.start-screen.hidden {
    display: none;
}

.start-screen .subtitle {
    font-size: 1.2em;
    color: #bbb;
    margin-top: -10px;
    margin-bottom: 50px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.start-screen h2 {
    color: #4CAF50;
    font-size: 2.5em;
    margin-bottom: 10px; /* Kembali ke margin default untuk h2 di start-screen */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

/* Penyesuaian margin untuk version-info di dalam start-screen */
.start-screen .version-info {
    font-size: 0.9em;
    color: #bbb;
    margin-top: -5px; /* Sesuaikan agar lebih dekat ke h2 */
    margin-bottom: 20px; /* Jaga jarak dengan subtitle atau elemen berikutnya */
}


.start-screen p {
    font-size: 1.1em;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Gaya untuk label "Pilih Mode Game:" */
.start-screen .mode-game-label {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
}

.start-screen ul {
    list-style: none;
    padding: 0;
    margin-top: 0px;
    margin-bottom: 15px;
    text-align: left;
}

.start-screen ul li::before {
    content: '• ';
    left: 0;
    color: #4CAF50;
}


.start-screen button {
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.4em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-top: 15px;
}

.start-screen button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.how-to-play-button {
    background-color: #008CBA !important;
    margin-top: 10px !important;
    padding: 12px 25px !important;
    font-size: 1.1em !important;
}

.how-to-play-button:hover {
    background-color: #007bb5 !important;
}


.game-options {
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styling untuk radio button mode selection */
.mode-selection {
    margin-bottom: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

/* Styling untuk setiap pasangan radio button + label */
.mode-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mode-selection label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
    text-align: left;
}

.mode-selection input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    top: 2px;
    flex-shrink: 0;
}

.mode-selection input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mode-selection input[type="radio"]:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.5);
}

/* Styling untuk dropdown ukuran dan level */
.grid-size-selection,
.level-selection {
    margin-bottom: 20px;
    flex-direction: column;
    align-items: center;
}

.game-options select {
    padding: 8px 30px 8px 12px;
    border-radius: 5px;
    border: 1px solid #4CAF50;
    background-color: #2a2a2a;
    color: #eee;
    font-size: 1em;
    line-height: 1.2;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23eeeeee%22%20d%3D%22M287%2069.2L146.2%20209.8%205.4%2069.2c-5.3-5.3-5.3-13.8%200-19.1l19.1-19.1c5.3-5.3%2013.8-5.3%2019.1%200L146.2%20171.6l102.8-102.8c5.3-5.3%2013.8-5.3%2019.1%200l19.1%2019.1c5.3%205.3%205.3%2013.8%200%2019.1z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.game-options select:focus {
    outline: none;
    border-color: #8BC34A;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.5);
}

/* KELAS UTAMA UNTUK MENYEMBUNYIKAN ELEMEN */
.hidden {
    display: none !important;
}

/* Skor Akhir di Layar Start */
.exit-final-score {
    font-size: 1.8em;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.food-color {
    color: #FF6347;
    font-weight: bold;
}

.bonus-food-color {
    color: #00BFFF;
    font-weight: bold;
}

/* Gaya dasar untuk tombol-tombol dalam game-info */
.game-button {
    background-color: #555;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.game-button:hover {
    background-color: #777;
}

/* Gaya khusus untuk tombol pause */
.pause-game-button {
    background-color: #00BFFF;
}

.pause-game-button:hover {
    background-color: #008CBA;
}

/* Layar Pause */
.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 25;
    color: #eee;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    display: none;
}

.pause-screen h2 {
    color: #FFD700;
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 3px 3px 7px rgba(0,0,0,0.4);
}

.pause-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.pause-screen button {
    background-color: #00BFFF;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin: 10px;
}

.pause-screen button#quitButton {
    background-color: #FF6347;
}

.pause-screen button:hover {
    background-color: #008CBA;
    transform: translateY(-2px);
}

.pause-screen button#quitButton:hover {
    background-color: #CD5C5C;
}

.exit-game-button {
    background-color: #f44336;
}

.exit-game-button:hover {
    background-color: #d32f2f;
}

/* Modal Konfirmasi Kustom */
.confirm-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 40;
}

.confirm-modal.hidden {
    display: none !important;
}

.confirm-modal .modal-content {
    background-color: #444;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    text-align: center;
    max-width: 400px;
    border: 2px solid #FFD700;
}

.confirm-modal p {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #eee;
}

.confirm-modal .modal-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.confirm-modal .modal-buttons button.confirm-no {
    background-color: #FF6347;
}

.confirm-modal .modal-buttons button:hover {
    transform: translateY(-2px);
}

.confirm-modal .modal-buttons button.confirm-yes:hover {
    background-color: #45a049;
}

.confirm-modal .modal-buttons button.confirm-no:hover {
    background-color: #CD5C5C;
}

/* Modal Level Complete / Game Complete */
.level-complete-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 45;
    display: none;
}

.level-complete-modal.hidden {
    display: none;
}

.level-complete-modal .modal-content {
    background-color: #444;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    text-align: center;
    max-width: 500px;
    border: 2px solid #00BFFF;
}

.level-complete-modal p {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #eee;
    white-space: pre-line;
}

.level-complete-modal .modal-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.level-complete-modal .modal-buttons button#levelExitButton {
    background-color: #FF6347;
}

.level-complete-modal .modal-buttons button:hover {
    transform: translateY(-2px);
}

.level-complete-modal .modal-buttons button.confirm-yes:hover {
    background-color: #45a049;
}

.level-complete-modal .modal-buttons button.confirm-no:hover {
    background-color: #CD5C5C;
}

.stage-mode-info-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.stage-mode-info-modal.hidden {
    display: none !important;
}

.stage-mode-info-modal .modal-content {
    background-color: #444;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    text-align: center;
    max-width: 500px;
    border: 2px solid #FFD700;
}

.stage-mode-info-modal h2 {
    color: #4CAF50;
    font-size: 2.2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.stage-mode-info-modal p {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #eee;
    line-height: 1.6;
}

.stage-mode-info-modal p strong {
    color: #FFD700;
}

.stage-mode-info-modal .modal-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.4em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-top: 20px;
}

.stage-mode-info-modal .modal-buttons button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Gaya untuk modal Classic Info */
.classic-mode-info-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.classic-mode-info-modal.hidden {
    display: none !important;
}

.classic-mode-info-modal .modal-content {
    background-color: #444;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    text-align: center;
    max-width: 500px;
    border: 2px solid #00BFFF;
}

.classic-mode-info-modal h2 {
    color: #FFD700;
    font-size: 2.2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.classic-mode-info-modal p {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #eee;
    line-height: 1.6;
}

.classic-mode-info-modal p strong {
    color: #4CAF50;
}

.classic-mode-info-modal .modal-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.4em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-top: 20px;
}

.classic-mode-info-modal .modal-buttons button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}


/* Gaya untuk modal Cara Bermain */
.how-to-play-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60;
}

.how-to-play-modal.hidden {
    display: none !important;
}

.how-to-play-modal .modal-content {
    background-color: #444;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    text-align: center;
    max-width: 550px;
    border: 2px solid #00BFFF;
}

.how-to-play-modal h2 {
    color: #FFD700;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.how-to-play-modal p {
    font-size: 1.1em;
    margin-bottom: 0px; /* Diubah menjadi 0px */
    color: #eee;
    line-height: 1.6;
    text-align: left;
}

.how-to-play-modal p strong {
    color: #4CAF50;
}

.how-to-play-modal ul {
    list-style: none;
    padding: 0;
    margin-top: 0px; /* Diubah menjadi 0px */
    margin-bottom: 10px;
    text-align: left;
}

.how-to-play-modal ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 8px;
    font-size: 1.05em;
    color: #ccc;
}

.how-to-play-modal ul li::before {
    font-size: 1em;
    top: 0.12em;
}

.how-to-play-modal .modal-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.4em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-top: 20px;
}

.how-to-play-modal .modal-buttons button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}


/* Game Over Screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-over-screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 35;
    display: flex !important;
}

.game-over-screen h2 {
    color: #FF6347;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 3px 3px 7px rgba(0,0,0,0.4);
}

.game-over-screen p {
    font-size: 1.8em;
    color: #eee;
    margin-bottom: 20px;
    white-space: pre-line;
}

.game-over-screen button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-top: 15px;
}

.game-over-screen button#backToMenuButton {
    background-color: #607D8B;
}

.game-over-screen button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.game-over-screen button#backToMenuButton:hover {
    background-color: #455A64;
}

/* Gaya baru untuk footer */
.game-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9em;
    color: #aaa;
    display: flex;
    flex-direction: column; /* Tetap kolom untuk p copyright di atas dan elemen di bawahnya */
    align-items: center;
    gap: 10px; /* Jarak antara teks copyright dan ikon sosial, serta ikon sosial dan link log */
    width: 100%;
}

.game-footer p {
    margin: 0;
    font-size: 1em;
}

/* Grup baru untuk ikon sosial dan link log -> dihapus karena tidak lagi diperlukan */
/* .social-links-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
} */

.game-footer .social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    /* margin-top: 5px; -> tidak diperlukan lagi karena diatur oleh gap di .game-footer */
}

.game-footer .instagram-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    transition: transform 0.2s ease;
}

.game-footer .instagram-icon:hover {
    transform: scale(1.1);
}

/* Gaya untuk link Log Perubahan */
.footer-link {
    color: #00BFFF;
    text-decoration: none;
    font-size: 0.95em;
    margin-top: 0px; /* Diatur oleh gap di .game-footer, tapi bisa override jika perlu */
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #63d6ff;
    text-decoration: underline;
}

/* Gaya untuk modal Log Perubahan */
.log-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 70; /* Lebih tinggi dari modal lainnya */
}

.log-modal.hidden {
    display: none !important;
}

.log-modal .modal-content {
    background-color: #444;
    padding: 20px; /* Mengurangi padding untuk mengecilkan modal */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    text-align: left; /* Teks rata kiri di dalam modal log */
    max-width: 500px; /* Mengurangi lebar maksimum untuk mengecilkan modal */
    max-height: 70vh; /* Mengurangi tinggi maksimum dan aktifkan scroll */
    overflow-y: hidden; /* **Diubah menjadi hidden** agar scrollbar dikontrol oleh log-content */
    display: flex; /* Tambahkan flexbox */
    flex-direction: column; /* Konten dalam kolom */
    border: 2px solid #00BFFF;
    color: #eee;
}

/* Bagian konten yang akan di-scroll */
.log-modal .log-content {
    flex-grow: 1; /* Konten akan mengisi ruang yang tersedia dan di-scroll */
    overflow-y: auto; /* Aktifkan scrollbar di sini */
    padding-right: 15px; /* Memberi ruang untuk scrollbar agar tidak menimpa teks */
    box-sizing: border-box; /* Pastikan padding dihitung dalam lebar elemen */
}


.log-modal h2 {
    color: #4CAF50; /* Diubah menjadi hijau seperti judul utama */
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center; /* Judul modal tetap di tengah */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.log-modal h3 {
    color: #FFFFFF; /* Diubah menjadi putih */
    font-size: 1.3em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.log-modal p, .log-modal li {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 5px;
}

.log-modal ul {
    list-style: disc; /* Menggunakan bullet point standar */
    margin-left: 20px;
    padding-left: 0;
    margin-bottom: 15px;
}

.log-modal ul ul { /* Untuk sub-list */
    list-style: circle;
    margin-left: 20px;
}

.log-modal .modal-buttons {
    text-align: center; /* Tombol di tengah */
    margin-top: 20px;
    flex-shrink: 0; /* Pastikan tombol tidak menyusut saat konten di-scroll */
    padding-top: 10px; /* Tambahkan padding agar tombol tidak terlalu mepet dengan scrollbar */
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Garis pemisah opsional */
}

.log-modal .modal-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.log-modal .modal-buttons button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}


/* --- MOBILE RESPONSIVENESS (max-width 768px) --- */
@media screen and (max-width: 768px) {
    /* Penyesuaian Global untuk Skala Mobile */
    html {
        -webkit-text-size-adjust: 100%; /* Mencegah auto-zoom teks di iOS Safari */
        text-size-adjust: 100%;
        width: 100%;
        overflow-x: hidden; /* Mencegah scroll horizontal */
    }

    body {
        min-height: 100vh;
        display: block;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .game-container {
        width: 100vw; /* Mengisi lebar viewport penuh */
        /* height: auto; */
        min-height: 100vh; /* Memastikan game-container mengisi seluruh tinggi viewport */
        padding: 15px 10px;
        border-radius: 0;
        box-shadow: none;
        align-items: center;
        justify-content: flex-start;
        /* Tambahkan max-width untuk konsistensi di layar yang sangat lebar dalam mode mobile */
        max-width: 450px; /* Contoh: Batasi lebar maksimum mobile container */
        margin-left: auto;
        margin-right: auto;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 20px; /* Kembali ke margin default untuk h1 di luar start-screen */
    }

    /* version-info di mobile tetap berada di dalam start-screen */
    .version-info {
        font-size: 0.8em;
        /* margin-bottom: 15px; -> Ini sudah ditimpa oleh .start-screen .version-info */
    }

    .level-info-top {
        font-size: 1.2em;
        margin-top: -5px;
        margin-bottom: 10px;
    }

    canvas {
        width: 95vw; /* Lebar kanvas proporsional dengan viewport */
        height: 95vw; /* Menjaga rasio aspek persegi */
        max-width: 400px; /* Batasi ukuran maksimum agar tidak terlalu besar di tablet kecil */
        max-height: 400px;
        margin: 10px auto;
        border-width: 2px;
    }

    .game-info {
        width: 95%;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin-top: 10px;
        font-size: 0.9em;
    }

    .score-display,
    .speed-display,
    .target-score-info {
        font-size: 1.2em;
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }

    .score-and-target {
        align-items: center;
        max-width: none;
        width: 100%;
        margin-bottom: 10px;
    }

    .button-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-top: 10px;
        flex-basis: 100%;
        max-width: none;
    }

    /* Penyesuaian khusus untuk tombol Pause dan Exit di mode mobile */
    .game-info .pause-game-button {
        padding: 12px 25px;
        font-size: 1.2em;
        margin-bottom: 15px;
        margin-right: 0;
        margin-left: 0;
    }

    .game-info .exit-game-button {
        padding: 12px 25px;
        font-size: 1.2em;
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
    }

    /* Start Screen Mobile Adjustments */
    .start-screen {
        padding: 15px;
        align-items: center;
        /* Hapus padding-top dan justify-content: flex-start; untuk membiarkan justify-content: center yang default */
        /* justify-content: flex-start; */
        /* padding-top: 5vh; */
        justify-content: center; /* Kembali ke tengah vertikal */
    }

    .start-screen h2 {
        font-size: 2em;
        margin-bottom: 10px; /* Sesuaikan margin-bottom h2 untuk mobile */
    }

    .start-screen .subtitle {
        font-size: 1em;
        margin-bottom: 30px;
    }

    .start-screen .mode-game-label {
        font-size: 1em;
    }

    .start-screen .mode-selection {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    .start-screen button {
        padding: 12px 25px;
        font-size: 1.2em;
    }

    .how-to-play-button {
        padding: 10px 20px !important;
        font-size: 1em !important;
    }

    /* Modals Mobile Adjustments */
    .how-to-play-modal .modal-content,
    .stage-mode-info-modal .modal-content,
    .classic-mode-info-modal .modal-content,
    .confirm-modal .modal-content,
    .level-complete-modal .modal-content,
    .log-modal .modal-content { /* Tambahkan .log-modal */
        max-width: 90vw;
        padding: 20px;
        margin: 15px;
        box-sizing: border-box;
    }

    .how-to-play-modal h2,
    .stage-mode-info-modal h2,
    .classic-mode-info-modal h2,
    .pause-screen h2,
    .game-over-screen h2,
    .log-modal h2 { /* Tambahkan .log-modal */
        font-size: 2em;
        margin-bottom: 15px;
    }

    .how-to-play-modal p,
    .stage-mode-info-modal p,
    .classic-mode-info-modal p,
    .pause-screen p,
    .game-over-screen p,
    .confirm-modal p,
    .level-complete-modal p,
    .log-modal p, .log-modal li { /* Tambahkan .log-modal */
        font-size: 1em;
        line-height: 1.5;
    }

    .how-to-play-modal ul li {
        font-size: 0.95em;
        padding-left: 20px;
        margin-bottom: 6px;
    }

    .how-to-play-modal ul li::before {
        font-size: 1em;
        top: 0.12em;
    }

    .how-to-play-modal .modal-buttons button,
    .stage-mode-info-modal .modal-buttons button,
    .classic-mode-info-modal .modal-buttons button,
    .pause-screen button,
    .game-over-screen button,
    .confirm-modal .modal-buttons button,
    .level-complete-modal .modal-buttons button,
    .log-modal .modal-buttons button { /* Tambahkan .log-modal */
        padding: 10px 20px;
        font-size: 1.1em;
        margin: 8px;
    }

    .game-over-screen p {
        font-size: 1.4em;
    }

    /* Gaya baru untuk notifikasi desktop experience */
    .desktop-notification {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.95);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 100; /* Pastikan di atas semua elemen lain */
    }

    .desktop-notification.hidden {
        display: none !important;
    }

    .desktop-notification .modal-content {
        background-color: #444;
        padding: 30px;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0,0,0,0.8);
        text-align: center;
        max-width: 90vw; /* Lebar responsif */
        border: 2px solid #FFD700;
        color: #eee;
    }

    .desktop-notification h2 {
        color: #FFD700;
        font-size: 1.8em; /* Ukuran font judul */
        margin-bottom: 15px;
        text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    }

    .desktop-notification p {
        font-size: 1em; /* Ukuran font paragraf */
        margin-bottom: 20px;
        line-height: 1.5;
    }

    .desktop-notification .modal-buttons button {
        background-color: #4CAF50;
        color: white;
        padding: 12px 25px;
        border: none;
        border-radius: 8px;
        font-size: 1.1em; /* Ukuran font tombol */
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        margin-top: 10px;
    }

    .desktop-notification .modal-buttons button:hover {
        background-color: #45a049;
        transform: translateY(-2px);
    }
}

/* Hanya sembunyikan notifikasi desktop secara default di desktop */
@media screen and (min-width: 769px) {
    .desktop-notification {
        display: none !important;
    }
}