/* Spec 427: the public ranking tool - its two sources, the tiles, the duels and the result. Every colour is a tabletop
   token, so the light and the dark theme both follow html[data-theme]; buttons come from home-landing.css (gl-btn). */

.pr-tool {
    display: grid;
    gap: 1.25rem;
}

.rules-page .pr-tool h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.pr-sources {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .pr-sources {
        grid-template-columns: 1fr 1fr;
    }
}

.pr-source,
.pr-start,
.pr-duel,
.pr-result {
    padding: 1rem;
    border: 1px solid var(--tt-line);
    background: var(--tt-field);
}

.pr-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.pr-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pr-input {
    flex: 1 1 12rem;
    min-width: 0;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tt-line);
    background: var(--tt-surface);
    color: var(--tt-ink);
    font: inherit;
}

.pr-row .pr-input {
    width: auto;
}

.pr-input:focus-visible {
    outline: 2px solid var(--tt-accent);
    outline-offset: 1px;
}

.rules-page .pr-note,
.rules-page .pr-status {
    margin: 0.6rem 0 0;
    color: var(--tt-muted);
    font-size: 0.95rem;
}

.rules-page .pr-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tt-ink);
}

.rules-page .is-problem {
    color: var(--tt-danger);
}

.pr-spinner {
    flex: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--tt-line);
    border-top-color: var(--tt-accent);
    animation: pr-spin 0.9s linear infinite;
}

@keyframes pr-spin {
    to {
        transform: rotate(360deg);
    }
}

.pr-source > .gl-btn {
    margin-top: 0.5rem;
}

/* Rule 16: the BGG logo where its data shows, the variant of the theme. */
.pr-bgg-credit {
    display: inline-block;
    margin-top: 0.85rem;
    line-height: 0;
}

.pr-bgg-logo {
    height: 26px;
    width: auto;
}

.pr-bgg-logo--dark,
html[data-theme="dark"] .pr-bgg-logo--light {
    display: none;
}

html[data-theme="dark"] .pr-bgg-logo--dark {
    display: block;
}

.pr-hits {
    display: grid;
    gap: 0.35rem;
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
}

.pr-hits li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--tt-line);
}

.pr-hit-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.pr-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.pr-count {
    color: var(--tt-muted);
    font-weight: 600;
}

.pr-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    margin-bottom: 0.85rem;
}

.pr-filter span {
    white-space: nowrap;
}

.pr-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pr-filter .pr-input {
    width: auto;
}

.pr-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    cursor: pointer;
}

.pr-check input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--tt-accent);
}

.pr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.6rem;
}

.pr-tile {
    position: relative;
    display: grid;
    gap: 0.35rem;
    padding: 0.4rem;
    border: 2px solid var(--tt-line);
    background: var(--tt-surface);
    color: var(--tt-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.pr-tile.is-selected {
    border-color: var(--tt-accent);
    background: var(--tt-accent-soft);
}

/* The one light-frame selection look of the app: a check in the corner of a picked tile. */
.pr-tile.is-selected::after {
    content: "";
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    width: 1.3rem;
    height: 1.3rem;
    background: var(--tt-accent);
    -webkit-mask: var(--tt-check) center / 80% no-repeat;
    mask: var(--tt-check) center / 80% no-repeat;
}

.pr-tile-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

.pr-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--tt-area);
}

.pr-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pr-initials {
    color: var(--tt-muted);
    font-family: var(--tt-font-display);
    font-size: 1.6rem;
    font-weight: 700;
}

.pr-more {
    margin-top: 0.85rem;
}

.pr-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.pr-chip {
    display: grid;
    gap: 0.15rem;
    padding: 0.55rem 0.7rem;
    border: 2px solid var(--tt-line);
    background: var(--tt-surface);
    color: var(--tt-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.pr-chip span {
    color: var(--tt-muted);
    font-size: 0.85rem;
}

.pr-chip.is-active {
    border-color: var(--tt-accent);
    background: var(--tt-accent-soft);
}

.pr-start-btn {
    margin-top: 0.85rem;
}

.pr-progress-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.pr-progress-row h3:focus {
    outline: none;
}

.pr-progress {
    height: 6px;
    margin: 0.4rem 0 1rem;
    background: var(--tt-area);
}

.pr-progress span {
    display: block;
    height: 100%;
    background: var(--tt-accent);
}

.pr-duel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    max-width: 34rem;
    margin-inline: auto;
}

.pr-duel-grid.is-pick {
    max-width: 46rem;
}

@media (min-width: 640px) {
    .pr-duel-grid.is-pick {
        grid-template-columns: repeat(4, 1fr);
    }
}

.pr-duel-option {
    display: grid;
    gap: 0.5rem;
    padding: 0.6rem;
    border: 2px solid var(--tt-line);
    background: var(--tt-surface);
    color: var(--tt-ink);
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.pr-duel-option:hover,
.pr-tile:hover,
.pr-chip:hover {
    border-color: var(--tt-accent);
}

.pr-duel-option strong {
    overflow-wrap: anywhere;
}

.pr-cover--duel {
    aspect-ratio: 4 / 3;
}

.pr-cover--duel .pr-initials {
    font-size: 2.4rem;
}

.pr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.pr-result-list {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pr-result-list li {
    display: grid;
    grid-template-columns: 3rem 3rem 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--tt-line);
}

.pr-place {
    font-family: var(--tt-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--tt-accent);
}

.pr-cover--row .pr-initials {
    font-size: 1rem;
}

.pr-result-name {
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.pr-save-line {
    margin-top: 1rem;
}

/* Spec 431 rule 2c: the refusal under the two save buttons, on a line of its own. */
.rules-page .pr-save-line .pr-save-failed {
    flex: 1 1 100%;
    color: var(--tt-danger);
}
