/* Map browser of the Nexgen Spades maps repository.

   The look is the game's own site (ngspades.obex.pw): a voxel camouflage
   behind a dark shell with a gold frame, gold Dosis text, stencil nav and
   blood-red links; the same camo, fonts and palette, taken from that site's
   public/ folder. No framework, one stylesheet. */

@font-face {
    font-family: "Dosis";
    src: url("assets/fonts/dosis-latin.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Allerta Stencil";
    src: url("assets/fonts/allerta-stencil-latin.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
:root {
    color-scheme: dark;

    --gold: #ffd70b;
    --blood: #ff0000;
    --lime: #74e800;
    --ink: #cccccc;
    --dark-red: #8b0000;

    --black-50: rgba(0, 0, 0, .5);
    --black-70: rgba(0, 0, 0, .7);
    --gold-40: rgba(255, 215, 11, .4);
    --gold-20: rgba(255, 215, 11, .2);
    --white-10: rgba(255, 255, 255, .1);

    /* The mode colours, bright enough on black to read as a label. */
    --m-ngctf: #74e800;
    --m-ctf: #ffd70b;
    --m-koth: #ff9f43;
    --m-tc: #64b5f6;
    --m-babel: #c792ea;
    --m-arena: #ff4d4d;
    --m-zombie: #4dd6a8;
    --m-none: #9a9a9a;

    --font-sans: "Dosis", "Segoe UI", system-ui, sans-serif;
    --font-stencil: "Allerta Stencil", "Dosis", sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;

    --width: 1000px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: #000 url("assets/camo.jpg") center top / 510px repeat;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--blood); text-decoration: none; }
a:hover { color: var(--lime); text-decoration: underline; }

/* A link inside prose is underlined, not only red: a reader who cannot tell
   the blood red from the ink must still find it (WCAG 1.4.1). */
.about p a,
.detail-desc a,
.detail-by a,
.note a,
.app-foot a,
.app-lead a,
.empty a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

code, kbd, pre, .mono { font-family: var(--font-mono); }
code {
    padding: 1px 5px;
    border: 1px solid var(--gold-40);
    background: rgba(0, 0, 0, .7);
    color: var(--gold);
    font-size: .85em;
}

:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

::selection { background: var(--gold); color: #000; }

.skip {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 100;
    padding: 10px 14px;
    background: var(--gold);
    color: #000;
    font-weight: 700;
}
.skip:focus { left: 12px; top: 12px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---- the app frame, its compact head and its foot --------------------- */

.app {
    max-width: 1280px;
    margin: 10px auto;
    border: 1px solid var(--gold);
    background: #000 url("assets/camo-dark.jpg") center top / 510px repeat;
}

@media (max-width: 1284px) {
    .app { margin: 0; border-left: 0; border-right: 0; }
}

.app-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 20px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gold-40);
}

.brand { flex: none; display: block; }
.brand img {
    width: 132px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .7));
}

.app-title { flex: 1 1 340px; min-width: 240px; }
.app-title h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 500;
    color: var(--gold);
}
.app-lead {
    margin: 6px 0 0;
    max-width: 80ch;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(204, 204, 204, .85);
}
.app-stats {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: rgba(204, 204, 204, .7);
    font-variant-numeric: tabular-nums;
}
.app-stats b { color: var(--gold); font-weight: 600; }

.app-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-family: var(--font-stencil);
    font-size: 14px;
}
.app-links a { color: var(--gold); }
.app-links a:hover { color: var(--lime); }

main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 14px 20px 20px;
}

.app-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 18px;
    padding: 10px 20px;
    border-top: 1px solid var(--gold-40);
    font-size: 13px;
    color: rgba(204, 204, 204, .8);
}
.app-foot p { margin: 0; }

/* ---- panels ----------------------------------------------------------- */

.panel {
    border: 1px solid var(--gold);
    background: #000 url("assets/camo-desat.jpg") center top / 512px repeat;
    padding: 16px;
}

@media (max-width: 760px) {
    .app-head { padding: 12px 14px; gap: 12px; }
    .brand img { width: 96px; }
    .app-title h1 { font-size: 24px; }
    .app-lead { font-size: 13.5px; }
    .app-links { font-size: 13px; gap: 10px; }
    main { padding: 12px 14px 16px; }
    .app-foot { padding: 10px 14px; }
}

/* ---- filters ---------------------------------------------------------- */

.controls { padding: 12px; }
@media (min-width: 900px) {
    .controls {
        position: sticky;
        top: 8px;
        z-index: 20;
        background: #050505 url("assets/camo-desat.jpg") center top / 512px repeat;
    }
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 320px;
    min-width: 220px;
}

