.word-cloud-section {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Let the page layout decide height; keep small breathing room. */
    padding: 20px 0;
}

/* On the home page, the main layout already centers vertically. */
.page-index .word-cloud-section {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-index .word-cloud-container {
    width: min(800px, 100%);
    flex-direction: column;
    align-items: center;
}

.word-cloud-container {
    display: flex;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    justify-content: center;
    /*
    background: white;
    border-radius: 12px;
    */
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /*
    margin: 0 auto;
    text-align: center;
    */
}

.word-cloud-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

.processed-counter {
    margin-top: 18px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    color: #334155;
}

.processed-counter__num {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.processed-counter__label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
}

.word {
    display: inline-block;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    user-select: none;
}

.word:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Color variations */
.word:nth-child(5n+1) { color: #3b82f6; }
.word:nth-child(5n+2) { color: #10b981; }
.word:nth-child(5n+3) { color: #f59e0b; }
.word:nth-child(5n+4) { color: #ef4444; }
.word:nth-child(5n+5) { color: #8b5cf6; }

/* Size classes based on weight */
.size-1 { font-size: 0.7rem; }
.size-2 { font-size: 0.8rem; }
.size-3 { font-size: 1rem; }
.size-4 { font-size: 1.2rem; }
.size-5 { font-size: 1.5rem; }
.size-6 { font-size: 1.8rem; }
.size-7 { font-size: 2.2rem; }
.size-8 { font-size: 2.6rem; }
.size-9 { font-size: 3rem; }
.size-10 { font-size: 3.4rem; }

@media (max-width: 640px) {
    .word-cloud-container {
        padding: 20px;
    }

    .word-cloud-title {
        font-size: 1.2rem;
    }

    /* Reduce sizes on mobile */
    .size-1 { font-size: 0.6rem; }
    .size-2 { font-size: 0.7rem; }
    .size-3 { font-size: 0.8rem; }
    .size-4 { font-size: 0.9rem; }
    .size-5 { font-size: 1rem; }
    .size-6 { font-size: 1.2rem; }
    .size-7 { font-size: 1.5rem; }
    .size-8 { font-size: 1.8rem; }
    .size-9 { font-size: 2.2rem; }
    .size-10 { font-size: 2.6rem; }
}
