/* Spec 426: the public quiz pages. quizzes.css draws the quiz; this sheet adds the few app pieces a quiz needs outside
   the app (components.css, planner.css and game-viewer.css are not loaded here), the island's waiting line and the hub's
   cards. The tabletop sheets give the colours of both themes. */

/* The app pieces, structure only. */
.public-tool .home-app-card {
    border: 1px solid;
    padding: 0.95rem 1rem;
    display: grid;
    gap: 0.52rem;
    align-content: start;
}

.public-tool .home-app-card h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
}

.public-tool .home-app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.public-tool .home-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.58rem 0.9rem;
    border: 1px solid;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.public-tool .home-cta:disabled {
    cursor: default;
    opacity: 0.6;
}

.public-tool .planner-small {
    margin: 0;
    font-size: 0.85rem;
    color: var(--tt-muted);
}

.public-tool .planner-toggle-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
}

.public-tool .planner-toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.public-tool .planner-toggle-indicator {
    flex: none;
    width: 34px;
    height: 20px;
    position: relative;
}

.public-tool .planner-toggle-indicator::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    transition: transform 0.18s ease;
}

.public-tool .planner-toggle-checkbox:checked + .planner-toggle-indicator::after {
    transform: translateX(14px);
}

.public-tool .planner-toggle-checkbox:focus-visible + .planner-toggle-indicator {
    outline: 2px solid var(--tt-accent);
    outline-offset: 2px;
}

.public-tool .game-filter-select,
.public-tool .quiz-search-input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0.52rem 0.68rem;
    border: 1.5px solid;
    font-size: 0.86rem;
}

.public-tool .game-filter-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364758b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-size: 12px 8px;
    background-repeat: no-repeat;
}

/* Rules 10-11: the tool block around the island. */
.pq-island {
    display: grid;
    gap: 0.75rem;
    min-height: 12rem;
}

.pq-island:has(.pq-island-body) .pq-wait {
    display: none;
}

.pq-island .quiz-result,
.pq-island .quiz-round,
.pq-island .quiz-start {
    min-width: 0;
}

/* Spec 442 rule 12: from 768 px the top bar stays on screen, so a round brought into view starts below it. */
@media (min-width: 768px) {
    .pq-island .quiz-round {
        scroll-margin-top: 7rem;
    }
}

@media (min-width: 1024px) {
    .pq-island .quiz-round {
        scroll-margin-top: 4.5rem;
    }
}

.pq-bgg {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

/* Rule 8: the hub's cards. */
.pq-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pq-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    height: 100%;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--tt-line);
    background: var(--tt-field);
    color: var(--tt-ink);
    text-decoration: none;
}

a.pq-card:hover,
a.pq-card:focus-visible {
    border-color: var(--tt-accent);
}

.pq-card .quiz-icon {
    flex: none;
    color: var(--tt-accent);
}

.pq-card-body {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.pq-card-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
}

.pq-card-mark {
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--tt-line);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tt-muted);
}

.pq-card-text {
    font-size: 0.9rem;
    color: var(--tt-muted);
}

.pq-cards--locked .pq-card {
    background: transparent;
}
