:root {
    --tt-topnav-h: 64px;
    --sky: #8fb3f8;
    --sky-soft: #dbe7ff;
    --cloud: #f5f8ff;
    --ink: #0e1b33;
    --ink-2: #33425f;
    --link: #173f9e;
    --list-bg: rgba(0, 0, 0, 0.74);
    --mc-white: #ffffff;
    --mc-gray: #b4b4b4;
    --mc-green: #55ff55;
    --mc-red: #ff5555;
    --mc-yellow: #ffff55;
    --stone: #7d7d7d;
    --leaf: #3a7527;
    --gap: clamp(16px, 2vw, 32px);
    --side: clamp(16px, 2.2vw, 40px);
    --pixel: 'Pixelify Sans', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; scroll-padding-top: calc(var(--tt-topnav-h) + 16px); }
body {
    margin: 0;
    background: var(--sky-soft);
    color: var(--ink);
    font: 400 1rem/1.6 'Inter', system-ui, sans-serif;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--pixel); font-weight: 700; line-height: 1.15; margin: 0; font-variant-ligatures: none; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.mc-hero :focus-visible { outline-color: var(--mc-white); }

/* Hero: on a phone the screenshot sits above the panel, from 900px the panel sits on the screenshot. */
.mc-hero { background: #000; color: var(--mc-white); }
.mc-hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.mc-hero-body { display: grid; gap: 16px; padding: 20px var(--side) 24px; min-width: 0; }
.mc-hero h1 {
    font-size: clamp(2rem, 3.4vw, 3.6rem);
    text-shadow: 3px 3px 0 #3f3f3f;
}
.mc-lead { font-size: clamp(1rem, 1.3vw, 1.2rem); max-width: 60ch; }

/* The status row copies an entry of the game's own multiplayer server list. */
.mc-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 4px 12px;
    align-items: center;
    padding: 8px;
    background: var(--list-bg);
    outline: 2px solid var(--mc-gray);
    outline-offset: -2px;
}
.mc-row-icon { width: 64px; height: 64px; image-rendering: pixelated; }
.mc-row-main { min-width: 0; }
.mc-row-name { font-size: 1.3rem; font-weight: 500; text-shadow: 2px 2px 0 #3f3f3f; }
.mc-row-motd { color: var(--mc-gray); line-height: 1.25; margin-top: 2px; }
.mc-row-status {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}
.mc-row-players { color: var(--mc-gray); text-shadow: 2px 2px 0 #3f3f3f; }
.mc-row-state { color: var(--mc-gray); font-weight: 600; }
.mc-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.mc-bars i { display: block; width: 4px; background: #555555; }
.mc-bars i:nth-child(1) { height: 4px; }
.mc-bars i:nth-child(2) { height: 7px; }
.mc-bars i:nth-child(3) { height: 10px; }
.mc-bars i:nth-child(4) { height: 13px; }
.mc-bars i:nth-child(5) { height: 16px; }
[data-state="online"] .mc-bars i { background: var(--mc-green); }
[data-state="online"] .mc-row-state { color: var(--mc-green); }
[data-state="offline"] .mc-bars i { background: var(--mc-red); }
[data-state="offline"] .mc-row-state { color: var(--mc-red); }
[data-state="unknown"] .mc-row-state { color: var(--mc-yellow); }

/* Buttons copy the game's stone buttons: hard bevel, black edge, no radius. */
.mc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1 1 100%;
    min-height: 48px;
    padding: 8px 18px;
    border: 2px solid #000;
    background: var(--stone);
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -4px 0 rgba(0, 0, 0, 0.35);
    color: var(--mc-white);
    font: 500 1.15rem/1.2 var(--pixel);
    font-variant-ligatures: none;
    text-decoration: none;
    text-shadow: 2px 2px 0 #3f3f3f;
    cursor: pointer;
}
.mc-btn:hover { filter: brightness(1.15); }
.mc-btn-go { background: var(--leaf); }
.mc-address { background: #2b2b2b; }
.mc-address-text { font: 800 1.25rem/1.2 'Inter', system-ui, sans-serif; color: var(--mc-yellow); }

.mc-gallery { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--sky); }
.mc-gallery figure { margin: 0; min-width: 0; }
.mc-gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.mc-gallery figcaption { padding: 10px var(--side) 14px; font-weight: 500; }

.mc-join {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    padding: var(--gap) var(--side);
}
.howto-section { min-width: 0; counter-reset: step; display: grid; gap: 14px; align-content: start; }
.mc-step {
    position: relative;
    counter-increment: step;
    padding: 14px 14px 14px 62px;
    background: var(--cloud);
    min-width: 0;
}
.mc-step::before {
    content: counter(step);
    position: absolute;
    left: 12px;
    top: 12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid #000;
    background: var(--leaf);
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -3px 0 rgba(0, 0, 0, 0.35);
    color: var(--mc-white);
    font: 700 1.2rem/1 var(--pixel);
    font-variant-ligatures: none;
}
.mc-step p { margin-top: 6px; max-width: 80ch; overflow-wrap: anywhere; }
.mc-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.mc-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 600;
}

.mc-side { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.mc-panel { background: var(--cloud); padding: 16px; min-width: 0; }
.mc-mods { list-style: none; margin: 10px 0 0; padding: 0; }
.mc-mods li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 12px;
    padding: 8px 0;
    border-top: 2px solid var(--sky-soft);
}
.mc-mods a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.mc-mods span { align-self: center; }
.mc-mods span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mc-mods small { grid-column: 1 / -1; color: var(--ink-2); font-size: 0.9rem; }
.mc-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 10px 0 0; }
.mc-facts dt { color: var(--ink-2); }
.mc-facts dd { margin: 0; font-weight: 600; }

