:root {
    --bg-dark: #090a10;
    --card-bg: #12131d;
    --card-hover-bg: #161824;
    --border-color: #222538;
    --border-highlight: #333852;
    --accent-green: #39ff14;
    --accent-green-dim: rgba(57, 255, 20, 0.15);
    --accent-purple: #bc13fe;
    --accent-purple-dim: rgba(188, 19, 254, 0.15);
    --accent-cyan: #00f3ff;
    --text-main: #f4f4f8;
    --text-muted: #9c9cb8;
    --font-arcade: 'Press Start 2P', cursive;
    --font-body: 'Comfortaa', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --footer-theme: #bc13fe;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- RETRO CYBERPUNK BACKGROUND GRID --- */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(188, 19, 254, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 255, 20, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    z-index: -1;
    pointer-events: none;
}

/* --- ARCADE HEADER --- */
.arcade-header {
    text-align: center;
    padding: 36px 20px 28px;
    border-bottom: 2px solid rgba(188, 19, 254, 0.35);
    box-shadow: 0 10px 30px -15px rgba(188, 19, 254, 0.2);
    width: 100%;
    max-width: 960px;
    margin-bottom: 36px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Clean, standard Back Button matching the project design system */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 22px;
}

.back-link svg {
    transition: transform 0.2s ease;
}

.back-link:hover {
    color: #ffffff;
    border-color: var(--accent-green);
    background: rgba(57, 255, 20, 0.08);
    box-shadow: 0 0 14px rgba(57, 255, 20, 0.25);
    transform: translateX(-3px);
}

.back-link:hover svg {
    transform: translateX(-2px);
}

/* Hero Brand & Arcade Logo */
.hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.arcade-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(4px 4px 0px var(--accent-purple)) drop-shadow(0 0 14px rgba(57, 255, 20, 0.45));
    animation: arcadePulse 2.8s ease-in-out infinite alternate;
}

@keyframes arcadePulse {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-4px) scale(1.03);
    }
}

.arcade-hero-icon {
    display: block;
}

.hero-title {
    font-family: var(--font-arcade);
    color: var(--accent-green);
    text-shadow: 4px 4px 0px var(--accent-purple), 0 0 24px rgba(57, 255, 20, 0.4);
    font-size: clamp(1.8rem, 5.5vw, 2.7rem);
    margin: 0;
    line-height: 1.2;
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

/* --- GAMES CONTAINER --- */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 28px;
    width: 92%;
    max-width: 1020px;
    padding-bottom: 56px;
    flex: 1 0 auto;
}

/* --- GAME CARDS --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border, var(--accent-green));
    box-shadow: 0 0 22px var(--card-hover-glow, rgba(57, 255, 20, 0.28)), 0 12px 30px rgba(0, 0, 0, 0.6);
}

.card-preview {
    height: 155px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
    overflow: hidden;
}

/* Scanline texture over preview */
.card-preview::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.65;
}

.card-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-family: var(--font-arcade);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.badge {
    color: #0b0d13; 
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-family: var(--font-arcade);
    font-weight: 700;
    vertical-align: middle;
    text-shadow: none;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* User requested Comfortaa font for description */
.card-desc {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 18px;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.card-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-arcade);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.card:hover .card-action-pill {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.08);
}

.card-action-arrow {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.card:hover .card-action-arrow {
    transform: translateX(3px);
}

/* --- TOAST NOTIFICATION --- */
.arcade-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #141522;
    border: 1px solid var(--accent-purple);
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.4), 0 10px 25px rgba(0, 0, 0, 0.8);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 9999px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.arcade-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 600px) {
    .arcade-header {
        padding: 28px 16px 22px;
        margin-bottom: 24px;
    }

    .hero-brand {
        gap: 12px;
    }

    .arcade-hero-icon {
        width: 38px;
        height: 38px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.86rem;
    }

    .container {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 94%;
        padding-bottom: 40px;
    }

    .card-preview {
        height: 140px;
        font-size: 2.8rem;
    }

    .card-content {
        padding: 18px;
    }
}

/* Universal Mobile Anti-Zoom & Touch Safeguards */
html, body {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

input, select, textarea, button, a {
    touch-action: manipulation;
}

@media screen and (max-width: 850px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}



