.intro-text {
    text-align: center;
    margin: 20px auto 0px;
    max-width: 800px;
    font-size: 18px;
    color: #ccc;
}

.features-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-list li {
    display: flex;
    flex-direction: column;
    background-color: #2c2c3a;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 2px solid #4c3a62;
    height: 100%;
}

.feature-list li:nth-child(odd) {
    flex-direction: column;
}

.feature-list li:nth-child(even) {
    flex-direction: column;
}

.feature-list li:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: #a68ab7;
}

.feature-list li a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Handle div positioning for both internal (inside a) and external (direct child) links */
.feature-list li > div,
.feature-list li a > div {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.feature-list li img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 2px solid #4c3a62;
}

.feature-list li:hover img {
    border-bottom-color: #a68ab7;
}

.feature-list li h3 {
    font-size: 18px;
    color: #d6b3ff;
    margin: 0;
}

.feature-list li p {
    font-size: 14px;
    color: #bbb;
    line-height: 1.4;
    flex-grow: 1;
    margin: 0;
}

.feature-list li .feature-btn {
    display: inline-block;
    align-self: flex-start;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background-color: #4c3a62;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.feature-list li .feature-btn:hover {
    background-color: #a68ab7;
}

.feature-list li .tags {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    width: 100%;
    margin: 0 0 8px 0;
}

.feature-list li .tags::-webkit-scrollbar {
    height: 4px;
}

.feature-list li .tags::-webkit-scrollbar-thumb {
    background: #4c3a62;
    border-radius: 2px;
}

.feature-list li .tags::-webkit-scrollbar-track {
    background: #2c2c3a;
}

.feature-list li .tags .tag {
    display: inline-block;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    flex: 0 0 auto;
    background-color: #4d4d4d;
    color: #fff;
}

.feature-list li .tags .tag-engine {
    background-color: #4c3a62;
}

.feature-list li .tags .tag-lang {
    background-color: #3a647a;
}

/* Retro theme styling */
body.retro-theme .intro-text {
    color: #333344;
}

body.retro-theme .feature-list li {
    background-color: #f5deb3;
    border-color: #d4a574;
    box-shadow: 0 8px 12px rgba(212, 165, 116, 0.2);
    color: #333344;
}

body.retro-theme .feature-list li:hover {
    background-color: #f3eac2;
    border-color: #d4881e;
}

body.retro-theme .feature-list li img {
    border-bottom-color: #d4a574;
}

body.retro-theme .feature-list li:hover img {
    border-bottom-color: #d4881e;
}

body.retro-theme .feature-list li h3 {
    color: #d4881e;
}

body.retro-theme .feature-list li p {
    color: #333344;
}

body.retro-theme .feature-list li .feature-btn {
    background-color: #d4881e;
    color: #fff;
}

body.retro-theme .feature-list li .feature-btn:hover {
    background-color: #e89b3c;
}

body.retro-theme .feature-list li .tags .tag {
    background-color: #d4a574;
    color: #333344;
}

body.retro-theme .feature-list li .tags .tag-engine,
body.retro-theme .feature-list li .tags .tag-lang {
    background-color: #c4964d;
    color: #fff;
}

@media (max-width: 768px) {
    .features-section {
        padding: 15px;
    }

    .feature-list {
        gap: 12px;
    }

    .feature-list li {
        flex-direction: column;
    }

    .feature-list li img {
        height: 140px;
    }

    .feature-list li h3 {
        font-size: 16px;
        margin: 0;
    }

    .feature-list li p {
        font-size: 13px;
    }

    .feature-list li .feature-btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .feature-list li .tags .tag {
        font-size: 12px;
        padding: 4px 10px;
    }
}