/*
 * One collection: what it is, what is in it, in what key, and who else can read
 * it.
 *
 * It is the set page's twin, less the order: there is nothing to number and
 * nothing to move, so the list is a plain one and an entry has one button
 * rather than three.
 */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

/* Whether the collection is saved, sitting between the way back and the way to
   save it, which is the order those three things are thought about in. */
#collection-state {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#title-input {
    font-size: var(--text-lg);
    font-weight: 600;
}

.notice {
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-2);
    background-color: var(--surface-2);
    color: var(--text-2);
    font-size: var(--text-sm);
}

/* THE PIECES THAT ARE IN IT */

/* No numbers and no bullets: a collection has no order, and a list that counts
   its items is a list that says which comes first. */
#entries-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    background-color: var(--surface-2);
    box-shadow: var(--shadow-1);
}

.entry-title {
    align-self: center;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* A piece that has yet to be scanned. It has no score here and never had one,
   which is a fact about the book rather than something to put right, so it is
   shown as an ordinary piece and not as a warning. */
.entry-on-paper {
    font-weight: 600;
}

.entry-on-paper::after {
    content: ' · not scanned';
    font-weight: 400;
    font-style: italic;
    color: var(--text-2);
}

/* A piece the collection names but this device has not got. It is still part of
   the collection, which is why it is shown at all rather than left out. */
.entry-missing {
    font-weight: 400;
    color: var(--danger);
    font-style: italic;
}

.entry-buttons {
    display: flex;
    gap: var(--space-1);
    align-items: start;
}

.entry-buttons > button,
.entry-buttons > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 var(--space-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-1);
    background: transparent;
    color: inherit;
    font-size: var(--text-sm);
    text-decoration: none;
    cursor: pointer;
}

.entry-buttons > button:hover:not(:disabled),
.entry-buttons > a:hover {
    background-color: var(--surface-3);
    border-color: var(--brand-quiet);
}

.entry-buttons > button:disabled,
.entry-buttons > a[aria-disabled="true"] {
    opacity: 0.4;
    cursor: default;
}

.entry-controls {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.entry-description {
    flex: 1 1 12rem;
    min-width: 8rem;
    min-height: 2.25rem;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-1);
    background-color: var(--surface-1);
    color: inherit;
    font-size: var(--text-sm);
}

.entry-transposition {
    width: 3.5rem;
    min-height: 2.25rem;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-1);
    background-color: var(--surface-1);
    color: inherit;
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
}

.entry-transpose,
.entry-parts {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-2);
}

/* What the group does and what one player reads on top of it are two halves of
   one number, so they are boxed as one thing: the two of them in the order they
   add, and what they come to after. Wrapping rather than one long line, since
   the whole of it is wider than a phone. */
.entry-transpose {
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-1);
}

.entry-transpose-field {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    white-space: nowrap;
}

.entry-transpose-total,
.entry-parts {
    font-style: italic;
    white-space: nowrap;
}

.entry-transpose-clamped {
    color: var(--danger);
    font-style: normal;
}

.entry-parts > button {
    min-height: 2rem;
    padding: 0 var(--space-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-1);
    background: transparent;
    color: inherit;
    font-size: var(--text-xs);
    cursor: pointer;
}

/* ADDING A SCORE */

#score-picker {
    display: grid;
    gap: var(--space-2);
    max-height: 22rem;
    overflow-y: auto;
}

/* The piece and the button that adds it, side by side, with the box taking
   whatever room is left. */
#paper-entry-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

#paper-entry-row > .input {
    flex: 1 1 auto;
    min-width: 0;
}

.score-option {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    background-color: var(--surface-2);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--ease), background-color var(--ease);
}

.score-option:hover {
    border-color: var(--brand-quiet);
    background-color: var(--surface-3);
}

.score-option > .score-option-creators {
    color: var(--text-2);
    font-size: var(--text-sm);
}

/* A score the collection already holds. It is still offered, because tapping it
   is still worth something — it takes the player to the piece — but it is not
   offered as something to add. */
.score-option--already-in {
    opacity: 0.65;
}

.score-option-state {
    color: var(--text-2);
    font-size: var(--text-xs);
    font-style: italic;
}

/* Being shown the piece you just asked for. It lights for a moment and settles
   back: a dialog to dismiss would be in the way of what it is pointing at. */
.entry--pointed-at {
    animation: entry-pointed-at 1.6s var(--ease-out, ease-out);
}

@keyframes entry-pointed-at {
    from {
        border-color: var(--brand-quiet);
        background-color: var(--surface-3);
    }
    to {
        border-color: var(--border);
        background-color: var(--surface-2);
    }
}

/* DELETING */

#forbidden-notice {
    padding-block: var(--space-6);
}
