/* Download page — Modrinth-style layout on top of the rankings theme */

.mr-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.25rem;
    align-items: start;
}

.mr-main {
    min-width: 0;
}

.mr-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.mr-card h2 {
    font-size: 1.15rem;
    margin: 1.25rem 0 0.5rem 0;
}

.mr-card h2:first-child {
    margin-top: 0;
}

.mr-card h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
}

.mr-card p,
.mr-card li {
    color: var(--text-secondary);
}

.mr-card ul,
.mr-card ol {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.mr-card li {
    margin-bottom: 0.35rem;
}

.mr-card code {
    background: rgba(255, 255, 255, 0.07);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--text-primary);
}

/* Title header */
.mr-title-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.mr-icon {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    flex-shrink: 0;
}

.mr-title-text {
    flex: 1;
    min-width: 0;
}

.mr-title-text h1 {
    margin: 0;
    font-size: 1.5rem;
}

.mr-title-text p {
    margin: 0.35rem 0 0.6rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.mr-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mr-cat {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 0.15rem 0.6rem;
}

.mr-title-actions {
    flex-shrink: 0;
    position: relative;
}

.mr-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1ebd59;
    color: #04120a;
    font-weight: 800;
    font-size: 1rem;
    font-family: inherit;
    text-decoration: none;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 10px;
    transition: background 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.mr-download-btn:hover {
    background: #25e06c;
}

/* Download picker (game version + platform) */
.mr-picker {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(520px, 80vw);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    z-index: 50;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.mr-picker-title {
    margin: 0 0 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.mr-picker-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.mr-picker select,
.mr-vfilters select {
    appearance: none;
    background-color: var(--bg-tertiary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 2rem 0.6rem 0.9rem;
    cursor: pointer;
    width: 100%;
}

.mr-picker select:disabled,
.mr-vfilters select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mr-pick-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.mr-pick-info {
    min-width: 0;
}

.mr-pick-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mr-pick-name {
    color: var(--text-primary);
    font-weight: 700;
}

.mr-pick-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.mr-pick-dl {
    font-size: 0.9rem;
    padding: 0.55rem 1.2rem;
}

.mr-chan-badge {
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
}

.mr-chan-badge.release {
    background: rgba(30, 189, 89, 0.18);
    color: #4ade80;
}

.mr-chan-badge.beta {
    background: rgba(217, 119, 6, 0.18);
    color: #fbbf24;
}

/* Tabs */
.mr-tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
}

.mr-tab {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mr-tab:hover {
    color: var(--text-primary);
}

.mr-tab.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Versions table */
.mr-vfilters {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
    max-width: 480px;
}

.mr-vtable-wrap {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow-x: auto;
}

.mr-vtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.mr-vtable thead th {
    text-align: left;
    color: var(--text-primary);
    font-weight: 700;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.mr-vtable thead th:first-child {
    padding-left: 1.25rem;
}

.mr-vtable thead th:last-child {
    padding-right: 1.25rem;
}

.mr-vtable tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
    vertical-align: middle;
}

.mr-vtable tbody tr:last-child td {
    border-bottom: none;
}

.mr-vtable tbody td:first-child {
    padding-left: 1.25rem;
}

.mr-vtable tbody td:last-child {
    padding-right: 1.25rem;
    text-align: right;
}

.mr-chan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.mr-chan.release {
    background: rgba(30, 189, 89, 0.18);
    color: #4ade80;
}

.mr-chan.beta {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

.mr-vname {
    color: var(--text-primary);
    font-weight: 600;
}

.mr-pill {
    display: inline-block;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.mr-vnum {
    color: var(--text-secondary);
}

.mr-row-dl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    color: #4ade80;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.mr-row-dl:hover {
    background: rgba(30, 189, 89, 0.15);
}

.mr-vempty {
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem;
}

/* Changelog entries */
.mr-log {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.mr-log h3 {
    margin: 0;
    font-size: 1.05rem;
}

.mr-log-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.2rem 0 0.6rem 0;
}

.mr-log ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.mr-log li {
    margin-bottom: 0.25rem;
}

/* Sidebar */
.mr-side {
    min-width: 0;
}

.mr-side-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0.9rem 0 0.4rem 0;
}

.mr-side-label:first-of-type {
    margin-top: 0;
}

.mr-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.mr-chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    text-transform: capitalize;
}

.mr-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mr-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.mr-links a:hover {
    color: var(--text-primary);
}

.mr-links a::before {
    content: "↗ ";
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .mr-wrap {
        grid-template-columns: 1fr;
    }

    .mr-title-card {
        flex-direction: column;
    }
}