.search-icon {
    position: absolute;
    left: 11px;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.8;
    opacity: .8;
    pointer-events: none;
}

.search input {
    width: 100%;
    height: 40px;
    padding: 0 42px 0 34px;
    border: 1px solid var(--gold-40);
    border-radius: 0;
    background: var(--black-70);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    outline: none;
}
.search input::placeholder { color: rgba(204, 204, 204, .55); }
.search input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-20);
}
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.search kbd {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 5px;
    border: 1px solid var(--gold-40);
    background: rgba(0, 0, 0, .6);
    color: var(--gold);
    font-size: 11px;
    pointer-events: none;
}

.sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(204, 204, 204, .8);
}
.sort select {
    height: 40px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--gold-40);
    border-radius: 0;
    background: var(--black-70) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffd70b' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    appearance: none;
    cursor: pointer;
}
.sort select:focus { border-color: var(--gold); outline: none; }

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--dark-red);
    background: var(--black-50);
    color: var(--gold);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.toggle:hover { background: rgba(139, 0, 0, .55); }
.toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--gold); }
.toggle:has(input:checked) { border-color: var(--gold); background: rgba(255, 215, 11, .12); }

.btn {
    height: 40px;
    padding: 0 14px;
    border: 2px solid var(--dark-red);
    border-radius: 0;
    background: var(--black-70);
    color: var(--gold);
    font-family: var(--font-stencil);
    font-size: 15px;
    letter-spacing: .03em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: rgba(139, 0, 0, .6); color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--gold-40);
    background: var(--black-50);
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
}
.btn.ghost:hover { border-color: var(--lime); color: var(--lime); background: var(--black-70); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chip {
    --m: var(--m-none);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--dark-red);
    border-radius: 0;
    background: var(--black-50);
    color: var(--gold);
    font-family: var(--font-stencil);
    font-size: 14px;
    letter-spacing: .03em;
    white-space: nowrap;
    cursor: pointer;
}
.chip:hover { background: rgba(139, 0, 0, .55); color: var(--gold); }
.chip .dot {
    width: 8px;
    height: 8px;
    background: var(--m);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .8);
}
.chip .n {
    font-family: var(--font-sans);
    font-size: 11px;
    color: rgba(204, 204, 204, .7);
    font-variant-numeric: tabular-nums;
}
.chip[aria-pressed="true"] {
    border-color: var(--gold);
    background: rgba(255, 215, 11, .16);
    color: var(--gold);
}
.chip[aria-pressed="true"] .n { color: var(--gold); }

:where(.tag, .chip) { --m: var(--m-none); }

.m-ngctf { --m: var(--m-ngctf); }
.m-ctf { --m: var(--m-ctf); }
.m-koth { --m: var(--m-koth); }
.m-tc { --m: var(--m-tc); }
.m-babel { --m: var(--m-babel); }
.m-arena { --m: var(--m-arena); }
.m-zombie { --m: var(--m-zombie); }
.m-none { --m: var(--m-none); }
.m-playable { --m: var(--lime); }
.m-all { --m: var(--gold); }

/* ---- results ---------------------------------------------------------- */

.results-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0 0;
}
.results-line p {
    margin: 0;
    font-size: 14px;
    color: rgba(204, 204, 204, .85);
    font-variant-numeric: tabular-nums;
}
.results-line p b { color: var(--gold); font-weight: 600; }

.link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--blood);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.link:hover { color: var(--lime); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    padding: 12px 0 4px;
}

.card {
    display: block;
    border: 1px solid var(--gold-40);
    background: var(--black-50);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.card:hover,
.card:focus-visible {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold-20), 0 10px 24px -16px #000;
    text-decoration: none;
}

.card-img {
    position: relative;
    display: block;
    aspect-ratio: 800 / 404;
    background: #000;
    overflow: hidden;
}
.card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 1px 6px;
    border: 1px solid var(--gold-40);
    background: rgba(0, 0, 0, .82);
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.card-body { padding: 9px 10px 11px; }

