/* The pages around a game, shared by Jablká, Múr, Záhrada and Piškvorky.
 *
 * Each game opens on the same first page — the title, a card saying how to
 * play, a Hrať button, and the Rebríček in a second card where the game keeps
 * scores — and Hrať leads to the choices. One file, so the four cannot drift
 * apart again: they did, and it showed.
 *
 * Three text colours, and only three:
 *   #e94560  pink   titles, scores, whatever is chosen
 *   #33373f  ink    everything you read (the site's body colour)
 *   #7a6a5c  muted  subtitles, labels, links, an empty board
 */

h1 {
    font-size: clamp(1.7rem, 6vw, 2.2rem);
    color: #e94560;
    margin: 1rem 0 0.3rem;
    text-shadow: 3px 3px 0 #f7ccd3;
}

.subtitle {
    font-size: 0.95rem;
    color: #7a6a5c;
    margin-bottom: 1rem;
}

/* The two pages before the game share one column, so the title, the cards and
   the choices line up whichever page is showing. */
#intro, .setup { width: 100%; max-width: 480px; margin: 0 auto; text-align: center; }
/* The choices need the room for five options in a row. */
.setup { max-width: 640px; }
#intro > .subtitle { margin: 0 0 1.75rem; }
/* `hidden` loses to any display set in a stylesheet; say it again here. */
#intro[hidden], .setup[hidden] { display: none; }

/* How to play and the board are cards, white like the character cards, so the
   first page is two clear blocks with the Hrať button between them. */
.card {
    background: #fff;
    border: 2px solid #ece4d6;
    border-radius: 12px;
    padding: 1.5rem 1.75rem 1.75rem;
}
.card h2 { font-size: 1.15rem; color: #e94560; margin: 0 0 1rem; text-align: center; }

.rules { text-align: left; }
.rules dl { margin: 0; display: grid; gap: 1.1rem; }
.rules dt { font-weight: 700; color: #33373f; font-size: .95rem; }
.rules dd { margin: .25rem 0 0; color: #33373f; font-size: .95rem; line-height: 1.5; }
.rules ol { margin: 0; padding-left: 1.3rem; display: grid; gap: .6rem; }
.rules li { color: #33373f; font-size: .95rem; line-height: 1.5; }
.rules .source, .rules .ours { color: #7a6a5c; font-size: .88rem; line-height: 1.5; margin: 1rem 0 0; }
.rules .source { font-style: italic; }

.play-btn {
    font-family: 'Noway', system-ui, sans-serif;
    font-size: 1.3rem;
    padding: 0.85rem 3.5rem;
    margin: 1.75rem 0;
    background: #e94560; color: white;
    border: none; border-radius: 999px; cursor: pointer;
    box-shadow: 0 3px 0 #c73652;
}
.play-btn:hover { background: #c73652; }
.play-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #c73652; }

/* Back a page, from the choices. */
.back-link {
    font-family: 'Noway', system-ui, sans-serif;
    font-size: .95rem;
    background: none; border: none; cursor: pointer;
    color: #7a6a5c; padding: .4rem 0;
    display: block; margin: 0 0 .5rem;
}
.back-link:hover { color: #e94560; }

/* More room above a heading than below it, so each reads as the title of
   the choices under it rather than a caption for the ones above. */
.setup h2 {
    font-size: 1.15rem;
    color: #e94560;
    margin: 2.5rem 0 1rem;
}
.setup .back-link + h2 { margin-top: 0.75rem; }

/* --- the Rebríček ------------------------------------------------------- */

#leaderboard { text-align: center; margin-bottom: 2rem; }

.lb-tabs { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.25rem; }

.lb-tab {
    font-family: 'Noway', system-ui, sans-serif;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border: 2px solid #ece4d6;
    border-radius: 999px;
    background: transparent;
    color: #7a6a5c;
    cursor: pointer;
}

.lb-tab.active { border-color: #e94560; color: #e94560; }

/* No wider than it needs to be, so rank, name and score sit together under
   the tabs instead of at the two edges of the page. */
#lb-list { margin: 0 auto; max-width: 320px; }

.lb-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
    font-size: 0.95rem;
    color: #33373f;
    border-bottom: 1px solid #ece4d6;
}
.lb-row:last-child { border-bottom: none; }

.lb-row .lb-rank { color: #7a6a5c; width: 2rem; text-align: left; }
.lb-row .lb-name { flex: 1; text-align: left; }
.lb-row .lb-score { color: #e94560; width: 4rem; text-align: right; }

.lb-highlight { background: #fdf0f2; border-radius: 4px; color: #e94560; }
.lb-highlight .lb-name { color: #e94560; }

.lb-empty { color: #7a6a5c; font-size: 0.95rem; padding: 1rem 0 0; margin: 0; }

@media (max-width: 480px) {
    .card { padding: 1.25rem 1.25rem 1.5rem; }
}
