/* Roadmap page: the history timeline.
   Colours per game come from --accent (config/games.php). */

/* ---------- Intro ---------- */

.rm-intro .section-heading {
    margin-bottom: 32px;
}

.rm-title {
    font-family: var(--font-display);
    font-size: clamp(44px, 9vw, 92px);
    font-weight: normal;
    line-height: 1.05;
    letter-spacing: 2px;
    background: linear-gradient(100deg, var(--magenta), var(--purple) 45%, var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 30px rgba(154, 41, 255, 0.35));
}

.rm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 820px;
    margin: 0 auto;
}

.rm-stats div {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.rm-stats dt {
    font-family: var(--font-display);
    font-size: clamp(22px, 3.4vw, 32px);
    line-height: 1.2;
}

.rm-stats div:last-child dt {
    font-size: clamp(15px, 2vw, 19px);
    line-height: 1.9;
}

.rm-stats dd {
    color: var(--faint);
    font-size: 14px;
}

/* ---------- Covers ---------- */

.rm-cover {
    position: relative;
    display: grid;
    flex-shrink: 0;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #000), color-mix(in srgb, var(--accent) 20%, #000));
}

.rm-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rm-cover b {
    font-family: var(--font-display);
    font-weight: normal;
    font-size: 1.6em;
    color: #fff;
}

/* mobile games: the square icon centred on its colour */
.rm-cover--mobile img {
    width: 62%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 22%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.rm-cover--studio {
    background: linear-gradient(135deg, #2F0F4E, #12061F);
}

.rm-cover--studio img {
    width: 62%;
    height: auto;
    object-fit: contain;
}

/* ---------- History ---------- */

.rm-filters {
    position: sticky;
    top: calc(var(--header-h) + 8px);
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 36px;
    padding: 8px;
    background: rgba(18, 6, 31, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.rm-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rm-filter i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.rm-filter:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.rm-filter.is-active {
    background: color-mix(in srgb, var(--accent, var(--magenta)) 20%, transparent);
    border-color: var(--accent, var(--magenta));
    color: var(--text);
}

.rm-filter:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

/* a line down the middle; months sit on it, entries alternate left and right */
.rm-history {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
}

.rm-history::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(var(--purple), rgba(154, 41, 255, 0.5) 85%, transparent);
    transform: translateX(-50%);
}

.rm-month {
    position: relative;
    z-index: 1;
    width: fit-content;
    margin: 0 auto 24px;
    padding: 8px 18px;
    background: var(--bg-3);
    border: 1px solid rgba(154, 41, 255, 0.6);
    border-radius: 999px;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: normal;
    letter-spacing: 1px;
    box-shadow: 0 0 24px rgba(154, 41, 255, 0.35);
}

.rm-month span {
    color: var(--text);
}

.rm-timeline {
    display: grid;
    gap: 22px;
    margin-bottom: 40px;
    list-style: none;
}

.rm-entry {
    display: grid;
    grid-template-columns: 1fr 64px 1fr;
    align-items: center;
}

.rm-entry-day {
    position: relative;
    z-index: 1;
    display: grid;
    grid-column: 2;
    grid-row: 1;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    background: var(--bg);
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 14px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent);
}

.rm-entry-card {
    position: relative;
    display: flex;
    grid-column: 3;
    grid-row: 1;
    gap: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.rm-entry:nth-child(odd) .rm-entry-card {
    grid-column: 1;
}

.rm-entry-card:hover {
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    transform: translateY(-2px);
}

.rm-entry-cover {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    font-size: 16px;
}

.rm-entry-cover.rm-cover--mobile img {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
}

.rm-entry-body {
    min-width: 0;
}

.rm-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.rm-entry-meta time {
    color: var(--faint);
}

.rm-entry-game {
    color: color-mix(in srgb, var(--accent) 75%, #fff);
}

.rm-type {
    padding: 2px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rm-type--launch   { background: rgba(255, 62, 201, 0.18); color: #FF8BDE; }
.rm-type--update   { background: rgba(63, 208, 255, 0.16); color: #8BE3FF; }
.rm-type--announce { background: rgba(245, 197, 66, 0.16); color: #F7D57A; }
.rm-type--store    { background: rgba(120, 220, 140, 0.15); color: #9BE5A9; }
.rm-type--studio   { background: rgba(154, 41, 255, 0.2); color: #C79BFF; }
.rm-type--demo     { background: rgba(255, 140, 66, 0.16); color: #FFB27A; }
.rm-type--dev      { background: rgba(255, 255, 255, 0.1); color: #D6D6E6; }

.rm-entry-text {
    color: var(--text);
    line-height: 1.45;
}

.rm-entry-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--cyan);
    font-size: 14px;
    text-decoration: none;
}

.rm-entry-link:hover {
    text-decoration: underline;
}

.rm-timeline[hidden],
.rm-month[hidden],
.rm-entry[hidden] {
    display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
    .rm-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* the line runs down the left */
    .rm-history::before {
        left: 22px;
    }

    .rm-month {
        margin-left: 0;
    }

    .rm-entry {
        grid-template-columns: 44px 1fr;
        gap: 12px;
        align-items: start;
    }

    .rm-entry-day {
        grid-column: 1;
        margin-top: 14px;
    }

    .rm-entry-card,
    .rm-entry:nth-child(odd) .rm-entry-card {
        grid-column: 2;
        flex-direction: column;
        gap: 10px;
    }

    .rm-entry-cover {
        width: 44px;
        height: 44px;
        border-radius: 11px;
    }

    .rm-filters {
        border-radius: 18px;
    }
}
