.latte-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 20px;
    min-height: 100vh;
    background-color: #fcfaf7;
    color: #4a3a34;
    font-family: 'Noto Serif JP', serif;
}

.latte-header {
    text-align: center;
    margin-bottom: 50px;
}

.latte-header h1 {
    font-size: 2.5rem;
    color: #2c1a14;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.latte-header p {
    font-size: 0.9rem;
    color: #8b736b;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.latte-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.instruction-text {
    text-align: center;
    line-height: 1.8;
    color: #6d5d58;
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 20px;
}

.latte-interaction-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.cup-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    overflow: hidden;
}

.base-cup {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#latte-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    cursor: crosshair;
}

.result-art {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    /* Masking to fit inside the cup rim */
    -webkit-mask-image: radial-gradient(circle, black 65%, transparent 70%);
    mask-image: radial-gradient(circle, black 65%, transparent 70%);
    /* Better blending with the coffee underneath */
    mix-blend-mode: screen;
}

.diagnose-btn {
    margin-top: 30px;
    background: #a67c52;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    box-shadow: 0 4px 15px rgba(166, 124, 82, 0.3);
}

.diagnose-btn.active {
    opacity: 1;
    background: #06C755; /* Stable green or gold? Let's use a nice resonance color */
    transform: scale(1.05);
}

.diagnose-btn.active:hover {
    background: #05a647;
    transform: scale(1.1);
}

.cup-wrapper.resonating {
    animation: cupResonance 0.5s infinite;
}

@keyframes cupResonance {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.02); filter: brightness(1.2) contrast(1.1); }
    100% { transform: scale(1); filter: brightness(1); }
}

.diagnosis-result {
    width: 100%;
    max-width: 600px;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.diagnosis-result.show {
    opacity: 1;
    transform: translateY(0);
}

.diagnosis-result h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #2c1a14;
}

.result-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: bold;
    color: #a67c52;
}

.fortune-message {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 30px;
}

.cookie-suggestion {
    margin: 30px 0;
    padding: 20px;
    background: #fff9f0;
    border: 1px dashed #e6c8a8;
    border-radius: 10px;
    animation: fadeIn 1s ease-out;
}

.suggestion-text {
    font-size: 0.95rem;
    color: #8b736b;
    margin-bottom: 15px;
    line-height: 1.6;
}

.cookie-btn {
    display: inline-block;
    background: #d97706; /* Cookie orange-brown */
    color: white;
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background 0.3s, transform 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

.cookie-btn:hover {
    background: #b45309;
    transform: translateY(-2px);
}

.result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reset-btn {
    background: #2c1a14;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s;
}

.reset-btn:hover {
    background: #4a3a34;
}

.scientific-context {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #e5e0d8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.scientific-context h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.scientific-context p {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.6;
    text-align: justify;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .cup-wrapper {
        width: 300px;
        height: 300px;
    }
    #latte-canvas {
        width: 300px;
        height: 300px;
    }
}
