/* com_dc360wordcloud front-end styling — mind-map game + both results tables. */

.dcwc {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
    font-family: inherit;
    color: #1f2933;
}

.dcwc-title {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
}

.dcwc-task {
    margin: 0 0 0.75rem;
    color: #52606d;
}

.dcwc-guest-note {
    background: #fff8e1;
    border: 1px solid #f0d78c;
    color: #7a5b00;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    margin: 0 0 1rem;
}

.d-none {
    display: none !important;
}

/* -------------------- Badges -------------------- */
.dcwc-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dcwc-category-badge,
.dcwc-streak-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.dcwc-category-badge {
    background: #e3f2fd;
    color: #0d47a1;
}

.dcwc-streak-badge {
    background: #fff3e0;
    color: #b45309;
}

/* -------------------- Layout -------------------- */
.dcwc-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.dcwc-mindmap-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    flex: 1 1 320px;
    margin: 0 auto;
}

.dcwc-connectors {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.dcwc-connector {
    stroke: #cbd2d9;
    stroke-width: 3;
    stroke-linecap: round;
}

.dcwc-connector.is-solved {
    stroke: #34a853;
}

/* -------------------- Hub -------------------- */
.dcwc-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 14px rgba(13, 71, 161, 0.35);
    z-index: 2;
}

.dcwc-hub-blanks {
    font-size: clamp(0.75rem, 3.2vw, 1.15rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0 0.4rem;
    word-break: break-all;
}

.dcwc-hub.is-won .dcwc-hub-blanks,
.dcwc-hub.is-lost .dcwc-hub-blanks {
    letter-spacing: 0.04em;
}

.dcwc-hub.is-won {
    background: linear-gradient(135deg, #34a853, #0f7b34);
}

.dcwc-hub.is-lost {
    background: linear-gradient(135deg, #6b7280, #374151);
}

/* -------------------- Clue nodes -------------------- */
.dcwc-node {
    position: absolute;
    width: 22%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 3px dashed #9aa5b1;
    background: #fff;
    color: #1f2933;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 2;
    padding: 0.2rem;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.dcwc-node:hover:not(.is-solved) {
    border-color: #1a73e8;
    transform: translate(-50%, -50%) scale(1.05);
}

.dcwc-node.is-active {
    border-color: #1a73e8;
    border-style: solid;
}

.dcwc-node.is-solved {
    border-style: solid;
    border-color: #34a853;
    background: #e6f4ea;
    cursor: default;
}

.dcwc-node-index {
    font-size: 0.7rem;
    color: #7b8794;
    line-height: 1;
}

.dcwc-node.is-solved .dcwc-node-index {
    display: none;
}

.dcwc-node-word {
    font-size: clamp(0.55rem, 2.4vw, 0.8rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.05;
    word-break: break-word;
}

.dcwc-node-1 { top: 10%;    left: 50%; }
.dcwc-node-2 { top: 30%;    left: 84.64%; }
.dcwc-node-3 { top: 70%;    left: 84.64%; }
.dcwc-node-4 { top: 90%;    left: 50%; }
.dcwc-node-5 { top: 70%;    left: 15.36%; }
.dcwc-node-6 { top: 30%;    left: 15.36%; }

/* -------------------- Side column / panels -------------------- */
.dcwc-side-col {
    flex: 1 1 280px;
    min-width: 260px;
}

.dcwc-panel {
    background: #f8fafc;
    border: 1px solid #e4e9ef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.dcwc-panel-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.dcwc-clue-text {
    margin: 0 0 0.75rem;
    color: #334155;
}

.dcwc-guess-form {
    display: flex;
    gap: 0.5rem;
}

.dcwc-input {
    flex: 1 1 auto;
    padding: 0.5rem 0.65rem;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    font-size: 1rem;
}

.dcwc-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.dcwc-btn-primary {
    background: #1a73e8;
    color: #fff;
}

.dcwc-btn-primary:hover {
    background: #0d5bc4;
}

.dcwc-btn-secondary {
    background: #e4e9ef;
    color: #1f2933;
}

.dcwc-link-btn {
    background: none;
    border: none;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.5rem 0 0;
}

.dcwc-feedback {
    margin: 0.5rem 0 0;
    min-height: 1.2em;
    font-weight: 600;
}

.dcwc-feedback.is-correct {
    color: #0f7b34;
}

.dcwc-feedback.is-incorrect {
    color: #b91c1c;
}

.dcwc-guesses-left {
    margin: 0 0 0.5rem;
    color: #52606d;
    font-size: 0.9rem;
}

.dcwc-guess-history {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dcwc-guess-history li {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 600;
}

.dcwc-guess-history li.is-correct {
    background: #dcfce7;
    color: #166534;
}

.dcwc-result-text {
    margin: 0 0 0.4rem;
}

.dcwc-result-streak {
    font-weight: 600;
    color: #b45309;
}

.dcwc-come-back {
    color: #52606d;
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

.dcwc-save-status {
    color: #52606d;
    font-size: 0.85rem;
    min-height: 1.2em;
}

/* -------------------- Results tables (site + admin share this look) -------------------- */
.dcwc-results-table-wrap {
    overflow-x: auto;
}

.dcwc-results-table {
    width: 100%;
    border-collapse: collapse;
}

.dcwc-results-table th,
.dcwc-results-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e4e9ef;
    text-align: left;
}

.dcwc-results-table th {
    background: #f8fafc;
    font-weight: 700;
}

@media (max-width: 640px) {
    .dcwc-layout {
        flex-direction: column;
    }

    .dcwc-mindmap-wrap {
        max-width: 360px;
    }
}