.card-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-author {
    margin: 1px 0 8px;
    font-size: 12.5px;
    color: rgba(204, 204, 204, .7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.tag {
    --m: var(--m-none);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 5px;
    border: 1px solid color-mix(in srgb, var(--m) 45%, transparent);
    background: color-mix(in srgb, var(--m) 12%, transparent);
    color: var(--m);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.tag i { width: 4px; height: 4px; background: currentColor; }
.tag.none {
    color: rgba(204, 204, 204, .6);
    border-color: var(--white-10);
    background: transparent;
}

.empty {
    margin: 16px 0;
    padding: 48px 20px;
    border: 1px dashed var(--gold-40);
    text-align: center;
}
.empty h2 { margin: 0 0 6px; font-size: 22px; font-weight: 500; color: var(--gold); }
.empty p { margin: 0 0 16px; color: rgba(204, 204, 204, .8); }

.more { display: flex; justify-content: center; padding: 10px 0 0; }

.skeleton {
    border: 1px solid var(--gold-40);
    background: var(--black-50);
    overflow: hidden;
}
.skeleton .sk-img { aspect-ratio: 800 / 404; background: #1a1a1a; animation: pulse 1.4s ease-in-out infinite; }
.skeleton .sk-line { height: 12px; margin: 10px; background: #222; animation: pulse 1.4s ease-in-out infinite; }
.skeleton .sk-line.short { width: 45%; margin-top: 0; margin-bottom: 14px; }

@keyframes pulse {
    0%, 100% { opacity: .5; }
    50% { opacity: .9; }
}

/* ---- about ------------------------------------------------------------ */

.about { font-size: 15px; line-height: 1.6; }
.about h2 {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 500;
    color: var(--gold);
}
.about h2:not(:first-child) { margin-top: 20px; }
.about p { margin: 0 0 10px; }
.about p:last-child { margin-bottom: 0; }

/* ---- the map sheet ---------------------------------------------------- */

.detail {
    width: min(940px, calc(100vw - 16px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
}
.detail::backdrop {
    background: rgba(0, 0, 0, .82);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.detail-card {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border: 2px solid var(--gold);
    background: #000 url("assets/camo-dark.jpg") center top / 510px repeat;
    box-shadow: 0 30px 80px -20px #000;
    overflow: hidden;
}

.detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 2px solid var(--dark-red);
    background: var(--black-70);
    color: var(--gold);
    cursor: pointer;
}
.detail-close:hover { background: rgba(139, 0, 0, .6); color: var(--gold); }
.detail-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.detail-hero {
    position: relative;
    flex: none;
    height: clamp(200px, 34vh, 330px);
    background: #000;
    border-bottom: 1px solid var(--gold-40);
}
.detail-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.detail-hero.top {
    height: min(54vh, 500px);
    background: #000 url("assets/camo-dark.jpg") center top / 510px repeat;
}
.detail-hero.top img { object-fit: contain; }
.detail-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(0, 0, 0, .96) 0%,
        rgba(0, 0, 0, .78) 30%,
        rgba(0, 0, 0, .34) 58%,
        rgba(0, 0, 0, .05) 80%,
        rgba(0, 0, 0, 0) 100%);
}
.detail-hero-text {
    position: absolute;
    left: 20px;
    right: 64px;
    bottom: 14px;
}
.detail-hero-text h2 {
    margin: 7px 0 3px;
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.08;
    font-weight: 500;
    color: var(--gold);
    text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
    text-wrap: balance;
}
.detail-by {
    margin: 0;
    font-size: 14px;
    color: rgba(204, 204, 204, .9);
    text-shadow: 0 2px 10px #000;
}
.detail-by b { color: #fff; font-weight: 600; }

.view-switch {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    gap: 3px;
}
.view-switch button {
    height: 28px;
    padding: 0 9px;
    border: 1px solid var(--dark-red);
    background: var(--black-70);
    color: var(--gold);
    font-family: var(--font-stencil);
    font-size: 13px;
    letter-spacing: .03em;
    cursor: pointer;
}
.view-switch button:hover { background: rgba(139, 0, 0, .6); }
.view-switch button[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 215, 11, .16); }

.detail-body {
    padding: 18px 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
@media (min-width: 640px) {
    .detail-body { padding: 20px 24px 28px; }
}

.detail-desc {
    margin: 0;
    max-width: 74ch;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
}

.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.detail-actions .mono { font-family: var(--font-mono); font-size: 12px; }

.detail-body h3 {
    margin: 22px 0 8px;
    font-family: var(--font-stencil);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold);
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
}
.fact {
    padding: 8px 10px;
    border: 1px solid var(--gold-40);
    background: var(--black-50);
}
.fact dt {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 215, 11, .75);
}
.fact dd {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.fact dd small { display: block; margin-top: 1px; font-size: 11px; color: rgba(204, 204, 204, .6); }
.fact dd.mono { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.fact .swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    vertical-align: -1px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

.note {
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(204, 204, 204, .7);
}

.table-wrap {
    margin-top: 9px;
    overflow-x: auto;
    border: 1px solid var(--gold-40);
    background: var(--black-50);
}

table.fit {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
table.fit th {
    padding: 7px 9px;
    text-align: left;
    font-family: var(--font-stencil);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 215, 11, .8);
    border-bottom: 1px solid var(--gold-40);
    white-space: nowrap;
}
table.fit td {
    padding: 7px 9px;
    border-bottom: 1px solid var(--white-10);
    white-space: nowrap;
    vertical-align: middle;
}
table.fit tr:last-child td { border-bottom: 0; }
table.fit td .limit { display: block; font-size: 10.5px; color: rgba(204, 204, 204, .6); }
table.fit td.bad { color: var(--blood); }
table.fit td.bad .limit { color: rgba(255, 0, 0, .7); }
table.fit td.good { color: var(--lime); }
table.fit td.tagged { color: var(--gold); }
table.fit td.untagged { color: rgba(204, 204, 204, .55); }
table.fit td .tag { font-size: 10px; }

.why {
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: rgba(204, 204, 204, .85);
}
.why li { padding-left: 12px; position: relative; }
.why li::before { content: "-"; position: absolute; left: 0; color: var(--gold); }

/* The uploads that share a map's name. */
.variants {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}
.variant {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--gold-40);
    background: var(--black-50);
    color: var(--ink);
    text-decoration: none;
}
.variant:hover { border-color: var(--gold); text-decoration: none; }
.variant img { flex: none; width: 72px; height: 36px; object-fit: cover; background: #000; }
.variant-text { display: flex; flex-direction: column; min-width: 0; }
.variant-text b {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.variant-text small {
    font-size: 11px;
    color: rgba(204, 204, 204, .65);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.variant.current { border-color: var(--gold); background: rgba(255, 215, 11, .1); }

.downloads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 7px;
    margin-top: 9px;
}
.dl {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 10px;
    border: 1px solid var(--gold-40);
    background: var(--black-50);
    color: var(--ink);
    text-decoration: none;
}
.dl:hover {
    border-color: var(--gold);
    background: rgba(0, 0, 0, .7);
    text-decoration: none;
    color: var(--ink);
}
.dl b { font-size: 13.5px; font-weight: 600; color: var(--gold); }
.dl span { font-family: var(--font-mono); font-size: 10.5px; color: rgba(204, 204, 204, .6); }

details { margin-top: 16px; border-top: 1px solid var(--gold-40); padding-top: 12px; }
details summary {
    cursor: pointer;
    font-family: var(--font-stencil);
    font-size: 14px;
    color: var(--gold);
    list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; display: inline-block; width: 14px; color: var(--gold); font-family: var(--font-mono); }
details[open] summary::before { content: "-"; }
details pre {
    margin: 10px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--gold-40);
    background: #000;
    color: var(--gold);
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
}

.spawns { margin-top: 10px; display: grid; gap: 5px; font-family: var(--font-mono); font-size: 12px; color: rgba(204, 204, 204, .85); }
.spawns b { color: var(--gold); font-weight: 600; }

/* ---- small screens ---------------------------------------------------- */

@media (max-width: 760px) {
    .panel { padding: 12px; }

    .search { flex-basis: 100%; }
    .search kbd { display: none; }
    .sort { flex: 1 1 110px; }
    .sort > span { display: none; }
    .sort select { width: 100%; min-width: 100px; }
    /* The chips scroll sideways instead of taking three rows of a phone. */
    .chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 10px -12px 0;
        padding: 0 12px 2px;
    }
    .chips::-webkit-scrollbar { display: none; }
    .chip { flex: none; }

    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 9px; }
    .card-name { font-size: 15px; }

    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .variants { grid-template-columns: 1fr; }

    .detail { width: calc(100vw - 8px); }
    .detail-card { max-height: calc(100dvh - 8px); }
    .detail-hero { height: 180px; }
    .detail-hero.top { height: min(50vh, 340px); }
    .detail-hero-text { left: 14px; right: 56px; bottom: 12px; }
    .detail-body { padding: 16px 14px 22px; }
    .detail-close { top: 8px; right: 8px; }
    .view-switch { top: 8px; left: 8px; }

    /* A phone reads the figures as a card a mode, not a table to drag. */
    .table-wrap { overflow: visible; }
    table.fit { min-width: 0; }
    table.fit thead { display: none; }
    table.fit tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px 12px;
        padding: 10px;
        border-bottom: 1px solid var(--white-10);
    }
    table.fit tbody tr:last-child { border-bottom: 0; }
    table.fit tbody td { display: block; border: 0; padding: 0; white-space: normal; font-size: 13px; }
    table.fit td.fit-mode { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; }
    table.fit tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 9.5px;
        letter-spacing: .07em;
        text-transform: uppercase;
        color: rgba(204, 204, 204, .55);
        margin-bottom: 1px;
    }
    table.fit td.fit-mode::before { display: none; }
}

@media (max-width: 420px) {
    .grid { grid-template-columns: 1fr; }
    .app-links { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
