:root {
    color-scheme: dark;

    --bg: #111311;
    --text: #d8ddd5;
    --bright: #f0f2ed;
    --muted: #8b9389;
    --dim: #60685f;

    --green: #8fc887;
    --green2: #b1d8aa;
    --red: #d28b8b;
    --yellow: #d5c88a;

    --line: #353b34;

    --width: 960px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--text);
    font-family:
        "DejaVu Sans Mono",
        "Liberation Mono",
        Consolas,
        monospace;
    font-size: 15px;
    line-height: 1.55;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--green);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:visited {
    color: #a2b99e;
}

a:hover,
a:focus {
    color: var(--green2);
    background: #1b211a;
}

code,
pre {
    font: inherit;
}

code {
    color: var(--bright);
}

.shell {
    width: min(calc(100% - 32px), var(--width));
    margin: 0 auto;
}


/*
 * header
 */

.site-header {
    border-bottom: 1px solid var(--line);
}

.site-header .shell {
    min-height: auto;
    padding: 15px 0 13px;
    display: flex;
    align-items: baseline;
    gap: 28px;
}

.brand {
    color: var(--bright);
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.brand::before {
    content: "[";
    color: var(--dim);
}

.brand::after {
    content: "]";
    color: var(--dim);
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 18px;
}

.site-header nav a {
    color: var(--green);
    font-size: inherit;
    text-transform: lowercase;
}

.site-header nav .play-link {
    padding: 0;
    border: 0;
    color: var(--yellow);
}


/*
 * main
 */

main.shell {
    padding-top: 28px;
    padding-bottom: 60px;
}


/*
 * home intro
 */

.hero {
    max-width: 760px;
    padding: 8px 0 28px;
}

.hero h1,
.page-heading h1 {
    margin: 0 0 12px;
    padding: 0;
    color: var(--bright);
    font-size: 1.55rem;
    line-height: 1.3;
    letter-spacing: 0;
}

.hero h1::before {
    content: "$ ";
    color: var(--green);
}

.hero > p:not(.eyebrow) {
    margin: 8px 0;
    max-width: 700px;
    color: var(--text);
    line-height: 1.6;
    font-size: inherit;
}

.eyebrow {
    display: none;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-top: 18px;
}

.hero-actions code {
    display: inline-block;
    padding: 3px 7px;
    border: 1px solid var(--line);
    background: #0b0d0b;
}


/*
 * links that used to look like product buttons
 */

.button {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: var(--green);
    text-decoration: underline;
}

.button::before {
    content: "[";
    color: var(--dim);
    text-decoration: none;
}

.button::after {
    content: "]";
    color: var(--dim);
    text-decoration: none;
}

.button.primary {
    border: 0;
    background: none;
    color: var(--yellow);
}


/*
 * page headings
 */

.page-heading {
    margin: 0 0 26px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.page-heading h1 {
    margin-bottom: 5px;
}

.page-heading h1::before {
    content: "# ";
    color: var(--green);
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}


/*
 * summary stats
 *
 * deliberately not cards
 */

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 0;
    margin: 0 0 30px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stat {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 0 24px 0 0;
    margin: 0 24px 0 0;
    border: 0;
    border-right: 1px solid var(--line);
    background: none;
}

.stat:last-child {
    border-right: 0;
}

.stat span {
    display: inline;
    margin: 0;
    color: var(--muted);
    font-size: inherit;
    text-transform: lowercase;
    letter-spacing: 0;
}

.stat span::after {
    content: ":";
}

.stat strong {
    color: var(--bright);
    font-size: inherit;
    font-weight: bold;
}


/*
 * layout
 */

.columns {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .8fr);
    gap: 36px;
    margin-bottom: 34px;
}


/*
 * sections
 *
 * no cards, no floating boxes
 */

.panel {
    margin: 0 0 34px;
    padding: 0;
    border: 0;
    background: none;
}

.panel h2 {
    margin: 0 0 12px;
    padding: 0 0 5px;
    border-bottom: 1px dashed var(--line);
    color: var(--bright);
    font-size: 1rem;
    font-weight: bold;
    text-transform: lowercase;
}

.panel h2::before {
    content: "== ";
    color: var(--dim);
}

.panel h2::after {
    content: " ==";
    color: var(--dim);
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--line);
}

.panel-title h2 {
    margin: 0;
    padding: 0;
    border: 0;
}

.panel-title > a {
    font-size: .86rem;
}


/*
 * tables
 */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

th {
    padding: 5px 12px 5px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-weight: normal;
    text-align: left;
    white-space: nowrap;
    text-transform: lowercase;
}

td {
    padding: 7px 12px 7px 0;
    border-bottom: 1px dotted #292e29;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #151915;
}

.death {
    color: #b7bcb5;
    max-width: 390px;
}


/*
 * rankings
 */

.ranking {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: rank;
}

.ranking li {
    counter-increment: rank;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 7px;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px dotted #292e29;
}

.ranking li::before {
    content: counter(rank) ".";
    color: var(--dim);
}

.ranking li:last-child {
    border-bottom: 0;
}

.ranking small {
    display: inline;
    margin-left: 8px;
    color: var(--muted);
}


/*
 * game detail
 */

.details {
    display: grid;
    grid-template-columns: minmax(125px, auto) 1fr;
    gap: 5px 18px;
    margin: 0;
}

.details dt {
    color: var(--muted);
}

.details dt::after {
    content: ":";
}

.details dd {
    margin: 0;
}

.result {
    color: var(--bright);
    line-height: 1.6;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
}

.tags span {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
}

.tags span::before {
    content: "+";
    color: var(--green);
}


/*
 * livelog
 */

.events article {
    padding: 10px 0;
    border-bottom: 1px dotted var(--line);
}

.events article:first-child {
    padding-top: 0;
}

