body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 800px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    color: #d9534f; /* A reddish tone, inspired by the Japanese flag's sun */
    text-align: center;
    margin-bottom: 20px;
}

.onigiri-display {
    text-align: center;
    margin-bottom: 20px;
    position: relative; /* Crucial for positioning mini onigiris */
    overflow: visible; /* Ensures mini onigiris are not clipped if they jump slightly outside bounds */
}

#onigiri-image {
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    border: 3px solid #5cb85c; /* Green like nori */
    cursor: pointer;
    transition: transform 0.3s ease;
}

#onigiri-image:hover {
    transform: scale(1.1) rotate(5deg);
}

#read-aloud-button {
    display: block;
    margin: 15px auto 20px auto; /* Added bottom margin */
    padding: 10px 20px;
    font-size: 1em;
    color: white;
    background-color: #5cb85c; /* Green, like other interactive elements */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#read-aloud-button:hover {
    background-color: #4cae4c; /* Darker green */
}

#read-aloud-button.speaking {
    background-color: #d9534f; /* Reddish, like main H1 or a 'stop' button */
}

#read-aloud-button.speaking:hover {
    background-color: #c9302c; /* Darker red */
}

.mini-onigiri {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('/IMG_1196.webp');
    background-size: contain;
    background-repeat: no-repeat;
    /* Start centered on their 'left'/'top' point, and invisible/small */
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    
    animation-name: jumpAndSpread;
    animation-duration: 1.2s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards; /* Stay at the end state (invisible) until removed */
    will-change: transform, opacity; /* Performance hint for browsers */
    pointer-events: none; /* So they don't interfere with mouse events */
    z-index: 10; /* Appear above other elements in the display div */
}

@keyframes jumpAndSpread {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0.0;
    }
    10% { /* Pop into existence */
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { /* Mid-point: peak of jump, slight enlargement */
        transform: translate(calc(-50% + var(--end-x) / 2), calc(-50% - 70px + var(--end-y) / 2)) scale(1.1) rotate(calc(var(--rotation) / 2));
        opacity: 0.9;
    }
    100% { /* End-point: landed, smaller, faded out */
        transform: translate(calc(-50% + var(--end-x)), calc(-50% + var(--end-y))) scale(0.3) rotate(var(--rotation));
        opacity: 0.0;
    }
}

.info-section h2 {
    color: #5cb85c; /* Green for headings, like nori */
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-top: 20px;
}

.info-section ul {
    list-style-type: disc;
    padding-left: 20px;
}

.info-section ul li {
    margin-bottom: 8px;
}

.origin-section {
    margin-top: 30px;
    padding: 15px;
    background-color: #e7f3fe; /* Light blue, contrasting */
    border-radius: 5px;
    text-align: center;
    border: 1px solid #bce8f1;
}

#japan-flag {
    width: 60px;
    height: auto;
    vertical-align: middle;
    margin-right: 10px;
    border: 1px solid #ccc;
}

.origin-section p {
    display: inline;
    font-style: italic;
    color: #31708f; /* Darker blue for text */
}

/* Basic responsive design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 1.8em;
    }
    #onigiri-image {
        max-width: 150px;
    }
}