body {
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--ink);
}

a {
    color: var(--accent);
}

.PageWrapper {
    max-width: 900px;
    margin: 2em auto;
    padding: 1em;
    background-color: var(--panel);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.PagePanel {
    margin-bottom: 1.5em;
    padding: 1em;
    background-color: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
}

/* The PHP the server is running (mg #759), right of the admin greeting. */
.PagePanel .PhpVersion {
    float: right;
}

.fix {
    font-size: 0.85em;
    text-align: right;
    color: var(--muted);
}

.GameLinks ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* One heading per group of games (mg #554). */
.GameLinks .GameGroup + .GameGroup {
    margin-top: 1.5em;
}

.GameLinks h3 {
    margin: 0 0 0.5em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid var(--line);
    font-size: 1em;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.GameLinks li + li {
    margin-top: 0.75em;
}

.GameLinks a {
    font-weight: bold;
}

.GameLinks .blurb {
    display: block;
    color: var(--muted);
}

/* DOTS games waiting for a second player, under the DOTS link. */
.GameLinks .Waiting {
    margin-top: 0.4em;
    padding-left: 0.25em;
}

.GameLinks .Waiting li + li {
    margin-top: 0.25em;
}

.GameLinks .Waiting a {
    margin-left: 0.4em;
}

.GameLinks .Swatch {
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin-right: 0.3em;
    border: 1px solid var(--line, #cccccc);
    border-radius: 50%;
    vertical-align: -0.05em;
}

/* The top page: what the site is for, and the way to the games. */
.Mission .Lead {
    font-size: 1.25em;
    margin-top: 0;
}

.Mission .ToLobby {
    font-weight: bold;
    font-size: 1.1em;
}

/* The 18+ question (templates/partials/age_step.tpl.php, js/age_step.js).
   Without the script it is a plain select. With it, a tap grid of years. */
.AgeStep {
    border: 0;
    padding: 0;
    margin: 0 0 1.25em;
}

.AgeStep legend {
    font-size: 1.15em;
    font-weight: bold;
    padding: 0;
}

.AgeNote,
.AgeAside,
.AgeCrumbs {
    color: var(--muted);
    font-size: 0.9em;
}

.AgeStep.Enhanced .AgeFallback {
    display: none;
}

/* The grids set display, which would otherwise beat the hidden attribute. */
.AgeStep [hidden],
.AfterAge[hidden] {
    display: none;
}

.AgeGrid {
    display: grid;
    gap: 0.35em;
}

.AgeYears {
    grid-template-columns: repeat(4, 1fr);
    max-height: 14.5em;
    overflow-y: auto;
    padding: 0.15em;
}

@media (min-width: 600px) {
    .AgeYears {
        grid-template-columns: repeat(5, 1fr);
    }
}

.AgeTwo {
    grid-template-columns: repeat(2, minmax(0, 8em));
}

.AgeMonths {
    grid-template-columns: repeat(4, 1fr);
}

.AgeCal {
    grid-template-columns: repeat(7, 1fr);
}

.AgeDow {
    text-align: center;
    font-size: 0.75em;
    color: var(--muted);
}

.AgePick {
    font: inherit;
    font-variant-numeric: tabular-nums;
    padding: 0.55em 0.2em;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: pointer;
}

.AgePick:hover:not(:disabled) {
    background: var(--card-hover);
}

.AgePick:disabled {
    opacity: 0.3;
    cursor: default;
}

.AgePick:focus-visible,
.AgeChange:focus-visible,
.AgePin:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.AgeChange,
.AgePin {
    font: inherit;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--accent);
    color: var(--accent);
    cursor: pointer;
    padding: 0;
}

.AgeBig {
    font-size: clamp(2.2em, 9vw, 3.6em);
    font-weight: bold;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    margin: 0.4em 0 0.2em;
}

.AgeBig small {
    font-size: 0.35em;
    font-weight: normal;
    color: var(--muted);
}

.AgePinArea {
    margin-top: 0.8em;
}

.AgeRefusal h2 {
    margin-top: 0;
}

/* A player's name, with an account's @username in its own chip
   (templates/partials/player_name.tpl.php). The chip is never part of the
   name's text, and names can't contain @, so a guest can't fake one. */
.Handle {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    margin-left: 0.4em;
    padding: 0.05em 0.45em;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.8em;
    font-weight: normal;
    color: var(--accent);
    background: var(--card-hover);
    border: 1px solid var(--line);
    border-radius: 999px;
    vertical-align: 0.1em;
    white-space: nowrap;
}

.HandleBadge {
    font-size: 0.85em;
}

/* Rankings: /rankings/ and each game's rankings page. */
.RankingsPage h2 {
    margin-top: 1.5em;
}
.RankingsPage h3 {
    margin: 1em 0 0.3em;
    font-size: 1em;
    color: var(--muted);
}
.RankingsPage .Quiet {
    color: var(--muted);
}
.RankingsWrap {
    overflow-x: auto;
}
table.Rankings {
    width: 100%;
    border-collapse: collapse;
}
table.Rankings th,
table.Rankings td {
    padding: 0.35em 0.5em;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}
/* Names and headings wrap, so on a phone the numbers fit beside them. */
table.Rankings th,
table.Rankings td:nth-child(2) {
    white-space: normal;
}
table.Rankings .Num,
table.Rankings .Place {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
table.Rankings th button {
    font: inherit;
    font-weight: bold;
    color: var(--accent);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
table.Rankings th[aria-sort="descending"] button::after {
    content: " \25BC";
}
table.Rankings th[aria-sort="ascending"] button::after {
    content: " \25B2";
}
/* A computer's row on the rankings: start a game against it. */
table.Rankings .Play {
    margin-left: 0.4em;
    font-size: 0.9em;
}