.events article:last-child {
    border-bottom: 0;
}

.events article > div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
}

.events article > div span,
.events time {
    color: var(--muted);
    font-size: .85rem;
}

.events article p {
    margin: 4px 0;
}


/*
 * live games
 */

.live-active {
    color: var(--green2);
}

.live-active::before {
    content: "* ";
    color: var(--green);
}


/*
 * general
 */

.muted {
    color: var(--muted);
    font-size: .9rem;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 28px 0;
}


/*
 * footer
 */

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-size: .85rem;
}

.site-footer .shell {
    padding-top: 15px;
    padding-bottom: 28px;
}


/*
 * mobile
 */

@media (max-width: 760px) {
    .site-header .shell {
        display: block;
    }

    .brand {
        display: block;
        margin-bottom: 8px;
    }

    .site-header nav {
        gap: 5px 13px;
    }

    .columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .stat {
        margin-right: 14px;
        padding-right: 14px;
    }

    .hero {
        padding-top: 0;
    }
}

@media (max-width: 480px) {
    .shell {
        width: calc(100% - 22px);
    }

    html {
        font-size: 14px;
    }

    .stats-grid {
        display: block;
    }

    .stat {
        border: 0;
        padding: 2px 0;
        margin: 0;
    }

    .details {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .details dd {
        margin-bottom: 8px;
    }
}


/*
 * ============================================================
 * NetHack front page
 * ============================================================
 *
 * Deliberately simple.
 * This is a game server status board, not a web application
 * dashboard.
 */

.nh-home {
    width: min(100%, 760px);
    margin: 0 auto;
}


/*
 * title / entry point
 */

.nh-intro {
    padding: 34px 0 42px;
    text-align: center;
}

.nh-intro h1 {
    margin: 0 0 25px;
    color: var(--bright);
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: .20em;
}

.nh-play-button {
    display: inline-block;
    margin: 0 0 21px;
    padding: 9px 20px;

    border: 1px solid var(--green);

    color: var(--bright);
    background: transparent;

    text-decoration: none;
    letter-spacing: .05em;
}

.nh-play-button:visited {
    color: var(--bright);
}

.nh-play-button:hover {
    color: #111311;
    background: var(--green);
    text-decoration: none;
}

.nh-ssh {
    color: var(--muted);
    font-size: .95rem;
}


/*
 * live games
 */

.nh-live-section {
    margin-bottom: 44px;
}

.nh-live-count {
    margin-bottom: 13px;
    text-align: center;
    color: var(--text);
}

.nh-live-box {
    border: 1px solid var(--line);
    padding: 14px 18px 16px;
}

.nh-section-label {
    margin-bottom: 13px;

    color: var(--bright);

    font-weight: bold;
    letter-spacing: .10em;
}

.nh-section-label::before {
    content: "* ";
    color: var(--green);
}

.nh-live-list {
    display: grid;
    gap: 2px;
}

.nh-live-row {
    display: grid;

    grid-template-columns:
        minmax(120px, 1.35fr)
        minmax(130px, 1fr)
        minmax(110px, .9fr)
        auto;

    gap: 15px;

    padding: 6px 0;

    border-top: 1px dotted #292e29;

    align-items: baseline;
}

.nh-live-row:first-child {
    border-top: 0;
}

.nh-live-player {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nh-live-role {
    color: var(--text);
}

.nh-live-level {
    color: var(--muted);
}

.nh-watch {
    color: var(--yellow);

    font-size: .88rem;
    font-weight: bold;

    text-decoration: none;
}

.nh-watch::before {
    content: "[";
    color: var(--dim);
}

.nh-watch::after {
    content: "]";
    color: var(--dim);
}

.nh-watch:hover {
    color: var(--bright);
    text-decoration: none;
}


/*
 * today's server activity
 */

.nh-today {
    margin-bottom: 42px;
}

.nh-today h2,
.nh-recent-deaths h2 {
    margin: 0 0 15px;

    color: var(--bright);

    font-size: 1rem;
    font-weight: bold;

    letter-spacing: .09em;
}

.nh-today-stats {
    display: grid;
    grid-template-columns: repeat(2, max-content);

    gap: 5px 45px;

    padding-left: 15px;
}

.nh-today-stats > div {
    color: var(--text);
}

.nh-today-stats strong {
    display: inline-block;

    min-width: 45px;

    color: var(--bright);

    text-align: right;
    font-weight: normal;
}


/*
 * recent deaths
 */

.nh-recent-deaths {
    margin-bottom: 40px;
}

.nh-recent-deaths ul {
    list-style: none;

    margin: 0;
    padding: 0 0 0 15px;
}

.nh-recent-deaths li {
    margin: 7px 0;

    line-height: 1.5;
}

.nh-recent-deaths li::before {
    content: "> ";

    color: var(--dim);
}

.nh-death-text {
    color: var(--text);
    text-decoration: none;
}

.nh-death-text:visited {
    color: var(--text);
}

.nh-death-text:hover {
    color: var(--bright);
    text-decoration: underline;
}

.nh-empty {
    color: var(--muted);
}


/*
 * home mobile
 */

@media (max-width: 620px) {
    .nh-intro {
        padding-top: 18px;
    }

    .nh-live-row {
        grid-template-columns: 1fr auto;
        gap: 3px 12px;

        padding: 9px 0;
    }

    .nh-live-player {
        font-weight: bold;
    }

    .nh-live-role {
        grid-column: 1;
        grid-row: 2;

        color: var(--muted);
    }

    .nh-live-level {
        grid-column: 1;
        grid-row: 3;

        font-size: .85rem;
    }

    .nh-watch {
        grid-column: 2;
        grid-row: 1 / span 3;

        align-self: center;
    }

    .nh-today-stats {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}
