/* Component character finder — /tools/character-finder (growth plan D43).
   Colours come from Bootstrap variables, so dark mode needs no second set of rules. */

/* The palette. Server-rendered in full, every stroke-count band at once, so the page works
   before the index arrives and a crawler sees all 500 components rather than an empty div. */
.cf-band + .cf-band {
    margin-top: 1rem;
}

.cf-band-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.65;
    margin-bottom: 0.35rem;
}

.cf-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.cf-key {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    min-height: 2.6rem;
    padding: 0.2rem 0.35rem;
    font-size: 1.4rem;
    line-height: 1;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.45rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: transform 0.1s ease, border-color 0.1s ease, background-color 0.1s ease;
}

.cf-key:hover,
.cf-key:focus-visible {
    border-color: var(--bs-primary);
    transform: translateY(-1px);
}

.cf-key[aria-pressed="true"] {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

/* A component that finds nothing once the other picks are applied. Dimmed rather than
   removed: a grid that reflows on every press is a grid nobody can aim at twice. */
.cf-key[disabled] {
    opacity: 0.28;
    transform: none;
}

/* The radicals carry the link this whole tool exists to create, so they are marked as
   different before you press them. */
.cf-key-radical {
    border-color: rgba(13, 110, 253, 0.45);
}

.cf-chosen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
}

.cf-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--bs-primary);
    border-radius: 999px;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-size: 1.1rem;
}

.cf-chip small {
    font-size: 0.72rem;
    opacity: 0.8;
}

.cf-chip button {
    border: 0;
    background: none;
    color: inherit;
    line-height: 1;
    padding: 0 0.1rem;
    font-size: 0.9rem;
}

/* Results. Same chip shape as the handwriting candidates, deliberately — they are the same
   kind of answer and land in the same place on the page. */
.cf-results {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cf-hit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 4.5rem;
    padding: 0.4rem 0.5rem;
    text-decoration: none;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.cf-hit:hover,
.cf-hit:focus-visible {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
    color: var(--bs-body-color);
}

.cf-hit-glyph {
    font-size: 1.9rem;
    line-height: 1.1;
}

.cf-hit-read {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.75;
}

.cf-hit-gloss {
    font-size: 0.7rem;
    opacity: 0.65;
    max-width: 7rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
