body {
    margin: 0;
    min-height: 100vh;
    padding: 4rem 1.5rem;
    box-sizing: border-box;
    background: #2a1e0d;
    color: #cfe0cf;
    font-family: system-ui, sans-serif;
    text-align: center;
}

/* terrain.js draws the game's dirt tiles here, on the same hex grid
   and isometric projection the game uses */
#terrain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    image-rendering: pixelated;
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

#terrain.ready {
    opacity: 1;
}

/* menu_skin.png is the panel the game draws its own menus with, a
   nine-slice; border-image with `fill` paints the centre as the
   panel background. The file is already stored at 3x, and the slice
   matches the border width, so the browser draws it 1:1 and never
   resamples it -- Firefox ignores image-rendering on border-image,
   and smoothing the notched corners leaves a pale halo. */
main {
    max-width: 46rem;
    margin: 0 auto;
    padding: 2rem;
    border: 12px solid transparent;
    border-image-source: url("menu_skin.png");
    border-image-slice: 12 fill;
    border-image-repeat: repeat;
    image-rendering: pixelated;
    /* No drop shadow: an outer box-shadow is painted around the
       border box, which is a plain rectangle, so the notched
       corners sit inside it and get none. The terrain showing
       through a notch then reads as a bright patch against the
       darkened terrain all around it. The game's own menus have no
       shadow either. */
}

h1 {
    margin: 0 0 2rem;
}

/* The title art the game's title screen draws, see README.md */
h1 img {
    display: block;
    width: 100%;
    height: auto;
}

h2 {
    margin: 2rem 0 0.75rem;
    font-size: 1.1rem;
    color: #eaf5ea;
}

p {
    line-height: 1.5;
}

a {
    color: #9fd89f;
}

.about {
    text-align: left;
}

.screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.screenshots a {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 2px solid #111;
}

.screenshots img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.15s;
}

.screenshots a:hover img,
.screenshots a:focus img {
    filter: brightness(1.25);
}

/* The full size screenshot, opened over the page by the gallery */
#viewer {
    max-width: 96vw;
    max-height: 96vh;
    padding: 0;
    border: 2px solid #111;
    outline: none;
    background: #1c1c1c;
    cursor: zoom-out;
}

#viewer::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

#viewer img {
    display: block;
    max-width: 100%;
    max-height: calc(96vh - 4px);
    margin: 0 auto;
}

.screenshots a {
    cursor: zoom-in;
}

.alpha {
    margin: 2rem 0;
    padding: 0.75rem 1.25rem;
    border-left: 4px solid #d8a83f;
    background: rgba(216, 168, 63, 0.08);
    text-align: left;
}

.alpha h2 {
    margin-top: 0.25rem;
    color: #e8c070;
}

.alpha ul {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.5;
}

/* the same skin, at the same 1:1 scale, so the buttons read as
   in-game menu entries and stay just as crisp */
.downloads a,
.older a,
.links a {
    display: inline-block;
    margin: 0.4rem;
    padding: 0.15rem 0.6rem;
    border: 12px solid transparent;
    border-image-source: url("menu_skin.png");
    border-image-slice: 12 fill;
    border-image-repeat: repeat;
    image-rendering: pixelated;
    color: #cfe0cf;
    text-decoration: none;
}

.downloads a:hover,
.downloads a:focus,
.older a:hover,
.older a:focus,
.links a:hover,
.links a:focus {
    filter: brightness(1.8);
    color: #eaf5ea;
}

/* The current release: bigger buttons, platform on top, version below */
.downloads a {
    min-width: 9rem;
    padding: 0.5rem 1rem;
}

.downloads .platform {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #eaf5ea;
}

.downloads .version {
    display: block;
    font-size: 0.85rem;
    opacity: 0.75;
}

.links {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.links .discord {
    padding: 0.3rem 0.6rem;
    line-height: 0;
}

.links .discord svg {
    width: 2rem;
    height: 2rem;
    fill: #5865f2;
}

.contact {
    margin: 1.5rem 0 0;
    font-size: 0.85rem;
    opacity: 0.75;
}

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

.older li {
    margin: 0.5rem 0;
}

.older .version {
    display: inline-block;
    min-width: 7rem;
    font-variant-numeric: tabular-nums;
}

.older a {
    padding: 0 0.5rem;
    font-size: 0.9rem;
}
