/* Escopo restrito ao laboratório: não altera o artigo nem outros jogos. */
#spark-game {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
    max-width: 100%;
    margin-block: 1.5rem;
    padding: clamp(0.75rem, 3vw, 1.5rem);
    border: 2px solid #0647a8;
    border-radius: 1rem;
    background: #eaf3ff;
    color: #101828;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

#spark-game *,
#spark-game *::before,
#spark-game *::after {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

#spark-game > p,
#spark-game > ol,
#spark-game > div {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
}

#spark-game #sp-status {
    padding: 0.85rem;
    border-left: 4px solid #0647a8;
    border-radius: 0.35rem;
    background: #ffffff;
    color: #042b66;
    font-weight: 600;
}

#spark-game #sp-progress,
#spark-game #sp-score {
    color: #042b66;
    font-weight: 700;
}

#spark-game #sp-plan {
    padding: 0 0 0 1.65rem;
    color: #042b66;
}

#spark-game #sp-plan:empty {
    padding: 0;
}

#spark-game #sp-plan li {
    margin-block: 0.4rem;
    padding: 0.6rem;
    border: 1px solid #a9c6ec;
    border-radius: 0.4rem;
    background: #ffffff;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.95em;
    white-space: normal;
    overflow-wrap: anywhere;
}

#spark-game #sp-plan li[aria-current="step"] {
    border-color: #0647a8;
    border-left-width: 4px;
    font-weight: 700;
}

#spark-game #sp-result:empty {
    display: none;
}

#spark-game #sp-result:not(:empty) {
    padding: 1rem;
    border: 2px solid #0647a8;
    border-radius: 0.65rem;
    background: #ffffff;
}

#spark-game #sp-result h3 {
    margin: 0 0 0.6rem;
    color: #042b66;
    font-size: 1.15em;
    line-height: 1.4;
}

#spark-game #sp-result ul {
    margin: 0;
    padding-left: 1.4rem;
}

#spark-game #sp-result p {
    margin: 0.65rem 0 0;
}

#spark-game #sp-result ul + p {
    color: #042b66;
    font-weight: 800;
}

#spark-game button {
    flex: 1 1 12rem;
    min-height: 48px;
    height: auto;
    padding: 0.75rem 1rem;
    border: 2px solid #0647a8;
    border-radius: 0.5rem;
    background: #0647a8;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    touch-action: manipulation;
}

#spark-game button:hover {
    background: #042b66;
    border-color: #042b66;
}

#spark-game button[aria-disabled="true"] {
    border-style: dashed;
    background: #ffffff;
    color: #344054;
    cursor: help;
}

#spark-game button[aria-pressed="true"] {
    border: 3px solid #042b66;
    background: #d8e8ff;
    color: #042b66;
}

#spark-game #sp-reset {
    flex-basis: 100%;
    background: #ffffff;
    color: #0647a8;
}

#spark-game button:focus-visible,
#spark-game #sp-result:focus {
    outline: 3px solid #042b66;
    outline-offset: 3px;
}

#spark-game [hidden] {
    display: none !important;
}

@media (max-width: 400px) {
    #spark-game button {
        flex-basis: 100%;
    }
}

@media (forced-colors: active) {
    #spark-game button[aria-pressed="true"],
    #spark-game #sp-plan li[aria-current="step"] {
        border: 3px solid Highlight;
    }
}
