/* The mastery report (/dashboard/mastery/). Kept out of style.css because
   nothing else uses it. The markup is views/mastery.pug for the page's own
   parts and mastery-lib/admin/report.js for the rows it draws, so the class
   names below are shared with that script. Colours come from the site's own
   variables, so dark mode follows for free; the five stages keep their own. */

#mastery {
    --none: #8d877c;
    --learning: #c2701b;
    --practicing: #9a8a1c;
    --mastered: #2f8a4b;
    --review: #3b6fb3;
}

.dark #mastery {
    --none: #b9b3a8;
    --learning: #e8993f;
    --practicing: #d9c64a;
    --mastered: #5fc27c;
    --review: #7aa6e0;
}

#mastery .mastery-back {
    margin: 0 0 0.25em;
    font-size: 0.9em;
}

#mastery .mastery-sub {
    color: var(--text-color-sub);
}

/* The controls, as one card like the dashboard's account card. */
#mastery .mastery-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6em 1em;
    margin: 0.75em 0;
    padding: 0.75em 1em;
    border: 0.125em solid var(--text-color);
    border-radius: 1em;
    background: var(--help-background);
    color: var(--text-color);
}

#mastery select {
    font: inherit;
    padding: 0.25em 0.5em;
    border: 0.0625em solid var(--border-color);
    border-radius: 0.5em;
}

#mastery .mastery-button {
    min-height: 2.4em;
    padding: 0.4em 1em;
    border: 0.0625em solid var(--border-color);
    border-radius: 0.6em;
    background: var(--button-background);
    color: var(--button-text-color);
    font: inherit;
    font-weight: bold;
}

#mastery .mastery-button:hover {
    background: var(--button-background-hover);
}

#mastery .mastery-danger {
    color: #b3261e;
}

#mastery .mastery-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1em;
}

/* Small pills: stage counts, standards codes, games. */
#mastery .chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.1em 0.6em;
    border: 0.0625em solid var(--border-color);
    border-radius: 999px;
    background: var(--help-background);
    color: var(--text-color);
    font-size: 0.85em;
    white-space: nowrap;
}

#mastery a.chip.play {
    border-color: var(--c, var(--border-color));
    font-weight: bold;
    text-decoration: none;
}

#mastery a.chip.play:hover {
    background: var(--button-background-hover);
}

#mastery .dot {
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    background: var(--c);
}

/* A skill: a card, with its stage's colour for the meter. */
#mastery .row {
    margin-bottom: 0.5em;
    padding: 0.6em 1em;
    border: 0.125em solid var(--text-color);
    border-radius: 1em;
    background: var(--help-background);
    color: var(--text-color);
}

#mastery .top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5em;
}

#mastery .title {
    font-weight: bold;
    color: var(--help-heading-color);
}

#mastery .id {
    font-family: ui-monospace, monospace;
    font-size: 0.75em;
    color: var(--text-color-sub);
    overflow-wrap: anywhere;
}

#mastery .meter {
    height: 0.45em;
    margin: 0.4em 0;
    border-radius: 0.25em;
    background: #88888855;
    overflow: hidden;
}

#mastery .meter>span {
    display: block;
    height: 100%;
    background: var(--c);
}

#mastery .meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
    font-size: 0.85em;
    color: var(--text-color-sub);
}

/* A strand's name, which the script writes as an h2. */
#mastery #rows h2 {
    margin: 1.2em 0 0.4em;
    font-size: 1.3em;
    text-transform: capitalize;
    color: var(--text-color);
}

#mastery details {
    margin-bottom: 0.75em;
}

#mastery summary {
    cursor: pointer;
}

#mastery .log {
    padding: 0.15em 0;
    border-bottom: 0.0625em solid #88888855;
    font-family: ui-monospace, monospace;
    font-size: 0.8em;
}

#mastery .empty {
    padding: 1em 0;
    color: var(--text-color-sub);
}