.mc-content { display: grid; gap: clamp(28px, 3vw, 44px); padding: 8px var(--side) 56px; }
.mc-prose { min-width: 0; }
.mc-prose > h2 { margin-bottom: 12px; }
.mc-columns { display: grid; gap: 14px var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.mc-columns p, .mc-narrow { max-width: 80ch; }
.mc-narrow { margin-bottom: 4px; }
.mc-tips {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.mc-tips li { max-width: 80ch; }
.faq-section { display: grid; gap: 8px var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); align-items: start; }
.faq-section > h2 { grid-column: 1 / -1; margin-bottom: 4px; }
.faq-item { background: var(--cloud); min-width: 0; }
.faq-item summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    list-style-position: inside;
}
.faq-item summary::before { content: '+'; font: 700 1.3rem/1 var(--pixel); width: 24px; flex: none; }
.faq-item[open] summary::before { content: '-'; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { padding: 0 14px 14px 38px; max-width: 80ch; }

.mc-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; color: var(--ink-2); font-size: 0.9rem; }
.mc-legal a { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 600px) {
    .mc-btn { flex: 0 1 auto; }
    .mc-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
    .mc-row-status { grid-column: auto; flex-direction: column; align-items: flex-end; gap: 2px; }
}

@media (min-width: 900px) {
    .mc-hero { position: relative; display: flex; align-items: flex-end; min-height: min(78vh, 56.25vw); overflow: hidden; }
    .mc-hero-img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
    .mc-hero-body {
        position: relative;
        width: min(900px, 66%);
        margin: var(--side);
        padding: 20px;
        background: rgba(0, 0, 0, 0.62);
    }
    .mc-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mc-gallery figcaption { padding: 10px 14px 14px; }
    .mc-gallery figure:first-child figcaption { padding-left: var(--side); }
    .mc-join { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); }
}

@media (min-width: 1400px) {
    .mc-join { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr) minmax(320px, 1fr); }
    .mc-side { display: contents; }
    .howto-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .howto-section > h2 { grid-column: 1 / -1; }
    .mc-panel { align-self: start; }
}
