* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background with Rice Field Pattern */
body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0,50 Q25,30 50,50 T100,50" stroke="rgba(255,255,255,0.1)" fill="none" stroke-width="2"/><path d="M0,60 Q25,40 50,60 T100,60" stroke="rgba(255,255,255,0.1)" fill="none" stroke-width="2"/><path d="M0,70 Q25,50 50,70 T100,70" stroke="rgba(255,255,255,0.1)" fill="none" stroke-width="2"/><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="50" r="3" fill="rgba(255,255,255,0.15)"/></svg>');
    animation: float 20s infinite linear;
    z-index: -1;
}

@keyframes float {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff4757, #ff6348);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.close-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.5);
}

/* Sound Control Button */
.sound-control {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff6348, #ff7675);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 99, 72, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-control:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 99, 72, 0.5);
}

.sound-control.muted {
    background: linear-gradient(135deg, #636e72, #95a5a6);
}

/* Start Screen */
.start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    padding: 20px;
}

.title-container {
    text-align: center;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

.main-title {
    font-size: 3.5rem;
    color: white;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.5);
    }

    50% {
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.8);
    }
}

.subtitle {
    font-size: 1.8rem;
    color: #ffeaa7;
    margin-bottom: 40px;
}

.start-btn {
    background: linear-gradient(135deg, #ff6348, #ff7675);
    color: white;
    border: none;
    padding: 20px 60px;
    font-size: 1.8rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 118, 117, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.start-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 118, 117, 0.5);
}

/* Balinese Decorative Elements */
.balinese-border {
    position: absolute;
    width: 100%;
    height: 40px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0,10 Q5,0 10,10 T20,10 T30,10 T40,10 T50,10 T60,10 T70,10 T80,10 T90,10 T100,10" stroke="rgba(255,255,255,0.3)" fill="none" stroke-width="2"/></svg>');
    background-repeat: repeat-x;
}

.balinese-border-top {
    top: 0;
}

.balinese-border-bottom {
    bottom: 0;
    transform: rotate(180deg);
}

/* Quiz Container */
.quiz-container {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.quiz-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    margin: 50px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, #ff7e5f, #feb47b, #ff7e5f);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-header {
    background: linear-gradient(135deg, #ff6348, #ff7675);
    color: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.question-text {
    font-size: 1.5rem;
    line-height: 1.6;
}

.progress-container {
    margin-bottom: 20px;
}

.progress {
    height: 30px;
    border-radius: 15px;
    background: #e0e0e0;
    overflow: visible;
}

.progress-bar {
    background: linear-gradient(90deg, #ff6348, #ff7675);
    border-radius: 15px;
    position: relative;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 30px;
    color: #2c3e50;
    font-weight: bold;
}

.image-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin: 30px 0 40px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
    border-radius: 0 0 20px 20px;
}

.quiz-image {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 15px;
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.placeholder-image {
    height: 450px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #636e72;
}

.answer-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.answer-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.5s ease;
}

.answer-btn:hover::before {
    left: 100%;
}

.btn-benar {
    background: linear-gradient(135deg, #01cf12, #229df0);
    color: white;
}

.btn-benar:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 99, 72, 0.4);
}

.btn-salah {
    background: linear-gradient(135deg, #ff7675, #fd79a8);
    color: white;
}

.btn-salah:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 118, 117, 0.4);
}

/* Custom Modal Styles */
.modal-content {
    border: none;
    border-radius: 25px;
    overflow: hidden;
}

.modal-header {
    border: none;
    padding: 30px;
}

.modal-body {
    padding: 20px 30px 30px;
    text-align: center;
}

.modal-success {
    background: linear-gradient(135deg, #01cf12, #229df0);
}

.modal-error {
    background: linear-gradient(135deg, #ff7675, #fd79a8);
}

.modal-success .modal-header,
.modal-success .modal-body {
    color: white;
}

.modal-error .modal-header,
.modal-error .modal-body {
    color: white;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: iconBounce 0.5s ease-out;
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.result-text {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Completion Screen */
.completion-screen {
    display: none;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.trophy-icon {
    font-size: 8rem;
    color: #ff6348;
    animation: rotate 2s linear infinite;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 99, 72, 0.5);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.completion-title {
    color: white;
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}

.score-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px 50px;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.score-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
}

.score-text {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
    color: #ff6348;
}

.restart-btn {
    background: linear-gradient(135deg, #ff6348, #ff7675);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 99, 72, 0.4);
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 99, 72, 0.5);
}

/* Rice Field Decorations */
.rice-decoration {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0,20 Q5,10 10,20 T20,20 T30,20 T40,20 T50,20 T60,20 T70,20 T80,20 T90,20 T100,20" stroke="rgba(255,255,255,0.3)" fill="none" stroke-width="2"/><path d="M0,15 Q5,5 10,15 T20,15 T30,15 T40,15 T50,15 T60,15 T70,15 T80,15 T90,15 T100,15" stroke="rgba(255,255,255,0.2)" fill="none" stroke-width="2"/></svg>');
    background-repeat: repeat-x;
    z-index: -1;
}

/* Balinese Icon */
.balinese-icon {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
}

.icon-1 {
    top: 10%;
    left: 5%;
    transform: rotate(-15deg);
}

.icon-2 {
    top: 15%;
    right: 10%;
    transform: rotate(10deg);
}

.icon-3 {
    bottom: 20%;
    left: 8%;
    transform: rotate(5deg);
}

.icon-4 {
    bottom: 25%;
    right: 7%;
    transform: rotate(-10deg);
}

/* Sound Indicator */
.sound-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #2c3e50;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.sound-indicator.show {
    opacity: 1;
}

.sound-indicator i {
    font-size: 1.2rem;
}

/* ----- MEDIA QUERIES FOR RESPONSIVENESS ----- */

/* Untuk Tablet (lebar layar <= 768px) */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.8rem;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    .start-btn {
        padding: 15px 40px;
        font-size: 1.5rem;
    }

    .quiz-card {
        padding: 25px;
        margin-top: 20px;
    }

    .question-text {
        font-size: 1.3rem;
    }

    .answer-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .answer-btn {
        width: 80%;
    }

    .completion-title {
        font-size: 2.5rem;
    }

    .score-text {
        font-size: 1.5rem;
    }

    .score-number {
        font-size: 2.5rem;
    }
}

/* Untuk Ponsel (lebar layar <= 576px) */
@media (max-width: 576px) {
    .main-title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .start-btn {
        padding: 12px 30px;
        font-size: 1.2rem;
    }

    .quiz-card {
        padding: 15px;
    }

    .question-header {
        padding: 15px;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .answer-btn {
        font-size: 1rem;
        padding: 12px 25px;
        width: 90%;
    }

    .trophy-icon {
        font-size: 6rem;
    }

    .completion-title {
        font-size: 2rem;
    }

    .score-display {
        padding: 20px 30px;
    }

    .score-text {
        font-size: 1.2rem;
    }

    .score-number {
        font-size: 2rem;
    }

    .restart-btn {
        padding: 12px 30px;
        font-size: 1.2rem;
    }
}