@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

body {
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 1.4rem;
    line-height: 1.6;
    background: #000;
    color: #0f0;
    margin: 0;
}

/* Base fallback styles */
header, main, footer { 
    padding: 2rem; 
    text-align: center; 
}
h1 { font-size: 4rem; margin: 0.5em 0; }
h2 { font-size: 2.5rem; margin: 2em 0 1em; }
img { max-width: 100%; height: auto; }
a { color: #0f0; }

/* Fancy retro styles (only apply if CSS is supported) */
@supports (background: linear-gradient(#000,#000)) {
    body {
        background: #000 fixed url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><rect width="10" height="10" fill="%23000"/><rect x="0" y="0" width="5" height="5" fill="%23001500"/></svg>');
    }

    header {
        background: linear-gradient(135deg, #001a00, #003300);
        padding: 6rem 2rem 4rem;
        border-bottom: 8px double #0f0;
        box-shadow: 0 0 40px #0f0 inset;
    }
    header img { image-rendering: pixelated; }

    nav ul {
        list-style: none;
        padding: 1rem;
        background: rgba(0,40,0,0.9);
        display: flex;
        justify-content: center;
        gap: 3rem;
        flex-wrap: wrap;
        margin: 0;
        font-size: 1.5rem;
    }
    nav a {
        text-decoration: none;
        padding: 0.5rem 1rem;
    }
    nav a:hover {
        border-bottom: 3px solid #0f0;
    }

    img[alt*="Macintosh"] {
        width: 220px;
        height: 258px;
        max-width: 90vw;
        border: 6px solid #0f0;
        box-shadow: 0 0 30px #0f0;
        image-rendering: pixelated;
        display: block;
        margin: 2rem auto;
    }

    dl {
        display: grid;
        grid-template-columns: max-content auto;
        gap: 0.8rem 2rem;
        max-width: 600px;
        margin: 3rem auto;
        text-align: left;
    }
    dt { font-weight: bold; }
    dd { margin: 0; color: #0f8; }

    .btn-primary, .btn-secondary {
        display: inline-block;
        padding: 1rem 2.5rem;
        margin: 1rem;
        font-size: 1.7rem;
        text-transform: uppercase;
        text-decoration: none;
        border: 4px solid #0f0;
        background: #000;
        color: #0f0;
        box-shadow: 0 0 20px #0f0;
        transition: all 0.3s;
    }
    .btn-primary:hover, .btn-secondary:hover {
        background: #0f0;
        color: #000;
        box-shadow: 0 0 40px #0f0;
    }
    .btn-secondary { background: transparent; }

    footer {
        background: #001100;
        padding: 3rem;
        border-top: 4px double #0f0;
        margin-top: 4rem;
    }
}

/* Mobile adjustments */
@media (max-width: 640px) {
    h1 { font-size: 3rem; }
    img[alt*="Macintosh"] { 
        width: 300px; 
        height: 225px; 
    }
}

/* Platforms grid – modern, responsive, cow-approved */
.platforms-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 2rem;
    padding: 2rem 1rem;
    justify-content: center;
    margin: 3rem auto;
    max-width: 90%;
    padding-bottom: 4rem;
}

.platforms-table a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border: 2px solid #0f0;
    box-shadow: 0 0 12px #0f0;
    background: rgba(0,20,0,0.3);
    text-decoration: none;
    transition: all .25s;
    height: 100%;
    box-sizing: border-box;
}

.platforms-table a:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 25px #0f0;
    border-color: #0f8;
}

.img-platform {
    max-width: 100px;
    height: auto;
    image-rendering: pixelated;
}

.platforms-table .notranslate {
    color: #0f0;
    font-weight: bold;
    text-align: center;
    word-wrap: break-word;
}

/* Shared components */
.ad-space {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(0,30,0,0.5);
    margin: 3rem 0;
    border-top: 4px double #0f0;
    border-bottom: 4px double #0f0;
}

.contact-list {
    list-style: none;
    text-align: center;
    font-size: 1.6rem;
    margin: 3rem 0;
    padding: 0;
}

.contact-list li { margin: 2rem 0; }
.contact-list a {
    color: #0f0;
    text-decoration: underline;
    font-weight: bold;
}
.contact-list a:hover { color: #fff; }

.pagination-box {
    font-size: 1.5rem;
    text-align: center;
    margin: 2rem 0;
}
.pagination-box a, .pagination-box span { margin: 0 0.5rem; color: #0f0; text-decoration: none; }
.pagination-box a:hover { text-decoration: underline; }
.pagination-box .current { color: #fff; font-weight: bold; }
.pagination-box .dots { color: #0a0; }

.platform-preview {
    max-width: 90%;
    max-height: 400px;
    margin: 2rem auto;
    display: block;
    image-rendering: pixelated;
    border: 4px solid #0f0;
    box-shadow: 0 0 30px #0f0;
}

.cow-message {
    font-size: 1.5rem;
    color: #0f0;
    text-align: center;
    margin: 3rem 0;
    font-weight: bold;
    text-shadow: 0 0 15px #0f0;
}

.letter-header {
    text-align: center;
    font-size: 3rem;
    margin: 4rem 0 2rem;
    color: #0f0;
    text-shadow: 0 0 20px #0f0;
}

/* Games tables */
.games-list, .search-results, .repair-explorer, .games-table-container {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.games-list { text-align: left; font-size: 1.3rem; }
.games-list h2 {
    font-size: 2.2rem;
    text-align: center;
    margin: 3rem 0 1.5rem;
    text-shadow: 0 0 15px #0f0;
}
.games-list p {
    margin: 0.8rem 0;
    padding: 0.6rem 1rem;
    background: rgba(0,30,0,0.4);
    border-left: 4px solid #0f0;
}
.games-list a { color: #0f0; font-weight: bold; text-decoration: underline; }
.games-list a:hover { color: #fff; text-shadow: 0 0 10px #0f0; }

.games-table, .search-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(0,30,0,0.4);
    box-shadow: 0 0 20px #0f0;
}

.games-table th, .search-table th {
    background: rgba(0,50,0,0.8);
    padding: 1rem;
    color: #0f0;
    font-size: 1.4rem;
    text-shadow: 0 0 10px #0f0;
}

.games-table td, .search-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #030;
}

.games-table tr:hover, .search-table tr:hover {
    background: rgba(0,80,0,0.3);
    box-shadow: 0 0 15px #0f0;
}

.game-name, .platform-col, .game-col {
    color: #0f0;
    font-family: monospace;
    font-weight: bold;
}

.download-cell a, .download-col a {
    background: #0f0;
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.download-cell a:hover, .download-col a:hover {
    background: #fff;
    box-shadow: 0 0 20px #0f0;
}

.size-cell { text-align: right; color: #0a0; font-family: monospace; }

.pagination {
    text-align: center;
    margin: 3rem 0;
}
.pagination a, .pagination .current, .pagination .dots {
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #0f0;
    display: inline-block;
}
.pagination .current { background: #0f0; color: #000; }
.page-info { margin-top: 1rem; color: #0a0; font-style: italic; }

/* Repair explorer */
.repair-item {
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(0,30,0,0.4);
    border: 2px solid #0f0;
    box-shadow: 0 0 15px #0f0;
    display: block;
    font-size: 1.4rem;
    transition: all .25s;
}
.repair-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px #0f0;
    background: rgba(0,50,0,0.6);
}
.repair-item.folder a { color: #0f8; font-weight: bold; }
.repair-item.file a { color: #0f0; }
.repair-item.parent a { color: #0a0; font-style: italic; }
.repair-item .size { float: right; color: #0a0; font-family: monospace; }

.breadcrumb {
    font-size: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(0,20,0,0.5);
    border: 2px solid #0f0;
    box-shadow: 0 0 20px #0f0;
    word-wrap: break-word;
}

/* Special elements */
.notranslate { translate: none !important; }

.nav-repair {
    background: rgba(0, 50, 0, 0.8) !important;
    color: #0f0 !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    padding: 0.8rem 1.6rem !important;
    border: 2px solid #0f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 0 20px #0f0 !important;
    text-transform: none !important;
    letter-spacing: 1px;
    transition: all 0.35s ease;
    font-family: 'Courier New', monospace;
}
.nav-repair:hover {
    background: #0f0 !important;
    color: #000 !important;
    box-shadow: 0 0 50px #0f0, 0 0 80px #0f8 !important;
    transform: translateY(-4px) scale(1.05);
    font-weight: 900;
}
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 2.5rem;
    padding: 2rem;
    justify-content: center;
}

.category-switcher {
    margin: 4rem 0;
    padding: 1.5rem;
    background: rgba(0,40,0,0.6);
    border: 2px solid #0f0;
    border-radius: 12px;
    box-shadow: 0 0 25px #0f0;
    text-align: center;
    font-size: 1.4rem;
}

.cat-btn {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.8rem 1.4rem;
    background: rgba(0,255,0,0.1);
    color: #0f0;
    border: 2px solid #0f0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.cat-btn:hover { background: #0f0; color: #000; }
.cat-btn.active { background: #0f0; color: #000; box-shadow: 0 0 20px #0f0; }

/* FINAL — MAXIMUM ICON SIZE, PERFECT RESPONSIVE GRID */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(5, 220px);     /* 5 × 220px = 1100px → perfect on desktop */
    gap: 3rem;
    justify-content: center;
    padding: 3rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Mobile & tablet — 2 columns */
@media (max-width: 1024px) {
    .platforms-grid {
        grid-template-columns: repeat(2, 220px) !important;
        gap: 2.5rem;
    }
}

@media (max-width: 560px) {
    .platforms-grid {
        grid-template-columns: repeat(2, 180px) !important;
        gap: 2rem;
    }
}

/* Each item */
.platforms-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    width: 220px;
    transition: transform 0.35s ease;
}

.platforms-grid a:hover {
    transform: translateY(-15px) scale(1.06);
}

/* ICON — MAX SIZE, KEEPS ASPECT RATIO, NEVER DISTORTED */
.platforms-grid a img.img-platform {
    width: 200px;           /* max width */
    height: 200px;          /* max height */
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;    /* ← KEEPS ORIGINAL RATIO (137px height stays 137px) */
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 20px #0f0);
    transition: all 0.35s ease;
}

.platforms-grid a:hover img.img-platform {
    filter: drop-shadow(0 0 50px #0f0) brightness(1.4);
    transform: scale(1.1);
}

/* Text — big and bold */
.platforms-grid a span.notranslate {
    color: #0f0;
    font-weight: bold;
    font-size: 1.35rem;
    text-align: center;
    text-shadow: 0 0 15px #0f0;
    max-width: 220px;
    word-wrap: break-word;
}

.legal-notice {
    background: rgba(50, 0, 0, 0.7);
    border: 3px solid #0f0;
    border-radius: 16px;
    padding: 2.5rem;
    margin: 3rem 1rem;
    box-shadow: 0 0 40px #0f0, inset 0 0 30px rgba(0,255,0,0.1);
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.legal-notice h2 {
    color: #0ff;
    font-size: 2.2rem;
    text-shadow: 0 0 20px #0f0;
    text-align: center;
    margin-bottom: 1.5rem;
}

.legal-notice ul {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.legal-notice li {
    margin: 0.8rem 0;
}
